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

Rdc sprint4 staging #283

Open
wants to merge 20 commits into
base: tamu-rdc-dspace-7_x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
68663c7
added new metadata fields for local types and Dublin Core
qtamu Aug 26, 2024
24fa765
added the scope notes to the newly added metadata fields
qtamu Aug 28, 2024
fa0729d
corrected formatting issue
qtamu Aug 28, 2024
c5fc543
a tag was out of file format
qtamu Aug 28, 2024
5af4cf5
update formatting for new fields
jsavell Aug 28, 2024
f02fa7f
update formatting for new fields in local-types
jsavell Aug 28, 2024
b03eed7
Merge pull request #273 from TAMULib/new-metadata-fields
qtamu Aug 29, 2024
370a357
add metadata fields that are to be hidden in a local cfg rdc file
qtamu Aug 29, 2024
1cc53eb
Merge pull request #274 from TAMULib/hide-metadata-fields
qtamu Aug 29, 2024
29989b5
Add Research Project entitiy
qtamu Sep 3, 2024
a59383d
updated relationships for research project
qtamu Sep 4, 2024
7ddfe0c
add virtual metadata for ResearchProject entity
jsavell Sep 5, 2024
9cff938
Merge pull request #278 from TAMULib/research-project-entity
qtamu Sep 5, 2024
afddf67
Merge pull request #280 from TAMULib/research-project-entity-virtual-…
jsavell Sep 5, 2024
809e861
add PDAC custody tracking to Research Projects
jsavell Sep 5, 2024
7ef0006
Merge pull request #281 from TAMULib/sprint4-275-research-pdac-tracking
jsavell Sep 5, 2024
d84d1db
add missing part fo scope fo the findingAid metadata field.
qtamu Sep 10, 2024
d172290
updated scope of findingAid
qtamu Sep 11, 2024
5557b41
Added full finding aid scope note
qtamu Sep 11, 2024
bdb8542
Merge pull request #282 from TAMULib/new-metadata-fields
qtamu Sep 11, 2024
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
28 changes: 28 additions & 0 deletions dspace/config/entities/relationship-types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,33 @@
</rightCardinality>
<copyToLeft>true</copyToLeft>
</type>
<type>
<leftType>Dataset</leftType>
<rightType>ResearchProject</rightType>
<leftwardType>isProjectThatProducedDataset</leftwardType>
<rightwardType>isDatasetProducedByProject</rightwardType>
<leftCardinality>
<min>0</min>
<max>1</max>
</leftCardinality>
<rightCardinality>
<min>0</min>
</rightCardinality>
<copyToLeft>true</copyToLeft>
</type>
<type>
<leftType>ResearchProject</leftType>
<rightType>PDAC</rightType>
<leftwardType>isPDACForProject</leftwardType>
<rightwardType>isProjectAssignedtoPDAC</rightwardType>
<leftCardinality>
<min>0</min>
<max>1</max>
</leftCardinality>
<rightCardinality>
<min>0</min>
</rightCardinality>
<copyToLeft>true</copyToLeft>
</type>
<!-- End TAMU Customization - only add specific RDC entity types -->
</relationships>
21 changes: 21 additions & 0 deletions dspace/config/local.cfg.RDC
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
##### Hide Item Metadata Fields #####
##### TAMU Customization - Hidden metadata fields #####
# Fields named here are hidden in the following places UNLESS the
# logged-in user is an Administrator:
# 1. REST API (and therefore UI)
# 2. RDF (every where as there is currently no possibility to authenticate)
# 3. OAI (every where as there is currently no possibility to authenticate)
# Attention: You need to rebuild the OAI SOLR index after every change of
# this property. Run [dspace-install]/bin/dspace oai import -c to do so.
#
# To designate a field as hidden, add a property here in the form:
# metadata.hide.SCHEMA.ELEMENT.QUALIFIER = true
#
# This default configuration hides the dc.description.provenance field,
# since that usually contains email addresses which ought to be kept
# private and is mainly of interest to administrators:
metadata.hide.dc.creator.UIN = true
metadata.hide.dc.identifier.UIN = true
metadata.hide.dc.description.findingAid = true

# END TAMU Customization - hidden metadata fields
62 changes: 62 additions & 0 deletions dspace/config/registries/dublin-core-types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,68 @@
<!-- unqualified -->
<scope_note>A person, organization, or service responsible for the content of the resource. Catch-all for unspecified contributors.</scope_note>
</dc-type>
<!-- TAMU Customization - additional dublin core contributor member-->
<dc-type>
<schema>dc</schema>
<element>contributor</element>
<qualifier>member</qualifier>
<scope_note>Use for name of TAMU department or institute that is home to the research project</scope_note>
</dc-type>
<!-- END TAMU Customization - additional dublin core contributor member-->

<!-- TAMU Customization - additional dublin core creator UIN -->
<dc-type>
<schema>dc</schema>
<element>creator</element>
<qualifier>UIN</qualifier>
<scope_note>TAMU identifier of PI of a research project</scope_note>
</dc-type>
<!-- END TAMU Customization -->

<!-- TAMU Customization - additional dublin core PI-->
<dc-type>
<schema>dc</schema>
<element>creator</element>
<qualifier>pi</qualifier>
<scope_note>Name of Principal Investigator on research project</scope_note>
</dc-type>
<!-- END TAMU Customization - additional dublin core PI-->

<!-- TAMU Customization - additional dublin core COPI-->
<dc-type>
<schema>dc</schema>
<element>creator</element>
<qualifier>copi</qualifier>
<scope_note>Name of Co-Principal Investigator on research project</scope_note>
</dc-type>
<!-- END TAMU Customization - additional dublin core COPI-->

