// first fill all the parts of the document
super.handleCreate(wrapDoc);
handleInAuthority(wrapDoc.getWrappedObject());
+ handleComputedDisplayNames(wrapDoc.getWrappedObject());
// CSPACE-3178:
// Uncomment once debugged and App layer is read to integrate
// Experimenting with these uncommented now ...
handleDisplayNameAsShortIdentifier(wrapDoc.getWrappedObject(), authorityItemCommonSchemaName);
updateRefnameForAuthorityItem(wrapDoc, authorityItemCommonSchemaName, getAuthorityRefNameBase());
}
+
+ /* (non-Javadoc)
+ * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleUpdate(org.collectionspace.services.common.document.DocumentWrapper)
+ */
+ @Override
+ public void handleUpdate(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
+ super.handleUpdate(wrapDoc);
+ handleComputedDisplayNames(wrapDoc.getWrappedObject());
+ }
+
+ /**
+ * Handle display name.
+ *
+ * @param docModel the doc model
+ * @throws Exception the exception
+ */
+ protected void handleComputedDisplayNames(DocumentModel docModel) throws Exception {
+ // Do nothing by default.
+ }
private void handleDisplayNameAsShortIdentifier(DocumentModel docModel, String schemaName) throws Exception {
String shortIdentifier = (String) docModel.getProperty(schemaName, AuthorityItemJAXBSchema.SHORT_IDENTIFIER);
return LocationAuthorityClient.SERVICE_PATH_COMPONENT; // CSPACE-3932
}
- /* (non-Javadoc)
- * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleCreate(org.collectionspace.services.common.document.DocumentWrapper)
- */
- @Override
- public void handleCreate(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
- // first fill all the parts of the document
- super.handleCreate(wrapDoc);
- handleDisplayNames(wrapDoc.getWrappedObject());
- }
-
- /* (non-Javadoc)
- * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleUpdate(org.collectionspace.services.common.document.DocumentWrapper)
- */
- @Override
- public void handleUpdate(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
- super.handleUpdate(wrapDoc);
- handleDisplayNames(wrapDoc.getWrappedObject());
- }
-
/**
* Handle display name.
*
* @param docModel the doc model
* @throws Exception the exception
*/
- private void handleDisplayNames(DocumentModel docModel) throws Exception {
+ @Override
+ protected void handleComputedDisplayNames(DocumentModel docModel) throws Exception {
String commonPartLabel = getServiceContext().getCommonPartLabel("locations");
Boolean displayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
LocationJAXBSchema.DISPLAY_NAME_COMPUTED);
return OrgAuthorityClient.SERVICE_PATH_COMPONENT; // CSPACE-3932
}
- /* (non-Javadoc)
- * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleCreate(org.collectionspace.services.common.document.DocumentWrapper)
- */
- @Override
- public void handleCreate(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
- // first fill all the parts of the document
- super.handleCreate(wrapDoc);
- handleDisplayNames(wrapDoc.getWrappedObject());
- }
-
- /* (non-Javadoc)
- * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleUpdate(org.collectionspace.services.common.document.DocumentWrapper)
- */
- @Override
- public void handleUpdate(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
- super.handleUpdate(wrapDoc);
- handleDisplayNames(wrapDoc.getWrappedObject());
- }
-
/**
* Check the logic around the computed displayName
*
*
* @throws Exception the exception
*/
- private void handleDisplayNames(DocumentModel docModel) throws Exception {
+ @Override
+ protected void handleComputedDisplayNames(DocumentModel docModel) throws Exception {
String commonPartLabel = getServiceContext().getCommonPartLabel("organizations");
Boolean displayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
OrganizationJAXBSchema.DISPLAY_NAME_COMPUTED);
return PersonAuthorityClient.SERVICE_PATH_COMPONENT; // CSPACE-3932
}
- /* (non-Javadoc)
- * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleCreate(org.collectionspace.services.common.document.DocumentWrapper)
- */
- @Override
- public void handleCreate(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
- // first fill all the parts of the document
- super.handleCreate(wrapDoc);
- handleDisplayNames(wrapDoc.getWrappedObject());
- }
-
- /* (non-Javadoc)
- * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleUpdate(org.collectionspace.services.common.document.DocumentWrapper)
- */
- @Override
- public void handleUpdate(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
- super.handleUpdate(wrapDoc);
- handleDisplayNames(wrapDoc.getWrappedObject());
- }
-
/**
* Handle display names.
*
* @param docModel the doc model
* @throws Exception the exception
*/
- private void handleDisplayNames(DocumentModel docModel) throws Exception {
+ @Override
+ protected void handleComputedDisplayNames(DocumentModel docModel) throws Exception {
String commonPartLabel = getServiceContext().getCommonPartLabel("persons");
Boolean displayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
PersonJAXBSchema.DISPLAY_NAME_COMPUTED);
super(COMMON_PART_LABEL);
}
- /* (non-Javadoc)
- * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleCreate(org.collectionspace.services.common.document.DocumentWrapper)
- */
- @Override
- public void handleCreate(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
- // first fill all the parts of the document
- super.handleCreate(wrapDoc);
- handleDisplayNames(wrapDoc.getWrappedObject());
- }
-
- /* (non-Javadoc)
- * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleUpdate(org.collectionspace.services.common.document.DocumentWrapper)
- */
- @Override
- public void handleUpdate(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
- super.handleUpdate(wrapDoc);
- handleDisplayNames(wrapDoc.getWrappedObject());
- }
-
/**
* Handle display name.
*
* @param docModel the doc model
* @throws Exception the exception
*/
- private void handleDisplayNames(DocumentModel docModel) throws Exception {
+ @Override
+ protected void handleComputedDisplayNames(DocumentModel docModel) throws Exception {
String commonPartLabel = getServiceContext().getCommonPartLabel("taxon");
Boolean displayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
TaxonJAXBSchema.DISPLAY_NAME_COMPUTED);