]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-12, CSPACE-13, CSPACE-20: Revised the service's response schema and correspond...
authorAron Roberts <aron@socrates.berkeley.edu>
Mon, 9 Mar 2009 22:12:28 +0000 (22:12 +0000)
committerAron Roberts <aron@socrates.berkeley.edu>
Mon, 9 Mar 2009 22:12:28 +0000 (22:12 +0000)
Minor revision to datatype for objectNumber in defaultCollectionObject.

sandbox/aron/schema/defaultCollectionObject.rng
sandbox/aron/schema/serviceErrorResponse.rng [new file with mode: 0644]
sandbox/aron/schema/serviceErrorResponse.xml [new file with mode: 0644]
sandbox/aron/schema/serviceResponse.rng [deleted file]
sandbox/aron/schema/serviceResponse.xml [deleted file]

index 10166a0ed3fb18e1e9aa014ce05ab70044e40746..3682798644708807b625b8450b79981af61393ef 100644 (file)
   <interleave>
   
                <element name="objectNumber">
-                       <choice>
-                               <data type="string" />
-                               <empty />
-                       </choice>
+                       <!--
+                               This declaration specifies that the value of this element must never be empty (blank).
+                               If that's not accurate, it should be redefined, perhaps to match other elements below.
+                               
+                               Note: In a site- or instance-specific declaration - not in the default
+                               definition here - we might wish to specify a regex-type pattern here for
+                               further constraining valid object numbers.
+                       -->
+                       <data type="normalizedString">
+                               <param name="minLength">1</param>
+                       </data>
                </element>
 
                <optional>
diff --git a/sandbox/aron/schema/serviceErrorResponse.rng b/sandbox/aron/schema/serviceErrorResponse.rng
new file mode 100644 (file)
index 0000000..2af4835
--- /dev/null
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+
+       serviceErrorResponse.rng
+
+       A schema defining the representation of the data returned,
+       as an error response, to a call to a service.
+       
+       This schema was created for the CollectionSpace system,
+       http://www.collectionspace.org/
+       
+       It is written in the XML syntax of the RELAX NG schema language,
+       http://relaxng.org/
+
+  $Author$
+  $Revision$
+  $Date$
+
+-->
+
+<!-- The result of the operation. -->
+<element name="error"
+       xmlns="http://relaxng.org/ns/structure/1.0"
+       datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+
+       <!--
+               A service-dependent result code, which must be
+               at least one character in length.
+       -->
+       <element name="errorCode">
+               <data type="normalizedString">
+                       <param name="minLength">1</param>
+               </data>
+       </element>
+       
+       <!--
+               An (optional) service-dependent message,
+               presumably corresponding to the result code.
+       -->
+       <element name="errorMessage">
+               <choice>
+                       <empty/>
+                       <data type="normalizedString" />
+               </choice>
+       </element>
+       
+</element>
diff --git a/sandbox/aron/schema/serviceErrorResponse.xml b/sandbox/aron/schema/serviceErrorResponse.xml
new file mode 100644 (file)
index 0000000..2904c36
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+
+  serviceErrorResponse.xml
+
+  A hypothetical instance of an error response from a call to a service.
+
+  This document was created for the CollectionSpace system,
+  http://www.collectionspace.org/
+
+  $Author$
+  $Revision$
+  $Date$
+
+-->
+
+<!--
+       Note: this root element may require a namespace, and it and its
+       child elements may require the corresponding namespace prefix.
+-->
+<error>
+       <errorCode>1005</errorCode>
+       <errorMessage></errorMessage>
+</error>
diff --git a/sandbox/aron/schema/serviceResponse.rng b/sandbox/aron/schema/serviceResponse.rng
deleted file mode 100644 (file)
index d7adbf3..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
-
-       serviceResponse.rng
-
-       A schema defining the representation of the data returned in
-       response to a request.  This may include a result code and
-       message, as well as a block containing any arbitrary XML-based data.
-       
-       This schema was created for the CollectionSpace system,
-       http://www.collectionspace.org/
-       
-       It is written in the XML syntax of the RELAX NG schema language,
-       http://relaxng.org/
-
-  $Author$
-  $Revision$
-  $Date$
-
--->
-
-<grammar
-       xmlns="http://relaxng.org/ns/structure/1.0"
-       datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
-
-       <start>
-    
-               <element
-                       name="response">
-               
-                       <!-- ######################### -->
-                       <!-- Result                    -->
-                       <!-- ######################### -->
-                       
-                       <!-- The result of the operation. -->
-                       <element name="result">
-                       
-                               <!--
-                                       A service-dependent result code, which must be
-                                       at least one character in length.
-                               -->
-                               <element name="resultCode">
-                                       <data type="normalizedString">
-                                               <param name="minLength">1</param>
-                                       </data>
-                               </element>
-                               
-                               <!--
-                                       An (optional) service-dependent message,
-                                       presumably corresponding to the result code.
-                               -->
-                               <element name="resultMessage">
-                                       <choice>
-                                               <empty/>
-                                               <data type="normalizedString" />
-                                       </choice>
-                               </element>
-                               
-                       </element>
-               
-               
-                       <!-- ######################### -->
-                       <!-- Data                      -->
-                       <!-- ######################### -->
-               
-                       <!--
-                               The data returned to the caller after performing the operation.
-
-                               The data may be any one of the following:
-                               - Empty (blank);
-                               - Any text; or
-                               - Any combination of elements, each of which may have attributes,
-                                 text nodes, and child elements.
-                       -->
-                       
-                       <!--
-                               Note: we may want to add a MIME type attribute, and to consider how to
-                               structure this for potentially returning multipart MIME data or the like,
-                               for use cases where we might need to return multiple media objects, etc.
-                       -->
-                       <element name="data">
-                               <choice>
-                                       <empty/>
-                                       <text/>
-                                       <ref name="anyElement"/>
-                               </choice>
-                       </element>
-
-               </element>
-       
-       </start>
-       
-       <!--
-               See the "Name Classes" section in the RELAX NG tutorial,
-               http://relaxng.org/tutorial-20011203.html#IDAFLZR
-       -->
-  <define name="anyElement">
-    <element>
-      <anyName/>
-      <zeroOrMore>
-                               <choice>
-                                       <attribute>
-                                               <anyName/>
-                                       </attribute>
-                                       <text/>
-                                       <ref name="anyElement"/>
-                               </choice>
-      </zeroOrMore>
-    </element>
-  </define>
-       
-</grammar>
-
diff --git a/sandbox/aron/schema/serviceResponse.xml b/sandbox/aron/schema/serviceResponse.xml
deleted file mode 100644 (file)
index f1d48fb..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
-
-  serviceResponse.xml
-
-  A hypothetical instance of an serviceResponse document.
-
-  This document was created for the CollectionSpace system,
-  http://www.collectionspace.org/
-
-  $Author$
-  $Revision$
-  $Date$
-
--->
-
-<!--
-       Note: this root element may require a namespace, and it and its
-       child elements may require the corresponding namespace prefix.
--->
-<response>
-  <result>
-    <resultCode>1005</resultCode>
-    <resultMessage></resultMessage>
-  </result>
-  <!--
-    The 'data' element below may be empty, contain any text,
-    or consist of any XML element, which may have attributes,
-    text nodes, and child elements.
-  -->
-  <data>foo</data>
-</response>