}
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
return getDocType(getServiceName());\r
}\r
\r
- // FIXME: This may well be a dreadful hack, just to get this initially working.\r
+ // FIXME: The technique in getDocType(String) may well be a dreadful hack, just to get this initially working.\r
//\r
// Question:\r
// At the point we're seeking to populate docTypes in the uriTemplateRegistry, during system startup,\r
// we're not yet logged into any tenant, but instead it appears we are acting as the user SPRING_ADMIN.\r
- // Could this potentially suggest reasonable method(s), other than those below, by which we can obtain\r
- // the docType(s) associated with the current resource?\r
+ // Could this potentially suggest reasonable method(s), other than those below, which reads from\r
+ // tenant bindings configuration for an arbitrary tenant, by which we can obtain the docType(s)\r
+ // associated with the current resource?\r
\r
public String getDocType(String serviceName) {\r
String docType = "";\r
String arbitraryTenantId = "";\r
TenantBindingConfigReaderImpl reader = ServiceMain.getInstance().getTenantBindingConfigReader();\r
- // FIXME: Makes the outrageous assumption that the list of service names and associated\r
- // document types is essentially identical across tenants\r
+ // FIXME: Makes the likely unsupportable assumption that the list of service names and associated\r
+ // document types is materially identical across tenants\r
arbitraryTenantId = getArbitraryTenantId(reader);\r
if (Tools.notBlank(arbitraryTenantId)) {\r
ServiceBindingType sb = reader.getServiceBinding(arbitraryTenantId, serviceName);\r
- docType = sb.getObject().getName();\r
+ docType = sb.getObject().getName(); // reads the Nuxeo Document Type from tenant bindings configuration\r
}\r
return docType;\r
}\r
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<String,StoredValuesUriTemplate> getUriTemplateMap() {
// Get resource and item URI templates from superclass