<!-- TAMU Customization - additional dublin core Role-->
<dc-type>
<schema>dc</schema>
<element>description</element>
<qualifier>role</qualifier>
<scope_note>Describes the role of the PI on the research project</scope_note>
</dc-type>
<!-- END TAMU Customization - additional dublin core Role-->

<!-- TAMU Customization - additional dublin core Identifier UIN-->
<dc-type>
<schema>dc</schema>
<element>identifier</element>
<qualifier>UIN</qualifier>
<scope_note>TAMU identifier of a PDAC</scope_note>
</dc-type>
<!-- END TAMU Customization - additional dublin core Identifier UIN -->

<!-- TAMU Customization - additional dublin core Finding Aid-->
<dc-type>
<schema>dc</schema>
<element>description</element>
<qualifier>findingAid</qualifier>
<scope_note>A single-level description of extent, scope, and content of the research data associated with a research project. For more details on archival practices, refer to the following resources: Extent https://saa-ts-dacs.github.io/dacs/06_part_I/03_chapter_02/05_extent.html, and Scope-and-Content https://saa-ts-dacs.github.io/dacs/06_part_I/04_chapter_03/01_scope_and_content.html</scope_note>
</dc-type>
<!-- END TAMU Customization - additional dublin core Finding Aid -->

<!-- TAMU Customization - additional dublin core contributor qualifier for department -->
<dc-type>
Expand Down
36 changes: 36 additions & 0 deletions dspace/config/registries/local-types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,40 @@
<scope_note>Email of the Project Data Access Contact</scope_note>
</dc-type>
<!-- End TAMU Customization - Custom metadata fields for Project Data Access Contact (PDAC) -->

<!-- TAMU Customization - additional local field Award Number-->
<dc-type>
<schema>local</schema>
<element>awardNumber</element>
<!-- unqualified -->
<scope_note>Number identifying the individual grant that the sponsor awarded for the research project</scope_note>
</dc-type>
<!-- END TAMU Customization - additional local field Award Number-->

<!-- TAMU Customization - additional local field Project Status-->
<dc-type>
<schema>local</schema>
<element>projectStatus</element>
<!-- unqualified -->
<scope_note>Status of research project in Maestro</scope_note>
</dc-type>
<!-- END TAMU Customization - additional local field Project Status-->

<!-- TAMU Customization - additional local field Contact Email-->
<dc-type>
<schema>local</schema>
<element>contact</element>
<qualifier>email</qualifier>
<scope_note>Email address of a PDAC</scope_note>
</dc-type>
<!-- END TAMU Customization - additional local field Contact Email-->

<!-- TAMU Customization - additional local field Contact Phone-->
<dc-type>
<schema>local</schema>
<element>contact</element>
<qualifier>phone</qualifier>
<scope_note>Telephone number of a PDAC</scope_note>
</dc-type>
<!-- END TAMU Customization - additional local field Contact Phone-->
</dspace-dc-types>
30 changes: 30 additions & 0 deletions dspace/config/spring/api/virtual-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
<!-- TAMU Customization - Dataset / PDAC virtual metadata mapping -->
<entry key="isPDACForDataset" value-ref="isPDACForDatasetMap"/>
<entry key="isDatasetAssignedToPDAC" value-ref="isDatasetAssignedToPDACMap"/>
<entry key="isPDACForProject" value-ref="isPDACForProjectMap"/>
<entry key="isProjectAssignedtoPDAC" value-ref="isProjectAssignedToPDACMap"/>
<!-- End TAMU Customization - Dataset / PDAC virtual metadata mapping -->
</map>
</property>
Expand All @@ -40,6 +42,7 @@
<!-- TAMU Customization - Dataset / PDAC entity type to filter query entry -->
<entry key="Dataset" value="f.entityType=Dataset,equals"/>
<entry key="PDAC" value="f.entityType=PDAC,equals"/>
<entry key="ResearchProject" value="f.entityType=ResearchProject,equals"/>
<!-- End TAMU Customization - Dataset / PDAC entity type to filter query entry -->
</map>
</property>
Expand Down Expand Up @@ -82,6 +85,33 @@
</bean>
<!-- End TAMU Customization - Dataset / PDAC virtual metadata -->

<util:map id="isPDACForProjectMap">
<entry key="local.pdac.name" value-ref="projectPDAC_name"/>
<entry key="dc.contributor.pdac" value-ref="projectPDAC_identifier"/>
</util:map>
<bean class="org.dspace.content.virtual.Concatenate" id="projectPDAC_name">
<property name="fields">
<util:list>
<value>local.pdac.name</value>
</util:list>
</property>
<property name="separator">
<value>, </value>
</property>
<property name="useForPlace" value="true"/>
<property name="populateWithNameVariant" value="true"/>
</bean>
<bean class="org.dspace.content.virtual.Collected" id="projectPDAC_identifier">
<property name="fields">
<util:list>
<value>dc.identifier.uri</value>
</util:list>
</property>
</bean>
<util:map id="isProjectAssignedToPDACMap">
<entry key="dc.relation.hasResearchProject" value-ref="pdac_identifier"/>
</util:map>

<!-- Config like this will tell our VirtualMetadataPopulator to include the virtual metadata field
'dc.contributor.author' on the appropriate item with the values defined in the value-ref.
This value-ref should be a bean of type VirtualMetadataConfiguration -->
Expand Down
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