<xs:element name="shortDisplayName" type="xs:string"/>
<xs:element name="shortDisplayNameComputed" type="xs:boolean"/>
<xs:element name="name" type="xs:string"/>
- <xs:element name="conditionNote" type="xs:string"/>
- <xs:element name="conditionNoteDate" type="xs:string"/>
+ <xs:element name="conditionGroupList" type="conditionGroupList"/>
<xs:element name="securityNote" type="xs:string"/>
<xs:element name="accessNote" type="xs:string"/>
<xs:element name="address" type="xs:string"/>
<xs:element name="locationType" type="xs:string"/>
+ <xs:complexType name="conditionGroupList">
+ <xs:sequence>
+ <xs:element name="conditionGroup" type="conditionGroup" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="conditionGroup">
+ <xs:sequence>
+ <xs:element name="conditionNote" type="xs:string"/>
+ <xs:element name="conditionNoteDate" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+
</xs:schema>
import org.collectionspace.services.LocationJAXBSchema;\r
import org.collectionspace.services.client.test.ServiceRequestType;\r
import org.collectionspace.services.location.LocationsCommon;\r
+import org.collectionspace.services.location.ConditionGroupList;\r
+import org.collectionspace.services.location.ConditionGroup;\r
import org.collectionspace.services.location.LocationauthoritiesCommon;\r
import org.dom4j.DocumentException;\r
import org.jboss.resteasy.client.ClientResponse;\r
\r
/**\r
* @param locationRefName The proper refName for this authority\r
- * @param locationInfo the properties for the new Location\r
+ * @param locationInfo the properties for the new Location. Can pass in one condition\r
+ * note and date string.\r
* @param headerLabel The common part label\r
* @return The PoxPayloadOut payload for the create call\r
*/\r
public static PoxPayloadOut createLocationInstance( \r
- String locationAuthRefName, Map<String, String> locationInfo, String headerLabel){\r
+ String locationAuthRefName, Map<String, String> locationInfo, \r
+ String headerLabel){\r
LocationsCommon location = new LocationsCommon();\r
String shortId = locationInfo.get(LocationJAXBSchema.SHORT_IDENTIFIER);\r
String displayName = locationInfo.get(LocationJAXBSchema.DISPLAY_NAME);\r
location.setDisplayNameComputed(displayNameComputed);\r
if((value = (String)locationInfo.get(LocationJAXBSchema.NAME))!=null)\r
location.setName(value);\r
- if((value = (String)locationInfo.get(LocationJAXBSchema.CONDITION_NOTE))!=null)\r
- location.setConditionNote(value);\r
- if((value = (String)locationInfo.get(LocationJAXBSchema.CONDITION_NOTE_DATE))!=null)\r
- location.setConditionNoteDate(value);\r
+ if((value = (String)locationInfo.get(LocationJAXBSchema.CONDITION_NOTE))!=null) {\r
+ ConditionGroupList conditionGroupList = new ConditionGroupList();\r
+ List<ConditionGroup> conditionGroups = conditionGroupList.getConditionGroup();\r
+ ConditionGroup conditionGroup = new ConditionGroup();\r
+ conditionGroup.setConditionNote(value);\r
+ if((value = (String)locationInfo.get(LocationJAXBSchema.CONDITION_NOTE_DATE))!=null)\r
+ conditionGroup.setConditionNoteDate(value);\r
+ conditionGroups.add(conditionGroup);\r
+ location.setConditionGroupList(conditionGroupList);\r
+ }\r
if((value = (String)locationInfo.get(LocationJAXBSchema.SECURITY_NOTE))!=null)\r
location.setSecurityNote(value);\r
if((value = (String)locationInfo.get(LocationJAXBSchema.ACCESS_NOTE))!=null)\r
location.setAddress(value);\r
if((value = (String)locationInfo.get(LocationJAXBSchema.TERM_STATUS))!=null)\r
location.setTermStatus(value);\r
+\r
PoxPayloadOut multipart = new PoxPayloadOut(LocationAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);\r
PayloadOutputPart commonPart = multipart.addPart(location,\r
MediaType.APPLICATION_XML_TYPE);\r
@Override
protected PoxPayloadOut createInstance(String identifier) {
LocationAuthorityClient client = new LocationAuthorityClient();
- String shortId = createIdentifier();
+ String shortId = identifier;
String displayName = "displayName-" + shortId;
- String baseRefName = LocationAuthorityClientUtils.createLocationAuthRefName(shortId, null);
+ String baseRefName =
+ LocationAuthorityClientUtils.createLocationAuthRefName(shortId, null);
PoxPayloadOut multipart =
LocationAuthorityClientUtils.createLocationAuthorityInstance(
displayName, shortId, client.getCommonPartName());
LocationAuthorityClient client = new LocationAuthorityClient();
String shortId = createIdentifier();
String displayName = "displayName-" + shortId;
- String baseRefName = LocationAuthorityClientUtils.createLocationAuthRefName(shortId, null);
+ String baseRefName =
+ LocationAuthorityClientUtils.createLocationAuthRefName(shortId, null);
+
PoxPayloadOut multipart =
LocationAuthorityClientUtils.createLocationAuthorityInstance(
displayName, shortId, client.getCommonPartName());
public interface LocationJAXBSchema extends AuthorityItemJAXBSchema {\r
final static String LOCATIONS_COMMON = "locations_common";\r
final static String NAME = "name";\r
+ final static String CONDITION_GROUP_LIST = "conditionGroupList";\r
+ final static String CONDITION_GROUP = "conditionGroup";\r
final static String CONDITION_NOTE = "conditionNote";\r
final static String CONDITION_NOTE_DATE = "conditionNoteDate";\r
final static String SECURITY_NOTE = "securityNote";\r
<xs:element name="shortDisplayName" type="xs:string"/>
<xs:element name="shortDisplayNameComputed" type="xs:boolean"/>
<xs:element name="name" type="xs:string"/>
- <xs:element name="conditionNote" type="xs:string"/>
- <xs:element name="conditionNoteDate" type="xs:string"/>
+ <xs:element name="conditionGroupList" type="conditionGroupList"/>
<xs:element name="securityNote" type="xs:string"/>
<xs:element name="accessNote" type="xs:string"/>
<xs:element name="address" type="xs:string"/>
</xs:complexType>
</xs:element>
+ <xs:complexType name="conditionGroupList">
+ <xs:sequence>
+ <xs:element name="conditionGroup" type="conditionGroup" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="conditionGroup">
+ <xs:sequence>
+ <xs:element name="conditionNote" type="xs:string"/>
+ <xs:element name="conditionNoteDate" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+
<!-- This is the base class for paginated lists -->
<xs:complexType name="abstractCommonListItem">
<xs:annotation>