Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import DDI dataset with Term of Use #8715

Closed
lubitchv opened this issue May 18, 2022 · 3 comments · Fixed by #8743
Closed

Import DDI dataset with Term of Use #8715

lubitchv opened this issue May 18, 2022 · 3 comments · Fixed by #8743
Milestone

Comments

@lubitchv
Copy link
Contributor

It seems that importDDI API does not import terms of Use from XML.
Although there is a treatment for this section in ImportDDIServiceBean and it parses correctly input xml in processDataAccs,
dvDTO.setTermsOfUse(parseText(xmlr, "notes")) is not used, instead there is just parseText(xmlr, "notes"). Hence despite parsing the xml for terms of use, the terms never set.

What steps does it take to reproduce the issue?
Create import xml with
<dataAccs> <notes type="DVN:TOU" level="dv">Test</notes> </dataAccs>
in stdyDscr section.

curl -H X-Dataverse-key:$API_TOKEN -X POST http://localhost:8080/api/dataverses/:root/datasets/:importddi --upload-file test_term_of_use.xml

Example of such xml file is attached.

test_term_of_use.txt

@jggautier
Copy link
Contributor

jggautier commented May 26, 2022

Hey @lubitchv. I would think the same is true for the Terms of Access field. Would you happen to know? If you're not sure either I can test this and create a separate GitHub issue for it.

@lubitchv
Copy link
Contributor Author

In the code, Therms of Access field seems to be filled, it seems to be ok. It has

                if (NOTE_TYPE_TERMS_OF_ACCESS.equalsIgnoreCase(noteType) ) {
                    if (LEVEL_DV.equalsIgnoreCase(xmlr.getAttributeValue(null, "level"))) {
                        dvDTO.setTermsOfAccess(parseText(xmlr, "notes"));
                    }
                } 

so it should work, unlike term of use that was:

                if (NOTE_TYPE_TERMS_OF_USE.equalsIgnoreCase(noteType) ) {
                   if ( LEVEL_DV.equalsIgnoreCase(xmlr.getAttributeValue(null, "level"))) {
                        parseText(xmlr, "notes");
                    }
               }

@jggautier
Copy link
Contributor

Ah great! Thanks!

@pdurbin pdurbin added this to the 5.12 milestone Sep 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants