]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-737: Added fields to Contact serice, conforming to current 0.5 wireframe and...
authorAron Roberts <aron@socrates.berkeley.edu>
Thu, 4 Feb 2010 06:34:47 +0000 (06:34 +0000)
committerAron Roberts <aron@socrates.berkeley.edu>
Thu, 4 Feb 2010 06:34:47 +0000 (06:34 +0000)
services/contact/3rdparty/nuxeo-platform-cs-contact/src/main/resources/OSGI-INF/layouts-contrib.xml
services/contact/3rdparty/nuxeo-platform-cs-contact/src/main/resources/schemas/contacts_common.xsd
services/contact/client/src/test/java/org/collectionspace/services/client/test/ContactServiceTest.java
services/contact/jaxb/src/main/java/org/collectionspace/services/contact/ContactJAXBSchema.java
services/contact/jaxb/src/main/java/org/collectionspace/services/contact/ContactListItemJAXBSchema.java
services/contact/jaxb/src/main/resources/contacts-common.xsd
services/contact/service/src/main/java/org/collectionspace/services/contact/nuxeo/ContactDocumentModelHandler.java

index b5e35d5eecfead3faa259b50c9b92fb0ce8c70dd..ae32eb0e5e574a942fcccb1e8016f77149380a89 100644 (file)
         <template mode="any">/layouts/layout_default_template.xhtml</template>
       </templates>
       <rows>
-        <row><widget>addressText</widget></row>
+        <row><widget>addressType1</widget></row>
+        <row><widget>addressText1</widget></row>
         <row><widget>postcode</widget></row>
-        <row><widget>addressType</widget></row>
       </rows>
       
-      <widget name="addressText" type="text">
+      <widget name="addressText1" type="text">
         <labels>
-          <label mode="any">addressText</label>
+          <label mode="any">addressText1</label>
         </labels>
         <translated>true</translated>
         <fields>
-          <field schema="contacts_common">addressText</field>
+          <field schema="contacts_common">addressText1</field>
         </fields>
         <properties widgetMode="edit">
           <property name="styleClass">dataInputText</property>
         </properties>
       </widget>
       
-      <widget name="addressType" type="text">
+      <widget name="addressType1" type="text">
         <labels>
-          <label mode="any">addressType</label>
+          <label mode="any">addressType1</label>
         </labels>
         <translated>true</translated>
         <fields>
-          <field schema="contacts_common">addressType</field>
+          <field schema="contacts_common">addressType1</field>
         </fields>
         <properties widgetMode="edit">
           <property name="styleClass">dataInputText</property>
index fe852862cfab1386995ecb99dc1ac985178da0c4..891aecf4bb2c5fdb4dc5e3d12e5e786bec25e6c5 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 
 <!--
     Contact schema (XSD)
     <!-- 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 believed to still be in flux. -->
-    
-<!--  Address Information Group -->
-    <xs:element name="addressText" type="xs:string"/>
-    <xs:element name="postcode" type="xs:string"/>
-    <xs:element name="addressType" type="xs:string"/>
+    <!-- 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="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="notes" type="xs:string"/>
     
 </xs:schema>
index 55db0250e0af558bf9f350d035e0492836a1c1b3..04d661b69638e6273527c9d0c6cd0fde37b70f23 100644 (file)
@@ -303,7 +303,7 @@ public class ContactServiceTest extends AbstractServiceTest {
                 logger.debug(testName + ": list-item[" + i + "] csid=" +
                         item.getCsid());
                 logger.debug(testName + ": list-item[" + i + "] objectNumber=" +
-                        item.getAddressText());
+                        item.getAddressText1());
                 logger.debug(testName + ": list-item[" + i + "] URI=" +
                         item.getUri());
                 i++;
