<?xml version="1.0"?>
<project basedir="." default="store" name="exist-ant-tasks">

	<path id="classpath.core">
		<fileset dir="lib/core">
			<include name="*.jar"/>
		</fileset>
		<pathelement path="exist.jar"/>
		<pathelement path="exist-optional.jar"/>
	</path>

	<typedef resource="org/exist/ant/antlib.xml" uri="http://exist-db.org/ant">
		<classpath refid="classpath.core"/>
	</typedef>

	<target name="store" xmlns:xmldb="http://exist-db.org/ant">

		<xmldb:store uri="xmldb:exist:///db/shakespeare/plays" initdb="true" createcollection="true">
			<fileset dir="samples/shakespeare" includes="*.xml"/>
		</xmldb:store>

		<xmldb:store uri="xmldb:exist:///db/library" createcollection="true">
			<fileset dir="samples" includes="biblio.rdf"/>
		</xmldb:store>

		<xmldb:store uri="xmldb:exist:///db/xinclude" createcollection="true">
			<fileset dir="samples/xinclude" includes="**.xml"/>
		</xmldb:store>

		<property name="backup" value="${user.home}/exist-backup"/>

		<xmldb:backup uri="xmldb:exist:///db" dir="${backup}"/>

		<xmldb:remove uri="xmldb:exist:///db" collection="shakespeare"/>

		<xmldb:restore uri="xmldb:exist://" user="admin" password="" dir="${backup}/db/shakespeare/plays"/>

	</target>

</project>
