PageRenderTime 25ms CodeModel.GetById 17ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/install/build.xml

http://transcriptstudio4isha.googlecode.com/
XML | 74 lines | 64 code | 9 blank | 1 comment | 0 complexity | f3212ecd5d79feae0658604701155eb6 MD5 | raw file
 1<?xml version="1.0" encoding="UTF-8"?>
 2<project basedir="." default="all" name="transcript-studio">
 3
 4	<description>Isha Foundation Transcript Studio - Configure eXist</description>
 5	
 6	<path id="classpath.core">
 7		<fileset dir="${exist.home}/lib/core">
 8			<include name="*.jar"/>
 9		</fileset>
10		<pathelement path="${exist.home}/exist.jar"/>
11		<pathelement path="${exist.home}/exist-optional.jar"/>
12	</path>
13
14	<typedef resource="org/exist/ant/antlib.xml" uri="http://exist-db.org/ant">
15		<classpath refid="classpath.core"/>
16	</typedef>
17
18	<property name="dist.exist.app.dir" location="exist-app"/>
19	<property name="dist.exist.db.dir" location="exist-db"/>
20
21	<target name="init-exist">
22		<echo message="Copying TranscriptStudio-specific files to eXist installation..."/>
23		<copy todir="${exist.home}" includeEmptyDirs="true">
24			<fileset dir="${dist.exist.app.dir}">
25				<exclude name="tools/wrapper/conf/wrapper.conf"/>
26			</fileset>
27 		</copy>
28		<copy todir="${exist.home}">
29			<fileset dir="${dist.exist.app.dir}">
30				<include name="tools/wrapper/conf/wrapper.conf"/>
31			</fileset>
32			<filterset>
33				<filter token="JAVA_HOME" value="${java.home}"/>
34			</filterset>
35 		</copy>
36		<chmod file="${exist.home}/bin/startup.sh" perm="ugo+x"/>
37		<echo message="Initialising database..."/>
38		<xdb:store xmlns:xdb="http://exist-db.org/ant" uri="xmldb:exist://localhost:8080/exist/xmlrpc/db" createcollection="true" createsubcollections="true" user="admin" password="admin">
39			<fileset dir="${dist.exist.db.dir}">
40				<include name="**"/>
41				<exclude name="ts4isha/reference/reference.xml"/>
42			</fileset>
43		</xdb:store>
44		<!-- Cannot get this working properly, so reference.xml will have to be done manually -->
45		<condition property="reference.xml.exists">  
46			<xdb:exist xmlns:xdb="http://exist-db.org/ant" uri="xmldb:exist://localhost:8080/exist/xmlrpc/db/ts4isha/reference" resource="reference.xml"/>
47		</condition>
48		<condition property="data.exists">
49			<xdb:exist xmlns:xdb="http://exist-db.org/ant" uri="xmldb:exist://localhost:8080/exist/xmlrpc/db/ts4isha/data"/>
50		</condition>
51		<antcall target="store-reference-xml"/>
52		<antcall target="create-data-collection"/>
53	</target>
54
55	<target name="closing-message">
56		<echo message="Please restart eXist database for changes to take effect"/> 
57	</target>
58	
59	<target name="store-reference-xml" unless="reference.xml.exists">
60		<echo message="Storing reference.xml"/>
61		<xdb:store xmlns:xdb="http://exist-db.org/ant" uri="xmldb:exist://localhost:8080/exist/xmlrpc/db" createcollection="true" createsubcollections="true" user="admin" password="admin">
62			<fileset dir="${dist.exist.db.dir}">
63				<include name="ts4isha/reference/reference.xml"/>
64			</fileset>
65		</xdb:store>
66	</target>
67
68	<target name="create-data-collection" unless="data.exists">
69		<echo message="Creating data collection"/>
70		<xdb:create xmlns:xdb="http://exist-db.org/ant" uri="xmldb:exist://localhost:8080/exist/xmlrpc/db/ts4isha" collection="data" user="admin" password="admin"/>  
71	</target>
72
73	<target name="all" depends="init-exist,closing-message" description="Configure eXist for TranscriptStudio"/>
74</project>