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

Support for configurable list of licenses #7920

Merged
merged 228 commits into from
Feb 2, 2022
Merged
Show file tree
Hide file tree
Changes from 106 commits
Commits
Show all changes
228 commits
Select commit Hold shift + click to select a range
bc34031
First db table and api.
JingMa87 Mar 16, 2021
5d08b0e
Final changes for prototype.
JingMa87 Mar 16, 2021
f9e3a3e
Add integration tests.
JingMa87 Mar 18, 2021
5e3fb88
Fix indentation.
JingMa87 Mar 22, 2021
0394652
Add prototype of newest changes.
JingMa87 Mar 24, 2021
cb58637
Add URI and URL objects, and new endpoints.
JingMa87 Mar 25, 2021
dda1335
Add Apache icons.
JingMa87 Mar 30, 2021
c87c367
Change tokens to licenses.
JingMa87 Mar 31, 2021
67b7471
Change URIException to IllegalStateException.
JingMa87 Mar 31, 2021
4b6c367
DD-387 Add license entity and api (#57)
JingMa87 Mar 31, 2021
784fdb0
Handle POST request HTTP 409 conflict error and introduce bug fixes.
JingMa87 Mar 31, 2021
8a9974d
Change location to correct URL.
JingMa87 Apr 1, 2021
67178c9
Handle wrong JSON.
JingMa87 Apr 9, 2021
c9d33e2
Handle posting same JSON twice.
JingMa87 Apr 9, 2021
f6c99eb
Reformat tabs.
JingMa87 Apr 9, 2021
878ef6f
Merged back develop
janvanmansum Apr 14, 2021
5bb0142
Merge pull request #70 from janvanmansum/MERGE_BACK_DEVELOP_IN_MULTI_LIC
janvanmansum Apr 14, 2021
855f8a0
Merge pull request #62 from JingMa87/dd-421-wrong-location-header
PaulBoon Apr 21, 2021
41887c5
Merge pull request #67 from JingMa87/DD-424-post-wrong-json
PaulBoon Apr 21, 2021
d3da68b
Merged back develop
janvanmansum Apr 23, 2021
60292bb
Merge branch 'multi-license' into DD-425-missing-error-messages
janvanmansum Apr 23, 2021
5cee794
Merge pull request #66 from JingMa87/DD-425-missing-error-messages
janvanmansum Apr 23, 2021
49f5d0a
Merge branch 'multi-license' into DD-422-posting-same-license-error
JingMa87 Apr 24, 2021
0cf7359
added license info to publish dataset popup dialog
Apr 28, 2021
245f04c
Revert "added license info to publish dataset popup dialog"
Apr 28, 2021
6219010
added license info to publish dataset dialog
Apr 28, 2021
5280a50
Merge remote-tracking branch 'blessed/multi-license' into dd-446-add-…
Apr 28, 2021
f670d73
Merge pull request #61 from JingMa87/DD-422-posting-same-license-error
PaulBoon Apr 28, 2021
13ec753
added extra values to Bundle.properties
Apr 28, 2021
0273c0f
Merge pull request #72 from mderuijter/dd-446-add-license-info-to-pub…
PaulBoon Apr 29, 2021
83b21f0
DD-420 multi license UI (#73)
JingMa87 May 26, 2021
71f6be2
Merged back develop
janvanmansum May 26, 2021
55bd5a1
retrieve active licenses only for dropdown list
May 31, 2021
8f1969c
Merge pull request #78 from mderuijter/filter-inactive-licenses-from-…
janvanmansum Jun 1, 2021
ec4fd30
added function to make sure custom fields are null when saving standa…
Jun 1, 2021
336359d
Merge pull request #80 from mderuijter/dd-484-empty-custom-license-on…
janvanmansum Jun 3, 2021
7dbd78d
Merge branch 'develop' into multi-license
janvanmansum Jun 3, 2021
e28e4e0
refreshes to propper logo&url on item select
Jun 7, 2021
832e4f6
refactored render statement
Jun 7, 2021
b1fb21f
Merge pull request #81 from mderuijter/dd-485-update-license-logo-and…
PaulBoon Jun 8, 2021
74cd21b
Create V5.5.0.3__7440-multi-license-add-column-to-termsofuseandaccess…
Jun 8, 2021
9ad49e8
newline at end of file
Jun 8, 2021
7d5c0d1
WIP
janvanmansum Jun 9, 2021
7676ab5
Reverted attempt to move uniqueness check to database
janvanmansum Jun 9, 2021
8915c06
Started with docs
janvanmansum Jun 11, 2021
17616c4
Docs in progress
janvanmansum Jun 12, 2021
918c86f
Tabs -> spaces
janvanmansum Jun 12, 2021
8cc996a
Documented management API
janvanmansum Jun 12, 2021
ec37254
Merge pull request #85 from janvanmansum/CLEANUP_LICENSE_API
janvanmansum Jun 12, 2021
2ecba09
Removed shortDescription from integration test files.
janvanmansum Jun 12, 2021
58b623e
Merge pull request #82 from mderuijter/dd-486-termsofuseandaccess-fly…
janvanmansum Jun 16, 2021
5b68e53
DD-511 Open links to license in new tab
janvanmansum Jun 17, 2021
a980c5e
Merge pull request #90 from janvanmansum/multi-license
janvanmansum Jun 18, 2021
c34bd3e
DD-513. Added database setting :AllowCustomTerms (#91)
janvanmansum Jun 18, 2021
6313887
DD-513 Added docs for new setting.
janvanmansum Jun 18, 2021
5c72dca
Replaced redundant (and incomplete) uniqueness check with try-cath ar…
janvanmansum Jun 19, 2021
9895ddd
Merge pull request #92 from janvanmansum/REFACTOR_LICENSE_UNIQUENESS
janvanmansum Jun 19, 2021
1b8765e
Removed remaining references to shortDescription property + renamed f…
janvanmansum Jun 19, 2021
d9e61a5
WIP
janvanmansum Jun 19, 2021
e45b74c
Merge pull request #93 from janvanmansum/ADD_CC0_VIA_FLYWAY
janvanmansum Jun 19, 2021
1a9fe2e
DD-515. Don't allow a referenced license to be deleted through the co…
janvanmansum Jun 21, 2021
6516186
DD-521 Default license (#95)
janvanmansum Jun 28, 2021
2497228
Merged back develop
janvanmansum Jun 30, 2021
1e1e0f6
Renumbered flyway script to avoid conflict with other flyway script
janvanmansum Jun 30, 2021
6840329
added license shortDescription, and UI shortDescription to publish di…
mderuijter Jun 30, 2021
fab2f99
DD-527 Restructure license and custom terms in dataset JSON (#97)
mderuijter Jul 8, 2021
20e4360
DD-526 create url for custom terms (#99)
mderuijter Jul 8, 2021
0dc8e80
added EditMode check to setLicense
Jul 9, 2021
0a187ee
updated flyway script
Jul 13, 2021
5b952b1
Merge pull request #100 from mderuijter/dd-548-defaults-to-custom-bugfix
janvanmansum Jul 14, 2021
d425ec7
Merge pull request #102 from mderuijter/dd-522-update-termsofuseandac…
janvanmansum Jul 14, 2021
4c12a7e
changed bundle property file.dataFilesTab.terms.list.termsOfUse.waive…
Jul 14, 2021
c2e7375
Merge pull request #104 from mderuijter/dd-533-improve-ui-text-licens…
janvanmansum Jul 14, 2021
fd21968
DD-526 create url for custom terms (#103)
mderuijter Jul 14, 2021
4518fd6
DD-525 add short description (#101)
mderuijter Jul 14, 2021
19f3eac
Merge back develop (#105)
janvanmansum Jul 14, 2021
7df29a1
DD-528 Adapt metadata export to show new license info (#106)
mderuijter Jul 24, 2021
f8270de
DD-553 Default licenses can be deleted (#107)
mderuijter Jul 24, 2021
6cc86e0
Resolved merge conflicts
janvanmansum Jul 24, 2021
352e6b4
Renumbered flyway scripts + removed duplicate
janvanmansum Jul 24, 2021
a5e0125
Updated example config
janvanmansum Jul 24, 2021
046df42
Decrease diff
janvanmansum Jul 24, 2021
f93e45f
Decrease diff
janvanmansum Jul 24, 2021
56c12c4
Decrease diff
janvanmansum Jul 24, 2021
924e166
Decrease diff
janvanmansum Jul 24, 2021
e499435
Updated example files in scripts/api/data
janvanmansum Jul 24, 2021
417b875
Decreased import diffs
janvanmansum Jul 24, 2021
0dd15b0
Removed one ctor from ConflictException
janvanmansum Jul 24, 2021
46f675e
urlIcon element does not disploy if empty now
Jul 27, 2021
9223a3e
added api call GET /licenses/default
Jul 28, 2021
9f58548
removed termsofuseandacces.license column
Aug 16, 2021
31d7470
Merge pull request #112 from mderuijter/dd-562-implement-GET-api-admi…
janvanmansum Sep 10, 2021
925a1c3
DD-573 Implement set license in semantic api (#113)
mderuijter Sep 10, 2021
556be4a
Merge pull request #114 from mderuijter/dd-549-removed-termsofuseanda…
janvanmansum Sep 10, 2021
051f75d
Merge pull request #110 from mderuijter/dd-552-remove-reference-to-wa…
janvanmansum Sep 10, 2021
b001bf1
Merged back develop
janvanmansum Sep 10, 2021
47cabe1
Renum flyway script
janvanmansum Sep 10, 2021
60cb2ea
DD-561 Updated SwordServiceBean to support multi-license (#118)
mderuijter Sep 15, 2021
06c8574
DD-593 integration test fixes multi license (#116)
mderuijter Sep 15, 2021
9192f35
Merged back develop
janvanmansum Sep 15, 2021
6a708fc
Restored github unit test workflow
janvanmansum Sep 15, 2021
741f255
Merge branch 'develop' into multi-license
janvanmansum Sep 24, 2021
6ad3bc3
DD-529. Fixes in setting of TermsOfUseAndAccess properties in JSONLDU…
janvanmansum Oct 5, 2021
a421aba
Merge pull request #125 from janvanmansum/DD-529
janvanmansum Oct 6, 2021
5151b94
implementing change requests
Oct 6, 2021
896c02a
Merge remote-tracking branch 'blessed/multi-license' into multi-license
Oct 6, 2021
fae7475
implemented change requests
Oct 6, 2021
cea9c17
Merge remote-tracking branch 'upstream/develop' into dd-617-change-re…
Oct 6, 2021
e21ee3b
fix flyway numbering
qqmyers Oct 6, 2021
9840eb3
Merge branch 'develop' into multi-license
janvanmansum Oct 7, 2021
83e8dfe
Merge remote-tracking branch 'blessed/multi-license' into multi-license
janvanmansum Oct 7, 2021
1002e87
Merge remote-tracking branch 'blessed/multi-license' into dd-617-chan…
Oct 7, 2021
7cafa70
simplified multi-license code for OpenAIRE export
Oct 7, 2021
9cb9518
Merge pull request #127 from GlobalDataverseCommunityConsortium/multi…
janvanmansum Oct 8, 2021
ef2e276
Merge pull request #126 from mderuijter/dd-617-change-requests-multi-…
janvanmansum Oct 8, 2021
d2c61b3
Merged back develop
janvanmansum Oct 22, 2021
6159d19
DD-648 fix for allow custom terms (#130)
mderuijter Oct 26, 2021
91a5fab
update flyway numbering
qqmyers Oct 26, 2021
e55b12e
Merge pull request #132 from GlobalDataverseCommunityConsortium/multi…
janvanmansum Oct 27, 2021
4cbaa01
also need to handle new install where license column doesn't exist
qqmyers Oct 27, 2021
f5ee336
Merge pull request #133 from GlobalDataverseCommunityConsortium/multi…
janvanmansum Oct 28, 2021
a55304c
DD-647 fixed/refactored exception handling (#131)
mderuijter Oct 28, 2021
ff5fcaf
refactored code
Oct 28, 2021
97ff410
Merge pull request #134 from mderuijter/dd-681-refactoring-code
janvanmansum Oct 28, 2021
1c4ee43
DD-683 UI Change Requests Multi License (#135)
mderuijter Nov 2, 2021
f994923
Merged back develop
janvanmansum Nov 9, 2021
1d575bd
Resolved conflict
janvanmansum Nov 9, 2021
a79143e
Merge branch 'develop' into multi-license
janvanmansum Nov 15, 2021
b87e19a
Merge branch 'develop' into multi-license
janvanmansum Nov 22, 2021
c9bf631
rst formatting
janvanmansum Nov 22, 2021
150a393
Renumbered Flyway script
janvanmansum Nov 22, 2021
1a7def0
Initial attempt to make terms required with custom license
PaulBoon Nov 23, 2021
de506ee
Merge branch 'multi-license' of github.com:DANS-KNAW/dataverse into D…
PaulBoon Nov 23, 2021
19f9edf
Added validator to TermsOfUse
PaulBoon Nov 25, 2021
73e6fc8
Merge branch 'develop' into multi-license
janvanmansum Nov 29, 2021
1065610
Merge branch 'develop' into multi-license
janvanmansum Dec 5, 2021
727c997
Renumbered flyway script
janvanmansum Dec 5, 2021
76a12d1
Required termsOfUse, but form is not correctly updated
PaulBoon Dec 8, 2021
0618c14
Merge branch 'develop' into multi-license
janvanmansum Dec 12, 2021
1f81a45
Renumbered flyway script
janvanmansum Dec 12, 2021
9cf8e6d
Merge remote-tracking branch 'IQSS/develop' into PB/DD-696
qqmyers Dec 14, 2021
5045950
merge latest flyway numbering changes
qqmyers Dec 15, 2021
3d70aeb
cleanup/merge
qqmyers Dec 15, 2021
525add2
fix for DD-696
qqmyers Dec 15, 2021
a4eb99e
updating string names/values
qqmyers Dec 15, 2021
af8cba7
move license name/uri code
qqmyers Dec 15, 2021
dea8f13
add custom license URI to dataset
qqmyers Dec 15, 2021
2be06ef
custom link on dataset page
qqmyers Dec 16, 2021
0fc0124
Language tweak
qqmyers Dec 16, 2021
59c4b25
cleanup
qqmyers Dec 16, 2021
d04cfce
switch to using License objects directly in select menu
qqmyers Dec 16, 2021
019dd94
use param - set license directly on terms class
qqmyers Dec 16, 2021
2438185
get license selections from service, add caching, clear in terms
qqmyers Dec 16, 2021
e1be751
remove unused method
qqmyers Dec 16, 2021
3da511a
Update release notes and flyway to reflect all cases
qqmyers Dec 17, 2021
9c15773
Merge branch 'develop' into multi-license
janvanmansum Dec 20, 2021
c8b4ef7
Copied @qqmyers version of flyway script over latest one
janvanmansum Dec 20, 2021
a213ab4
Typos an layout
janvanmansum Dec 20, 2021
119eca8
Fix doc generation error
janvanmansum Dec 20, 2021
f838f74
Fix error response/tests
qqmyers Jan 3, 2022
5a582f3
Merge pull request #137 from GlobalDataverseCommunityConsortium/multi…
janvanmansum Jan 4, 2022
61e327e
Merge branch 'develop' into multi-license
janvanmansum Jan 4, 2022
0cfe058
Merge remote-tracking branch 'blessed/multi-license' into multi-license
janvanmansum Jan 4, 2022
529c5d0
remove obsolete tests
qqmyers Jan 5, 2022
1c50160
Merge pull request #138 from GlobalDataverseCommunityConsortium/multi…
janvanmansum Jan 5, 2022
9a4fa8d
Merge remote-tracking branch 'IQSS/develop' into DANS/multi-license
qqmyers Jan 5, 2022
b6c2d80
potential fix for the build error
qqmyers Jan 5, 2022
842f0a8
Merge pull request #139 from GlobalDataverseCommunityConsortium/multi…
janvanmansum Jan 5, 2022
4bbd51a
Merged back develop
janvanmansum Jan 6, 2022
b1880cb
Merge remote-tracking branch 'blessed/multi-license' into multi-license
janvanmansum Jan 6, 2022
dbdc031
Update doc/release-notes/7440-multilicense.md
janvanmansum Jan 7, 2022
e83e3d7
Update doc/release-notes/7440-multilicense.md
janvanmansum Jan 7, 2022
2ed5680
Update doc/release-notes/7440-multilicense.md
janvanmansum Jan 7, 2022
3d26262
update license api and tests
qqmyers Jan 10, 2022
c10530c
refactor to add license package
qqmyers Jan 10, 2022
b6d170b
fix/simplify refactor
qqmyers Jan 10, 2022
513c011
update docs
qqmyers Jan 11, 2022
2fac0e8
remove unused query
qqmyers Jan 11, 2022
02a04bd
add braces for ifs, fix text
qqmyers Jan 11, 2022
27a607f
use Bundle.properties term for license.custom
qqmyers Jan 11, 2022
a6687a0
print termsofuse when custom, simplify logic re: nulls
qqmyers Jan 11, 2022
663bde9
braces for if, reformat method
qqmyers Jan 11, 2022
a183b4a
add comments re: URI logic
qqmyers Jan 11, 2022
3e897e8
note compatibility issues
qqmyers Jan 11, 2022
632b71d
add isDefault key in license json output
qqmyers Jan 11, 2022
5ef1972
note UI enhancements to raise profile of license/terms
qqmyers Jan 11, 2022
dc08712
update datasetversion jsonld output and tests
qqmyers Jan 11, 2022
7bcfa0e
add suite of CC licenses for future installer use
qqmyers Jan 11, 2022
9131e96
update license name, use 'name' instead of 'label' in exports
qqmyers Jan 11, 2022
e8c9fc9
only print custom terms fields with no license
qqmyers Jan 11, 2022
5cf2bd4
restore termsofuse with no license inc. check for URL
qqmyers Jan 11, 2022
8f2624b
fix auto-change
qqmyers Jan 11, 2022
1e2e83b
reformat
qqmyers Jan 11, 2022
76a789b
typo/extra chars
qqmyers Jan 11, 2022
1c79279
Merge pull request #140 from GlobalDataverseCommunityConsortium/multi…
janvanmansum Jan 12, 2022
aee5d76
merged back develop
janvanmansum Jan 13, 2022
fb60c1f
fix json lincese object and typo
qqmyers Jan 13, 2022
5623537
fix respecting custom terms property
qqmyers Jan 13, 2022
7bdf6b6
typo
qqmyers Jan 14, 2022
5d1b8e1
fix logic re: when to show download dialog
qqmyers Jan 14, 2022
dad5fc8
unreachable code
qqmyers Jan 14, 2022
91fba7c
add terms to download popup
qqmyers Jan 14, 2022
eeab710
css for download popup
qqmyers Jan 14, 2022
0b667be
make showing tofa for restricted files context sensitive
qqmyers Jan 14, 2022
b097628
fix context mgmt for downloads
qqmyers Jan 14, 2022
3d71fc9
Merge remote-tracking branch 'IQSS/develop' into DANS/multi-license
qqmyers Jan 14, 2022
a85765d
Merge pull request #141 from GlobalDataverseCommunityConsortium/multi…
janvanmansum Jan 15, 2022
304371c
Solved NPE when datasetVersion.getTermsOfUseAndAccess().getTermsOfUse…
janvanmansum Jan 15, 2022
e4e9f0e
Merge branch 'develop' into multi-license
janvanmansum Jan 21, 2022
ec3965e
per review - text updates update formatting of pub dialog
qqmyers Jan 21, 2022
4175f4b
include info text and tweak spacing
qqmyers Jan 21, 2022
075d55b
tweak text
qqmyers Jan 21, 2022
d4ef070
align terms tab display (w/o link though)
qqmyers Jan 21, 2022
fb309dd
Merge remote-tracking branch 'DANS/multi-license' into DANS/multi-lic…
qqmyers Jan 21, 2022
860b08f
Merge pull request #142 from GlobalDataverseCommunityConsortium/multi…
janvanmansum Jan 24, 2022
4433533
fix NPE in DC export
qqmyers Jan 26, 2022
7a176a5
Merge remote-tracking branch 'DANS/multi-license' into DANS/multi-lic…
qqmyers Jan 26, 2022
9526963
Merge remote-tracking branch 'IQSS/develop' into DANS/multi-license
qqmyers Jan 26, 2022
4665ac7
fix formatting issue found in QA
qqmyers Jan 26, 2022
54bf74c
Merge pull request #143 from GlobalDataverseCommunityConsortium/DANS/…
janvanmansum Jan 27, 2022
7721ca9
format fixes
qqmyers Jan 27, 2022
55f7d0d
Merge branch 'develop' into multi-license
janvanmansum Jan 28, 2022
334bb48
Merge remote-tracking branch 'blessed/multi-license' into multi-license
janvanmansum Jan 28, 2022
20b3142
Merge pull request #144 from GlobalDataverseCommunityConsortium/multi…
janvanmansum Jan 28, 2022
667c1b0
per QA request - note can't roll back without db rollback
qqmyers Jan 28, 2022
148fbcd
curl example updates/fixes per QA
qqmyers Jan 28, 2022
fd8946c
per QA - fix issue with custom text showing with standard licenses
qqmyers Jan 28, 2022
e6d449a
Merge pull request #145 from GlobalDataverseCommunityConsortium/multi…
janvanmansum Jan 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/sphinx-guides/source/_static/api/add-license.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "CC-BY-4.0",
Copy link
Member

@pdurbin pdurbin Jan 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be "CC BY 4.0" (without the hyphens)? That's what it says at https://creativecommons.org/licenses/by/4.0/

Screen Shot 2022-01-06 at 11 59 21 AM

Update: I talked to @4tikhonov and he pointed me to https://spdx.org/licenses/ which leads me to believe that "name" should be "identifer" since "CC-BY-4.0" seems to be an identifier.

However, now I'm concerned that we're showing these machine-readable identifiers in the UI. If I saw "MIT-0" in the GUI below I wouldn't know what it means but "MIT No Attribution" is clear.

126765490-7d91ed79-65c5-411c-81d2-b6d1bdabe021

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the URL is really the primary identifier and the 'name' is intended for display rather than as a second less specific way to identify the license globally. So - I think I agree that the non-hyphenated versions make more sense and we can change those (unless someone else has a concern about that?).

(Note - since these are configured via API, installations that prefer some other user-visible label (or want to have them in another language, etc.), they can still do that. The interoperability is intended to be by URL - if that matches, it's the same license.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no objection to using a URL as a primary identifier but are our URLs aligned with SPDX, for example? It seems like not (CC-BY-4.0 example):

In short, if we're going to use URLs as identifiers it would be nice to see a canonical list of these URLs somewhere.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The URLs used now are what Creative Commons has assigned to their licenses. Their page metadata include attributes like about="http://creativecommons.org/licenses/by/4.0" for example. While SPDX has assigned alternate URLs, I don't think it would be best practice to not follow Creative Commons. Since licenses are configurable, installations could choose to do that if they wanted to though.

"uri": "http://creativecommons.org/licenses/by/4.0",
"shortDescription": "Creative Commons Attribution 4.0 International License.",
"iconUrl": "https://i.creativecommons.org/l/by/4.0/88x31.png",
"active": true
}
25 changes: 25 additions & 0 deletions doc/sphinx-guides/source/api/native-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3576,3 +3576,28 @@ Recursively applies the role assignments of the specified Dataverse collection,
GET http://$SERVER/api/admin/dataverse/{dataverse alias}/addRoleAssignmentsToChildren

Note: setting ``:InheritParentRoleAssignments`` will automatically trigger inheritance of the parent Dataverse collection's role assignments for a newly created Dataverse collection. Hence this API call is intended as a way to update existing child Dataverse collections or to update children after a change in role assignments has been made on a parent Dataverse collection.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a geneal comment about updates to the guides. We should probably update the "Terms" section in the User Guide from what's currently there: https://guides.dataverse.org/en/5.9/user/dataset-management.html#terms

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch - will do.


Manage Available Standard License Terms
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to move these outside "admin" so regular API users can learn what licenses are available.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense - for the get licenses call anyway. Probably good if API users can directly tell if custom licenses are allowed too. Is there a precedent for a split API like that where get is open and the change/delete functionality is restricted? (Looking at how to construct the URLs and where to place the code - I know there are some /api/admin/* calls not in the Admin class, but I don't know what best practice is.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should have a new top level /api/licenses. The main thing is to have it outside of /api/admin which is usually blocked in production. I did something similar with /api/pids.

That way, any API client could get a list of licenses even without authenticating. But only superusers would be able to add licenses.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View the list of standard license terms that can be selected for a dataset::

curl http://$SERVER/api/admin/licenses

View the details of the standard license with the database ID specified in ``$ID``::

export ID=1
curl http://$SERVER/api/admin/licenses/$ID

Add a new license by posting a JSON file adapted from this example :download:`add-license.json <../_static/api/add-license.json>`. The ``name`` and ``uri`` of the new license must be unique. ::

curl -X POST -H 'Content-Type: application/json' --data-binary @add-license.json http://$SERVER/api/admin/licenses

Overwrite the license with the database specified in ``$ID``::

curl -X PUT -H 'Content-Type: application/json' --data-binary @edit-license.json http://$SERVER/api/admin/licenses/$ID

Delete the license with with the database specified in ``$ID``::

curl -X DELETE http://$SERVER/api/admin/licenses/$ID
13 changes: 8 additions & 5 deletions doc/sphinx-guides/source/installation/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -680,8 +680,8 @@ When a user selects one of the available choices, the Dataverse user interfaces
Allowing the Language Used for Dataset Metadata to be Specified
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Since dataset metadata can only be entered in one language, and administrators may wish to limit which languages metadata can be entered in, Dataverse also offers a separate setting defining allowed metadata languages.
The presence of the :ref:`:MetadataLanguages` database setting identifies the available options (which can be different from those in the :Languages setting above, with fewer or more options).
Since dataset metadata can only be entered in one language, and administrators may wish to limit which languages metadata can be entered in, Dataverse also offers a separate setting defining allowed metadata languages.
The presence of the :ref:`:MetadataLanguages` database setting identifies the available options (which can be different from those in the :Languages setting above, with fewer or more options).
Dataverse collection admins can select from these options to indicate which language should be used for new Datasets created with that specific collection.

When creating or editing a dataset, users will be asked to enter the metadata in that language. The metadata language selected will also be shown when dataset metadata is viewed and will be included in metadata exports (as appropriate for each format) for published datasets:
Expand Down Expand Up @@ -2229,7 +2229,7 @@ See :ref:`i18n` for a curl example and related settings.
:MetadataLanguages
++++++++++++++++++

Sets which languages can be used when entering dataset metadata.
Sets which languages can be used when entering dataset metadata.

See :ref:`i18n` for further discussion, a curl example, and related settings.

Expand Down Expand Up @@ -2369,7 +2369,7 @@ Also refer to the "Datafile Integrity" API :ref:`datafile-integrity`

A boolean setting that, if true will send an email and notification to users when a Dataset is created. Messages go to those, other than the dataset creator,
who have the ability/permission necessary to publish the dataset. The intent of this functionality is to simplify tracking activity and planning to follow-up contact.

``curl -X PUT -d true http://localhost:8080/api/admin/settings/:SendNotificationOnDatasetCreation``

.. _:CVocConf:
Expand All @@ -2379,10 +2379,13 @@ A boolean setting that, if true will send an email and notification to users whe

A JSON-structured setting that configures Dataverse to associate specific metadatablock fields with external vocabulary services and specific vocabularies/sub-vocabularies managed by that service. More information about this capability is available at :doc:`/admin/metadatacustomization`.

Scripts that implement this association for specific service protocols are maintained at https://github.com/gdcc/dataverse-external-vocab-support. That repository also includes a json-schema for validating the structure required by this setting along with an example metadatablock and sample :CVocConf setting values associating entries in the example block with ORCID and SKOSMOS based services.
Scripts that implement this association for specific service protocols are maintained at https://github.com/gdcc/dataverse-external-vocab-support. That repository also includes a json-schema for validating the structure required by this setting along with an example metadatablock and sample :CVocConf setting values associating entries in the example block with ORCID and SKOSMOS based services.

``wget https://gdcc.github.io/dataverse-external-vocab-support/examples/config/cvoc-conf.json``

``curl -X PUT --upload-file cvoc-conf.json http://localhost:8080/api/admin/settings/:CVocConf``

:AllowCustomTerms
+++++++++++++++++

By default, custom terms of data use and access can be specified after selecting "Custom Terms" from the License/DUA dropdown on the Terms tab. When ``:AllowCustomTerms`` is set to ``false`` the "Custom Terms" item is not made available to the depositor.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -847,8 +847,8 @@
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<configuration>
<destfile>${basedir}/target/coverage-reports/jacoco-unit.exec</destfile>
<datafile>${basedir}/target/coverage-reports/jacoco-unit.exec</datafile>
<destFile>${basedir}/target/coverage-reports/jacoco-unit.exec</destFile>
<dataFile>${basedir}/target/coverage-reports/jacoco-unit.exec</dataFile>
</configuration>
<executions>
<execution>
Expand Down
7 changes: 7 additions & 0 deletions scripts/api/data/license.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "CC-BY-4.0",
"uri": "http://creativecommons.org/licenses/by/4.0",
"shortDescription": "Creative Commons Attribution 4.0 International License.",
"iconUrl": "https://i.creativecommons.org/l/by/4.0/88x31.png",
"active": false
}
8 changes: 8 additions & 0 deletions scripts/api/data/licenseError.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These three are used only for tests? Maybe they should go under /src/test/resources somewhere (suggestions anyone? in the json dir with datasets or a new licenses dir?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just adding it to the json dir in /src/test/resources with a descriptive name should be okay

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qqmyers on second thought the rest of the tests also use the scripts/api/data/ directory for the tests, it would make more sense to change that as a whole then for all Integration Tests? Changing the directory to /src/test/resources just for the license test wouldn't make a lot of sense I think

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scolapasta , @pdurbin - any guidance for where test data should go? It seems like existing test data is not all in one place, so I'm not sure what the recommendation would be for new test data.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under /src/test/resources sounds fine to me. You're right. Test data is a bit spread around. But at least it'll be in good company there. 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I think putting all the test data there makes sense too - (not sure if I commented on all the test files, but I wasn't trying to single this one out.)

"id": 6,
"name": "CC-BY-4.0",
"uri": "http://creativecommons.org/licenses/by/4.0",
"shortDescription": "Creative Commons Attribution 4.0 International License.",
"iconUrl": "https://i.creativecommons.org/l/by/4.0/88x31.png",
"active": true
}
7 changes: 7 additions & 0 deletions scripts/api/data/licenseUpdate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "CC-BY-4.0",
"uri": "http://creativecommons.org/licenses/by/4.0",
"shortDescription": "Creative Commons Attribution 4.0 International License.",
"iconUrl": "https://i.creativecommons.org/l/by/4.0/88x31.png",
"active": true
}
18 changes: 9 additions & 9 deletions src/main/java/edu/harvard/iq/dataverse/Dataset.java
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,15 @@ public void setVersions(List<DatasetVersion> versions) {
this.versions = versions;
}

private DatasetVersion createNewDatasetVersion(Template template, FileMetadata fmVarMet) {
private DatasetVersion createNewDatasetVersion(Template template, FileMetadata fmVarMet, License license) {
DatasetVersion dsv = new DatasetVersion();
dsv.setVersionState(DatasetVersion.VersionState.DRAFT);
dsv.setFileMetadatas(new ArrayList<>());
DatasetVersion latestVersion;

//if the latest version has values get them copied over
if (template != null) {
dsv.updateDefaultValuesFromTemplate(template);
dsv.updateDefaultValuesFromTemplate(template, license);
setVersions(new ArrayList());
} else {
latestVersion = getLatestVersionForCopy();
Expand All @@ -317,7 +317,7 @@ private DatasetVersion createNewDatasetVersion(Template template, FileMetadata f
} else {
TermsOfUseAndAccess terms = new TermsOfUseAndAccess();
terms.setDatasetVersion(dsv);
terms.setLicense(TermsOfUseAndAccess.License.CC0);
terms.setLicense(license);
dsv.setTermsOfUseAndAccess(terms);
}

Expand Down Expand Up @@ -373,18 +373,18 @@ private DatasetVersion createNewDatasetVersion(Template template, FileMetadata f
* @return The edit version {@code this}.
*/
public DatasetVersion getEditVersion() {
return getEditVersion(null, null);
return getEditVersion(null, null, null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does using null here (and in the following variations of this method) cause a draft auto-generated from an earlier version to revert to no license? Could/should they inherit the license of the latest version instead? Are there any cases where you really want to send null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure where this particular code is invoked, but when testing through the UI I can see that a new version inherits the license of the previous version. I think that, as a user, this is definitely what you would expect, as you also inherit the metadata and files from the previous version.

If we can agree on the above as the required behavior, then we should indeed check that it is consistent throughout the application.

}

public DatasetVersion getEditVersion(FileMetadata fm) {
return getEditVersion(null, fm);
return getEditVersion(null, fm, null);
}

public DatasetVersion getEditVersion(Template template, FileMetadata fm) {
public DatasetVersion getEditVersion(Template template, FileMetadata fm, License license) {
DatasetVersion latestVersion = this.getLatestVersion();
if (!latestVersion.isWorkingCopy() || template != null) {
// if the latest version is released or archived, create a new version for editing
return createNewDatasetVersion(template, fm);
return createNewDatasetVersion(template, fm, license);
} else {
// else, edit existing working copy
return latestVersion;
Expand All @@ -395,11 +395,11 @@ public DatasetVersion getEditVersion(Template template, FileMetadata fm) {
* @todo Investigate if this method should be deprecated in favor of
* createNewDatasetVersion.
*/
public DatasetVersion getCreateVersion() {
public DatasetVersion getCreateVersion(License license) {
DatasetVersion dsv = new DatasetVersion();
dsv.setVersionState(DatasetVersion.VersionState.DRAFT);
dsv.setDataset(this);
dsv.initDefaultValues();
dsv.initDefaultValues(license);
this.setVersions(new ArrayList<>());
getVersions().add(0, dsv);
return dsv;
Expand Down
Loading