}
public static class CsidAndShortIdentifier {
-
String CSID;
String shortIdentifier;
}
parentShortIdentifier = FETCH_SHORT_ID;
} else {
parentShortIdentifier = parentSpec.value;
- String whereClause = buildWhereForAuthByName(parentSpec.value);
+ String whereClause = RefNameServiceUtils.buildWhereForAuthByName(authorityCommonSchemaName, parentSpec.value);
ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(getServiceName(), uriInfo);
parentcsid = getRepositoryClient(ctx).findDocCSID(null, ctx, whereClause); //FIXME: REM - If the parent has been soft-deleted, should we be looking for the item?
}
if (itemSpec.form == SpecifierForm.CSID) {
itemcsid = itemSpec.value;
} else {
- String itemWhereClause = buildWhereForAuthItemByName(itemSpec.value, parentcsid);
+ String itemWhereClause = RefNameServiceUtils.buildWhereForAuthItemByName(authorityItemCommonSchemaName, itemSpec.value, parentcsid);
itemcsid = getRepositoryClient(ctx).findDocCSID(null, ctx, itemWhereClause); //FIXME: REM - Should we be looking for the 'wf_deleted' query param and filtering on it?
}
return itemcsid;
if(item == null) {
return null;
}
- String whereClause = buildWhereForAuthByName(item.getParentShortIdentifier());
+ String whereClause = RefNameServiceUtils.buildWhereForAuthByName(authorityCommonSchemaName, item.getParentShortIdentifier());
// Ensure we have the right context.
ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(item.inAuthority.resource);
RepositoryClientImpl client = (RepositoryClientImpl)getRepositoryClient(ctx);
String parentcsid = client.findDocCSID(repoSession, ctx, whereClause);
- String itemWhereClause = buildWhereForAuthItemByName(item.getShortIdentifier(), parentcsid);
+ String itemWhereClause = RefNameServiceUtils.buildWhereForAuthItemByName(authorityItemCommonSchemaName, item.getShortIdentifier(), parentcsid);
ctx = createServiceContext(getItemServiceName());
DocumentWrapper<DocumentModel> docWrapper = client.findDoc(repoSession, ctx, itemWhereClause);
DocumentModel docModel = docWrapper.getWrappedObject();
}
}
- protected String buildWhereForAuthByName(String name) {
- return authorityCommonSchemaName
- + ":" + AuthorityJAXBSchema.SHORT_IDENTIFIER
- + "='" + name + "'";
- }
- protected String buildWhereForAuthItemByName(String name, String parentcsid) {
- return authorityItemCommonSchemaName
- + ":" + AuthorityItemJAXBSchema.SHORT_IDENTIFIER
- + "='" + name + "' AND "
- + authorityItemCommonSchemaName + ":"
- + AuthorityItemJAXBSchema.IN_AUTHORITY + "="
- + "'" + parentcsid + "'";
- }
+ /**
+ * Synchronizes the authority and its terms with a Shared Authority Server.
+ *
+ * @param specifier either a CSID or one of the urn forms
+ *
+ * @return the authority
+ */
+ @GET
+ @Path("{csid}/sync")
+ public Response synchronize(
+ @Context Request request,
+ @Context UriInfo ui,
+ @PathParam("csid") String csid) {
+ boolean result = false;
+ Specifier specifier;
+
+ try {
+ ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(ui);
+ AuthorityDocumentModelHandler handler = (AuthorityDocumentModelHandler)createDocumentHandler(ctx);
+ specifier = getSpecifier(csid, "getAuthority", "GET");
+ result = handler.synchronize(specifier);
+ } catch (Exception e) {
+ throw bigReThrow(e, ServiceMessages.SYNC_FAILED, csid);
+ }
+ if (result == false) {
+ Response response = Response.status(Response.Status.NOT_FOUND).entity(
+ "Get failed, the requested Authority specifier:" + specifier + ": was not found.").type(
+ "text/plain").build();
+ throw new CSWebApplicationException(response);
+ }
+
+ return Response.status(Response.Status.OK).entity(
+ "Synchronization completed, the requested Authority specifier:" + specifier.value + ": was synchronized.").type(
+ "text/plain").build();
+ }
+
/**
* Gets the authority.
*
}
getRepositoryClient(ctx).get(ctx, spec.value, handler);
} else {
- String whereClause = buildWhereForAuthByName(spec.value);
+ String whereClause = RefNameServiceUtils.buildWhereForAuthByName(authorityCommonSchemaName, spec.value);
DocumentFilter myFilter = new NuxeoDocumentFilter(whereClause, 0, 1);
handler.setDocumentFilter(myFilter);
getRepositoryClient(ctx).get(ctx, handler);
if (spec.form == SpecifierForm.CSID) {
csid = spec.value;
} else {
- String whereClause = buildWhereForAuthByName(spec.value);
+ String whereClause = RefNameServiceUtils.buildWhereForAuthByName(authorityCommonSchemaName, spec.value);
csid = getRepositoryClient(ctx).findDocCSID(null, ctx, whereClause);
}
getRepositoryClient(ctx).update(ctx, csid, handler);
if (logger.isDebugEnabled()) {
logger.debug("deleteAuthority with specifier=" + spec.value);
}
- String whereClause = buildWhereForAuthByName(spec.value);
+ String whereClause = RefNameServiceUtils.buildWhereForAuthByName(authorityCommonSchemaName, spec.value);
getRepositoryClient(ctx).deleteWithWhereClause(ctx, whereClause, handler);
}
getRepositoryClient(ctx).get(ctx, itemSpec.value, handler);
} else {
String itemWhereClause =
- buildWhereForAuthItemByName(itemSpec.value, parentcsid);
+ RefNameServiceUtils.buildWhereForAuthItemByName(authorityItemCommonSchemaName, itemSpec.value, parentcsid);
DocumentFilter myFilter = new NuxeoDocumentFilter(itemWhereClause, 0, 1); // start at page 0 and get 1 item
handler.setDocumentFilter(myFilter);
getRepositoryClient(ctx).get(ctx, handler);
import org.collectionspace.services.common.api.Tools;
import org.collectionspace.services.common.context.ServiceContext;
import org.collectionspace.services.common.document.DocumentException;
+import org.collectionspace.services.common.document.DocumentFilter;
import org.collectionspace.services.common.document.DocumentNotFoundException;
import org.collectionspace.services.common.document.DocumentWrapper;
import org.collectionspace.services.common.document.DocumentHandler.Action;
import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
import org.collectionspace.services.common.vocabulary.AuthorityJAXBSchema;
+import org.collectionspace.services.common.vocabulary.AuthorityResource.Specifier;
+import org.collectionspace.services.common.vocabulary.AuthorityResource.SpecifierForm;
+import org.collectionspace.services.common.vocabulary.RefNameServiceUtils;
import org.collectionspace.services.config.service.ObjectPartType;
+import org.collectionspace.services.nuxeo.client.java.NuxeoDocumentFilter;
import org.collectionspace.services.nuxeo.client.java.NuxeoDocumentModelHandler;
import org.collectionspace.services.nuxeo.client.java.CoreSessionInterface;
import org.collectionspace.services.nuxeo.client.java.RepositoryClientImpl;
extends NuxeoDocumentModelHandler<AuthCommon> {
private final Logger logger = LoggerFactory.getLogger(AuthorityDocumentModelHandler.class);
- private String authorityCommonSchemaName;
+ protected String authorityCommonSchemaName;
+ protected String authorityItemCommonSchemaName;
- public AuthorityDocumentModelHandler(String authorityCommonSchemaName) {
+ public AuthorityDocumentModelHandler(String authorityCommonSchemaName, String authorityItemCommonSchemaName) {
this.authorityCommonSchemaName = authorityCommonSchemaName;
+ this.authorityItemCommonSchemaName = authorityItemCommonSchemaName;
+ }
+
+
+ public boolean synchronize(Specifier specifier) throws DocumentNotFoundException, DocumentException {
+ boolean result = true;
+
+ ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = this.getServiceContext();
+ if (specifier.form == SpecifierForm.CSID) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Synchronize Authority with csid=" + specifier.value);
+ }
+ getRepositoryClient(ctx).get(getServiceContext(), specifier.value, this);
+ } else {
+ String whereClause = RefNameServiceUtils.buildWhereForAuthByName(authorityCommonSchemaName, specifier.value);
+ DocumentFilter myFilter = new NuxeoDocumentFilter(whereClause, 0, 1);
+ this.setDocumentFilter(myFilter);
+ getRepositoryClient(ctx).get(ctx, this);
+ }
+
+ PoxPayloadOut output = ctx.getOutput();
+
+ return result;
}
/*
package org.collectionspace.services.citation.nuxeo;
import org.collectionspace.services.citation.CitationauthoritiesCommon;
+import org.collectionspace.services.client.CitationAuthorityClient;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityDocumentModelHandler;
/**
* CitationAuthorityDocumentModelHandler
*
- * $LastChangedRevision: $
- * $LastChangedDate: $
*/
public class CitationAuthorityDocumentModelHandler
extends AuthorityDocumentModelHandler<CitationauthoritiesCommon> {
-
- /**
- * Common part schema label
- */
- static final String COMMON_PART_LABEL = "citationauthorities_common";
public CitationAuthorityDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(CitationAuthorityClient.SERVICE_COMMON_PART_NAME, CitationAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
}
/**
*/
package org.collectionspace.services.citation.nuxeo;
-import java.util.Arrays;
-import java.util.List;
-
import org.collectionspace.services.client.CitationAuthorityClient;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
-import org.collectionspace.services.CitationJAXBSchema;
import org.collectionspace.services.citation.CitationsCommon;
-import org.nuxeo.ecm.core.api.DocumentModel;
/**
* CitationDocumentModelHandler
*
- * $LastChangedRevision: $
- * $LastChangedDate: $
- */
-/**
- * @author pschmitz
- *
*/
public class CitationDocumentModelHandler
- extends AuthorityItemDocumentModelHandler<CitationsCommon> {
-
- /** The logger. */
- //private final Logger logger = LoggerFactory.getLogger(CitationDocumentModelHandler.class);
- /**
- * Common part schema label
- */
- private static final String COMMON_PART_LABEL = "citations_common";
+ extends AuthorityItemDocumentModelHandler<CitationsCommon> {
public CitationDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(CitationAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
}
@Override
@Override
public String getParentCommonSchemaName() {
// TODO Auto-generated method stub
- return CitationAuthorityDocumentModelHandler.COMMON_PART_LABEL;
+ return CitationAuthorityClient.SERVICE_COMMON_PART_NAME;
}
}
public static final String VALIDATION_FAILURE = "Validation failure ";
public static final String MISSING_CSID = "missing csid";
public static final String MISSING_INVALID_CSID = "missing/invalid csid=";
+ public static final String SYNC_FAILED = "Synchonization failed.";
public static String resourceNotFoundMsg(String csid) {
return String.format("The resource identified by CSID '%s' was not found.", csid);
import org.nuxeo.ecm.core.api.model.PropertyNotFoundException;
import org.nuxeo.ecm.core.api.model.impl.primitives.StringProperty;
import org.nuxeo.ecm.core.api.CoreSession;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import org.collectionspace.services.client.CollectionSpaceClient;
import org.collectionspace.services.client.IQueryManager;
import org.collectionspace.services.client.IRelationsManager;
logger.debug("PropertyException on: " + prop.getPath() + pe.getLocalizedMessage());
}
}
+
+ public static String buildWhereForAuthByName(String authorityCommonSchemaName, String name) {
+ return authorityCommonSchemaName
+ + ":" + AuthorityJAXBSchema.SHORT_IDENTIFIER
+ + "='" + name + "'";
+ }
+
+ public static String buildWhereForAuthItemByName(String authorityItemCommonSchemaName, String name, String parentcsid) {
+ return authorityItemCommonSchemaName
+ + ":" + AuthorityItemJAXBSchema.SHORT_IDENTIFIER
+ + "='" + name + "' AND "
+ + authorityItemCommonSchemaName + ":"
+ + AuthorityItemJAXBSchema.IN_AUTHORITY + "="
+ + "'" + parentcsid + "'";
+ }
/*
* Identifies whether the refName was found in the supplied field. If passed
*/
package org.collectionspace.services.concept.nuxeo;
+import org.collectionspace.services.client.ConceptAuthorityClient;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityDocumentModelHandler;
import org.collectionspace.services.concept.ConceptauthoritiesCommon;
/**
* ConceptAuthorityDocumentModelHandler
*
- * $LastChangedRevision: $
- * $LastChangedDate: $
*/
public class ConceptAuthorityDocumentModelHandler
extends AuthorityDocumentModelHandler<ConceptauthoritiesCommon> {
-
- /**
- * Common part schema label
- */
- static final String COMMON_PART_LABEL = "conceptauthorities_common";
public ConceptAuthorityDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(ConceptAuthorityClient.SERVICE_COMMON_PART_NAME, ConceptAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
}
/**
/**
* ConceptDocumentModelHandler
*
- * $LastChangedRevision: $
- * $LastChangedDate: $
- */
-/**
- * @author pschmitz
- *
*/
public class ConceptDocumentModelHandler
extends AuthorityItemDocumentModelHandler<ConceptsCommon> {
return ConceptAuthorityClient.SERVICE_PATH_COMPONENT; // CSPACE-3932
}
- /**
- * Note that Concept has no displayName computation support.
- */
-
/**
* getQProperty converts the given property to qualified schema property
* @param prop
@Override
public String getParentCommonSchemaName() {
// TODO Auto-generated method stub
- return ConceptAuthorityDocumentModelHandler.COMMON_PART_LABEL;
+ return ConceptAuthorityClient.SERVICE_COMMON_PART_NAME;
}
-
}
*/
package org.collectionspace.services.location.nuxeo;
+import org.collectionspace.services.client.LocationAuthorityClient;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityDocumentModelHandler;
import org.collectionspace.services.location.LocationauthoritiesCommon;
/**
* LocationAuthorityDocumentModelHandler
*
- * $LastChangedRevision: $
- * $LastChangedDate: $
*/
public class LocationAuthorityDocumentModelHandler
extends AuthorityDocumentModelHandler<LocationauthoritiesCommon> {
-
- /**
- * Common part schema label
- */
- static final String COMMON_PART_LABEL = "locationauthorities_common";
public LocationAuthorityDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(LocationAuthorityClient.SERVICE_COMMON_PART_NAME, LocationAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
}
/**
*/
package org.collectionspace.services.location.nuxeo;
-import org.collectionspace.services.LocationJAXBSchema;
import org.collectionspace.services.client.LocationAuthorityClient;
-import org.collectionspace.services.common.document.DocumentWrapper;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
import org.collectionspace.services.location.LocationsCommon;
-import org.nuxeo.ecm.core.api.DocumentModel;
/**
* LocationDocumentModelHandler
*
- * $LastChangedRevision: $
- * $LastChangedDate: $
- */
-/**
- * @author pschmitz
- *
*/
public class LocationDocumentModelHandler
extends AuthorityItemDocumentModelHandler<LocationsCommon> {
-
- /**
- * Common part schema label
- */
- private static final String COMMON_PART_LABEL = "locations_common";
public LocationDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(LocationAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
}
@Override
public String getAuthorityServicePath(){
return LocationAuthorityClient.SERVICE_PATH_COMPONENT; // CSPACE-3932
}
-
- /**
- * Handle display name.
- *
- * @param docModel the doc model
- * @throws Exception the exception
- */
-// @Override
-// protected void handleComputedDisplayNames(DocumentModel docModel) throws Exception {
-// String commonPartLabel = getServiceContext().getCommonPartLabel("locations");
-// Boolean displayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
-// LocationJAXBSchema.DISPLAY_NAME_COMPUTED);
-// Boolean shortDisplayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
-// LocationJAXBSchema.SHORT_DISPLAY_NAME_COMPUTED);
-// if(displayNameComputed==null)
-// displayNameComputed = true;
-// if(shortDisplayNameComputed==null)
-// shortDisplayNameComputed = true;
-// if (displayNameComputed || shortDisplayNameComputed) {
-// String displayName = prepareDefaultDisplayName(
-// (String)docModel.getProperty(commonPartLabel, LocationJAXBSchema.NAME ));
-// if (displayNameComputed) {
-// docModel.setProperty(commonPartLabel, LocationJAXBSchema.DISPLAY_NAME,
-// displayName);
-// }
-// if (shortDisplayNameComputed) {
-// docModel.setProperty(commonPartLabel, LocationJAXBSchema.SHORT_DISPLAY_NAME,
-// displayName);
-// }
-// }
-// }
-
- /**
- * Produces a default displayName from the basic name and dates fields.
- * @see LocationAuthorityClientUtils.prepareDefaultDisplayName() which
- * duplicates this logic, until we define a service-general utils package
- * that is neither client nor service specific.
- * @param foreName
- * @param middleName
- * @param surName
- * @param birthDate
- * @param deathDate
- * @return
- * @throws Exception
- */
- private static String prepareDefaultDisplayName(
- String name ) throws Exception {
- StringBuilder newStr = new StringBuilder();
- newStr.append(name);
- return newStr.toString();
- }
-
+
/**
* getQProperty converts the given property to qualified schema property
* @param prop
@Override
public String getParentCommonSchemaName() {
// TODO Auto-generated method stub
- return LocationAuthorityDocumentModelHandler.COMMON_PART_LABEL;
+ return LocationAuthorityClient.SERVICE_COMMON_PART_NAME;
}
-
}
*/
package org.collectionspace.services.material.nuxeo;
+import org.collectionspace.services.client.MaterialAuthorityClient;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityDocumentModelHandler;
import org.collectionspace.services.material.MaterialauthoritiesCommon;
*/
public class MaterialAuthorityDocumentModelHandler
extends AuthorityDocumentModelHandler<MaterialauthoritiesCommon> {
-
- /**
- * Common part schema label
- */
- static final String COMMON_PART_LABEL = "materialauthorities_common";
public MaterialAuthorityDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(MaterialAuthorityClient.SERVICE_COMMON_PART_NAME, MaterialAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
}
/**
*/
package org.collectionspace.services.material.nuxeo;
-import org.collectionspace.services.MaterialJAXBSchema;
import org.collectionspace.services.client.MaterialAuthorityClient;
-import org.collectionspace.services.common.document.DocumentWrapper;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
import org.collectionspace.services.material.MaterialsCommon;
-import org.nuxeo.ecm.core.api.DocumentModel;
/**
* MaterialDocumentModelHandler
public class MaterialDocumentModelHandler
extends AuthorityItemDocumentModelHandler<MaterialsCommon> {
- /**
- * Common part schema label
- */
- private static final String COMMON_PART_LABEL = "materials_common";
-
public MaterialDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(MaterialAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
}
@Override
public String getAuthorityServicePath(){
return MaterialAuthorityClient.SERVICE_PATH_COMPONENT; // CSPACE-3932
}
-
- /**
- * Handle display name.
- *
- * @param docModel the doc model
- * @throws Exception the exception
- */
-// @Override
-// protected void handleComputedDisplayNames(DocumentModel docModel) throws Exception {
-// String commonPartLabel = getServiceContext().getCommonPartLabel("materials");
-// Boolean displayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
-// MaterialJAXBSchema.DISPLAY_NAME_COMPUTED);
-// Boolean shortDisplayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
-// MaterialJAXBSchema.SHORT_DISPLAY_NAME_COMPUTED);
-// if(displayNameComputed==null)
-// displayNameComputed = true;
-// if(shortDisplayNameComputed==null)
-// shortDisplayNameComputed = true;
-// if (displayNameComputed || shortDisplayNameComputed) {
-// // Obtain the primary material name from the list of material names, for computing the display name.
-// String xpathToMaterialName = MaterialJAXBSchema.MATERIAL_TERM_NAME_GROUP_LIST
-// + "/[0]/" + MaterialeJAXBSchema.MATERIAL_TERM_NAME;
-// String materialName = getXPathStringValue(docModel, COMMON_PART_LABEL, xpathToMaterialName);
-// String displayName = prepareDefaultDisplayName(materialName);
-// if (displayNameComputed) {
-// docModel.setProperty(commonPartLabel, MaterialJAXBSchema.DISPLAY_NAME,
-// displayName);
-// }
-// if (shortDisplayNameComputed) {
-// docModel.setProperty(commonPartLabel, MaterialJAXBSchema.SHORT_DISPLAY_NAME,
-// displayName);
-// }
-// }
-// }
-
- /**
- * Produces a default displayName from one or more supplied fields.
- * @see MaterialAuthorityClientUtils.prepareDefaultDisplayName() which
- * duplicates this logic, until we define a service-general utils package
- * that is neither client nor service specific.
- * @param materialName
- * @return the default display name
- * @throws Exception
- */
- private static String prepareDefaultDisplayName(
- String materialName ) throws Exception {
- StringBuilder newStr = new StringBuilder();
- newStr.append(materialName);
- return newStr.toString();
- }
/**
* getQProperty converts the given property to qualified schema property
@Override
public String getParentCommonSchemaName() {
// TODO Auto-generated method stub
- return MaterialAuthorityDocumentModelHandler.COMMON_PART_LABEL;
+ return MaterialAuthorityClient.SERVICE_COMMON_PART_NAME;
}
-
}
package org.collectionspace.services.organization.nuxeo;
import org.collectionspace.services.organization.OrgauthoritiesCommon;
+import org.collectionspace.services.client.OrgAuthorityClient;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityDocumentModelHandler;
/**
* OrgAuthorityDocumentModelHandler
*
- * $LastChangedRevision$
- * $LastChangedDate$
*/
public class OrgAuthorityDocumentModelHandler
extends AuthorityDocumentModelHandler<OrgauthoritiesCommon> {
-
- /**
- * Common part schema label
- */
- static final String COMMON_PART_LABEL = "orgauthorities_common";
public OrgAuthorityDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(OrgAuthorityClient.SERVICE_COMMON_PART_NAME, OrgAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
}
/**
import org.collectionspace.services.client.OrgAuthorityClient;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
-import org.collectionspace.services.OrganizationJAXBSchema;
-import org.collectionspace.services.common.document.DocumentWrapper;
import org.collectionspace.services.organization.OrganizationsCommon;
-import org.nuxeo.ecm.core.api.DocumentModel;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* OrganizationDocumentModelHandler
*
- * $LastChangedRevision$
- * $LastChangedDate$
*/
public class OrganizationDocumentModelHandler
extends AuthorityItemDocumentModelHandler<OrganizationsCommon> {
- /** The logger. */
- private final Logger logger = LoggerFactory.getLogger(OrganizationDocumentModelHandler.class);
- /**
- * Common part schema label
- */
- private static final String COMMON_PART_LABEL = "organizations_common";
-
public OrganizationDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(OrgAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
}
@Override
return OrgAuthorityClient.SERVICE_PATH_COMPONENT; // CSPACE-3932
}
- /**
- * Check the logic around the computed displayName
- *
- * @param docModel
- *
- * @throws Exception the exception
- */
-// @Override
-// protected void handleComputedDisplayNames(DocumentModel docModel) throws Exception {
-// String commonPartLabel = getServiceContext().getCommonPartLabel("organizations");
-// Boolean displayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
-// OrganizationJAXBSchema.DISPLAY_NAME_COMPUTED);
-// Boolean shortDisplayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
-// OrganizationJAXBSchema.SHORT_DISPLAY_NAME_COMPUTED);
-// if(displayNameComputed==null)
-// displayNameComputed = Boolean.TRUE;
-// if(shortDisplayNameComputed==null)
-// shortDisplayNameComputed = Boolean.TRUE;
-// if (displayNameComputed.booleanValue() || shortDisplayNameComputed.booleanValue()) {
-// String shortName = getStringValueInPrimaryRepeatingComplexProperty(
-// docModel, commonPartLabel, OrganizationJAXBSchema.MAIN_BODY_GROUP_LIST,
-// OrganizationJAXBSchema.SHORT_NAME);
-// // FIXME: Determine how to handle cases where primary short name is null or empty.
-// if(shortDisplayNameComputed.booleanValue()) {
-// String displayName = prepareDefaultDisplayName(shortName, null);
-// docModel.setProperty(commonPartLabel, OrganizationJAXBSchema.SHORT_DISPLAY_NAME,
-// displayName);
-// }
-// if(displayNameComputed.booleanValue()) {
-// String foundingPlace = (String) docModel.getProperty(commonPartLabel,
-// OrganizationJAXBSchema.FOUNDING_PLACE);
-// String displayName = prepareDefaultDisplayName(shortName, foundingPlace);
-// docModel.setProperty(commonPartLabel, OrganizationJAXBSchema.DISPLAY_NAME,
-// displayName);
-// }
-// }
-// }
-
- /**
- * Produces a default displayName from the basic name and foundingPlace fields.
- * @see OrgAuthorityClientUtils.prepareDefaultDisplayName() which
- * duplicates this logic, until we define a service-general utils package
- * that is neither client nor service specific.
- * @param shortName
- * @param foundingPlace
- * @return
- * @throws Exception
- */
- private static String prepareDefaultDisplayName(
- String shortName, String foundingPlace ) throws Exception {
- StringBuilder newStr = new StringBuilder();
- final String sep = " ";
- boolean firstAdded = false;
- if(null != shortName ) {
- newStr.append(shortName);
- firstAdded = true;
- }
- // Now we add the place
- if(null != foundingPlace ) {
- if(firstAdded) {
- newStr.append(sep);
- }
- newStr.append(foundingPlace);
- }
- return newStr.toString();
- }
-
/**
* getQProperty converts the given property to qualified schema property
* @param prop
@Override
public String getParentCommonSchemaName() {
// TODO Auto-generated method stub
- return OrgAuthorityDocumentModelHandler.COMMON_PART_LABEL;
+ return OrgAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
}
-
}
package org.collectionspace.services.person.nuxeo;
import org.collectionspace.services.person.PersonauthoritiesCommon;
+import org.collectionspace.services.client.PersonAuthorityClient;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityDocumentModelHandler;
/**
* PersonAuthorityDocumentModelHandler
*
- * $LastChangedRevision: $
- * $LastChangedDate: $
*/
public class PersonAuthorityDocumentModelHandler
extends AuthorityDocumentModelHandler<PersonauthoritiesCommon> {
- /**
- * Common part schema label
- */
- static final String COMMON_PART_LABEL = "personauthorities_common";
-
public PersonAuthorityDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(PersonAuthorityClient.SERVICE_COMMON_PART_NAME, PersonAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
}
/**
*/
package org.collectionspace.services.person.nuxeo;
-import java.util.Arrays;
-import java.util.List;
-
import org.collectionspace.services.client.PersonAuthorityClient;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
-import org.collectionspace.services.PersonJAXBSchema;
import org.collectionspace.services.person.PersonsCommon;
-import org.nuxeo.ecm.core.api.DocumentModel;
/**
* PersonDocumentModelHandler
*
- * $LastChangedRevision: $
- * $LastChangedDate: $
- */
-/**
- * @author pschmitz
- *
*/
public class PersonDocumentModelHandler
extends AuthorityItemDocumentModelHandler<PersonsCommon> {
- /** The logger. */
- //private final Logger logger = LoggerFactory.getLogger(PersonDocumentModelHandler.class);
- /**
- * Common part schema label
- */
- private static final String COMMON_PART_LABEL = "persons_common";
-
public PersonDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(PersonAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
}
@Override
public String getAuthorityServicePath(){
return PersonAuthorityClient.SERVICE_PATH_COMPONENT; // CSPACE-3932
}
-
- /**
- * Handle display names.
- *
- * @param docModel the doc model
- * @throws Exception the exception
- */
- /*
- @Override
- protected void handleComputedDisplayNames(DocumentModel docModel) throws Exception {
- String commonPartLabel = getServiceContext().getCommonPartLabel("persons");
- Boolean displayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
- PersonJAXBSchema.DISPLAY_NAME_COMPUTED);
- Boolean shortDisplayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
- PersonJAXBSchema.SHORT_DISPLAY_NAME_COMPUTED);
- if(displayNameComputed==null)
- displayNameComputed = true;
- if(shortDisplayNameComputed==null)
- shortDisplayNameComputed = true;
- if (displayNameComputed || shortDisplayNameComputed) {
- String forename =
- (String)docModel.getProperty(commonPartLabel, PersonJAXBSchema.FORE_NAME);
- String lastname =
- (String)docModel.getProperty(commonPartLabel, PersonJAXBSchema.SUR_NAME);
- if(shortDisplayNameComputed) {
- String displayName = prepareDefaultDisplayName(forename, null, lastname,
- null, null);
- docModel.setProperty(commonPartLabel, PersonJAXBSchema.SHORT_DISPLAY_NAME,
- displayName);
- }
- if(displayNameComputed) {
- String midname =
- (String)docModel.getProperty(commonPartLabel, PersonJAXBSchema.MIDDLE_NAME);
- String birthdate =
- (String)docModel.getProperty(commonPartLabel, PersonJAXBSchema.BIRTH_DATE);
- String deathdate =
- (String)docModel.getProperty(commonPartLabel, PersonJAXBSchema.DEATH_DATE);
- String displayName = prepareDefaultDisplayName(forename, midname, lastname,
- birthdate, deathdate);
- docModel.setProperty(commonPartLabel, PersonJAXBSchema.DISPLAY_NAME,
- displayName);
- }
- }
- }
- *
- */
-
-
- /**
- * Produces a default displayName from the basic name and dates fields.
- * see PersonAuthorityClientUtils.prepareDefaultDisplayName(String,String,String,String,String) which
- * duplicates this logic, until we define a service-general utils package
- * that is neither client nor service specific.
- * @param foreName
- * @param middleName
- * @param surName
- * @param birthDate
- * @param deathDate
- * @return
- * @throws Exception
- */
- /*
- private static String prepareDefaultDisplayName(
- String foreName, String middleName, String surName,
- String birthDate, String deathDate ) throws Exception {
- final String SEP = " ";
- final String DATE_SEP = "-";
-
- StringBuilder newStr = new StringBuilder();
- List<String> nameStrings =
- Arrays.asList(foreName, middleName, surName);
- boolean firstAdded = false;
- for (String partStr : nameStrings ){
- if (partStr != null) {
- if (firstAdded == true) {
- newStr.append(SEP);
- }
- newStr.append(partStr);
- firstAdded = true;
- }
- }
- // Now we add the dates. In theory could have dates with no name, but that is their problem.
- boolean foundBirth = false;
- if (birthDate != null) {
- if (firstAdded) {
- newStr.append(SEP);
- }
- newStr.append(birthDate);
- newStr.append(DATE_SEP); // Put this in whether there is a death date or not
- foundBirth = true;
- }
- if (deathDate != null) {
- if (!foundBirth) {
- if (firstAdded == true) {
- newStr.append(SEP);
- }
- newStr.append(DATE_SEP);
- }
- newStr.append(deathDate);
- }
-
- return newStr.toString();
- }
- *
- */
-
+
/**
* getQProperty converts the given property to qualified schema property
* @param prop
@Override
public String getParentCommonSchemaName() {
// TODO Auto-generated method stub
- return PersonAuthorityDocumentModelHandler.COMMON_PART_LABEL;
+ return PersonAuthorityClient.SERVICE_COMMON_PART_NAME;
}
-
}
*/
package org.collectionspace.services.place.nuxeo;
+import org.collectionspace.services.client.PlaceAuthorityClient;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityDocumentModelHandler;
import org.collectionspace.services.place.PlaceauthoritiesCommon;
/**
* PlaceAuthorityDocumentModelHandler
*
- * $LastChangedRevision: $
- * $LastChangedDate: $
*/
public class PlaceAuthorityDocumentModelHandler
extends AuthorityDocumentModelHandler<PlaceauthoritiesCommon> {
- /**
- * Common part schema label
- */
- static final String COMMON_PART_LABEL = "placeauthorities_common";
-
public PlaceAuthorityDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(PlaceAuthorityClient.SERVICE_COMMON_PART_NAME, PlaceAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
}
/**
*/
package org.collectionspace.services.place.nuxeo;
-import org.collectionspace.services.PlaceJAXBSchema;
import org.collectionspace.services.client.PlaceAuthorityClient;
-import org.collectionspace.services.common.document.DocumentWrapper;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
import org.collectionspace.services.place.PlacesCommon;
-import org.nuxeo.ecm.core.api.DocumentModel;
/**
* PlaceDocumentModelHandler
*
- * $LastChangedRevision: $
- * $LastChangedDate: $
- */
-/**
- * @author pschmitz
- *
*/
public class PlaceDocumentModelHandler
extends AuthorityItemDocumentModelHandler<PlacesCommon> {
- /**
- * Common part schema label
- */
- private static final String COMMON_PART_LABEL = "places_common";
-
public PlaceDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(PlaceAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
}
@Override
return PlaceAuthorityClient.SERVICE_PATH_COMPONENT; // CSPACE-3932
}
- /**
- * Handle display name.
- *
- * @param docModel the doc model
- * @throws Exception the exception
- */
-// @Override
-// protected void handleComputedDisplayNames(DocumentModel docModel) throws Exception {
-// String commonPartLabel = getServiceContext().getCommonPartLabel("places");
-// Boolean displayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
-// PlaceJAXBSchema.DISPLAY_NAME_COMPUTED);
-// Boolean shortDisplayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
-// PlaceJAXBSchema.SHORT_DISPLAY_NAME_COMPUTED);
-// if(displayNameComputed==null)
-// displayNameComputed = true;
-// if(shortDisplayNameComputed==null)
-// shortDisplayNameComputed = true;
-// if (displayNameComputed || shortDisplayNameComputed) {
-// // Obtain the primary place name from the list of place names, for computing the display name.
-// String xpathToPlaceName = PlaceJAXBSchema.PLACE_NAME_GROUP_LIST
-// + "/[0]/" + PlaceJAXBSchema.PLACE_NAME;
-// String placeName = getXPathStringValue(docModel, COMMON_PART_LABEL, xpathToPlaceName);
-// String displayName = prepareDefaultDisplayName(placeName);
-// if (displayNameComputed) {
-// docModel.setProperty(commonPartLabel, PlaceJAXBSchema.DISPLAY_NAME,
-// displayName);
-// }
-// if (shortDisplayNameComputed) {
-// docModel.setProperty(commonPartLabel, PlaceJAXBSchema.SHORT_DISPLAY_NAME,
-// displayName);
-// }
-// }
-// }
-
- /**
- * Produces a default displayName from one or more supplied fields.
- * @see PlaceAuthorityClientUtils.prepareDefaultDisplayName() which
- * duplicates this logic, until we define a service-general utils package
- * that is neither client nor service specific.
- * @param placeName
- * @return the default display name
- * @throws Exception
- */
- private static String prepareDefaultDisplayName(
- String placeName ) throws Exception {
- StringBuilder newStr = new StringBuilder();
- newStr.append(placeName);
- return newStr.toString();
- }
-
/**
* getQProperty converts the given property to qualified schema property
* @param prop
@Override
public String getParentCommonSchemaName() {
// TODO Auto-generated method stub
- return PlaceAuthorityDocumentModelHandler.COMMON_PART_LABEL;
+ return PlaceAuthorityClient.SERVICE_COMMON_PART_NAME;
}
}
package org.collectionspace.services.taxonomy.nuxeo;
import org.collectionspace.services.client.TaxonomyAuthorityClient;
-import org.collectionspace.services.TaxonJAXBSchema;
-import org.collectionspace.services.common.document.DocumentWrapper;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
import org.collectionspace.services.taxonomy.TaxonCommon;
-import org.nuxeo.ecm.core.api.DocumentModel;
/**
* TaxonomyDocumentModelHandler
*
- * $LastChangedRevision$
- * $LastChangedDate$
- */
-/**
- * @author pschmitz
- *
*/
public class TaxonDocumentModelHandler
extends AuthorityItemDocumentModelHandler<TaxonCommon> {
- /**
- * Common part schema label
- */
- private static final String COMMON_PART_LABEL = "taxon_common";
-
public TaxonDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(TaxonomyAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
}
+ @Override
public String getAuthorityServicePath(){
return TaxonomyAuthorityClient.SERVICE_PATH_COMPONENT;
}
- /**
- * Handle display name.
- *
- * @param docModel the doc model
- * @throws Exception the exception
- */
-// @Override
-// protected void handleComputedDisplayNames(DocumentModel docModel) throws Exception {
-// String commonPartLabel = getServiceContext().getCommonPartLabel("taxon");
-// Boolean displayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
-// TaxonJAXBSchema.DISPLAY_NAME_COMPUTED);
-// Boolean shortDisplayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
-// TaxonJAXBSchema.SHORT_DISPLAY_NAME_COMPUTED);
-// if (displayNameComputed == null) {
-// displayNameComputed = true;
-// }
-// if (shortDisplayNameComputed == null) {
-// shortDisplayNameComputed = true;
-// }
-// if (displayNameComputed || shortDisplayNameComputed) {
-// String displayName = prepareDefaultDisplayName(
-// (String) docModel.getProperty(commonPartLabel, TaxonJAXBSchema.NAME));
-// if (displayNameComputed) {
-// docModel.setProperty(commonPartLabel, TaxonJAXBSchema.DISPLAY_NAME,
-// displayName);
-// }
-// if (shortDisplayNameComputed) {
-// docModel.setProperty(commonPartLabel, TaxonJAXBSchema.SHORT_DISPLAY_NAME,
-// displayName);
-// }
-// }
-// }
-
- /**
- * Produces a default displayName from the basic name and dates fields.
- * @see TaxonomyAuthorityClientUtils.prepareDefaultDisplayName() which
- * duplicates this logic, until we define a service-general utils package
- * that is neither client nor service specific.
- * @param name
- * @return
- * @throws Exception
- */
- private static String prepareDefaultDisplayName(
- String name) throws Exception {
- StringBuilder newStr = new StringBuilder();
- newStr.append(name);
- return newStr.toString();
- }
-
/**
* getQProperty converts the given property to qualified schema property
* @param prop
@Override
public String getParentCommonSchemaName() {
// TODO Auto-generated method stub
- return TaxonomyAuthorityDocumentModelHandler.COMMON_PART_LABEL;
+ return TaxonomyAuthorityClient.SERVICE_COMMON_PART_NAME;
}
}
*/
package org.collectionspace.services.taxonomy.nuxeo;
+import org.collectionspace.services.client.TaxonomyAuthorityClient;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityDocumentModelHandler;
import org.collectionspace.services.taxonomy.TaxonomyauthorityCommon;
/**
* TaxonomyAuthorityDocumentModelHandler
*
- * $LastChangedRevision$
- * $LastChangedDate$
*/
public class TaxonomyAuthorityDocumentModelHandler
extends AuthorityDocumentModelHandler<TaxonomyauthorityCommon> {
- /**
- * Common part schema label
- */
- static final String COMMON_PART_LABEL = "taxonomyauthority_common";
-
public TaxonomyAuthorityDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(TaxonomyAuthorityClient.SERVICE_COMMON_PART_NAME, TaxonomyAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
}
- public String getCommonPartLabel() {
- return COMMON_PART_LABEL;
+ /**
+ * getQProperty converts the given property to qualified schema property
+ * @param prop
+ * @return
+ */
+ @Override
+ public String getQProperty(String prop) {
+ return TaxonomyAuthorityConstants.NUXEO_SCHEMA_NAME + ":" + prop;
}
-
}
public static final String SERVICE_ITEM_NAME = "vocabularyitems";
public static final String SERVICE_ITEM_PAYLOAD_NAME = SERVICE_ITEM_NAME;
+ public static final String SERVICE_COMMON_PART_NAME = SERVICE_NAME
+ + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
+ public static final String SERVICE_ITEM_COMMON_PART_NAME = SERVICE_ITEM_NAME
+ + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
+
+
@Override
public String getServiceName() {
return SERVICE_NAME;
*/
package org.collectionspace.services.vocabulary.nuxeo;
+import org.collectionspace.services.client.VocabularyClient;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityDocumentModelHandler;
import org.collectionspace.services.vocabulary.VocabulariesCommon;
/**
* VocabularyDocumentModelHandler
*
- * $LastChangedRevision: $
- * $LastChangedDate: $
*/
public class VocabularyDocumentModelHandler
extends AuthorityDocumentModelHandler<VocabulariesCommon> {
-
- /**
- * Common part schema label
- */
- static final String COMMON_PART_LABEL = "vocabularies_common";
public VocabularyDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(VocabularyClient.SERVICE_COMMON_PART_NAME, VocabularyClient.SERVICE_ITEM_COMMON_PART_NAME);
}
/**
/**
* VocabularyItemDocumentModelHandler
*
- * $LastChangedRevision: $
- * $LastChangedDate: $
*/
public class VocabularyItemDocumentModelHandler
extends AuthorityItemDocumentModelHandler<VocabularyitemsCommon> {
- private static final String COMMON_PART_LABEL = "vocabularyitems_common";
-
public VocabularyItemDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(VocabularyClient.SERVICE_ITEM_COMMON_PART_NAME);
}
@Override
return result;
}
+ @Override
protected ListResultField getListResultsTermStatusField() {
ListResultField result = new ListResultField();
@Override
public String getParentCommonSchemaName() {
// TODO Auto-generated method stub
- return VocabularyDocumentModelHandler.COMMON_PART_LABEL;
+ return VocabularyClient.SERVICE_COMMON_PART_NAME;
}
}
*/
package org.collectionspace.services.work.nuxeo;
+import org.collectionspace.services.client.WorkAuthorityClient;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityDocumentModelHandler;
import org.collectionspace.services.work.WorkauthoritiesCommon;
public class WorkAuthorityDocumentModelHandler
extends AuthorityDocumentModelHandler<WorkauthoritiesCommon> {
- /**
- * Common part schema label
- */
- static final String COMMON_PART_LABEL = "workauthorities_common";
-
public WorkAuthorityDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(WorkAuthorityClient.SERVICE_COMMON_PART_NAME, WorkAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
}
/**
*/
package org.collectionspace.services.work.nuxeo;
-import org.collectionspace.services.WorkJAXBSchema;
import org.collectionspace.services.client.WorkAuthorityClient;
-import org.collectionspace.services.common.document.DocumentWrapper;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
import org.collectionspace.services.work.WorksCommon;
-import org.nuxeo.ecm.core.api.DocumentModel;
/**
* WorkDocumentModelHandler
public class WorkDocumentModelHandler
extends AuthorityItemDocumentModelHandler<WorksCommon> {
- /**
- * Common part schema label
- */
- private static final String COMMON_PART_LABEL = "works_common";
-
public WorkDocumentModelHandler() {
- super(COMMON_PART_LABEL);
+ super(WorkAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
}
@Override
public String getAuthorityServicePath(){
return WorkAuthorityClient.SERVICE_PATH_COMPONENT; // CSPACE-3932
}
-
- /**
- * Handle display name.
- *
- * @param docModel the doc model
- * @throws Exception the exception
- */
-// @Override
-// protected void handleComputedDisplayNames(DocumentModel docModel) throws Exception {
-// String commonPartLabel = getServiceContext().getCommonPartLabel("works");
-// Boolean displayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
-// WorkJAXBSchema.DISPLAY_NAME_COMPUTED);
-// Boolean shortDisplayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
-// WorkJAXBSchema.SHORT_DISPLAY_NAME_COMPUTED);
-// if(displayNameComputed==null)
-// displayNameComputed = true;
-// if(shortDisplayNameComputed==null)
-// shortDisplayNameComputed = true;
-// if (displayNameComputed || shortDisplayNameComputed) {
-// // Obtain the primary work name from the list of work names, for computing the display name.
-// String xpathToWorkName = WorkJAXBSchema.WORK_TERM_NAME_GROUP_LIST
-// + "/[0]/" + WorkeJAXBSchema.WORK_TERM_NAME;
-// String workName = getXPathStringValue(docModel, COMMON_PART_LABEL, xpathToWorkName);
-// String displayName = prepareDefaultDisplayName(workName);
-// if (displayNameComputed) {
-// docModel.setProperty(commonPartLabel, WorkJAXBSchema.DISPLAY_NAME,
-// displayName);
-// }
-// if (shortDisplayNameComputed) {
-// docModel.setProperty(commonPartLabel, WorkJAXBSchema.SHORT_DISPLAY_NAME,
-// displayName);
-// }
-// }
-// }
-
- /**
- * Produces a default displayName from one or more supplied fields.
- * @see WorkAuthorityClientUtils.prepareDefaultDisplayName() which
- * duplicates this logic, until we define a service-general utils package
- * that is neither client nor service specific.
- * @param workName
- * @return the default display name
- * @throws Exception
- */
- private static String prepareDefaultDisplayName(
- String workName ) throws Exception {
- StringBuilder newStr = new StringBuilder();
- newStr.append(workName);
- return newStr.toString();
- }
/**
* getQProperty converts the given property to qualified schema property
@Override
public String getParentCommonSchemaName() {
// TODO Auto-generated method stub
- return WorkAuthorityDocumentModelHandler.COMMON_PART_LABEL;
+ return WorkAuthorityClient.SERVICE_COMMON_PART_NAME;
}
}