From: Aron Roberts Date: Fri, 8 Jun 2012 21:53:36 +0000 (-0700) Subject: CSPACE-5271: Added debugging to dump UriTemplateRegistry contents. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=8cd525180a1e615b8e17ff8861a40d750d9f616b;p=tmp%2Fjakarta-migration.git CSPACE-5271: Added debugging to dump UriTemplateRegistry contents. --- diff --git a/services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java b/services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java index b476f5620..15a3008a3 100644 --- a/services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java +++ b/services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java @@ -59,16 +59,13 @@ import javax.ws.rs.core.Context; import java.util.HashMap; import java.util.HashSet; +import java.util.Map; import java.util.Set; //import org.collectionspace.services.common.FileUtils; import org.collectionspace.services.authorization.PermissionResource; import org.collectionspace.services.authorization.RoleResource; -import org.collectionspace.services.common.ResourceBase; -import org.collectionspace.services.common.ResourceMap; -import org.collectionspace.services.common.ResourceMapHolder; -import org.collectionspace.services.common.ResourceMapImpl; -import org.collectionspace.services.common.UriTemplateRegistry; +import org.collectionspace.services.common.*; import org.collectionspace.services.common.security.SecurityInterceptor; import org.jboss.resteasy.core.Dispatcher; import org.jboss.resteasy.spi.ResteasyProviderFactory; @@ -131,6 +128,10 @@ public class CollectionSpaceJaxRsApplication extends Application addResourceToMapAndSingletons(new ReportResource()); singletons.add(new IDResource()); + + // FIXME: Temporary for CSPACE-5271 + uriTemplateRegistry.dump(); + /* singletons.add(new WorkflowResource()); */ 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 1ebd88a3b..b2aca1fd5 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 @@ -963,7 +963,7 @@ public abstract class AuthorityResource public String getItemDocType() { // FIXME: Proof of concept placeholder - return getServiceName(); + return "item-" + getServiceName(); } @Override diff --git a/services/common/src/main/java/org/collectionspace/services/common/UriTemplateRegistry.java b/services/common/src/main/java/org/collectionspace/services/common/UriTemplateRegistry.java index 7ac6fa8fc..18131a825 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/UriTemplateRegistry.java +++ b/services/common/src/main/java/org/collectionspace/services/common/UriTemplateRegistry.java @@ -31,4 +31,11 @@ import java.util.HashMap; * accessing instances of those documents. */ public class UriTemplateRegistry extends HashMap { + + public void dump() { + for (String docTypeKey : this.keySet()) { + StoredValuesUriTemplate uriTemplate = this.get(docTypeKey); + System.out.println("Key = " + docTypeKey + ", Value = " + uriTemplate.getUriTemplateType() + " : " + uriTemplate.toString()); + } + } } 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 38031d16c..5d5553fd5 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 @@ -298,7 +298,7 @@ public abstract class AuthorityResourceWithContacts public String getContactDocType() { // FIXME: Proof of concept placeholder - return getServiceName(); + return "contact-" + getServiceName(); } @Override