import org.collectionspace.services.collectionobject.TitleGroup;
import org.collectionspace.services.collectionobject.TitleGroupList;
import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.organization.OrgTermGroup;
import org.collectionspace.services.person.PersonTermGroup;
import org.jboss.resteasy.client.ClientResponse;
*/
protected String createOrganization(String shortName, String foundingPlace, String shortIdentifier ) {
Map<String, String> orgInfo = new HashMap<String,String>();
- orgInfo.put(OrganizationJAXBSchema.SHORT_NAME, shortName);
orgInfo.put(OrganizationJAXBSchema.FOUNDING_PLACE, foundingPlace);
orgInfo.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, shortIdentifier);
+
+ List<OrgTermGroup> orgTerms = new ArrayList<OrgTermGroup>();
+ OrgTermGroup term = new OrgTermGroup();
+ term.setTermDisplayName(shortName);
+ term.setTermName(shortName);
+ orgTerms.add(term);
+
OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
PoxPayloadOut multipart =
- OrgAuthorityClientUtils.createOrganizationInstance(
- orgAuthRefName, orgInfo, orgAuthClient.getItemCommonPartName());
+ OrgAuthorityClientUtils.createOrganizationInstance(orgAuthRefName, orgInfo, orgTerms, orgAuthClient.getItemCommonPartName());
ClientResponse<Response> res = orgAuthClient.createItem(orgAuthCSID, multipart);
int statusCode = res.getStatus();
* @param headerLabel the header label\r
* @return the multipart output\r
*/\r
- public static PoxPayloadOut createOrganizationInstance(\r
- String orgAuthRefName, Map<String, String> orgInfo,\r
- List<OrgTermGroup> terms, String headerLabel){\r
- final Map<String, List<String>> EMPTY_ORG_REPEATABLES_INFO =\r
- new HashMap<String, List<String>>();\r
- return createOrganizationInstance(orgAuthRefName,\r
- orgInfo, terms, EMPTY_ORG_REPEATABLES_INFO, headerLabel);\r
- }\r
-\r
+ public static PoxPayloadOut createOrganizationInstance(\r
+ String orgAuthRefName,\r
+ Map<String, String> orgInfo,\r
+ List<OrgTermGroup> terms,\r
+ String headerLabel) {\r
+ final Map<String, List<String>> EMPTY_ORG_REPEATABLES_INFO = new HashMap<String, List<String>>();\r
+ return createOrganizationInstance(orgAuthRefName, orgInfo, terms,\r
+ EMPTY_ORG_REPEATABLES_INFO, headerLabel);\r
+ }\r
\r
/**\r
* Creates the organization instance.\r