From: Aron Roberts Date: Sat, 9 Jun 2012 00:56:36 +0000 (-0700) Subject: CSPACE-5271: Clean up cruft, tweak comments. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=5ca963a5a5905f9cbeb0f5b82f06e69a64581e77;p=tmp%2Fjakarta-migration.git CSPACE-5271: Clean up cruft, tweak comments. --- diff --git a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java index e1543c2c8..03fd6642d 100644 --- a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java +++ b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java @@ -966,34 +966,7 @@ public abstract class AuthorityResource } public String getItemDocType() { - // FIXME: Proof of concept placeholder - // return "item-" + getServiceName(); - return super.getDocType(getItemServiceName()); - - /* - // FIXME: Replace this outrageous hack; a tenant with this ID may not exist - String docType = ""; - final String DEFAULT_TENANT_ID = "1"; - TenantBindingConfigReaderImpl reader = ServiceMain.getInstance().getTenantBindingConfigReader(); - ServiceBindingType sb = reader.getServiceBinding(DEFAULT_TENANT_ID, getItemServiceName()); - docType = sb.getObject().getName(); - return docType; - - String docType = ""; - String arbitraryTenantId = ""; - ServiceBindingType sb; - TenantBindingConfigReaderImpl reader = ServiceMain.getInstance().getTenantBindingConfigReader(); - // FIXME: Makes the outrageous assumption that the list of service names and associated - // document types is essentially identical across tenants - arbitraryTenantId = getArbitraryTenantId(reader); - if (Tools.notBlank(arbitraryTenantId)) { - ServiceBindingType sb = reader.getServiceBinding(arbitraryTenantId, getItemServiceName()); - docType = sb.getObject().getName(); - } - return docType; - * - */ } @Override diff --git a/services/common/src/main/java/org/collectionspace/services/common/ResourceBase.java b/services/common/src/main/java/org/collectionspace/services/common/ResourceBase.java index 5eecf059d..7dab7c32a 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/ResourceBase.java +++ b/services/common/src/main/java/org/collectionspace/services/common/ResourceBase.java @@ -389,24 +389,25 @@ public abstract class ResourceBase return getDocType(getServiceName()); } - // FIXME: This may well be a dreadful hack, just to get this initially working. + // FIXME: The technique in getDocType(String) may well be a dreadful hack, just to get this initially working. // // Question: // At the point we're seeking to populate docTypes in the uriTemplateRegistry, during system startup, // we're not yet logged into any tenant, but instead it appears we are acting as the user SPRING_ADMIN. - // Could this potentially suggest reasonable method(s), other than those below, by which we can obtain - // the docType(s) associated with the current resource? + // Could this potentially suggest reasonable method(s), other than those below, which reads from + // tenant bindings configuration for an arbitrary tenant, by which we can obtain the docType(s) + // associated with the current resource? public String getDocType(String serviceName) { String docType = ""; String arbitraryTenantId = ""; TenantBindingConfigReaderImpl reader = ServiceMain.getInstance().getTenantBindingConfigReader(); - // FIXME: Makes the outrageous assumption that the list of service names and associated - // document types is essentially identical across tenants + // FIXME: Makes the likely unsupportable assumption that the list of service names and associated + // document types is materially identical across tenants arbitraryTenantId = getArbitraryTenantId(reader); if (Tools.notBlank(arbitraryTenantId)) { ServiceBindingType sb = reader.getServiceBinding(arbitraryTenantId, serviceName); - docType = sb.getObject().getName(); + docType = sb.getObject().getName(); // reads the Nuxeo Document Type from tenant bindings configuration } return docType; } diff --git a/services/contact/service/src/main/java/org/collectionspace/services/contact/AuthorityResourceWithContacts.java b/services/contact/service/src/main/java/org/collectionspace/services/contact/AuthorityResourceWithContacts.java index d81256c78..edf510c8a 100644 --- a/services/contact/service/src/main/java/org/collectionspace/services/contact/AuthorityResourceWithContacts.java +++ b/services/contact/service/src/main/java/org/collectionspace/services/contact/AuthorityResourceWithContacts.java @@ -301,6 +301,10 @@ public abstract class AuthorityResourceWithContacts return ContactConstants.NUXEO_DOCTYPE; } + // FIXME: This currently populates only one entry in the UriTemplateRegistry + // for the Contacts docType, even though contacts can be a sub-resource of + // multiple authority item resources. (This method is called more than once, + // but each time the existing item with the same key in the map is overwritten.) @Override public Map getUriTemplateMap() { // Get resource and item URI templates from superclass