point="layouts">
<layout name="contact">
+
<templates>
<template mode="any">/layouts/layout_default_template.xhtml</template>
</templates>
<rows>
- <row><widget>addressType1</widget></row>
- <row><widget>addressText1</widget></row>
- <row><widget>postcode</widget></row>
+ <row><widget>addressType</widget></row>
+ <row><widget>addressPlace</widget></row>
+ <row><widget>email</widget></row>
+ <row><widget>telephoneNumber</widget></row>
+ <row><widget>faxNumber</widget></row>
+ <row><widget>notes</widget></row>
</rows>
-
- <widget name="addressText1" type="text">
+
+ <widget name="addressType" type="text">
+ <labels>
+ <label mode="any">addressType</label>
+ </labels>
+ <translated>true</translated>
+ <fields>
+ <field schema="contacts_common">addressType</field>
+ </fields>
+ <properties widgetMode="edit">
+ <property name="styleClass">dataInputText</property>
+ </properties>
+ </widget>
+
+ <widget name="addressPlace" type="text">
+ <labels>
+ <label mode="any">addressPlace</label>
+ </labels>
+ <translated>true</translated>
+ <fields>
+ <field schema="contacts_common">addressPlace</field>
+ </fields>
+ <properties widgetMode="edit">
+ <property name="styleClass">dataInputText</property>
+ </properties>
+ </widget>
+
+ <widget name="email" type="text">
<labels>
- <label mode="any">addressText1</label>
+ <label mode="any">email</label>
</labels>
<translated>true</translated>
<fields>
- <field schema="contacts_common">addressText1</field>
+ <field schema="contacts_common">email</field>
</fields>
<properties widgetMode="edit">
<property name="styleClass">dataInputText</property>
</properties>
</widget>
-
- <widget name="postcode" type="text">
+
+ <widget name="telephoneNumber" type="text">
<labels>
- <label mode="any">postcode</label>
+ <label mode="any">telephoneNumber</label>
</labels>
<translated>true</translated>
<fields>
- <field schema="contacts_common">postcode</field>
+ <field schema="contacts_common">telephoneNumber</field>
</fields>
<properties widgetMode="edit">
<property name="styleClass">dataInputText</property>
</properties>
</widget>
-
- <widget name="addressType1" type="text">
+
+ <widget name="faxNumber" type="text">
+ <labels>
+ <label mode="any">faxNumber</label>
+ </labels>
+ <translated>true</translated>
+ <fields>
+ <field schema="contacts_common">faxNumber</field>
+ </fields>
+ <properties widgetMode="edit">
+ <property name="styleClass">dataInputText</property>
+ </properties>
+ </widget>
+
+ <widget name="notes" type="text">
<labels>
- <label mode="any">addressType1</label>
+ <label mode="any">notes</label>
</labels>
<translated>true</translated>
<fields>
- <field schema="contacts_common">addressType1</field>
+ <field schema="contacts_common">notes</field>
</fields>
<properties widgetMode="edit">
<property name="styleClass">dataInputText</property>
xmlns="http://collectionspace.org/contact/"
targetNamespace="http://collectionspace.org/contact/"
version="0.1">
-
- <!-- Note: the following is currently a representative subset -->
- <!-- of the full Address Information schema specified at -->
- <!-- http://wiki.collectionspace.org/display/collectionspace/Contact+Information+Schema -->
- <!-- as this schema is still in flux. -->
-
- <!-- The use of numbered field names, below, is an expedient for -->
- <!-- release 0.5 ("Jupiter"). This will be handled instead in future -->
- <!-- releases via the standard scalar repeatability methods; e.g. -->
- <!-- minOccurs="{minValue}" maxOccurs="unbounded" attributes. -->
- <!-- Initially, in release 0.5, this entire group will be repeatable, -->
- <!-- as a result of Contact records being made a repeatable -->
- <!-- sub-resource of Person and Organization. -->
<xs:element name="csid" type="xs:string" />
<xs:element name="inAuthority" type="xs:string" />
<xs:element name="inItem" type="xs:string" />
- <xs:element name="addressType1" type="xs:string"/>
- <xs:element name="addressType2" type="xs:string"/>
- <xs:element name="addressType3" type="xs:string"/>
- <xs:element name="addressText1" type="xs:string"/>
- <xs:element name="addressText2" type="xs:string"/>
- <xs:element name="addressText3" type="xs:string"/>
- <xs:element name="postcode1" type="xs:string"/>
- <xs:element name="postcode2" type="xs:string"/>
- <xs:element name="postcode3" type="xs:string"/>
- <xs:element name="email1" type="xs:string"/>
- <xs:element name="email2" type="xs:string"/>
- <xs:element name="email3" type="xs:string"/>
- <xs:element name="telephoneNumber1" type="xs:string"/>
- <xs:element name="telephoneNumber2" type="xs:string"/>
- <xs:element name="telephoneNumber3" type="xs:string"/>
- <xs:element name="faxNumber1" type="xs:string"/>
- <xs:element name="faxNumber2" type="xs:string"/>
- <xs:element name="faxNumber3" type="xs:string"/>
+ <xs:element name="addressType" type="xs:string"/>
+ <xs:element name="addressPlace" type="xs:string"/>
+ <xs:element name="email" type="xs:string"/>
+ <xs:element name="telephoneNumber" type="xs:string"/>
+ <xs:element name="faxNumber" type="xs:string"/>
<xs:element name="notes" type="xs:string"/>
</xs:schema>
LoggerFactory.getLogger(ContactClientUtils.class);
public static MultipartOutput createContactInstance(String identifier, String headerLabel) {
- String inAuthority = "";
- String inItem = "";
+ final String inAuthority = "";
+ final String inItem = "";
return createContactInstance(
inAuthority,
inItem,
- "addressText1-" + identifier,
- "postcode-" + identifier,
- "addressType1-" + identifier,
+ "addressType-" + identifier,
+ "addressPlace-" + identifier,
+ "emakl-" + identifier,
headerLabel);
}
return createContactInstance(
inAuthority,
inItem,
- "addressText1-" + identifier,
- "postcode-" + identifier,
- "addressType1-" + identifier,
+ "addressType-" + identifier,
+ "addressPlace-" + identifier,
+ "emakl-" + identifier,
headerLabel);
}
public static MultipartOutput createContactInstance(
- String inAuthority, String inItem, String addressText,
- String postcode, String addressType, String headerLabel) {
+ String inAuthority, String inItem, String addressType,
+ String addressPlace, String email, String headerLabel) {
ContactsCommon contact = new ContactsCommon();
contact.setInAuthority(inAuthority);
contact.setInItem(inItem);
- contact.setAddressText1(addressText);
- contact.setPostcode1(postcode);
- contact.setAddressType1(addressType);
+ contact.setAddressType(addressType);
+ contact.setAddressPlace(addressPlace);
+ contact.setEmail(email);
MultipartOutput multipart = new MultipartOutput();
OutputPart commonPart =
multipart.addPart(contact, MediaType.APPLICATION_XML_TYPE);
logger.debug(testName + ": list-item[" + i + "] csid=" +
item.getCsid());
logger.debug(testName + ": list-item[" + i + "] objectNumber=" +
- item.getAddressText1());
+ item.getAddressPlace());
logger.debug(testName + ": list-item[" + i + "] URI=" +
item.getUri());
i++;
Assert.assertNotNull(contact);
// Update the content of this resource.
- contact.setAddressText1("updated-" + contact.getAddressText1());
- contact.setPostcode1("updated-" + contact.getPostcode1());
+ contact.setAddressType("updated-" + contact.getAddressType());
+ contact.setAddressPlace("updated-" + contact.getAddressPlace());
+ contact.setEmail("updated-" + contact.getEmail());
if(logger.isDebugEnabled()){
logger.debug("to be updated object");
logger.debug(objectAsXmlString(contact, ContactsCommon.class));
client.getCommonPartName(), ContactsCommon.class);
Assert.assertNotNull(updatedContact);
- Assert.assertEquals(updatedContact.getPostcode1(),
- contact.getPostcode1(),
+ Assert.assertEquals(updatedContact.getEmail(),
+ contact.getEmail(),
"Data in updated object did not match submitted data.");
}
final static String CSID = "csid";
final static String IN_AUTHORITY = "inAuthority";
final static String IN_ITEM ="inItem";
- final static String ADDRESS_TYPE1 = "addressType1";
- final static String ADDRESS_TYPE2 = "addressType2";
- final static String ADDRESS_TYPE3 = "addressType3";
- final static String ADDRESS_TEXT1 = "addressText1";
- final static String ADDRESS_TEXT2 = "addressText2";
- final static String ADDRESS_TEXT3 = "addressText3";
- final static String POSTCODE1 = "postcode1";
- final static String POSTCODE2 = "postcode2";
- final static String POSTCODE3 = "postcode3";
- final static String EMAIL1 = "email1";
- final static String EMAIL2 = "email2";
- final static String EMAIL3 = "email3";
- final static String TELEPHONE_NUMBER1 = "telephoneNumber1";
- final static String TELEPHONE_NUMBER2 = "telephoneNumber2";
- final static String TELEPHONE_NUMBER3 = "telephoneNumber3";
- final static String FAX_NUMBER1 = "faxNumber1";
- final static String FAX_NUMBER2 = "faxNumber2";
- final static String FAX_NUMBER3 = "faxNumber3";
+ final static String ADDRESS_TYPE = "addressType";
+ final static String ADDRESS_PLACE = "addressPlace";
+ final static String EMAIL = "email";
+ final static String TELEPHONE_NUMBER = "telephoneNumber";
+ final static String FAX_NUMBER = "faxNumber";
final static String NOTES = "notes";
}
package org.collectionspace.services.contact;
public interface ContactListItemJAXBSchema {
- // TODO Revisit which information unit(s) should be returned
- // in each entry, in a list of contact information.
- // Should this be addressText or some other unit(s)?
- final static String ADDRESS_TEXT1 = "addressText1";
+ final static String ADDRESS_PLACE = "addressPlace";
final static String CSID = "csid";
final static String URI = "url";
}
-->
<!-- See http://wiki.collectionspace.org/display/collectionspace/Contact+Schema -->
- <!-- contact -->
-
- <!-- Note: the following is currently a representative subset -->
- <!-- of the full Address Information schema specified at -->
- <!-- http://wiki.collectionspace.org/display/collectionspace/Contact+Information+Schema -->
- <!-- as this schema is still in flux. -->
-
- <!-- The use of numbered field names, below, is an expedient for -->
- <!-- release 0.5 ("Jupiter"). This will be handled instead in future -->
- <!-- releases via the standard scalar repeatability methods; e.g. -->
- <!-- minOccurs="{minValue}" maxOccurs="unbounded" attributes. -->
-
- <!-- Initially, in release 0.5, this entire group will be repeatable, -->
- <!-- as a result of Contact records being made a repeatable -->
- <!-- sub-resource of Person and Organization. -->
<xs:element name="contacts_common">
<xs:complexType>
<xs:sequence>
<xs:element name="csid" type="xs:string" />
<xs:element name="inAuthority" type="xs:string" />
<xs:element name="inItem" type="xs:string" />
- <xs:element name="addressType1" type="xs:string"/>
- <xs:element name="addressType2" type="xs:string"/>
- <xs:element name="addressType3" type="xs:string"/>
- <xs:element name="addressText1" type="xs:string"/>
- <xs:element name="addressText2" type="xs:string"/>
- <xs:element name="addressText3" type="xs:string"/>
- <xs:element name="postcode1" type="xs:string"/>
- <xs:element name="postcode2" type="xs:string"/>
- <xs:element name="postcode3" type="xs:string"/>
- <xs:element name="email1" type="xs:string"/>
- <xs:element name="email2" type="xs:string"/>
- <xs:element name="email3" type="xs:string"/>
- <xs:element name="telephoneNumber1" type="xs:string"/>
- <xs:element name="telephoneNumber2" type="xs:string"/>
- <xs:element name="telephoneNumber3" type="xs:string"/>
- <xs:element name="faxNumber1" type="xs:string"/>
- <xs:element name="faxNumber2" type="xs:string"/>
- <xs:element name="faxNumber3" type="xs:string"/>
+ <xs:element name="addressType" type="xs:string"/>
+ <xs:element name="addressPlace" type="xs:string"/>
+ <xs:element name="email" type="xs:string"/>
+ <xs:element name="telephoneNumber" type="xs:string"/>
+ <xs:element name="faxNumber" type="xs:string"/>
<xs:element name="notes" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="contact-list-item" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
- <xs:element name="addressText1" type="xs:string"
+ <xs:element name="addressPlace" type="xs:string"
minOccurs="1" />
<!-- uri to retrive contact details -->
<xs:element name="uri" type="xs:anyURI"
ContactListItem clistItem = new ContactListItem();
// TODO Revisit which information unit(s) should be returned
// in each entry, in a list of contact information.
- // Should this be AddressText1 or some other unit(s)?
- clistItem.setAddressText1((String) docModel.getProperty(getServiceContext().getCommonPartLabel(),
- ContactJAXBSchema.ADDRESS_TEXT1));
+ // See CSPACE-1018
+ clistItem.setAddressPlace((String) docModel.getProperty(getServiceContext().getCommonPartLabel(),
+ ContactJAXBSchema.ADDRESS_PLACE));
String id = NuxeoUtils.extractId(docModel.getPathAsString());
clistItem.setUri(getServiceContextPath() + id);
clistItem.setCsid(id);