--- /dev/null
+/target/
+/target/
+/target/
+/target/
+/target/
+/target/
--- /dev/null
+/target/
+/target/
+/target/
final static String ORDER = "order";
final static String SHORT_IDENTIFIER = "shortIdentifier";
final static String CSID = "csid";
+ final static String REV = "rev";
final static String DISPLAY_NAME = "displayName"; // This is the display name element for the Vocabulary service's item
final static String TERM_DISPLAY_NAME = "termDisplayName"; // This is the display name element for all Authority services' items
final static String TERM_NAME = "termName";
import org.collectionspace.services.common.document.DocumentException;
import org.collectionspace.services.common.document.DocumentNotFoundException;
import org.collectionspace.services.common.document.DocumentWrapper;
+import org.collectionspace.services.common.document.DocumentHandler.Action;
+import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
import org.collectionspace.services.common.vocabulary.AuthorityJAXBSchema;
import org.collectionspace.services.config.service.ObjectPartType;
import org.collectionspace.services.nuxeo.client.java.NuxeoDocumentModelHandler;
return unQObjectProperties;
}
+
+ public void fillAllParts(DocumentWrapper<DocumentModel> wrapDoc, Action action) throws Exception {
+ super.fillAllParts(wrapDoc, action);
+ //
+ // Update the record's revision number on both CREATE and UPDATE actions
+ //
+ DocumentModel documentModel = wrapDoc.getWrappedObject();
+ Integer rev = (Integer)documentModel.getProperty(authorityCommonSchemaName, AuthorityItemJAXBSchema.REV);
+ if (rev == null) {
+ rev = 0;
+ } else {
+ rev++;
+ }
+ documentModel.setProperty(authorityCommonSchemaName, AuthorityItemJAXBSchema.REV, rev);
+ }
+
@Override
public void handleCreate(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
--- /dev/null
+/target/
+/target/
+/target/
+/target/
+/target/
+/target/
+/target/
--- /dev/null
+/target/
+/target/
--- /dev/null
+/target/
+/target/
<xs:sequence>
<!-- Common identifier -->
<xs:element name="csid" type="xs:string" />
+ <xs:element name="rev" type="xs:integer" /> <!-- Revision number -->
<!-- Citation Information Group -->
<xs:element name="inAuthority" type="xs:string" />
Part : Common
Used for: JAXB binding between XML and Java objects
- $LastChangedRevision: 1055 $
- $LastChangedDate: 2009-12-09 12:25:15 -0800 (Wed, 09 Dec 2009) $
-->
<xs:schema
xmlns:ns="http://collectionspace.org/services/citation"
xmlns="http://collectionspace.org/services/citation"
targetNamespace="http://collectionspace.org/services/citation"
- version="0.1"
+ version="0.2"
>
<!--
<!-- CitationAuthority Information Group -->
<xs:element name="displayName" type="xs:string"/>
- <xs:element name="shortIdentifier" type="xs:string"/>
+ <xs:element name="shortIdentifier" type="xs:string"/>
<xs:element name="refName" type="xs:string"/>
<xs:element name="vocabType" type="xs:string"/>
<xs:element name="source" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
+ <!-- Internal fields -->
+ <xs:element name="rev" type="xs:integer"/> <!-- The revision number of the authority. Increments with each change including changes to its terms. -->
</xs:sequence>
</xs:complexType>
</xs:element>
--- /dev/null
+/target/
+/target/
ArrayList<String> docTypes = new ArrayList<String>();
- String query = computeWhereClauseForAuthorityRefDocs(refName, refPropName, docTypes, servicebindings, // REM - Side effect that docTypes array gets set. Any others?
+ String query = computeWhereClauseForAuthorityRefDocs(refName, refPropName, docTypes, servicebindings, // REM - Side effect that docTypes, authRefFieldsByService, and queriedServiceBindings get set/change. Any others?
queriedServiceBindings, authRefFieldsByService);
if (query == null) { // found no authRef fields - nothing to query
return null;
+ " AND " + (authTermInfo.inAuthority.name != null
? authTermInfo.inAuthority.name : authTermInfo.inAuthority.csid)
+ " AND " + (authTermInfo.name != null
- ? authTermInfo.name : authTermInfo.csid);
+ ? authTermInfo.name : authTermInfo.csid); // REM - This seems likely to cause trouble. We should consider searching for the full refname -excluding the display name suffix
String whereClauseStr = QueryManager.createWhereClauseFromKeywords(keywords);
}
if (prop instanceof StringProperty) { // scalar string
- addARIifMatches(refNameToMatch, matchBaseOnly, arci, prop, foundProps);
+ addARIifMatches(refNameToMatch, matchBaseOnly, arci, prop, foundProps); // REM - Side effect that foundProps gets changed/updated
} else if (prop instanceof List) {
List<Property> propList = (List<Property>) prop;
// run through list. Must either be list of Strings, or Complex
<xs:sequence>
<!-- Common identifier -->
<xs:element name="csid" type="xs:string" />
+ <xs:element name="rev" type="xs:integer" /> <!-- Revision number -->
<!-- Common Authority Information Group -->
<!-- inAuthority is the csid of the owning ConceptAuthority -->
Part : Common
Used for: JAXB binding between XML and Java objects
- $LastChangedRevision: 1055 $
- $LastChangedDate: 2009-12-09 12:25:15 -0800 (Wed, 09 Dec 2009) $
-->
<xs:schema
xmlns:ns="http://collectionspace.org/services/concept"
xmlns="http://collectionspace.org/services/concept"
targetNamespace="http://collectionspace.org/services/concept"
- version="0.1"
+ version="0.2"
>
<!--
<!-- ConceptAuthority Information Group -->
<xs:element name="displayName" type="xs:string"/>
- <xs:element name="shortIdentifier" type="xs:string"/>
+ <xs:element name="shortIdentifier" type="xs:string"/>
<xs:element name="refName" type="xs:string"/>
<xs:element name="vocabType" type="xs:string"/>
<xs:element name="source" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
+ <!-- Internal fields -->
+ <xs:element name="rev" type="xs:integer"/> <!-- The revision number of the authority. Increments with each change including changes to its terms. -->
</xs:sequence>
</xs:complexType>
</xs:element>
--- /dev/null
+/target/
+/target/
+/target/
--- /dev/null
+/target/
+/target/
+/target/
+/target/
--- /dev/null
+/target/
+/target/
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+ Location schema (XSD)
+
+ Entity : Location
+ Part : Common
+ Used for: JAXB binding between XML and Java objects
+-->
+
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
<xs:sequence>
<!-- Common identifier -->
<xs:element name="csid" type="xs:string" />
+ <xs:element name="rev" type="xs:integer" /> <!-- Revision number -->
<!-- Location Information Group -->
<!-- inAuthority is the csid of the owning LocationAuthority -->
Part : Common
Used for: JAXB binding between XML and Java objects
- $LastChangedRevision: 1055 $
- $LastChangedDate: 2009-12-09 12:25:15 -0800 (Wed, 09 Dec 2009) $
-->
<xs:schema
xmlns:ns="http://collectionspace.org/services/location"
xmlns="http://collectionspace.org/services/location"
targetNamespace="http://collectionspace.org/services/location"
- version="0.1"
+ version="0.2"
>
<!--
<!-- LocationAuthority Information Group -->
<xs:element name="displayName" type="xs:string"/>
- <xs:element name="shortIdentifier" type="xs:string"/>
+ <xs:element name="shortIdentifier" type="xs:string"/>
<xs:element name="refName" type="xs:string"/>
<xs:element name="vocabType" type="xs:string"/>
<xs:element name="source" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
+ <!-- Internal fields -->
+ <xs:element name="rev" type="xs:integer"/> <!-- The revision number of the authority. Increments with each change including changes to its terms. -->
</xs:sequence>
</xs:complexType>
</xs:element>
--- /dev/null
+/target/
+/target/
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+ Material schema (XSD)
+
+ Entity : Material
+ Part : Common
+ Used for: JAXB binding between XML and Java objects
+-->
+
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
<xs:sequence>
<!-- Common identifier -->
<xs:element name="csid" type="xs:string" />
+ <xs:element name="rev" type="xs:integer" /> <!-- Revision number -->
<!-- Common Authority Information Group -->
<!-- inAuthority is the csid of the owning MaterialAuthority -->
xmlns:ns="http://collectionspace.org/services/material"
xmlns="http://collectionspace.org/services/material"
targetNamespace="http://collectionspace.org/services/material"
- version="0.1"
+ version="0.2"
>
<!--
<xs:element name="vocabType" type="xs:string"/>
<xs:element name="source" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
+ <!-- Internal fields -->
+ <xs:element name="rev" type="xs:integer"/> <!-- The revision number of the authority. Increments with each change including changes to its terms. -->
</xs:sequence>
</xs:complexType>
</xs:element>
--- /dev/null
+/target/
+/target/
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+ Organization schema (XSD)
+
+ Entity : Organization
+ Part : Common
+ Used for: JAXB binding between XML and Java objects
+-->
+
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
<xs:sequence>
<!-- Common identifier -->
<xs:element name="csid" type="xs:string" />
+ <xs:element name="rev" type="xs:integer" /> <!-- Revision number -->
<!-- Organization Information Group -->
<xs:element name="inAuthority" type="xs:string" />
Part : Common
Used for: JAXB binding between XML and Java objects
- $LastChangedRevision$
- $LastChangedDate$
-->
<xs:schema
xmlns:ns="http://collectionspace.org/services/organization"
xmlns="http://collectionspace.org/services/organization"
targetNamespace="http://collectionspace.org/services/organization"
- version="0.1">
+ version="0.2"
+ >
<!--
Avoid XmlRootElement nightmare:
<xs:element name="csid" type="xs:string" />
<!-- OrgAuthority Information Group -->
- <xs:element name="shortIdentifier" type="xs:string"/>
<xs:element name="displayName" type="xs:string"/>
+ <xs:element name="shortIdentifier" type="xs:string"/>
<xs:element name="refName" type="xs:string"/>
<xs:element name="vocabType" type="xs:string"/>
<xs:element name="source" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
+ <!-- Internal fields -->
+ <xs:element name="rev" type="xs:integer"/> <!-- The revision number of the authority. Increments with each change including changes to its terms. -->
</xs:sequence>
</xs:complexType>
</xs:element>
--- /dev/null
+/target/
+/target/
<xs:sequence>
<!-- Common identifier -->
<xs:element name="csid" type="xs:string" />
+ <xs:element name="rev" type="xs:integer" /> <!-- Revision number -->
<!-- Person Information Group -->
<xs:element name="inAuthority" type="xs:string" />
Part : Common
Used for: JAXB binding between XML and Java objects
- $LastChangedRevision: 1055 $
- $LastChangedDate: 2009-12-09 12:25:15 -0800 (Wed, 09 Dec 2009) $
-->
<xs:schema
xmlns:ns="http://collectionspace.org/services/person"
xmlns="http://collectionspace.org/services/person"
targetNamespace="http://collectionspace.org/services/person"
- version="0.1"
- >
+ version="0.2"
+ >
<!--
Avoid XmlRootElement nightmare:
<!-- PersonAuthority Information Group -->
<xs:element name="displayName" type="xs:string"/>
- <xs:element name="shortIdentifier" type="xs:string"/>
+ <xs:element name="shortIdentifier" type="xs:string"/>
<xs:element name="refName" type="xs:string"/>
<xs:element name="vocabType" type="xs:string"/>
<xs:element name="source" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
+ <!-- Internal fields -->
+ <xs:element name="rev" type="xs:integer"/> <!-- The revision number of the authority. Increments with each change including changes to its terms. -->
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:sequence>
<!-- Common identifier -->
<xs:element name="csid" type="xs:string" />
+ <xs:element name="rev" type="xs:integer" /> <!-- Revision number -->
<!-- Place Information Group -->
<!-- inAuthority is the csid of the owning PlaceAuthority -->
Part : Common
Used for: JAXB binding between XML and Java objects
- $LastChangedRevision: 1055 $
- $LastChangedDate: 2009-12-09 12:25:15 -0800 (Wed, 09 Dec 2009) $
-->
<xs:schema
xmlns:ns="http://collectionspace.org/services/place"
xmlns="http://collectionspace.org/services/place"
targetNamespace="http://collectionspace.org/services/place"
- version="0.1"
+ version="0.2"
>
<!--
<!-- PlaceAuthority Information Group -->
<xs:element name="displayName" type="xs:string"/>
- <xs:element name="shortIdentifier" type="xs:string"/>
+ <xs:element name="shortIdentifier" type="xs:string"/>
<xs:element name="refName" type="xs:string"/>
<xs:element name="vocabType" type="xs:string"/>
<xs:element name="source" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
+ <!-- Internal fields -->
+ <xs:element name="rev" type="xs:integer"/> <!-- The revision number of the authority. Increments with each change including changes to its terms. -->
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:sequence>
<!-- Common identifier -->
<xs:element name="csid" type="xs:string" />
+ <xs:element name="rev" type="xs:integer" /> <!-- Revision number -->
<!-- Taxonomy Information Group -->
<!-- inAuthority is the csid of the owning TaxonomyAuthority -->
Part : Common
Used for: JAXB binding between XML and Java objects
- $LastChangedRevision$
- $LastChangedDate$
-->
<xs:schema
xmlns:ns="http://collectionspace.org/services/taxonomy"
xmlns="http://collectionspace.org/services/taxonomy"
targetNamespace="http://collectionspace.org/services/taxonomy"
- version="0.1"
+ version="0.2"
>
<!--
<xs:element name="vocabType" type="xs:string"/>
<xs:element name="source" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
+ <!-- Internal fields -->
+ <xs:element name="rev" type="xs:integer"/> <!-- The revision number of the authority. Increments with each change including changes to its terms. -->
</xs:sequence>
</xs:complexType>
</xs:element>
Part : Common
Used for: JAXB binding between XML and Java objects
- $LastChangedRevision$
- $LastChangedDate$
-->
<xs:schema
xmlns:ns="http://collectionspace.org/services/vocabulary"
xmlns="http://collectionspace.org/services/vocabulary"
targetNamespace="http://collectionspace.org/services/vocabulary"
- version="0.1"
+ version="0.2"
>
<!--
<xs:element name="vocabType" type="xs:string"/>
<xs:element name="source" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
+ <!-- Internal fields -->
+ <xs:element name="rev" type="xs:integer"/> <!-- The revision number of the authority. Increments with each change including changes to its terms. -->
</xs:sequence>
</xs:complexType>
</xs:element>
+
</xs:schema>
<xs:sequence>
<!-- Common identifier -->
<xs:element name="csid" type="xs:string"/>
+ <xs:element name="rev" type="xs:integer" /> <!-- Revision number -->
<!-- Vocabularyitem Information Group -->
<xs:element name="inAuthority" type="xs:string"/>
<xs:sequence>
<!-- Common identifier -->
<xs:element name="csid" type="xs:string" />
+ <xs:element name="rev" type="xs:integer" /> <!-- Revision number -->
<!-- Common Authority Information Group -->
<!-- inAuthority is the csid of the owning WorkAuthority -->
xmlns:ns="http://collectionspace.org/services/work"
xmlns="http://collectionspace.org/services/work"
targetNamespace="http://collectionspace.org/services/work"
- version="0.1"
+ version="0.2"
>
<!--
<xs:element name="vocabType" type="xs:string"/>
<xs:element name="source" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
+ <!-- Internal fields -->
+ <xs:element name="rev" type="xs:integer"/> <!-- The revision number of the authority. Increments with each change including changes to its terms. -->
</xs:sequence>
</xs:complexType>
</xs:element>