* @param identifier the identifier\r
*/\r
void fillCollectionObject(CollectionobjectsCommon co, String identifier) {\r
- fillCollectionObject(co, "objectNumber-" + identifier, "objectName-"\r
+ fillCollectionObject(co, "objectNumber-" + identifier, "title-"\r
+ identifier);\r
}\r
\r
* \r
* @param co the co\r
* @param objectNumber the object number\r
- * @param objectName the object name\r
+ * @param title the object title\r
*/\r
void fillCollectionObject(CollectionobjectsCommon co, String objectNumber,\r
- String objectName) {\r
+ String title) {\r
co.setObjectNumber(objectNumber);\r
- co.setObjectName(objectName);\r
+ co.setTitle(title);\r
}\r
\r
/**\r
public abstract class CollectionSpacePerformanceTest {\r
\r
protected final static String OBJECT_NUMBER = "objectNumber_";\r
- protected final static String OBJECT_NAME = "objectName_";\r
+ protected final static String OBJECT_TITLE = "objectTitle_";\r
\r
/*\r
* Package scoped methods.\r
* @param identifier the identifier\r
*/\r
void fillCollectionObject(CollectionobjectsCommon co, String identifier) {\r
- fillCollectionObject(co, OBJECT_NUMBER + identifier, OBJECT_NAME + identifier);\r
+ fillCollectionObject(co, OBJECT_NUMBER + identifier, OBJECT_TITLE + identifier);\r
}\r
\r
/**\r
* \r
* @param co the co\r
* @param objectNumber the object number\r
- * @param objectName the object name\r
+ * @param title the object title\r
*/\r
void fillCollectionObject(CollectionobjectsCommon co, String objectNumber,\r
- String objectName) {\r
+ String title) {\r
co.setObjectNumber(objectNumber);\r
- co.setObjectName(objectName);\r
+ co.setTitle(title);\r
}\r
\r
/**\r
String times = "";
for (int numOfKeywords = 0; numOfKeywords < MAX_KEYWORDS;
numOfKeywords++, totalTime = 0, totalSearchResults = 0, times = "") {
- keywords = keywords + " " + OBJECT_NAME + randomGenerator.nextInt(numberOfObjects);
+ keywords = keywords + " " + OBJECT_TITLE + randomGenerator.nextInt(numberOfObjects);
for (int i = 0; i < MAX_SEARCHES; i++) {
//sandwich the call with timestamps
Date startTime = new Date();
xmlns="http://collectionspace.org/collectionobject/"\r
targetNamespace="http://collectionspace.org/collectionobject/" version="0.1">\r
\r
- <xs:complexType name="otherNumberList">\r
- <xs:sequence>\r
- <xs:element name="otherNumber" type="ns:otherNumber" minOccurs="0"\r
- maxOccurs="unbounded"/>\r
- </xs:sequence>\r
- </xs:complexType>\r
-\r
- <xs:complexType name="otherNumber">\r
- <xs:sequence>\r
- <xs:element name="numberValue" type="xs:string"/>\r
- <xs:element name="numberType" type="xs:string"/>\r
- </xs:sequence>\r
- </xs:complexType>\r
-\r
<!-- Object identification information -->\r
<xs:element name="objectNumber" type="xs:string"/>\r
<xs:element name="otherNumberList" type="ns:otherNumberList"/>\r
</xs:element>\r
<xs:element name="distinguishingFeatures" type="xs:string"/>\r
<xs:element name="numberOfObjects" type="xs:string"/>\r
- <xs:element name="objectName" type="xs:string"/>\r
- <xs:element name="objectNameCurrency" type="xs:string"/>\r
- <xs:element name="objectNameLevel" type="xs:string"/>\r
- <xs:element name="objectNameNote" type="xs:string"/>\r
- <xs:element name="objectNameSystem" type="xs:string"/>\r
- <xs:element name="objectNameType" type="xs:string"/>\r
- <xs:element name="objectNameLanguage" type="xs:string"/>\r
+ <xs:element name="objectNameList" type="ns:objectNameList"/>\r
+\r
<xs:element name="responsibleDepartments">\r
<xs:complexType>\r
<xs:sequence>\r
</xs:element>\r
<xs:element name="fieldCollectionEventName" type="xs:string"/>\r
\r
+ <xs:complexType name="otherNumberList">\r
+ <xs:sequence>\r
+ <xs:element name="otherNumber" type="ns:otherNumber" minOccurs="0"\r
+ maxOccurs="unbounded"/>\r
+ </xs:sequence>\r
+ </xs:complexType>\r
+\r
+ <xs:complexType name="otherNumber">\r
+ <xs:sequence>\r
+ <xs:element name="numberValue" type="xs:string"/>\r
+ <xs:element name="numberType" type="xs:string"/>\r
+ </xs:sequence>\r
+ </xs:complexType>\r
+\r
+ <xs:complexType name="objectNameList">\r
+ <xs:sequence>\r
+ <xs:element name="objectNameGroup" type="objectNameGroup" minOccurs="0"\r
+ maxOccurs="unbounded"/>\r
+ </xs:sequence>\r
+ </xs:complexType>\r
+\r
+ <xs:complexType name="objectNameGroup">\r
+ <xs:sequence>\r
+ <xs:element name="objectName" type="xs:string"/>\r
+ <xs:element name="objectNameCurrency" type="xs:string"/>\r
+ <xs:element name="objectNameLevel" type="xs:string"/>\r
+ <xs:element name="objectNameNote" type="xs:string"/>\r
+ <xs:element name="objectNameSystem" type="xs:string"/>\r
+ <xs:element name="objectNameType" type="xs:string"/>\r
+ <xs:element name="objectNameLanguage" type="xs:string"/>\r
+ </xs:sequence>\r
+ </xs:complexType>\r
+\r
<!-- Object Description Date Information -->\r
<!-- This appears to be a placeholder structured date -->\r
<xs:element name="dateAssociation" type="xs:string"/>\r
import org.collectionspace.services.collectionobject.domain.naturalhistory.CollectionobjectsNaturalhistory;
import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;
import org.collectionspace.services.collectionobject.ResponsibleDepartmentList;
+import org.collectionspace.services.collectionobject.ObjectNameGroup;
+import org.collectionspace.services.collectionobject.ObjectNameList;
import org.collectionspace.services.collectionobject.OtherNumber;
import org.collectionspace.services.collectionobject.OtherNumberList;
/** The known resource id. */
private String knownResourceId = null;
+ private final String OBJECT_NAME_VALUE = "an object name";
+
/* (non-Javadoc)
* @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
*/
// a non-empty value is required, as enforced by the service's
// validation routine(s).
CollectionobjectsCommon collectionObject = new CollectionobjectsCommon();
- collectionObject.setTitle("atitle");
- collectionObject.setObjectName("some name");
+ collectionObject.setTitle("a title");
+
+ ObjectNameList objNameList = new ObjectNameList();
+ List<ObjectNameGroup> objNameGroups = objNameList.getObjectNameGroup();
+ ObjectNameGroup objectNameGroup = new ObjectNameGroup();
+ objectNameGroup.setObjectName("an object name");
+ objNameGroups.add(objectNameGroup);
+ collectionObject.setObjectNameList(objNameList);
// Submit the request to the service and store the response.
CollectionObjectClient client = new CollectionObjectClient();
// empty String, in a field that requires a non-empty value,
// as enforced by the service's validation routine(s).
collectionObject = new CollectionobjectsCommon();
- collectionObject.setTitle("atitle");
- collectionObject.setObjectName("some name");
collectionObject.setObjectNumber("");
+ collectionObject.setTitle("a title");
+ objNameList = new ObjectNameList();
+ objNameGroups = objNameList.getObjectNameGroup();
+ objectNameGroup = new ObjectNameGroup();
+ objectNameGroup.setObjectName(OBJECT_NAME_VALUE);
+ objNameGroups.add(objectNameGroup);
+ collectionObject.setObjectNameList(objNameList);
// Submit the request to the service and store the response.
multipart =
// Change the content of one or more fields in the common part.
collectionObject.setObjectNumber("updated-" + collectionObject.getObjectNumber());
- collectionObject.setObjectName("updated-" + collectionObject.getObjectName());
+
+ ObjectNameList objNameList = collectionObject.getObjectNameList();
+ List<ObjectNameGroup> objNameGroups = objNameList.getObjectNameGroup();
+ Assert.assertNotNull(objNameGroups);
+ Assert.assertTrue(objNameGroups.size() >= 1);
+ String objectName = objNameGroups.get(0).getObjectName();
+ Assert.assertEquals(objectName, OBJECT_NAME_VALUE);
+ String updatedObjectName = "updated-" + objectName;
+ objNameGroups.get(0).setObjectName(updatedObjectName);
+ collectionObject.setObjectNameList(objNameList);
+
if (logger.isDebugEnabled()) {
logger.debug("sparse update that will be sent in update request:");
logger.debug(objectAsXmlString(collectionObject,
(CollectionobjectsCommon) extractPart(input,
client.getCommonPartName(), CollectionobjectsCommon.class);
Assert.assertNotNull(updatedCollectionObject);
- Assert.assertEquals(updatedCollectionObject.getObjectName(),
- collectionObject.getObjectName(),
+
+ objNameList = collectionObject.getObjectNameList();
+ objNameGroups = objNameList.getObjectNameGroup();
+ Assert.assertNotNull(objNameGroups);
+ Assert.assertTrue(objNameGroups.size() >= 1);
+ Assert.assertEquals(updatedObjectName,
+ objNameGroups.get(0).getObjectName(),
"Data in updated object did not match submitted data.");
}
// is supported by the application layers
collectionObject.setOtherNumber("urn:org.walkerart.id:123");
- collectionObject.setObjectName(objectName);
+ ObjectNameList objNameList = new ObjectNameList();
+ List<ObjectNameGroup> objNameGroups = objNameList.getObjectNameGroup();
+ ObjectNameGroup objectNameGroup = new ObjectNameGroup();
+ objectNameGroup.setObjectName(OBJECT_NAME_VALUE);
+ objNameGroups.add(objectNameGroup);
+ collectionObject.setObjectNameList(objNameList);
+
collectionObject.setAge(""); //test for null string
collectionObject.setBriefDescriptions(descriptionList);
xsi:schemaLocation="http://collectionspace.org/services/collectionobject http://services.collectionspace.org/collectionobject/collectionobjects_common.xsd">
<objectNumber>2</objectNumber>
<comments>description</comments>
- <objectName>Left-handed screwdriver</objectName>
<title></title>
<briefDescriptions>
<!-- First value instance of this repeatable field is blank -->
xsi:schemaLocation="http://collectionspace.org/services/collectionobject http://services.collectionspace.org/collectionobject/collectionobjects_common.xsd">
<objectNumber>2</objectNumber>
<comments>description</comments>
- <objectName>Left-handed screwdriver</objectName>
<title></title>
<briefDescriptions>
<!-- First value instance of this repeatable field is non-blank -->
<briefDescriptions> <briefDescription> briefDescription</briefDescription></briefDescriptions>
<distinguishingFeatures>distFeatures</distinguishingFeatures>
<numberOfObjects>numberOfObjects</numberOfObjects>
-<objectName>objectName</objectName>
-<objectNameCurrency>objectNameCurrency</objectNameCurrency>
-<objectNameLevel>XXX</objectNameLevel>
-<objectNameNote>objectNameNote</objectNameNote>
-<objectNameSystem>objectNameSystem</objectNameSystem>
-<objectNameType>objectNameType</objectNameType>
-
-<objectNameLanguage>objectNameLanguage</objectNameLanguage>
<!-- test whitespace as first child node -->
<responsibleDepartments> <responsibleDepartment> responsibleDept1</responsibleDepartment><responsibleDepartment>responsibleDept2</responsibleDepartment></responsibleDepartments>
<title>title</title>
</briefDescriptions>
<distinguishingFeatures>distFeatures</distinguishingFeatures>
<numberOfObjects>numberOfObjects</numberOfObjects>
-<objectName>objectName</objectName>
-<objectNameCurrency>objectNameCurrency</objectNameCurrency>
-<objectNameLevel>XXX</objectNameLevel>
-<objectNameNote>objectNameNote</objectNameNote>
-<objectNameSystem>objectNameSystem</objectNameSystem>
-<objectNameType>objectNameType</objectNameType>
-
-<objectNameLanguage>objectNameLanguage</objectNameLanguage>
<!-- test newline whitespace -->
<responsibleDepartments>
<responsibleDepartment>responsibleDept1</responsibleDepartment>
<distinguishingFeatures>distFeatures</distinguishingFeatures>
<numberOfObjects>numberOfObjects</numberOfObjects>
-<objectName>objectName</objectName>
-<objectNameCurrency>objectNameCurrency</objectNameCurrency>
-<objectNameLevel>XXX</objectNameLevel>
-<objectNameNote>objectNameNote</objectNameNote>
-<objectNameSystem>objectNameSystem</objectNameSystem>
-<objectNameType>objectNameType</objectNameType>
-
-<objectNameLanguage>objectNameLanguage</objectNameLanguage>
<!-- test newline whitespace -->
<responsibleDepartments>
<!-- test childnode as whitespace -->
</briefDescriptions>
<distinguishingFeatures>distFeatures</distinguishingFeatures>
<numberOfObjects>numberOfObjects</numberOfObjects>
-<objectName>objectName</objectName>
-<objectNameCurrency>objectNameCurrency</objectNameCurrency>
-<objectNameLevel>XXX</objectNameLevel>
-<objectNameNote>objectNameNote</objectNameNote>
-<objectNameSystem>objectNameSystem</objectNameSystem>
-<objectNameType>objectNameType</objectNameType>
-
-<objectNameLanguage>objectNameLanguage</objectNameLanguage>
<!-- test newline and tab whitespace -->
<responsibleDepartments>
<responsibleDepartment>responsibleDept1</responsibleDepartment>
<comments>comments</comments>
<distinguishingFeatures>distFeatures</distinguishingFeatures>
<numberOfObjects>numberOfObjects</numberOfObjects>
- <objectName>objectName</objectName>
- <objectNameCurrency>objectNameCurrency</objectNameCurrency>
- <objectNameLevel>XXX</objectNameLevel>
- <objectNameNote>objectNameNote</objectNameNote>
- <objectNameSystem>objectNameSystem</objectNameSystem>
- <objectNameType>objectNameType</objectNameType>
- <objectNameLanguage>objectNameLanguage</objectNameLanguage>
<responsibleDepartments>
<!--
<responsibleDepartment xtmplpoint="responsibleDept"/>
xmlns="http://collectionspace.org/services/collectionobject"
targetNamespace="http://collectionspace.org/services/collectionobject"
version="0.1">
-
- <xs:complexType name="otherNumberList">
- <xs:sequence>
- <xs:element name="otherNumber" type="ns:otherNumber" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="otherNumber">
- <xs:sequence>
- <xs:element name="numberValue" type="xs:string"/>
- <xs:element name="numberType" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
<!--
Avoid XmlRootElement nightmare:
<!-- Object Identification Information -->
<xs:element name="objectNumber" type="xs:string"/>
- <xs:element name="otherNumberList" type="ns:otherNumberList"/>
+ <xs:element name="otherNumberList" type="otherNumberList"/>
<!-- Remove these two elements when the App/UI layer is -->
<!-- using the new repeatable 'otherNumbers' field -->
<xs:element name="comments" type="commentList"/>
<xs:element name="distinguishingFeatures" type="xs:string"/>
<xs:element name="numberOfObjects" type="xs:string"/>
- <xs:element name="objectName" type="xs:string"/>
- <xs:element name="objectNameCurrency" type="xs:string"/>
- <xs:element name="objectNameLevel" type="xs:string"/>
- <xs:element name="objectNameNote" type="xs:string"/>
- <xs:element name="objectNameSystem" type="xs:string"/>
- <xs:element name="objectNameType" type="xs:string"/>
- <xs:element name="objectNameLanguage" type="xs:string"/>
+ <xs:element name="objectNameList" type="ns:objectNameList"/>
<xs:element name="responsibleDepartments" type="responsibleDepartmentList"/>
<xs:element name="collection" type="xs:string"/>
<xs:element name="title" type="xs:string"/>
</xs:complexType>
</xs:element>
+ <xs:complexType name="otherNumberList">
+ <xs:sequence>
+ <xs:element name="otherNumber" type="otherNumber" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="otherNumber">
+ <xs:sequence>
+ <xs:element name="numberValue" type="xs:string"/>
+ <xs:element name="numberType" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="objectNameList">
+ <xs:sequence>
+ <xs:element name="objectNameGroup" type="objectNameGroup" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="objectNameGroup">
+ <xs:sequence>
+ <xs:element name="objectName" type="xs:string"/>
+ <xs:element name="objectNameCurrency" type="xs:string"/>
+ <xs:element name="objectNameLevel" type="xs:string"/>
+ <xs:element name="objectNameNote" type="xs:string"/>
+ <xs:element name="objectNameSystem" type="xs:string"/>
+ <xs:element name="objectNameType" type="xs:string"/>
+ <xs:element name="objectNameLanguage" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+
<xs:complexType name="responsibleDepartmentList">
<xs:sequence>
<xs:element name="responsibleDepartment" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
private MultipartOutput createCollectionObjectInstance(
String commonPartName, String identifier) {
return createCollectionObjectInstance(commonPartName, "objectNumber-"
- + identifier, "objectName-" + identifier);
+ + identifier, "title-" + identifier);
}
/**
*
* @param commonPartName the common part name
* @param objectNumber the object number
- * @param objectName the object name
+ * @param title the object title
*
* @return the multipart output
*/
private MultipartOutput createCollectionObjectInstance(
- String commonPartName, String objectNumber, String objectName) {
+ String commonPartName, String objectNumber, String title) {
CollectionobjectsCommon collectionObject = new CollectionobjectsCommon();
collectionObject.setObjectNumber(objectNumber);
- collectionObject.setObjectName(objectName);
+ collectionObject.setTitle(title);
MultipartOutput multipart =
CollectionObjectFactory.createCollectionObjectInstance(
commonPartName, collectionObject, null, null);