Skip to content

Commit

Permalink
Bug fix/align with fdo (#34)
Browse files Browse the repository at this point in the history
* align with handle api

* align with handle api

* test
  • Loading branch information
southeo authored Jul 31, 2024
1 parent 6aac6ac commit 0c864c9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ public enum FdoProfileAttributes {
LINKED_DO_PID("linkedDigitalObjectPid", null),
MEDIA_HOST("mediaHost", null),
IS_DERIVED_FROM_SPECIMEN("isDerivedFromSpecimen", "true"),
LINKED_DO_TYPE("linkedDigitalObjectType", "https://hdl.handle.net/21.T11148/894b1e6cad57e921764e"),
LINKED_DO_TYPE("linkedDigitalObjectType", "digital specimen"),
PRIMARY_MO_ID_TYPE("primaryMediaObjectIdType", "Resolvable"),
PRIMARY_MO_ID_NAME("primaryMediaObjectIdName", "ac:accessUri"),
DCTERMS_TYPE("dcterms:type", "Image"),
LICENSE_NAME("licenseName", ""),
DCTERMS_TYPE("dcterms:type", "image"),
LICENSE_NAME("licenseName", null),
RIGHTSHOLDER_PID_TYPE("rightsholderPidType", "Resolvable"),
MEDIA_FORMAT("dcterms:format", "image");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,9 @@ private JsonNode generateAttributes(DigitalMediaWrapper mediaObject) throws PidC
if (mediaObject.type() != null) {
attributes.put(MEDIA_FORMAT.getAttribute(), MEDIA_FORMAT.getDefaultValue());
}
// Optional values
attributes.put(MEDIA_FORMAT.getAttribute(), mediaObject.attributes().getDctermsFormat() == null
? MEDIA_FORMAT.getDefaultValue() : mediaObject.attributes().getDctermsFormat());
attributes.put(DCTERMS_TYPE.getAttribute(), mediaObject.attributes().getDctermsType() == null ?
DCTERMS_TYPE.getDefaultValue() : mediaObject.attributes().getDctermsType().value());

// Default values
// Default
attributes.put(MEDIA_FORMAT.getAttribute(), MEDIA_FORMAT.getDefaultValue());
attributes.put(DCTERMS_TYPE.getAttribute(), DCTERMS_TYPE.getDefaultValue());
attributes.put(ISSUED_FOR_AGENT.getAttribute(), fdoProperties.getIssuedForAgent());
attributes.put(PRIMARY_MO_ID_TYPE.getAttribute(), PRIMARY_MO_ID_TYPE.getDefaultValue());
attributes.put(PRIMARY_MO_ID_NAME.getAttribute(), PRIMARY_MO_ID_NAME.getDefaultValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public static JsonNode givenPostAttributes() {
attributes.put(PRIMARY_MEDIA_ID.getAttribute(), MEDIA_URL_1);
attributes.put(REFERENT_NAME.getAttribute(), TYPE + " for " + DIGITAL_SPECIMEN_ID);
attributes.put(LINKED_DO_PID.getAttribute(), DIGITAL_SPECIMEN_ID);
attributes.put(MEDIA_FORMAT.getAttribute(), FORMAT);
attributes.put(MEDIA_FORMAT.getAttribute(), MEDIA_FORMAT.getDefaultValue());
attributes.put(ISSUED_FOR_AGENT.getAttribute(), "https://ror.org/0566bfb96");
attributes.put(DCTERMS_TYPE.getAttribute(), DCTERMS_TYPE.getDefaultValue());
attributes.put(PRIMARY_MO_ID_TYPE.getAttribute(), PRIMARY_MO_ID_TYPE.getDefaultValue());
Expand Down

0 comments on commit 0c864c9

Please sign in to comment.