Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
5 changes: 5 additions & 0 deletions doc/release-notes/12174-handle-improvements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This release offers improved support for Handles as persistent ids.

The following issues are fixed:
- When pid registration of persistent ids for files is enabled, Dataverse will create the handle as soon as the file is created (similary to other persistent id providers) (issue #12174);
- When a new handle is created, for a dataset or file that is still a draft, it will be reserved and registered, but not visible publicly. The handle will become visible and the redirects will start working once it is published. This is also in line with how DOI providers work (issue #8881).
2 changes: 1 addition & 1 deletion src/main/java/edu/harvard/iq/dataverse/DataFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
public class DataFile extends DvObject implements Comparable {
private static final Logger logger = Logger.getLogger(DatasetPage.class.getCanonicalName());
private static final long serialVersionUID = 1L;
public static final String TARGET_URL = "/file.xhtml?persistentId=";
public static final String TARGET_URL = "/citation?persistentId=";
public static final char INGEST_STATUS_NONE = 65;
public static final char INGEST_STATUS_SCHEDULED = 66;
public static final char INGEST_STATUS_INPROGRESS = 67;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public Throwable registerNewHandle(DvObject dvObject) {
timestamp, null, true, true, true, false), new HandleValue(1, "URL".getBytes(StandardCharsets.UTF_8),
datasetUrl.getBytes(),
HandleValue.TTL_TYPE_RELATIVE, 86400,
timestamp, null, true, true, true, false)};
timestamp, null, true, true, false, false)};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks fine but I'm just leaving a comment so we can easily see that "publicRead" is what's being changed:

    this.timestamp = timestamp;
    this.references = references;
    this.adminRead = adminRead;
    this.adminWrite = adminWrite;
    this.publicRead = publicRead;
    this.publicWrite = publicWrite;


CreateHandleRequest req
= new CreateHandleRequest(handle.getBytes(StandardCharsets.UTF_8), val, auth);
Expand Down Expand Up @@ -259,7 +259,7 @@ private String getRegistrationUrl(DvObject dvObject) {
logger.log(Level.FINE,"getRegistrationUrl");
String siteUrl = SystemConfig.getDataverseSiteUrlStatic();
String targetUrl = siteUrl + dvObject.getTargetUrl() + "hdl:" + dvObject.getAuthority()
+ "/" + dvObject.getIdentifier();
+ "/" + dvObject.getIdentifier();
return targetUrl;
}

Expand Down Expand Up @@ -324,12 +324,6 @@ private String getAuthenticationHandle(String handlePrefix) {
return "0.NA/" + handlePrefix;
}
}

@Override
public boolean alreadyRegistered(DvObject dvObject) {
String handle = getDvObjectHandle(dvObject);
return isHandleRegistered(handle);
}

@Override
public boolean alreadyRegistered(GlobalId pid, boolean noProviderDefault) throws Exception {
Expand Down Expand Up @@ -400,6 +394,10 @@ public List<String> getProviderInformation(){

@Override
public String createIdentifier(DvObject dvObject) throws Throwable {
if (dvObject.getIdentifier() == null || dvObject.getIdentifier().isEmpty()) {
dvObject = generatePid(dvObject);
logger.fine("generated identifier: " + getIdentifier(dvObject));
}
Throwable result = registerNewHandle(dvObject);
if (result != null)
throw result;
Expand Down