Displaying differences for changeset
 
display as  

nbproject/build-impl.xml

@@ -1,1465 +1,1467 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-        *** GENERATED FROM project.xml - DO NOT EDIT  ***
-        ***         EDIT ../build.xml INSTEAD         ***
-
-        For the purpose of easier reading the script
-        is divided into following sections:
-        - initialization
-        - compilation
-        - dist
-        - execution
-        - debugging
-        - javadoc
-        - test compilation
-        - test execution
-        - test debugging
-        - cleanup
-
-        -->
-<project xmlns:webproject1="http://www.netbeans.org/ns/web-project/1" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" basedir=".." default="default" name="csip-cfa-impl">
-    <import file="rest-build.xml"/>
-    <import file="ant-deploy.xml"/>
-    <fail message="Please build using Ant 1.7.1 or higher.">
-        <condition>
-            <not>
-                <antversion atleast="1.7.1"/>
-            </not>
-        </condition>
-    </fail>
-    <target depends="dist,javadoc" description="Build whole project." name="default"/>
-    <!--
-                INITIALIZATION SECTION
-            -->
-    <target name="-pre-init">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="-pre-init" name="-init-private">
-        <property file="nbproject/private/private.properties"/>
-    </target>
-    <target depends="-pre-init,-init-private" name="-init-user">
-        <property file="${user.properties.file}"/>
-        <!-- The two properties below are usually overridden -->
-        <!-- by the active platform. Just a fallback. -->
-        <property name="default.javac.source" value="1.4"/>
-        <property name="default.javac.target" value="1.4"/>
-    </target>
-    <target depends="-pre-init,-init-private,-init-user" name="-init-project">
-        <property file="nbproject/project.properties"/>
-    </target>
-    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" if="dist.ear.dir" name="-do-ear-init"/>
-    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
-        <condition property="have.tests">
-            <or>
-                <available file="${test.src.dir}"/>
-            </or>
-        </condition>
-        <condition property="have.sources">
-            <or>
-                <available file="${src.dir}"/>
-            </or>
-        </condition>
-        <condition property="netbeans.home+have.tests">
-            <and>
-                <isset property="netbeans.home"/>
-                <isset property="have.tests"/>
-            </and>
-        </condition>
-        <condition property="no.javadoc.preview">
-            <isfalse value="${javadoc.preview}"/>
-        </condition>
-        <property name="javac.compilerargs" value=""/>
-        <condition property="no.deps">
-            <and>
-                <istrue value="${no.dependencies}"/>
-            </and>
-        </condition>
-        <condition property="no.dist.ear.dir">
-            <not>
-                <isset property="dist.ear.dir"/>
-            </not>
-        </condition>
-        <property name="build.web.excludes" value="${build.classes.excludes}"/>
-        <condition property="do.compile.jsps">
-            <istrue value="${compile.jsps}"/>
-        </condition>
-        <condition property="do.debug.server">
-            <or>
-                <not>
-                    <isset property="debug.server"/>
-                </not>
-                <istrue value="${debug.server}"/>
-                <and>
-                    <not>
-                        <istrue value="${debug.server}"/>
-                    </not>
-                    <not>
-                        <istrue value="${debug.client}"/>
-                    </not>
-                </and>
-            </or>
-        </condition>
-        <condition property="do.debug.client">
-            <istrue value="${debug.client}"/>
-        </condition>
-        <condition property="do.display.browser">
-            <istrue value="${display.browser}"/>
-        </condition>
-        <condition property="do.display.browser.debug.old">
-            <and>
-                <isset property="do.display.browser"/>
-                <not>
-                    <isset property="do.debug.client"/>
-                </not>
-                <not>
-                    <isset property="browser.context"/>
-                </not>
-            </and>
-        </condition>
-        <condition property="do.display.browser.debug">
-            <and>
-                <isset property="do.display.browser"/>
-                <not>
-                    <isset property="do.debug.client"/>
-                </not>
-                <isset property="browser.context"/>
-            </and>
-        </condition>
-        <available file="${conf.dir}/MANIFEST.MF" property="has.custom.manifest"/>
-        <available file="${persistence.xml.dir}/persistence.xml" property="has.persistence.xml"/>
-        <condition property="do.war.package.with.custom.manifest">
-            <isset property="has.custom.manifest"/>
-        </condition>
-        <condition property="do.war.package.without.custom.manifest">
-            <not>
-                <isset property="has.custom.manifest"/>
-            </not>
-        </condition>
-        <condition property="do.tmp.war.package.with.custom.manifest">
-            <and>
-                <isset property="has.custom.manifest"/>
-                <or>
-                    <isfalse value="${directory.deployment.supported}"/>
-                    <isset property="dist.ear.dir"/>
-                </or>
-            </and>
-        </condition>
-        <condition property="do.tmp.war.package.without.custom.manifest">
-            <and>
-                <not>
-                    <isset property="has.custom.manifest"/>
-                </not>
-                <or>
-                    <isfalse value="${directory.deployment.supported}"/>
-                    <isset property="dist.ear.dir"/>
-                </or>
-            </and>
-        </condition>
-        <condition property="do.tmp.war.package">
-            <or>
-                <isfalse value="${directory.deployment.supported}"/>
-                <isset property="dist.ear.dir"/>
-            </or>
-        </condition>
-        <property name="build.meta.inf.dir" value="${build.web.dir}/META-INF"/>
-        <condition else="" property="application.args.param" value="${application.args}">
-            <and>
-                <isset property="application.args"/>
-                <not>
-                    <equals arg1="${application.args}" arg2="" trim="true"/>
-                </not>
-            </and>
-        </condition>
-        <property name="source.encoding" value="${file.encoding}"/>
-        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
-            <and>
-                <isset property="javadoc.encoding"/>
-                <not>
-                    <equals arg1="${javadoc.encoding}" arg2=""/>
-                </not>
-            </and>
-        </condition>
-        <property name="javadoc.encoding.used" value="${source.encoding}"/>
-        <property name="includes" value="**"/>
-        <property name="excludes" value=""/>
-        <property name="runmain.jvmargs" value=""/>
-        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
-        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
-            <and>
-                <isset property="endorsed.classpath"/>
-                <length length="0" string="${endorsed.classpath}" when="greater"/>
-            </and>
-        </condition>
-        <condition else="false" property="jdkBug6558476">
-            <and>
-                <matches pattern="1\.[56]" string="${java.specification.version}"/>
-                <not>
-                    <os family="unix"/>
-                </not>
-            </and>
-        </condition>
-        <property name="javac.fork" value="${jdkBug6558476}"/>
-        <condition property="junit.available">
-            <or>
-                <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
-                <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
-            </or>
-        </condition>
-        <condition property="testng.available">
-            <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
-        </condition>
-        <condition property="junit+testng.available">
-            <and>
-                <istrue value="${junit.available}"/>
-                <istrue value="${testng.available}"/>
-            </and>
-        </condition>
-        <condition else="testng" property="testng.mode" value="mixed">
-            <istrue value="${junit+testng.available}"/>
-        </condition>
-        <condition else="" property="testng.debug.mode" value="-mixed">
-            <istrue value="${junit+testng.available}"/>
-        </condition>
-    </target>
-    <target depends="init" name="-init-cos" unless="deploy.on.save">
-        <condition property="deploy.on.save" value="true">
-            <or>
-                <istrue value="${j2ee.deploy.on.save}"/>
-                <istrue value="${j2ee.compile.on.save}"/>
-            </or>
-        </condition>
-    </target>
-    <target name="-post-init">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
-        <fail unless="src.dir">Must set src.dir</fail>
-        <fail unless="test.src.dir">Must set test.src.dir</fail>
-        <fail unless="build.dir">Must set build.dir</fail>
-        <fail unless="build.web.dir">Must set build.web.dir</fail>
-        <fail unless="build.generated.dir">Must set build.generated.dir</fail>
-        <fail unless="dist.dir">Must set dist.dir</fail>
-        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
-        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
-        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
-        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
-        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
-        <fail unless="dist.war">Must set dist.war</fail>
-        <condition property="missing.j2ee.server.home">
-            <and>
-                <matches pattern="j2ee.server.home" string="${j2ee.platform.classpath}"/>
-                <not>
-                    <isset property="j2ee.server.home"/>
-                </not>
-            </and>
-        </condition>
-        <fail if="missing.j2ee.server.home">
-The Java EE server classpath is not correctly set up - server home directory is missing.
-Either open the project in the IDE and assign the server or setup the server classpath manually.
-For example like this:
-   ant -Dj2ee.server.home=&lt;app_server_installation_directory&gt;
-                </fail>
-        <fail unless="j2ee.platform.classpath">
-The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}.
-Either open the project in the IDE and assign the server or setup the server classpath manually.
-For example like this:
-   ant -Duser.properties.file=&lt;path_to_property_file&gt; (where you put the property "j2ee.platform.classpath" in a .properties file)
-or ant -Dj2ee.platform.classpath=&lt;server_classpath&gt; (where no properties file is used)
-                </fail>
-    </target>
-    <target name="-init-macrodef-property">
-        <macrodef name="property" uri="http://www.netbeans.org/ns/web-project/1">
-            <attribute name="name"/>
-            <attribute name="value"/>
-            <sequential>
-                <property name="@{name}" value="${@{value}}"/>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
-        <macrodef name="javac" uri="http://www.netbeans.org/ns/web-project/2">
-            <attribute default="${src.dir}" name="srcdir"/>
-            <attribute default="${build.classes.dir}" name="destdir"/>
-            <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
-            <attribute default="${javac.processorpath}" name="processorpath"/>
-            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
-            <attribute default="${includes}" name="includes"/>
-            <attribute default="${excludes}" name="excludes"/>
-            <attribute default="${javac.debug}" name="debug"/>
-            <attribute default="${empty.dir}" name="gensrcdir"/>
-            <element name="customize" optional="true"/>
-            <sequential>
-                <property location="${build.dir}/empty" name="empty.dir"/>
-                <mkdir dir="${empty.dir}"/>
-                <mkdir dir="@{apgeneratedsrcdir}"/>
-                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" srcdir="@{srcdir}" target="${javac.target}">
-                    <src>
-                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
-                            <include name="*"/>
-                        </dirset>
-                    </src>
-                    <classpath>
-                        <path path="@{classpath}"/>
-                    </classpath>
-                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
-                    <compilerarg line="${javac.compilerargs}"/>
-                    <compilerarg value="-processorpath"/>
-                    <compilerarg path="@{processorpath}:${empty.dir}"/>
-                    <compilerarg line="${ap.processors.internal}"/>
-                    <compilerarg value="-s"/>
-                    <compilerarg path="@{apgeneratedsrcdir}"/>
-                    <compilerarg line="${ap.proc.none.internal}"/>
-                    <customize/>
-                </javac>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
-        <macrodef name="javac" uri="http://www.netbeans.org/ns/web-project/2">
-            <attribute default="${src.dir}" name="srcdir"/>
-            <attribute default="${build.classes.dir}" name="destdir"/>
-            <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
-            <attribute default="${javac.processorpath}" name="processorpath"/>
-            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
-            <attribute default="${includes}" name="includes"/>
-            <attribute default="${excludes}" name="excludes"/>
-            <attribute default="${javac.debug}" name="debug"/>
-            <attribute default="${empty.dir}" name="gensrcdir"/>
-            <element name="customize" optional="true"/>
-            <sequential>
-                <property location="${build.dir}/empty" name="empty.dir"/>
-                <mkdir dir="${empty.dir}"/>
-                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" srcdir="@{srcdir}" target="${javac.target}">
-                    <src>
-                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
-                            <include name="*"/>
-                        </dirset>
-                    </src>
-                    <classpath>
-                        <path path="@{classpath}"/>
-                    </classpath>
-                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
-                    <compilerarg line="${javac.compilerargs}"/>
-                    <customize/>
-                </javac>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
-        <macrodef name="depend" uri="http://www.netbeans.org/ns/web-project/2">
-            <attribute default="${src.dir}" name="srcdir"/>
-            <attribute default="${build.classes.dir}" name="destdir"/>
-            <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
-            <sequential>
-                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
-                    <classpath>
-                        <path path="@{classpath}"/>
-                    </classpath>
-                </depend>
-            </sequential>
-        </macrodef>
-        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/web-project/2">
-            <attribute default="${build.classes.dir}" name="destdir"/>
-            <sequential>
-                <fail unless="javac.includes">Must set javac.includes</fail>
-                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
-                    <path>
-                        <filelist dir="@{destdir}" files="${javac.includes}"/>
-                    </path>
-                    <globmapper from="*.java" to="*.class"/>
-                </pathconvert>
-                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
-                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
-                <delete>
-                    <files includesfile="${javac.includesfile.binary}"/>
-                </delete>
-                <delete file="${javac.includesfile.binary}"/>
-            </sequential>
-        </macrodef>
-    </target>
-    <target if="${junit.available}" name="-init-macrodef-junit-init">
-        <condition else="false" property="nb.junit.batch" value="true">
-            <and>
-                <istrue value="${junit.available}"/>
-                <not>
-                    <isset property="test.method"/>
-                </not>
-            </and>
-        </condition>
-        <condition else="false" property="nb.junit.single" value="true">
-            <and>
-                <istrue value="${junit.available}"/>
-                <isset property="test.method"/>
-            </and>
-        </condition>
-    </target>
-    <target name="-init-test-properties">
-        <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
-        <property name="test.binarytestincludes" value=""/>
-        <property name="test.binaryexcludes" value=""/>
-    </target>
-    <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
-        <macrodef name="junit" uri="http://www.netbeans.org/ns/web-project/2">
-            <attribute default="${includes}" name="includes"/>
-            <attribute default="${excludes}" name="excludes"/>
-            <attribute default="**" name="testincludes"/>
-            <attribute default="" name="testmethods"/>
-            <element name="customize" optional="true"/>
-            <sequential>
-                <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${java.io.tmpdir}">
-                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
-                    <syspropertyset>
-                        <propertyref prefix="test-sys-prop."/>
-                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
-                    </syspropertyset>
-                    <formatter type="brief" usefile="false"/>
-                    <formatter type="xml"/>
-                    <jvmarg value="-ea"/>
-                    <customize/>
-                </junit>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
-        <macrodef name="junit" uri="http://www.netbeans.org/ns/web-project/2">
-            <attribute default="${includes}" name="includes"/>
-            <attribute default="${excludes}" name="excludes"/>
-            <attribute default="**" name="testincludes"/>
-            <attribute default="" name="testmethods"/>
-            <element name="customize" optional="true"/>
-            <sequential>
-                <property name="run.jvmargs.ide" value=""/>
-                <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
-                    <batchtest todir="${build.test.results.dir}">
-                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
-                            <filename name="@{testincludes}"/>
-                        </fileset>
-                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
-                            <filename name="${test.binarytestincludes}"/>
-                        </fileset>
-                    </batchtest>
-                    <syspropertyset>
-                        <propertyref prefix="test-sys-prop."/>
-                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
-                    </syspropertyset>
-                    <formatter type="brief" usefile="false"/>
-                    <formatter type="xml"/>
-                    <jvmarg value="-ea"/>
-                    <jvmarg line="${run.jvmargs.ide}"/>
-                    <customize/>
-                </junit>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
-    <target if="${testng.available}" name="-init-macrodef-testng">
-        <macrodef name="testng" uri="http://www.netbeans.org/ns/web-project/2">
-            <attribute default="${includes}" name="includes"/>
-            <attribute default="${excludes}" name="excludes"/>
-            <attribute default="**" name="testincludes"/>
-            <attribute default="" name="testmethods"/>
-            <element name="customize" optional="true"/>
-            <sequential>
-                <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
-                    <isset property="test.method"/>
-                </condition>
-                <union id="test.set">
-                    <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
-                        <filename name="@{testincludes}"/>
-                    </fileset>
-                </union>
-                <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
-                <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="csip-cfa" testname="TestNG tests" workingDir="${basedir}">
-                    <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
-                    <propertyset>
-                        <propertyref prefix="test-sys-prop."/>
-                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
-                    </propertyset>
-                    <customize/>
-                </testng>
-            </sequential>
-        </macrodef>
-    </target>
-    <target name="-init-macrodef-test-impl">
-        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2">
-            <attribute default="${includes}" name="includes"/>
-            <attribute default="${excludes}" name="excludes"/>
-            <attribute default="**" name="testincludes"/>
-            <attribute default="" name="testmethods"/>
-            <element implicit="true" name="customize" optional="true"/>
-            <sequential>
-                <echo>No tests executed.</echo>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
-        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2">
-            <attribute default="${includes}" name="includes"/>
-            <attribute default="${excludes}" name="excludes"/>
-            <attribute default="**" name="testincludes"/>
-            <attribute default="" name="testmethods"/>
-            <element implicit="true" name="customize" optional="true"/>
-            <sequential>
-                <webproject2:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
-                    <customize/>
-                </webproject2:junit>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
-        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2">
-            <attribute default="${includes}" name="includes"/>
-            <attribute default="${excludes}" name="excludes"/>
-            <attribute default="**" name="testincludes"/>
-            <attribute default="" name="testmethods"/>
-            <element implicit="true" name="customize" optional="true"/>
-            <sequential>
-                <webproject2:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
-                    <customize/>
-                </webproject2:testng>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
-        <macrodef name="test" uri="http://www.netbeans.org/ns/web-project/2">
-            <attribute default="${includes}" name="includes"/>
-            <attribute default="${excludes}" name="excludes"/>
-            <attribute default="**" name="testincludes"/>
-            <attribute default="" name="testmethods"/>
-            <sequential>
-                <webproject2:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
-                    <customize>
-                        <classpath>
-                            <path path="${run.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}"/>
-                        </classpath>
-                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
-                        <jvmarg line="${runmain.jvmargs}"/>
-                    </customize>
-                </webproject2:test-impl>
-            </sequential>
-        </macrodef>
-    </target>
-    <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
-        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/web-project/2">
-            <attribute default="${includes}" name="includes"/>
-            <attribute default="${excludes}" name="excludes"/>
-            <attribute default="**" name="testincludes"/>
-            <attribute default="" name="testmethods"/>
-            <element name="customize" optional="true"/>
-            <sequential>
-                <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${java.io.tmpdir}">
-                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
-                    <syspropertyset>
-                        <propertyref prefix="test-sys-prop."/>
-                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
-                    </syspropertyset>
-                    <formatter type="brief" usefile="false"/>
-                    <formatter type="xml"/>
-                    <jvmarg value="-ea"/>
-                    <jvmarg line="${debug-args-line}"/>
-                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
-                    <customize/>
-                </junit>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
-        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/web-project/2">
-            <attribute default="${includes}" name="includes"/>
-            <attribute default="${excludes}" name="excludes"/>
-            <attribute default="**" name="testincludes"/>
-            <attribute default="" name="testmethods"/>
-            <element name="customize" optional="true"/>
-            <sequential>
-                <property name="run.jvmargs.ide" value=""/>
-                <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
-                    <batchtest todir="${build.test.results.dir}">
-                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
-                            <filename name="@{testincludes}"/>
-                        </fileset>
-                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
-                            <filename name="${test.binarytestincludes}"/>
-                        </fileset>
-                    </batchtest>
-                    <syspropertyset>
-                        <propertyref prefix="test-sys-prop."/>
-                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
-                    </syspropertyset>
-                    <formatter type="brief" usefile="false"/>
-                    <formatter type="xml"/>
-                    <jvmarg value="-ea"/>
-                    <jvmarg line="${run.jvmargs.ide}"/>
-                    <jvmarg line="${debug-args-line}"/>
-                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
-                    <customize/>
-                </junit>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
-        <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/web-project/2">
-            <attribute default="${includes}" name="includes"/>
-            <attribute default="${excludes}" name="excludes"/>
-            <attribute default="**" name="testincludes"/>
-            <attribute default="" name="testmethods"/>
-            <element implicit="true" name="customize" optional="true"/>
-            <sequential>
-                <webproject2:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
-                    <customize/>
-                </webproject2:junit-debug>
-            </sequential>
-        </macrodef>
-    </target>
-    <target if="${testng.available}" name="-init-macrodef-testng-debug">
-        <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/web-project/2">
-            <attribute default="${main.class}" name="testClass"/>
-            <attribute default="" name="testMethod"/>
-            <element name="customize2" optional="true"/>
-            <sequential>
-                <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
-                    <isset property="test.method"/>
-                </condition>
-                <condition else="-suitename csip-cfa -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
-                    <matches pattern=".*\.xml" string="@{testClass}"/>
-                </condition>
-                <delete dir="${build.test.results.dir}" quiet="true"/>
-                <mkdir dir="${build.test.results.dir}"/>
-                <webproject1:debug args="${testng.cmd.args}" classname="org.testng.TestNG" classpath="${debug.test.classpath}:${j2ee.platform.embeddableejb.classpath}">
-                    <customize>
-                        <customize2/>
-                        <jvmarg value="-ea"/>
-                        <arg line="${testng.debug.mode}"/>
-                        <arg line="-d ${build.test.results.dir}"/>
-                        <arg line="-listener org.testng.reporters.VerboseReporter"/>
-                    </customize>
-                </webproject1:debug>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
-        <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/web-project/2">
-            <attribute default="${main.class}" name="testClass"/>
-            <attribute default="" name="testMethod"/>
-            <element implicit="true" name="customize2" optional="true"/>
-            <sequential>
-                <webproject2:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
-                    <customize2/>
-                </webproject2:testng-debug>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
-        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/web-project/2">
-            <attribute default="${includes}" name="includes"/>
-            <attribute default="${excludes}" name="excludes"/>
-            <attribute default="**" name="testincludes"/>
-            <attribute default="" name="testmethods"/>
-            <attribute default="${main.class}" name="testClass"/>
-            <attribute default="" name="testMethod"/>
-            <sequential>
-                <webproject2:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
-                    <customize>
-                        <classpath>
-                            <path path="${run.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}"/>
-                        </classpath>
-                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
-                        <jvmarg line="${runmain.jvmargs}"/>
-                    </customize>
-                </webproject2:test-debug-impl>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
-        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/web-project/2">
-            <attribute default="${includes}" name="includes"/>
-            <attribute default="${excludes}" name="excludes"/>
-            <attribute default="**" name="testincludes"/>
-            <attribute default="" name="testmethods"/>
-            <attribute default="${main.class}" name="testClass"/>
-            <attribute default="" name="testMethod"/>
-            <sequential>
-                <webproject2:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
-                    <customize2>
-                        <syspropertyset>
-                            <propertyref prefix="test-sys-prop."/>
-                            <mapper from="test-sys-prop.*" to="*" type="glob"/>
-                        </syspropertyset>
-                    </customize2>
-                </webproject2:testng-debug-impl>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
-    <target name="-init-macrodef-java">
-        <macrodef name="java" uri="http://www.netbeans.org/ns/web-project/1">
-            <attribute default="${main.class}" name="classname"/>
-            <attribute default="${debug.classpath}" name="classpath"/>
-            <element name="customize" optional="true"/>
-            <sequential>
-                <java classname="@{classname}" fork="true">
-                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
-                    <jvmarg line="${runmain.jvmargs}"/>
-                    <classpath>
-                        <path path="@{classpath}:${j2ee.platform.classpath}"/>
-                    </classpath>
-                    <syspropertyset>
-                        <propertyref prefix="run-sys-prop."/>
-                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
-                    </syspropertyset>
-                    <customize/>
-                </java>
-            </sequential>
-        </macrodef>
-    </target>
-    <target name="-init-macrodef-nbjsdebug">
-        <macrodef name="nbjsdebugstart" uri="http://www.netbeans.org/ns/web-project/1">
-            <attribute default="${client.url}" name="webUrl"/>
-            <sequential>
-                <nbjsdebugstart urlPart="${client.urlPart}" webUrl="@{webUrl}"/>
-            </sequential>
-        </macrodef>
-    </target>
-    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
-        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/web-project/1">
-            <attribute default="${main.class}" name="name"/>
-            <attribute default="${debug.classpath}:${j2ee.platform.classpath}" name="classpath"/>
-            <sequential>
-                <nbjpdastart addressproperty="jpda.address" name="@{name}" transport="${debug-transport}">
-                    <classpath>
-                        <path path="@{classpath}"/>
-                    </classpath>
-                </nbjpdastart>
-            </sequential>
-        </macrodef>
-        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/web-project/1">
-            <attribute default="${build.classes.dir}" name="dir"/>
-            <sequential>
-                <nbjpdareload>
-                    <fileset dir="@{dir}" includes="${fix.classes}">
-                        <include name="${fix.includes}*.class"/>
-                    </fileset>
-                </nbjpdareload>
-            </sequential>
-        </macrodef>
-        <macrodef name="nbjpdaappreloaded" uri="http://www.netbeans.org/ns/web-project/1">
-            <sequential>
-                <nbjpdaappreloaded/>
-            </sequential>
-        </macrodef>
-    </target>
-    <target name="-init-debug-args">
-        <property name="version-output" value="java version &quot;${ant.java.version}"/>
-        <condition property="have-jdk-older-than-1.4">
-            <or>
-                <contains string="${version-output}" substring="java version &quot;1.0"/>
-                <contains string="${version-output}" substring="java version &quot;1.1"/>
-                <contains string="${version-output}" substring="java version &quot;1.2"/>
-                <contains string="${version-output}" substring="java version &quot;1.3"/>
-            </or>
-        </condition>
-        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
-            <istrue value="${have-jdk-older-than-1.4}"/>
-        </condition>
-        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
-            <os family="windows"/>
-        </condition>
-        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
-            <isset property="debug.transport"/>
-        </condition>
-    </target>
-    <target depends="-init-debug-args" name="-init-macrodef-debug">
-        <macrodef name="debug" uri="http://www.netbeans.org/ns/web-project/1">
-            <attribute default="${main.class}" name="classname"/>
-            <attribute default="${debug.classpath}:${j2ee.platform.classpath}" name="classpath"/>
-            <attribute default="${application.args.param}" name="args"/>
-            <element name="customize" optional="true"/>
-            <sequential>
-                <java classname="@{classname}" fork="true">
-                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
-                    <jvmarg line="${debug-args-line}"/>
-                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
-                    <jvmarg line="${runmain.jvmargs}"/>
-                    <classpath>
-                        <path path="@{classpath}"/>
-                    </classpath>
-                    <syspropertyset>
-                        <propertyref prefix="run-sys-prop."/>
-                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
-                    </syspropertyset>
-                    <arg line="@{args}"/>
-                    <customize/>
-                </java>
-            </sequential>
-        </macrodef>
-    </target>
-    <target name="-init-taskdefs">
-        <fail unless="libs.CopyLibs.classpath">
-The libs.CopyLibs.classpath property is not set up.
-This property must point to 
-org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part
-of NetBeans IDE installation and is usually located at 
-&lt;netbeans_installation&gt;/java&lt;version&gt;/ant/extra folder.
-Either open the project in the IDE and make sure CopyLibs library
-exists or setup the property manually. For example like this:
- ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar
-                </fail>
-        <taskdef classpath="${libs.CopyLibs.classpath}" resource="org/netbeans/modules/java/j2seproject/copylibstask/antlib.xml"/>
-    </target>
-    <target name="-init-ap-cmdline-properties">
-        <property name="annotation.processing.enabled" value="true"/>
-        <property name="annotation.processing.processors.list" value=""/>
-        <property name="annotation.processing.run.all.processors" value="true"/>
-        <property name="javac.processorpath" value="${javac.classpath}"/>
-        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
-        <condition property="ap.supported.internal" value="true">
-            <not>
-                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
-            </not>
-        </condition>
-    </target>
-    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
-        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
-            <isfalse value="${annotation.processing.run.all.processors}"/>
-        </condition>
-        <condition else="" property="ap.proc.none.internal" value="-proc:none">
-            <isfalse value="${annotation.processing.enabled}"/>
-        </condition>
-    </target>
-    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
-        <property name="ap.cmd.line.internal" value=""/>
-    </target>
-    <!--
-                pre NB7.2 profiling section; consider it deprecated
-            -->
-    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
-    <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="-profile-pre-init, init, -profile-post-init" if="profiler.info.jvmargs.agent" name="-profile-init-check">
-        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
-        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
-    </target>
-    <!--
-                end of pre NB7.2 profiling section
-            -->
-    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-java,-init-macrodef-nbjpda,-init-macrodef-nbjsdebug,-init-macrodef-debug,-init-taskdefs,-init-ap-cmdline" name="init"/>
-    <!--
-                COMPILATION SECTION
-            -->
-    <target depends="init" if="no.dist.ear.dir" name="deps-module-jar" unless="no.deps">
-        <ant antfile="${project.csip-core}/build.xml" inheritall="false" target="jar">
-            <property name="deploy.on.save" value="false"/>
-        </ant>
-    </target>
-    <target depends="init" if="dist.ear.dir" name="deps-ear-jar" unless="no.deps">
-        <ant antfile="${project.csip-core}/build.xml" inheritall="false" target="jar">
-            <property name="deploy.on.save" value="false"/>
-        </ant>
-    </target>
-    <target depends="init, deps-module-jar, deps-ear-jar" name="deps-jar" unless="no.deps"/>
-    <target depends="init,deps-jar,generate-rest-config" name="-pre-pre-compile">
-        <mkdir dir="${build.classes.dir}"/>
-    </target>
-    <target name="-pre-compile">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target name="-copy-webdir">
-        <copy todir="${build.web.dir}">
-            <fileset dir="${web.docbase.dir}" excludes="${build.web.excludes},${excludes}" includes="${includes}"/>
-        </copy>
-        <copy todir="${build.web.dir}/WEB-INF">
-            <fileset dir="${webinf.dir}" excludes="${build.web.excludes}"/>
-        </copy>
-    </target>
-    <target depends="init, deps-jar, -pre-pre-compile, -pre-compile, -copy-manifest, -copy-persistence-xml, -copy-webdir, library-inclusion-in-archive,library-inclusion-in-manifest" if="have.sources" name="-do-compile">
-        <webproject2:javac destdir="${build.classes.dir}" gensrcdir="${build.generated.sources.dir}"/>
-        <copy todir="${build.classes.dir}">
-            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-        </copy>
-    </target>
-    <target if="has.custom.manifest" name="-copy-manifest">
-        <mkdir dir="${build.meta.inf.dir}"/>
-        <copy todir="${build.meta.inf.dir}">
-            <fileset dir="${conf.dir}" includes="MANIFEST.MF"/>
-        </copy>
-    </target>
-    <target if="has.persistence.xml" name="-copy-persistence-xml">
-        <mkdir dir="${build.web.dir}/WEB-INF/classes/META-INF"/>
-        <copy todir="${build.web.dir}/WEB-INF/classes/META-INF">
-            <fileset dir="${persistence.xml.dir}" includes="persistence.xml orm.xml"/>
-        </copy>
-    </target>
-    <target name="-post-compile">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
-    <target name="-pre-compile-single">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
-        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
-        <webproject2:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}"/>
-        <copy todir="${build.classes.dir}">
-            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-        </copy>
-    </target>
-    <target name="-post-compile-single">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
-    <property name="jspc.schemas" value="/resources/schemas/"/>
-    <property name="jspc.dtds" value="/resources/dtds/"/>
-    <target depends="compile" description="Test compile JSP pages to expose compilation errors." if="do.compile.jsps" name="compile-jsps">
-        <mkdir dir="${build.generated.dir}/src"/>
-        <java classname="org.netbeans.modules.web.project.ant.JspC" failonerror="true" fork="true">
-            <arg value="-uriroot"/>
-            <arg file="${basedir}/${build.web.dir}"/>
-            <arg value="-d"/>
-            <arg file="${basedir}/${build.generated.dir}/src"/>
-            <arg value="-die1"/>
-            <arg value="-schemas ${jspc.schemas}"/>
-            <arg value="-dtds ${jspc.dtds}"/>
-            <arg value="-compilerSourceVM ${javac.source}"/>
-            <arg value="-compilerTargetVM ${javac.target}"/>
-            <arg value="-javaEncoding ${source.encoding}"/>
-            <arg value="-sysClasspath ${libs.jsp-compilation-syscp.classpath}"/>
-            <classpath path="${java.home}/../lib/tools.jar:${libs.jsp-compiler.classpath}:${libs.jsp-compilation.classpath}"/>
-        </java>
-        <mkdir dir="${build.generated.dir}/classes"/>
-        <webproject2:javac classpath="${build.classes.dir}:${libs.jsp-compilation.classpath}:${javac.classpath}:${j2ee.platform.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src"/>
-    </target>
-    <target depends="compile" if="jsp.includes" name="-do-compile-single-jsp">
-        <fail unless="javac.jsp.includes">Must select some files in the IDE or set javac.jsp.includes</fail>
-        <mkdir dir="${build.generated.dir}/src"/>
-        <java classname="org.netbeans.modules.web.project.ant.JspCSingle" failonerror="true" fork="true">
-            <arg value="-uriroot"/>
-            <arg file="${basedir}/${build.web.dir}"/>
-            <arg value="-d"/>
-            <arg file="${basedir}/${build.generated.dir}/src"/>
-            <arg value="-die1"/>
-            <arg value="-schemas ${jspc.schemas}"/>
-            <arg value="-dtds ${jspc.dtds}"/>
-            <arg value="-sysClasspath ${libs.jsp-compilation-syscp.classpath}"/>
-            <arg value="-jspc.files"/>
-            <arg path="${jsp.includes}"/>
-            <arg value="-compilerSourceVM ${javac.source}"/>
-            <arg value="-compilerTargetVM ${javac.target}"/>
-            <arg value="-javaEncoding ${source.encoding}"/>
-            <classpath path="${java.home}/../lib/tools.jar:${libs.jsp-compiler.classpath}:${libs.jsp-compilation.classpath}"/>
-        </java>
-        <mkdir dir="${build.generated.dir}/classes"/>
-        <webproject2:javac classpath="${build.classes.dir}:${libs.jsp-compilation.classpath}:${javac.classpath}:${j2ee.platform.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src">
-            <customize>
-                <patternset includes="${javac.jsp.includes}"/>
-            </customize>
-        </webproject2:javac>
-    </target>
-    <target name="compile-single-jsp">
-        <fail unless="jsp.includes">Must select a file in the IDE or set jsp.includes</fail>
-        <antcall target="-do-compile-single-jsp"/>
-    </target>
-    <!--
-                DIST BUILDING SECTION
-            -->
-    <target name="-pre-dist">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.without.custom.manifest" name="-do-dist-without-manifest">
-        <dirname file="${dist.war}" property="dist.jar.dir"/>
-        <mkdir dir="${dist.jar.dir}"/>
-        <jar compress="${jar.compress}" jarfile="${dist.war}">
-            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
-        </jar>
-    </target>
-    <target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.with.custom.manifest" name="-do-dist-with-manifest">
-        <dirname file="${dist.war}" property="dist.jar.dir"/>
-        <mkdir dir="${dist.jar.dir}"/>
-        <jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
-            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
-        </jar>
-    </target>
-    <target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.without.custom.manifest" name="-do-tmp-dist-without-manifest">
-        <dirname file="${dist.war}" property="dist.jar.dir"/>
-        <mkdir dir="${dist.jar.dir}"/>
-        <jar compress="${jar.compress}" jarfile="${dist.war}">
-            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
-        </jar>
-    </target>
-    <target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.with.custom.manifest" name="-do-tmp-dist-with-manifest">
-        <dirname file="${dist.war}" property="dist.jar.dir"/>
-        <mkdir dir="${dist.jar.dir}"/>
-        <jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
-            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
-        </jar>
-    </target>
-    <target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/>
-    <target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest">
-        <copyfiles files="${libs.CSIP-Jersey-2.16.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
-        <copyfiles files="${reference.csip-core.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
-        <copyfiles files="${file.reference.commons-math-2.0.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
-        <copyfiles files="${file.reference.jcommon-1.0.16.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
-        <copyfiles files="${file.reference.jfreechart-1.0.13.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
-        <copyfiles files="${file.reference.Jama-1.0.2.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
-        <mkdir dir="${build.web.dir}/META-INF"/>
-        <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
-    </target>
-    <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
-        <copyfiles files="${libs.CSIP-Jersey-2.16.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
-        <copyfiles files="${reference.csip-core.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
-        <copyfiles files="${file.reference.commons-math-2.0.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
-        <copyfiles files="${file.reference.jcommon-1.0.16.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
-        <copyfiles files="${file.reference.jfreechart-1.0.13.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
-        <copyfiles files="${file.reference.Jama-1.0.2.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
-    </target>
-    <target depends="init" if="dist.ear.dir" name="-clean-webinf-lib">
-        <delete dir="${build.web.dir}/WEB-INF/lib"/>
-    </target>
-    <target depends="init,-clean-webinf-lib,compile,compile-jsps,-pre-dist,library-inclusion-in-manifest" if="do.tmp.war.package" name="do-ear-dist">
-        <dirname file="${dist.ear.war}" property="dist.jar.dir"/>
-        <mkdir dir="${dist.jar.dir}"/>
-        <jar compress="${jar.compress}" jarfile="${dist.ear.war}" manifest="${build.web.dir}/META-INF/MANIFEST.MF">
-            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
-        </jar>
-    </target>
-    <target name="-post-dist">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,compile,-pre-dist,do-dist,-post-dist" description="Build distribution (WAR)." name="dist"/>
-    <target depends="init,-clean-webinf-lib,-init-cos,compile,-pre-dist,do-ear-dist,-post-dist" description="Build distribution (WAR) to be packaged into an EAR." name="dist-ear"/>
-    <!--
-                EXECUTION SECTION
-            -->
-    <target depends="run-deploy,run-display-browser" description="Deploy to server and show in browser." name="run"/>
-    <target name="-pre-run-deploy">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target name="-post-run-deploy">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target name="-pre-nbmodule-run-deploy">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -pre-run-deploy task instead. -->
-    </target>
-    <target name="-post-nbmodule-run-deploy">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -post-run-deploy task instead. -->
-    </target>
-    <target name="-run-deploy-am">
-        <!-- Task to deploy to the Access Manager runtime. -->
-    </target>
-    <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest,-pre-run-deploy,-pre-nbmodule-run-deploy,-run-deploy-nb,-init-deploy-ant,-deploy-ant,-run-deploy-am,-post-nbmodule-run-deploy,-post-run-deploy,-do-update-breakpoints" name="run-deploy"/>
-    <target if="netbeans.home" name="-run-deploy-nb">
-        <nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
-    </target>
-    <target name="-init-deploy-ant" unless="netbeans.home">
-        <property name="deploy.ant.archive" value="${dist.war}"/>
-        <property name="deploy.ant.docbase.dir" value="${web.docbase.dir}"/>
-        <property name="deploy.ant.resource.dir" value="${resource.dir}"/>
-        <property name="deploy.ant.enabled" value="true"/>
-    </target>
-    <target depends="dist,-run-undeploy-nb,-init-deploy-ant,-undeploy-ant" name="run-undeploy"/>
-    <target if="netbeans.home" name="-run-undeploy-nb">
-        <fail message="Undeploy is not supported from within the IDE"/>
-    </target>
-    <target depends="init,-pre-dist,dist,-post-dist" name="verify">
-        <nbverify file="${dist.war}"/>
-    </target>
-    <target depends="run-deploy,-init-display-browser,-display-browser-nb-old,-display-browser-nb,-display-browser-cl" name="run-display-browser"/>
-    <target if="do.display.browser" name="-init-display-browser">
-        <condition property="do.display.browser.nb.old">
-            <and>
-                <isset property="netbeans.home"/>
-                <not>
-                    <isset property="browser.context"/>
-                </not>
-            </and>
-        </condition>
-        <condition property="do.display.browser.nb">
-            <and>
-                <isset property="netbeans.home"/>
-                <isset property="browser.context"/>
-            </and>
-        </condition>
-        <condition property="do.display.browser.cl">
-            <isset property="deploy.ant.enabled"/>
-        </condition>
-    </target>
-    <target if="do.display.browser.nb.old" name="-display-browser-nb-old">
-        <nbbrowse url="${client.url}"/>
-    </target>
-    <target if="do.display.browser.nb" name="-display-browser-nb">
-        <nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
-    </target>
-    <target if="do.display.browser.cl" name="-get-browser" unless="browser">
-        <condition property="browser" value="rundll32">
-            <os family="windows"/>
-        </condition>
-        <condition else="" property="browser.args" value="url.dll,FileProtocolHandler">
-            <os family="windows"/>
-        </condition>
-        <condition property="browser" value="/usr/bin/open">
-            <os family="mac"/>
-        </condition>
-        <property environment="env"/>
-        <condition property="browser" value="${env.BROWSER}">
-            <isset property="env.BROWSER"/>
-        </condition>
-        <condition property="browser" value="/usr/bin/firefox">
-            <available file="/usr/bin/firefox"/>
-        </condition>
-        <condition property="browser" value="/usr/local/firefox/firefox">
-            <available file="/usr/local/firefox/firefox"/>
-        </condition>
-        <condition property="browser" value="/usr/bin/mozilla">
-            <available file="/usr/bin/mozilla"/>
-        </condition>
-        <condition property="browser" value="/usr/local/mozilla/mozilla">
-            <available file="/usr/local/mozilla/mozilla"/>
-        </condition>
-        <condition property="browser" value="/usr/sfw/lib/firefox/firefox">
-            <available file="/usr/sfw/lib/firefox/firefox"/>
-        </condition>
-        <condition property="browser" value="/opt/csw/bin/firefox">
-            <available file="/opt/csw/bin/firefox"/>
-        </condition>
-        <condition property="browser" value="/usr/sfw/lib/mozilla/mozilla">
-            <available file="/usr/sfw/lib/mozilla/mozilla"/>
-        </condition>
-        <condition property="browser" value="/opt/csw/bin/mozilla">
-            <available file="/opt/csw/bin/mozilla"/>
-        </condition>
-    </target>
-    <target depends="-get-browser" if="do.display.browser.cl" name="-display-browser-cl">
-        <fail unless="browser">
-                    Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable.
-                </fail>
-        <property name="browse.url" value="${deploy.ant.client.url}${client.urlPart}"/>
-        <echo>Launching ${browse.url}</echo>
-        <exec executable="${browser}" spawn="true">
-            <arg line="${browser.args} ${browse.url}"/>
-        </exec>
-    </target>
-    <target depends="init,-init-cos,compile-single" name="run-main">
-        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
-        <webproject1:java classname="${run.class}"/>
-    </target>
-    <target depends="init,compile-test-single,-pre-test-run-single" name="run-test-with-main">
-        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
-        <webproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
-    </target>
-    <target depends="init" if="netbeans.home" name="-do-update-breakpoints">
-        <webproject1:nbjpdaappreloaded/>
-    </target>
-    <!--
-                DEBUGGING SECTION
-            -->
-    <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest" description="Debug project in IDE." if="netbeans.home" name="debug">
-        <nbstartserver debugmode="true"/>
-        <antcall target="connect-debugger"/>
-        <nbdeploy clientUrlPart="${client.urlPart}" debugmode="true" forceRedeploy="true"/>
-        <antcall target="debug-display-browser-old"/>
-        <antcall target="debug-display-browser"/>
-        <antcall target="connect-client-debugger"/>
-    </target>
-    <target if="do.debug.server" name="connect-debugger" unless="is.debugged">
-        <condition property="listeningcp" value="sourcepath">
-            <istrue value="${j2ee.compile.on.save}"/>
-        </condition>
-        <nbjpdaconnect address="${jpda.address}" host="${jpda.host}" listeningcp="${listeningcp}" name="${name}" transport="${jpda.transport}">
-            <classpath>
-                <path path="${debug.classpath}:${j2ee.platform.classpath}"/>
-            </classpath>
-            <sourcepath>
-                <path path="${web.docbase.dir}"/>
-            </sourcepath>
-        </nbjpdaconnect>
-    </target>
-    <target if="do.display.browser.debug.old" name="debug-display-browser-old">
-        <nbbrowse url="${client.url}"/>
-    </target>
-    <target if="do.display.browser.debug" name="debug-display-browser">
-        <nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
-    </target>
-    <target if="do.debug.client" name="connect-client-debugger">
-        <webproject1:nbjsdebugstart webUrl="${client.url}"/>
-    </target>
-    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
-        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
-        <webproject1:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
-    </target>
-    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
-    <target depends="init,compile,compile-jsps,-do-compile-single-jsp,debug" if="netbeans.home" name="debug-single"/>
-    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
-        <webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
-    </target>
-    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
-        <webproject1:nbjpdastart name="${debug.class}"/>
-    </target>
-    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
-        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
-        <webproject1:debug classname="${debug.class}"/>
-    </target>
-    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single-main"/>
-    <target depends="init" name="-pre-debug-fix">
-        <fail unless="fix.includes">Must set fix.includes</fail>
-        <property name="javac.includes" value="${fix.includes}.java"/>
-    </target>
-    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
-        <webproject1:nbjpdareload/>
-    </target>
-    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
-    <!--
-            =================
-            PROFILING SECTION
-            =================
-            -->
-    <!--
-                pre NB7.2 profiling section; consider it deprecated
-            -->
-    <target description="Profile a J2EE project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
-        <condition else="start-profiled-server" property="profiler.startserver.target" value="start-profiled-server-extraargs">
-            <isset property="profiler.info.jvmargs.extra"/>
-        </condition>
-        <antcall target="${profiler.startserver.target}"/>
-        <antcall target="run"/>
-        <antcall target="-profile-start-loadgen"/>
-    </target>
-    <target if="profiler.info.jvmargs.agent" name="start-profiled-server">
-        <nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}">
-            <jvmarg value="${profiler.info.jvmargs.agent}"/>
-            <jvmarg value="${profiler.j2ee.agentID}"/>
-        </nbstartprofiledserver>
-    </target>
-    <target if="profiler.info.jvmargs.agent" name="start-profiled-server-extraargs">
-        <nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}">
-            <jvmarg value="${profiler.info.jvmargs.extra}"/>
-            <jvmarg value="${profiler.info.jvmargs.agent}"/>
-            <jvmarg value="${profiler.j2ee.agentID}"/>
-        </nbstartprofiledserver>
-    </target>
-    <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
-        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
-        <nbprofiledirect>
-            <classpath>
-                <path path="${run.test.classpath}"/>
-                <path path="${j2ee.platform.classpath}"/>
-            </classpath>
-        </nbprofiledirect>
-        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
-            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
-            <jvmarg value="${profiler.info.jvmargs.agent}"/>
-            <jvmarg line="${profiler.info.jvmargs}"/>
-            <test name="${profile.class}"/>
-            <classpath>
-                <path path="${run.test.classpath}"/>
-                <path path="${j2ee.platform.classpath}"/>
-            </classpath>
-            <syspropertyset>
-                <propertyref prefix="test-sys-prop."/>
-                <mapper from="test-sys-prop.*" to="*" type="glob"/>
-            </syspropertyset>
-            <formatter type="brief" usefile="false"/>
-            <formatter type="xml"/>
-        </junit>
-    </target>
-    <target if="netbeans.home" name="-profile-check">
-        <condition property="profiler.configured">
-            <or>
-                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
-                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
-            </or>
-        </condition>
-    </target>
-    <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest" name="-do-profile">
-        <startprofiler/>
-        <nbstartserver profilemode="true"/>
-        <nbdeploy clientUrlPart="${client.urlPart}" forceRedeploy="true" profilemode="true"/>
-        <antcall target="debug-display-browser-old"/>
-        <antcall target="debug-display-browser"/>
-        <antcall target="-profile-start-loadgen"/>
-    </target>
-    <target depends="-profile-check,-profile-pre72" description="Profile a J2EE project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
-        <antcall target="-do-profile"/>
-    </target>
-    <target depends="-profile-test-single-pre72" name="profile-test-single"/>
-    <target depends="-profile-check" if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs.agent">
-        <startprofiler/>
-        <antcall target="test-single"/>
-    </target>
-    <target if="profiler.loadgen.path" name="-profile-start-loadgen">
-        <loadgenstart path="${profiler.loadgen.path}"/>
-    </target>
-    <!--
-                JAVADOC SECTION
-            -->
-    <target depends="init" if="have.sources" name="javadoc-build">
-        <mkdir dir="${dist.javadoc.dir}"/>
-        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
-            <classpath>
-                <path path="${javac.classpath}:${j2ee.platform.classpath}"/>
-            </classpath>
-            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/*.java"/>
-            </fileset>
-            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
-                <include name="**/*.java"/>
-            </fileset>
-        </javadoc>
-        <copy todir="${dist.javadoc.dir}">
-            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
-                <filename name="**/doc-files/**"/>
-            </fileset>
-            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
-                <include name="**/doc-files/**"/>
-            </fileset>
-        </copy>
-    </target>
-    <target depends="init,javadoc-build" if="netbeans.home" name="javadoc-browse" unless="no.javadoc.preview">
-        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
-    </target>
-    <target depends="init,javadoc-build,javadoc-browse" description="Build Javadoc." name="javadoc"/>
-    <!--
-                
-                TEST COMPILATION SECTION
-            -->
-    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
-        <mkdir dir="${build.test.classes.dir}"/>
-        <property name="j2ee.platform.embeddableejb.classpath" value=""/>
-    </target>
-    <target name="-pre-compile-test">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test" if="have.tests" name="-do-compile-test">
-        <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
-        <copy todir="${build.test.classes.dir}">
-            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-        </copy>
-    </target>
-    <target name="-post-compile-test">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
-    <target name="-pre-compile-test-single">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
-        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
-        <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" srcdir="${test.src.dir}"/>
-        <copy todir="${build.test.classes.dir}">
-            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-        </copy>
-    </target>
-    <target name="-post-compile-test-single">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
-    <!--
-                
-                TEST EXECUTION SECTION
-            -->
-    <target depends="init" if="have.tests" name="-pre-test-run">
-        <mkdir dir="${build.test.results.dir}"/>
-    </target>
-    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
-        <webproject2:test includes="${includes}" testincludes="**/*Test.java"/>
-    </target>
-    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
-        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
-    </target>
-    <target depends="init" if="have.tests" name="test-report"/>
-    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
-    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
-    <target depends="init" if="have.tests" name="-pre-test-run-single">
-        <mkdir dir="${build.test.results.dir}"/>
-    </target>
-    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
-        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
-        <webproject2:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
-    </target>
-    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
-        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
-    </target>
-    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
-    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
-        <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
-        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
-        <webproject2:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
-    </target>
-    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
-        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
-    </target>
-    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
-    <!--
-                
-                TEST DEBUGGING SECTION
-            -->
-    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
-        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
-        <webproject2:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
-    </target>
-    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
-        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
-        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
-        <webproject2:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
-    </target>
-    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
-        <webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
-    </target>
-    <target depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
-    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
-    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
-        <webproject1:nbjpdareload dir="${build.test.classes.dir}"/>
-    </target>
-    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
-    <!--
-                
-                CLEANUP SECTION
-            -->
-    <target depends="init" name="deps-clean" unless="no.deps">
-        <ant antfile="${project.csip-core}/build.xml" inheritall="false" target="clean"/>
-    </target>
-    <target depends="init" name="do-clean">
-        <condition property="build.dir.to.clean" value="${build.web.dir}">
-            <isset property="dist.ear.dir"/>
-        </condition>
-        <property name="build.dir.to.clean" value="${build.web.dir}"/>
-        <delete includeEmptyDirs="true" quiet="true">
-            <fileset dir="${build.dir.to.clean}/WEB-INF/lib"/>
-        </delete>
-        <delete dir="${build.dir}"/>
-        <available file="${build.dir.to.clean}/WEB-INF/lib" property="status.clean-failed" type="dir"/>
-        <delete dir="${dist.dir}"/>
-    </target>
-    <target depends="do-clean" if="status.clean-failed" name="check-clean">
-        <echo message="Warning: unable to delete some files in ${build.web.dir}/WEB-INF/lib - they are probably locked by the J2EE server. "/>
-        <echo level="info" message="To delete all files undeploy the module from Server Registry in Runtime tab and then use Clean again."/>
-    </target>
-    <target depends="init" if="netbeans.home" name="undeploy-clean">
-        <nbundeploy failOnError="false" startServer="false"/>
-    </target>
-    <target name="-post-clean">
-        <!-- Empty placeholder for easier customization. -->
-        <!-- You can override this target in the ../build.xml file. -->
-    </target>
-    <target depends="init,undeploy-clean,deps-clean,do-clean,check-clean,-post-clean" description="Clean build products." name="clean"/>
-    <target depends="clean" description="Clean build products." name="clean-ear"/>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+        *** GENERATED FROM project.xml - DO NOT EDIT  ***
+        ***         EDIT ../build.xml INSTEAD         ***
+
+        For the purpose of easier reading the script
+        is divided into following sections:
+        - initialization
+        - compilation
+        - dist
+        - execution
+        - debugging
+        - javadoc
+        - test compilation
+        - test execution
+        - test debugging
+        - cleanup
+
+        -->
+<project xmlns:webproject1="http://www.netbeans.org/ns/web-project/1" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" basedir=".." default="default" name="csip-cfa-impl">
+    <import file="rest-build.xml"/>
+    <import file="ant-deploy.xml"/>
+    <fail message="Please build using Ant 1.7.1 or higher.">
+        <condition>
+            <not>
+                <antversion atleast="1.7.1"/>
+            </not>
+        </condition>
+    </fail>
+    <target depends="dist,javadoc" description="Build whole project." name="default"/>
+    <!--
+                INITIALIZATION SECTION
+            -->
+    <target name="-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init" name="-init-private">
+        <property file="nbproject/private/private.properties"/>
+    </target>
+    <target depends="-pre-init,-init-private" name="-init-user">
+        <property file="${user.properties.file}"/>
+        <!-- The two properties below are usually overridden -->
+        <!-- by the active platform. Just a fallback. -->
+        <property name="default.javac.source" value="1.4"/>
+        <property name="default.javac.target" value="1.4"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user" name="-init-project">
+        <property file="nbproject/project.properties"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" if="dist.ear.dir" name="-do-ear-init"/>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
+        <condition property="have.tests">
+            <or>
+                <available file="${test.src.dir}"/>
+            </or>
+        </condition>
+        <condition property="have.sources">
+            <or>
+                <available file="${src.dir}"/>
+            </or>
+        </condition>
+        <condition property="netbeans.home+have.tests">
+            <and>
+                <isset property="netbeans.home"/>
+                <isset property="have.tests"/>
+            </and>
+        </condition>
+        <condition property="no.javadoc.preview">
+            <isfalse value="${javadoc.preview}"/>
+        </condition>
+        <property name="javac.compilerargs" value=""/>
+        <condition property="no.deps">
+            <and>
+                <istrue value="${no.dependencies}"/>
+            </and>
+        </condition>
+        <condition property="no.dist.ear.dir">
+            <not>
+                <isset property="dist.ear.dir"/>
+            </not>
+        </condition>
+        <property name="build.web.excludes" value="${build.classes.excludes}"/>
+        <condition property="do.compile.jsps">
+            <istrue value="${compile.jsps}"/>
+        </condition>
+        <condition property="do.debug.server">
+            <or>
+                <not>
+                    <isset property="debug.server"/>
+                </not>
+                <istrue value="${debug.server}"/>
+                <and>
+                    <not>
+                        <istrue value="${debug.server}"/>
+                    </not>
+                    <not>
+                        <istrue value="${debug.client}"/>
+                    </not>
+                </and>
+            </or>
+        </condition>
+        <condition property="do.debug.client">
+            <istrue value="${debug.client}"/>
+        </condition>
+        <condition property="do.display.browser">
+            <istrue value="${display.browser}"/>
+        </condition>
+        <condition property="do.display.browser.debug.old">
+            <and>
+                <isset property="do.display.browser"/>
+                <not>
+                    <isset property="do.debug.client"/>
+                </not>
+                <not>
+                    <isset property="browser.context"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="do.display.browser.debug">
+            <and>
+                <isset property="do.display.browser"/>
+                <not>
+                    <isset property="do.debug.client"/>
+                </not>
+                <isset property="browser.context"/>
+            </and>
+        </condition>
+        <available file="${conf.dir}/MANIFEST.MF" property="has.custom.manifest"/>
+        <available file="${persistence.xml.dir}/persistence.xml" property="has.persistence.xml"/>
+        <condition property="do.war.package.with.custom.manifest">
+            <isset property="has.custom.manifest"/>
+        </condition>
+        <condition property="do.war.package.without.custom.manifest">
+            <not>
+                <isset property="has.custom.manifest"/>
+            </not>
+        </condition>
+        <condition property="do.tmp.war.package.with.custom.manifest">
+            <and>
+                <isset property="has.custom.manifest"/>
+                <or>
+                    <isfalse value="${directory.deployment.supported}"/>
+                    <isset property="dist.ear.dir"/>
+                </or>
+            </and>
+        </condition>
+        <condition property="do.tmp.war.package.without.custom.manifest">
+            <and>
+                <not>
+                    <isset property="has.custom.manifest"/>
+                </not>
+                <or>
+                    <isfalse value="${directory.deployment.supported}"/>
+                    <isset property="dist.ear.dir"/>
+                </or>
+            </and>
+        </condition>
+        <condition property="do.tmp.war.package">
+            <or>
+                <isfalse value="${directory.deployment.supported}"/>
+                <isset property="dist.ear.dir"/>
+            </or>
+        </condition>
+        <property name="build.meta.inf.dir" value="${build.web.dir}/META-INF"/>
+        <condition else="" property="application.args.param" value="${application.args}">
+            <and>
+                <isset property="application.args"/>
+                <not>
+                    <equals arg1="${application.args}" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+        <property name="source.encoding" value="${file.encoding}"/>
+        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
+            <and>
+                <isset property="javadoc.encoding"/>
+                <not>
+                    <equals arg1="${javadoc.encoding}" arg2=""/>
+                </not>
+            </and>
+        </condition>
+        <property name="javadoc.encoding.used" value="${source.encoding}"/>
+        <property name="includes" value="**"/>
+        <property name="excludes" value=""/>
+        <property name="runmain.jvmargs" value=""/>
+        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
+        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
+            <and>
+                <isset property="endorsed.classpath"/>
+                <length length="0" string="${endorsed.classpath}" when="greater"/>
+            </and>
+        </condition>
+        <condition else="false" property="jdkBug6558476">
+            <and>
+                <matches pattern="1\.[56]" string="${java.specification.version}"/>
+                <not>
+                    <os family="unix"/>
+                </not>
+            </and>
+        </condition>
+        <property name="javac.fork" value="${jdkBug6558476}"/>
+        <condition property="junit.available">
+            <or>
+                <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
+                <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
+            </or>
+        </condition>
+        <condition property="testng.available">
+            <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
+        </condition>
+        <condition property="junit+testng.available">
+            <and>
+                <istrue value="${junit.available}"/>
+                <istrue value="${testng.available}"/>
+            </and>
+        </condition>
+        <condition else="testng" property="testng.mode" value="mixed">
+            <istrue value="${junit+testng.available}"/>
+        </condition>
+        <condition else="" property="testng.debug.mode" value="-mixed">
+            <istrue value="${junit+testng.available}"/>
+        </condition>
+    </target>
+    <target depends="init" name="-init-cos" unless="deploy.on.save">
+        <condition property="deploy.on.save" value="true">
+            <or>
+                <istrue value="${j2ee.deploy.on.save}"/>
+                <istrue value="${j2ee.compile.on.save}"/>
+            </or>
+        </condition>
+    </target>
+    <target name="-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
+        <fail unless="src.dir">Must set src.dir</fail>
+        <fail unless="test.src.dir">Must set test.src.dir</fail>
+        <fail unless="build.dir">Must set build.dir</fail>
+        <fail unless="build.web.dir">Must set build.web.dir</fail>
+        <fail unless="build.generated.dir">Must set build.generated.dir</fail>
+        <fail unless="dist.dir">Must set dist.dir</fail>
+        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
+        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
+        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
+        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
+        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
+        <fail unless="dist.war">Must set dist.war</fail>
+        <condition property="missing.j2ee.server.home">
+            <and>
+                <matches pattern="j2ee.server.home" string="${j2ee.platform.classpath}"/>
+                <not>
+                    <isset property="j2ee.server.home"/>
+                </not>
+            </and>
+        </condition>
+        <fail if="missing.j2ee.server.home">
+The Java EE server classpath is not correctly set up - server home directory is missing.
+Either open the project in the IDE and assign the server or setup the server classpath manually.
+For example like this:
+   ant -Dj2ee.server.home=&lt;app_server_installation_directory&gt;
+                </fail>
+        <fail unless="j2ee.platform.classpath">
+The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}.
+Either open the project in the IDE and assign the server or setup the server classpath manually.
+For example like this:
+   ant -Duser.properties.file=&lt;path_to_property_file&gt; (where you put the property "j2ee.platform.classpath" in a .properties file)
+or ant -Dj2ee.platform.classpath=&lt;server_classpath&gt; (where no properties file is used)
+                </fail>
+    </target>
+    <target name="-init-macrodef-property">
+        <macrodef name="property" uri="http://www.netbeans.org/ns/web-project/1">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${@{value}}"/>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <mkdir dir="@{apgeneratedsrcdir}"/>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" srcdir="@{srcdir}" target="${javac.target}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <compilerarg value="-processorpath"/>
+                    <compilerarg path="@{processorpath}:${empty.dir}"/>
+                    <compilerarg line="${ap.processors.internal}"/>
+                    <compilerarg value="-s"/>
+                    <compilerarg path="@{apgeneratedsrcdir}"/>
+                    <compilerarg line="${ap.proc.none.internal}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" srcdir="@{srcdir}" target="${javac.target}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
+        <macrodef name="depend" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
+            <sequential>
+                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </depend>
+            </sequential>
+        </macrodef>
+        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <sequential>
+                <fail unless="javac.includes">Must set javac.includes</fail>
+                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
+                    <path>
+                        <filelist dir="@{destdir}" files="${javac.includes}"/>
+                    </path>
+                    <globmapper from="*.java" to="*.class"/>
+                </pathconvert>
+                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
+                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
+                <delete>
+                    <files includesfile="${javac.includesfile.binary}"/>
+                </delete>
+                <delete file="${javac.includesfile.binary}"/>
+            </sequential>
+        </macrodef>
+    </target>
+    <target if="${junit.available}" name="-init-macrodef-junit-init">
+        <condition else="false" property="nb.junit.batch" value="true">
+            <and>
+                <istrue value="${junit.available}"/>
+                <not>
+                    <isset property="test.method"/>
+                </not>
+            </and>
+        </condition>
+        <condition else="false" property="nb.junit.single" value="true">
+            <and>
+                <istrue value="${junit.available}"/>
+                <isset property="test.method"/>
+            </and>
+        </condition>
+    </target>
+    <target name="-init-test-properties">
+        <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
+        <property name="test.binarytestincludes" value=""/>
+        <property name="test.binaryexcludes" value=""/>
+    </target>
+    <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
+        <macrodef name="junit" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${java.io.tmpdir}">
+                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg value="-ea"/>
+                    <customize/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
+        <macrodef name="junit" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property name="run.jvmargs.ide" value=""/>
+                <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
+                    <batchtest todir="${build.test.results.dir}">
+                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+                            <filename name="@{testincludes}"/>
+                        </fileset>
+                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
+                            <filename name="${test.binarytestincludes}"/>
+                        </fileset>
+                    </batchtest>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg value="-ea"/>
+                    <jvmarg line="${run.jvmargs.ide}"/>
+                    <customize/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
+    <target if="${testng.available}" name="-init-macrodef-testng">
+        <macrodef name="testng" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
+                    <isset property="test.method"/>
+                </condition>
+                <union id="test.set">
+                    <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
+                        <filename name="@{testincludes}"/>
+                    </fileset>
+                </union>
+                <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
+                <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="csip-cfa" testname="TestNG tests" workingDir="${basedir}">
+                    <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
+                    <propertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </propertyset>
+                    <customize/>
+                </testng>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-test-impl">
+        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <echo>No tests executed.</echo>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
+        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <webproject2:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize/>
+                </webproject2:junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
+        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <webproject2:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize/>
+                </webproject2:testng>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
+        <macrodef name="test" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <sequential>
+                <webproject2:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize>
+                        <classpath>
+                            <path path="${run.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}"/>
+                        </classpath>
+                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                        <jvmarg line="${runmain.jvmargs}"/>
+                    </customize>
+                </webproject2:test-impl>
+            </sequential>
+        </macrodef>
+    </target>
+    <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
+        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${java.io.tmpdir}">
+                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg value="-ea"/>
+                    <jvmarg line="${debug-args-line}"/>
+                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+                    <customize/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
+        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property name="run.jvmargs.ide" value=""/>
+                <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
+                    <batchtest todir="${build.test.results.dir}">
+                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+                            <filename name="@{testincludes}"/>
+                        </fileset>
+                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
+                            <filename name="${test.binarytestincludes}"/>
+                        </fileset>
+                    </batchtest>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg value="-ea"/>
+                    <jvmarg line="${run.jvmargs.ide}"/>
+                    <jvmarg line="${debug-args-line}"/>
+                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+                    <customize/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
+        <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <webproject2:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize/>
+                </webproject2:junit-debug>
+            </sequential>
+        </macrodef>
+    </target>
+    <target if="${testng.available}" name="-init-macrodef-testng-debug">
+        <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <element name="customize2" optional="true"/>
+            <sequential>
+                <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
+                    <isset property="test.method"/>
+                </condition>
+                <condition else="-suitename csip-cfa -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
+                    <matches pattern=".*\.xml" string="@{testClass}"/>
+                </condition>
+                <delete dir="${build.test.results.dir}" quiet="true"/>
+                <mkdir dir="${build.test.results.dir}"/>
+                <webproject1:debug args="${testng.cmd.args}" classname="org.testng.TestNG" classpath="${debug.test.classpath}:${j2ee.platform.embeddableejb.classpath}">
+                    <customize>
+                        <customize2/>
+                        <jvmarg value="-ea"/>
+                        <arg line="${testng.debug.mode}"/>
+                        <arg line="-d ${build.test.results.dir}"/>
+                        <arg line="-listener org.testng.reporters.VerboseReporter"/>
+                    </customize>
+                </webproject1:debug>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
+        <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <element implicit="true" name="customize2" optional="true"/>
+            <sequential>
+                <webproject2:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
+                    <customize2/>
+                </webproject2:testng-debug>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
+        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <sequential>
+                <webproject2:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize>
+                        <classpath>
+                            <path path="${run.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}"/>
+                        </classpath>
+                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                        <jvmarg line="${runmain.jvmargs}"/>
+                    </customize>
+                </webproject2:test-debug-impl>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
+        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <sequential>
+                <webproject2:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
+                    <customize2>
+                        <syspropertyset>
+                            <propertyref prefix="test-sys-prop."/>
+                            <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                        </syspropertyset>
+                    </customize2>
+                </webproject2:testng-debug-impl>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
+    <target name="-init-macrodef-java">
+        <macrodef name="java" uri="http://www.netbeans.org/ns/web-project/1">
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${debug.classpath}" name="classpath"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" fork="true">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg line="${runmain.jvmargs}"/>
+                    <classpath>
+                        <path path="@{classpath}:${j2ee.platform.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-nbjsdebug">
+        <macrodef name="nbjsdebugstart" uri="http://www.netbeans.org/ns/web-project/1">
+            <attribute default="${client.url}" name="webUrl"/>
+            <sequential>
+                <nbjsdebugstart urlPart="${client.urlPart}" webUrl="@{webUrl}"/>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
+        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/web-project/1">
+            <attribute default="${main.class}" name="name"/>
+            <attribute default="${debug.classpath}:${j2ee.platform.classpath}" name="classpath"/>
+            <sequential>
+                <nbjpdastart addressproperty="jpda.address" name="@{name}" transport="${debug-transport}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </nbjpdastart>
+            </sequential>
+        </macrodef>
+        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/web-project/1">
+            <attribute default="${build.classes.dir}" name="dir"/>
+            <sequential>
+                <nbjpdareload>
+                    <fileset dir="@{dir}" includes="${fix.classes}">
+                        <include name="${fix.includes}*.class"/>
+                    </fileset>
+                </nbjpdareload>
+            </sequential>
+        </macrodef>
+        <macrodef name="nbjpdaappreloaded" uri="http://www.netbeans.org/ns/web-project/1">
+            <sequential>
+                <nbjpdaappreloaded/>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-debug-args">
+        <property name="version-output" value="java version &quot;${ant.java.version}"/>
+        <condition property="have-jdk-older-than-1.4">
+            <or>
+                <contains string="${version-output}" substring="java version &quot;1.0"/>
+                <contains string="${version-output}" substring="java version &quot;1.1"/>
+                <contains string="${version-output}" substring="java version &quot;1.2"/>
+                <contains string="${version-output}" substring="java version &quot;1.3"/>
+            </or>
+        </condition>
+        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
+            <istrue value="${have-jdk-older-than-1.4}"/>
+        </condition>
+        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
+            <os family="windows"/>
+        </condition>
+        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
+            <isset property="debug.transport"/>
+        </condition>
+    </target>
+    <target depends="-init-debug-args" name="-init-macrodef-debug">
+        <macrodef name="debug" uri="http://www.netbeans.org/ns/web-project/1">
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${debug.classpath}:${j2ee.platform.classpath}" name="classpath"/>
+            <attribute default="${application.args.param}" name="args"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" fork="true">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg line="${debug-args-line}"/>
+                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+                    <jvmarg line="${runmain.jvmargs}"/>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <arg line="@{args}"/>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-taskdefs">
+        <fail unless="libs.CopyLibs.classpath">
+The libs.CopyLibs.classpath property is not set up.
+This property must point to 
+org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part
+of NetBeans IDE installation and is usually located at 
+&lt;netbeans_installation&gt;/java&lt;version&gt;/ant/extra folder.
+Either open the project in the IDE and make sure CopyLibs library
+exists or setup the property manually. For example like this:
+ ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar
+                </fail>
+        <taskdef classpath="${libs.CopyLibs.classpath}" resource="org/netbeans/modules/java/j2seproject/copylibstask/antlib.xml"/>
+    </target>
+    <target name="-init-ap-cmdline-properties">
+        <property name="annotation.processing.enabled" value="true"/>
+        <property name="annotation.processing.processors.list" value=""/>
+        <property name="annotation.processing.run.all.processors" value="true"/>
+        <property name="javac.processorpath" value="${javac.classpath}"/>
+        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
+        <condition property="ap.supported.internal" value="true">
+            <not>
+                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
+            </not>
+        </condition>
+    </target>
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
+        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
+            <isfalse value="${annotation.processing.run.all.processors}"/>
+        </condition>
+        <condition else="" property="ap.proc.none.internal" value="-proc:none">
+            <isfalse value="${annotation.processing.enabled}"/>
+        </condition>
+    </target>
+    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
+        <property name="ap.cmd.line.internal" value=""/>
+    </target>
+    <!--
+                pre NB7.2 profiling section; consider it deprecated
+            -->
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
+    <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-profile-pre-init, init, -profile-post-init" if="profiler.info.jvmargs.agent" name="-profile-init-check">
+        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
+        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
+    </target>
+    <!--
+                end of pre NB7.2 profiling section
+            -->
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-java,-init-macrodef-nbjpda,-init-macrodef-nbjsdebug,-init-macrodef-debug,-init-taskdefs,-init-ap-cmdline" name="init"/>
+    <!--
+                COMPILATION SECTION
+            -->
+    <target depends="init" if="no.dist.ear.dir" name="deps-module-jar" unless="no.deps">
+        <ant antfile="${project.csip-core}/build.xml" inheritall="false" target="jar">
+            <property name="deploy.on.save" value="false"/>
+        </ant>
+    </target>
+    <target depends="init" if="dist.ear.dir" name="deps-ear-jar" unless="no.deps">
+        <ant antfile="${project.csip-core}/build.xml" inheritall="false" target="jar">
+            <property name="deploy.on.save" value="false"/>
+        </ant>
+    </target>
+    <target depends="init, deps-module-jar, deps-ear-jar" name="deps-jar" unless="no.deps"/>
+    <target depends="init,deps-jar,generate-rest-config" name="-pre-pre-compile">
+        <mkdir dir="${build.classes.dir}"/>
+    </target>
+    <target name="-pre-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-copy-webdir">
+        <copy todir="${build.web.dir}">
+            <fileset dir="${web.docbase.dir}" excludes="${build.web.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+        <copy todir="${build.web.dir}/WEB-INF">
+            <fileset dir="${webinf.dir}" excludes="${build.web.excludes}"/>
+        </copy>
+    </target>
+    <target depends="init, deps-jar, -pre-pre-compile, -pre-compile, -copy-manifest, -copy-persistence-xml, -copy-webdir, library-inclusion-in-archive,library-inclusion-in-manifest" if="have.sources" name="-do-compile">
+        <webproject2:javac destdir="${build.classes.dir}" gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.classes.dir}">
+            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target if="has.custom.manifest" name="-copy-manifest">
+        <mkdir dir="${build.meta.inf.dir}"/>
+        <copy todir="${build.meta.inf.dir}">
+            <fileset dir="${conf.dir}" includes="MANIFEST.MF"/>
+        </copy>
+    </target>
+    <target if="has.persistence.xml" name="-copy-persistence-xml">
+        <mkdir dir="${build.web.dir}/WEB-INF/classes/META-INF"/>
+        <copy todir="${build.web.dir}/WEB-INF/classes/META-INF">
+            <fileset dir="${persistence.xml.dir}" includes="persistence.xml orm.xml"/>
+        </copy>
+    </target>
+    <target name="-post-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
+    <target name="-pre-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <webproject2:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}"/>
+        <copy todir="${build.classes.dir}">
+            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target name="-post-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
+    <property name="jspc.schemas" value="/resources/schemas/"/>
+    <property name="jspc.dtds" value="/resources/dtds/"/>
+    <target depends="compile" description="Test compile JSP pages to expose compilation errors." if="do.compile.jsps" name="compile-jsps">
+        <mkdir dir="${build.generated.dir}/src"/>
+        <java classname="org.netbeans.modules.web.project.ant.JspC" failonerror="true" fork="true">
+            <arg value="-uriroot"/>
+            <arg file="${basedir}/${build.web.dir}"/>
+            <arg value="-d"/>
+            <arg file="${basedir}/${build.generated.dir}/src"/>
+            <arg value="-die1"/>
+            <arg value="-schemas ${jspc.schemas}"/>
+            <arg value="-dtds ${jspc.dtds}"/>
+            <arg value="-compilerSourceVM ${javac.source}"/>
+            <arg value="-compilerTargetVM ${javac.target}"/>
+            <arg value="-javaEncoding ${source.encoding}"/>
+            <arg value="-sysClasspath ${libs.jsp-compilation-syscp.classpath}"/>
+            <classpath path="${java.home}/../lib/tools.jar:${libs.jsp-compiler.classpath}:${libs.jsp-compilation.classpath}"/>
+        </java>
+        <mkdir dir="${build.generated.dir}/classes"/>
+        <webproject2:javac classpath="${build.classes.dir}:${libs.jsp-compilation.classpath}:${javac.classpath}:${j2ee.platform.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src"/>
+    </target>
+    <target depends="compile" if="jsp.includes" name="-do-compile-single-jsp">
+        <fail unless="javac.jsp.includes">Must select some files in the IDE or set javac.jsp.includes</fail>
+        <mkdir dir="${build.generated.dir}/src"/>
+        <java classname="org.netbeans.modules.web.project.ant.JspCSingle" failonerror="true" fork="true">
+            <arg value="-uriroot"/>
+            <arg file="${basedir}/${build.web.dir}"/>
+            <arg value="-d"/>
+            <arg file="${basedir}/${build.generated.dir}/src"/>
+            <arg value="-die1"/>
+            <arg value="-schemas ${jspc.schemas}"/>
+            <arg value="-dtds ${jspc.dtds}"/>
+            <arg value="-sysClasspath ${libs.jsp-compilation-syscp.classpath}"/>
+            <arg value="-jspc.files"/>
+            <arg path="${jsp.includes}"/>
+            <arg value="-compilerSourceVM ${javac.source}"/>
+            <arg value="-compilerTargetVM ${javac.target}"/>
+            <arg value="-javaEncoding ${source.encoding}"/>
+            <classpath path="${java.home}/../lib/tools.jar:${libs.jsp-compiler.classpath}:${libs.jsp-compilation.classpath}"/>
+        </java>
+        <mkdir dir="${build.generated.dir}/classes"/>
+        <webproject2:javac classpath="${build.classes.dir}:${libs.jsp-compilation.classpath}:${javac.classpath}:${j2ee.platform.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src">
+            <customize>
+                <patternset includes="${javac.jsp.includes}"/>
+            </customize>
+        </webproject2:javac>
+    </target>
+    <target name="compile-single-jsp">
+        <fail unless="jsp.includes">Must select a file in the IDE or set jsp.includes</fail>
+        <antcall target="-do-compile-single-jsp"/>
+    </target>
+    <!--
+                DIST BUILDING SECTION
+            -->
+    <target name="-pre-dist">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.without.custom.manifest" name="-do-dist-without-manifest">
+        <dirname file="${dist.war}" property="dist.jar.dir"/>
+        <mkdir dir="${dist.jar.dir}"/>
+        <jar compress="${jar.compress}" jarfile="${dist.war}">
+            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
+        </jar>
+    </target>
+    <target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.with.custom.manifest" name="-do-dist-with-manifest">
+        <dirname file="${dist.war}" property="dist.jar.dir"/>
+        <mkdir dir="${dist.jar.dir}"/>
+        <jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
+            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
+        </jar>
+    </target>
+    <target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.without.custom.manifest" name="-do-tmp-dist-without-manifest">
+        <dirname file="${dist.war}" property="dist.jar.dir"/>
+        <mkdir dir="${dist.jar.dir}"/>
+        <jar compress="${jar.compress}" jarfile="${dist.war}">
+            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
+        </jar>
+    </target>
+    <target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.with.custom.manifest" name="-do-tmp-dist-with-manifest">
+        <dirname file="${dist.war}" property="dist.jar.dir"/>
+        <mkdir dir="${dist.jar.dir}"/>
+        <jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
+            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
+        </jar>
+    </target>
+    <target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/>
+    <target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest">
+        <copyfiles files="${libs.CSIP-Jersey-2.16.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+        <copyfiles files="${reference.csip-core.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+        <copyfiles files="${file.reference.commons-math-2.0.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+        <copyfiles files="${file.reference.jcommon-1.0.16.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+        <copyfiles files="${file.reference.jfreechart-1.0.13.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+        <copyfiles files="${file.reference.Jama-1.0.2.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+        <copyfiles files="${file.reference.csip-lib-water-1.0.6.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+        <mkdir dir="${build.web.dir}/META-INF"/>
+        <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
+    </target>
+    <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
+        <copyfiles files="${libs.CSIP-Jersey-2.16.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
+        <copyfiles files="${reference.csip-core.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+        <copyfiles files="${file.reference.commons-math-2.0.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+        <copyfiles files="${file.reference.jcommon-1.0.16.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+        <copyfiles files="${file.reference.jfreechart-1.0.13.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+        <copyfiles files="${file.reference.Jama-1.0.2.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+        <copyfiles files="${file.reference.csip-lib-water-1.0.6.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+    </target>
+    <target depends="init" if="dist.ear.dir" name="-clean-webinf-lib">
+        <delete dir="${build.web.dir}/WEB-INF/lib"/>
+    </target>
+    <target depends="init,-clean-webinf-lib,compile,compile-jsps,-pre-dist,library-inclusion-in-manifest" if="do.tmp.war.package" name="do-ear-dist">
+        <dirname file="${dist.ear.war}" property="dist.jar.dir"/>
+        <mkdir dir="${dist.jar.dir}"/>
+        <jar compress="${jar.compress}" jarfile="${dist.ear.war}" manifest="${build.web.dir}/META-INF/MANIFEST.MF">
+            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
+        </jar>
+    </target>
+    <target name="-post-dist">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-dist,do-dist,-post-dist" description="Build distribution (WAR)." name="dist"/>
+    <target depends="init,-clean-webinf-lib,-init-cos,compile,-pre-dist,do-ear-dist,-post-dist" description="Build distribution (WAR) to be packaged into an EAR." name="dist-ear"/>
+    <!--
+                EXECUTION SECTION
+            -->
+    <target depends="run-deploy,run-display-browser" description="Deploy to server and show in browser." name="run"/>
+    <target name="-pre-run-deploy">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-post-run-deploy">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-pre-nbmodule-run-deploy">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -pre-run-deploy task instead. -->
+    </target>
+    <target name="-post-nbmodule-run-deploy">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -post-run-deploy task instead. -->
+    </target>
+    <target name="-run-deploy-am">
+        <!-- Task to deploy to the Access Manager runtime. -->
+    </target>
+    <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest,-pre-run-deploy,-pre-nbmodule-run-deploy,-run-deploy-nb,-init-deploy-ant,-deploy-ant,-run-deploy-am,-post-nbmodule-run-deploy,-post-run-deploy,-do-update-breakpoints" name="run-deploy"/>
+    <target if="netbeans.home" name="-run-deploy-nb">
+        <nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
+    </target>
+    <target name="-init-deploy-ant" unless="netbeans.home">
+        <property name="deploy.ant.archive" value="${dist.war}"/>
+        <property name="deploy.ant.docbase.dir" value="${web.docbase.dir}"/>
+        <property name="deploy.ant.resource.dir" value="${resource.dir}"/>
+        <property name="deploy.ant.enabled" value="true"/>
+    </target>
+    <target depends="dist,-run-undeploy-nb,-init-deploy-ant,-undeploy-ant" name="run-undeploy"/>
+    <target if="netbeans.home" name="-run-undeploy-nb">
+        <fail message="Undeploy is not supported from within the IDE"/>
+    </target>
+    <target depends="init,-pre-dist,dist,-post-dist" name="verify">
+        <nbverify file="${dist.war}"/>
+    </target>
+    <target depends="run-deploy,-init-display-browser,-display-browser-nb-old,-display-browser-nb,-display-browser-cl" name="run-display-browser"/>
+    <target if="do.display.browser" name="-init-display-browser">
+        <condition property="do.display.browser.nb.old">
+            <and>
+                <isset property="netbeans.home"/>
+                <not>
+                    <isset property="browser.context"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="do.display.browser.nb">
+            <and>
+                <isset property="netbeans.home"/>
+                <isset property="browser.context"/>
+            </and>
+        </condition>
+        <condition property="do.display.browser.cl">
+            <isset property="deploy.ant.enabled"/>
+        </condition>
+    </target>
+    <target if="do.display.browser.nb.old" name="-display-browser-nb-old">
+        <nbbrowse url="${client.url}"/>
+    </target>
+    <target if="do.display.browser.nb" name="-display-browser-nb">
+        <nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
+    </target>
+    <target if="do.display.browser.cl" name="-get-browser" unless="browser">
+        <condition property="browser" value="rundll32">
+            <os family="windows"/>
+        </condition>
+        <condition else="" property="browser.args" value="url.dll,FileProtocolHandler">
+            <os family="windows"/>
+        </condition>
+        <condition property="browser" value="/usr/bin/open">
+            <os family="mac"/>
+        </condition>
+        <property environment="env"/>
+        <condition property="browser" value="${env.BROWSER}">
+            <isset property="env.BROWSER"/>
+        </condition>
+        <condition property="browser" value="/usr/bin/firefox">
+            <available file="/usr/bin/firefox"/>
+        </condition>
+        <condition property="browser" value="/usr/local/firefox/firefox">
+            <available file="/usr/local/firefox/firefox"/>
+        </condition>
+        <condition property="browser" value="/usr/bin/mozilla">
+            <available file="/usr/bin/mozilla"/>
+        </condition>
+        <condition property="browser" value="/usr/local/mozilla/mozilla">
+            <available file="/usr/local/mozilla/mozilla"/>
+        </condition>
+        <condition property="browser" value="/usr/sfw/lib/firefox/firefox">
+            <available file="/usr/sfw/lib/firefox/firefox"/>
+        </condition>
+        <condition property="browser" value="/opt/csw/bin/firefox">
+            <available file="/opt/csw/bin/firefox"/>
+        </condition>
+        <condition property="browser" value="/usr/sfw/lib/mozilla/mozilla">
+            <available file="/usr/sfw/lib/mozilla/mozilla"/>
+        </condition>
+        <condition property="browser" value="/opt/csw/bin/mozilla">
+            <available file="/opt/csw/bin/mozilla"/>
+        </condition>
+    </target>
+    <target depends="-get-browser" if="do.display.browser.cl" name="-display-browser-cl">
+        <fail unless="browser">
+                    Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable.
+                </fail>
+        <property name="browse.url" value="${deploy.ant.client.url}${client.urlPart}"/>
+        <echo>Launching ${browse.url}</echo>
+        <exec executable="${browser}" spawn="true">
+            <arg line="${browser.args} ${browse.url}"/>
+        </exec>
+    </target>
+    <target depends="init,-init-cos,compile-single" name="run-main">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <webproject1:java classname="${run.class}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single" name="run-test-with-main">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <webproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
+    </target>
+    <target depends="init" if="netbeans.home" name="-do-update-breakpoints">
+        <webproject1:nbjpdaappreloaded/>
+    </target>
+    <!--
+                DEBUGGING SECTION
+            -->
+    <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest" description="Debug project in IDE." if="netbeans.home" name="debug">
+        <nbstartserver debugmode="true"/>
+        <antcall target="connect-debugger"/>
+        <nbdeploy clientUrlPart="${client.urlPart}" debugmode="true" forceRedeploy="true"/>
+        <antcall target="debug-display-browser-old"/>
+        <antcall target="debug-display-browser"/>
+        <antcall target="connect-client-debugger"/>
+    </target>
+    <target if="do.debug.server" name="connect-debugger" unless="is.debugged">
+        <condition property="listeningcp" value="sourcepath">
+            <istrue value="${j2ee.compile.on.save}"/>
+        </condition>
+        <nbjpdaconnect address="${jpda.address}" host="${jpda.host}" listeningcp="${listeningcp}" name="${name}" transport="${jpda.transport}">
+            <classpath>
+                <path path="${debug.classpath}:${j2ee.platform.classpath}"/>
+            </classpath>
+            <sourcepath>
+                <path path="${web.docbase.dir}"/>
+            </sourcepath>
+        </nbjpdaconnect>
+    </target>
+    <target if="do.display.browser.debug.old" name="debug-display-browser-old">
+        <nbbrowse url="${client.url}"/>
+    </target>
+    <target if="do.display.browser.debug" name="debug-display-browser">
+        <nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
+    </target>
+    <target if="do.debug.client" name="connect-client-debugger">
+        <webproject1:nbjsdebugstart webUrl="${client.url}"/>
+    </target>
+    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <webproject1:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
+    </target>
+    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
+    <target depends="init,compile,compile-jsps,-do-compile-single-jsp,debug" if="netbeans.home" name="debug-single"/>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
+        <webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
+    </target>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
+        <webproject1:nbjpdastart name="${debug.class}"/>
+    </target>
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <webproject1:debug classname="${debug.class}"/>
+    </target>
+    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single-main"/>
+    <target depends="init" name="-pre-debug-fix">
+        <fail unless="fix.includes">Must set fix.includes</fail>
+        <property name="javac.includes" value="${fix.includes}.java"/>
+    </target>
+    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
+        <webproject1:nbjpdareload/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
+    <!--
+            =================
+            PROFILING SECTION
+            =================
+            -->
+    <!--
+                pre NB7.2 profiling section; consider it deprecated
+            -->
+    <target description="Profile a J2EE project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
+        <condition else="start-profiled-server" property="profiler.startserver.target" value="start-profiled-server-extraargs">
+            <isset property="profiler.info.jvmargs.extra"/>
+        </condition>
+        <antcall target="${profiler.startserver.target}"/>
+        <antcall target="run"/>
+        <antcall target="-profile-start-loadgen"/>
+    </target>
+    <target if="profiler.info.jvmargs.agent" name="start-profiled-server">
+        <nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}">
+            <jvmarg value="${profiler.info.jvmargs.agent}"/>
+            <jvmarg value="${profiler.j2ee.agentID}"/>
+        </nbstartprofiledserver>
+    </target>
+    <target if="profiler.info.jvmargs.agent" name="start-profiled-server-extraargs">
+        <nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}">
+            <jvmarg value="${profiler.info.jvmargs.extra}"/>
+            <jvmarg value="${profiler.info.jvmargs.agent}"/>
+            <jvmarg value="${profiler.j2ee.agentID}"/>
+        </nbstartprofiledserver>
+    </target>
+    <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
+        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+                <path path="${j2ee.platform.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
+            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+            <jvmarg value="${profiler.info.jvmargs.agent}"/>
+            <jvmarg line="${profiler.info.jvmargs}"/>
+            <test name="${profile.class}"/>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+                <path path="${j2ee.platform.classpath}"/>
+            </classpath>
+            <syspropertyset>
+                <propertyref prefix="test-sys-prop."/>
+                <mapper from="test-sys-prop.*" to="*" type="glob"/>
+            </syspropertyset>
+            <formatter type="brief" usefile="false"/>
+            <formatter type="xml"/>
+        </junit>
+    </target>
+    <target if="netbeans.home" name="-profile-check">
+        <condition property="profiler.configured">
+            <or>
+                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
+                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
+            </or>
+        </condition>
+    </target>
+    <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest" name="-do-profile">
+        <startprofiler/>
+        <nbstartserver profilemode="true"/>
+        <nbdeploy clientUrlPart="${client.urlPart}" forceRedeploy="true" profilemode="true"/>
+        <antcall target="debug-display-browser-old"/>
+        <antcall target="debug-display-browser"/>
+        <antcall target="-profile-start-loadgen"/>
+    </target>
+    <target depends="-profile-check,-profile-pre72" description="Profile a J2EE project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
+        <antcall target="-do-profile"/>
+    </target>
+    <target depends="-profile-test-single-pre72" name="profile-test-single"/>
+    <target depends="-profile-check" if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs.agent">
+        <startprofiler/>
+        <antcall target="test-single"/>
+    </target>
+    <target if="profiler.loadgen.path" name="-profile-start-loadgen">
+        <loadgenstart path="${profiler.loadgen.path}"/>
+    </target>
+    <!--
+                JAVADOC SECTION
+            -->
+    <target depends="init" if="have.sources" name="javadoc-build">
+        <mkdir dir="${dist.javadoc.dir}"/>
+        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
+            <classpath>
+                <path path="${javac.classpath}:${j2ee.platform.classpath}"/>
+            </classpath>
+            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="**/*.java"/>
+            </fileset>
+        </javadoc>
+        <copy todir="${dist.javadoc.dir}">
+            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="**/doc-files/**"/>
+            </fileset>
+        </copy>
+    </target>
+    <target depends="init,javadoc-build" if="netbeans.home" name="javadoc-browse" unless="no.javadoc.preview">
+        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
+    </target>
+    <target depends="init,javadoc-build,javadoc-browse" description="Build Javadoc." name="javadoc"/>
+    <!--
+                
+                TEST COMPILATION SECTION
+            -->
+    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
+        <mkdir dir="${build.test.classes.dir}"/>
+        <property name="j2ee.platform.embeddableejb.classpath" value=""/>
+    </target>
+    <target name="-pre-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test" if="have.tests" name="-do-compile-test">
+        <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
+        <copy todir="${build.test.classes.dir}">
+            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target name="-post-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
+    <target name="-pre-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" srcdir="${test.src.dir}"/>
+        <copy todir="${build.test.classes.dir}">
+            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target name="-post-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
+    <!--
+                
+                TEST EXECUTION SECTION
+            -->
+    <target depends="init" if="have.tests" name="-pre-test-run">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
+        <webproject2:test includes="${includes}" testincludes="**/*Test.java"/>
+    </target>
+    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init" if="have.tests" name="test-report"/>
+    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
+    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
+    <target depends="init" if="have.tests" name="-pre-test-run-single">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
+        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
+        <webproject2:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
+        <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
+        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
+        <webproject2:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
+    <!--
+                
+                TEST DEBUGGING SECTION
+            -->
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
+        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
+        <webproject2:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
+        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
+        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
+        <webproject2:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
+    </target>
+    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
+        <webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
+    </target>
+    <target depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
+    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
+    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
+        <webproject1:nbjpdareload dir="${build.test.classes.dir}"/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
+    <!--
+                
+                CLEANUP SECTION
+            -->
+    <target depends="init" name="deps-clean" unless="no.deps">
+        <ant antfile="${project.csip-core}/build.xml" inheritall="false" target="clean"/>
+    </target>
+    <target depends="init" name="do-clean">
+        <condition property="build.dir.to.clean" value="${build.web.dir}">
+            <isset property="dist.ear.dir"/>
+        </condition>
+        <property name="build.dir.to.clean" value="${build.web.dir}"/>
+        <delete includeEmptyDirs="true" quiet="true">
+            <fileset dir="${build.dir.to.clean}/WEB-INF/lib"/>
+        </delete>
+        <delete dir="${build.dir}"/>
+        <available file="${build.dir.to.clean}/WEB-INF/lib" property="status.clean-failed" type="dir"/>
+        <delete dir="${dist.dir}"/>
+    </target>
+    <target depends="do-clean" if="status.clean-failed" name="check-clean">
+        <echo message="Warning: unable to delete some files in ${build.web.dir}/WEB-INF/lib - they are probably locked by the J2EE server. "/>
+        <echo level="info" message="To delete all files undeploy the module from Server Registry in Runtime tab and then use Clean again."/>
+    </target>
+    <target depends="init" if="netbeans.home" name="undeploy-clean">
+        <nbundeploy failOnError="false" startServer="false"/>
+    </target>
+    <target name="-post-clean">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,undeploy-clean,deps-clean,do-clean,check-clean,-post-clean" description="Clean build products." name="clean"/>
+    <target depends="clean" description="Clean build products." name="clean-ear"/>
+</project>

nbproject/project.properties

@@ -1,3 +1,4 @@
+file.reference.csip-lib-water-1.0.6.jar=lib/csip-lib-water-1.0.6.jar
 file.reference.Jama-1.0.2.jar=lib/Jama-1.0.2.jar
 j2ee.platform.classpath=${j2ee.server.home}/lib/annotations-api.jar:${j2ee.server.home}/lib/catalina-ant.jar:${j2ee.server.home}/lib/catalina-ha.jar:${j2ee.server.home}/lib/catalina-storeconfig.jar:${j2ee.server.home}/lib/catalina-tribes.jar:${j2ee.server.home}/lib/catalina.jar:${j2ee.server.home}/lib/ecj-4.4.2.jar:${j2ee.server.home}/lib/el-api.jar:${j2ee.server.home}/lib/jasper-el.jar:${j2ee.server.home}/lib/jasper.jar:${j2ee.server.home}/lib/jsp-api.jar:${j2ee.server.home}/lib/servlet-api.jar:${j2ee.server.home}/lib/tomcat-api.jar:${j2ee.server.home}/lib/tomcat-coyote.jar:${j2ee.server.home}/lib/tomcat-dbcp.jar:${j2ee.server.home}/lib/tomcat-i18n-es.jar:${j2ee.server.home}/lib/tomcat-i18n-fr.jar:${j2ee.server.home}/lib/tomcat-i18n-ja.jar:${j2ee.server.home}/lib/tomcat-jdbc.jar:${j2ee.server.home}/lib/tomcat-jni.jar:${j2ee.server.home}/lib/tomcat-util-scan.jar:${j2ee.server.home}/lib/tomcat-util.jar:${j2ee.server.home}/lib/tomcat-websocket.jar:${j2ee.server.home}/lib/websocket-api.jar
 #Fri May 06 09:05:19 MDT 2016
@@ -52,7 +53,8 @@
     ${file.reference.commons-math-2.0.jar}:\
     ${file.reference.jcommon-1.0.16.jar}:\
     ${file.reference.jfreechart-1.0.13.jar}:\
-    ${file.reference.Jama-1.0.2.jar}
+    ${file.reference.Jama-1.0.2.jar}:\
+    ${file.reference.csip-lib-water-1.0.6.jar}
 javadoc.noindex=false
 webinf.dir=web/WEB-INF
 annotation.processing.enabled.in.editor=true

nbproject/project.xml

@@ -35,6 +35,10 @@
                     <file>${file.reference.Jama-1.0.2.jar}</file>
                     <path-in-war>WEB-INF/lib</path-in-war>
                 </library>
+                <library dirs="200">
+                    <file>${file.reference.csip-lib-water-1.0.6.jar}</file>
+                    <path-in-war>WEB-INF/lib</path-in-war>
+                </library>
             </web-module-libraries>
             <web-module-additional-libraries/>
             <source-roots>

src/java/m/cfa/baseflow/guiBaseflow_Model.java

@@ -1,11 +1,11 @@
 package m.cfa.baseflow;
 
-import m.cfa.Data;
+import WaterData.WaterDataInterface;
+import WaterData.WaterData;
 import m.cfa.DoubleArray;
 import m.cfa.DoubleMath;
 import m.cfa.FlowComparator;
 import m.cfa.Graphing;
-import m.cfa.User_Data;
 import csip.Executable;
 import java.awt.Color;
 import java.io.BufferedReader;
@@ -33,7 +33,7 @@
 import org.jfree.data.time.TimeSeries;
 
 /**
- * Last Updated: 31-May-2017
+ * Last Updated: 20-June-2017
  * @author Tyler Wible
  * @since 15-June-2012
  */
@@ -41,8 +41,8 @@
     //Inputs
     String directory = "C:/Projects/TylerWible/CodeDirectories/NetBeans/data/CFA/Baseflow";//"/od/projects/cfa/GUI_FlowAnalysis";
     String database = "USGS";//"CDWR";//"STORET";//"CDSN";//"UserData";//
-    String organizationID = "n/a";//"n/a";//"21COL001";//"CITYFTCO_WQX";//"n/a";//
-    String stationID = "06741510";//"CLAGRECO";//"000028";//"1EFF";//"n/a";//
+    String orgId = "n/a";//"n/a";//"21COL001";//"CITYFTCO_WQX";//"n/a";//
+    String stationId = "06741510";//"CLAGRECO";//"000028";//"1EFF";//"n/a";//
     String stationName = "BIG THOMPSON RIVER AT LOVELAND, CO.";//"Cache La Poudre Near Greeley";//"BIG THOMPSON R NEAR MOUTH";//"n/a";//"n/a";//
     double drainageArea = 27.3;//Square miles
     String modelType = "BFLOW";//"HYSEP";//
@@ -108,8 +108,8 @@
     //Sets
     public void setDirectory(String directory_str){ directory = directory_str; }
     public void setDatabase(String database_str){ database = database_str; }
-    public void setOrganizationID(String organizationID_str){ organizationID = organizationID_str; }
-    public void setStationID(String stationID_str){ stationID = stationID_str; }
+    public void setOrganizationID(String orgId_str){ orgId = orgId_str; }
+    public void setStationID(String stationId_str){ stationId = stationId_str; }
     public void setStationName(String stationName_str){ stationName = stationName_str; }
     public void setDrainageArea(double drainageArea_dbl){ drainageArea = drainageArea_dbl; }
     public void setModelType(String modelType_str){ modelType = modelType_str; }
@@ -317,7 +317,7 @@
         plotTime = Graphing.setTimeAxisPreferences(plotTime);
 
         //Graph plot onto JfreeChart
-        String graphTitle = "BFLOW Base-flow Separation for " + database + " Station " + stationID + "; " + stationName;
+        String graphTitle = "BFLOW Base-flow Separation for " + database + " Station " + stationId + "; " + stationName;
         JFreeChart parentChart = new JFreeChart(graphTitle, Graphing.titleFont, plotTime, true);
 
         //Set legend Font
@@ -750,7 +750,7 @@
         plotTime = Graphing.setTimeAxisPreferences(plotTime);
 
         //Graph plot onto JfreeChart
-        String title = "USGS-HYSEP Hydrograph Separation For " + database + " Station: " + stationID + ", " + stationName;
+        String title = "USGS-HYSEP Hydrograph Separation For " + database + " Station: " + stationId + ", " + stationName;
         JFreeChart parentChart = new JFreeChart(title, Graphing.titleFont, plotTime, true);
 
         //Set legend Font
@@ -911,12 +911,14 @@
         }
         
         //Check if any flow data exists
-        String[][] sortableData = Data.extractFlowData(directory, storetResourceFile, database, organizationID, stationID, beginDate, endDate, userData);
+        WaterDataInterface waterLib = WaterData.getNewWaterDataInterface(database, userData, storetResourceFile);
+        String[][] sortableData = waterLib.extractFlowData_formatted(directory, orgId, stationId, beginDate, endDate);
         
         //If the user wants the datasets (public and user) merged then retrieve the second dataset (user)
         String[][] sortableData_user = new String[0][0];
         if(mergeDatasets){
-            sortableData_user = User_Data.readUserFile("UserData", stationID, userData, "flow", beginDate, endDate);
+            WaterDataInterface waterLibUser = WaterData.getNewWaterDataInterface("UserData", userData, storetResourceFile);
+            sortableData_user = waterLibUser.extractFlowData_formatted(directory, orgId, stationId, beginDate, endDate);
         }
         
         //Sort the Data by date to remove duplicate date entries
@@ -928,13 +930,13 @@
         if(sortedData_combined.length == 0){
             ArrayList<String> errorMessage = new ArrayList<>();
             if(sortedData.length == 0){
-                errorMessage.add("There is no available flow data in the " + database + " database for station '" + stationID + "' and the specified date range.");
+                errorMessage.add("There is no available flow data in the " + database + " database for station '" + stationId + "' and the specified date range.");
                 if(database.equalsIgnoreCase("CDWR")){
                     errorMessage.add("The CDWR database is sensitive to the begin date used, try specifying a later begin date");
                 }
             }
             if(sortedData_user.length == 0){
-                errorMessage.add("There is no available uploaded data for station '" + stationID + "' and the specified date range");
+                errorMessage.add("There is no available uploaded data for station '" + stationId + "' and the specified date range");
             }
             writeError(errorMessage);
         }

src/java/m/cfa/download/guiDownload_Data.java

@@ -1,32 +1,26 @@
 package m.cfa.download;
 
-import m.cfa.CDSN_Data;
-import m.cfa.CDWR_Data;
-import m.cfa.STORET_Data;
-import m.cfa.USGS_Data;
-import java.io.BufferedReader;
+import WaterData.WaterData;
+import WaterData.WaterDataInterface;
 import java.io.File;
-import java.io.FileReader;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.text.DateFormat;
-import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
-import org.codehaus.jettison.json.JSONException;
 
 /**
-* Last Updated: 31-May-2017
+* Last Updated: 20-June-2017
 * @author Tyler Wible
 * @since 21-June-2012
 */
 public class guiDownload_Data {
     String directory = "C:/Projects/TylerWible/CodeDirectories/NetBeans/data/CFA";
     String database = "USGS";//"CDWR";//"STORET";//"CDSN";//"UserData";//
-    String organizationID = "n/a";//"n/a";//"21COL001";//"CITYFTCO_WQX";//"n/a";//
-    String stationID = "06752260";//"CLAGRECO";//"000028";//"1EFF";//"n/a";//
+    String orgId = "n/a";//"n/a";//"21COL001";//"CITYFTCO_WQX";//"n/a";//
+    String stationId = "06752260";//"CLAGRECO";//"000028";//"1EFF";//"n/a";//
     String wqTest = "flow";//"00600";//"Nitrogen, Nitrate (NO3) as NO3";//"Fecal Coliform";//"15-min flow";//"stage-discharge";//"All";//
     String beginDate = "";
     String endDate = "";
@@ -43,200 +37,17 @@
     //Sets
     public void setDirectory(String directory_str){ directory = directory_str; }
     public void setDatabase(String database_str){ database = database_str; }
-    public void setOrganizationID(String organizationID_str){ organizationID = organizationID_str; }
-    public void setStationID(String stationID_str){ stationID = stationID_str; }
+    public void setOrganizationID(String orgId_str){ orgId = orgId_str; }
+    public void setStationID(String stationId_str){ stationId = stationId_str; }
     public void setWaterQualityTest(String wqTest_str){ wqTest = wqTest_str; }
     public void setBeginDate(String beginDate_str){ beginDate = beginDate_str; }
     public void setEndDate(String endDate_str){ endDate = endDate_str; }
     /**
-     * Main CDWR data download subroutine
-     * @return  an ArrayList<String> containing the result file of the download request
-     * @throws Exception 
-     */
-    private ArrayList<String> downloadCDWRdata() throws Exception{
-        ArrayList<String> textData = new ArrayList<>();
-        
-        //Determine the type of download for CDWR: flow, hourly-flow, no aggrigation (15-min) flow, or stage-discharge
-        if(wqTest.equalsIgnoreCase("flow")){
-            //Search for CDWR flow data
-            Object[] returnArray = CDWR_Data.getCDWRflowData(stationID, beginDate, endDate, "Daily");
-            textData = (ArrayList<String>) returnArray[0];
-            //flowData = (String[][]) returnArray[1];
-            start = (String) returnArray[2];
-            end = (String) returnArray[3];
-
-        }else if(wqTest.equalsIgnoreCase("Flood Flow") || wqTest.equalsIgnoreCase("15-min flow")){
-            //Search for CDWR flow data
-            Object[] returnArray = CDWR_Data.getCDWRflowData(stationID, beginDate, endDate, "15-min");
-            textData = (ArrayList<String>) returnArray[0];
-            //flowData = (String[][]) returnArray[1];
-            start = (String) returnArray[2];
-            end = (String) returnArray[3];
-
-        }else if(wqTest.equalsIgnoreCase("stage-discharge")){
-            Object[] returnArray = CDWR_Data.getCDWRratingCurve(stationID);
-            textData = (ArrayList<String>) returnArray[0];
-            //double[][] ratingCurve = (double[][]) returnArray[1];
-
-        }else{
-            ArrayList<String> errorMessage = new ArrayList<>();
-            errorMessage.add("There is no available data available for " + wqTest + " in the CDWR database. This feature is only available for stations in the USGS-NWIS, STORET, or CDSN databases.");
-            writeError(errorMessage);
-        }
-        
-        //Check if there is actually data
-        if(textData.size() == 1){
-            //If only the headers and no data, replace with an error 
-            textData.set(0, "There is no available flow data in the " + database + " database for station '" + stationID + "' and the specified date range.");
-            textData.add("The CDWR database is sensitive to the begin date used, try specifying a later begin date");
-        }
-        
-        return textData;
-    }
-    /**
-     * Main STORET data download subroutine
-     * @return  an ArrayList<String> containing the result file of the download request
-     * @throws IOException 
-     */
-    private ArrayList<String> downloadSTORETdata(File storetResourceFile) throws IOException, InterruptedException{
-        //Determine the type of download for STORET: flow, water quality (individual test)
-        if(wqTest.equalsIgnoreCase("Flood Flow")){
-            //Since STORET doesn't have annual flood flow values, just return normal flow data to the user
-            wqTest = "flow";
-        }else if(wqTest.equalsIgnoreCase("15-min flow")){
-            //Since STORET doesn't have 15-minute data, thrown an error and alert the user of this
-            ArrayList<String> errorMessage = new ArrayList<>();
-            errorMessage.add("There is no available 15-minute flow data available for the STORET database. This feature is only available for stations in the USGS-NWIS or CDWR databases.");
-            writeError(errorMessage);
-        }else if(wqTest.equalsIgnoreCase("stage-discharge")){
-            //Since STORET doesn't have stage-discharge/rating curve data, thrown an error and alert the user of this
-            ArrayList<String> errorMessage = new ArrayList<>();
-            errorMessage.add("There is no available stage-discharge data available for the STORET database. This feature is only available for stations in the USGS-NWIS or CDWR databases.");
-            writeError(errorMessage);
-        }
-        
-        //Search STORET database using new rest service (fast)
-        File storetResultFile = STORET_Data.downloadSTORET(directory, storetResourceFile, false, organizationID, stationID, "", beginDate, endDate);
-        
-        //Read Result file
-        FileReader fr = new FileReader(storetResultFile);
-        BufferedReader textReader = new BufferedReader(fr);
-
-        ArrayList<String> textData = new ArrayList<>();
-        String currentLine;
-        while((currentLine = textReader.readLine()) !=null){
-            textData.add(currentLine);
-        }
-        textReader.close();
-        fr.close();
-        
-        return textData;
-    }
-    /**
-     * Main USGS data download subroutine
-     * @return  an ArrayList<String> containing the result file of the download request
-     * @throws IOException
-     * @throws InterruptedException 
-     */
-    private ArrayList<String> downloadUSGSdata() throws IOException, InterruptedException{
-        ArrayList<String> textData = new ArrayList<>();
-        
-        //Determine the type of download for USGS: flow, flood flow, 15-minute-flow, stage-discharge, WQ data (all), WQ data (individual test)
-        if(wqTest.equalsIgnoreCase("flow")){
-            //Retrieve flow data from USGS website
-            Object[] returnArray = USGS_Data.getUSGSflowData(stationID, beginDate, endDate);
-            textData = (ArrayList<String>) returnArray[0];
-            //String[][] flowData = (String[][]) returnArray[1];
-            start = (String) returnArray[2];
-            end = (String) returnArray[3];
-
-        }else if(wqTest.equalsIgnoreCase("Flood Flow")){
-            //Retrieve flood flow data from USGS website
-            Object[] returnArray = USGS_Data.getUSGSPeakData(stationID, beginDate, endDate);
-            textData = (ArrayList<String>) returnArray[0];
-            //double[][] floodData = (double[][]) returnArray[1];
-            start = String.valueOf((double) returnArray[2]);
-            end = String.valueOf((double) returnArray[3]);
-
-        }else if(wqTest.equalsIgnoreCase("15-min flow")){
-            //Retrive 15-minute flow data from USGS website
-            Object[] returnArray = USGS_Data.getUSGS15minFlowData(stationID, beginDate, endDate);
-            textData = (ArrayList<String>) returnArray[0];
-            //String[][] flowData = (String[][]) returnArray[1];
-            start = (String) returnArray[2];
-            end = (String) returnArray[3];
-
-        }else if(wqTest.equalsIgnoreCase("stage-discharge")){
-            //Retrive rating curve data from USGS website
-            Object[] returnArray = USGS_Data.getUSGSratingCurve(stationID);
-            textData = (ArrayList<String>) returnArray[0];
-            //double[][] ratingCurve = (double[][]) returnArray[1];
-
-        }else if(wqTest.equalsIgnoreCase("all")){
-            //Retrive all WQ data from USGS website
-            Object[] returnArray = USGS_Data.getUSGSwqData(stationID);
-            textData = (ArrayList<String>) returnArray[0];
-            //String[][] allWQdata = (String[][]) returnArray1[1];
-            start = (String) returnArray[2];
-            end = (String) returnArray[3];
-
-        }else{
-            //Retrive only the selected WQ data from USGS website
-            textData = USGS_Data.getUSGSwqData_partial(stationID, wqTest);
-        }
-        
-        return textData;
-    }
-    /**
-     * Main CDSN data download subroutine
-     * @return  an ArrayList<String> containing the result file of the download request
-     * @throws IOException
-     * @throws InterruptedException 
-     */
-    private ArrayList<String> downloadCDSNdata() throws IOException, InterruptedException, ParseException, JSONException{
-        //Determine the type of download for CDSN: flow, water quality (individual test)
-        if(wqTest.equalsIgnoreCase("Flood Flow")){
-            //Since CDSN doesn't have annual flood flow values, just return normal flow data to the user
-            wqTest = "flow";
-        }else if(wqTest.equalsIgnoreCase("15-min flow")){
-            //Since CDSN doesn't have 15-minute data, thrown an error and alert the user of this
-            ArrayList<String> errorMessage = new ArrayList<>();
-            errorMessage.add("There is no available 15-minute flow data available for the STORET database. This feature is only available for stations in the USGS-NWIS or CDWR databases.");
-            writeError(errorMessage);
-        }else if(wqTest.equalsIgnoreCase("stage-discharge")){
-            //Since CDSN doesn't have stage-discharge/rating curve data, thrown an error and alert the user of this
-            ArrayList<String> errorMessage = new ArrayList<>();
-            errorMessage.add("There is no available stage-discharge data available for the STORET database. This feature is only available for stations in the USGS-NWIS or CDWR databases.");
-            writeError(errorMessage);
-        }
-        
-        Object[] returnArray = CDSN_Data.getCDSNdata(organizationID, stationID, wqTest, beginDate, endDate);
-        ArrayList<String> resultFileContents = (ArrayList<String>) returnArray[0];
-        //flowData = (String[][]) returnArray[1];
-        start = (String) returnArray[2];
-        end = (String) returnArray[3];
-        
-        return resultFileContents;
-    }
-    /**
-     * Writes out the error message, if any, for finding the file and then exits the program
-     * @param error  string array to be written as each line of an error message
-     * @throws IOException
-     */
-    public void writeError(ArrayList<String> error) throws IOException{
-        //Output data to text file
-        String errorContents = error.get(0);
-        for(int i=1; i<error.size(); i++){
-            errorContents = errorContents + "\n" + error.get(i);
-        }
-        throw new IOException("Error encountered. Please see the following message for details: \n" + errorContents);
-    }
-    /**
      * Writes out the output file to the specified location
      * @param textData  ArrayList to be written as each line of the text file
      * @throws IOException
      */
-    public void writeOutputFile(ArrayList<String> textData) throws IOException{
+    private void writeOutputFile(ArrayList<String> textData) throws IOException{
         String path = directory + File.separator + getOutput().getName();
         FileWriter writer =  new FileWriter(path, false);
         PrintWriter print_line = new PrintWriter(writer);
@@ -267,22 +78,25 @@
             endDate = desiredDateFormat.format(currentDate);
         }
         
-        //Determine the requested download type and download data from the correct site
-        ArrayList<String> textData = new ArrayList<>();
-        if(database.equalsIgnoreCase("USGS")){
-            textData = downloadUSGSdata();
-            
-        }else if(database.equalsIgnoreCase("STORET")){
-            textData = downloadSTORETdata(storetResourceFile);
-            
-        }else if(database.equalsIgnoreCase("CDWR")){
-            textData = downloadCDWRdata();
-        }else if(database.equalsIgnoreCase("CDSN")){
-            textData = downloadCDSNdata();
+        //Determine the data type and download it for the current database/orgId/stationId
+        WaterDataInterface waterLib = WaterData.getNewWaterDataInterface(database, "", storetResourceFile);
+        ArrayList<String> rawData = new ArrayList<>();
+        if(wqTest.equalsIgnoreCase("flow")){
+            rawData = waterLib.extractFlowData_raw(directory, orgId, stationId, beginDate, endDate);
+        }else if(wqTest.equalsIgnoreCase("Flood Flow")){
+            rawData = waterLib.extractFloodData_raw(directory, orgId, stationId, beginDate, endDate);
+        }else if(wqTest.equalsIgnoreCase("15-min flow")){
+            rawData = waterLib.extractInstantaneousFlowData_raw(directory, stationId, beginDate, endDate);
+        }else if(wqTest.equalsIgnoreCase("stage-discharge")){
+            rawData = waterLib.extractStageDischarge_raw(stationId);
+        }else if(wqTest.equalsIgnoreCase("all")){
+            rawData = waterLib.extractWaterQualityData_raw(directory, orgId, stationId, beginDate, endDate, "");
+        }else{
+            rawData = waterLib.extractWaterQualityData_raw(directory, orgId, stationId, beginDate, endDate, wqTest);
         }
 
-        //write out data to text file
-         writeOutputFile(textData);
+        //Save results file
+        writeOutputFile(rawData);
     }
     public static void main(String[] args) throws IOException, InterruptedException, Exception{
         //Run Model

src/java/m/cfa/drought/guiDrought_Model.java

@@ -1,11 +1,11 @@
 package m.cfa.drought;
 
+import WaterData.WaterData;
+import WaterData.WaterDataInterface;
 import m.cfa.CircleDrawer;
-import m.cfa.Data;
 import m.cfa.DoubleArray;
 import m.cfa.DoubleMath;
 import m.cfa.Graphing;
-import m.cfa.User_Data;
 import java.awt.BasicStroke;
 import java.awt.Color;
 import java.awt.Font;
@@ -51,24 +51,24 @@
 import org.jfree.ui.TextAnchor;
 
 /**
-* Last Updated: 31-May-2017
+* Last Updated: 20-June-2017
 * @author Tyler Wible
 * @since 10-July-2012
 */
 public class guiDrought_Model {
     //Inputs
-    String directory     = "C:/Projects/TylerWible/CodeDirectories/NetBeans/data/CFA/Drought";
+    String directory = "C:/Projects/TylerWible/CodeDirectories/NetBeans/data/CFA/Drought";
     String database = "USGS";//"CDWR";//"STORET";//"CDSN";//"UserData";//
-    String organizationID = "n/a";//"n/a";//"21COL001";//"CITYFTCO_WQX";//"n/a";//
-    String stationID = "06752000";//"CLAGRECO";//"000028";//"1EFF";//"n/a";//
+    String orgId  = "n/a";//"n/a";//"21COL001";//"CITYFTCO_WQX";//"n/a";//
+    String stationId = "06752000";//"CLAGRECO";//"000028";//"1EFF";//"n/a";//
     String stationName = "CACHE LA POUDRE RIV AT MO OF CN, NR FT COLLINS, CO";//"Cache La Poudre Near Greeley";//"BIG THOMPSON R NEAR MOUTH";//"n/a";//"n/a";//
-    String beginDate     = "";//"1900-01-01";//
-    String endDate     = "";//"2002-01-01";//
+    String beginDate = "";//"1900-01-01";//
+    String endDate = "";//"2002-01-01";//
     String lambdaString    = "optimize";//"1";//
-    String action    = "all";//"optimizeModel";//"optimizeParameters";//"useParameters";//
-    String phiValues    = "1";
-    String thetaValues    = "";
-    double droughtLimit    = -1;
+    String action = "all";//"optimizeModel";//"optimizeParameters";//"useParameters";//
+    String phiValues = "1";
+    String thetaValues = "";
+    double droughtLimit = -1;
     boolean mergeDatasets = false;//true;//
     String mergeMethod = "user";//"public";//"max";//"average";//"min";//
     String userData = "";//"Date\tFlow\n1997-04-29\t8.3\n1998-05-09\t60.2\n1999-05-29\t20.1";
@@ -109,8 +109,8 @@
     //Sets
     public void setDirectory(String directory_str){ directory = directory_str; }
     public void setDatabase(String database_str){ database = database_str; }
-    public void setOrganizationID(String organizationID_str){ organizationID = organizationID_str; }
-    public void setStationID(String stationID_str){ stationID = stationID_str; }
+    public void setOrganizationID(String orgId_str){ orgId = orgId_str; }
+    public void setStationID(String stationId_str){ stationId = stationId_str; }
     public void setStationName(String stationName_str){ stationName = stationName_str; }
     public void setBeginDate(String beginDate_str){ beginDate = beginDate_str; }
     public void setEndDate(String endDate_str){ endDate = endDate_str; }
@@ -472,7 +472,7 @@
         plotTime = Graphing.setTimeAxisPreferences(plotTime);
 
         //Create the chart with the plot and a legend
-        String graphTitle = "Annual Time Series for " + database + " Station: " + stationID + "; " + stationName;
+        String graphTitle = "Annual Time Series for " + database + " Station: " + stationId + "; " + stationName;
         JFreeChart chart = new JFreeChart(graphTitle, Graphing.titleFont, plotTime, true);
 
         //Set legend Font
@@ -548,7 +548,7 @@
         plot = Graphing.setTimeAxisPreferences(plot);
 
         //Create the chart with the plot
-        String graphTitle = "Annual Drought/Surplus for " + database + " Station: " + stationID + "; " + stationName;
+        String graphTitle = "Annual Drought/Surplus for " + database + " Station: " + stationId + "; " + stationName;
         JFreeChart chart = new JFreeChart(graphTitle, Graphing.titleFont, plot, false);
 
         //Save resulting graph for use later
@@ -638,7 +638,7 @@
 
 
         //Create the chart with the plot
-        String graphTitle = "Data Correlation for " + database + " Station: " + stationID + "; " + stationName;
+        String graphTitle = "Data Correlation for " + database + " Station: " + stationId + "; " + stationName;
         JFreeChart chart = new JFreeChart(graphTitle, Graphing.titleFont, plot, false);
 
         try{
@@ -723,7 +723,7 @@
         plot = Graphing.setAxisPreferences(plot);
 
         //Create the chart with the plot
-        String graphTitle = "Projected Data for " + database + " Station: " + stationID + "; " + stationName;
+        String graphTitle = "Projected Data for " + database + " Station: " + stationId + "; " + stationName;
         JFreeChart chart = new JFreeChart(graphTitle, Graphing.titleFont, plot, true);
 
         //Set legend Font
@@ -869,7 +869,7 @@
         plot = Graphing.setAxisPreferences(plot);
 
         //Create the chart with the plot
-        String graphTitle = "Drought Recurrence Intervals for " + database + " Station: " + stationID + "; " + stationName;
+        String graphTitle = "Drought Recurrence Intervals for " + database + " Station: " + stationId + "; " + stationName;
         JFreeChart chart = new JFreeChart(graphTitle, Graphing.titleFont, plot, true);
 
         //Set legend Font
@@ -1141,12 +1141,14 @@
         }
 
         //Check if any flow data exists
-        String[][] sortableData = Data.extractFlowData(directory, storetResourceFile, database, organizationID, stationID, beginDate, endDate, userData);
+        WaterDataInterface waterLib = WaterData.getNewWaterDataInterface(database, userData, storetResourceFile);
+        String[][] sortableData = waterLib.extractFlowData_formatted(directory, orgId, stationId, beginDate, endDate);
         
         //If the user wants the datasets (public and user) merged then retrieve the second dataset (user)
         String[][] sortableData_user = new String[0][0];
         if(mergeDatasets){
-            sortableData_user = User_Data.readUserFile("UserData", stationID, userData, "flow", beginDate, endDate);
+            WaterDataInterface waterLibUser = WaterData.getNewWaterDataInterface("UserData", userData, storetResourceFile);
+            sortableData_user = waterLibUser.extractFlowData_formatted(directory, orgId, stationId, beginDate, endDate);
         }
         
         //Sort the Data by date to remove duplicate date entries
@@ -1158,13 +1160,13 @@
         if(sortedData_combined.length == 0){
             ArrayList<String> errorMessage = new ArrayList<>();
             if(sortedData.length == 0){
-                errorMessage.add("There is no available flow data in the " + database + " database for station '" + stationID + "' and the specified date range.");
+                errorMessage.add("There is no available flow data in the " + database + " database for station '" + stationId + "' and the specified date range.");
                 if(database.equalsIgnoreCase("CDWR")){
                     errorMessage.add("The CDWR database is sensitive to the begin date used, try specifying a later begin date");
                 }
             }
             if(sortedData_user.length == 0){
-                errorMessage.add("There is no available uploaded data for station '" + stationID + "' and the specified date range");
+                errorMessage.add("There is no available uploaded data for station '" + stationId + "' and the specified date range");
             }
             writeError(errorMessage);
         }

src/java/m/cfa/durationcurve/guiDC_Model.java

@@ -1,11 +1,12 @@
 package m.cfa.durationcurve;
 
-import m.cfa.Data;
+import WaterData.WaterData;
+import WaterData.WaterDataException;
+import WaterData.WaterDataInterface;
 import m.cfa.DoubleArray;
 import m.cfa.DoubleMath;
 import m.cfa.FlowStatistics;
 import m.cfa.Graphing;
-import m.cfa.User_Data;
 import java.awt.Color;
 import java.awt.geom.Ellipse2D;
 import java.awt.geom.Rectangle2D;
@@ -18,6 +19,7 @@
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
+import m.cfa.WaterQualityInfo;
 import org.codehaus.jettison.json.JSONException;
 import org.jfree.chart.ChartUtilities;
 import org.jfree.chart.JFreeChart;
@@ -33,7 +35,7 @@
 import org.jfree.data.xy.XYSeriesCollection;
 
 /**
-* Last Updated: 1-June-2017
+* Last Updated: 20-June-2017
 * @author Tyler Wible
 * @since 12-June-2011
 */
@@ -41,8 +43,8 @@
     //Inputs
     String directory = "C:/Projects/TylerWible/CodeDirectories/NetBeans/data/CFA/DurationCurve";
     String database = "USGS";//"CDWR";//"STORET";//"CDSN";//"UserData";//
-    String organizationID = "n/a";//"n/a";//"21COL001";//"CITYFTCO_WQX";//"n/a";//
-    String stationID = "06764880";//"CLAGRECO";//"000028";//"1EFF";//"n/a";//
+    String orgId = "n/a";//"n/a";//"21COL001";//"CITYFTCO_WQX";//"n/a";//
+    String stationId = "06764880";//"CLAGRECO";//"000028";//"1EFF";//"n/a";//
     String stationName = "South Platte River at Roscoe, Nebr.";//"Cache La Poudre Near Greeley";//"BIG THOMPSON R NEAR MOUTH";//"n/a";//"n/a";//
     String wqTest = "flow";//"00600 Total nitrogen, water, unfiltered, milligrams per liter -- mg/L";//"00625 Ammonia-nitrogen as N -- mg/L";//
     double wqTarget = 10;//in units of current test
@@ -112,8 +114,8 @@
     //Sets
     public void setDirectory(String directory_str){ directory = directory_str; }
     public void setDatabase(String database_str){ database = database_str; }
-    public void setOrganizationID(String organizationID_str){ organizationID = organizationID_str; }
-    public void setStationID(String stationID_str){ stationID = stationID_str; }
+    public void setOrganizationID(String orgId_str){ orgId = orgId_str; }
+    public void setStationID(String stationId_str){ stationId = stationId_str; }
     public void setStationName(String stationName_str){ stationName = stationName_str; }
     public void setWaterQualityTest(String wqTest_str){ wqTest = wqTest_str; }
     public void setWaterQualityTarget(double wqTarget_dbl){ wqTarget = wqTarget_dbl; }
@@ -152,12 +154,14 @@
         boolean mQnHide = mQnPeriod.contains("false");    
 
         //Check if any flow data exists
-        String[][] sortableData = Data.extractFlowData(directory, storetResourceFile, database, organizationID, stationID, beginDate, endDate, userData);
+        WaterDataInterface waterLib = WaterData.getNewWaterDataInterface(database, userData, storetResourceFile);
+        String[][] sortableData = waterLib.extractFlowData_formatted(directory, orgId, stationId, beginDate, endDate);
         
         //If the user wants the datasets (public and user) merged then retrieve the second dataset (user)
         String[][] sortableData_user = new String[0][0];
         if(mergeDatasets){
-            sortableData_user = User_Data.readUserFile("UserData", stationID, userData, "flow", beginDate, endDate);
+            WaterDataInterface waterLibUser = WaterData.getNewWaterDataInterface("UserData", userData, storetResourceFile);
+            sortableData_user = waterLibUser.extractFlowData_formatted(directory, orgId, stationId, beginDate, endDate);
         }
         
         //Sort the Data by date to remove duplicate date entries
@@ -169,13 +173,13 @@
         if(sortedData_combined.length == 0){
             ArrayList<String> errorMessage = new ArrayList<>();
             if(sortedData.length == 0){
-                errorMessage.add("There is no available flow data in the " + database + " database for station '" + stationID + "' and the specified date range.");
+                errorMessage.add("There is no available flow data in the " + database + " database for station '" + stationId + "' and the specified date range.");
                 if(database.equalsIgnoreCase("CDWR")){
                     errorMessage.add("The CDWR database is sensitive to the begin date used, try specifying a later begin date");
                 }
             }
             if(sortedData_user.length == 0){
-                errorMessage.add("There is no available uploaded data for station '" + stationID + "' and the specified date range");
+                errorMessage.add("There is no available uploaded data for station '" + stationId + "' and the specified date range");
             }
             writeError(errorMessage);
         }
@@ -208,7 +212,7 @@
         //Calculate the flow stats file
         FlowStatistics flowStats = new FlowStatistics();
         if(calcFlowStatisticsFileTF){
-            Object[] returnValue = flowStats.calculateAllStatisticsSummaries(directory, stationID, stationName, sortedData_combined, highPercentile, lowPercentile, 
+            Object[] returnValue = flowStats.calculateAllStatisticsSummaries(directory, stationId, stationName, sortedData_combined, highPercentile, lowPercentile, 
                     m, n, showMonthlyStatsTF, seasonBegin, seasonEnd, period1Begin, period1End, period2Begin, period2End, period3Begin, period3End, false);
             
             //Calculate low flow
@@ -464,7 +468,7 @@
         plot = Graphing.addIntervalLabel(plot, "Low Flow", 90, 100);
 
         //Graph plot onto JfreeChart
-        String graphTitle = "Flow Duration Curve for " + database + " Station " + stationID + "; " + stationName;
+        String graphTitle = "Flow Duration Curve for " + database + " Station " + stationId + "; " + stationName;
         JFreeChart chart = new JFreeChart(graphTitle, Graphing.titleFont, plot, showLegend);
 
         //Write a results file containing the flow duration curve interval (exceedance values) and their corresponding discharge values
@@ -490,19 +494,20 @@
      * @throws ParseException 
      * @throws JSONException
      */
-    private void createLDC(File storetResourceFile) throws IOException, InterruptedException, ParseException, JSONException {
+    private void createLDC(File storetResourceFile) throws IOException, InterruptedException, ParseException, JSONException, WaterDataException {
         //Check if any flow and water quality data exists
-        Object[] returnArray1 = Data.extractFlow_and_WQdata(directory, storetResourceFile, database, organizationID, stationID, beginDate, endDate, wqTest, userData);
-        String[][] sortableData = (String[][]) returnArray1[0];
-        String[][] WQdata = (String[][]) returnArray1[1];
+        
+        WaterDataInterface waterLib = WaterData.getNewWaterDataInterface(database, userData, storetResourceFile);
+        String[][] sortableData = waterLib.extractFlowData_formatted(directory, orgId, stationId, beginDate, endDate);
+        String[][] WQdata = waterLib.extractWaterQualityData_formatted(directory, orgId, stationId, beginDate, endDate, wqTest);
         
         //Find the user uploaded data file and uses this for a timeseries graph
         String[][] sortableData_user = new String[0][0];
         String[][] WQdata_user = new String[0][0];
         if(mergeDatasets){
-            Object[] returnArray2 = User_Data.readUserFileLDC("UserData", stationID, userData, wqTest, beginDate, endDate);
-            sortableData_user = (String[][]) returnArray2[0];
-            WQdata_user = (String[][]) returnArray2[1];
+            WaterDataInterface waterLibUser = WaterData.getNewWaterDataInterface("UserData", userData, storetResourceFile);
+            sortableData_user = waterLibUser.extractFlowData_formatted(directory, orgId, stationId, beginDate, endDate);
+            WQdata_user = waterLibUser.extractWaterQualityData_formatted(directory, orgId, stationId, beginDate, endDate, wqTest);
         }
         
         //Sort the Data by date to remove duplicate date entries
@@ -517,36 +522,29 @@
         ArrayList<String> errorMessage = new ArrayList<>();
         if(sortedData_combined.length == 0){
             if(sortedData.length == 0){
-                errorMessage.add("There is no available flow data in the " + database + " database for station '" + stationID + "' and the specified date range.");
+                errorMessage.add("There is no available flow data in the " + database + " database for station '" + stationId + "' and the specified date range.");
                 if(database.equalsIgnoreCase("CDWR")){
                     errorMessage.add("The CDWR database is sensitive to the begin date used, try specifying a later begin date");
                 }
             }
             if(sortedData_user.length==0){
-                errorMessage.add("There is no uploaded flow data for station '" + stationID + "' and the specified date range.");
+                errorMessage.add("There is no uploaded flow data for station '" + stationId + "' and the specified date range.");
             }
         }
         if(WQdata_combined.length == 0){
             if(WQdata.length == 0){
-                errorMessage.add("There are no available '" + wqTest + "' water quality tests in the " + database + " database for station '" + stationID + "' and the specified date range.");
+                errorMessage.add("There are no available '" + wqTest + "' water quality tests in the " + database + " database for station '" + stationId + "' and the specified date range.");
             }
             if(WQdata_user.length==0){
-                errorMessage.add("There are no uploaded '" + wqTest + "' water quality tests for station " + stationID+  " and the specified date range");
+                errorMessage.add("There are no uploaded '" + wqTest + "' water quality tests for station " + stationId+  " and the specified date range");
             }
         }
         if(errorMessage.size() > 0){
             writeError(errorMessage);
         }
         
-//        //Determine additional information for the model conversions and labels
-//        int endIndex = wqTest.lastIndexOf(", ");//"00597      Dissolved nitrogen gas, water, unfiltered, milligrams per liter -- mg/l"
-//        if(endIndex == -1){
-//            endIndex = wqTest.lastIndexOf("--");
-//        }
-//        String WQlabel = wqTest.substring(11,endIndex);//cut off the "98335      " part before the test name and the units after the name
-
         //Get Units and conversion for current WQ test
-        String[] resultArray = Data.getWQtestDataInfo(wqTest, database);
+        String[] resultArray = WaterQualityInfo.getWqTestDataInfo(wqTest, database);
         //String wqCode = resultArray[0];
         String wqLabel = resultArray[1];
         //String units = resultArray[2];
@@ -583,7 +581,7 @@
         //Calculate the flow stats file
         FlowStatistics flowStats = new FlowStatistics();
         if(calcFlowStatisticsFileTF){
-            Object[] returnValue = flowStats.calculateAllStatisticsSummaries(directory, stationID, stationName, sortedData_combined, highPercentile, lowPercentile, m, n, 
+            Object[] returnValue = flowStats.calculateAllStatisticsSummaries(directory, stationId, stationName, sortedData_combined, highPercentile, lowPercentile, m, n, 
                     showMonthlyStatsTF, seasonBegin, seasonEnd, period1Begin, period1End, period2Begin, period2End, period3Begin, period3End, false);
             
             //Calculate low flow
@@ -1178,7 +1176,7 @@
         plot = Graphing.setLogYaxisPreferences(plot);
 
         //Graph plot onto JfreeChart
-        String graphTitle = "Load Duration Curve for " + database + " Station " + stationID + "; " + stationName;
+        String graphTitle = "Load Duration Curve for " + database + " Station " + stationId + "; " + stationName;
         JFreeChart chart = new JFreeChart(graphTitle, Graphing.titleFont, plot, true);
 
         //Set legend Font

src/java/m/cfa/flood/guiFlood_Model.java

@@ -1,6 +1,7 @@
 package m.cfa.flood;
 
-import m.cfa.Data;
+import WaterData.WaterData;
+import WaterData.WaterDataInterface;
 import m.cfa.DoubleArray;
 import java.io.File;
 import java.io.FileWriter;
@@ -12,15 +13,15 @@
 import java.util.Date;
 
 /**
-* Last Updated: 31-May-2017
+* Last Updated: 20-June-2017
 * @author Tyler Wible
 * @since 13-June-2012
 */
 public class guiFlood_Model {
     String directory = "C:/Projects/TylerWible/CodeDirectories/NetBeans/data/CFA";
     String database = "USGS";//"CDWR";//"STORET";//"CDSN";//"UserData";//
-    String organizationID = "n/a";//"n/a";//"21COL001";//"CITYFTCO_WQX";//"n/a";//
-    String stationID = "06764880";//"CLAGRECO";//"000028";//"1EFF";//"n/a";//
+    String orgId = "n/a";//"n/a";//"21COL001";//"CITYFTCO_WQX";//"n/a";//
+    String stationId = "06764880";//"CLAGRECO";//"000028";//"1EFF";//"n/a";//
     String stationName = "South Platte River at Roscoe, Nebr.";//"Cache La Poudre Near Greeley";//"BIG THOMPSON R NEAR MOUTH";//"n/a";//"n/a";//
     String analysisType = "B17";
     String beginDate = "";
@@ -53,8 +54,8 @@
     //Sets
     public void setDirectory(String directory_str){ directory = directory_str; }
     public void setDatabase(String database_str){ database = database_str; }
-    public void setOrganizationID(String organizationID_str){ organizationID = organizationID_str; }
-    public void setStationID(String stationID_str){ stationID = stationID_str; }
+    public void setOrganizationID(String orgId_str){ orgId = orgId_str; }
+    public void setStationID(String stationId_str){ stationId = stationId_str; }
     public void setStationName(String stationName_str){ stationName = stationName_str; }
     public void setAnalysisType(String analysisType_str){ analysisType = analysisType_str; }
     public void setBeginDate(String beginDate_str){ beginDate = beginDate_str; }
@@ -122,12 +123,14 @@
         //Decide which analysis to perform
         if(analysisType.equalsIgnoreCase("B17")){
             //Check if any flow data exists
-            double[][] peakFlowData = Data.extractFloodData(directory, storetResourceFile, database, organizationID, stationID, beginDate, endDate, userData);
+            WaterDataInterface waterLib = WaterData.getNewWaterDataInterface(database, userData, storetResourceFile);
+            double[][] peakFlowData = waterLib.extractFloodData_formatted(directory, orgId, stationId, beginDate, endDate);
             
             //Check if merging the datasets is desired, if so get the user data
             double[][] peakFlowData_user = new double[0][0];
             if(mergeDatasets){
-                peakFlowData_user = Data.extractFloodData(directory, storetResourceFile, "UserData", "", "", beginDate, endDate, userData);
+                WaterDataInterface waterLibUser = WaterData.getNewWaterDataInterface("UserData", userData, storetResourceFile);
+                peakFlowData_user = waterLibUser.extractFloodData_formatted(directory, orgId, stationId, beginDate, endDate);
             }
             
             //Merge the two datasets (if user data is empty nothing will be merged)
@@ -135,20 +138,20 @@
             if(peakFlowData_combined.length == 0){
                 ArrayList<String> errorMessage = new ArrayList<>();
                 if(peakFlowData.length == 0){
-                    errorMessage.add("There is no available flood data in the " + database + " database for station '" + stationID + "' and the specified date range.");
+                    errorMessage.add("There is no available flood data in the " + database + " database for station '" + stationId + "' and the specified date range.");
                     if(database.equalsIgnoreCase("CDWR")){
                         errorMessage.add("The CDWR database is sensitive to the begin date used, try specifying a later begin date");
                     }
                 }
                 if(peakFlowData_user.length == 0){
-                    errorMessage.add("There is no available uploaded flow data for station '" + stationID + "' and the specified date range");
+                    errorMessage.add("There is no available uploaded flow data for station '" + stationId + "' and the specified date range");
                 }
                 writeError(errorMessage);
             }
             
             //Run Bulletin 17 function and return graph
             Bulletin17B bulletin17B = new Bulletin17B();
-            String[][] dataSummary = bulletin17B.b17(peakFlowData_combined, gg, MSERbar, directory, database, stationID, stationName, showLargeFloods, plotref, plottype);
+            String[][] dataSummary = bulletin17B.b17(peakFlowData_combined, gg, MSERbar, directory, database, stationId, stationName, showLargeFloods, plotref, plottype);
 
             //Get today's date for the source reference
             Date currentDate = new Date();

src/java/m/cfa/loadest/guiLOADEST_Model.java

@@ -1,9 +1,10 @@
 package m.cfa.loadest;
 
-import m.cfa.Data;
+import WaterData.WaterData;
+import WaterData.WaterDataException;
+import WaterData.WaterDataInterface;
 import m.cfa.DoubleArray;
 import m.cfa.DoubleMath;
-import m.cfa.User_Data;
 import csip.Executable;
 import java.io.BufferedReader;
 import java.io.File;
@@ -17,10 +18,11 @@
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
+import m.cfa.WaterQualityInfo;
 import org.codehaus.jettison.json.JSONException;
 
 /**
-* Last Updated: 31-May-2017
+* Last Updated: 20-June-2017
 * @author Tyler Wible & Tyler Dell
 * @since 27-March-2013
 */
@@ -28,8 +30,8 @@
     //Inputs
     String directory = "C:/Projects/TylerWible/CodeDirectories/NetBeans/data/CFA/LOADEST";
     String database = "USGS";//"CDWR";//"STORET";//"CDSN";//"UserData";//
-    String organizationID = "n/a";//"n/a";//"21COL001";//"CITYFTCO_WQX";//"n/a";//
-    String stationID = "06764880";//"CLAGRECO";//"000028";//"1EFF";//"n/a";//
+    String orgId = "n/a";//"n/a";//"21COL001";//"CITYFTCO_WQX";//"n/a";//
+    String stationId = "06764880";//"CLAGRECO";//"000028";//"1EFF";//"n/a";//
     String stationName = "South Platte River at Roscoe, Nebr.";//"Cache La Poudre Near Greeley";//"BIG THOMPSON R NEAR MOUTH";//"n/a";//"n/a";//
     String wqTest = "00600 Total nitrogen, water, unfiltered, milligrams per liter -- mg/L";//"00625 Ammonia-nitrogen as N -- mg/L";//
     int PTOPT = 1; // estimated values print option (0,1)
@@ -127,9 +129,9 @@
     //Sets
     public void setDirectory(String directory_str){ directory = directory_str; }
     public void setDatabase(String database_str){ database = database_str; }
-    public void setOrganizationID(String organizationID_str){ organizationID = organizationID_str; }
+    public void setOrganizationID(String orgId_str){ orgId = orgId_str; }
     public void setStationName(String stationName_str){ stationName = stationName_str; }
-    public void setStationID(String stationID_str){ stationID = stationID_str; }
+    public void setStationID(String stationId_str){ stationId = stationId_str; }
     public void setWQtest(String wqTest_str){ wqTest = wqTest_str; }
     public void setPTOPT(int PTOPT_int){ PTOPT = PTOPT_int; }
     public void setSEOPT(int SEOPT_int){ SEOPT = SEOPT_int; }
@@ -190,12 +192,12 @@
         print_line.printf("%s" + "\r\n", "#");
         print_line.printf("%s" + "\r\n", "#  LOADEST Header File");
         print_line.printf("%s" + "\r\n", "#");
-        print_line.printf("%s" + "\r\n", "# " + stationID + " " + stationName + " Database: " + database + ", Organization ID: " + organizationID);
+        print_line.printf("%s" + "\r\n", "# " + stationId + " " + stationName + " Database: " + database + ", Organization ID: " + orgId);
         print_line.printf("%s" + "\r\n", "#");
         print_line.printf("%s" + "\r\n", "######################################################################");
 
         // Inputs 1-4 Title, estimated values print option, standard error option, and load option 
-        print_line.printf("%s" + "\r\n",stationID + " " +stationName + " Database: " + database + ", Organization ID: " + organizationID);
+        print_line.printf("%s" + "\r\n",stationId + " " +stationName + " Database: " + database + ", Organization ID: " + orgId);
         print_line.printf("%s" + "\r\n", PTOPT);
         print_line.printf("%s" + "\r\n", SEOPT);
         print_line.printf("%s" + "\r\n", LDOPT);
@@ -298,7 +300,7 @@
         print_line.printf("%s" + "\r\n", "#");
         print_line.printf("%s" + "\r\n", "#  LOADEST Calibration File");
         print_line.printf("%s" + "\r\n", "#");
-        print_line.printf("%s" + "\r\n", "# " + stationID + " " + stationName + " Database: " + database + ", Organization ID: " + organizationID );
+        print_line.printf("%s" + "\r\n", "# " + stationId + " " + stationName + " Database: " + database + ", Organization ID: " + orgId);
         print_line.printf("%s" + "\r\n", "#");
         print_line.printf("%s" + "\r\n", "##########################################################################################################");
         print_line.printf("%s" + "\r\n", "#");
@@ -353,7 +355,7 @@
         print_line.printf("%s" + "\r\n", "#");
         print_line.printf("%s" + "\r\n", "#  LOADEST Estimation File");
         print_line.printf("%s" + "\r\n", "#");
-        print_line.printf("%s" + "\r\n", "# " + stationID + " " + stationName + " " + "Organization ID: " + organizationID);
+        print_line.printf("%s" + "\r\n", "# " + stationId + " " + stationName + " " + "Organization ID: " + orgId);
         print_line.printf("%s" + "\r\n", "#");
         print_line.printf("%s" + "\r\n", "######################################################################");
         print_line.printf("%s" + "\r\n", "# Number of oberservations per day");
@@ -563,7 +565,7 @@
      * @throws ParseException 
      * @throws org.codehaus.jettison.json.JSONException 
      */
-    public void run(Executable e, File storetResourceFile) throws IOException, InterruptedException, ParseException, JSONException {
+    public void run(Executable e, File storetResourceFile) throws IOException, InterruptedException, ParseException, JSONException, WaterDataException {
         //If no date input, make it the maximum of available data
         if(beginDate == null || beginDate.equalsIgnoreCase("")){
             beginDate = "1850-01-01";
@@ -576,7 +578,7 @@
         }
         
         //Correct Inputs
-        String[] resultArray = Data.getWQtestDataInfo(wqTest, database);
+        String[] resultArray = WaterQualityInfo.getWqTestDataInfo(wqTest, database);
         //String wqCode = resultArray[0];
         String wqLabel = resultArray[1];
         wqUnits = resultArray[2];
@@ -584,17 +586,17 @@
         //String endLoadUnits = resultArray[4];
         
         //Check if any flow and water quality data exists
-        Object[] returnArray1 = Data.extractFlow_and_WQdata(directory, storetResourceFile, database, organizationID, stationID, beginDate, endDate, wqTest, userData);
-        String[][] sortableData = (String[][]) returnArray1[0];
-        String[][] WQdata = (String[][]) returnArray1[1];
+        WaterDataInterface waterLib = WaterData.getNewWaterDataInterface(database, userData, storetResourceFile);
+        String[][] sortableData = waterLib.extractFlowData_formatted(directory, orgId, stationId, beginDate, endDate);
+        String[][] WQdata = waterLib.extractWaterQualityData_formatted(directory, orgId, stationId, beginDate, endDate, wqTest);
         
         //Find the user uploaded data file and uses this if merged
         String[][] sortableData_user = new String[0][0];
         String[][] WQdata_user = new String[0][0];
         if(mergeDatasets){
-            Object[] returnArray = User_Data.readUserFileLDC("UserData", stationID, userData, wqTest, beginDate, endDate);
-            sortableData_user = (String[][]) returnArray[0];
-            WQdata_user = (String[][]) returnArray[1];
+            WaterDataInterface waterLibUser = WaterData.getNewWaterDataInterface("UserData", userData, storetResourceFile);
+            sortableData_user = waterLibUser.extractFlowData_formatted(directory, orgId, stationId, beginDate, endDate);
+            WQdata_user = waterLibUser.extractWaterQualityData_formatted(directory, orgId, stationId, beginDate, endDate, wqTest);
         }
         
         //Sort the Data by date to remove duplicate date entries
@@ -609,22 +611,22 @@
         ArrayList<String> errorMessage = new ArrayList<>();
         if(sortedData_combined.length == 0){
             if(sortedData.length == 0){
-                errorMessage.add("There is no available flow data in the " + database + " database for station '" + stationID + "' and the specified date range.");
+                errorMessage.add("There is no available flow data in the " + database + " database for station '" + stationId + "' and the specified date range.");
                 if(database.equalsIgnoreCase("CDWR")){
                     errorMessage.add("The CDWR database is sensitive to the begin date used, try specifying a later begin date");
                 }
             }
             if(sortedData_user.length==0){
-                errorMessage.add("There is no uploaded flow data for station '" + stationID + "' and the specified date range.");
+                errorMessage.add("There is no uploaded flow data for station '" + stationId + "' and the specified date range.");
             }
         }
         if(WQdata_combined.length == 0){
             if(WQdata.length == 0){
-                errorMessage.add("There are no available '" + wqTest + "' water quality tests for station " + stationID+  " by: " + 
+                errorMessage.add("There are no available '" + wqTest + "' water quality tests for station " + stationId+  " by: " + 
                     database + " and the specified date range");
             }
             if(WQdata_user.length==0){
-                errorMessage.add("There are no uploaded '" + wqTest + "' water quality tests for station " + stationID+  " and the specified date range");
+                errorMessage.add("There are no uploaded '" + wqTest + "' water quality tests for station " + stationId+  " and the specified date range");
             }
         }
         if(errorMessage.size() > 0){

src/java/m/cfa/stagedischarge/guiStageDischarge_Model.java

@@ -1,6 +1,7 @@
 package m.cfa.stagedischarge;
 
-import m.cfa.Data;
+import WaterData.WaterData;
+import WaterData.WaterDataInterface;
 import m.cfa.Graphing;
 import java.awt.Color;
 import java.io.File;
@@ -17,7 +18,7 @@
 import org.jfree.chart.plot.XYPlot;
 
 /**
-* Last Updated: 31-May-2017
+* Last Updated: 20-June-2017
 * @author Tyler Wible
 * @since 24-June-2014
 */
@@ -114,7 +115,8 @@
     }
     public void run() throws IOException, Exception{
         //Get stage-discharge data
-        double[][] stageDischargeData = Data.extractStageDischarge(database, stationID);
+        WaterDataInterface waterLib = WaterData.getNewWaterDataInterface(database, "", null);
+        double[][] stageDischargeData = waterLib.extractStageDischarge_formatted(stationID);
         
         //Check if any rating curve data exists
         if(stageDischargeData.length == 0){

src/java/m/cfa/storetservice/V1_0.java

@@ -1,10 +1,15 @@
 package m.cfa.storetservice;
 
-import m.cfa.STORET_Data;
+import WaterData.WaterData;
+import WaterData.WaterDataInterface;
 import csip.ModelDataService;
 import csip.annotations.Resource;
 import static csip.annotations.ResourceType.FILE;
 import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
 import javax.ws.rs.Path;
 import oms3.annotations.Description;
 import oms3.annotations.Name;
@@ -17,27 +22,61 @@
 @Resource(file = "/python/driver.py", type = FILE, id = "driver")
 public class V1_0 extends ModelDataService {
 
-    File result_file = null;
-
+    File resultFile = null;
+    
     @Override
     protected String process() throws Exception {
-        //Setup directory/result file
-        result_file = STORET_Data.downloadSTORET(getWorkspaceDir().toString(), 
-                                   getResourceFile("driver"), 
-                                   false, 
-                                   getStringParam("org_id"), 
-                                   getStringParam("station_id"), 
-                                   getStringParam("wq_test"), 
-                                   getStringParam("begin_date"), 
-                                   getStringParam("end_date"));
+        //Get Inputs
+        String directory = getWorkspaceDir().toString();
+        String orgId = getStringParam("org_id");
+        String stationId = getStringParam("station_id");
+        String wqTest = getStringParam("wq_test");
+        String beginDate = getStringParam("begin_date");
+        String endDate = getStringParam("end_date");
+        
+        //Extract data from database
+        WaterDataInterface waterLib = WaterData.getNewWaterDataInterface("STORET", "", getResourceFile("driver"));
+        ArrayList<String> rawData = new ArrayList<>();
+        if(wqTest.equalsIgnoreCase("flow")){
+            rawData = waterLib.extractFlowData_raw(directory, orgId, stationId, beginDate, endDate);
+        }else{
+            rawData = waterLib.extractWaterQualityData_raw(directory, orgId, stationId, beginDate, endDate, wqTest);
+        }
+        
+        //Save results file
+        String fileName = "STORET_" + orgId + "_" + stationId + "_results.txt";
+        fileName = fileName.replace("/", "");
+        resultFile = new File(directory, fileName);
+        writeResultFile(directory, fileName, rawData);
+                
         return EXEC_OK;
     }
 
     @Override
     protected void postProcess() throws Exception {
         // files
-        putResult(result_file);
+        putResult(resultFile);
         // values
-        putResult("result_file", result_file.getName());
+        putResult("result_file", resultFile.getName());
+    }
+    
+    /**
+     * Writes out the output file to the specified location
+     * @param directory  the working directory to create the file in
+     * @param fileName  the name of the result file
+     * @param rawData  ArrayList to be written as each line of the text file
+     * @throws IOException 
+     */
+    private void writeResultFile(String directory, String fileName, ArrayList<String> rawData) throws IOException{
+        //Write output to file
+        String path = directory + File.separator + fileName;
+        FileWriter writer =  new FileWriter(path, false);
+        PrintWriter print_line = new PrintWriter(writer);
+        for(int i=0; i<rawData.size(); i++){
+            print_line.printf("%s" + "\r\n", rawData.get(i));
+        }
+        print_line.close();
+        writer.close();
+        System.out.println("File located at: " + path);
     }
 }

src/java/m/cfa/timeseries/guiTimeseries_Model.java

@@ -1,12 +1,12 @@
 package m.cfa.timeseries;
 
+import WaterData.WaterData;
+import WaterData.WaterDataInterface;
 import csip.Executable;
 import m.cfa.FlowStatistics;
-import m.cfa.Data;
 import m.cfa.DoubleArray;
 import m.cfa.DoubleMath;
 import m.cfa.Graphing;
-import m.cfa.User_Data;
 import java.awt.BasicStroke;
 import java.awt.Color;
 import java.awt.Paint;
@@ -21,6 +21,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
+import m.cfa.WaterQualityInfo;
 import org.jfree.chart.ChartUtilities;
 import org.jfree.chart.JFreeChart;
 import org.jfree.chart.axis.AxisLocation;
@@ -53,7 +54,7 @@
 import org.jfree.ui.RectangleInsets;
 
 /**
-* Last Updated: 31-May-2017
+* Last Updated: 20-June-2017
 * @author Tyler Wible
 * @since 24-June-2011
 */
@@ -61,8 +62,8 @@
     //Inputs
     String directory = "C:/Projects/TylerWible/CodeDirectories/NetBeans/data/CFA/Timeseries";
     String database = "USGS";//"CDWR";//"STORET";//"CDSN";//"UserData";//
-    String organizationID = "n/a";//"n/a";//"21COL001";//"CITYFTCO_WQX";//"n/a";//
-    String stationID = "06764880";//"CLAGRECO";//"000028";//"1EFF";//"n/a";//
+    String orgId = "n/a";//"n/a";//"21COL001";//"CITYFTCO_WQX";//"n/a";//
+    String stationId = "06764880";//"CLAGRECO";//"000028";//"1EFF";//"n/a";//
     String stationName = "South Platte River at Roscoe, Nebr.";//"Cache La Poudre Near Greeley";//"BIG THOMPSON R NEAR MOUTH";//"n/a";//"n/a";//
     String wqTest = "flow";//"00600 Total nitrogen, water, unfiltered, milligrams per liter -- mg/L";//"00625 Ammonia-nitrogen as N -- mg/L";//
     String beginDate = "";
@@ -290,11 +291,11 @@
     //Sets
     public void setDirectory(String directory_str){ directory = directory_str; }
     public void setDatabase(String database_str){ database = database_str; }
-    public void setOrganizationID(String organizationID_str){ organizationID = organizationID_str; }
+    public void setOrganizationID(String orgId_str){ orgId = orgId_str; }
     public void setBeginDate(String beginDate_str){ beginDate = beginDate_str; }
     public void setEndDate(String endDate_str){ endDate = endDate_str; }
     public void setStationName(String stationName_str){ stationName = stationName_str; }
-    public void setStationID(String stationID_str){ stationID = stationID_str; }
+    public void setStationID(String stationId_str){ stationId = stationId_str; }
     public void setWQtest(String wqTest_str){ wqTest = wqTest_str; }
     public void setTimeStep(String timeStep_str){ timeStep = timeStep_str; }
     public void setMethod(String method_str){ method = method_str; }
@@ -439,7 +440,6 @@
      * @param color2  the color of the user dataset (Java.Color)
      * @param showLine  a boolean, if true lines will be shown on the graph, if false only shapes for the data
      * @param yAxisTitle  the String label for the y axis of the graph
-     * @param units  the units of the current graph to be used in labeling for the legend
      */
     private void createTimeseriesGraph(String[][] sortedData,
                                        String[][] sortedData_user,
@@ -449,8 +449,7 @@
                                        Color color,
                                        Color color2,
                                        boolean showLine,
-                                       String yAxisTitle,
-                                       String units) throws ParseException, IOException {
+                                       String yAxisTitle) throws ParseException, IOException {
         DateFormat periodDateFormat = DoubleArray.getDateFormat("daily",  false);
         Date jfreeChartDateLimit = periodDateFormat.parse("1900-01-01");
         
@@ -522,8 +521,8 @@
         //Create TimeSeries graph of merged data
         XYPlot plotTime = new XYPlot();
         boolean showLegend = false;
-        TimeSeries series = Graphing.createTimeSeriesFromData(sortedData, stationID + ": Data", timeStep);
-        TimeSeries series2 = Graphing.createTimeSeriesFromData(sortedData_user, stationID + ": User Data", timeStep);
+        TimeSeries series = Graphing.createTimeSeriesFromData(sortedData, stationId + ": Data", timeStep);
+        TimeSeries series2 = Graphing.createTimeSeriesFromData(sortedData_user, stationId + ": User Data", timeStep);
         
         //Create user data points
         if(sortedData_user.length != 0){//only show user points if it is not zero
@@ -619,7 +618,7 @@
         plotTime = Graphing.setTimeAxisPreferences(plotTime);
 
         //Create the chart with the plot and a legend
-        String graphTitle = "Time Series for " + database + " Station: " + stationID + "; " + stationName;
+        String graphTitle = "Time Series for " + database + " Station: " + stationId + "; " + stationName;
         JFreeChart chart = new JFreeChart(graphTitle, Graphing.titleFont, plotTime, showLegend);
         
         //Set legend Font
@@ -841,11 +840,11 @@
         double[][] xyRanks_period3 = DoubleArray.weibullPlottingPosition(period3Data);
         
         //Calculate cdf for the entire dataset
-        XYSeries series = new XYSeries(stationID + ": Data");
-        XYSeries series_user = new XYSeries(stationID + ": User Data");
-        XYSeries period1_series = new XYSeries(stationID + ": Period 1");
-        XYSeries period2_series = new XYSeries(stationID + ": Period 2");
-        XYSeries period3_series = new XYSeries(stationID + ": Period 3");
+        XYSeries series = new XYSeries(stationId + ": Data");
+        XYSeries series_user = new XYSeries(stationId + ": User Data");
+        XYSeries period1_series = new XYSeries(stationId + ": Period 1");
+        XYSeries period2_series = new XYSeries(stationId + ": Period 2");
+        XYSeries period3_series = new XYSeries(stationId + ": Period 3");
         String[][] cdfData = new String[xyRanks.length][8];
         for(int i=0; i<xyRanks.length; i++){
             double x = xyRanks[i][1]; //flow
@@ -958,7 +957,7 @@
         plot = Graphing.setLogXaxisPreferences(plot);
 
         //Create the charts out of the plots
-        String graphTitle = "CDF for " + database + " Station: " + stationID + "; " + stationName;
+        String graphTitle = "CDF for " + database + " Station: " + stationId + "; " + stationName;
         JFreeChart chart = new JFreeChart(graphTitle, Graphing.titleFont, plot, legendTF);
         
         //Set legend Font
@@ -1259,7 +1258,7 @@
             plot = Graphing.setAxisPreferences(plot);
 
             //Create the charts out of the plots
-            String graphTitle = "Time Series Range for " + database + " Station: " + stationID + "; " + stationName;
+            String graphTitle = "Time Series Range for " + database + " Station: " + stationId + "; " + stationName;
             JFreeChart chart = new JFreeChart(graphTitle, Graphing.titleFont, plot, true);
 
             //Set legend Font
@@ -1365,7 +1364,7 @@
         plot = Graphing.setAxisPreferences(plot);
 
         //Create the charts out of the plots
-        String graphTitle = "Raster Graph for " + database + " Station: " + stationID + "; " + stationName;
+        String graphTitle = "Raster Graph for " + database + " Station: " + stationId + "; " + stationName;
         JFreeChart chart = new JFreeChart(graphTitle, Graphing.titleFont, plot, false);
         
         //Add scale/legend
@@ -1636,7 +1635,7 @@
         plot = Graphing.setCategoryAxisPreferences(plot);
         
         //Create the chart with the plot
-        String graphTitle = "Histogram for " + database + " Station: " + stationID + "; " + stationName;
+        String graphTitle = "Histogram for " + database + " Station: " + stationId + "; " + stationName;
         JFreeChart chart = new JFreeChart(graphTitle, Graphing.titleFont, plot, legendTF);
         
         //Set legend Font
@@ -1687,10 +1686,10 @@
         
         //Calculate monthly averages for the entire dataset
         XYPlot plot = new XYPlot();
-        XYSeries series = new XYSeries(stationID + ": Data");
-        XYSeries period1_series = new XYSeries(stationID + ": Period 1 Data");
-        XYSeries period2_series = new XYSeries(stationID + ": Period 2 Data");
-        XYSeries period3_series = new XYSeries(stationID + ": Period 3 Data");
+        XYSeries series = new XYSeries(stationId + ": Data");
+        XYSeries period1_series = new XYSeries(stationId + ": Period 1 Data");
+        XYSeries period2_series = new XYSeries(stationId + ": Period 2 Data");
+        XYSeries period3_series = new XYSeries(stationId + ": Period 3 Data");
 //        ArrayList<ArrayList<Double>> boxplotOutliers = new ArrayList<>();
 //        double[][] boxplotData = new double[5][12];
         String[][] monthXYdata = new String[12][8];
@@ -1904,7 +1903,7 @@
         plot = Graphing.setAxisPreferences(plot);
 
         //Create the charts out of the plots
-        String graphTitle = "Monthly Averages for " + database + " Station: " + stationID + "; " + stationName;
+        String graphTitle = "Monthly Averages for " + database + " Station: " + stationId + "; " + stationName;
         JFreeChart chart = new JFreeChart(graphTitle, Graphing.titleFont, plot, legendTF);
         
         //Set legend Font
@@ -1961,41 +1960,46 @@
         //Initialize graph variables
         String yAxisTitle = "y axis";
         String monthlyYaxisTitle = "y axis";
-        String WQlabel = "??";
-        String graphUnits = "??";
         Color color = Color.black, color2 = Color.black;
         boolean showLine = true;
         
         String[][] sortableData = new String[0][2];
         if(wqTest.equalsIgnoreCase("flow")){
             //Check if any flow data exists
-            sortableData = Data.extractFlowData(directory, storetResourceFile, database, organizationID, stationID, beginDate, endDate, userData);
+            WaterDataInterface waterLib = WaterData.getNewWaterDataInterface(database, userData, storetResourceFile);
+            sortableData = waterLib.extractFlowData_formatted(directory, orgId, stationId, beginDate, endDate);
 
             //Define other graph information
-            graphUnits = "cfs";
+            units = "cfs";
             if(timeStep.equalsIgnoreCase("Daily")){
-                yAxisTitle = timeStep + " Flow [" + graphUnits + "]";
+                yAxisTitle = timeStep + " Flow [cfs]";
             }else{
-                yAxisTitle = timeStep + " " + method + " Flow [" + graphUnits + "]";
+                yAxisTitle = timeStep + " " + method + " Flow [cfs]";
             }
-            monthlyYaxisTitle = "Monthly Average Flow [" + graphUnits + "]";
+            monthlyYaxisTitle = "Monthly Average Flow [cfs]";
             color = Color.blue;
             color2 = Color.darkGray;
             showLine = true;
         }else{
             //Search for WQ data
-            Object[] returnArray = Data.extractWQdata(directory, storetResourceFile, database, organizationID, stationID, beginDate, endDate, wqTest, userData);
-            sortableData = (String[][]) returnArray[0];
-            graphUnits = (String) returnArray[1];
-            WQlabel = (String) returnArray[2];
+            WaterDataInterface waterLib = WaterData.getNewWaterDataInterface(database, userData, storetResourceFile);
+            sortableData = waterLib.extractWaterQualityData_formatted(directory, orgId, stationId, beginDate, endDate, wqTest);
+            
+            //Get Units and conversion for current WQ test
+            String[] resultArray = WaterQualityInfo.getWqTestDataInfo(wqTest, database);
+            //String wqCode = resultArray[0];
+            String wqLabel = resultArray[1];
+            units = resultArray[2];
+            //double conversion = Double.parseDouble(resultArray[3]);
+            //String endUnits = resultArray[4];
 
             //Define other graph information
             if(timeStep.equalsIgnoreCase("Daily")){
-                yAxisTitle = timeStep + " " + WQlabel + " [" + graphUnits + "]";
+                yAxisTitle = timeStep + " " + wqLabel + " [" + units + "]";
             }else{
-                yAxisTitle = timeStep + " " + method + " " + WQlabel + " [" + graphUnits + "]";
+                yAxisTitle = timeStep + " " + method + " " + wqLabel + " [" + units + "]";
             }
-            monthlyYaxisTitle = "Monthly Average " + WQlabel + " [" + graphUnits + "]";
+            monthlyYaxisTitle = "Monthly Average " + wqLabel + " [" + units + "]";
             color = Color.magenta;
             color2 = Color.blue;
             showLine = false;
@@ -2004,7 +2008,12 @@
         //Check if merging the datasets is desired, if so get the user data
         String[][] sortableData_user = new String[0][0];
         if(mergeDatasets){
-            sortableData_user = User_Data.readUserFile("UserData", stationID, userData, wqTest, beginDate, endDate);
+            WaterDataInterface waterLibUser = WaterData.getNewWaterDataInterface("UserData", userData, storetResourceFile);
+            if(wqTest.equalsIgnoreCase("flow")){
+                sortableData = waterLibUser.extractFlowData_formatted(directory, orgId, stationId, beginDate, endDate);
+            }else{
+                sortableData = waterLibUser.extractWaterQualityData_formatted(directory, orgId, stationId, beginDate, endDate, wqTest);
+            }
         }
         
         //Sort the Data by date to remove duplicate date entries
@@ -2016,13 +2025,13 @@
         if(sortedData_combined.length == 0){
             ArrayList<String> errorMessage = new ArrayList<>();
             if(sortableData.length == 0){
-                errorMessage.add("There is no available " + wqTest + " data in the " + database + " database for station '" + stationID + "' and the specified date range.");
+                errorMessage.add("There is no available " + wqTest + " data in the " + database + " database for station '" + stationId + "' and the specified date range.");
                 if(database.equalsIgnoreCase("CDWR")){
                     errorMessage.add("The CDWR database is sensitive to the begin date used, try specifying a later begin date");
                 }
             }
             if(sortedData_user.length == 0){
-                errorMessage.add("There is no available uploaded data for station '" + stationID + "' and the specified date range");
+                errorMessage.add("There is no available uploaded data for station '" + stationId + "' and the specified date range");
             }
             writeError(errorMessage);
         }
@@ -2049,7 +2058,7 @@
             
             //Calculate Hydrologic Indicators of Alteration
             if(calcFlowStatisticsFileTF){
-                flowStats.calculateAllStatisticsSummaries(directory, stationID, stationName, sortedData_combined, highPercentile, lowPercentile, 0, 0, showMonthlyStatsTF,
+                flowStats.calculateAllStatisticsSummaries(directory, stationId, stationName, sortedData_combined, highPercentile, lowPercentile, 0, 0, showMonthlyStatsTF,
                         seasonBegin, seasonEnd, period1Begin, period1End, period2Begin, period2End, period3Begin, period3End, waterYearTF);
             }
             
@@ -2178,7 +2187,7 @@
         CalculateStatistics(seasonalData, "seasonal");
         
         //Graph the timeseries data
-        createTimeseriesGraph(sortedData_combined, sortedData_user, period1Data, period2Data, period3Data, color, color2, showLine, yAxisTitle, graphUnits);
+        createTimeseriesGraph(sortedData_combined, sortedData_user, period1Data, period2Data, period3Data, color, color2, showLine, yAxisTitle);
         createTimeseriesBoxplot(sortedData_combined, yAxisTitle);
         createTimeseriesHistogram(sortedData_combined, sortedData_user, period1Data, period2Data, period3Data, color, yAxisTitle);
         createTimeseriesCDF(sortedData_combined, sortedData_user, period1Data, period2Data, period3Data, color, color2, yAxisTitle);
@@ -2196,7 +2205,6 @@
             dataSource = "Stream flow data provided by the user. Flow analysis accessed: " + today;
         }
         len = String.valueOf(sortedData_combined.length);
-        units = graphUnits;
     }
     public static void main(String[] args) throws IOException, InterruptedException, Exception {
         //Run model

src/java/m/cfa/timeseries15min/gui15minTimeseries_Model.java

@@ -1,11 +1,11 @@
 package m.cfa.timeseries15min;
 
+import WaterData.WaterData;
+import WaterData.WaterDataInterface;
 import m.cfa.DateComparator;
-import m.cfa.Data;
 import m.cfa.DoubleArray;
 import m.cfa.DoubleMath;
 import m.cfa.Graphing;
-import m.cfa.User_Data;
 import java.awt.Color;
 import java.io.File;
 import java.io.FileWriter;
@@ -30,14 +30,14 @@
 import org.jfree.data.time.TimeSeries;
 
 /**
-* Last Updated: 31-May-2017
+* Last Updated: 20-June-2017
 * @author Tyler Wible
 * @since 23-June-2014
 */
 public class gui15minTimeseries_Model {
     String directory = "C:/Projects/TylerWible/CodeDirectories/NetBeans/data/CFA/Timeseries";
     String database = "USGS";//"CDWR";
-    String stationID = "06752260";//"CLAGRECO";
+    String stationId = "06752260";//"CLAGRECO";
     String stationName = "CACHE LA POUDRE RIVER AT FORT COLLINS, CO";//"Cache La Poudre Near Greeley";
     String beginDate = "";//yyyy-MM-dd
     String endDate = "";//yyyy-MM-dd
@@ -83,7 +83,7 @@
     //Sets
     public void setDirectory(String directory_str){ directory = directory_str; }
     public void setDatabase(String database_str){ database = database_str; }
-    public void setStationID(String stationID_str){ stationID = stationID_str; }
+    public void setStationID(String stationId_str){ stationId = stationId_str; }
     public void setStationName(String stationName_str){ stationName = stationName_str; }
     public void setBeginDate(String beginDate_str){ beginDate = beginDate_str; }
     public void setEndDate(String endDate_str){ endDate = endDate_str; }
@@ -167,7 +167,7 @@
     private void createTimeseriesGraph(String[][] sortedData,
                                        String[][] sortedData_user) throws ParseException, IOException {
         //Create TimeSeries graph of merged data
-        TimeSeries series = new TimeSeries(stationID + ": Data");
+        TimeSeries series = new TimeSeries(stationId + ": Data");
         DateFormat desiredDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
         Date jfreeChartDateLimit = desiredDateFormat.parse("1900-01-01 00:00");
         String[][] graphData = new String[sortedData.length][2];
@@ -192,7 +192,7 @@
         }
         
         //Create Time Series graph of user data
-        TimeSeries series2 = new TimeSeries(stationID + ": User Data");
+        TimeSeries series2 = new TimeSeries(stationId + ": User Data");
         for(int i=0; i < sortedData_user.length; i++) {
             double value = Double.parseDouble(sortedData_user[i][1]);
             //artificial limit for JFreeCharts' "Day" class
@@ -232,7 +232,7 @@
         plotTime = Graphing.setTimeAxisPreferences(plotTime);
 
         //Create the chart with the plot and a legend
-        String graphTitle = "Time Series for " + database + " Station " + stationID + "; " + stationName;
+        String graphTitle = "Time Series for " + database + " Station " + stationId + "; " + stationName;
         JFreeChart chart = new JFreeChart(graphTitle, Graphing.titleFont, plotTime, showLegend);
         
         //Set legend Font
@@ -305,12 +305,14 @@
         }
         
         //Check if any flow data exists
-        String[][] sortableData = Data.extractInstantaneousFlowData(directory, database, stationID, beginDate, endDate, userData);
+        WaterDataInterface waterLib = WaterData.getNewWaterDataInterface(database, "", null);
+        String[][] sortableData = waterLib.extractInstantaneousFlowData_formatted(directory, stationId, beginDate, endDate);
         
         //If the user wants the datasets (public and user) merged then retrieve the second dataset (user)
         String[][] sortableData_user = new String[0][0];
         if(mergeDatasets){
-            sortableData_user = User_Data.read15minUserFile(userData, "flow", beginDate, endDate);
+            WaterDataInterface waterLibUser = WaterData.getNewWaterDataInterface("UserData", userData, null);
+            sortableData = waterLibUser.extractInstantaneousFlowData_formatted(directory, stationId, beginDate, endDate);
         }
         
         //Sort the Data by date to remove duplicate date entries
@@ -322,13 +324,13 @@
         if(sortedData_combined.length == 0){
             ArrayList<String> errorMessage = new ArrayList<>();
             if(sortableData.length == 0){
-                errorMessage.add("There is no available 15-minute (instantaneous) flow data in the " + database + " database for station '" + stationID + "' and the specified date range.");
+                errorMessage.add("There is no available 15-minute (instantaneous) flow data in the " + database + " database for station '" + stationId + "' and the specified date range.");
                 if(database.equalsIgnoreCase("CDWR")){
                     errorMessage.add("The CDWR database is sensitive to the begin date used, try specifying a later begin date");
                 }
             }
             if(sortableData_user.length == 0){
-                errorMessage.add("There is no available 15-minute (instantaneous) uploaded data for station '" + stationID + "' and the specified date range");
+                errorMessage.add("There is no available 15-minute (instantaneous) uploaded data for station '" + stationId + "' and the specified date range");
             }
             writeError(errorMessage);
         }