From: Aron Roberts Date: Fri, 25 May 2012 21:41:31 +0000 (-0700) Subject: CSPACE-5012: When populating collectionspace_core:uri with URIs for authority item... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=bf1d0d01b6aa6e7de9c6a042cc517c6d765ec646;p=tmp%2Fjakarta-migration.git CSPACE-5012: When populating collectionspace_core:uri with URIs for authority item records, handle extensions to the authorities doctypes by getting their base (unqualified) doctypes. --- diff --git a/services/imports/service/src/main/java/org/collectionspace/services/imports/TemplateExpander.java b/services/imports/service/src/main/java/org/collectionspace/services/imports/TemplateExpander.java index 3e2b5ca75..4442606fc 100644 --- a/services/imports/service/src/main/java/org/collectionspace/services/imports/TemplateExpander.java +++ b/services/imports/service/src/main/java/org/collectionspace/services/imports/TemplateExpander.java @@ -39,6 +39,7 @@ import org.collectionspace.services.common.XmlTools; import org.collectionspace.services.common.api.FileTools; import org.collectionspace.services.common.api.Tools; import org.collectionspace.services.common.config.TenantBindingConfigReaderImpl; +import org.collectionspace.services.common.context.ServiceBindingUtils; import org.collectionspace.services.common.datetime.GregorianCalendarDateTimeUtils; import org.collectionspace.services.config.service.ServiceBindingType; import org.collectionspace.services.nuxeo.util.NuxeoUtils; @@ -204,7 +205,16 @@ public class TemplateExpander { } private static String getAuthoritySvcName(String docType) { - return getDocTypeSvcNameRegistry().get(docType); + String authoritySvcName = getDocTypeSvcNameRegistry().get(docType); + // If an authority document type name isn't matched by a name in the + // registry, we may have been supplied with the tenant-qualified name + // of an extension to that document type. In that case, get the base + // document type. + if (Tools.isBlank(authoritySvcName)) { + authoritySvcName = getDocTypeSvcNameRegistry().get( + ServiceBindingUtils.getUnqualifiedTenantDocType(docType)); + } + return authoritySvcName; } // FIXME: These URI construction methods are also intended to be made