<ant antfile="services/build.xml" target="gen_ddl" inheritAll="false"/>\r
</target>\r
\r
- <target name="create_db" depends="create_base_db"\r
+ <target name="create_db" \r
description="create database(s), invoke subtasks for indexes, etc.">\r
- <ant antfile="services/build.xml" target="create_db" inheritAll="false"/>\r
+ <antcall target="create_nuxeo_db"/>\r
+ <antcall target="create_cspace_db"/>\r
</target>\r
\r
- <target name="create_base_db" \r
- description="create database(s), grant privileges to test users">\r
+ <target name="create_nuxeo_db" \r
+ description="create nuxeo database">\r
<sql driver="${db.jdbc.driver.class}"\r
url="${db.jdbc.baseurl}"\r
userid="${db.user}"\r
password="${db.user.password}"\r
autocommit="true"\r
- src="${db.script.dir}/init_db.sql"\r
+ src="${db.script.dir}/init_nuxeo_db.sql"\r
>\r
<classpath>\r
<pathelement path="${db.driver.jar}"/>\r
</classpath>\r
</sql>\r
+ <ant antfile="services/build.xml" target="create_nuxeo_db" inheritAll="false"/>\r
+ </target>\r
+\r
+ <target name="create_cspace_db" \r
+ description="create cspace database">\r
+ <sql driver="${db.jdbc.driver.class}"\r
+ url="${db.jdbc.baseurl}"\r
+ userid="${db.user}"\r
+ password="${db.user.password}"\r
+ autocommit="true"\r
+ src="${db.script.dir}/init_cspace_db.sql"\r
+ >\r
+ <classpath>\r
+ <pathelement path="${db.driver.jar}"/>\r
+ </classpath>\r
+ </sql>\r
+ <ant antfile="services/build.xml" target="create_cspace_db" inheritAll="false"/>\r
</target>\r
\r
<target name="import"\r
<ant antfile="services/build.xml" target="config" inheritAll="false"/> \r
</target> \r
\r
- <target name="predeploy" depends="config">\r
- <exec executable="echo">\r
- <arg value="Installer: Creating necessary databases and associated users and privileges." />\r
- </exec>\r
- <sql driver="${db.jdbc.driver.class}"\r
- url="${db.jdbc.baseurl}"\r
- userid="${db.user}"\r
- password="${db.user.password}"\r
- src="${db.script.dir}/init_db.sql">\r
- <classpath>\r
- <pathelement path="${db.driver.jar}"/>\r
- </classpath>\r
- </sql>\r
- \r
+ <target name="predeploy" depends="config, create_cspace_db, create_nuxeo_db">\r
<!-- Now, invoke the "predeploy" target on each of the services' install directories -->\r
<ant antfile="services/build.xml" target="predeploy" inheritAll="false"/> \r
</target>\r
+\r
+ <target name="create_nuxeo_db" \r
+ description="create nuxeo database">\r
+ <sql driver="${db.jdbc.driver.class}"\r
+ url="${db.jdbc.baseurl}"\r
+ userid="${db.user}"\r
+ password="${db.user.password}"\r
+ autocommit="true"\r
+ src="${db.script.dir}/init_nuxeo_db.sql"\r
+ >\r
+ <classpath>\r
+ <pathelement path="${db.driver.jar}"/>\r
+ </classpath>\r
+ </sql>\r
+ <ant antfile="services/build.xml" target="create_nuxeo_db" inheritAll="false"/>\r
+ </target>\r
+\r
+ <target name="create_cspace_db" \r
+ description="create cspace database">\r
+ <sql driver="${db.jdbc.driver.class}"\r
+ url="${db.jdbc.baseurl}"\r
+ userid="${db.user}"\r
+ password="${db.user.password}"\r
+ autocommit="true"\r
+ src="${db.script.dir}/init_cspace_db.sql"\r
+ >\r
+ <classpath>\r
+ <pathelement path="${db.driver.jar}"/>\r
+ </classpath>\r
+ </sql>\r
+ <ant antfile="services/build.xml" target="create_cspace_db" inheritAll="false"/>\r
+ </target>\r
+\r
+\r
\r
<target name="deploy" description="">\r
<!-- Now, invoke the "deploy" target on each of the services' install directories -->\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="collectionobjects">
+ <ns2:collectionobjects_naturalhistory
+ xmlns:ns2="http://collectionspace.org/services/collectionobject/domain/naturalhistory"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <taxonomicIdentGroupList>
+ <taxonomicIdentGroup>
+ <qualifier>questionable</qualifier>
+ <notes/>
+ <taxon>urn:cspace:lifesci.collectionspace.org:taxonomyauthority:name(taxon):item:name(AcerJaponicus1332900279183)'Acer
+ Japonicus'</taxon>
+ <reference/>
+ <identBy>urn:cspace:lifesci.collectionspace.org:personauthorities:name(person):item:name(PatrickSchmitz1332900293194)'Patrick
+ Schmitz'</identBy>
+ <institution/>
+ </taxonomicIdentGroup>
+ </taxonomicIdentGroupList>
+ </ns2:collectionobjects_naturalhistory>
+ <ns2:collectionobjects_common xmlns:ns2="http://collectionspace.org/services/collectionobject"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <objectNumber>2012.1.3</objectNumber>
+ <titleGroupList>
+ <titleGroup>
+ <title>This is a nice Object</title>
+ <titleType>generic</titleType>
+ <titleTranslationSubGroupList>
+ <titleTranslationSubGroup>
+ <titleTranslationLanguage>urn:cspace:lifesci.collectionspace.org:vocabularies:name(languages):item:name(deu)'German'</titleTranslationLanguage>
+ <titleTranslation>Das ist ein nettes Object</titleTranslation>
+ </titleTranslationSubGroup>
+ </titleTranslationSubGroupList>
+ <titleLanguage>urn:cspace:lifesci.collectionspace.org:vocabularies:name(languages):item:name(eng)'English'</titleLanguage>
+ </titleGroup>
+ </titleGroupList>
+ <responsibleDepartments>
+ <responsibleDepartment>antiquities</responsibleDepartment>
+ </responsibleDepartments>
+ <otherNumberList>
+ <otherNumber>
+ <numberValue>Obj123</numberValue>
+ <numberType>serial</numberType>
+ </otherNumber>
+ </otherNumberList>
+ </ns2:collectionobjects_common>
+</document>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="collectionobjects">
+ <ns2:collectionobjects_naturalhistory
+ xmlns:ns2="http://collectionspace.org/services/collectionobject/domain/naturalhistory"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <taxonomicIdentGroupList>
+ <taxonomicIdentGroup>
+ <qualifier>questionable</qualifier>
+ <notes/>
+ <taxon>urn:cspace:lifesci.collectionspace.org:taxonomyauthority:name(taxon):item:name(AcerJaponicus1332900279183)'Acer
+ Japonicus'</taxon>
+ <reference/>
+ <identBy>urn:cspace:lifesci.collectionspace.org:personauthorities:name(person):item:name(PatrickSchmitz1332900293194)'Patrick
+ Schmitz'</identBy>
+ <institution/>
+ </taxonomicIdentGroup>
+ </taxonomicIdentGroupList>
+ <nh_titleGroupList>
+ <nh_titleGroup>
+ <titleNote>This is an experiment</titleNote>
+ </nh_titleGroup>
+ </nh_titleGroupList>
+ </ns2:collectionobjects_naturalhistory>
+ <ns2:collectionobjects_common xmlns:ns2="http://collectionspace.org/services/collectionobject"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <objectNumber>2012.1.4</objectNumber>
+ <titleGroupList>
+ <titleGroup>
+ <title>This is a nice Object</title>
+ <titleType>generic</titleType>
+ <titleTranslationSubGroupList>
+ <titleTranslationSubGroup>
+ <titleTranslationLanguage>urn:cspace:lifesci.collectionspace.org:vocabularies:name(languages):item:name(deu)'German'</titleTranslationLanguage>
+ <titleTranslation>Das ist ein nettes Object</titleTranslation>
+ </titleTranslationSubGroup>
+ </titleTranslationSubGroupList>
+ <titleLanguage>urn:cspace:lifesci.collectionspace.org:vocabularies:name(languages):item:name(eng)'English'</titleLanguage>
+ </titleGroup>
+ </titleGroupList>
+ <responsibleDepartments>
+ <responsibleDepartment>antiquities</responsibleDepartment>
+ </responsibleDepartments>
+ <otherNumberList>
+ <otherNumber>
+ <numberValue>Obj123</numberValue>
+ <numberType>serial</numberType>
+ </otherNumber>
+ </otherNumberList>
+ </ns2:collectionobjects_common>
+</document>
<ant antfile="pstore/build.xml" target="gen_ddl" inheritAll="false"/>\r
</target>\r
\r
- <target name="create_db"\r
+ <target name="create_cspace_db"\r
description="create tables(s), indices for account service">\r
- <ant antfile="pstore/build.xml" target="create_db" inheritAll="false"/>\r
+ <ant antfile="pstore/build.xml" target="create_cspace_db" inheritAll="false"/>\r
</target>\r
\r
<target name="deploy" depends="install"\r
</exec>\r
</target>\r
\r
- <target name="create_db"\r
+ <target name="create_cspace_db"\r
description="create tables(s), indices for account service">\r
<sql driver="${db.jdbc.driver.class}"\r
url="${db.jdbc.cspace.url}"\r
<ant antfile="pstore/build.xml" target="gen_ddl" inheritAll="false"/>\r
</target>\r
\r
- <target name="create_db"\r
+ <target name="create_cspace_db"\r
description="create tables(s), indices for authentication service">\r
- <ant antfile="pstore/build.xml" target="create_db" inheritAll="false"/>\r
+ <ant antfile="pstore/build.xml" target="create_cspace_db" inheritAll="false"/>\r
</target>\r
\r
<target name="deploy" depends="install"\r
</exec>\r
</target>\r
\r
- <target name="create_db"\r
+ <target name="create_cspace_db"\r
description="create tables(s), indices for authentication service">\r
<sql driver="${db.jdbc.driver.class}"\r
url="${db.jdbc.cspace.url}"\r
description="generate service-specific tables(s), indices, etc.">\r
</target>\r
\r
- <target name="create_db"\r
+ <target name="create_cspace_db"\r
description="create tables(s), indices for authorization service">\r
</target>\r
\r
<ant antfile="pstore/build.xml" target="gen_ddl" inheritAll="false"/>\r
</target>\r
\r
- <target name="create_db"\r
+ <target name="create_cspace_db"\r
description="create tables(s), indices for authorization service">\r
- <ant antfile="pstore/build.xml" target="create_db" inheritAll="false"/>\r
+ <ant antfile="pstore/build.xml" target="create_cspace_db" inheritAll="false"/>\r
</target>\r
\r
<target name="deploy" depends="install"\r
</exec>\r
</target>\r
\r
- <target name="create_db"\r
+ <target name="create_cspace_db"\r
description="create tables(s), indices for authorization service">\r
<sql driver="${db.jdbc.driver.class}"\r
url="${db.jdbc.cspace.url}"\r
<ant antfile="account/build.xml" target="gen_ddl" inheritAll="false"/>\r
</target>\r
\r
- <target name="create_db"\r
+ <target name="create_cspace_db"\r
description="create service-specific tables(s), indices, etc.">\r
- <ant antfile="authentication/build.xml" target="create_db" inheritAll="false"/>\r
- <ant antfile="authorization/build.xml" target="create_db" inheritAll="false"/>\r
- <ant antfile="account/build.xml" target="create_db" inheritAll="false"/>\r
- <ant antfile="id/build.xml" target="create_db" inheritAll="false"/>\r
+ <ant antfile="authentication/build.xml" target="create_cspace_db" inheritAll="false"/>\r
+ <ant antfile="authorization/build.xml" target="create_cspace_db" inheritAll="false"/>\r
+ <ant antfile="account/build.xml" target="create_cspace_db" inheritAll="false"/>\r
+ </target>\r
+\r
+ <target name="create_nuxeo_db"\r
+ description="create service-specific tables(s), indices, etc.">\r
+ <ant antfile="id/build.xml" target="create_nuxeo_db" inheritAll="false"/>\r
</target>\r
\r
<target name="import"\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="fieldLocLongDecimal" type="xs:string"/>\r
<xs:element name="fieldLocElevation" type="xs:string"/>\r
\r
+\r
+ <!-- Add in an extension field for the common title group -->\r
+ <xs:element name="nh_titleGroupList">\r
+ <xs:complexType>\r
+ <xs:sequence>\r
+ <xs:element name="nh_titleGroup">\r
+ <xs:complexType>\r
+ <xs:sequence>\r
+ <xs:element name="titleNote" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xs:sequence>\r
+ </xs:complexType>\r
+ </xs:element>\r
+ </xs:sequence>\r
+ </xs:complexType>\r
+ </xs:element>\r
+\r
+\r
<!-- These will become contolled lists -->\r
<xs:element name="fieldLocGeodeticDatum" type="xs:string"/>\r
<xs:element name="fieldLocCoordinateSystem" type="xs:string"/>\r
</exec>\r
</target>\r
\r
- <target name="create_db"\r
+ <target name="create_nuxeo_db"\r
description="create tables(s), indices for id service">\r
- <ant antfile="service/build.xml" target="create_db" inheritAll="false"/>\r
+ <ant antfile="service/build.xml" target="create_nuxeo_db" inheritAll="false"/>\r
</target>\r
\r
<target name="deploy" depends="install"\r
</exec>
</target>
- <target name="create_db"
+ <target name="create_nuxeo_db"
description="create tables(s), indices for id service">
<sql driver="${db.jdbc.driver.class}"
url="${db.jdbc.nuxeo.url}"
--- /dev/null
+--
+-- delete all users
+--
+-- DELETE FROM mysql.user WHERE NOT (host="localhost" and user="root");
+-- FLUSH PRIVILEGES;
+
+--
+-- delete anonymous access
+--
+DELETE FROM mysql.user WHERE User = '';
+FLUSH PRIVILEGES;
+
+--
+-- recreate cspace database
+--
+DROP database IF EXISTS cspace;
+CREATE database cspace DEFAULT CHARACTER SET utf8;
+
+--
+-- grant privileges to users on cspace database
+--
+GRANT ALL PRIVILEGES ON cspace.* TO '@DB_CSPACE_USER@'@'localhost' IDENTIFIED BY '@DB_CSPACE_PASSWORD@' WITH GRANT OPTION;
+FLUSH PRIVILEGES;
+
---\r
--- delete all users\r
---\r
--- DELETE FROM mysql.user WHERE NOT (host="localhost" and user="root");\r
--- FLUSH PRIVILEGES;\r
-\r
---\r
--- delete anonymous access\r
---\r
-DELETE FROM mysql.user WHERE User = '';\r
-FLUSH PRIVILEGES;\r
-\r
---\r
--- recreate cspace database\r
---\r
-DROP database IF EXISTS cspace;\r
-CREATE database cspace DEFAULT CHARACTER SET utf8;\r
-\r
---\r
--- recreate nuxeo database\r
---\r
-DROP database IF EXISTS nuxeo;\r
-CREATE database nuxeo DEFAULT CHARACTER SET utf8;\r
-\r
-\r
---\r
--- grant privileges to users on nuxeo and cspace databases\r
---\r
-GRANT ALL PRIVILEGES ON cspace.* TO '@DB_CSPACE_USER@'@'localhost' IDENTIFIED BY '@DB_CSPACE_PASSWORD@' WITH GRANT OPTION;\r
-FLUSH PRIVILEGES;\r
-GRANT ALL PRIVILEGES ON nuxeo.* TO '@DB_NUXEO_USER@'@'localhost' IDENTIFIED BY '@DB_NUXEO_PASSWORD@' WITH GRANT OPTION;\r
---\r
--- Grant privileges to read-only user on Nuxeo, for reporting. \r
---\r
-GRANT SELECT ON nuxeo.* TO 'reader'@'localhost' IDENTIFIED BY 'read';\r
---\r
--- Grant privileges to remote read-only users on Nuxeo, for reporting. \r
--- These should be changed to reflect your domain. Avoid specifying\r
--- 'reader'@'%' (while simple and flexible, this is a potential security hole).\r
---\r
-GRANT SELECT ON nuxeo.* TO 'reader'@'%.berkeley.edu' IDENTIFIED BY 'read';\r
-GRANT SELECT ON nuxeo.* TO 'reader'@'%.movingimage.us' IDENTIFIED BY 'read';\r
-FLUSH PRIVILEGES;\r
-\r
+--
+-- recreate nuxeo database
+--
+DROP database IF EXISTS nuxeo;
+CREATE database nuxeo DEFAULT CHARACTER SET utf8;
+
+
+--
+-- grant privileges to users on nuxeo database
+--
+GRANT ALL PRIVILEGES ON nuxeo.* TO '@DB_NUXEO_USER@'@'localhost' IDENTIFIED BY '@DB_NUXEO_PASSWORD@' WITH GRANT OPTION;
+--
+-- Grant privileges to read-only user on Nuxeo, for reporting.
+--
+GRANT SELECT ON nuxeo.* TO 'reader'@'localhost' IDENTIFIED BY 'read';
+--
+-- Grant privileges to remote read-only users on Nuxeo, for reporting.
+-- These should be changed to reflect your domain. Avoid specifying
+-- 'reader'@'%' (while simple and flexible, this is a potential security hole).
+--
+GRANT SELECT ON nuxeo.* TO 'reader'@'%.berkeley.edu' IDENTIFIED BY 'read';
+GRANT SELECT ON nuxeo.* TO 'reader'@'%.movingimage.us' IDENTIFIED BY 'read';
+FLUSH PRIVILEGES;
+
--- /dev/null
+-- drop all the objects before dropping roles
+DROP database IF EXISTS cspace;
+
+DROP USER IF EXISTS cspace;
+
+CREATE ROLE @DB_CSPACE_USER@ WITH PASSWORD '@DB_CSPACE_PASSWORD@' LOGIN;
+
+--
+-- recreate cspace database
+--
+CREATE DATABASE cspace ENCODING 'UTF8' OWNER @DB_CSPACE_USER@;
--- drop all the objects before dropping roles\r
-DROP database IF EXISTS cspace;\r
-DROP database IF EXISTS nuxeo;\r
-\r
-DROP USER IF EXISTS nuxeo;\r
-DROP USER IF EXISTS cspace;\r
-DROP USER IF EXISTS reader;\r
-\r
-CREATE ROLE @DB_NUXEO_USER@ WITH PASSWORD '@DB_NUXEO_PASSWORD@' LOGIN;\r
-CREATE ROLE @DB_CSPACE_USER@ WITH PASSWORD '@DB_CSPACE_PASSWORD@' LOGIN;\r
-CREATE ROLE reader WITH PASSWORD 'read' LOGIN;\r
-\r
---\r
--- recreate jbossdb, cspace, and nuxeo databases\r
---\r
-CREATE DATABASE cspace ENCODING 'UTF8' OWNER @DB_CSPACE_USER@;\r
-CREATE DATABASE nuxeo ENCODING 'UTF8' OWNER @DB_NUXEO_USER@;\r
-\r
---\r
--- Grant privileges to read-only user on Nuxeo, for reporting. \r
---\r
-GRANT CONNECT ON DATABASE nuxeo TO reader;\r
-\r
--- GRANT SELECT ON ALL TABLES IN SCHEMA public TO reader;\r
--- This must be run by hand, after the system has already started up,\r
--- so that it gives access to all the tables created on init.\r
-\r
+-- drop all the objects before dropping roles
+DROP database IF EXISTS nuxeo;
+
+DROP USER IF EXISTS nuxeo;
+DROP USER IF EXISTS reader;
+
+CREATE ROLE @DB_NUXEO_USER@ WITH PASSWORD '@DB_NUXEO_PASSWORD@' LOGIN;
+CREATE ROLE reader WITH PASSWORD 'read' LOGIN;
+
+--
+-- recreate nuxeo database
+--
+CREATE DATABASE nuxeo ENCODING 'UTF8' OWNER @DB_NUXEO_USER@;
+
+--
+-- Grant privileges to read-only user on Nuxeo, for reporting.
+--
+GRANT CONNECT ON DATABASE nuxeo TO reader;
+
+-- GRANT SELECT ON ALL TABLES IN SCHEMA public TO reader;
+-- This must be run by hand, after the system has already started up,
+-- so that it gives access to all the tables created on init.
+