<!-- enviornment should be declared before reading build.properties -->\r
<property environment="env" />\r
<property file="${services.trunk}/build.properties" />\r
+ <property name="nuxeo-platform-collectionobjects_common" value="nuxeo-platform-collectionobjects_common"/>\r
+ <property name="nuxeo-platform-cs-collectionobject" value="nuxeo-platform-cs-collectionobject"/>\r
+ <property name="nuxeo-platform-collectionobject-hearst" value="nuxeo-platform-collectionobject-hearst"/>\r
<property name="mvn.opts" value="" />\r
<property name="src" location="src"/>\r
<property name="build" location="build"/>\r
\r
<target name="deploy" depends="install"\r
description="deploy collectionobject in ${jboss.server.nuxeo}">\r
- <ant antfile="nuxeo-platform-cs-collectionobject/build.xml" target="deploy" inheritall="false"/>\r
+ <ant antfile="${nuxeo-platform-collectionobjects_common}/build.xml" target="deploy" inheritall="false"/>\r
+ <ant antfile="${nuxeo-platform-cs-collectionobject}/build.xml" target="deploy" inheritall="false"/>\r
+ <ant antfile="${nuxeo-platform-collectionobject-hearst}/build.xml" target="deploy" inheritall="false"/>\r
</target>\r
\r
<target name="undeploy"\r
description="undeploy collectionobject from ${jboss.server.nuxeo}">\r
- <ant antfile="nuxeo-platform-cs-collectionobject/build.xml" target="undeploy" inheritall="false"/>\r
+ <ant antfile="${nuxeo-platform-collectionobjects_common}/build.xml" target="undeploy" inheritall="false"/>\r
+ <ant antfile="${nuxeo-platform-cs-collectionobject}/build.xml" target="undeploy" inheritall="false"/>\r
+ <ant antfile="${nuxeo-platform-collectionobject-hearst}/build.xml" target="undeploy" inheritall="false"/>\r
</target>\r
\r
<target name="dist"\r
description="generate distribution for collectionobject" depends="package">\r
- <ant antfile="nuxeo-platform-cs-collectionobject/build.xml" target="dist" inheritall="false"/>\r
+ <ant antfile="${nuxeo-platform-collectionobjects_common}/build.xml" target="dist" inheritall="false"/>\r
+ <ant antfile="${nuxeo-platform-cs-collectionobject}/build.xml" target="dist" inheritall="false"/>\r
+ <ant antfile="${nuxeo-platform-collectionobject-hearst}/build.xml" target="dist" inheritall="false"/>\r
</target>\r
\r
<target name="dist_installer"\r
description="generate distribution for collectionobject" depends="package">\r
- <ant antfile="nuxeo-platform-cs-collectionobject/build.xml" target="dist_installer" inheritall="false"/>\r
+ <ant antfile="${nuxeo-platform-collectionobjects_common}/build.xml" target="dist_installer" inheritall="false"/>\r
+ <ant antfile="${nuxeo-platform-cs-collectionobject}/build.xml" target="dist_installer" inheritall="false"/>\r
+ <ant antfile="${nuxeo-platform-collectionobject-hearst}/build.xml" target="dist_installer" inheritall="false"/>\r
</target>\r
\r
</project>\r
--- /dev/null
+\r
+<project name="nuxeo-platform-collectionobjects_common" default="package" basedir=".">\r
+ <description>\r
+ CollectionobjectsCommon Nuxeo document type\r
+ </description>\r
+ <!-- set global properties for this build -->\r
+ <property name="services.trunk" value="../../../.."/>\r
+ <!-- environment should be declared before reading build.properties -->\r
+ <property environment="env" />\r
+ <property file="${services.trunk}/build.properties" />\r
+ <property name="mvn.opts" value="" />\r
+ <property name="src" location="src"/>\r
+ <property name="build" location="build"/>\r
+ <property name="dist" location="dist"/>\r
+ <property name="nuxeo.collectionobject.jar"\r
+ value="org.collectionspace.services.collectionobject.collectionobjects_common.nuxeo-${cspace.release}.jar"/>\r
+ <property name="nuxeo.collectionobject.jars.all"\r
+ value="org.collectionspace.services.collectionobject.collectionobjects_common.nuxeo-*.jar"/>\r
+\r
+ <condition property="osfamily-unix">\r
+ <os family="unix" />\r
+ </condition>\r
+ <condition property="osfamily-windows">\r
+ <os family="windows" />\r
+ </condition>\r
+\r
+ <target name="init" >\r
+ <!-- Create the time stamp -->\r
+ <tstamp/>\r
+ <!-- Create the build directory structure used by compile -->\r
+ <mkdir dir="${build}"/>\r
+ </target>\r
+\r
+ <target name="package" depends="package-unix,package-windows"\r
+ description="Package CollectionSpace Services" />\r
+ <target name="package-unix" if="osfamily-unix">\r
+ <exec executable="mvn" failonerror="true">\r
+ <arg value="package" />\r
+ <arg value="-Dmaven.test.skip=true" />\r
+ <arg value="-f" />\r
+ <arg value="${basedir}/pom.xml" />\r
+ <arg value="-N" />\r
+ <arg value="${mvn.opts}" />\r
+ </exec>\r
+ </target>\r
+ <target name="package-windows" if="osfamily-windows">\r
+ <exec executable="cmd" failonerror="true">\r
+ <arg value="/c" />\r
+ <arg value="mvn.bat" />\r
+ <arg value="package" />\r
+ <arg value="-Dmaven.test.skip=true" />\r
+ <arg value="-f" />\r
+ <arg value="${basedir}/pom.xml" />\r
+ <arg value="-N" />\r
+ <arg value="${mvn.opts}" />\r
+ </exec>\r
+ </target>\r
+\r
+ <target name="install" depends="install-unix,install-windows"\r
+ description="Install" />\r
+ <target name="install-unix" if="osfamily-unix">\r
+ <exec executable="mvn" failonerror="true">\r
+ <arg value="install" />\r
+ <arg value="-Dmaven.test.skip=true" />\r
+ <arg value="-f" />\r
+ <arg value="${basedir}/pom.xml" />\r
+ <arg value="-N" />\r
+ <arg value="${mvn.opts}" />\r
+ </exec>\r
+ </target>\r
+ <target name="install-windows" if="osfamily-windows">\r
+ <exec executable="cmd" failonerror="true">\r
+ <arg value="/c" />\r
+ <arg value="mvn.bat" />\r
+ <arg value="install" />\r
+ <arg value="-Dmaven.test.skip=true" />\r
+ <arg value="-f" />\r
+ <arg value="${basedir}/pom.xml" />\r
+ <arg value="-N" />\r
+ <arg value="${mvn.opts}" />\r
+ </exec>\r
+ </target>\r
+ \r
+ <target name="clean" depends="clean-unix,clean-windows"\r
+ description="Delete target directories" >\r
+ <delete dir="${build}"/>\r
+ </target>\r
+ <target name="clean-unix" if="osfamily-unix">\r
+ <exec executable="mvn" failonerror="true">\r
+ <arg value="clean" />\r
+ <arg value="${mvn.opts}" />\r
+ </exec>\r
+ </target>\r
+ <target name="clean-windows" if="osfamily-windows">\r
+ <exec executable="cmd" failonerror="true">\r
+ <arg value="/c" />\r
+ <arg value="mvn.bat" />\r
+ <arg value="clean" />\r
+ <arg value="${mvn.opts}" />\r
+ </exec>\r
+ </target>\r
+\r
+ <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
+ <target name="test-unix" if="osfamily-unix">\r
+ <exec executable="mvn" failonerror="true">\r
+ <arg value="test" />\r
+ <arg value="${mvn.opts}" />\r
+ </exec>\r
+ </target>\r
+ <target name="test-windows" if="osfamily-windows">\r
+ <exec executable="cmd" failonerror="true">\r
+ <arg value="/c" />\r
+ <arg value="mvn.bat" />\r
+ <arg value="test" />\r
+ <arg value="${mvn.opts}" />\r
+ </exec>\r
+ </target>\r
+\r
+ <target name="deploy" depends="install"\r
+ description="Deploy CollectionObjectsCommon doctype in ${jboss.server.nuxeo}">\r
+ <copy file="${basedir}/target/${nuxeo.collectionobject.jar}"\r
+ todir="${jboss.deploy.nuxeo.plugins}"/>\r
+ </target>\r
+\r
+ <target name="undeploy"\r
+ description="Undeploy CollectionObjectsCommon doctype from ${jboss.server.nuxeo}">\r
+ <delete>\r
+ <fileset dir="${jboss.deploy.nuxeo.plugins}">\r
+ <include name="${nuxeo.collectionobject.jars.all}"/>\r
+ </fileset>\r
+ <!-- Legacy deployment location through release 0.6 -->\r
+ <fileset dir="${jboss.deploy.nuxeo.system}">\r
+ <include name="${nuxeo.collectionobject.jars.all}"/>\r
+ </fileset>\r
+ </delete>\r
+ </target>\r
+\r
+ <target name="dist"\r
+ description="generate distribution for collectionobject doctype" depends="package">\r
+ <copy todir="${services.trunk}/${dist.deploy.nuxeo.plugins}">\r
+ <fileset file="${basedir}/target/${nuxeo.collectionobject.jar}"/>\r
+ </copy>\r
+ </target>\r
+\r
+ <target name="dist_installer"\r
+ description="Creates an installer distribution for CollectionObjectsCommon doctype" depends="package">\r
+ <copy todir="${services.trunk}/${dist.installer.services}/collectionobject/nuxeo">\r
+ <fileset file="${basedir}/target/${nuxeo.collectionobject.jar}"/>\r
+ </copy>\r
+ </target>\r
+</project>\r
--- /dev/null
+<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.collectionobject.3rdparty</artifactId>
+ <version>1.8-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.collectionobject.collectionobjects_common.nuxeo</artifactId>
+ <name>org.collectionspace.services.collectionobject.collectionobjects_common.nuxeo</name>
+ <packaging>jar</packaging>
+ <description>
+ CollectionObject Common Nuxeo document type
+ </description>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile> src/main/resources/META-INF/MANIFEST.MF </manifestFile>
+ <manifestEntries>
+ <Bundle-Version>${eclipseVersion}</Bundle-Version>
+ <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
--- /dev/null
+Manifest-Version: 1.0 \r
+Bundle-ManifestVersion: 1 \r
+Bundle-Name: org.collectionspace.collectionobject\r
+Bundle-SymbolicName: org.collectionspace.collectionobject;singleton:=true \r
+Bundle-Version: 1.0.0\r
+Bundle-Localization: plugin\r
+Bundle-Vendor: Nuxeo \r
+Require-Bundle: org.nuxeo.runtime, \r
+ org.nuxeo.ecm.core.api,\r
+ org.nuxeo.ecm.core,\r
+ org.nuxeo.ecm.webapp.core,\r
+ org.collectionspace.collectionspace_core\r
+Provide-Package: org.collectionspace.collectionobject\r
+Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
+ OSGI-INF/life-cycle-contrib.xml,\r
+ OSGI-INF/ecm-types-contrib.xml,\r
+ OSGI-INF/layouts-contrib.xml\r
--- /dev/null
+<?xml version="1.0"?>
+<component name="org.collectionspace.collectionobject.coreTypes">
+ <extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
+ <schema name="collectionobjects_common" prefix="collectionobjects_common" src="schemas/collectionobjects_common.xsd"/>
+ </extension>
+ <extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
+ <doctype name="CollectionObject" extends="CollectionSpaceDocument">
+ <prefetch>
+ collectionobjects_common:objectNumber
+ collectionobjects_common:objectNameList
+ collectionobjects_common:responsibleDepartments
+ </prefetch>
+ </doctype>
+ </extension>
+</component>
--- /dev/null
+<?xml version="1.0"?>\r
+<fragment>\r
+\r
+ <extension target="application#MODULE">\r
+ <module>\r
+ <java>${bundle.fileName}</java>\r
+ </module>\r
+ </extension>\r
+\r
+</fragment>\r
--- /dev/null
+<?xml version="1.0"?>
+<component name="org.collectionspace.collectionobject.ecm.types">
+ <extension target="org.nuxeo.ecm.platform.types.TypeService" point="types">
+ <type id="CollectionObject" coretype="CollectionObject">
+ <label>org.collectionspace.collectionobject</label>
+ <!--icon>/icons/file.gif</icon-->
+ <default-view>view_documents</default-view>
+
+ <layouts mode="any">
+ <layout>heading</layout>
+ <layout>collectionspace_core</layout>
+ <layout>collectionobjects_common</layout>
+ </layouts>
+ </type>
+
+ <type id="Folder" coretype="Folder">
+ <subtypes>
+ <type>CollectionObject</type>
+ </subtypes>
+ </type>
+
+ <type id="Workspace" coretype="Workspace">
+ <subtypes>
+ <type>CollectionObject</type>
+ </subtypes>
+ </type>
+ </extension>
+</component>
--- /dev/null
+<?xml version="1.0"?>
+<component name="org.collectionspace.collectionobject.layouts.webapp">
+
+ <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
+ point="layouts">
+
+ <layout name="collectionobjects_common">
+ <templates>
+ <template mode="any">/layouts/layout_default_template.xhtml</template>
+ </templates>
+ <rows>
+ <row><widget>objectNumber</widget></row>
+ <row><widget>otherNumber</widget></row>
+ <row><widget>otherNumberType</widget></row>
+ <!-- Repeatable fields are commented out for now until we -->
+ <!-- identify how to represent these complex types in layouts. -->
+ <!-- <row><widget>entryMethod</widget></row> -->
+ <!--<row><widget>briefDescription</widget></row>-->
+ <!--<row><widget>comments</widget></row>-->
+ <row><widget>distinguishingFeatures</widget></row>
+ <row><widget>numberOfObjects</widget></row>
+
+ <row><widget>objectName</widget></row>
+ <row><widget>objectNameCurrency</widget></row>
+ <row><widget>objectNameLevel</widget></row>
+ <row><widget>objectNameNote</widget></row>
+ <row><widget>objectNameSystem</widget></row>
+ <row><widget>objectNameType</widget></row>
+ <row><widget>objectNameLanguage</widget></row>
+
+ <!--<row><widget>responsibleDepartment</widget></row>-->
+ <row><widget>title</widget></row>
+ <row><widget>objectTitleLanguage</widget></row>
+ <row><widget>titleTranslation</widget></row>
+ <row><widget>titleType</widget></row>
+ </rows>
+
+ <widget name="objectNumber" type="text">
+ <labels>
+ <label mode="any">objectNumber</label>
+ </labels>
+ <translated>true</translated>
+ <fields>
+ <field schema="collectionobjects_common">objectNumber</field>
+ </fields>
+ <properties widgetMode="edit">
+ <property name="styleClass">dataInputText</property>
+ </properties>
+ </widget>
+
+ <widget name="otherNumber" type="text">
+ <labels>
+ <label mode="any">otherNumber</label>
+ </labels>
+ <translated>true</translated>
+ <fields>
+ <field schema="collectionobjects_common">otherNumber</field>
+ </fields>
+ <properties widgetMode="edit">
+ <property name="styleClass">dataInputText</property>
+ </properties>
+ </widget>
+
+ <widget name="otherNumberType" type="text">
+ <labels>
+ <label mode="any">otherNumberType</label>
+ </labels>
+ <translated>true</translated>
+ <fields>
+ <field schema="collectionobjects_common">otherNumberType</field>
+ </fields>
+ <properties widgetMode="edit">
+ <property name="styleClass">dataInputText</property>
+ </properties>
+ </widget>
+<!--
+ <widget name="briefDescription" type="text">
+ <labels>
+ <label mode="any">briefDescription</label>
+ </labels>
+ <translated>true</translated>
+ <fields>
+ <field schema="collectionobjects_common">briefDescription</field>
+ </fields>
+ <properties widgetMode="edit">
+ <property name="styleClass">dataInputText</property>
+ </properties>
+ </widget>
+
+ <widget name="comments" type="text">
+ <labels>
+ <label mode="any">comments</label>
+ </labels>
+ <translated>true</translated>
+ <fields>
+ <field schema="collectionobjects_common">comments</field>
+ </fields>
+ <properties widgetMode="edit">
+ <property name="styleClass">dataInputText</property>
+ </properties>
+ </widget>
+-->
+
+ <widget name="distinguishingFeatures" type="text">
+ <labels>
+ <label mode="any">distinguishingFeatures</label>
+ </labels>
+ <translated>true</translated>
+ <fields>
+ <field schema="collectionobjects_common">distinguishingFeatures</field>
+ </fields>
+ <properties widgetMode="edit">
+ <property name="styleClass">dataInputText</property>
+ </properties>
+ </widget>
+
+ <widget name="objectName" type="text">
+ <labels>
+ <label mode="any">objectName</label>
+ </labels>
+ <translated>true</translated>
+ <fields>
+ <field schema="collectionobjects_common">objectName</field>
+ </fields>
+ <properties widgetMode="edit">
+ <property name="styleClass">dataInputText</property>
+ </properties>
+ </widget>
+<!--
+ <widget name="responsibleDepartment" type="text">
+ <labels>
+ <label mode="any">responsibleDepartment</label>
+ </labels>
+ <translated>true</translated>
+ <fields>
+ <field schema="collectionobjects_common">responsibleDepartment</field>
+ </fields>
+ <properties widgetMode="edit">
+ <property name="styleClass">dataInputText</property>
+ </properties>
+ </widget>
+
+-->
+
+ <widget name="title" type="text">
+ <labels>
+ <label mode="any">title</label>
+ </labels>
+ <translated>true</translated>
+ <fields>
+ <field schema="collectionobjects_common">title</field>
+ </fields>
+ <properties widgetMode="edit">
+ <property name="styleClass">dataInputText</property>
+ </properties>
+ </widget>
+
+ </layout>
+ </extension>
+</component>
--- /dev/null
+<?xml version="1.0"?>
+<component name="org.collectionspace.collectionobjects.ecm.platform.LifeCycleManagerExtensions">
+ <extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService"
+ point="types">
+ <types>
+ <type name="CollectionObject">default</type>
+ </types>
+ </extension>
+</component>
Part : Common\r
Used for: Nuxeo EP core document type\r
\r
- $LastChangedRevision$\r
- $LastChangedDate$\r
+ $LastChangedRevision: 4736 $\r
+ $LastChangedDate: 2011-05-12 17:36:23 -0700 (Thu, 12 May 2011) $\r
-->\r
\r
\r
<property name="build" location="build"/>\r
<property name="dist" location="dist"/>\r
<property name="nuxeo.collectionobject.jar"\r
- value="org.collectionspace.services.collectionobject.3rdparty.nuxeo-${cspace.release}.jar"/>\r
+ value="org.collectionspace.services.collectionobject.CollectionObjectTenant1.nuxeo-${cspace.release}.jar"/>\r
<property name="nuxeo.collectionobject.jars.all"\r
- value="org.collectionspace.services.collectionobject.3rdparty.nuxeo-*.jar"/>\r
+ value="org.collectionspace.services.collectionobject.CollectionObjectTenant1.nuxeo-*.jar"/>\r
\r
<condition property="osfamily-unix">\r
<os family="unix" />\r
<modelVersion>4.0.0</modelVersion>
<groupId>org.collectionspace.services</groupId>
- <artifactId>org.collectionspace.services.collectionobject.3rdparty.nuxeo</artifactId>
- <name>services.collectionobject.3rdparty.nuxeo</name>
+ <artifactId>org.collectionspace.services.collectionobject.CollectionObjectTenant1.nuxeo</artifactId>
+ <name>services.collectionobject.CollectionObjectTenant1.nuxeo</name>
<packaging>jar</packaging>
<description>
- CollectionObject Nuxeo document type
+ CollectionObject Nuxeo document type for Tenant ID = "1"
</description>
<build>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
-<!-- <includes>
- <include>mydog.xml</include>
- </includes> -->
<archive>
<manifestFile> src/main/resources/META-INF/MANIFEST.MF </manifestFile>
<manifestEntries>
Manifest-Version: 1.0 \r
Bundle-ManifestVersion: 1 \r
-Bundle-Name: NuxeoCS\r
-Bundle-SymbolicName: org.collectionspace.collectionobject;singleton:=true \r
+Bundle-Name: org.collectionspace.collectionobjecttenant1\r
+Bundle-SymbolicName: org.collectionspace.collectionobjecttenant1;singleton:=true \r
Bundle-Version: 1.0.0\r
Bundle-Localization: plugin\r
Bundle-Vendor: Nuxeo \r
org.nuxeo.ecm.core.api,\r
org.nuxeo.ecm.core,\r
org.nuxeo.ecm.webapp.core,\r
- org.collectionspace.collectionspace_core\r
-Provide-Package: org.collectionspace.collectionobject\r
+ org.collectionspace.collectionspace_core,\r
+ org.collectionspace.collectionobject\r
+Provide-Package: org.collectionspace.collectionobjecttenant1\r
Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
OSGI-INF/life-cycle-contrib.xml,\r
OSGI-INF/ecm-types-contrib.xml,\r
<?xml version="1.0"?>
-<component name="org.collectionspace.collectionobject.coreTypes">
- <extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
- <schema name="collectionobjects_common" prefix="collectionobjects_common" src="schemas/collectionobjects_common.xsd"/>
- <schema name="collectionobjects_naturalhistory" prefix="collectionobjects_naturalhistory" src="schemas/collectionobjects_naturalhistory.xsd"/>
- </extension>
+<component name="org.collectionspace.CollectionObjectTenant1.coreTypes">
<extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
- <doctype name="CollectionObject" extends="CollectionSpaceDocument">
+ <doctype name="CollectionObjectTenant1" extends="CollectionObject">
<schema name="common"/>
<schema name="dublincore"/>
<schema name="collectionspace_core"/>
<schema name="collectionobjects_common"/>
- <schema name="collectionobjects_naturalhistory"/>
- <prefetch>
- collectionobjects_common:objectNumber
- collectionobjects_common:objectNameList
- collectionobjects_common:responsibleDepartments</prefetch>
</doctype>
</extension>
</component>
<?xml version="1.0"?>
-<component name="org.collectionspace.collectionobject.ecm.types">
+<component name="org.collectionspace.CollectionObjectTenant1.ecm.types">
<extension target="org.nuxeo.ecm.platform.types.TypeService" point="types">
- <type id="CollectionObject" coretype="CollectionObject">
- <label>org.collectionspace.collectionobject</label>
+
+ <type id="CollectionObjectTenant1" coretype="CollectionObjectTenant1">
+ <label>org.collectionspace.CollectionObjectTenant1</label>
<!--icon>/icons/file.gif</icon-->
<default-view>view_documents</default-view>
<layouts mode="any">
<layout>heading</layout>
<layout>collectionspace_core</layout>
- <layout>collectionobject</layout>
+ <layout>CollectionObjectTenant1</layout>
</layouts>
</type>
<type id="Folder" coretype="Folder">
<subtypes>
- <type>CollectionObject</type>
+ <type>"CollectionObjectTenant1"</type>
</subtypes>
</type>
<type id="Workspace" coretype="Workspace">
<subtypes>
- <type>CollectionObject</type>
+ <type>"CollectionObjectTenant1"</type>
</subtypes>
</type>
</extension>
<?xml version="1.0"?>
-<component name="org.collectionspace.collectionobject.layouts.webapp">
+<component name="org.collectionspace.CollectionObjectTenant1.layouts.webapp">
<extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
point="layouts">
- <layout name="collectionobject">
+ <layout name="CollectionObjectTenant1">
+ <!--
<templates>
<template mode="any">/layouts/layout_default_template.xhtml</template>
</templates>
<rows>
- <row><widget>objectNumber</widget></row>
- <row><widget>otherNumber</widget></row>
- <row><widget>otherNumberType</widget></row>
- <!-- Repeatable fields are commented out for now until we -->
- <!-- identify how to represent these complex types in layouts. -->
- <!-- <row><widget>entryMethod</widget></row> -->
- <!--<row><widget>briefDescription</widget></row>-->
- <!--<row><widget>comments</widget></row>-->
- <row><widget>distinguishingFeatures</widget></row>
- <row><widget>numberOfObjects</widget></row>
-
- <row><widget>objectName</widget></row>
- <row><widget>objectNameCurrency</widget></row>
- <row><widget>objectNameLevel</widget></row>
- <row><widget>objectNameNote</widget></row>
- <row><widget>objectNameSystem</widget></row>
- <row><widget>objectNameType</widget></row>
- <row><widget>objectNameLanguage</widget></row>
-
- <!--<row><widget>responsibleDepartment</widget></row>-->
- <row><widget>title</widget></row>
- <row><widget>objectTitleLanguage</widget></row>
- <row><widget>titleTranslation</widget></row>
- <row><widget>titleType</widget></row>
+ <row><widget>exampleField</widget></row>
</rows>
- <widget name="objectNumber" type="text">
+ <widget name="exampleField" type="text">
<labels>
- <label mode="any">objectNumber</label>
+ <label mode="any">exampleField</label>
</labels>
<translated>true</translated>
<fields>
- <field schema="collectionobjects_common">objectNumber</field>
+ <field schema="collectionobjects_naturalhistory">exampleField</field>
</fields>
<properties widgetMode="edit">
<property name="styleClass">dataInputText</property>
</properties>
</widget>
-
- <widget name="otherNumber" type="text">
- <labels>
- <label mode="any">otherNumber</label>
- </labels>
- <translated>true</translated>
- <fields>
- <field schema="collectionobjects_common">otherNumber</field>
- </fields>
- <properties widgetMode="edit">
- <property name="styleClass">dataInputText</property>
- </properties>
- </widget>
-
- <widget name="otherNumberType" type="text">
- <labels>
- <label mode="any">otherNumberType</label>
- </labels>
- <translated>true</translated>
- <fields>
- <field schema="collectionobjects_common">otherNumberType</field>
- </fields>
- <properties widgetMode="edit">
- <property name="styleClass">dataInputText</property>
- </properties>
- </widget>
-<!--
- <widget name="briefDescription" type="text">
- <labels>
- <label mode="any">briefDescription</label>
- </labels>
- <translated>true</translated>
- <fields>
- <field schema="collectionobjects_common">briefDescription</field>
- </fields>
- <properties widgetMode="edit">
- <property name="styleClass">dataInputText</property>
- </properties>
- </widget>
-
- <widget name="comments" type="text">
- <labels>
- <label mode="any">comments</label>
- </labels>
- <translated>true</translated>
- <fields>
- <field schema="collectionobjects_common">comments</field>
- </fields>
- <properties widgetMode="edit">
- <property name="styleClass">dataInputText</property>
- </properties>
- </widget>
--->
-
- <widget name="distinguishingFeatures" type="text">
- <labels>
- <label mode="any">distinguishingFeatures</label>
- </labels>
- <translated>true</translated>
- <fields>
- <field schema="collectionobjects_common">distinguishingFeatures</field>
- </fields>
- <properties widgetMode="edit">
- <property name="styleClass">dataInputText</property>
- </properties>
- </widget>
-
- <widget name="objectName" type="text">
- <labels>
- <label mode="any">objectName</label>
- </labels>
- <translated>true</translated>
- <fields>
- <field schema="collectionobjects_common">objectName</field>
- </fields>
- <properties widgetMode="edit">
- <property name="styleClass">dataInputText</property>
- </properties>
- </widget>
-<!--
- <widget name="responsibleDepartment" type="text">
- <labels>
- <label mode="any">responsibleDepartment</label>
- </labels>
- <translated>true</translated>
- <fields>
- <field schema="collectionobjects_common">responsibleDepartment</field>
- </fields>
- <properties widgetMode="edit">
- <property name="styleClass">dataInputText</property>
- </properties>
- </widget>
-
--->
-
- <widget name="title" type="text">
- <labels>
- <label mode="any">title</label>
- </labels>
- <translated>true</translated>
- <fields>
- <field schema="collectionobjects_common">title</field>
- </fields>
- <properties widgetMode="edit">
- <property name="styleClass">dataInputText</property>
- </properties>
- </widget>
-
+ -->
</layout>
</extension>
</component>
<?xml version="1.0"?>
-<component name="org.collectionspace.ecm.platform.collectionobject.LifeCycleManagerExtensions">
+<component name="org.collectionspace.CollectionObjectTenant1.ecm.platform.LifeCycleManagerExtensions">
<extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService"
point="types">
<types>
- <type name="CollectionObject">default</type>
+ <type name="CollectionObjectTenant1">default</type>
</types>
</extension>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-\r
-<!--\r
- CollectionObject schema (XSD)\r
- \r
- Entity : CollectionObject\r
- Part : Domain - Natural History (example)\r
- Used for: Nuxeo EP core document type\r
- \r
- $LastChangedRevision$\r
- $LastChangedDate$\r
--->\r
-\r
-<xs:schema \r
- xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
- xmlns:ns="http://collectionspace.org/services/collectionobject/domain/naturalhistory"\r
- xmlns="http://collectionspace.org/services/collectionobject/domain/naturalhistory"\r
- targetNamespace="http://collectionspace.org/services/collectionobject/domain/naturalhistory"\r
- version="0.1">\r
-\r
- <!-- used for testing\r
- <xs:element name="nh-string" type="xs:string" />\r
- <xs:element name="nh-int" type="xs:int"/>\r
- <xs:element name="nh-long" type="xs:long"/>\r
- <xs:element name="nh-date" type="xs:dateTime"/>\r
- <xs:element name="nh-note" type="xs:string"/>\r
- -->\r
-\r
- <!-- These items are being moved to common\r
- <xs:element name="fieldCollector" type="xs:string"/>\r
- <xs:element name="fieldCollectionDate" type="xs:string"/>\r
- <xs:element name="fieldLocPlace" type="xs:string"/>\r
- <xs:element name="catalogDate" type="xs:string"/>\r
- -->\r
-\r
- <xs:element name="labelHeader" type="xs:string"/>\r
- <xs:element name="labelFooter" type="xs:string"/>\r
-\r
- <xs:element name="fieldLocVerbatim" type="xs:string"/>\r
- <xs:element name="fieldCollectionDateEarliest" type="xs:string"/>\r
- <xs:element name="fieldCollectionDateLatest" type="xs:string"/>\r
- <xs:element name="fieldLocLatDecimal" type="xs:string"/>\r
- <xs:element name="fieldLocLongDecimal" type="xs:string"/>\r
- <xs:element name="fieldLocElevation" type="xs:string"/>\r
-\r
- <!-- These will become contolled lists -->\r
- <xs:element name="fieldLocGeodeticDatum" type="xs:string"/>\r
- <xs:element name="fieldLocCoordinateSystem" type="xs:string"/>\r
- <xs:element name="fieldLocCounty" type="xs:string"/>\r
- <xs:element name="fieldLocState" type="xs:string"/>\r
- <xs:element name="fieldLocCountry" type="xs:string"/>\r
- <xs:element name="fieldLocHigherGeography" type="xs:string"/>\r
-\r
- <xs:element name="taxonomicIdentGroupList" type="taxonomicIdentGroupList"/>\r
- <xs:element name="typeSpecimenGroupList" type="typeSpecimenGroupList"/>\r
- <xs:element name="fieldCollElevationGroupList" type="fieldCollElevationGroupList"/>\r
- <xs:element name="fieldCollDepthGroupList" type="fieldCollDepthGroupList"/>\r
- <xs:element name="associatedTaxaGroupList" type="associatedTaxaGroupList"/>\r
-\r
- <xs:complexType name="taxonomicIdentGroupList">\r
- <xs:sequence>\r
- <xs:element name="taxonomicIdentGroup" type="taxonomicIdentGroup" minOccurs="0"\r
- maxOccurs="unbounded"/>\r
- </xs:sequence>\r
- </xs:complexType>\r
- <xs:complexType name="taxonomicIdentGroup">\r
- <xs:sequence>\r
- <xs:element name="taxon" type="xs:string"/>\r
- <xs:element name="qualifier" type="xs:string"/>\r
- <xs:element name="identBy" type="xs:string"/>\r
- <xs:element name="identDate" type="xs:string"/>\r
- <xs:element name="institution" type="xs:string"/>\r
- <xs:element name="identKind" type="xs:string"/>\r
- <xs:element name="reference" type="xs:string"/>\r
- <xs:element name="refPage" type="xs:string"/>\r
- <xs:element name="notes" type="xs:string"/>\r
- </xs:sequence>\r
- </xs:complexType>\r
-\r
- <xs:complexType name="typeSpecimenGroupList">\r
- <xs:sequence>\r
- <xs:element name="typeSpecimenGroup" type="typeSpecimenGroup" minOccurs="0"\r
- maxOccurs="unbounded"/>\r
- </xs:sequence>\r
- </xs:complexType>\r
- <xs:complexType name="typeSpecimenGroup">\r
- <xs:sequence>\r
- <xs:element name="kindOfType" type="xs:string"/>\r
- <xs:element name="reference" type="xs:string"/>\r
- <xs:element name="refPage" type="xs:string"/>\r
- <xs:element name="institution" type="xs:string"/>\r
- <xs:element name="institutionType" type="xs:string"/>\r
- <xs:element name="notes" type="xs:string"/>\r
- </xs:sequence>\r
- </xs:complexType>\r
-\r
- <xs:complexType name="fieldCollElevationGroupList">\r
- <xs:sequence>\r
- <xs:element name="fieldCollElevationGroup" type="fieldCollElevationGroup" minOccurs="0"\r
- maxOccurs="unbounded"/>\r
- </xs:sequence>\r
- </xs:complexType>\r
- <xs:complexType name="fieldCollElevationGroup">\r
- <xs:sequence>\r
- <xs:element name="minElevation" type="xs:integer"/>\r
- <xs:element name="maxElevation" type="xs:integer"/>\r
- <xs:element name="units" type="xs:string"/>\r
- <xs:element name="qualifier" type="xs:string"/>\r
- <xs:element name="notes" type="xs:string"/>\r
- </xs:sequence>\r
- </xs:complexType>\r
-\r
- <xs:complexType name="fieldCollDepthGroupList">\r
- <xs:sequence>\r
- <xs:element name="fieldCollDepthGroup" type="fieldCollDepthGroup" minOccurs="0"\r
- maxOccurs="unbounded"/>\r
- </xs:sequence>\r
- </xs:complexType>\r
- <xs:complexType name="fieldCollDepthGroup">\r
- <xs:sequence>\r
- <xs:element name="minDepth" type="xs:integer"/>\r
- <xs:element name="maxDepth" type="xs:integer"/>\r
- <xs:element name="units" type="xs:string"/>\r
- <xs:element name="qualifier" type="xs:string"/>\r
- <xs:element name="notes" type="xs:string"/>\r
- </xs:sequence>\r
- </xs:complexType>\r
-\r
- <xs:complexType name="associatedTaxaGroupList">\r
- <xs:sequence>\r
- <xs:element name="associatedTaxaGroup" type="associatedTaxaGroup" minOccurs="0"\r
- maxOccurs="unbounded"/>\r
- </xs:sequence>\r
- </xs:complexType>\r
- <xs:complexType name="associatedTaxaGroup">\r
- <xs:sequence>\r
- <xs:element name="taxon" type="xs:string"/>\r
- <xs:element name="commonName" type="xs:integer"/>\r
- <xs:element name="interaction" type="xs:integer"/>\r
- </xs:sequence>\r
- </xs:complexType>\r
-\r
-</xs:schema>\r
</description>\r
\r
<modules>\r
- <module>nuxeo-platform-cs-collectionobject</module>\r
+ <module>nuxeo-platform-collectionobjects_common</module>\r
+ <module>nuxeo-platform-cs-collectionobject</module>\r
+ <module>nuxeo-platform-collectionobject-hearst</module>\r
</modules>\r
\r
</project>\r
// object.
return (overrideDocumentType != null) ? overrideDocumentType : serviceBinding.getObject().getName();
}
+
+ @Override
+ public String getTenantQualifiedDoctype(String docType) {
+ // If they have not overridden the setting, use the type of the service
+ // object.
+ String result = docType + ServiceContext.TENANT_SUFFIX + this.getTenantId();
+
+ return result;
+ }
+
+ @Override
+ public String getTenantQualifiedDoctype() {
+ String docType = (overrideDocumentType != null) ? overrideDocumentType : serviceBinding.getObject().getName();
+ return getTenantQualifiedDoctype(docType);
+ }
/* (non-Javadoc)
* @see org.collectionspace.services.common.context.ServiceContext#setDocumentType(java.lang.String)
import org.collectionspace.services.common.ClientType;
import org.collectionspace.services.common.document.DocumentHandler;
import org.collectionspace.services.common.document.ValidatorHandler;
+import org.collectionspace.services.common.query.QueryContext;
import org.collectionspace.services.common.security.SecurityContext;
import org.collectionspace.services.common.security.UnauthorizedException;
import org.collectionspace.services.common.service.ObjectPartType;
public static final String PART_LABEL_SEPARATOR = "_";
/** The Constant PART_COMMON_LABEL. */
public static final String PART_COMMON_LABEL = "common";
+ /** Used to qualify document types **/
+ public static final String TENANT_SUFFIX = "Tenant";
/**
* getSecurityContext is contains security info. for the service layer
* @return service name
*/
public String getDocumentType();
+
+ /**
+ * Returns a tenant qualified document type.
+ *
+ */
+ public String getTenantQualifiedDoctype();
+
+ /**
+ * Returns a tenant qualified document type.
+ *
+ */
+ public String getTenantQualifiedDoctype(String docType);
/**
* setDocumentType sets the name of the Document Type for this service
String tenantId;\r
\r
static public final String getTenantQualifiedDoctype(QueryContext queryContext, String docType) {\r
-// return queryContext.getTenantId() + "_" + docType;\r
- return docType; //FIXME: Need to use the line above to get a qualified doctype name \r
-\r
+ return docType + ServiceContext.TENANT_SUFFIX + queryContext.getTenantId();\r
}\r
\r
/**\r
import java.util.Hashtable;
import java.util.List;
+import java.util.Set;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.nuxeo.ecm.core.api.PathRef;
import org.nuxeo.ecm.core.api.repository.RepositoryInstance;
import org.nuxeo.ecm.core.client.NuxeoClient;
+import org.nuxeo.ecm.core.schema.SchemaManager;
+import org.nuxeo.runtime.api.Framework;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
DocumentHandler handler) throws BadRequestException,
DocumentException {
- if (ctx.getDocumentType() == null) {
+ String docType = NuxeoUtils.getTenantQualifiedDocType(ctx); //ctx.getDocumentType();
+ if (docType == null) {
throw new IllegalArgumentException(
"RepositoryJavaClient.create: docType is missing");
}
+
if (handler == null) {
throw new IllegalArgumentException(
"RepositoryJavaClient.create: handler is missing");
//give our own ID so PathRef could be constructed later on
String id = IdUtils.generateId(UUID.randomUUID().toString());
// create document model
- DocumentModel doc = repoSession.createDocumentModel(wspacePath, id,
- ctx.getDocumentType());
+ DocumentModel doc = repoSession.createDocumentModel(wspacePath, id, docType);
((DocumentModelHandler) handler).setRepositorySession(repoSession);
DocumentWrapper<DocumentModel> wrapDoc = new DocumentWrapperImpl<DocumentModel>(doc);
handler.handle(Action.CREATE, wrapDoc);
DocumentModelList docList = null;
// force limit to 1, and ignore totalSize
- String query = NuxeoUtils.buildNXQLQuery(queryContext);
+ String query = NuxeoUtils.buildNXQLQuery(ctx, queryContext);
docList = repoSession.query(query, null, 1, 0, false);
if (docList.size() != 1) {
throw new DocumentNotFoundException("No document found matching filter params.");
repoSession = getRepositorySession();
DocumentModelList docList = null;
// force limit to 1, and ignore totalSize
- String query = NuxeoUtils.buildNXQLQuery(queryContext);
+ String query = NuxeoUtils.buildNXQLQuery(ctx, queryContext);
docList = repoSession.query(query,
null, //Filter
1, //limit
handler.prepare(Action.GET_ALL);
repoSession = getRepositorySession();
DocumentModelList docList = null;
- String query = NuxeoUtils.buildNXQLQuery(queryContext);
+ String query = NuxeoUtils.buildNXQLQuery(ctx, queryContext);
if (logger.isDebugEnabled()) {
logger.debug("Executing NXQL query: " + query.toString());
import java.io.Serializable;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.collectionspace.services.client.PoxPayloadIn;
import org.collectionspace.services.client.PoxPayloadOut;
import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.document.BadRequestException;
import org.collectionspace.services.common.document.DocumentException;
import org.collectionspace.services.common.document.DocumentWrapper;
import org.collectionspace.services.common.document.DocumentWrapperImpl;
import org.nuxeo.ecm.core.io.impl.plugins.SingleDocumentReader;
import org.nuxeo.ecm.core.io.impl.plugins.XMLDocumentWriter;
+import org.nuxeo.ecm.core.schema.SchemaManager;
import org.nuxeo.ecm.core.search.api.client.querymodel.descriptor.QueryModelDescriptor;
import org.nuxeo.ecm.core.storage.sql.jdbc.ResultSetQueryResult;
import org.nuxeo.ecm.core.query.sql.NXQL;
+import org.nuxeo.runtime.api.Framework;
import org.slf4j.Logger;
* @return an NXQL query
* @throws Exception if supplied values in the query are invalid.
*/
- static public final String buildNXQLQuery(QueryContext queryContext) throws Exception {
+ static public final String buildNXQLQuery(ServiceContext ctx, QueryContext queryContext) throws Exception {
StringBuilder query = new StringBuilder("SELECT * FROM ");
- query.append(queryContext.getTenantQualifiedDoctype()); // Nuxeo doctype must be tenant qualified.
+ query.append(NuxeoUtils.getTenantQualifiedDocType(queryContext)); // Nuxeo doctype must be tenant qualified.
appendNXQLWhere(query, queryContext);
appendNXQLOrderBy(query, queryContext);
return query.toString();
* @param queryContext the query context
* @return an NXQL query
*/
- static public final String buildNXQLQuery(List<String> docTypes, QueryContext queryContext) {
+ static public final String buildNXQLQuery(List<String> docTypes, QueryContext queryContext) throws Exception {
StringBuilder query = new StringBuilder("SELECT * FROM ");
boolean fFirst = true;
for (String docType : docTypes) {
} else {
query.append(",");
}
- String tqDocType = QueryContext.getTenantQualifiedDoctype(queryContext, docType);
+ String tqDocType = getTenantQualifiedDocType(queryContext, docType);
query.append(tqDocType); // Nuxeo doctype must be tenant qualified.
}
appendNXQLWhere(query, queryContext);
//
// Since we're doing a query, we get back a list so we need to make sure there is only
// a single result since CSID values are supposed to be unique.
- String query = buildNXQLQuery(queryContext);
+ String query = buildNXQLQuery(ctx, queryContext);
docModelList = repoSession.query(query);
long resultSize = docModelList.totalSize();
if (resultSize == 1) {
return result;
}
+
+ public static String getTenantQualifiedDocType(ServiceContext ctx, String docType) throws Exception {
+ String result = docType;
+
+ String tenantQualifiedDocType = ctx.getTenantQualifiedDoctype(docType);
+ if (docTypeExists(tenantQualifiedDocType) == true) {
+ result = tenantQualifiedDocType;
+ }
+
+ return result;
+ }
+
+ public static String getTenantQualifiedDocType(ServiceContext ctx) {
+ String result = null;
+ try {
+ String docType = ctx.getDocumentType();
+ result = getTenantQualifiedDocType(ctx, docType);
+ } catch (Exception e) {
+ logger.error("Could not get tentant qualified doctype.", e);
+ }
+ return result;
+ }
+
+ public static String getTenantQualifiedDocType(QueryContext queryCtx, String docType) throws Exception {
+ String result = docType;
+
+ String tenantQualifiedDocType = queryCtx.getTenantQualifiedDoctype();
+ if (docTypeExists(tenantQualifiedDocType) == true) {
+ result = tenantQualifiedDocType;
+ }
+
+ return result;
+ }
+
+ public static String getTenantQualifiedDocType(QueryContext queryCtx) throws Exception {
+ return getTenantQualifiedDocType(queryCtx, queryCtx.getDocType());
+ }
+
+ static private boolean docTypeExists(String docType) throws Exception {
+ boolean result = false;
+
+ SchemaManager schemaManager = null;
+ try {
+ schemaManager = Framework.getService(org.nuxeo.ecm.core.schema.SchemaManager.class);
+ } catch (Exception e1) {
+ // TODO Auto-generated catch block
+ logger.error("Could not get Nuxeo SchemaManager instance.", e1);
+ throw e1;
+ }
+ Set<String> docTypes = schemaManager.getDocumentTypeNamesExtending(docType);
+ if (docTypes != null && docTypes.contains(docType)) {
+ result = true;
+ }
+
+ return result;
+ }
}