<widget name="displayName" type="text">
<labels>
- <label mode="any">Name</label>
+ <label mode="any">Display Name</label>
</labels>
<translated>true</translated>
<fields>
<template mode="any">/layouts/layout_default_template.xhtml</template>
</templates>
<rows>
+ <row><widget>displayName</widget></row>
<row><widget>shortName</widget></row>
<row><widget>refName</widget></row>
<row><widget>inAuthority</widget></row>
<row><widget>description</widget></row>
</rows>
+ <widget name="displayName" type="text">
+ <labels>
+ <label mode="any">Display Name</label>
+ </labels>
+ <translated>true</translated>
+ <fields>
+ <field schema="orgauthorities_common">displayName</field>
+ </fields>
+ <properties widgetMode="edit">
+ <property name="styleClass">dataInputText</property>
+ </properties>
+ </widget>
+
<widget name="shortName" type="text">
<labels>
- <label mode="any">Name</label>
+ <label mode="any">ShortName</label>
</labels>
<translated>true</translated>
<fields>
<!-- inAuthority is the csid of the owning OrgAuthority -->
<xs:element name="inAuthority" type="xs:string" />
<xs:element name="refName" type="xs:string"/>
+ <xs:element name="displayName" type="xs:string"/>
<xs:element name="shortName" type="xs:string"/>
<xs:element name="longName" type="xs:string"/>
<xs:element name="nameAdditions" type="xs:string"/>
logger.debug(" " + testName + ": list-item[" + i + "] csid=" +
item.getCsid());
logger.debug(" " + testName + ": list-item[" + i + "] shortName=" +
- item.getShortName());
+ item.getDisplayName());
logger.debug(" " + testName + ": list-item[" + i + "] URI=" +
item.getUri());
i++;
if(logger.isDebugEnabled()){
logger.debug("Import: Create orgAuthority: \"" + orgAuthorityName +"\"");
}
- String baseOrgRefName = createOrgAuthRefName(orgAuthorityName);
- String fullOrgRefName = baseOrgRefName+"'"+orgAuthorityName+"'";
+ String baseOrgAuthRefName = createOrgAuthRefName(orgAuthorityName);
+ String fullOrgAuthRefName = baseOrgAuthRefName+"'"+orgAuthorityName+"'";
MultipartOutput multipart = createOrgAuthorityInstance(orgAuthorityName,
- fullOrgRefName);
+ fullOrgAuthRefName);
ClientResponse<Response> res = client.create(multipart);
int statusCode = res.getStatus();
+newOrgAuthorityId );
}
for(List<String> orgStrings : orgInfo){
- createItemInAuthority(newOrgAuthorityId, baseOrgRefName, orgStrings);
+ createItemInAuthority(newOrgAuthorityId, baseOrgAuthRefName, orgStrings);
}
}
foundingDate, dissolutionDate, foundingPlace, function, description
*/
String shortName = orgStrings.get(0);
- String refName = createOrganizationRefName(orgAuthorityRefName, shortName);
+ String refName = createOrganizationRefName(orgAuthorityRefName, shortName)+"'"+shortName+"'";
if(logger.isDebugEnabled()){
logger.debug("Import: Create Item: \""+shortName
}
protected String createOrgAuthRefName(String orgAuthorityName) {
- return "urn:cspace:org.collectionspace.demo:personauthority:name("
+ return "urn:cspace:org.collectionspace.demo:orgauthority:name("
+orgAuthorityName+")";
}
public interface OrganizationJAXBSchema {\r
final static String CSID = "csid";\r
final static String IN_AUTHORITY = "inAuthority";\r
+ final static String DISPLAY_NAME = "displayName";\r
final static String SHORT_NAME = "shortName";\r
final static String REF_NAME = "refName";\r
final static String LONG_NAME = "longName";\r
package org.collectionspace.services;\r
\r
public interface OrganizationListItemJAXBSchema {\r
- final static String SHORT_NAME = "shortName";\r
+ final static String DISPLAY_NAME = "displayName";\r
final static String REF_NAME = "refName";\r
final static String CSID = "csid";\r
final static String URI = "url";\r
<!-- Organization Information Group -->
<xs:element name="inAuthority" type="xs:string" />
<xs:element name="refName" type="xs:string"/>
+ <xs:element name="displayName" type="xs:string"/>
<xs:element name="shortName" type="xs:string"/>
<xs:element name="longName" type="xs:string"/>
- <xs:element name="nameAdditions" type="xs:string"/>
- <xs:element name="contactName" type="xs:string"/>
- <xs:element name="foundingDate" type="xs:string"/>
- <xs:element name="dissolutionDate" type="xs:string"/>
- <xs:element name="foundingPlace" type="xs:string"/>
- <xs:element name="function" type="xs:string"/>
+ <xs:element name="nameAdditions" type="xs:string"/>
+ <xs:element name="contactName" type="xs:string"/>
+ <xs:element name="foundingDate" type="xs:string"/>
+ <xs:element name="dissolutionDate" type="xs:string"/>
+ <xs:element name="foundingPlace" type="xs:string"/>
+ <xs:element name="function" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="organization_list_item" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
- <xs:element name="shortName" type="xs:string"
+ <xs:element name="displayName" type="xs:string"
minOccurs="1" />
<!-- uri to retrieve organization details -->
<xs:element name="uri" type="xs:anyURI"
OrganizationsCommonList.OrganizationListItem item) {\r
StringBuffer sb = new StringBuffer();\r
sb.append("csid=" + item.getCsid() + "\n");\r
- sb.append("shortName=" + item.getShortName() + "\n");\r
+ sb.append("displayName=" + item.getDisplayName() + "\n");\r
// sb.append("URI=" + item.getUri() + "\n");\r
return sb.toString();\r
}\r
// For each organization ...\r
for (OrganizationsCommonList.OrganizationListItem\r
item : items.getOrganizationListItem()) {\r
- // Get its short name.\r
- logger.info(" " + item.getShortName());\r
+ // Get its display name.\r
+ logger.info(" " + item.getDisplayName());\r
}\r
}\r
\r
//no specific action needed
}
+ /* Override handleGet so we can deal with defaulting the displayName
+ * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleGet(org.collectionspace.services.common.document.DocumentWrapper)
+ */
+ @Override
+ public void handleGet(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
+ DocumentModel docModel = wrapDoc.getWrappedObject();
+ String displayName = (String) docModel.getProperty(getServiceContext().getCommonPartLabel("organizations"),
+ OrganizationJAXBSchema.DISPLAY_NAME);
+ if(displayName == null) {
+ displayName = (String) docModel.getProperty(getServiceContext().getCommonPartLabel("organizations"),
+ OrganizationJAXBSchema.SHORT_NAME);
+ docModel.setProperty(getServiceContext().getCommonPartLabel("organizations"),
+ OrganizationJAXBSchema.DISPLAY_NAME, displayName);
+ }
+ super.handleGet(wrapDoc);
+ }
+
/**
* getCommonPart get associated organization
* @return
while(iter.hasNext()){
DocumentModel docModel = iter.next();
OrganizationListItem ilistItem = new OrganizationListItem();
- ilistItem.setShortName(
- (String) docModel.getProperty(getServiceContext().getCommonPartLabel("organizations"),
- OrganizationJAXBSchema.SHORT_NAME));
+ // We look for a set display name, and fall back to teh short name if there is none
+ String displayName = (String) docModel.getProperty(getServiceContext().getCommonPartLabel("organizations"),
+ OrganizationJAXBSchema.DISPLAY_NAME);
+ if(displayName == null)
+ displayName = (String) docModel.getProperty(getServiceContext().getCommonPartLabel("organizations"),
+ OrganizationJAXBSchema.SHORT_NAME);
+ ilistItem.setDisplayName( displayName );
ilistItem.setRefName(
(String) docModel.getProperty(getServiceContext().getCommonPartLabel("organizations"),
OrganizationJAXBSchema.REF_NAME));