/** * Generate a refName for the authority from the short identifier and display name. * * <p>All refNames for authorities are generated. If a client supplies a refName, it will be * overwritten during create (per this method) or discarded during update (per * filterReadOnlyPropertiesForPart). * * @see #filterReadOnlyPropertiesForPart(Map<String, Object>, * org.collectionspace.services.common.service.ObjectPartType) */ protected void updateRefnameForAuthority( DocumentWrapper<DocumentModel> wrapDoc, String schemaName) throws Exception { DocumentModel docModel = wrapDoc.getWrappedObject(); String shortIdentifier = (String) docModel.getProperty(schemaName, AuthorityJAXBSchema.SHORT_IDENTIFIER); String displayName = (String) docModel.getProperty(schemaName, AuthorityJAXBSchema.DISPLAY_NAME); MultipartServiceContext ctx = (MultipartServiceContext) getServiceContext(); RefName.Authority authority = RefName.buildAuthority( ctx.getTenantName(), ctx.getServiceName(), shortIdentifier, displayName); String refName = authority.toString(); docModel.setProperty(schemaName, AuthorityJAXBSchema.REF_NAME, refName); }