-
Notifications
You must be signed in to change notification settings - Fork 2
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
metadata-added-provenance #730
base: dtq-dev
Are you sure you want to change the base?
Conversation
Problem: the page is loading data from cache? |
dspace-api/src/main/java/org/dspace/app/bulkaccesscontrol/BulkAccessControl.java
Outdated
Show resolved
Hide resolved
dspace-api/src/main/java/org/dspace/app/bulkaccesscontrol/BulkAccessControl.java
Outdated
Show resolved
Hide resolved
dspace-api/src/main/java/org/dspace/app/bulkaccesscontrol/BulkAccessControl.java
Outdated
Show resolved
Hide resolved
dspace-server-webapp/src/main/java/org/dspace/app/rest/BundleUploadBitstreamController.java
Outdated
Show resolved
Hide resolved
dspace-server-webapp/src/main/java/org/dspace/app/rest/BundleUploadBitstreamController.java
Outdated
Show resolved
Hide resolved
...in/java/org/dspace/app/rest/repository/patch/operation/DSpaceObjectMetadataAddOperation.java
Outdated
Show resolved
Hide resolved
...java/org/dspace/app/rest/repository/patch/operation/DSpaceObjectMetadataRemoveOperation.java
Outdated
Show resolved
Hide resolved
...java/org/dspace/app/rest/repository/patch/operation/DSpaceObjectMetadataRemoveOperation.java
Outdated
Show resolved
Hide resolved
...ava/org/dspace/app/rest/repository/patch/operation/DSpaceObjectMetadataReplaceOperation.java
Outdated
Show resolved
Hide resolved
...in/java/org/dspace/app/rest/repository/patch/operation/ItemDiscoverableReplaceOperation.java
Outdated
Show resolved
Hide resolved
Checks are not green |
dspace-api/src/main/java/org/dspace/core/ProvenanceMessageProvider.java
Outdated
Show resolved
Hide resolved
dspace-api/src/main/java/org/dspace/core/ProvenanceMessageProviderImpl.java
Outdated
Show resolved
Hide resolved
dspace-api/src/main/java/org/dspace/core/ProvenanceMessageProviderImpl.java
Outdated
Show resolved
Hide resolved
dspace-api/src/main/java/org/dspace/core/ProvenanceMessageProviderImpl.java
Outdated
Show resolved
Hide resolved
dspace-api/src/main/java/org/dspace/core/ProvenanceServiceImpl.java
Outdated
Show resolved
Hide resolved
dspace-api/src/main/java/org/dspace/core/ProvenanceServiceImpl.java
Outdated
Show resolved
Hide resolved
dspace-api/src/main/java/org/dspace/core/ProvenanceServiceImpl.java
Outdated
Show resolved
Hide resolved
dspace-server-webapp/src/main/java/org/dspace/app/rest/BundleUploadBitstreamController.java
Outdated
Show resolved
Hide resolved
...in/java/org/dspace/app/rest/repository/patch/operation/DSpaceObjectMetadataAddOperation.java
Outdated
Show resolved
Hide resolved
...ava/org/dspace/app/rest/repository/patch/operation/DSpaceObjectMetadataReplaceOperation.java
Outdated
Show resolved
Hide resolved
dspace-api/src/main/java/org/dspace/app/bulkaccesscontrol/BulkAccessControl.java
Outdated
Show resolved
Hide resolved
dspace-api/src/main/java/org/dspace/app/bulkaccesscontrol/BulkAccessControl.java
Outdated
Show resolved
Hide resolved
dspace-api/src/main/java/org/dspace/app/bulkaccesscontrol/BulkAccessControl.java
Outdated
Show resolved
Hide resolved
@vidiecan @milanmajchrak |
@@ -552,6 +557,10 @@ private void updateBitstreamPolicies(Bitstream bitstream, Item item, BulkAccessC | |||
*/ | |||
private void removeReadPolicies(DSpaceObject dso, String type) { | |||
try { | |||
String resPoliciesStr = provenanceProvider.removedReadPolicies(context, dso, type); |
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.
explain
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.
at the end
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.
done
private void loadMessageTemplates() { | ||
ObjectMapper mapper = new ObjectMapper(); | ||
String msg; | ||
try (InputStream inputStream = getClass().getResourceAsStream(PROVENANCE_MSG_JSON)) { |
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.
~?
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.
done
return msg; | ||
} | ||
|
||
public String getResourcePoliciesMessage(List<ResourcePolicy> resPolicies) { |
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.
overloading
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.
done
import org.dspace.content.service.clarin.ClarinLicenseResourceMappingService; | ||
|
||
/** | ||
* ProvenanceProviderrest is responsible for creating provenance metadata for items based on the actions performed. |
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.
- ProvenanceProviderrest
- why provider?
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.
done
Created ProvenanceService
.collect(Collectors.joining(";")); | ||
} | ||
|
||
private Item getItem(Context context, Bitstream bitstream) throws SQLException { |
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.
?
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.
- Renamed to
findItemByBitstream
. - This method call a
clarinItemService.findByBitstreamUUID(...)
method and process the response - log if there is no Item,..
try { | ||
fileInputStream = uploadfile.getInputStream(); | ||
} catch (IOException e) { | ||
log.error("Something went wrong when trying to read the inputstream from the given file in the request", | ||
e); | ||
throw new UnprocessableEntityException("The InputStream from the file couldn't be read", e); | ||
} | ||
try { | ||
provenanceProvider.uploadBitstream(context, bundle); |
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.
?!
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.
done
@@ -104,6 +107,7 @@ public void createCollectionToItemRelation(@PathVariable UUID uuid, | |||
|
|||
collectionService.addItem(context, collectionToMapTo, item); | |||
collectionService.update(context, collectionToMapTo); | |||
provenanceProvider.mappedItem(context, item, collectionToMapTo); |
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.
here?
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.
done
try { | ||
provenanceProvider.deleteBitstream(context, bitstreamToDelete); | ||
bitstreamService.delete(context, bitstreamToDelete); |
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.
order
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.
done
} catch (SQLException e) { | ||
throw new DSpaceBadRequestException("SQLException in DspaceObjectMetadataAddOperation.add trying to add " + | ||
"metadata to dso.", e); | ||
msg = "SQLException in DspaceObjectMetadataAddOperation.add trying to add " + |
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.
!
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.
done
try { | ||
if (index == null) { | ||
provenanceProvider.removeMetadata(context, dso, metadataField); |
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.
!
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.
done
dspace-api/src/main/java/org/dspace/app/bulkaccesscontrol/BulkAccessControl.java
Outdated
Show resolved
Hide resolved
dspace-api/src/main/java/org/dspace/core/ProvenanceProvider.java
Outdated
Show resolved
Hide resolved
dspace-api/src/main/java/org/dspace/core/ProvenanceProvider.java
Outdated
Show resolved
Hide resolved
… when calling provenance methods.
…be used as Spring Service.
Problem description
After adding, deleting, or editing the metadata of an item, a new record should be created in the metadata as dc.description.provenance.