Skip to content

Commit a4a1587

Browse files
authored
Merge pull request #283 from TAMULib/rdc-sprint4-staging
Rdc sprint4 staging
2 parents efa4f39 + bdb8542 commit a4a1587

File tree

6 files changed

+183
-5
lines changed

6 files changed

+183
-5
lines changed

dspace/config/entities/relationship-types.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,33 @@
148148
</rightCardinality>
149149
<copyToLeft>true</copyToLeft>
150150
</type>
151+
<type>
152+
<leftType>Dataset</leftType>
153+
<rightType>ResearchProject</rightType>
154+
<leftwardType>isProjectThatProducedDataset</leftwardType>
155+
<rightwardType>isDatasetProducedByProject</rightwardType>
156+
<leftCardinality>
157+
<min>0</min>
158+
<max>1</max>
159+
</leftCardinality>
160+
<rightCardinality>
161+
<min>0</min>
162+
</rightCardinality>
163+
<copyToLeft>true</copyToLeft>
164+
</type>
165+
<type>
166+
<leftType>ResearchProject</leftType>
167+
<rightType>PDAC</rightType>
168+
<leftwardType>isPDACForProject</leftwardType>
169+
<rightwardType>isProjectAssignedtoPDAC</rightwardType>
170+
<leftCardinality>
171+
<min>0</min>
172+
<max>1</max>
173+
</leftCardinality>
174+
<rightCardinality>
175+
<min>0</min>
176+
</rightCardinality>
177+
<copyToLeft>true</copyToLeft>
178+
</type>
151179
<!-- End TAMU Customization - only add specific RDC entity types -->
152180
</relationships>

dspace/config/local.cfg.RDC

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
##### Hide Item Metadata Fields #####
2+
##### TAMU Customization - Hidden metadata fields #####
3+
# Fields named here are hidden in the following places UNLESS the
4+
# logged-in user is an Administrator:
5+
# 1. REST API (and therefore UI)
6+
# 2. RDF (every where as there is currently no possibility to authenticate)
7+
# 3. OAI (every where as there is currently no possibility to authenticate)
8+
# Attention: You need to rebuild the OAI SOLR index after every change of
9+
# this property. Run [dspace-install]/bin/dspace oai import -c to do so.
10+
#
11+
# To designate a field as hidden, add a property here in the form:
12+
# metadata.hide.SCHEMA.ELEMENT.QUALIFIER = true
13+
#
14+
# This default configuration hides the dc.description.provenance field,
15+
# since that usually contains email addresses which ought to be kept
16+
# private and is mainly of interest to administrators:
17+
metadata.hide.dc.creator.UIN = true
18+
metadata.hide.dc.identifier.UIN = true
19+
metadata.hide.dc.description.findingAid = true
20+
21+
# END TAMU Customization - hidden metadata fields

