...
Changed Acquisition method into a controlled list field
Wiki Markup |
---|
{composition-setup}{composition-setup} |
1. changed the <options> ... </options> section to the acquisitionMethod
definition in base-procedure-acquisition.xml
Wiki Markup |
---|
{toggle-cloak:id=a11} |
unmigrated-inline-wiki-markup
{cloak:id=a11} |
Code Block |
---|
controls | true |
---|
language | xml |
---|
linenumbers | true |
---|
|
<field id="acquisitionMethod" seperate_ui_container="true">
<selector>acquisition-acquisition-method</selector>
<options>
<option id="gift" default="yes">Gift</option>
<option id="purchase">Purchase</option>
<option id="bequest">Bequest</option>
<option id="loan">Loan</option>
<option id="restrictedgifts">Restricted Gifts</option>
</options>
</field>
|
Note |
---|
Note the string structure for the term list options: all lower-case and no space between words. |
unmigrated-inline-wiki-markup |
{cloak} |
2. build using mini-build script
Wiki Markup |
---|
{toggle-cloak:id=a12} |
Wiki Markup |
---|
{cloak:id=a12} |
Code Block |
---|
controls | true |
---|
language | Code Block |
---|
controls | true |
---|
language | xml |
---|
linenumbers | true |
---|
|
cd /tmp/tenant-customizations-v1.9/application
ant deploy
|
Then restart cspace server.
...
Add new text field:
Extent
...
- a. add a custom acquisition schema file
acquisitions_mmi.xsd
with new field name acquisitionExtent
Wiki Markup |
---|
{toggle-cloak:id=a21a} |
Wiki Markup |
---|
{cloak:id=a21a} |
Code Block |
---|
controls | true |
---|
language | xml |
---|
linenumbers | true |
---|
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
MMI Acquisition schema (XSD)
Entity : Acquisition
Part : Local - Museum of the Moving Image (MMI)
Used for: Nuxeo EP core document type
$LastChangedRevision: $
$LastChangedDate: $
-->
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns="http://collectionspace.org/services/acquisition/local/mmi"
xmlns="http://collectionspace.org/services/acquisition/local/mmi"
targetNamespace="http://collectionspace.org/services/acquisition/local/mmi"
version="0.1">
<xs:element name="acquisitionExtent" type="xs:string"/>
</xs:schema>
|
- b. edit MANIFEST.b. edit
MANIFEST.MF
to reference new mmi
module Wiki Markup |
---|
{toggle-cloak:id=a21b} |
Wiki Markup |
{cloak:id=a21b}
Note references to lowercase mmi
tenant string name on lines 3, 4, and 18.
Code Block |
---|
controls | true |
---|
language | xml |
---|
linenumbers | true |
---|
|
Manifest-Version: 1.0
Bundle-ManifestVersion: 1
Bundle-Name: org.collectionspace.acquisitiontenant42
Bundle-SymbolicName: org.collectionspace.acquisitiontenant42;singleton:=true
Bundle-Version: 1.0.0
Bundle-Localization: plugin
Bundle-Vendor: Nuxeo
Require-Bundle: org.nuxeo.runtime,
org.nuxeo.ecm.core.api,
org.nuxeo.ecm.core,
org.nuxeo.ecm.core.api,
org.nuxeo.ecm.platform.types.api,
org.nuxeo.ecm.platform.versioning.api,
org.nuxeo.ecm.platform.ui,
org.nuxeo.ecm.platform.forms.layout.client,
org.nuxeo.ecm.platform.ws,
org.collectionspace.collectionspace_core
Provide-Package: org.collectionspace.acquisitiontenant42
Nuxeo-Component: OSGI-INF/core-types-contrib.xml,
OSGI-INF/life-cycle-contrib.xml,
OSGI-INF/ecm-types-contrib.xml,
OSGI-INF/layouts-contrib.xml
|
- c. add a custom schema to parent document type
core-types-contrib.xml
and reference new acquisition schema Wiki Markup |
---|
{toggle-cloak:id=a21c} |
Wiki Markup |
---|
{cloak:id=a21c} |
Note reference to mmi
schema names and tenant string names on line Note reference to mmi
schema names and tenant string names on line 2, 4, 7 and 16. Code Block |
---|
controls | true |
---|
language | xml |
---|
linenumbers | true |
---|
|
<?xml version="1.0"?>
<component name="org.collectionspace.acquisitionTenant42.coreTypes">
<extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
<schema name="acquisitions_mmi" prefix="acquisitions_mmi" src="schemas/acquisitions_mmi.xsd"/>
</extension>
<extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
<doctype name="AcquisitionTenant42" extends="Document">
<schema name="common"/>
<schema name="dublincore"/>
<schema name="collectionspace_core"/>
<schema name="acquisitions_common"/>
<schema name="acquisitions_mmi"/>
<prefetch>
acquisitions_common:acquisitionReferenceNumber
acquisitions_common:acquisitionSources
acquisitions_common:owners</prefetch>
</doctype>
</extension>
</component>
|
Wiki Markup |
---|
{cloak} |
- d. edit
ecm-types-contrib.xml
to reference new mmi
component Wiki Markup |
---|
{toggle-cloak:id=a21d} |
Wiki Markup |
---|
{cloak:id=a21d} |
Note reference to mmi
tenant string name on lines 2, 4, 5, 11, 17 and 23. Code Block |
---|
controls | true |
---|
language | xml |
---|
linenumbers | true |
---|
|
<?xml version="1.0"?>
<component name="org.collectionspace.acquisitionTenant42.ecm.types">
<extension target="org.nuxeo.ecm.platform.types.TypeService" point="types">
<type id="AcquisitionTenant42" coretype="AcquisitionTenant42">
<label>org.collectionspace.acquisitionTenant42</label>
<!--icon>/icons/file.gif</icon-->
<default-view>view_documents</default-view>
<layouts mode="any">
<layout>heading</layout>
<layout>collectionspace_core</layout>
<layout>acquisitionTenant42</layout>
</layouts>
</type>
<type id="Folder" coretype="Folder">
<subtypes>
<type>acquisitionTenant42</type>
</subtypes>
</type>
<type id="Workspace" coretype="Workspace">
<subtypes>
<type>acquisitionTenant42</type>
</subtypes>
</type>
</extension>
</component>
|
- ee. edit
layouts-contrib.xml
to reference new mmi
component Wiki Markup |
---|
{toggle-cloak:id=a21e} |
Wiki Markup |
{cloak:id=a21e}
Note reference to mmi
tenant string name on lines 3 and 8.
Code Block |
---|
controls | true |
---|
language | xml |
---|
linenumbers | true |
---|
|
<?xml version="1.0"?>
<component name="org.collectionspace.acquisitionTenant42.layouts.webapp">
<extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
point="layouts">
<layout name="acquisitionTenant42">
<templates>
...
|
- f. edit
life-cycle-contrib.xml
to reference new mmi
component Wiki Markup |
---|
{toggle-cloak:id=a21f} |
Wiki Markup |
---|
{cloak:id=a21f} |
Note reference to mmi
tenant string name on lines 2 and 7. Code Block |
Note reference to mmi
tenant string name on lines 2 and 7. Code Block |
---|
controls | true |
---|
language | xml |
---|
linenumbers | true |
---|
|
<?xml version="1.0"?>
<component name="org.collectionspace.ecm.platform.acquisitionTenant42.LifeCycleManagerExtensions">
<extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService"
point="types">
<types>
<type name="AcquisitionTenant42">default</type>
</types>
</extension>
</component>
|
- g. edit
3rdparty/nuxeo-platform-cs-acquisition-mmi/build.xml
so to build the custom sub-module Wiki Markup |
---|
{toggle-cloak:id=a21g} |
Wiki Markup |
---|
{cloak:id=a21g} |
Note reference to mmi
project name on line 1, and tenant string name on lines 13 and 15. Code Block |
Note reference to mmi
project name on line 1, and tenant string name on lines 13 and 15. Code Block |
---|
controls | true |
---|
language | xml |
---|
linenumbers | true |
---|
|
<project name="nuxeo-platform-cs-acquisition-mmi" default="package" basedir=".">
<description>
acquisition nuxeo document type
</description>
<!-- set global properties for this build -->
<property name="services.trunk" value="../../../.."/>
<!-- environment should be declared before reading build.properties -->
<property environment="env" />
<property file="${services.trunk}/build.properties" />
<property name="mvn.opts" value="" />
<property name="src" location="src"/>
<property name="nuxeo.acquisition.jar"
value="org.collectionspace.services.AcquisitionTenant42.3rdparty.nuxeo-${cspace.release}.jar"/>
<property name="nuxeo.acquisition.jars.all"
value="org.collectionspace.services.AcquisitionTenant42.3rdparty.nuxeo-*.jar"/>
...
|
- h. edit
3rdparty/nuxeo-platform-cs-acquisition-mmi/pom.xml
to reference new mmi
component Wiki Markup |
---|
{toggle-cloak:id=a21h} |
Wiki Markup |
---|
{cloak:id=a21h} |
Note reference to mmi
tenant string name on lines 12, 13, Note reference to mmi
tenant string name on lines 12, 13, and description on line 15. Code Block |
---|
controls | true |
---|
language | xml |
---|
linenumbers | true |
---|
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.collectionspace.services</groupId>
<artifactId>org.collectionspace.services.acquisition.3rdparty</artifactId>
<version>1.11-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.collectionspace.services</groupId>
<artifactId>org.collectionspace.services.AcquisitionTenant42.3rdparty.nuxeo</artifactId>
<name>services.AcquisitionTenant42.3rdparty.nuxeo</name>
<packaging>jar</packaging>
<description> MMI Acquisition Nuxeo Document Type </description>
...
|
Wiki Markup |
---|
{cloak} |
- i. edit
3rdparty/build.xml
so to build the custom sub-module Wiki Markup |
---|
{toggle-cloak:id=a21i} |
Wiki Markup |
---|
{cloak:id=a21i} |
Wiki Markup |
{align:mode|class=myclass}
Note reference to {{mmi}} custom module on lines 11, 116, 122 and 128.
{newcode:language=xml|linenumbers=true|controls=true} Align |
---|
|
Note reference to mmi custom module on lines 11, 116, 122 and 128. Code Block |
---|
controls | true |
---|
language | xml |
---|
linenumbers | true |
---|
|
<project name="acquisition.3rdparty" default="package" basedir=".">
<description>
acquisition service 3rdparty
</description>
<!-- set global properties for this build -->
<property name="services.trunk" value="../../.."/>
<!-- enviornment should be declared before reading build.properties -->
<property environment="env" />
<property file="${services.trunk}/build.properties" />
<property name="nuxeo-platform-acquisition" value="nuxeo-platform-acquisition"/>
<property name="nuxeo-platform-acquisition-mmi" value="nuxeo-platform-acquisition-mmi"/>
...
| {newcode}
and further down the file
{newcode:language=xml|linenumbers=true|controls=true|firstline=113}file Code Block |
---|
controls | true |
---|
language | xml |
---|
firstline | 113 |
---|
linenumbers | true |
---|
|
<target name="deploy" depends="install"
description="deploy acquisition in ${jboss.server.nuxeo}">
<ant antfile="nuxeo-platform-cs-acquisition/build.xml" target="deploy" inheritall="false"/>
<ant antfile="nuxeo-platform-cs-acquisition-mmi/build.xml" target="deploy" inheritall="false"/>
</target>
<target name="undeploy"
description="undeploy acquisition from ${jboss.server.nuxeo}">
<ant antfile="nuxeo-platform-cs-acquisition/build.xml" target="undeploy" inheritall="false"/>
<ant antfile="nuxeo-platform-cs-acquisition-mmi/build.xml" target="undeploy" inheritall="false"/>
</target>
<target name="dist"
description="generate distribution for acquisition" depends="package">
<ant antfile="nuxeo-platform-cs-acquisition/build.xml" target="dist" inheritall="false"/>
<ant antfile="nuxeo-platform-cs-acquisition-mmi/build.xml" target="dist" inheritall="false"/>
</target>
</project>
| {newcode}
{align} |
Wiki Markup |
---|
{cloak} |
- j. edit
3rdparty/pom.xml
to reference new mmi
component unmigrated-inline-wiki-markup
{toggle-cloak:id=a21j} |
Wiki Markup |
---|
{cloak:id=a21j} |
Note reference to mmi
custom module on line 21. Code Block |
---|
controls | true |
---|
language | xml |
---|
linenumbers | true |
---|
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.collectionspace.services</groupId>
<artifactId>org.collectionspace.services.acquisition</artifactId>
<version>1.11-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.collectionspace.services</groupId>
<artifactId>org.collectionspace.services.acquisition.3rdparty</artifactId>
<packaging>pom</packaging>
<name>services.acquisition.3rdparty</name>
<description>
3rd party build for acquisition service
</description>
<modules>
<module>nuxeo-platform-cs-acquisition</module>
<module>nuxeo-platform-cs-acquisition-mmi</module>
</modules>
</project>
|
unmigrated-inline-wiki-markup |
{cloak} |
- k. add schema extension to tenant binding
tenant-bindings-delta.xml
Wiki Markup |
---|
{toggle-cloak:id=a21k} |
Wiki Markup |
---|
{cloak:id=a21k} |
Code Block |
---|
controls | true |
---|
language | xml |
---|
linenumbers | true |
---|
|
<?xml version="1.0" encoding="UTF-8"?>
<tenant:TenantBindingConfig
xmlns:merge='http://xmlmerge.el4j.elca.ch'
xmlns:tenant='http://collectionspace.org/services/common/tenant'>
<tenant:tenantBinding id="42" name="movingimage.us" displayName="MovingImage CollectionSpace Tenant" version="0.1">
<tenant:repositoryDomain name="default-domain" storageName="mmi-domain" repositoryClient="nuxeo-java" />
<!-- Acquisition -->
<tenant:serviceBindings merge:matcher="id" id="Acquisitions">
<service:object xmlns:service="http://collectionspace.org/services/common/service" >
<service:part id="42" merge:matcher="skip" merge:action="insert" control_group="Managed" versionable="true" auditable="false" label="acquisitions_mmi" updated="" order="3">
<service:content contentType="application/xml">
<service:xmlContent namespaceURI="http://collectionspace.org/services/acquisition/local/mmi" schemaLocation="http://collectionspace.org/services/acquisition/local/mmi http://collectionspace.org/services/acquisition/local/acquisitions_mmi.xsd" />
</service:content>
</service:part>
</service:object>
</tenant:serviceBindings>
</tenant:tenantBinding>
</tenant:TenantBindingConfig>
|
Wiki Markup |
---|
{cloak} |
2. add field id and selector to domain-procedure-acquisition.xml
Wiki Markup |
---|
{toggle-cloak:id=a22} |
Wiki Markup |
---|
{cloak:id=a22} |
Note the section
attribute for the new field. Every new field will have this identifying attribute.
Code Block |
---|
controls | true |
---|
language | xml |
---|
linenumbers | true |
---|
|
<section id="domaindata">
<field id="acquisitionExtent" section="mmi">
<selector>acquisition-acquisitionExtent</selector>
</field>
</section>
|
33. edit base-procedure-acquisition.xml
to point to new schema
Wiki Markup |
---|
{toggle-cloak:id=a23} |
Wiki Markup |
{cloak:id=a23}
Note the id
attribute on line 5. This connects with the section
attribute from the domain-procedure-acquisition.xml
file.
Code Block |
---|
controls | true |
---|
language | xml |
---|
linenumbers | true |
---|
|
<record id="acquisition" in-findedit="yes" type="record,procedure">
<services-url>acquisitions</services-url>
<services-tenant-singular>Acquisition</services-tenant-singular>
<services-list-path>abstract-common-list/list-item</services-list-path>
<services-record-path id="mmi">acquisitions_mmi:http://collectionspace.org/services/acquisition/local/mmi,acquisitions_mmi</services-record-path>
<services-record-path>acquisitions_common:http://collectionspace.org/services/acquisition,acquisitions_common</services-record-path>
<services-record-path id="collectionspace_core">collectionspace_core:http://collectionspace.org/collectionspace_core/,collectionspace_core</services-record-path>
...
|
4. add field label to core-messages.properties
Wiki Markup |
---|
{toggle-cloak:id=a24} |
Wiki Markup |
---|
{cloak:id=a24} |
Code Block |
---|
controls | true |
---|
language | Code Block |
---|
controls | true |
---|
language | xml |
---|
linenumbers | true |
---|
|
acquisition-acquisitionExtentLabel: Extent
|
Wiki Markup |
---|
{cloak} |
5. add html for new field to AcquisitionTemplate.html
unmigrated-inline-wiki-markup
{toggle-cloak:id=a25} |
Wiki Markup |
---|
{cloak:id=a25} |
Code Block |
---|
controls | true |
---|
language | html |
---|
linenumbers | true |
---|
|
<div class="info-pair">
<div class="header">
<div class="label csc-acquisition-acquisitionExtent-label">Extent</div>
</div>
<div class="content">
<input type="text" class="csc-acquisition-acquisitionExtent" />
</div>
</div>
|
Wiki Markup |
---|
{cloak} |
6. run mini-build scripts to deploy changes across all layers and then build & deploy updated services module from source
Wiki Markup |
---|
{toggle-cloak:id=a26} |
Wiki Markup |
---|
{cloak:id=a26} |
Code Block |
---|
Code Block |
---|
controls | true |
---|
language | xml |
---|
linenumbers | true |
---|
|
cd /tmp/tenant-customizations-v1.9/application
ant deploy
cd /tmp/tenant-customizations-v1.9/ui
ant deploy
cd /tmp/v1.9/services/acquisition
mvn clean install -DskipTests
cd /tmp/v1.9/services/
ant undeploy deploy
|
Wiki Markup |
---|
{cloak} |
7. Testing new field with payload
Wiki Markup |
---|
{toggle-cloak:id=a27} |
Wiki Markup |
---|
{cloak:id=a27} |
sample.xml
Code Block |
---|
controls | true |
---|
language | xml |
---|
linenumbers | true |
---|
|
<?xml version="1.0" encoding="utf-8"?>
<document name="acquisitions">
<ns2:acquisitions_common
xmlns:ns2="http://collectionspace.org/services/acquisition"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<titleGroupList>
<titleGroup>
<title>A title</title>
</titleGroup>
</titleGroupList>
<acquisitionReferenceNumber>2011.2.5</acquisitionReferenceNumber>
</ns2:acquisitions_common>
<ns2:acquisitions_mmi xmlns:ns2="http://collectionspace.org/services/acquisition/local/mmi"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<acquisitionExtent>foobar</acquisitionExtent>
</ns2:acquisitions_mmi>
</document>
|
...
Code Block |
---|
controls | true |
---|
linenumbers | true |
---|
|
curl -i -u admin@movingimage.us:Administrator -X POST \
-H "Content-Type: application/xml" \
http://localhost:8180/cspace-services/acquisitions \
-T sample.xml
|
Removed Removed two fields:
Transfer of title number and Field Collection event name
1. Commented out references in base-procedure-acquisition.xml
Wiki Markup |
---|
{toggle-cloak:id=a31} |
Wiki Markup |
---|
{cloak:id=a31} |
Code Block |
---|
controls | true |
---|
language | xml |
---|
firstline | 184 |
---|
linenumbers | true |
---|
|
<section id="objectCollectionInformation">
<!--<repeat id="fieldCollectionEventNames">
<selector>acquisition-fieldCollectionEventName</selector>
<field id="fieldCollectionEventName"></field>
</repeat>-->
</section>
|
Code Block |
---|
controls | true |
---|
language | xml |
---|
firstline | 106 |
---|
linenumbers | true |
---|
|
<!--<field id="transferOfTitleNumber" datatype="largetext">
<selector>acquisition-transfer-of-title-number</selector>
</field>-->
|
unmigrated-inline-wiki-markup |
{cloak} |
2. Removed references in core-messages.properties
Wiki Markup |
---|
{toggle-cloak:id=a32} |
unmigrated-inline-wiki-markup
{cloak:id=a32} |
Code Block |
---|
controls | true |
---|
language | xml |
---|
firstline | 99 |
---|
linenumbers | true |
---|
|
#acquisition-fieldCollectionEventNamesLabel: Field collection event name
#acquisition-transferOfTitleNumberLabel: Transfer of Title Number
|
3. Removed reference in AcquisitionTemplate.html
4. run mini-build scripts to deploy changes across app and ui layers
Wiki Markup |
---|
{toggle-cloak:id=a34} |
Wiki Markup |
{cloak:id=a34}
cd /