Skip to content

Commit 6a06c30

Browse files
committed
CSPACE-4783 - Applied a partial fix (hack) that will work until we put in a proper fix using a base schema for all authority items. Also fixed typo in tenant-bindings-proto.xml fix for authority perf problems. Placed taxonFullName declaration under authority, rather than item, service declaration.
1 parent ce83dd2 commit 6a06c30

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml

+4-5
Original file line numberDiff line numberDiff line change
@@ -2170,7 +2170,6 @@
21702170
<service:DocHandlerParams xmlns:service="http://collectionspace.org/services/common/service">
21712171
<service:params>
21722172
<service:ListResultsFields>
2173-
<!-- The default fields should probably be omitted here -->
21742173
<service:ListResultField>
21752174
<service:element>displayName</service:element>
21762175
<service:xpath>displayName</service:xpath>
@@ -2187,10 +2186,6 @@
21872186
<service:element>vocabType</service:element>
21882187
<service:xpath>vocabType</service:xpath>
21892188
</service:ListResultField>
2190-
<service:ListResultField>
2191-
<service:element>taxonFullName</service:element>
2192-
<service:xpath>taxonFullName</service:xpath>
2193-
</service:ListResultField>
21942189
</service:ListResultsFields>
21952190
</service:params>
21962191
</service:DocHandlerParams>
@@ -2238,6 +2233,10 @@
22382233
<service:params>
22392234
<service:ListResultsFields>
22402235
<!-- Omit the standard AuthorityItem items (they are handled by the code) -->
2236+
<service:ListResultField>
2237+
<service:element>taxonFullName</service:element>
2238+
<service:xpath>taxonFullName</service:xpath>
2239+
</service:ListResultField>
22412240
</service:ListResultsFields>
22422241
</service:params>
22432242
</service:DocHandlerParams>

services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java

+12-9
Original file line numberDiff line numberDiff line change
@@ -397,15 +397,18 @@ private void populateSubjectOrObjectValues(
397397

398398
private String getCommonSchemaNameForDocType(String docType) {
399399
String common_schema = null;
400-
if("Person".equals(docType))
401-
common_schema = PersonAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
402-
else if("Organization".equals(docType))
403-
common_schema = OrgAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
404-
else if("Locationitem".equals(docType))
405-
common_schema = LocationAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
406-
else if("Taxon".equals(docType))
407-
common_schema = TaxonomyAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
408-
//else leave it null.
400+
if(docType!=null) {
401+
// HACK - Use startsWith to allow for extension of schemas.
402+
if(docType.startsWith("Person"))
403+
common_schema = PersonAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
404+
else if(docType.startsWith("Organization"))
405+
common_schema = OrgAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
406+
else if(docType.startsWith("Locationitem"))
407+
common_schema = LocationAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
408+
else if(docType.startsWith("Taxon"))
409+
common_schema = TaxonomyAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
410+
//else leave it null.
411+
}
409412
return common_schema;
410413
}
411414

0 commit comments

Comments
 (0)