dspace/config/registries/dublin-core-types.xml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,68 @@
8686
<!-- unqualified -->
8787
<scope_note>A person, organization, or service responsible for the content of the resource. Catch-all for unspecified contributors.</scope_note>
8888
</dc-type>
89+
<!-- TAMU Customization - additional dublin core contributor member-->
90+
<dc-type>
91+
<schema>dc</schema>
92+
<element>contributor</element>
93+
<qualifier>member</qualifier>
94+
<scope_note>Use for name of TAMU department or institute that is home to the research project</scope_note>
95+
</dc-type>
96+
<!-- END TAMU Customization - additional dublin core contributor member-->
97+
98+
<!-- TAMU Customization - additional dublin core creator UIN -->
99+
<dc-type>
100+
<schema>dc</schema>
101+
<element>creator</element>
102+
<qualifier>UIN</qualifier>
103+
<scope_note>TAMU identifier of PI of a research project</scope_note>
104+
</dc-type>
105+
<!-- END TAMU Customization -->
106+
107+
<!-- TAMU Customization - additional dublin core PI-->
108+
<dc-type>
109+
<schema>dc</schema>
110+
<element>creator</element>
111+
<qualifier>pi</qualifier>
112+
<scope_note>Name of Principal Investigator on research project</scope_note>
113+
</dc-type>
114+
<!-- END TAMU Customization - additional dublin core PI-->
115+
116+
<!-- TAMU Customization - additional dublin core COPI-->
117+
<dc-type>
118+
<schema>dc</schema>
119+
<element>creator</element>
120+
<qualifier>copi</qualifier>
121+
<scope_note>Name of Co-Principal Investigator on research project</scope_note>
122+
</dc-type>
123+
<!-- END TAMU Customization - additional dublin core COPI-->
124+
125+
<!-- TAMU Customization - additional dublin core Role-->
126+
<dc-type>
127+
<schema>dc</schema>
128+
<element>description</element>
129+
<qualifier>role</qualifier>
130+
<scope_note>Describes the role of the PI on the research project</scope_note>
131+
</dc-type>
132+
<!-- END TAMU Customization - additional dublin core Role-->
133+
134+
<!-- TAMU Customization - additional dublin core Identifier UIN-->
135+
<dc-type>
136+
<schema>dc</schema>
137+
<element>identifier</element>
138+
<qualifier>UIN</qualifier>
139+
<scope_note>TAMU identifier of a PDAC</scope_note>
140+
</dc-type>
141+
<!-- END TAMU Customization - additional dublin core Identifier UIN -->
142+
143+
<!-- TAMU Customization - additional dublin core Finding Aid-->
144+
<dc-type>
145+
<schema>dc</schema>
146+
<element>description</element>
147+
<qualifier>findingAid</qualifier>
148+
<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>
149+
</dc-type>
150+
<!-- END TAMU Customization - additional dublin core Finding Aid -->
89151

90152
<!-- TAMU Customization - additional dublin core contributor qualifier for department -->
91153
<dc-type>

dspace/config/registries/local-types.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,40 @@
6969
<scope_note>Email of the Project Data Access Contact</scope_note>
7070
</dc-type>
7171
<!-- End TAMU Customization - Custom metadata fields for Project Data Access Contact (PDAC) -->
72+
73+
<!-- TAMU Customization - additional local field Award Number-->
74+
<dc-type>
75+
<schema>local</schema>
76+
<element>awardNumber</element>
77+
<!-- unqualified -->
78+
<scope_note>Number identifying the individual grant that the sponsor awarded for the research project</scope_note>
79+
</dc-type>
80+
<!-- END TAMU Customization - additional local field Award Number-->
81+
82+
<!-- TAMU Customization - additional local field Project Status-->
83+
<dc-type>
84+
<schema>local</schema>
85+
<element>projectStatus</element>
86+
<!-- unqualified -->
87+
<scope_note>Status of research project in Maestro</scope_note>
88+
</dc-type>
89+
<!-- END TAMU Customization - additional local field Project Status-->
90+
91+
<!-- TAMU Customization - additional local field Contact Email-->
92+
<dc-type>
93+
<schema>local</schema>
94+
<element>contact</element>
95+
<qualifier>email</qualifier>
96+
<scope_note>Email address of a PDAC</scope_note>
97+
</dc-type>
98+
<!-- END TAMU Customization - additional local field Contact Email-->
99+
100+
<!-- TAMU Customization - additional local field Contact Phone-->
101+
<dc-type>
102+
<schema>local</schema>
103+
<element>contact</element>
104+
<qualifier>phone</qualifier>
105+
<scope_note>Telephone number of a PDAC</scope_note>
106+
</dc-type>
107+
<!-- END TAMU Customization - additional local field Contact Phone-->
72108
</dspace-dc-types>

