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

metadata-added-provenance #730

Open
wants to merge 40 commits into
base: dtq-dev
Choose a base branch
from
Open

Conversation

Paurikova2
Copy link
Collaborator

@Paurikova2 Paurikova2 commented Aug 13, 2024

Phases MP MM MB MR JM Total
ETA 0 0 0 0 0 0
Developing 30 0 0 0 0 0
Review 0 0 0 0 0 0
Total - - - - - 0
ETA est. 0
ETA cust. - - - - - 0

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.

@Paurikova2 Paurikova2 linked an issue Aug 13, 2024 that may be closed by this pull request
@Paurikova2
Copy link
Collaborator Author

Problem: the page is loading data from cache?

@milanmajchrak
Copy link
Collaborator

Checks are not green

milanmajchrak
milanmajchrak previously approved these changes Sep 10, 2024
@Paurikova2 Paurikova2 requested review from milanmajchrak and removed request for vidiecan October 8, 2024 06:42
import org.dspace.content.MetadataField;

/**
* Interface for providing provenance messages.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add author

Copy link
Collaborator

Choose a reason for hiding this comment

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

with email dspace@dataquest.sk

import org.dspace.content.factory.ContentServiceFactory;
import org.dspace.content.service.InstallItemService;
import org.dspace.eperson.EPerson;

Copy link
Collaborator

Choose a reason for hiding this comment

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

doc + athor

}
messageTemplates = mapper.readValue(inputStream, Map.class);
} catch (IOException e) {
throw new RuntimeException("Failed to load message templates", e);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add log

ObjectMapper mapper = new ObjectMapper();
try (InputStream inputStream = getClass().getResourceAsStream(PROVENANCE_MSG_JSON)) {
if (inputStream == null) {
throw new RuntimeException("Failed to find message templates file");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add log

import org.dspace.content.MetadataField;
import org.dspace.content.MetadataValue;

public interface ProvenanceService {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add doc + author

public void setBitstreamPolicies(Context context, Bitstream bitstream, Item item,
BulkAccessControlInput accessControl) throws SQLException, AuthorizeException {
String accConditionsStr = extractAccessConditions(accessControl.getBitstream().getAccessConditions());
if (!accConditionsStr.isEmpty()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

!

@Override
public void deleteBitstream(Context context,Bitstream bitstream) throws SQLException, AuthorizeException {
Item item = getItem(context, bitstream);
if (!Objects.isNull(item)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nonNull

if (dso.getType() == Constants.BITSTREAM) {
Bitstream bitstream = (Bitstream) dso;
Item item = getItem(context, bitstream);
if (!Objects.isNull(item)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

!

try {
provenanceService.uploadBitstream(context, bundle);
} catch (SQLException ex) {
throw new RuntimeException("SQLException in BundleUploadBitstreamConverter.uploadBitstream when " +
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add log

} catch (SQLException e) {
throw new DSpaceBadRequestException("SQLException in DspaceObjectMetadataAddOperation.add trying to add " +
"metadata to dso.", e);
} catch (AuthorizeException e) {
throw new DSpaceBadRequestException(
Copy link
Collaborator

Choose a reason for hiding this comment

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

log

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added it to another files too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metadata edits and provenance
2 participants