]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5012: When populating collectionspace_core:uri with URIs for authority item...
authorAron Roberts <aron@socrates.berkeley.edu>
Fri, 25 May 2012 21:41:31 +0000 (14:41 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Fri, 25 May 2012 21:41:31 +0000 (14:41 -0700)
services/imports/service/src/main/java/org/collectionspace/services/imports/TemplateExpander.java

index 3e2b5ca759576401c4d9a3d7e46ecdef816b33c2..4442606fc22f2d79e2c2b7ddbcb5b812e2f36d71 100644 (file)
@@ -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