dspace/config/spring/api/virtual-metadata.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
<!-- TAMU Customization - Dataset / PDAC virtual metadata mapping -->
2626
<entry key="isPDACForDataset" value-ref="isPDACForDatasetMap"/>
2727
<entry key="isDatasetAssignedToPDAC" value-ref="isDatasetAssignedToPDACMap"/>
28+
<entry key="isPDACForProject" value-ref="isPDACForProjectMap"/>
29+
<entry key="isProjectAssignedtoPDAC" value-ref="isProjectAssignedToPDACMap"/>
2830
<!-- End TAMU Customization - Dataset / PDAC virtual metadata mapping -->
2931
</map>
3032
</property>
@@ -40,6 +42,7 @@
4042
<!-- TAMU Customization - Dataset / PDAC entity type to filter query entry -->
4143
<entry key="Dataset" value="f.entityType=Dataset,equals"/>
4244
<entry key="PDAC" value="f.entityType=PDAC,equals"/>
45+
<entry key="ResearchProject" value="f.entityType=ResearchProject,equals"/>
4346
<!-- End TAMU Customization - Dataset / PDAC entity type to filter query entry -->
4447
</map>
4548
</property>
@@ -82,6 +85,33 @@
8285
</bean>
8386
<!-- End TAMU Customization - Dataset / PDAC virtual metadata -->
8487

88+
<util:map id="isPDACForProjectMap">
89+
<entry key="local.pdac.name" value-ref="projectPDAC_name"/>
90+
<entry key="dc.contributor.pdac" value-ref="projectPDAC_identifier"/>
91+
</util:map>
92+
<bean class="org.dspace.content.virtual.Concatenate" id="projectPDAC_name">
93+
<property name="fields">
94+
<util:list>
95+
<value>local.pdac.name</value>
96+
</util:list>
97+
</property>
98+
<property name="separator">
99+
<value>, </value>
100+
</property>
101+
<property name="useForPlace" value="true"/>
102+
<property name="populateWithNameVariant" value="true"/>
103+
</bean>
104+
<bean class="org.dspace.content.virtual.Collected" id="projectPDAC_identifier">
105+
<property name="fields">
106+
<util:list>
107+
<value>dc.identifier.uri</value>
108+
</util:list>
109+
</property>
110+
</bean>
111+
<util:map id="isProjectAssignedToPDACMap">
112+
<entry key="dc.relation.hasResearchProject" value-ref="pdac_identifier"/>
113+
</util:map>
114+
85115
<!-- Config like this will tell our VirtualMetadataPopulator to include the virtual metadata field
86116
'dc.contributor.author' on the appropriate item with the values defined in the value-ref.
87117
This value-ref should be a bean of type VirtualMetadataConfiguration -->

dspace/modules/additions/src/main/java/org/dspace/content/RelationshipServiceImpl.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import java.sql.SQLException;
1111
import java.util.ArrayList;
12+
import java.util.Arrays;
1213
import java.util.Collections;
1314
import java.util.HashMap;
1415
import java.util.List;
@@ -129,7 +130,6 @@ public Relationship create(Context context, Relationship relationship) throws SQ
129130
Relationship relationshipToReturn = relationshipDAO.create(context, relationship);
130131
updatePlaceInRelationship(context, relationshipToReturn, null, null, true, true);
131132
update(context, relationshipToReturn);
132-
133133
//TAMU Customization - Track PDAC chain of custody for RDS
134134
updatePdacChainOfCustody(PdacActionType.ADD, relationship, context);
135135
//End TAMU Customization - Track PDAC chain of custody for RDS
@@ -1135,15 +1135,16 @@ public int countByItemRelationshipTypeAndRelatedList(Context context, UUID focus
11351135

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

11441144
// verify that this is a pdac relationship
1145-
if (relationship.getRelationshipType().getLeftwardType().equals(validLeftType)
1146-
&& relationship.getRelationshipType().getRightwardType().equals(validRightType)) {
1145+
if (validLeftTypes.contains(relationship.getRelationshipType().getLeftwardType())
1146+
&& validRightTypes.contains(relationship.getRelationshipType().getRightwardType())) {
1147+
11471148
final String mdLanguage = "en";
11481149
final String timeOfAction = java.time.format.DateTimeFormatter.ISO_DATE_TIME
11491150
.format(java.time.LocalDateTime.now());

0 commit comments

Comments
 (0)