]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5271,CSPACE-5453: Removed temporary UriUtils class in favor of the new URI...
authorAron Roberts <aron@socrates.berkeley.edu>
Fri, 17 Aug 2012 03:17:01 +0000 (20:17 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Fri, 17 Aug 2012 03:17:01 +0000 (20:17 -0700)
services/config/src/main/java/org/collectionspace/services/common/config/URIUtils.java [deleted file]
services/imports/service/src/main/java/org/collectionspace/services/imports/TemplateExpander.java

diff --git a/services/config/src/main/java/org/collectionspace/services/common/config/URIUtils.java b/services/config/src/main/java/org/collectionspace/services/common/config/URIUtils.java
deleted file mode 100644 (file)
index fcd0355..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.collectionspace.services.common.config;
-
-// client module is built after this config module, so we can't currently include this
-// import org.collectionspace.services.client.AuthorityClient;
-import java.util.HashMap;
-import java.util.Map;
-
-// This class is a hack for CSPACE-5406
-
-public class URIUtils {
-
-    private static Map<String, String> docTypeSvcNameRegistry = new HashMap<String, String>();
-    private static final String ITEMS_PATH_COMPONENT = "items";
-    
-    // FIXME: This is a quick hack, which assumes that URI construction
-    // behaviors are bound to categories of services.  Those behaviors
-    // should instead be specified on a per-service basis via a registry,
-    // mechanism.  (See comments below for more details.) - ADR 2012-05-24
-    public static final String AUTHORITY_SERVICE_CATEGORY = "authority";
-    public static final String OBJECT_SERVICE_CATEGORY = "object";
-    public static final String PROCEDURE_SERVICE_CATEGORY = "procedure";
-
-    // FIXME: This is a quick hack; a stub / mock of a registry of
-    // authority document types and their associated parent authority
-    // service names. This MUST be replaced by a more general registry mechanism.
-    // If not, the manually-entered values below represent a DRY violation,
-    // and risk falling out of sync with comparable values elsewhere.
-    // 
-    // Per Patrick, this registry needs to be available system-wide;
-    // extend to all relevant record types; and be automatically built
-    // in some manner, such as via per-resource registration, from
-    // existing configuration, etc. - ADR 2012-05-24
-    private static Map<String, String> getDocTypeSvcNameRegistry() {
-        if (docTypeSvcNameRegistry.isEmpty()) {
-            docTypeSvcNameRegistry.put("Conceptitem", "Conceptauthorities");
-            docTypeSvcNameRegistry.put("Locationitem", "Locationauthorities");
-            docTypeSvcNameRegistry.put("Person", "Personauthorities");
-            docTypeSvcNameRegistry.put("Placeitem", "Placeauthorities");
-            docTypeSvcNameRegistry.put("Organization", "Orgauthorities");
-            docTypeSvcNameRegistry.put("Taxon", "Taxonomyauthority");
-        }
-        return docTypeSvcNameRegistry;
-    }
-
-    /**
-     * Return the parent authority service name, based on the item document
-     * type.
-     */
-    public static String getAuthoritySvcName(String docType) {
-        return getDocTypeSvcNameRegistry().get(docType);
-    }
-
-    // FIXME: The following URI construction methods are also intended to be
-    // made generally available and associated to individual services, via the
-    // registry mechanism described above. - ADR, 2012-05-24
-    public static String getUri(String serviceName, String docID) {
-        return "/" + serviceName.toLowerCase()
-                + "/" + docID;
-    }
-
-    public static String getAuthorityItemUri(String authorityServiceName, String inAuthorityID, String docID) {
-        return "/" + authorityServiceName.toLowerCase()
-                + '/' + inAuthorityID
-                + '/' + ITEMS_PATH_COMPONENT // AuthorityClient.ITEMS
-                + '/' + docID;
-    }
-    
-    // FIXME: Create equivalent getUri-type method(s) for sub-resources,
-    // such as contacts - ADR, 2012-05-24
-}
index bbf13fe53eb7004db3e978106c50fe30242e6c4e..d4e446c4349b7e972b1d420891c3062be3d19472 100644 (file)
@@ -42,11 +42,7 @@ import org.collectionspace.services.common.XmlSaxFragmenter;
 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.config.URIUtils;
-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;
 import org.dom4j.Attribute;
 import org.dom4j.Document;