@@ -342,8 +342,8 @@ public class ContactServiceTest extends AbstractServiceTest {
         Assert.assertNotNull(contact);
 
         // Update the content of this resource.
-        contact.setAddressText("updated-" + contact.getAddressText());
-        contact.setPostcode("updated-" + contact.getPostcode());
+        contact.setAddressText1("updated-" + contact.getAddressText1());
+        contact.setPostcode1("updated-" + contact.getPostcode1());
         if(logger.isDebugEnabled()){
             logger.debug("to be updated object");
             logger.debug(objectAsXmlString(contact, ContactsCommon.class));
@@ -370,8 +370,8 @@ public class ContactServiceTest extends AbstractServiceTest {
                         client.getCommonPartName(), ContactsCommon.class);
         Assert.assertNotNull(updatedContact);
 
-        Assert.assertEquals(updatedContact.getPostcode(),
-                contact.getPostcode(),
+        Assert.assertEquals(updatedContact.getPostcode1(),
+                contact.getPostcode1(),
                 "Data in updated object did not match submitted data.");
 
     }
@@ -607,17 +607,17 @@ public class ContactServiceTest extends AbstractServiceTest {
 
     private MultipartOutput createContactInstance(String identifier) {
         return createContactInstance(
-                       "addressText-" + identifier,
+                       "addressText1-" + identifier,
                 "postcode-" + identifier,
-                "addressType-" + identifier);
+                "addressType1-" + identifier);
     }
 
-    private MultipartOutput createContactInstance(String addressText,
-        String postcode, String addressType) {
+    private MultipartOutput createContactInstance(String addressText1,
+        String postcode, String addressType1) {
         ContactsCommon contact = new ContactsCommon();
-        contact.setAddressText(addressText);
-        contact.setPostcode(postcode);
-        contact.setAddressType(addressType);
+        contact.setAddressText1(addressText1);
+        contact.setPostcode1(postcode);
+        contact.setAddressType1(addressType1);
         MultipartOutput multipart = new MultipartOutput();
         OutputPart commonPart =
             multipart.addPart(contact, MediaType.APPLICATION_XML_TYPE);
index b6beefa2e2e1d72a471f6e9899046290a0233ab9..9e2d4c68a9850d526065fedfafaeb82f31de413a 100644 (file)
@@ -7,9 +7,25 @@ package org.collectionspace.services.contact;
  *
  */
 public interface ContactJAXBSchema {
-       final static String ADDRESS_TEXT = "addressText";
-       final static String POSTCODE = "postcode";
-       final static String ADDRESS_TYPE = "addressType";
+       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 NOTES = "notes";
 }
 
 
index ff5699f13231cb8e1ec54dc082831b0fabf3c2a3..5b29dc035f40e130b1b4b2f14dc8bac2ee610244 100644 (file)
@@ -4,7 +4,7 @@ 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_TEXT = "addressText";
+       final static String ADDRESS_TEXT1 = "addressText1";
        final static String CSID = "csid";
        final static String URI = "url";
 }
index 32cc8192981280eadaa6b289bf505095d5871d00..e3003be5d2887e350794aece3519b6552af6581f 100644 (file)
     <!-- 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 believed to still be in flux. -->
+    <!-- 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="addressText" type="xs:string"/>
-                <xs:element name="postcode" type="xs:string"/>
-                <xs:element name="addressType" 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="notes" type="xs:string"/>
             </xs:sequence>
         </xs:complexType>
     </xs:element>
@@ -49,7 +74,7 @@
                 <xs:element name="contact-list-item" maxOccurs="unbounded">
                     <xs:complexType>
                         <xs:sequence>
-                            <xs:element name="addressText" type="xs:string"
+                            <xs:element name="addressText1" type="xs:string"
                                 minOccurs="1" />
                             <!-- uri to retrive contact details -->
                             <xs:element name="uri" type="xs:anyURI"
index af4c9b6dc58c8d43f76c6e015368451500182e25..51ae5256c84fae7bc2ecac7ad628cea2d1a9f951 100644 (file)
@@ -120,9 +120,9 @@ public class ContactDocumentModelHandler
             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 addressText or some other unit(s)?
-            clistItem.setAddressText((String) docModel.getProperty(getServiceContext().getCommonPartLabel(),
-                    ContactJAXBSchema.ADDRESS_TEXT));
+            // Should this be AddressText1 or some other unit(s)?
+            clistItem.setAddressText1((String) docModel.getProperty(getServiceContext().getCommonPartLabel(),
+                    ContactJAXBSchema.ADDRESS_TEXT1));
             String id = NuxeoUtils.extractId(docModel.getPathAsString());
             clistItem.setUri(getServiceContextPath() + id);
             clistItem.setCsid(id);