-
Notifications
You must be signed in to change notification settings - Fork 488
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
8889 file-level PIDs configuration in individual collections #9614
Changes from 16 commits
9e77561
bc84ed5
4d9e9b1
e757a77
0ec9c73
ff34b46
82e91f2
60c1031
14ce446
78d68e2
2fd36ad
ae8b438
6d06e32
a556b69
d2325fa
0704ae2
e337871
d902fed
4f1afd3
0e89865
59cd7ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
It is now possible to configure registering PIDs for files in individual collections. | ||
|
||
For example, registration of PIDs for files can be enabled in a specific collection when it is disabled instance-wide. Or it can be disabled in specific collections where it is enabled by default. See the [:FilePIDsEnabled](https://guides.dataverse.org/en/latest/installation/config.html#filepidsenabled) section of the Configuration guide for details. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -590,8 +590,17 @@ public void setCitationDatasetFieldTypes(List<DatasetFieldType> citationDatasetF | |
this.citationDatasetFieldTypes = citationDatasetFieldTypes; | ||
} | ||
|
||
|
||
@Column(nullable = true) | ||
private Boolean filePIDsEnabled; | ||
|
||
public Boolean getFilePIDsEnabled() { | ||
return filePIDsEnabled; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this code return a default if null? If this should be optional (so this is handled as business logic in service layer), maybe return At least the Javadoc should state what can be expected as return values. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I specifically wanted it to be nullable, and to be null by default; and I wanted the method above to return the actual value (or lack thereof) in the database table. Null value in my implementation has a meaning, of "not specifically configured" one way or another, indicating that the setting of the ancestral collection needs to be consulted instead (or the system-wide default, if none defined on the root collection). |
||
} | ||
|
||
public void setFilePIDsEnabled(boolean filePIDsEnabled) { | ||
this.filePIDsEnabled = filePIDsEnabled; | ||
} | ||
|
||
public List<DataverseFacet> getDataverseFacets() { | ||
return getDataverseFacets(false); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE dataverse ADD COLUMN IF NOT EXISTS filePIDsEnabled bool; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2091,6 +2091,12 @@ static Response setDataverseLogo(String dataverseAlias, String pathToImageFile, | |
.multiPart("file", new File(pathToImageFile)) | ||
.put("/api/dataverses/" + dataverseAlias + "/logo"); | ||
} | ||
|
||
static Response setCollectionAttribute(String dataverseAlias, String attribute, String value, String apiToken) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm excited to have this method and functionality. In future test cases, we could use it in DataversesIT to test changing the name, description, and affiliation of collections. We COULD do that now, in this PR, if we feel like it. It's new functionality that should probably be exercised. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I mentioned in the description, I'm copy-and-pasting/stealing this API from Oliver's pr that's still in draft (#9462). This by itself is going to introduce at least a minor merge conflict with his branch. @poikilotherm are you ok with me expanding on it in this branch, like adding an integration test? - or do you want me to leave it to you? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (I added a simple test that uses the API to change the alias then makes sure the change has taken effect) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hooray for the extra tests! 🎉 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please go ahead! I'm happy to resolve any merge conflicts that might appear. |
||
return given() | ||
.header(API_TOKEN_HTTP_HEADER, apiToken) | ||
.put("/api/dataverses/" + dataverseAlias + "/attribute/" + attribute + "?value=" + value); | ||
} | ||
|
||
/** | ||
* Deprecated as the apiToken is not used by the call. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be useful for @Kris-LIBIS.
In the containerization meetings he has expressed the need to change the name of a collection after installation via API.