perfsonar-dev - perfsonar: r2687 - branches/new-structure/trunk/geant2_java-xml-ls/ant
Subject: perfsonar development work
List archive
- From:
- To:
- Subject: perfsonar: r2687 - branches/new-structure/trunk/geant2_java-xml-ls/ant
- Date: Tue, 21 Aug 2007 05:09:22 -0400
Author: mac
Date: 2007-08-21 05:09:21 -0400 (Tue, 21 Aug 2007)
New Revision: 2687
Modified:
branches/new-structure/trunk/geant2_java-xml-ls/ant/axis-deploy-targets.xml
branches/new-structure/trunk/geant2_java-xml-ls/ant/exist-targets.xml
Log:
Exist targets supports creating new collection depending on storage option
(Multiple Files vs. XQuery)
Modified:
branches/new-structure/trunk/geant2_java-xml-ls/ant/axis-deploy-targets.xml
===================================================================
---
branches/new-structure/trunk/geant2_java-xml-ls/ant/axis-deploy-targets.xml
2007-08-20 13:07:50 UTC (rev 2686)
+++
branches/new-structure/trunk/geant2_java-xml-ls/ant/axis-deploy-targets.xml
2007-08-21 09:09:21 UTC (rev 2687)
@@ -218,7 +218,7 @@
<antcall target="exist-adduser"/>
</antcontrib:try>
<antcontrib:catch>
- <echo>The script can not create new user
${component.ls.xmldb.db_username}.</echo>
+ <echo>The script can not create new user
${service.ls.db_username}.</echo>
<echo>Such user could have been already created or there
is a problem with eXist.</echo>
<echo>---------- Detailed error message:</echo>
<echo>${errormessage}</echo>
Modified:
branches/new-structure/trunk/geant2_java-xml-ls/ant/exist-targets.xml
===================================================================
--- branches/new-structure/trunk/geant2_java-xml-ls/ant/exist-targets.xml
2007-08-20 13:07:50 UTC (rev 2686)
+++ branches/new-structure/trunk/geant2_java-xml-ls/ant/exist-targets.xml
2007-08-21 09:09:21 UTC (rev 2687)
@@ -33,46 +33,29 @@
</target>
- <target name="exist-resource-present"
- xmlns:xdb="http://exist-db.org/ant">
- <condition property="resource.present">
- <xdb:exist uri="${service.ls.db_uri.xmlrpc}"
- resource="LSStore.xml"/>
- <xdb:exist uri="${service.ls.db_uri.xmlrpc}"
- resource="LSStore-control.xml"/>
- </condition>
-
- </target>
-
-
- <target name="exist-collection-remove"
+ <target name="exist-collection-remove"
+ depends="getdbroot"
+ xmlns:antcontrib="antlib:net.sf.antcontrib"
+ xmlns:xdb="http://exist-db.org/ant"
xmlns:psbase="psbase:/base.perfsonar.org">
- <basename property="collection" file="${service.ls.db_uri.xmlrpc}" />
- <basename property="resource" file="${service.ma.conf_file}"/>
+ <condition property="collection.present">
+ <xdb:exist uri="${service.ls.db_uri.xmlrpc}"/>
+ </condition>
+
+ <antcontrib:if>
+ <isset property="collection.present"/>
+ <antcontrib:then>
+ <xdb:remove xmlns:xdb="http://exist-db.org/ant"
+ uri="${dbroot}" collection="ls"
+ user="${service.ls.db_username}"
+ password="${service.ls.db_password}"/>
+ </antcontrib:then>
+ </antcontrib:if>
- <psbase:exist-collection-remove uri="${service.ls.db_uri.xmlrpc}"
- resource="${resource}"
- collection="${collection}"
- user="${service.ls.db_username}"
- password="${service.ls.db_password}"/>
</target>
-
- <target name="exist-resource-remove"
- xmlns:psbase="psbase:/base.perfsonar.org">
-
- <input message="Enter the name of resource to remove"
- addproperty="resource"
- defaultvalue=""/>
- <psbase:exist-resource-remove uri="${service.ls.db_uri.xmlrpc}"
- resource="${resource}"
- user="${service.ls.db_username}"
- password="${service.ls.db_password}"/>
- </target>
-
-
<target name="exist-resource-store"
xmlns:psbase="psbase:/base.perfsonar.org">
@@ -88,19 +71,6 @@
</target>
- <target name="exist-resource-extract"
- xmlns:psbase="psbase:/base.perfsonar.org">
-<!--
- <basename property="xmlresource" file="resources/requests/LSStore.xml"/>
- <psbase:exist-resource-extract uri="${service.ls.db_uri.xmlrpc}"
- resource="${xmlresource}"
- user="${service.ls.db_username}"
- password="${service.ls.db_password}"
- dest-file="conf/dump_${xmlresource}"/>
--->
- </target>
-
-
<target name="getdbroot">
<dirname property="dir1" file="/${service.ls.db_uri.xmlrpc}"/>
@@ -122,22 +92,58 @@
<target name="exist-collection-create"
depends="getdbroot"
+ xmlns:antcontrib="antlib:net.sf.antcontrib"
xmlns:psbase="psbase:/base.perfsonar.org">
<basename property="ls-base-collection"
file="${service.ls.db_uri.xmlrpc}" />
- <psbase:exist-collection-create uri="${dbroot}"
- collection="${ls-base-collection}"
- user="${service.ls.db_username}"
- password="${service.ls.db_password}"/>
+
+ <!-- XQuery -->
+ <!-- create one collection /ls and store two XML documents -->
+
+ <antcontrib:if>
+ <equals arg1="${service.ls.db_type}"
arg2="org.perfsonar.service.lookupService.xmlType.storage.exist.XQueryExistDAOImpl"
/>
+ <antcontrib:then>
+ <psbase:exist-collection-create uri="${dbroot}"
+ collection="${ls-base-collection}"
+ user="${service.ls.db_username}"
+
password="${service.ls.db_password}"/>
+ <antcall target="exist-resource-store"/>
+ </antcontrib:then>
+ </antcontrib:if>
+
+ <!-- Multiple resouces -->
+ <!-- Create different collections for LSStore and control -->
+
+ <antcontrib:if>
+ <equals arg1="${service.ls.db_type}"
arg2="org.perfsonar.service.lookupService.xmlType.storage.exist.MultipleFilesExistDAOImpl"
/>
+ <antcontrib:then>
+ <psbase:exist-collection-create uri="${dbroot}"
+ collection="${ls-base-collection}"
+ user="${service.ls.db_username}"
+
password="${service.ls.db_password}"/>
+ <psbase:exist-collection-create uri="${dbroot}"
+
collection="${ls-base-collection}/LSStore"
+ user="${service.ls.db_username}"
+
password="${service.ls.db_password}"/>
+ <psbase:exist-collection-create uri="${dbroot}"
+
collection="${ls-base-collection}/LSStore-control"
+ user="${service.ls.db_username}"
+
password="${service.ls.db_password}"/>
+ </antcontrib:then>
+ </antcontrib:if>
+
+
+
+
+
</target>
<target name="exist-init"
- depends="exist-resource-present"
xmlns:psbase="psbase:/base.perfsonar.org"
xmlns:antcontrib="antlib:net.sf.antcontrib">
- <psbase:input2 message="Do you want me to initialize eXist xml database
(eXist database will store the metadata configuration file)? "
+ <psbase:input2 message="Do you want me to initialize eXist xml database
(ALL DATA WILL BE LOST!)? "
addproperty="exist.init"
validargs="y,n"
defaultvalue="y" />
@@ -146,23 +152,9 @@
<equals arg1="${exist.init}" arg2="y" />
<antcontrib:then>
+ <antcall target="exist-collection-remove"/>
<antcall target="exist-collection-create"/>
- <antcall target="exist-resource-store"/>
-<!--
- <antcontrib:if>
- <isset property="resource.present"/>
- <antcontrib:then>
- <antcall target="exist-resource-extract"/>
- <antcall target="exist-collection-remove"/>
- <antcall target="exist-collection-create"/>
- <antcall target="exist-resource-store"/>
- </antcontrib:then>
- <antcontrib:else>
- <antcall target="exist-collection-create"/>
- <antcall target="exist-resource-store"/>
- </antcontrib:else>
- </antcontrib:if>
--->
+
</antcontrib:then>
</antcontrib:if>
- perfsonar: r2687 - branches/new-structure/trunk/geant2_java-xml-ls/ant, svnlog, 08/21/2007
Archive powered by MHonArc 2.6.16.