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

[275] Research Project chain of custody tracking #281

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -129,7 +130,6 @@ public Relationship create(Context context, Relationship relationship) throws SQ
Relationship relationshipToReturn = relationshipDAO.create(context, relationship);
updatePlaceInRelationship(context, relationshipToReturn, null, null, true, true);
update(context, relationshipToReturn);

//TAMU Customization - Track PDAC chain of custody for RDS
updatePdacChainOfCustody(PdacActionType.ADD, relationship, context);
//End TAMU Customization - Track PDAC chain of custody for RDS
Expand Down Expand Up @@ -1135,15 +1135,16 @@ public int countByItemRelationshipTypeAndRelatedList(Context context, UUID focus

// TAMU Customization - Track changes to PDAC custody via metadata
protected void updatePdacChainOfCustody(PdacActionType pdacActionType, Relationship relationship, Context context) {
final String validLeftType = "isPDACForDataset";
final String validRightType = "isDatasetAssignedToPDAC";
final List<String> validLeftTypes = Arrays.asList("isPDACForDataset", "isPDACForProject");
final List<String> validRightTypes = Arrays.asList("isDatasetAssignedToPDAC","isProjectAssignedtoPDAC");
final String mdSchema = MetadataSchemaEnum.DC.getName();
final String mdElement = "description";
final String mdQualifier = "chainOfCustody";

// verify that this is a pdac relationship
if (relationship.getRelationshipType().getLeftwardType().equals(validLeftType)
&& relationship.getRelationshipType().getRightwardType().equals(validRightType)) {
if (validLeftTypes.contains(relationship.getRelationshipType().getLeftwardType())
&& validRightTypes.contains(relationship.getRelationshipType().getRightwardType())) {

final String mdLanguage = "en";
final String timeOfAction = java.time.format.DateTimeFormatter.ISO_DATE_TIME
.format(java.time.LocalDateTime.now());
Expand Down
Loading