Starting work on separating indexing and web frontend for the attributed indexer backend
authorJan Lahoda <jlahoda@netbeans.org>
Mon, 20 Jun 2011 23:27:31 +0200
changeset 5918c7e6dfbb560
parent 590 be1c327c2594
child 593 d88e4597c5c6
Starting work on separating indexing and web frontend for the attributed indexer backend
bridges/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteGoToType.java
build.xml
hudson/trunk
server/backend/base.web.api/build.xml
server/backend/base.web.api/manifest.mf
server/backend/base.web.api/nbproject/build-impl.xml
server/backend/base.web.api/nbproject/genfiles.properties
server/backend/base.web.api/nbproject/project.properties
server/backend/base.web.api/nbproject/project.xml
server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/CategoryStorage.java
server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/FreemarkerUtilities.java
server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/RelStreamHandlerFactory.java
server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/WebUtilities.java
server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/api/API.java
server/backend/build-indexing-backend
server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/MainPage.java
server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/OptionProcessorImpl.java
server/backend/scripts/index.sh
server/backend/scripts/web.sh
server/backend/type.web.api/build.xml
server/backend/type.web.api/manifest.mf
server/backend/type.web.api/nbproject/build-impl.xml
server/backend/type.web.api/nbproject/genfiles.properties
server/backend/type.web.api/nbproject/project.properties
server/backend/type.web.api/nbproject/project.xml
server/backend/type.web.api/src/org/netbeans/modules/jackpot30/backend/type/api/API.java
server/backend/type.web.api/src/org/netbeans/modules/jackpot30/backend/type/ui/UI.java
server/backend/type.web.api/src/org/netbeans/modules/jackpot30/backend/type/ui/ui-findType.html
server/backend/web.main/build.xml
server/backend/web.main/manifest.mf
server/backend/web.main/nbproject/build-impl.xml
server/backend/web.main/nbproject/genfiles.properties
server/backend/web.main/nbproject/project.properties
server/backend/web.main/nbproject/project.xml
server/backend/web.main/src/web/main/MainPage.java
server/backend/web.main/src/web/main/WebMain.java
server/download.xml
server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/IndexingBuilder.java
server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/StartWebFrontEnd.java
server/temp-build-indexing-backend
     1.1 --- a/bridges/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteGoToType.java	Mon Jun 20 20:20:46 2011 +0200
     1.2 +++ b/bridges/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteGoToType.java	Mon Jun 20 23:27:31 2011 +0200
     1.3 @@ -92,7 +92,7 @@
     1.4      public void computeTypeNames(Context context, Result result) {
     1.5          for (RemoteIndex ri : RemoteIndex.loadIndices()) {
     1.6              try {
     1.7 -                URI resolved = new URI(ri.remote.toExternalForm() + "/findType?path=" + WebUtilities.escapeForQuery(ri.remoteSegment) + "&prefix=" + WebUtilities.escapeForQuery(context.getText()));
     1.8 +                URI resolved = new URI(ri.remote.toExternalForm() + "/type/search?path=" + WebUtilities.escapeForQuery(ri.remoteSegment) + "&prefix=" + WebUtilities.escapeForQuery(context.getText()));
     1.9                  @SuppressWarnings("unchecked") //XXX: should not trust something got from the network!
    1.10                  Map<String, List<String>> types = Pojson.load(LinkedHashMap.class, WebUtilities.requestStringResponse(resolved));
    1.11  
     2.1 --- a/build.xml	Mon Jun 20 20:20:46 2011 +0200
     2.2 +++ b/build.xml	Mon Jun 20 23:27:31 2011 +0200
     2.3 @@ -15,8 +15,15 @@
     2.4          <copy file="${nbplatform.active.dir}/platform/lib/org-openide-util.jar" todir="server/lib" />
     2.5          <copy file="${nbplatform.active.dir}/platform/lib/org-openide-util-lookup.jar" todir="server/lib" />
     2.6          <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-spi-editor-hints.jar" todir="server/lib" />
     2.7 +        <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-api-java-classpath.jar" todir="server/lib" />
     2.8          <copy file="${nbplatform.active.dir}/java/modules/ext/javac-api-nb-7.0-b07.jar" todir="server/lib/javac" />
     2.9          <copy file="${nbplatform.active.dir}/java/modules/ext/javac-impl-nb-7.0-b07.jar" todir="server/lib/javac" />
    2.10 +        <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-modules-jumpto.jar" todir="server/lib" />
    2.11 +        <copy file="${nbplatform.active.dir}/platform/modules/org-netbeans-modules-masterfs.jar" todir="server/lib" />
    2.12 +        <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-modules-parsing-lucene.jar" todir="server/lib" />
    2.13 +        <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-modules-parsing-api.jar" todir="server/lib" />
    2.14 +        <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-modules-projectapi.jar" todir="server/lib" />
    2.15 +        <copy file="${nbplatform.active.dir}/java/modules/org-netbeans-modules-java-project.jar" todir="server/lib" />
    2.16      </target>
    2.17      
    2.18      <target name="findbugs" depends="-init">
     3.1 --- a/hudson/trunk	Mon Jun 20 20:20:46 2011 +0200
     3.2 +++ b/hudson/trunk	Mon Jun 20 23:27:31 2011 +0200
     3.3 @@ -60,5 +60,4 @@
     3.4  mkdir -p build/server
     3.5  (cp server/do-indexing server/indexer/dist; cd server/indexer/dist/; zip -r ../../../build/server/indexer.zip *)
     3.6  (cd server/web.api/dist/; zip -r ../../../build/server/web.api.zip *)
     3.7 -(cd server/backend; call_ant clean && call_ant build && call_ant test && call_ant build-zip) || exit
     3.8 -(cd server; ./temp-build-indexing-backend) || exit
     3.9 +(cd server/backend; ./build-indexing-backend) || exit
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/server/backend/base.web.api/build.xml	Mon Jun 20 23:27:31 2011 +0200
     4.3 @@ -0,0 +1,74 @@
     4.4 +<?xml version="1.0" encoding="UTF-8"?>
     4.5 +<!-- You may freely edit this file. See commented blocks below for -->
     4.6 +<!-- some examples of how to customize the build. -->
     4.7 +<!-- (If you delete it and reopen the project it will be recreated.) -->
     4.8 +<!-- By default, only the Clean and Build commands use this build script. -->
     4.9 +<!-- Commands such as Run, Debug, and Test only use this build script if -->
    4.10 +<!-- the Compile on Save feature is turned off for the project. -->
    4.11 +<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
    4.12 +<!-- in the project's Project Properties dialog box.-->
    4.13 +<project name="base.web.api" default="default" basedir=".">
    4.14 +    <description>Builds, tests, and runs the project base.web.api.</description>
    4.15 +    <import file="nbproject/build-impl.xml"/>
    4.16 +    <!--
    4.17 +
    4.18 +    There exist several targets which are by default empty and which can be 
    4.19 +    used for execution of your tasks. These targets are usually executed 
    4.20 +    before and after some main targets. They are: 
    4.21 +
    4.22 +      -pre-init:                 called before initialization of project properties
    4.23 +      -post-init:                called after initialization of project properties
    4.24 +      -pre-compile:              called before javac compilation
    4.25 +      -post-compile:             called after javac compilation
    4.26 +      -pre-compile-single:       called before javac compilation of single file
    4.27 +      -post-compile-single:      called after javac compilation of single file
    4.28 +      -pre-compile-test:         called before javac compilation of JUnit tests
    4.29 +      -post-compile-test:        called after javac compilation of JUnit tests
    4.30 +      -pre-compile-test-single:  called before javac compilation of single JUnit test
    4.31 +      -post-compile-test-single: called after javac compilation of single JUunit test
    4.32 +      -pre-jar:                  called before JAR building
    4.33 +      -post-jar:                 called after JAR building
    4.34 +      -post-clean:               called after cleaning build products
    4.35 +
    4.36 +    (Targets beginning with '-' are not intended to be called on their own.)
    4.37 +
    4.38 +    Example of inserting an obfuscator after compilation could look like this:
    4.39 +
    4.40 +        <target name="-post-compile">
    4.41 +            <obfuscate>
    4.42 +                <fileset dir="${build.classes.dir}"/>
    4.43 +            </obfuscate>
    4.44 +        </target>
    4.45 +
    4.46 +    For list of available properties check the imported 
    4.47 +    nbproject/build-impl.xml file. 
    4.48 +
    4.49 +
    4.50 +    Another way to customize the build is by overriding existing main targets.
    4.51 +    The targets of interest are: 
    4.52 +
    4.53 +      -init-macrodef-javac:     defines macro for javac compilation
    4.54 +      -init-macrodef-junit:     defines macro for junit execution
    4.55 +      -init-macrodef-debug:     defines macro for class debugging
    4.56 +      -init-macrodef-java:      defines macro for class execution
    4.57 +      -do-jar-with-manifest:    JAR building (if you are using a manifest)
    4.58 +      -do-jar-without-manifest: JAR building (if you are not using a manifest)
    4.59 +      run:                      execution of project 
    4.60 +      -javadoc-build:           Javadoc generation
    4.61 +      test-report:              JUnit report generation
    4.62 +
    4.63 +    An example of overriding the target for project execution could look like this:
    4.64 +
    4.65 +        <target name="run" depends="base.web.api-impl.jar">
    4.66 +            <exec dir="bin" executable="launcher.exe">
    4.67 +                <arg file="${dist.jar}"/>
    4.68 +            </exec>
    4.69 +        </target>
    4.70 +
    4.71 +    Notice that the overridden target depends on the jar target and not only on 
    4.72 +    the compile target as the regular run target does. Again, for a list of available 
    4.73 +    properties which you can use, check the target you are overriding in the
    4.74 +    nbproject/build-impl.xml file. 
    4.75 +
    4.76 +    -->
    4.77 +</project>
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/server/backend/base.web.api/manifest.mf	Mon Jun 20 23:27:31 2011 +0200
     5.3 @@ -0,0 +1,3 @@
     5.4 +Manifest-Version: 1.0
     5.5 +X-COMMENT: Main-Class will be added automatically by build
     5.6 +
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/server/backend/base.web.api/nbproject/build-impl.xml	Mon Jun 20 23:27:31 2011 +0200
     6.3 @@ -0,0 +1,1068 @@
     6.4 +<?xml version="1.0" encoding="UTF-8"?>
     6.5 +<!--
     6.6 +*** GENERATED FROM project.xml - DO NOT EDIT  ***
     6.7 +***         EDIT ../build.xml INSTEAD         ***
     6.8 +
     6.9 +For the purpose of easier reading the script
    6.10 +is divided into following sections:
    6.11 +
    6.12 +  - initialization
    6.13 +  - compilation
    6.14 +  - jar
    6.15 +  - execution
    6.16 +  - debugging
    6.17 +  - javadoc
    6.18 +  - junit compilation
    6.19 +  - junit execution
    6.20 +  - junit debugging
    6.21 +  - applet
    6.22 +  - cleanup
    6.23 +
    6.24 +        -->
    6.25 +<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="base.web.api-impl">
    6.26 +    <fail message="Please build using Ant 1.8.0 or higher.">
    6.27 +        <condition>
    6.28 +            <not>
    6.29 +                <antversion atleast="1.8.0"/>
    6.30 +            </not>
    6.31 +        </condition>
    6.32 +    </fail>
    6.33 +    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
    6.34 +    <!-- 
    6.35 +                ======================
    6.36 +                INITIALIZATION SECTION 
    6.37 +                ======================
    6.38 +            -->
    6.39 +    <target name="-pre-init">
    6.40 +        <!-- Empty placeholder for easier customization. -->
    6.41 +        <!-- You can override this target in the ../build.xml file. -->
    6.42 +    </target>
    6.43 +    <target depends="-pre-init" name="-init-private">
    6.44 +        <property file="nbproject/private/config.properties"/>
    6.45 +        <property file="nbproject/private/configs/${config}.properties"/>
    6.46 +        <property file="nbproject/private/private.properties"/>
    6.47 +    </target>
    6.48 +    <target name="-pre-init-libraries">
    6.49 +        <property location="../../lib/nblibraries.properties" name="libraries.path"/>
    6.50 +        <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
    6.51 +        <pathconvert dirsep="/" property="libraries.dir">
    6.52 +            <path path="${libraries.dir.nativedirsep}"/>
    6.53 +        </pathconvert>
    6.54 +        <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
    6.55 +        <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
    6.56 +    </target>
    6.57 +    <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
    6.58 +        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
    6.59 +            <filterchain>
    6.60 +                <replacestring from="$${base}" to="${libraries.dir}"/>
    6.61 +                <escapeunicode/>
    6.62 +            </filterchain>
    6.63 +        </loadproperties>
    6.64 +    </target>
    6.65 +    <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
    6.66 +        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
    6.67 +            <filterchain>
    6.68 +                <replacestring from="$${base}" to="${libraries.dir}"/>
    6.69 +                <escapeunicode/>
    6.70 +            </filterchain>
    6.71 +        </loadproperties>
    6.72 +    </target>
    6.73 +    <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
    6.74 +        <property file="${user.properties.file}"/>
    6.75 +        <!-- The two properties below are usually overridden -->
    6.76 +        <!-- by the active platform. Just a fallback. -->
    6.77 +        <property name="default.javac.source" value="1.4"/>
    6.78 +        <property name="default.javac.target" value="1.4"/>
    6.79 +    </target>
    6.80 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
    6.81 +        <property file="nbproject/configs/${config}.properties"/>
    6.82 +        <property file="nbproject/project.properties"/>
    6.83 +    </target>
    6.84 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
    6.85 +        <available file="${manifest.file}" property="manifest.available"/>
    6.86 +        <condition property="splashscreen.available">
    6.87 +            <and>
    6.88 +                <not>
    6.89 +                    <equals arg1="${application.splash}" arg2="" trim="true"/>
    6.90 +                </not>
    6.91 +                <available file="${application.splash}"/>
    6.92 +            </and>
    6.93 +        </condition>
    6.94 +        <condition property="main.class.available">
    6.95 +            <and>
    6.96 +                <isset property="main.class"/>
    6.97 +                <not>
    6.98 +                    <equals arg1="${main.class}" arg2="" trim="true"/>
    6.99 +                </not>
   6.100 +            </and>
   6.101 +        </condition>
   6.102 +        <condition property="manifest.available+main.class">
   6.103 +            <and>
   6.104 +                <isset property="manifest.available"/>
   6.105 +                <isset property="main.class.available"/>
   6.106 +            </and>
   6.107 +        </condition>
   6.108 +        <condition property="do.archive">
   6.109 +            <not>
   6.110 +                <istrue value="${jar.archive.disabled}"/>
   6.111 +            </not>
   6.112 +        </condition>
   6.113 +        <condition property="do.mkdist">
   6.114 +            <and>
   6.115 +                <isset property="do.archive"/>
   6.116 +                <isset property="libs.CopyLibs.classpath"/>
   6.117 +                <not>
   6.118 +                    <istrue value="${mkdist.disabled}"/>
   6.119 +                </not>
   6.120 +            </and>
   6.121 +        </condition>
   6.122 +        <condition property="manifest.available+main.class+mkdist.available">
   6.123 +            <and>
   6.124 +                <istrue value="${manifest.available+main.class}"/>
   6.125 +                <isset property="do.mkdist"/>
   6.126 +            </and>
   6.127 +        </condition>
   6.128 +        <condition property="do.archive+manifest.available">
   6.129 +            <and>
   6.130 +                <isset property="manifest.available"/>
   6.131 +                <istrue value="${do.archive}"/>
   6.132 +            </and>
   6.133 +        </condition>
   6.134 +        <condition property="do.archive+main.class.available">
   6.135 +            <and>
   6.136 +                <isset property="main.class.available"/>
   6.137 +                <istrue value="${do.archive}"/>
   6.138 +            </and>
   6.139 +        </condition>
   6.140 +        <condition property="do.archive+splashscreen.available">
   6.141 +            <and>
   6.142 +                <isset property="splashscreen.available"/>
   6.143 +                <istrue value="${do.archive}"/>
   6.144 +            </and>
   6.145 +        </condition>
   6.146 +        <condition property="do.archive+manifest.available+main.class">
   6.147 +            <and>
   6.148 +                <istrue value="${manifest.available+main.class}"/>
   6.149 +                <istrue value="${do.archive}"/>
   6.150 +            </and>
   6.151 +        </condition>
   6.152 +        <condition property="manifest.available-mkdist.available">
   6.153 +            <or>
   6.154 +                <istrue value="${manifest.available}"/>
   6.155 +                <isset property="do.mkdist"/>
   6.156 +            </or>
   6.157 +        </condition>
   6.158 +        <condition property="manifest.available+main.class-mkdist.available">
   6.159 +            <or>
   6.160 +                <istrue value="${manifest.available+main.class}"/>
   6.161 +                <isset property="do.mkdist"/>
   6.162 +            </or>
   6.163 +        </condition>
   6.164 +        <condition property="have.tests">
   6.165 +            <or>
   6.166 +                <available file="${test.src.dir}"/>
   6.167 +            </or>
   6.168 +        </condition>
   6.169 +        <condition property="have.sources">
   6.170 +            <or>
   6.171 +                <available file="${src.dir}"/>
   6.172 +            </or>
   6.173 +        </condition>
   6.174 +        <condition property="netbeans.home+have.tests">
   6.175 +            <and>
   6.176 +                <isset property="netbeans.home"/>
   6.177 +                <isset property="have.tests"/>
   6.178 +            </and>
   6.179 +        </condition>
   6.180 +        <condition property="no.javadoc.preview">
   6.181 +            <and>
   6.182 +                <isset property="javadoc.preview"/>
   6.183 +                <isfalse value="${javadoc.preview}"/>
   6.184 +            </and>
   6.185 +        </condition>
   6.186 +        <property name="run.jvmargs" value=""/>
   6.187 +        <property name="javac.compilerargs" value=""/>
   6.188 +        <property name="work.dir" value="${basedir}"/>
   6.189 +        <condition property="no.deps">
   6.190 +            <and>
   6.191 +                <istrue value="${no.dependencies}"/>
   6.192 +            </and>
   6.193 +        </condition>
   6.194 +        <property name="javac.debug" value="true"/>
   6.195 +        <property name="javadoc.preview" value="true"/>
   6.196 +        <property name="application.args" value=""/>
   6.197 +        <property name="source.encoding" value="${file.encoding}"/>
   6.198 +        <property name="runtime.encoding" value="${source.encoding}"/>
   6.199 +        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
   6.200 +            <and>
   6.201 +                <isset property="javadoc.encoding"/>
   6.202 +                <not>
   6.203 +                    <equals arg1="${javadoc.encoding}" arg2=""/>
   6.204 +                </not>
   6.205 +            </and>
   6.206 +        </condition>
   6.207 +        <property name="javadoc.encoding.used" value="${source.encoding}"/>
   6.208 +        <property name="includes" value="**"/>
   6.209 +        <property name="excludes" value=""/>
   6.210 +        <property name="do.depend" value="false"/>
   6.211 +        <condition property="do.depend.true">
   6.212 +            <istrue value="${do.depend}"/>
   6.213 +        </condition>
   6.214 +        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
   6.215 +        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
   6.216 +            <length length="0" string="${endorsed.classpath}" when="greater"/>
   6.217 +        </condition>
   6.218 +        <condition else="false" property="jdkBug6558476">
   6.219 +            <and>
   6.220 +                <matches pattern="1\.[56]" string="${java.specification.version}"/>
   6.221 +                <not>
   6.222 +                    <os family="unix"/>
   6.223 +                </not>
   6.224 +            </and>
   6.225 +        </condition>
   6.226 +        <property name="javac.fork" value="${jdkBug6558476}"/>
   6.227 +        <property name="jar.index" value="false"/>
   6.228 +        <property name="jar.index.metainf" value="${jar.index}"/>
   6.229 +        <property name="copylibs.rebase" value="true"/>
   6.230 +        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
   6.231 +    </target>
   6.232 +    <target name="-post-init">
   6.233 +        <!-- Empty placeholder for easier customization. -->
   6.234 +        <!-- You can override this target in the ../build.xml file. -->
   6.235 +    </target>
   6.236 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
   6.237 +        <fail unless="src.dir">Must set src.dir</fail>
   6.238 +        <fail unless="test.src.dir">Must set test.src.dir</fail>
   6.239 +        <fail unless="build.dir">Must set build.dir</fail>
   6.240 +        <fail unless="dist.dir">Must set dist.dir</fail>
   6.241 +        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
   6.242 +        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
   6.243 +        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
   6.244 +        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
   6.245 +        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
   6.246 +        <fail unless="dist.jar">Must set dist.jar</fail>
   6.247 +    </target>
   6.248 +    <target name="-init-macrodef-property">
   6.249 +        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
   6.250 +            <attribute name="name"/>
   6.251 +            <attribute name="value"/>
   6.252 +            <sequential>
   6.253 +                <property name="@{name}" value="${@{value}}"/>
   6.254 +            </sequential>
   6.255 +        </macrodef>
   6.256 +    </target>
   6.257 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
   6.258 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   6.259 +            <attribute default="${src.dir}" name="srcdir"/>
   6.260 +            <attribute default="${build.classes.dir}" name="destdir"/>
   6.261 +            <attribute default="${javac.classpath}" name="classpath"/>
   6.262 +            <attribute default="${javac.processorpath}" name="processorpath"/>
   6.263 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   6.264 +            <attribute default="${includes}" name="includes"/>
   6.265 +            <attribute default="${excludes}" name="excludes"/>
   6.266 +            <attribute default="${javac.debug}" name="debug"/>
   6.267 +            <attribute default="${empty.dir}" name="sourcepath"/>
   6.268 +            <attribute default="${empty.dir}" name="gensrcdir"/>
   6.269 +            <element name="customize" optional="true"/>
   6.270 +            <sequential>
   6.271 +                <property location="${build.dir}/empty" name="empty.dir"/>
   6.272 +                <mkdir dir="${empty.dir}"/>
   6.273 +                <mkdir dir="@{apgeneratedsrcdir}"/>
   6.274 +                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
   6.275 +                    <src>
   6.276 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   6.277 +                            <include name="*"/>
   6.278 +                        </dirset>
   6.279 +                    </src>
   6.280 +                    <classpath>
   6.281 +                        <path path="@{classpath}"/>
   6.282 +                    </classpath>
   6.283 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   6.284 +                    <compilerarg line="${javac.compilerargs}"/>
   6.285 +                    <compilerarg value="-processorpath"/>
   6.286 +                    <compilerarg path="@{processorpath}:${empty.dir}"/>
   6.287 +                    <compilerarg line="${ap.processors.internal}"/>
   6.288 +                    <compilerarg line="${annotation.processing.processor.options}"/>
   6.289 +                    <compilerarg value="-s"/>
   6.290 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
   6.291 +                    <compilerarg line="${ap.proc.none.internal}"/>
   6.292 +                    <customize/>
   6.293 +                </javac>
   6.294 +            </sequential>
   6.295 +        </macrodef>
   6.296 +    </target>
   6.297 +    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
   6.298 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   6.299 +            <attribute default="${src.dir}" name="srcdir"/>
   6.300 +            <attribute default="${build.classes.dir}" name="destdir"/>
   6.301 +            <attribute default="${javac.classpath}" name="classpath"/>
   6.302 +            <attribute default="${javac.processorpath}" name="processorpath"/>
   6.303 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   6.304 +            <attribute default="${includes}" name="includes"/>
   6.305 +            <attribute default="${excludes}" name="excludes"/>
   6.306 +            <attribute default="${javac.debug}" name="debug"/>
   6.307 +            <attribute default="${empty.dir}" name="sourcepath"/>
   6.308 +            <attribute default="${empty.dir}" name="gensrcdir"/>
   6.309 +            <element name="customize" optional="true"/>
   6.310 +            <sequential>
   6.311 +                <property location="${build.dir}/empty" name="empty.dir"/>
   6.312 +                <mkdir dir="${empty.dir}"/>
   6.313 +                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
   6.314 +                    <src>
   6.315 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   6.316 +                            <include name="*"/>
   6.317 +                        </dirset>
   6.318 +                    </src>
   6.319 +                    <classpath>
   6.320 +                        <path path="@{classpath}"/>
   6.321 +                    </classpath>
   6.322 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   6.323 +                    <compilerarg line="${javac.compilerargs}"/>
   6.324 +                    <customize/>
   6.325 +                </javac>
   6.326 +            </sequential>
   6.327 +        </macrodef>
   6.328 +    </target>
   6.329 +    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
   6.330 +        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
   6.331 +            <attribute default="${src.dir}" name="srcdir"/>
   6.332 +            <attribute default="${build.classes.dir}" name="destdir"/>
   6.333 +            <attribute default="${javac.classpath}" name="classpath"/>
   6.334 +            <sequential>
   6.335 +                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
   6.336 +                    <classpath>
   6.337 +                        <path path="@{classpath}"/>
   6.338 +                    </classpath>
   6.339 +                </depend>
   6.340 +            </sequential>
   6.341 +        </macrodef>
   6.342 +        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
   6.343 +            <attribute default="${build.classes.dir}" name="destdir"/>
   6.344 +            <sequential>
   6.345 +                <fail unless="javac.includes">Must set javac.includes</fail>
   6.346 +                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
   6.347 +                    <path>
   6.348 +                        <filelist dir="@{destdir}" files="${javac.includes}"/>
   6.349 +                    </path>
   6.350 +                    <globmapper from="*.java" to="*.class"/>
   6.351 +                </pathconvert>
   6.352 +                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
   6.353 +                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
   6.354 +                <delete>
   6.355 +                    <files includesfile="${javac.includesfile.binary}"/>
   6.356 +                </delete>
   6.357 +                <delete>
   6.358 +                    <fileset file="${javac.includesfile.binary}"/>
   6.359 +                </delete>
   6.360 +            </sequential>
   6.361 +        </macrodef>
   6.362 +    </target>
   6.363 +    <target name="-init-macrodef-junit">
   6.364 +        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
   6.365 +            <attribute default="${includes}" name="includes"/>
   6.366 +            <attribute default="${excludes}" name="excludes"/>
   6.367 +            <attribute default="**" name="testincludes"/>
   6.368 +            <sequential>
   6.369 +                <property name="junit.forkmode" value="perTest"/>
   6.370 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   6.371 +                    <batchtest todir="${build.test.results.dir}">
   6.372 +                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   6.373 +                            <filename name="@{testincludes}"/>
   6.374 +                        </fileset>
   6.375 +                    </batchtest>
   6.376 +                    <classpath>
   6.377 +                        <path path="${run.test.classpath}"/>
   6.378 +                    </classpath>
   6.379 +                    <syspropertyset>
   6.380 +                        <propertyref prefix="test-sys-prop."/>
   6.381 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   6.382 +                    </syspropertyset>
   6.383 +                    <formatter type="brief" usefile="false"/>
   6.384 +                    <formatter type="xml"/>
   6.385 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   6.386 +                    <jvmarg value="-ea"/>
   6.387 +                    <jvmarg line="${run.jvmargs}"/>
   6.388 +                </junit>
   6.389 +            </sequential>
   6.390 +        </macrodef>
   6.391 +    </target>
   6.392 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
   6.393 +    <target name="-profile-pre-init">
   6.394 +        <!-- Empty placeholder for easier customization. -->
   6.395 +        <!-- You can override this target in the ../build.xml file. -->
   6.396 +    </target>
   6.397 +    <target name="-profile-post-init">
   6.398 +        <!-- Empty placeholder for easier customization. -->
   6.399 +        <!-- You can override this target in the ../build.xml file. -->
   6.400 +    </target>
   6.401 +    <target name="-profile-init-macrodef-profile">
   6.402 +        <macrodef name="resolve">
   6.403 +            <attribute name="name"/>
   6.404 +            <attribute name="value"/>
   6.405 +            <sequential>
   6.406 +                <property name="@{name}" value="${env.@{value}}"/>
   6.407 +            </sequential>
   6.408 +        </macrodef>
   6.409 +        <macrodef name="profile">
   6.410 +            <attribute default="${main.class}" name="classname"/>
   6.411 +            <element name="customize" optional="true"/>
   6.412 +            <sequential>
   6.413 +                <property environment="env"/>
   6.414 +                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
   6.415 +                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
   6.416 +                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
   6.417 +                    <jvmarg line="${profiler.info.jvmargs}"/>
   6.418 +                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
   6.419 +                    <arg line="${application.args}"/>
   6.420 +                    <classpath>
   6.421 +                        <path path="${run.classpath}"/>
   6.422 +                    </classpath>
   6.423 +                    <syspropertyset>
   6.424 +                        <propertyref prefix="run-sys-prop."/>
   6.425 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   6.426 +                    </syspropertyset>
   6.427 +                    <customize/>
   6.428 +                </java>
   6.429 +            </sequential>
   6.430 +        </macrodef>
   6.431 +    </target>
   6.432 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
   6.433 +        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
   6.434 +        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
   6.435 +    </target>
   6.436 +    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
   6.437 +        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
   6.438 +            <attribute default="${main.class}" name="name"/>
   6.439 +            <attribute default="${debug.classpath}" name="classpath"/>
   6.440 +            <attribute default="" name="stopclassname"/>
   6.441 +            <sequential>
   6.442 +                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
   6.443 +                    <classpath>
   6.444 +                        <path path="@{classpath}"/>
   6.445 +                    </classpath>
   6.446 +                </nbjpdastart>
   6.447 +            </sequential>
   6.448 +        </macrodef>
   6.449 +        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
   6.450 +            <attribute default="${build.classes.dir}" name="dir"/>
   6.451 +            <sequential>
   6.452 +                <nbjpdareload>
   6.453 +                    <fileset dir="@{dir}" includes="${fix.classes}">
   6.454 +                        <include name="${fix.includes}*.class"/>
   6.455 +                    </fileset>
   6.456 +                </nbjpdareload>
   6.457 +            </sequential>
   6.458 +        </macrodef>
   6.459 +    </target>
   6.460 +    <target name="-init-debug-args">
   6.461 +        <property name="version-output" value="java version &quot;${ant.java.version}"/>
   6.462 +        <condition property="have-jdk-older-than-1.4">
   6.463 +            <or>
   6.464 +                <contains string="${version-output}" substring="java version &quot;1.0"/>
   6.465 +                <contains string="${version-output}" substring="java version &quot;1.1"/>
   6.466 +                <contains string="${version-output}" substring="java version &quot;1.2"/>
   6.467 +                <contains string="${version-output}" substring="java version &quot;1.3"/>
   6.468 +            </or>
   6.469 +        </condition>
   6.470 +        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
   6.471 +            <istrue value="${have-jdk-older-than-1.4}"/>
   6.472 +        </condition>
   6.473 +        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
   6.474 +            <os family="windows"/>
   6.475 +        </condition>
   6.476 +        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
   6.477 +            <isset property="debug.transport"/>
   6.478 +        </condition>
   6.479 +    </target>
   6.480 +    <target depends="-init-debug-args" name="-init-macrodef-debug">
   6.481 +        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   6.482 +            <attribute default="${main.class}" name="classname"/>
   6.483 +            <attribute default="${debug.classpath}" name="classpath"/>
   6.484 +            <element name="customize" optional="true"/>
   6.485 +            <sequential>
   6.486 +                <java classname="@{classname}" dir="${work.dir}" fork="true">
   6.487 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   6.488 +                    <jvmarg line="${debug-args-line}"/>
   6.489 +                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   6.490 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   6.491 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   6.492 +                    <jvmarg line="${run.jvmargs}"/>
   6.493 +                    <classpath>
   6.494 +                        <path path="@{classpath}"/>
   6.495 +                    </classpath>
   6.496 +                    <syspropertyset>
   6.497 +                        <propertyref prefix="run-sys-prop."/>
   6.498 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   6.499 +                    </syspropertyset>
   6.500 +                    <customize/>
   6.501 +                </java>
   6.502 +            </sequential>
   6.503 +        </macrodef>
   6.504 +    </target>
   6.505 +    <target name="-init-macrodef-java">
   6.506 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   6.507 +            <attribute default="${main.class}" name="classname"/>
   6.508 +            <attribute default="${run.classpath}" name="classpath"/>
   6.509 +            <element name="customize" optional="true"/>
   6.510 +            <sequential>
   6.511 +                <java classname="@{classname}" dir="${work.dir}" fork="true">
   6.512 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   6.513 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   6.514 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   6.515 +                    <jvmarg line="${run.jvmargs}"/>
   6.516 +                    <classpath>
   6.517 +                        <path path="@{classpath}"/>
   6.518 +                    </classpath>
   6.519 +                    <syspropertyset>
   6.520 +                        <propertyref prefix="run-sys-prop."/>
   6.521 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   6.522 +                    </syspropertyset>
   6.523 +                    <customize/>
   6.524 +                </java>
   6.525 +            </sequential>
   6.526 +        </macrodef>
   6.527 +    </target>
   6.528 +    <target name="-init-macrodef-copylibs">
   6.529 +        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
   6.530 +            <attribute default="${manifest.file}" name="manifest"/>
   6.531 +            <element name="customize" optional="true"/>
   6.532 +            <sequential>
   6.533 +                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
   6.534 +                <pathconvert property="run.classpath.without.build.classes.dir">
   6.535 +                    <path path="${run.classpath}"/>
   6.536 +                    <map from="${build.classes.dir.resolved}" to=""/>
   6.537 +                </pathconvert>
   6.538 +                <pathconvert pathsep=" " property="jar.classpath">
   6.539 +                    <path path="${run.classpath.without.build.classes.dir}"/>
   6.540 +                    <chainedmapper>
   6.541 +                        <flattenmapper/>
   6.542 +                        <globmapper from="*" to="lib/*"/>
   6.543 +                    </chainedmapper>
   6.544 +                </pathconvert>
   6.545 +                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
   6.546 +                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
   6.547 +                    <fileset dir="${build.classes.dir}"/>
   6.548 +                    <manifest>
   6.549 +                        <attribute name="Class-Path" value="${jar.classpath}"/>
   6.550 +                        <customize/>
   6.551 +                    </manifest>
   6.552 +                </copylibs>
   6.553 +            </sequential>
   6.554 +        </macrodef>
   6.555 +    </target>
   6.556 +    <target name="-init-presetdef-jar">
   6.557 +        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
   6.558 +            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
   6.559 +                <j2seproject1:fileset dir="${build.classes.dir}"/>
   6.560 +            </jar>
   6.561 +        </presetdef>
   6.562 +    </target>
   6.563 +    <target name="-init-ap-cmdline-properties">
   6.564 +        <property name="annotation.processing.enabled" value="true"/>
   6.565 +        <property name="annotation.processing.processors.list" value=""/>
   6.566 +        <property name="annotation.processing.processor.options" value=""/>
   6.567 +        <property name="annotation.processing.run.all.processors" value="true"/>
   6.568 +        <property name="javac.processorpath" value="${javac.classpath}"/>
   6.569 +        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
   6.570 +        <condition property="ap.supported.internal" value="true">
   6.571 +            <not>
   6.572 +                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
   6.573 +            </not>
   6.574 +        </condition>
   6.575 +    </target>
   6.576 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
   6.577 +        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
   6.578 +            <isfalse value="${annotation.processing.run.all.processors}"/>
   6.579 +        </condition>
   6.580 +        <condition else="" property="ap.proc.none.internal" value="-proc:none">
   6.581 +            <isfalse value="${annotation.processing.enabled}"/>
   6.582 +        </condition>
   6.583 +    </target>
   6.584 +    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
   6.585 +        <property name="ap.cmd.line.internal" value=""/>
   6.586 +    </target>
   6.587 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
   6.588 +    <!--
   6.589 +                ===================
   6.590 +                COMPILATION SECTION
   6.591 +                ===================
   6.592 +            -->
   6.593 +    <target name="-deps-jar-init" unless="built-jar.properties">
   6.594 +        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
   6.595 +        <delete file="${built-jar.properties}" quiet="true"/>
   6.596 +    </target>
   6.597 +    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
   6.598 +        <echo level="warn" message="Cycle detected: base.web.api was already built"/>
   6.599 +    </target>
   6.600 +    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
   6.601 +        <mkdir dir="${build.dir}"/>
   6.602 +        <touch file="${built-jar.properties}" verbose="false"/>
   6.603 +        <property file="${built-jar.properties}" prefix="already.built.jar."/>
   6.604 +        <antcall target="-warn-already-built-jar"/>
   6.605 +        <propertyfile file="${built-jar.properties}">
   6.606 +            <entry key="${basedir}" value=""/>
   6.607 +        </propertyfile>
   6.608 +    </target>
   6.609 +    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
   6.610 +    <target depends="init" name="-check-automatic-build">
   6.611 +        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
   6.612 +    </target>
   6.613 +    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
   6.614 +        <antcall target="clean"/>
   6.615 +    </target>
   6.616 +    <target depends="init,deps-jar" name="-pre-pre-compile">
   6.617 +        <mkdir dir="${build.classes.dir}"/>
   6.618 +    </target>
   6.619 +    <target name="-pre-compile">
   6.620 +        <!-- Empty placeholder for easier customization. -->
   6.621 +        <!-- You can override this target in the ../build.xml file. -->
   6.622 +    </target>
   6.623 +    <target if="do.depend.true" name="-compile-depend">
   6.624 +        <pathconvert property="build.generated.subdirs">
   6.625 +            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
   6.626 +                <include name="*"/>
   6.627 +            </dirset>
   6.628 +        </pathconvert>
   6.629 +        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
   6.630 +    </target>
   6.631 +    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
   6.632 +        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
   6.633 +        <copy todir="${build.classes.dir}">
   6.634 +            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
   6.635 +        </copy>
   6.636 +    </target>
   6.637 +    <target if="has.persistence.xml" name="-copy-persistence-xml">
   6.638 +        <mkdir dir="${build.classes.dir}/META-INF"/>
   6.639 +        <copy todir="${build.classes.dir}/META-INF">
   6.640 +            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
   6.641 +        </copy>
   6.642 +    </target>
   6.643 +    <target name="-post-compile">
   6.644 +        <!-- Empty placeholder for easier customization. -->
   6.645 +        <!-- You can override this target in the ../build.xml file. -->
   6.646 +    </target>
   6.647 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
   6.648 +    <target name="-pre-compile-single">
   6.649 +        <!-- Empty placeholder for easier customization. -->
   6.650 +        <!-- You can override this target in the ../build.xml file. -->
   6.651 +    </target>
   6.652 +    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
   6.653 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
   6.654 +        <j2seproject3:force-recompile/>
   6.655 +        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
   6.656 +    </target>
   6.657 +    <target name="-post-compile-single">
   6.658 +        <!-- Empty placeholder for easier customization. -->
   6.659 +        <!-- You can override this target in the ../build.xml file. -->
   6.660 +    </target>
   6.661 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
   6.662 +    <!--
   6.663 +                ====================
   6.664 +                JAR BUILDING SECTION
   6.665 +                ====================
   6.666 +            -->
   6.667 +    <target depends="init" name="-pre-pre-jar">
   6.668 +        <dirname file="${dist.jar}" property="dist.jar.dir"/>
   6.669 +        <mkdir dir="${dist.jar.dir}"/>
   6.670 +    </target>
   6.671 +    <target name="-pre-jar">
   6.672 +        <!-- Empty placeholder for easier customization. -->
   6.673 +        <!-- You can override this target in the ../build.xml file. -->
   6.674 +    </target>
   6.675 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
   6.676 +        <j2seproject1:jar/>
   6.677 +    </target>
   6.678 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
   6.679 +        <j2seproject1:jar manifest="${manifest.file}"/>
   6.680 +    </target>
   6.681 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
   6.682 +        <j2seproject1:jar manifest="${manifest.file}">
   6.683 +            <j2seproject1:manifest>
   6.684 +                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
   6.685 +            </j2seproject1:manifest>
   6.686 +        </j2seproject1:jar>
   6.687 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
   6.688 +        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
   6.689 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
   6.690 +        <pathconvert property="run.classpath.with.dist.jar">
   6.691 +            <path path="${run.classpath}"/>
   6.692 +            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
   6.693 +        </pathconvert>
   6.694 +        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
   6.695 +    </target>
   6.696 +    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
   6.697 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
   6.698 +        <touch file="${tmp.manifest.file}" verbose="false"/>
   6.699 +    </target>
   6.700 +    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
   6.701 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
   6.702 +        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
   6.703 +    </target>
   6.704 +    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
   6.705 +        <manifest file="${tmp.manifest.file}" mode="update">
   6.706 +            <attribute name="Main-Class" value="${main.class}"/>
   6.707 +        </manifest>
   6.708 +    </target>
   6.709 +    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
   6.710 +        <basename file="${application.splash}" property="splashscreen.basename"/>
   6.711 +        <mkdir dir="${build.classes.dir}/META-INF"/>
   6.712 +        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
   6.713 +        <manifest file="${tmp.manifest.file}" mode="update">
   6.714 +            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
   6.715 +        </manifest>
   6.716 +    </target>
   6.717 +    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
   6.718 +        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
   6.719 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
   6.720 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
   6.721 +        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
   6.722 +    </target>
   6.723 +    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
   6.724 +        <delete>
   6.725 +            <fileset file="${tmp.manifest.file}"/>
   6.726 +        </delete>
   6.727 +    </target>
   6.728 +    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
   6.729 +    <target name="-post-jar">
   6.730 +        <!-- Empty placeholder for easier customization. -->
   6.731 +        <!-- You can override this target in the ../build.xml file. -->
   6.732 +    </target>
   6.733 +    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
   6.734 +    <!--
   6.735 +                =================
   6.736 +                EXECUTION SECTION
   6.737 +                =================
   6.738 +            -->
   6.739 +    <target depends="init,compile" description="Run a main class." name="run">
   6.740 +        <j2seproject1:java>
   6.741 +            <customize>
   6.742 +                <arg line="${application.args}"/>
   6.743 +            </customize>
   6.744 +        </j2seproject1:java>
   6.745 +    </target>
   6.746 +    <target name="-do-not-recompile">
   6.747 +        <property name="javac.includes.binary" value=""/>
   6.748 +    </target>
   6.749 +    <target depends="init,compile-single" name="run-single">
   6.750 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
   6.751 +        <j2seproject1:java classname="${run.class}"/>
   6.752 +    </target>
   6.753 +    <target depends="init,compile-test-single" name="run-test-with-main">
   6.754 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
   6.755 +        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
   6.756 +    </target>
   6.757 +    <!--
   6.758 +                =================
   6.759 +                DEBUGGING SECTION
   6.760 +                =================
   6.761 +            -->
   6.762 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
   6.763 +        <j2seproject1:nbjpdastart name="${debug.class}"/>
   6.764 +    </target>
   6.765 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
   6.766 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
   6.767 +    </target>
   6.768 +    <target depends="init,compile" name="-debug-start-debuggee">
   6.769 +        <j2seproject3:debug>
   6.770 +            <customize>
   6.771 +                <arg line="${application.args}"/>
   6.772 +            </customize>
   6.773 +        </j2seproject3:debug>
   6.774 +    </target>
   6.775 +    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
   6.776 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
   6.777 +        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
   6.778 +    </target>
   6.779 +    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
   6.780 +    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
   6.781 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
   6.782 +        <j2seproject3:debug classname="${debug.class}"/>
   6.783 +    </target>
   6.784 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
   6.785 +    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
   6.786 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
   6.787 +        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
   6.788 +    </target>
   6.789 +    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
   6.790 +    <target depends="init" name="-pre-debug-fix">
   6.791 +        <fail unless="fix.includes">Must set fix.includes</fail>
   6.792 +        <property name="javac.includes" value="${fix.includes}.java"/>
   6.793 +    </target>
   6.794 +    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
   6.795 +        <j2seproject1:nbjpdareload/>
   6.796 +    </target>
   6.797 +    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
   6.798 +    <!--
   6.799 +                =================
   6.800 +                PROFILING SECTION
   6.801 +                =================
   6.802 +            -->
   6.803 +    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
   6.804 +        <nbprofiledirect>
   6.805 +            <classpath>
   6.806 +                <path path="${run.classpath}"/>
   6.807 +            </classpath>
   6.808 +        </nbprofiledirect>
   6.809 +        <profile/>
   6.810 +    </target>
   6.811 +    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
   6.812 +        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
   6.813 +        <nbprofiledirect>
   6.814 +            <classpath>
   6.815 +                <path path="${run.classpath}"/>
   6.816 +            </classpath>
   6.817 +        </nbprofiledirect>
   6.818 +        <profile classname="${profile.class}"/>
   6.819 +    </target>
   6.820 +    <!--
   6.821 +                =========================
   6.822 +                APPLET PROFILING  SECTION
   6.823 +                =========================
   6.824 +            -->
   6.825 +    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
   6.826 +        <nbprofiledirect>
   6.827 +            <classpath>
   6.828 +                <path path="${run.classpath}"/>
   6.829 +            </classpath>
   6.830 +        </nbprofiledirect>
   6.831 +        <profile classname="sun.applet.AppletViewer">
   6.832 +            <customize>
   6.833 +                <arg value="${applet.url}"/>
   6.834 +            </customize>
   6.835 +        </profile>
   6.836 +    </target>
   6.837 +    <!--
   6.838 +                =========================
   6.839 +                TESTS PROFILING  SECTION
   6.840 +                =========================
   6.841 +            -->
   6.842 +    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
   6.843 +        <nbprofiledirect>
   6.844 +            <classpath>
   6.845 +                <path path="${run.test.classpath}"/>
   6.846 +            </classpath>
   6.847 +        </nbprofiledirect>
   6.848 +        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
   6.849 +            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
   6.850 +            <jvmarg value="${profiler.info.jvmargs.agent}"/>
   6.851 +            <jvmarg line="${profiler.info.jvmargs}"/>
   6.852 +            <test name="${profile.class}"/>
   6.853 +            <classpath>
   6.854 +                <path path="${run.test.classpath}"/>
   6.855 +            </classpath>
   6.856 +            <syspropertyset>
   6.857 +                <propertyref prefix="test-sys-prop."/>
   6.858 +                <mapper from="test-sys-prop.*" to="*" type="glob"/>
   6.859 +            </syspropertyset>
   6.860 +            <formatter type="brief" usefile="false"/>
   6.861 +            <formatter type="xml"/>
   6.862 +        </junit>
   6.863 +    </target>
   6.864 +    <!--
   6.865 +                ===============
   6.866 +                JAVADOC SECTION
   6.867 +                ===============
   6.868 +            -->
   6.869 +    <target depends="init" if="have.sources" name="-javadoc-build">
   6.870 +        <mkdir dir="${dist.javadoc.dir}"/>
   6.871 +        <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}">
   6.872 +            <classpath>
   6.873 +                <path path="${javac.classpath}"/>
   6.874 +            </classpath>
   6.875 +            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
   6.876 +                <filename name="**/*.java"/>
   6.877 +            </fileset>
   6.878 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
   6.879 +                <include name="**/*.java"/>
   6.880 +                <exclude name="*.java"/>
   6.881 +            </fileset>
   6.882 +        </javadoc>
   6.883 +        <copy todir="${dist.javadoc.dir}">
   6.884 +            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
   6.885 +                <filename name="**/doc-files/**"/>
   6.886 +            </fileset>
   6.887 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
   6.888 +                <include name="**/doc-files/**"/>
   6.889 +            </fileset>
   6.890 +        </copy>
   6.891 +    </target>
   6.892 +    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
   6.893 +        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
   6.894 +    </target>
   6.895 +    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
   6.896 +    <!--
   6.897 +                =========================
   6.898 +                JUNIT COMPILATION SECTION
   6.899 +                =========================
   6.900 +            -->
   6.901 +    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
   6.902 +        <mkdir dir="${build.test.classes.dir}"/>
   6.903 +    </target>
   6.904 +    <target name="-pre-compile-test">
   6.905 +        <!-- Empty placeholder for easier customization. -->
   6.906 +        <!-- You can override this target in the ../build.xml file. -->
   6.907 +    </target>
   6.908 +    <target if="do.depend.true" name="-compile-test-depend">
   6.909 +        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
   6.910 +    </target>
   6.911 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
   6.912 +        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
   6.913 +        <copy todir="${build.test.classes.dir}">
   6.914 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
   6.915 +        </copy>
   6.916 +    </target>
   6.917 +    <target name="-post-compile-test">
   6.918 +        <!-- Empty placeholder for easier customization. -->
   6.919 +        <!-- You can override this target in the ../build.xml file. -->
   6.920 +    </target>
   6.921 +    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
   6.922 +    <target name="-pre-compile-test-single">
   6.923 +        <!-- Empty placeholder for easier customization. -->
   6.924 +        <!-- You can override this target in the ../build.xml file. -->
   6.925 +    </target>
   6.926 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
   6.927 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
   6.928 +        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
   6.929 +        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
   6.930 +        <copy todir="${build.test.classes.dir}">
   6.931 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
   6.932 +        </copy>
   6.933 +    </target>
   6.934 +    <target name="-post-compile-test-single">
   6.935 +        <!-- Empty placeholder for easier customization. -->
   6.936 +        <!-- You can override this target in the ../build.xml file. -->
   6.937 +    </target>
   6.938 +    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
   6.939 +    <!--
   6.940 +                =======================
   6.941 +                JUNIT EXECUTION SECTION
   6.942 +                =======================
   6.943 +            -->
   6.944 +    <target depends="init" if="have.tests" name="-pre-test-run">
   6.945 +        <mkdir dir="${build.test.results.dir}"/>
   6.946 +    </target>
   6.947 +    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
   6.948 +        <j2seproject3:junit testincludes="**/*Test.java"/>
   6.949 +    </target>
   6.950 +    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
   6.951 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
   6.952 +    </target>
   6.953 +    <target depends="init" if="have.tests" name="test-report"/>
   6.954 +    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
   6.955 +    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
   6.956 +    <target depends="init" if="have.tests" name="-pre-test-run-single">
   6.957 +        <mkdir dir="${build.test.results.dir}"/>
   6.958 +    </target>
   6.959 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
   6.960 +        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
   6.961 +        <j2seproject3:junit excludes="" includes="${test.includes}"/>
   6.962 +    </target>
   6.963 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
   6.964 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
   6.965 +    </target>
   6.966 +    <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"/>
   6.967 +    <!--
   6.968 +                =======================
   6.969 +                JUNIT DEBUGGING SECTION
   6.970 +                =======================
   6.971 +            -->
   6.972 +    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
   6.973 +        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
   6.974 +        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
   6.975 +        <delete file="${test.report.file}"/>
   6.976 +        <mkdir dir="${build.test.results.dir}"/>
   6.977 +        <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
   6.978 +            <customize>
   6.979 +                <syspropertyset>
   6.980 +                    <propertyref prefix="test-sys-prop."/>
   6.981 +                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
   6.982 +                </syspropertyset>
   6.983 +                <arg value="${test.class}"/>
   6.984 +                <arg value="showoutput=true"/>
   6.985 +                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
   6.986 +                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
   6.987 +            </customize>
   6.988 +        </j2seproject3:debug>
   6.989 +    </target>
   6.990 +    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
   6.991 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
   6.992 +    </target>
   6.993 +    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
   6.994 +    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
   6.995 +        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
   6.996 +    </target>
   6.997 +    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
   6.998 +    <!--
   6.999 +                =========================
  6.1000 +                APPLET EXECUTION SECTION
  6.1001 +                =========================
  6.1002 +            -->
  6.1003 +    <target depends="init,compile-single" name="run-applet">
  6.1004 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  6.1005 +        <j2seproject1:java classname="sun.applet.AppletViewer">
  6.1006 +            <customize>
  6.1007 +                <arg value="${applet.url}"/>
  6.1008 +            </customize>
  6.1009 +        </j2seproject1:java>
  6.1010 +    </target>
  6.1011 +    <!--
  6.1012 +                =========================
  6.1013 +                APPLET DEBUGGING  SECTION
  6.1014 +                =========================
  6.1015 +            -->
  6.1016 +    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
  6.1017 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  6.1018 +        <j2seproject3:debug classname="sun.applet.AppletViewer">
  6.1019 +            <customize>
  6.1020 +                <arg value="${applet.url}"/>
  6.1021 +            </customize>
  6.1022 +        </j2seproject3:debug>
  6.1023 +    </target>
  6.1024 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
  6.1025 +    <!--
  6.1026 +                ===============
  6.1027 +                CLEANUP SECTION
  6.1028 +                ===============
  6.1029 +            -->
  6.1030 +    <target name="-deps-clean-init" unless="built-clean.properties">
  6.1031 +        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
  6.1032 +        <delete file="${built-clean.properties}" quiet="true"/>
  6.1033 +    </target>
  6.1034 +    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
  6.1035 +        <echo level="warn" message="Cycle detected: base.web.api was already built"/>
  6.1036 +    </target>
  6.1037 +    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
  6.1038 +        <mkdir dir="${build.dir}"/>
  6.1039 +        <touch file="${built-clean.properties}" verbose="false"/>
  6.1040 +        <property file="${built-clean.properties}" prefix="already.built.clean."/>
  6.1041 +        <antcall target="-warn-already-built-clean"/>
  6.1042 +        <propertyfile file="${built-clean.properties}">
  6.1043 +            <entry key="${basedir}" value=""/>
  6.1044 +        </propertyfile>
  6.1045 +    </target>
  6.1046 +    <target depends="init" name="-do-clean">
  6.1047 +        <delete dir="${build.dir}"/>
  6.1048 +        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
  6.1049 +    </target>
  6.1050 +    <target name="-post-clean">
  6.1051 +        <!-- Empty placeholder for easier customization. -->
  6.1052 +        <!-- You can override this target in the ../build.xml file. -->
  6.1053 +    </target>
  6.1054 +    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
  6.1055 +    <target name="-check-call-dep">
  6.1056 +        <property file="${call.built.properties}" prefix="already.built."/>
  6.1057 +        <condition property="should.call.dep">
  6.1058 +            <not>
  6.1059 +                <isset property="already.built.${call.subproject}"/>
  6.1060 +            </not>
  6.1061 +        </condition>
  6.1062 +    </target>
  6.1063 +    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
  6.1064 +        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
  6.1065 +            <propertyset>
  6.1066 +                <propertyref prefix="transfer."/>
  6.1067 +                <mapper from="transfer.*" to="*" type="glob"/>
  6.1068 +            </propertyset>
  6.1069 +        </ant>
  6.1070 +    </target>
  6.1071 +</project>
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/server/backend/base.web.api/nbproject/genfiles.properties	Mon Jun 20 23:27:31 2011 +0200
     7.3 @@ -0,0 +1,8 @@
     7.4 +build.xml.data.CRC32=a7c02ab2
     7.5 +build.xml.script.CRC32=f51e627e
     7.6 +build.xml.stylesheet.CRC32=28e38971@1.45.0.45
     7.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
     7.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
     7.9 +nbproject/build-impl.xml.data.CRC32=a7c02ab2
    7.10 +nbproject/build-impl.xml.script.CRC32=e2e70d24
    7.11 +nbproject/build-impl.xml.stylesheet.CRC32=cfcde7f8@1.45.0.45
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/server/backend/base.web.api/nbproject/project.properties	Mon Jun 20 23:27:31 2011 +0200
     8.3 @@ -0,0 +1,81 @@
     8.4 +annotation.processing.enabled=true
     8.5 +annotation.processing.enabled.in.editor=false
     8.6 +annotation.processing.processor.options=
     8.7 +annotation.processing.processors.list=
     8.8 +annotation.processing.run.all.processors=true
     8.9 +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
    8.10 +build.classes.dir=${build.dir}/classes
    8.11 +build.classes.excludes=**/*.java,**/*.form
    8.12 +# This directory is removed when the project is cleaned:
    8.13 +build.dir=build
    8.14 +build.generated.dir=${build.dir}/generated
    8.15 +build.generated.sources.dir=${build.dir}/generated-sources
    8.16 +# Only compile against the classpath explicitly listed here:
    8.17 +build.sysclasspath=ignore
    8.18 +build.test.classes.dir=${build.dir}/test/classes
    8.19 +build.test.results.dir=${build.dir}/test/results
    8.20 +# Uncomment to specify the preferred debugger connection transport:
    8.21 +#debug.transport=dt_socket
    8.22 +debug.classpath=\
    8.23 +    ${run.classpath}
    8.24 +debug.test.classpath=\
    8.25 +    ${run.test.classpath}
    8.26 +# This directory is removed when the project is cleaned:
    8.27 +dist.dir=dist
    8.28 +dist.jar=${dist.dir}/base.web.api.jar
    8.29 +dist.javadoc.dir=${dist.dir}/javadoc
    8.30 +excludes=
    8.31 +file.reference.org-netbeans-modules-java-source.jar=../../lib/org-netbeans-modules-java-source.jar
    8.32 +file.reference.org-netbeans-modules-parsing-api.jar=../../lib/org-netbeans-modules-parsing-api.jar
    8.33 +file.reference.org-openide-filesystems.jar=../../lib/org-openide-filesystems.jar
    8.34 +file.reference.org-openide-util-lookup.jar=../../lib/org-openide-util-lookup.jar
    8.35 +includes=**
    8.36 +jar.compress=false
    8.37 +javac.classpath=\
    8.38 +    ${libs.freemarker.classpath}:\
    8.39 +    ${libs.jersey.classpath}:\
    8.40 +    ${file.reference.org-openide-filesystems.jar}:\
    8.41 +    ${file.reference.org-netbeans-modules-parsing-api.jar}:\
    8.42 +    ${file.reference.org-openide-util-lookup.jar}:\
    8.43 +    ${file.reference.org-netbeans-modules-java-source.jar}
    8.44 +# Space-separated list of extra javac options
    8.45 +javac.compilerargs=
    8.46 +javac.deprecation=false
    8.47 +javac.processorpath=\
    8.48 +    ${javac.classpath}
    8.49 +javac.source=1.6
    8.50 +javac.target=1.6
    8.51 +javac.test.classpath=\
    8.52 +    ${javac.classpath}:\
    8.53 +    ${build.classes.dir}
    8.54 +javac.test.processorpath=\
    8.55 +    ${javac.test.classpath}
    8.56 +javadoc.additionalparam=
    8.57 +javadoc.author=false
    8.58 +javadoc.encoding=${source.encoding}
    8.59 +javadoc.noindex=false
    8.60 +javadoc.nonavbar=false
    8.61 +javadoc.notree=false
    8.62 +javadoc.private=false
    8.63 +javadoc.splitindex=true
    8.64 +javadoc.use=true
    8.65 +javadoc.version=false
    8.66 +javadoc.windowtitle=
    8.67 +main.class=org.netbeans.modules.jackpot30.backend.base.BaseWebApi
    8.68 +manifest.file=manifest.mf
    8.69 +meta.inf.dir=${src.dir}/META-INF
    8.70 +mkdist.disabled=false
    8.71 +platform.active=default_platform
    8.72 +run.classpath=\
    8.73 +    ${javac.classpath}:\
    8.74 +    ${build.classes.dir}
    8.75 +# Space-separated list of JVM arguments used when running the project
    8.76 +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
    8.77 +# or test-sys-prop.name=value to set system properties for unit tests):
    8.78 +run.jvmargs=
    8.79 +run.test.classpath=\
    8.80 +    ${javac.test.classpath}:\
    8.81 +    ${build.test.classes.dir}
    8.82 +source.encoding=UTF-8
    8.83 +src.dir=src
    8.84 +test.src.dir=test
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/server/backend/base.web.api/nbproject/project.xml	Mon Jun 20 23:27:31 2011 +0200
     9.3 @@ -0,0 +1,18 @@
     9.4 +<?xml version="1.0" encoding="UTF-8"?>
     9.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
     9.6 +    <type>org.netbeans.modules.java.j2seproject</type>
     9.7 +    <configuration>
     9.8 +        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
     9.9 +            <name>base.web.api</name>
    9.10 +            <source-roots>
    9.11 +                <root id="src.dir"/>
    9.12 +            </source-roots>
    9.13 +            <test-roots>
    9.14 +                <root id="test.src.dir"/>
    9.15 +            </test-roots>
    9.16 +        </data>
    9.17 +        <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
    9.18 +            <definitions>../../lib/nblibraries.properties</definitions>
    9.19 +        </libraries>
    9.20 +    </configuration>
    9.21 +</project>
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/CategoryStorage.java	Mon Jun 20 23:27:31 2011 +0200
    10.3 @@ -0,0 +1,141 @@
    10.4 +/*
    10.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    10.6 + *
    10.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
    10.8 + *
    10.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   10.10 + * Other names may be trademarks of their respective owners.
   10.11 + *
   10.12 + * The contents of this file are subject to the terms of either the GNU
   10.13 + * General Public License Version 2 only ("GPL") or the Common
   10.14 + * Development and Distribution License("CDDL") (collectively, the
   10.15 + * "License"). You may not use this file except in compliance with the
   10.16 + * License. You can obtain a copy of the License at
   10.17 + * http://www.netbeans.org/cddl-gplv2.html
   10.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   10.19 + * specific language governing permissions and limitations under the
   10.20 + * License.  When distributing the software, include this License Header
   10.21 + * Notice in each file and include the License file at
   10.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   10.23 + * particular file as subject to the "Classpath" exception as provided
   10.24 + * by Oracle in the GPL Version 2 section of the License file that
   10.25 + * accompanied this code. If applicable, add the following below the
   10.26 + * License Header, with the fields enclosed by brackets [] replaced by
   10.27 + * your own identifying information:
   10.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   10.29 + *
   10.30 + * If you wish your version of this file to be governed by only the CDDL
   10.31 + * or only the GPL Version 2, indicate your decision by adding
   10.32 + * "[Contributor] elects to include this software in this distribution
   10.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   10.34 + * single choice of license, a recipient has the option to distribute
   10.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   10.36 + * to extend the choice of license to its licensees as provided above.
   10.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   10.38 + * Version 2 license, then the option applies only if the new code is
   10.39 + * made subject to such option by the copyright holder.
   10.40 + *
   10.41 + * Contributor(s):
   10.42 + *
   10.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
   10.44 + */
   10.45 +package org.netbeans.modules.jackpot30.backend.base;
   10.46 +
   10.47 +import java.io.File;
   10.48 +import java.io.IOException;
   10.49 +import java.lang.reflect.Field;
   10.50 +import java.net.URL;
   10.51 +import java.util.ArrayList;
   10.52 +import java.util.Collections;
   10.53 +import java.util.HashSet;
   10.54 +import java.util.List;
   10.55 +import java.util.Map;
   10.56 +import java.util.Set;
   10.57 +import java.util.logging.Level;
   10.58 +import java.util.logging.Logger;
   10.59 +import org.netbeans.modules.parsing.impl.indexing.CacheFolder;
   10.60 +import org.openide.filesystems.FileObject;
   10.61 +import org.openide.filesystems.FileUtil;
   10.62 +
   10.63 +/**
   10.64 + *
   10.65 + * @author lahvac
   10.66 + */
   10.67 +public class CategoryStorage {
   10.68 +
   10.69 +    public static void setCacheRoot(File cacheRoot) {
   10.70 +        CategoryStorage.cacheRoot = cacheRoot;
   10.71 +    }
   10.72 +
   10.73 +    private static File cacheRoot;
   10.74 +
   10.75 +    public static Iterable<? extends CategoryStorage> listCategories() {
   10.76 +        List<CategoryStorage> result = new ArrayList<CategoryStorage>();
   10.77 +
   10.78 +        for (File cat : cacheRoot.listFiles()) {
   10.79 +            result.add(new CategoryStorage(cat.getName()));
   10.80 +        }
   10.81 +
   10.82 +        return result;
   10.83 +    }
   10.84 +
   10.85 +    public static CategoryStorage forId(String id) {
   10.86 +        for (CategoryStorage s : listCategories()) {
   10.87 +            if (s.id.equals(id)) return s;
   10.88 +        }
   10.89 +
   10.90 +        return null;
   10.91 +    }
   10.92 +    
   10.93 +    private final String id;
   10.94 +
   10.95 +    private CategoryStorage(String id) {
   10.96 +        this.id = id;
   10.97 +    }
   10.98 +
   10.99 +    public Iterable<? extends URL> getCategoryIndexFolders() {
  10.100 +        try {
  10.101 +            FileObject root = getCacheRoot();
  10.102 +            CacheFolder.setCacheFolder(root);
  10.103 +            Set<URL> result = new HashSet<URL>();
  10.104 +
  10.105 +            CacheFolder.getDataFolder(new URL("file:/"), true);
  10.106 +            
  10.107 +            //XXX:
  10.108 +            Field invertedSegmentsField = CacheFolder.class.getDeclaredField("invertedSegments");
  10.109 +
  10.110 +            invertedSegmentsField.setAccessible(true);
  10.111 +            
  10.112 +            Map<String, String> invertedSegments = (Map<String, String>) invertedSegmentsField.get(null);
  10.113 +
  10.114 +            for (String c : invertedSegments.keySet()) {
  10.115 +                result.add(new URL(c));
  10.116 +            }
  10.117 +
  10.118 +            return result;
  10.119 +        } catch (IllegalArgumentException ex) {
  10.120 +            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
  10.121 +        } catch (IllegalAccessException ex) {
  10.122 +            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
  10.123 +        } catch (NoSuchFieldException ex) {
  10.124 +            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
  10.125 +        } catch (SecurityException ex) {
  10.126 +            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
  10.127 +        } catch (IOException ex) {
  10.128 +            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
  10.129 +        }
  10.130 +        return Collections.emptyList();
  10.131 +    }
  10.132 +
  10.133 +    public String getId() {
  10.134 +        return id;
  10.135 +    }
  10.136 +
  10.137 +    public String getDisplayName() {
  10.138 +        return id;//XXX
  10.139 +    }
  10.140 +
  10.141 +    public FileObject getCacheRoot() {
  10.142 +        return FileUtil.toFileObject(FileUtil.normalizeFile(new File(cacheRoot, id)));
  10.143 +    }
  10.144 +}
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/FreemarkerUtilities.java	Mon Jun 20 23:27:31 2011 +0200
    11.3 @@ -0,0 +1,94 @@
    11.4 +/*
    11.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    11.6 + *
    11.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
    11.8 + *
    11.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   11.10 + * Other names may be trademarks of their respective owners.
   11.11 + *
   11.12 + * The contents of this file are subject to the terms of either the GNU
   11.13 + * General Public License Version 2 only ("GPL") or the Common
   11.14 + * Development and Distribution License("CDDL") (collectively, the
   11.15 + * "License"). You may not use this file except in compliance with the
   11.16 + * License. You can obtain a copy of the License at
   11.17 + * http://www.netbeans.org/cddl-gplv2.html
   11.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   11.19 + * specific language governing permissions and limitations under the
   11.20 + * License.  When distributing the software, include this License Header
   11.21 + * Notice in each file and include the License file at
   11.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   11.23 + * particular file as subject to the "Classpath" exception as provided
   11.24 + * by Oracle in the GPL Version 2 section of the License file that
   11.25 + * accompanied this code. If applicable, add the following below the
   11.26 + * License Header, with the fields enclosed by brackets [] replaced by
   11.27 + * your own identifying information:
   11.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   11.29 + *
   11.30 + * If you wish your version of this file to be governed by only the CDDL
   11.31 + * or only the GPL Version 2, indicate your decision by adding
   11.32 + * "[Contributor] elects to include this software in this distribution
   11.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   11.34 + * single choice of license, a recipient has the option to distribute
   11.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   11.36 + * to extend the choice of license to its licensees as provided above.
   11.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   11.38 + * Version 2 license, then the option applies only if the new code is
   11.39 + * made subject to such option by the copyright holder.
   11.40 + *
   11.41 + * Contributor(s):
   11.42 + *
   11.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
   11.44 + */
   11.45 +package org.netbeans.modules.jackpot30.backend.base;
   11.46 +
   11.47 +import freemarker.cache.TemplateLoader;
   11.48 +import freemarker.template.Configuration;
   11.49 +import freemarker.template.Template;
   11.50 +import freemarker.template.TemplateException;
   11.51 +import java.io.IOException;
   11.52 +import java.io.InputStream;
   11.53 +import java.io.InputStreamReader;
   11.54 +import java.io.Reader;
   11.55 +import java.io.StringWriter;
   11.56 +import java.util.Map;
   11.57 +
   11.58 +/**
   11.59 + *
   11.60 + * @author lahvac
   11.61 + */
   11.62 +public class FreemarkerUtilities {
   11.63 +
   11.64 +    public static String processTemplate(String template, Map<String, Object> configurationData) throws TemplateException, IOException {
   11.65 +        Configuration conf = new Configuration();
   11.66 +
   11.67 +        conf.setTemplateLoader(new TemplateLoaderImpl());
   11.68 +
   11.69 +        Template templ = conf.getTemplate(template);
   11.70 +        StringWriter out = new StringWriter();
   11.71 +
   11.72 +        templ.process(configurationData, out);
   11.73 +
   11.74 +        return out.toString();
   11.75 +    }
   11.76 +
   11.77 +    private static final class TemplateLoaderImpl implements TemplateLoader {
   11.78 +
   11.79 +        public Object findTemplateSource(String name) throws IOException {
   11.80 +            return TemplateLoaderImpl.class.getResourceAsStream("/" + name);
   11.81 +        }
   11.82 +
   11.83 +        public long getLastModified(Object templateSource) {
   11.84 +            return 0L;
   11.85 +        }
   11.86 +
   11.87 +        public Reader getReader(Object templateSource, String encoding) throws IOException {
   11.88 +            InputStream in = (InputStream) templateSource;
   11.89 +
   11.90 +            return new InputStreamReader(in);
   11.91 +        }
   11.92 +
   11.93 +        public void closeTemplateSource(Object templateSource) throws IOException {
   11.94 +        }
   11.95 +    }
   11.96 +
   11.97 +}
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/RelStreamHandlerFactory.java	Mon Jun 20 23:27:31 2011 +0200
    12.3 @@ -0,0 +1,72 @@
    12.4 +/*
    12.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    12.6 + *
    12.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
    12.8 + *
    12.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   12.10 + * Other names may be trademarks of their respective owners.
   12.11 + *
   12.12 + * The contents of this file are subject to the terms of either the GNU
   12.13 + * General Public License Version 2 only ("GPL") or the Common
   12.14 + * Development and Distribution License("CDDL") (collectively, the
   12.15 + * "License"). You may not use this file except in compliance with the
   12.16 + * License. You can obtain a copy of the License at
   12.17 + * http://www.netbeans.org/cddl-gplv2.html
   12.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   12.19 + * specific language governing permissions and limitations under the
   12.20 + * License.  When distributing the software, include this License Header
   12.21 + * Notice in each file and include the License file at
   12.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   12.23 + * particular file as subject to the "Classpath" exception as provided
   12.24 + * by Oracle in the GPL Version 2 section of the License file that
   12.25 + * accompanied this code. If applicable, add the following below the
   12.26 + * License Header, with the fields enclosed by brackets [] replaced by
   12.27 + * your own identifying information:
   12.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   12.29 + *
   12.30 + * If you wish your version of this file to be governed by only the CDDL
   12.31 + * or only the GPL Version 2, indicate your decision by adding
   12.32 + * "[Contributor] elects to include this software in this distribution
   12.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   12.34 + * single choice of license, a recipient has the option to distribute
   12.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   12.36 + * to extend the choice of license to its licensees as provided above.
   12.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   12.38 + * Version 2 license, then the option applies only if the new code is
   12.39 + * made subject to such option by the copyright holder.
   12.40 + *
   12.41 + * Contributor(s):
   12.42 + *
   12.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
   12.44 + */
   12.45 +package org.netbeans.modules.jackpot30.backend.base;
   12.46 +
   12.47 +import java.io.IOException;
   12.48 +import java.net.URL;
   12.49 +import java.net.URLConnection;
   12.50 +import java.net.URLStreamHandler;
   12.51 +import java.net.URLStreamHandlerFactory;
   12.52 +import org.openide.util.lookup.ServiceProvider;
   12.53 +
   12.54 +/**
   12.55 + *
   12.56 + * @author lahvac
   12.57 + */
   12.58 +@ServiceProvider(service=URLStreamHandlerFactory.class)
   12.59 +public class RelStreamHandlerFactory implements URLStreamHandlerFactory {
   12.60 +
   12.61 +    @Override
   12.62 +    public URLStreamHandler createURLStreamHandler(String protocol) {
   12.63 +        if ("rel".equals(protocol)) return new RelStreamHandler();
   12.64 +        return null;
   12.65 +    }
   12.66 +
   12.67 +    private static final class RelStreamHandler extends URLStreamHandler {
   12.68 +
   12.69 +        @Override protected URLConnection openConnection(URL u) throws IOException {
   12.70 +            throw new IOException("Cannot open");
   12.71 +        }
   12.72 +
   12.73 +    }
   12.74 +
   12.75 +}
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/WebUtilities.java	Mon Jun 20 23:27:31 2011 +0200
    13.3 @@ -0,0 +1,137 @@
    13.4 +/*
    13.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    13.6 + *
    13.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
    13.8 + *
    13.9 + * The contents of this file are subject to the terms of either the GNU
   13.10 + * General Public License Version 2 only ("GPL") or the Common
   13.11 + * Development and Distribution License("CDDL") (collectively, the
   13.12 + * "License"). You may not use this file except in compliance with the
   13.13 + * License. You can obtain a copy of the License at
   13.14 + * http://www.netbeans.org/cddl-gplv2.html
   13.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   13.16 + * specific language governing permissions and limitations under the
   13.17 + * License.  When distributing the software, include this License Header
   13.18 + * Notice in each file and include the License file at
   13.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   13.20 + * particular file as subject to the "Classpath" exception as provided
   13.21 + * by Sun in the GPL Version 2 section of the License file that
   13.22 + * accompanied this code. If applicable, add the following below the
   13.23 + * License Header, with the fields enclosed by brackets [] replaced by
   13.24 + * your own identifying information:
   13.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   13.26 + *
   13.27 + * If you wish your version of this file to be governed by only the CDDL
   13.28 + * or only the GPL Version 2, indicate your decision by adding
   13.29 + * "[Contributor] elects to include this software in this distribution
   13.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   13.31 + * single choice of license, a recipient has the option to distribute
   13.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   13.33 + * to extend the choice of license to its licensees as provided above.
   13.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   13.35 + * Version 2 license, then the option applies only if the new code is
   13.36 + * made subject to such option by the copyright holder.
   13.37 + *
   13.38 + * Contributor(s):
   13.39 + *
   13.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
   13.41 + */
   13.42 +
   13.43 +package org.netbeans.modules.jackpot30.backend.base;
   13.44 +
   13.45 +import java.io.BufferedReader;
   13.46 +import java.io.IOException;
   13.47 +import java.io.InputStream;
   13.48 +import java.io.InputStreamReader;
   13.49 +import java.net.URI;
   13.50 +import java.net.URISyntaxException;
   13.51 +import java.net.URL;
   13.52 +import java.net.URLConnection;
   13.53 +import java.util.Collection;
   13.54 +import java.util.LinkedList;
   13.55 +import java.util.List;
   13.56 +import java.util.regex.Matcher;
   13.57 +import java.util.regex.Pattern;
   13.58 +
   13.59 +/**
   13.60 + *
   13.61 + */
   13.62 +public class WebUtilities {
   13.63 +
   13.64 +    private WebUtilities() {
   13.65 +    }
   13.66 +
   13.67 +    public static String requestStringResponse (URI uri) {
   13.68 +        final StringBuffer sb = new StringBuffer ();
   13.69 +        final URL url;
   13.70 +        try {
   13.71 +            url = uri.toURL();
   13.72 +            final URLConnection urlConnection = url.openConnection ();
   13.73 +            urlConnection.connect ();
   13.74 +            final Object content = urlConnection.getContent ();
   13.75 +//            System.out.println (content);
   13.76 +//            System.out.println (content.getClass ());
   13.77 +            final InputStream inputStream = (InputStream) content;
   13.78 +            final BufferedReader reader = new BufferedReader (new InputStreamReader (inputStream, "ASCII"));
   13.79 +            try {
   13.80 +                for (;;) {
   13.81 +                    String line = reader.readLine ();
   13.82 +                    if (line == null)
   13.83 +                        break;
   13.84 +                    sb.append (line).append ('\n');
   13.85 +                }
   13.86 +            } finally {
   13.87 +                reader.close ();
   13.88 +            }
   13.89 +        } catch (IOException e) {
   13.90 +            e.printStackTrace ();  // TODO
   13.91 +            return null;
   13.92 +        }
   13.93 +        return sb.toString ();
   13.94 +    }
   13.95 +    
   13.96 +    public static Collection<? extends String> requestStringArrayResponse (URI uri) {
   13.97 +        final List<String> result = new LinkedList<String> ();
   13.98 +        final URL url;
   13.99 +        try {
  13.100 +            url = uri.toURL();
  13.101 +            final URLConnection urlConnection = url.openConnection ();
  13.102 +            urlConnection.connect ();
  13.103 +            final Object content = urlConnection.getContent ();
  13.104 +//            System.out.println (content);
  13.105 +//            System.out.println (content.getClass ());
  13.106 +            final InputStream inputStream = (InputStream) content;
  13.107 +            final BufferedReader reader = new BufferedReader (new InputStreamReader (inputStream, "ASCII"));
  13.108 +            try {
  13.109 +                for (;;) {
  13.110 +                    String line = reader.readLine ();
  13.111 +                    if (line == null)
  13.112 +                        break;
  13.113 +                    result.add (line);
  13.114 +                }
  13.115 +            } finally {
  13.116 +                reader.close ();
  13.117 +            }
  13.118 +        } catch (IOException e) {
  13.119 +            e.printStackTrace ();  // TODO
  13.120 +        }
  13.121 +        return result;
  13.122 +    }
  13.123 +
  13.124 +    private static String[] c = new String[] {"&", "<", ">", "\n", "\""}; // NOI18N
  13.125 +    private static String[] tags = new String[] {"&amp;", "&lt;", "&gt;", "<br>", "&quot;"}; // NOI18N
  13.126 +
  13.127 +    public static String escapeForHTMLElement(String input) {
  13.128 +        for (int cntr = 0; cntr < c.length; cntr++) {
  13.129 +            input = input.replaceAll(c[cntr], tags[cntr]);
  13.130 +        }
  13.131 +
  13.132 +        return input;
  13.133 +    }
  13.134 +
  13.135 +    public static String escapeForQuery(String pattern) throws URISyntaxException {
  13.136 +        if (pattern == null) return null;
  13.137 +        return new URI(null, null, null, -1, null, pattern, null).getRawQuery().replaceAll(Pattern.quote("&"), Matcher.quoteReplacement("%26"));
  13.138 +    }
  13.139 +
  13.140 +}
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/api/API.java	Mon Jun 20 23:27:31 2011 +0200
    14.3 @@ -0,0 +1,122 @@
    14.4 +/*
    14.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    14.6 + *
    14.7 + * Copyright 2009-2011 Sun Microsystems, Inc. All rights reserved.
    14.8 + *
    14.9 + * The contents of this file are subject to the terms of either the GNU
   14.10 + * General Public License Version 2 only ("GPL") or the Common
   14.11 + * Development and Distribution License("CDDL") (collectively, the
   14.12 + * "License"). You may not use this file except in compliance with the
   14.13 + * License. You can obtain a copy of the License at
   14.14 + * http://www.netbeans.org/cddl-gplv2.html
   14.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   14.16 + * specific language governing permissions and limitations under the
   14.17 + * License.  When distributing the software, include this License Header
   14.18 + * Notice in each file and include the License file at
   14.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   14.20 + * particular file as subject to the "Classpath" exception as provided
   14.21 + * by Sun in the GPL Version 2 section of the License file that
   14.22 + * accompanied this code. If applicable, add the following below the
   14.23 + * License Header, with the fields enclosed by brackets [] replaced by
   14.24 + * your own identifying information:
   14.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   14.26 + *
   14.27 + * If you wish your version of this file to be governed by only the CDDL
   14.28 + * or only the GPL Version 2, indicate your decision by adding
   14.29 + * "[Contributor] elects to include this software in this distribution
   14.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   14.31 + * single choice of license, a recipient has the option to distribute
   14.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   14.33 + * to extend the choice of license to its licensees as provided above.
   14.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   14.35 + * Version 2 license, then the option applies only if the new code is
   14.36 + * made subject to such option by the copyright holder.
   14.37 + *
   14.38 + * Contributor(s):
   14.39 + *
   14.40 + * Portions Copyrighted 2009-2011 Sun Microsystems, Inc.
   14.41 + */
   14.42 +
   14.43 +package org.netbeans.modules.jackpot30.backend.base.api;
   14.44 +
   14.45 +import java.io.IOException;
   14.46 +import java.lang.reflect.Field;
   14.47 +import java.lang.reflect.InvocationTargetException;
   14.48 +import java.lang.reflect.Method;
   14.49 +import java.util.Arrays;
   14.50 +import java.util.Map;
   14.51 +import java.util.logging.Level;
   14.52 +import java.util.logging.Logger;
   14.53 +import javax.ws.rs.GET;
   14.54 +import javax.ws.rs.Path;
   14.55 +import javax.ws.rs.Produces;
   14.56 +import org.netbeans.modules.jackpot30.backend.base.CategoryStorage;
   14.57 +import org.netbeans.modules.java.source.usages.ClassIndexImpl;
   14.58 +import org.netbeans.modules.java.source.usages.ClassIndexManager;
   14.59 +
   14.60 +/**
   14.61 + *
   14.62 + * @author lahvac
   14.63 + */
   14.64 +@Path("/index")
   14.65 +public class API {
   14.66 +
   14.67 +    @GET
   14.68 +    @Path("/list")
   14.69 +    @Produces("text/plain")
   14.70 +    public String list() throws IOException {
   14.71 +        StringBuilder sb = new StringBuilder();
   14.72 +
   14.73 +        for (CategoryStorage c : CategoryStorage.listCategories()) {
   14.74 +            sb.append(c.getId());
   14.75 +            sb.append(":");
   14.76 +            sb.append(c.getDisplayName());
   14.77 +            sb.append("\n");
   14.78 +        }
   14.79 +
   14.80 +        return sb.toString();
   14.81 +    }
   14.82 +
   14.83 +    @GET
   14.84 +    @Path("/internal/indexUpdated")
   14.85 +    @Produces("test/plain")
   14.86 +    public String indexUpdated() throws IOException {
   14.87 +        //XXX: should allow individual providers to do their own cleanup:
   14.88 +        //XXX: synchronize with the queries!
   14.89 +        //XXX: well, still does not work!
   14.90 +
   14.91 +        try {
   14.92 +            for (String name : Arrays.asList("instances", "transientInstances")) {
   14.93 +                Field instances = ClassIndexManager.class.getDeclaredField(name);
   14.94 +
   14.95 +                instances.setAccessible(true);
   14.96 +
   14.97 +                Map<?, ClassIndexImpl> toClear = (Map<?, ClassIndexImpl>) instances.get(ClassIndexManager.getDefault());
   14.98 +
   14.99 +                for (ClassIndexImpl impl : toClear.values()) {
  14.100 +                    Method close = ClassIndexImpl.class.getDeclaredMethod("close");
  14.101 +
  14.102 +                    close.setAccessible(true);
  14.103 +                    close.invoke(impl);
  14.104 +                }
  14.105 +
  14.106 +                toClear.clear();
  14.107 +            }
  14.108 +        } catch (InvocationTargetException ex) {
  14.109 +            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
  14.110 +        } catch (NoSuchMethodException ex) {
  14.111 +            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
  14.112 +        } catch (IllegalArgumentException ex) {
  14.113 +            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
  14.114 +        } catch (IllegalAccessException ex) {
  14.115 +            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
  14.116 +        } catch (NoSuchFieldException ex) {
  14.117 +            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
  14.118 +        } catch (SecurityException ex) {
  14.119 +            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
  14.120 +        }
  14.121 +        
  14.122 +        return "Done";
  14.123 +    }
  14.124 +
  14.125 +}
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/server/backend/build-indexing-backend	Mon Jun 20 23:27:31 2011 +0200
    15.3 @@ -0,0 +1,13 @@
    15.4 +#!/bin/bash -x
    15.5 +ant clean || exit 1
    15.6 +mkdir -p build/indexing-backend
    15.7 +ant build-zip && unzip -d build/indexing-backend dist/backend.zip && mv build/indexing-backend/backend build/indexing-backend/indexer || exit 1
    15.8 +mkdir -p build/indexing-backend/web
    15.9 +(cd web.main; ant clean && ant jar && cp -r dist/* ../build/indexing-backend/web) || exit 1
   15.10 +
   15.11 +cp scripts/* build/indexing-backend
   15.12 +
   15.13 +chmod u+x build/temp-indexing-backend/index
   15.14 +chmod u+x build/temp-indexing-backend/web
   15.15 +
   15.16 +(cd build; zip -r indexing-backend.zip indexing-backend)
    16.1 --- a/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/MainPage.java	Mon Jun 20 20:20:46 2011 +0200
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,59 +0,0 @@
    16.4 -/*
    16.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    16.6 - *
    16.7 - * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
    16.8 - *
    16.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   16.10 - * Other names may be trademarks of their respective owners.
   16.11 - *
   16.12 - * The contents of this file are subject to the terms of either the GNU
   16.13 - * General Public License Version 2 only ("GPL") or the Common
   16.14 - * Development and Distribution License("CDDL") (collectively, the
   16.15 - * "License"). You may not use this file except in compliance with the
   16.16 - * License. You can obtain a copy of the License at
   16.17 - * http://www.netbeans.org/cddl-gplv2.html
   16.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   16.19 - * specific language governing permissions and limitations under the
   16.20 - * License.  When distributing the software, include this License Header
   16.21 - * Notice in each file and include the License file at
   16.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   16.23 - * particular file as subject to the "Classpath" exception as provided
   16.24 - * by Oracle in the GPL Version 2 section of the License file that
   16.25 - * accompanied this code. If applicable, add the following below the
   16.26 - * License Header, with the fields enclosed by brackets [] replaced by
   16.27 - * your own identifying information:
   16.28 - * "Portions Copyrighted [year] [name of copyright owner]"
   16.29 - *
   16.30 - * If you wish your version of this file to be governed by only the CDDL
   16.31 - * or only the GPL Version 2, indicate your decision by adding
   16.32 - * "[Contributor] elects to include this software in this distribution
   16.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
   16.34 - * single choice of license, a recipient has the option to distribute
   16.35 - * your version of this file under either the CDDL, the GPL Version 2 or
   16.36 - * to extend the choice of license to its licensees as provided above.
   16.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
   16.38 - * Version 2 license, then the option applies only if the new code is
   16.39 - * made subject to such option by the copyright holder.
   16.40 - *
   16.41 - * Contributor(s):
   16.42 - *
   16.43 - * Portions Copyrighted 2011 Sun Microsystems, Inc.
   16.44 - */
   16.45 -
   16.46 -package org.netbeans.modules.jackpot30.backend.impl;
   16.47 -
   16.48 -import javax.ws.rs.GET;
   16.49 -import javax.ws.rs.Path;
   16.50 -
   16.51 -/**
   16.52 - *
   16.53 - * @author lahvac
   16.54 - */
   16.55 -@Path("/")
   16.56 -public class MainPage {
   16.57 -
   16.58 -    @GET
   16.59 -    public String main() {
   16.60 -        return "<html><body><ul><li><a href='index/ui/search'>Search Pattern</a></li><li><a href='index/ui/apply'>Apply Pattern</a></li></ul></body></html>";
   16.61 -    }
   16.62 -}
    17.1 --- a/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/OptionProcessorImpl.java	Mon Jun 20 20:20:46 2011 +0200
    17.2 +++ b/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/OptionProcessorImpl.java	Mon Jun 20 23:27:31 2011 +0200
    17.3 @@ -42,16 +42,18 @@
    17.4  
    17.5  package org.netbeans.modules.jackpot30.backend.impl;
    17.6  
    17.7 -import com.sun.jersey.api.container.httpserver.HttpServerFactory;
    17.8 -import com.sun.jersey.api.core.ClassNamesResourceConfig;
    17.9 -import com.sun.net.httpserver.HttpServer;
   17.10  import java.io.File;
   17.11 +import java.io.FileOutputStream;
   17.12  import java.io.IOException;
   17.13 +import java.io.InputStream;
   17.14  import java.util.Arrays;
   17.15  import java.util.HashSet;
   17.16  import java.util.Map;
   17.17 +import java.util.Properties;
   17.18  import java.util.Set;
   17.19  import java.util.concurrent.atomic.AtomicBoolean;
   17.20 +import java.util.jar.JarOutputStream;
   17.21 +import java.util.zip.ZipEntry;
   17.22  import org.netbeans.api.java.classpath.ClassPath;
   17.23  import org.netbeans.api.java.classpath.GlobalPathRegistry;
   17.24  import org.netbeans.api.java.source.SourceUtils;
   17.25 @@ -59,11 +61,11 @@
   17.26  import org.netbeans.api.project.ProjectManager;
   17.27  import org.netbeans.api.project.ProjectUtils;
   17.28  import org.netbeans.api.project.SourceGroup;
   17.29 +import org.netbeans.api.project.ui.OpenProjects;
   17.30  import org.netbeans.api.sendopts.CommandException;
   17.31 -import org.netbeans.modules.jackpot30.backend.impl.api.API;
   17.32 -import org.netbeans.modules.jackpot30.backend.impl.ui.UI;
   17.33  import org.netbeans.modules.jackpot30.impl.duplicates.indexing.DuplicatesCustomIndexerImpl;
   17.34  import org.netbeans.modules.jackpot30.impl.indexing.CustomIndexerImpl;
   17.35 +import org.netbeans.modules.parsing.impl.indexing.CacheFolder;
   17.36  import org.netbeans.spi.java.classpath.support.ClassPathSupport;
   17.37  import org.netbeans.spi.project.support.ant.PropertyUtils;
   17.38  import org.netbeans.spi.sendopts.Env;
   17.39 @@ -82,14 +84,12 @@
   17.40  @ServiceProvider(service=OptionProcessor.class)
   17.41  public class OptionProcessorImpl extends OptionProcessor {
   17.42  
   17.43 -    private final Option SHUTDOWN = Option.withoutArgument(Option.NO_SHORT_NAME, "shutdown");
   17.44 -    private final Option RESTART = Option.withoutArgument(Option.NO_SHORT_NAME, "restart"); //XXX: does not currently work
   17.45 -    private final Option START_SERVER = Option.withoutArgument(Option.NO_SHORT_NAME, "start-server");
   17.46 -    private final Option INDEX = Option.withoutArgument(Option.NO_SHORT_NAME, "index");
   17.47      private final Option CATEGORY_ID = Option.requiredArgument(Option.NO_SHORT_NAME, "category-id");
   17.48      private final Option CATEGORY_NAME = Option.requiredArgument(Option.NO_SHORT_NAME, "category-name");
   17.49      private final Option CATEGORY_PROJECTS = Option.additionalArguments(Option.NO_SHORT_NAME, "category-projects");
   17.50 -    private final Set<Option> OPTIONS = new HashSet<Option>(Arrays.asList(SHUTDOWN, RESTART, START_SERVER, INDEX, CATEGORY_ID, CATEGORY_NAME, CATEGORY_PROJECTS));
   17.51 +    private final Option CATEGORY_ROOT_DIR = Option.requiredArgument(Option.NO_SHORT_NAME, "category-root-dir");
   17.52 +    private final Option CACHE_TARGET = Option.requiredArgument(Option.NO_SHORT_NAME, "cache-target");
   17.53 +    private final Set<Option> OPTIONS = new HashSet<Option>(Arrays.asList(CATEGORY_ID, CATEGORY_NAME, CATEGORY_PROJECTS, CATEGORY_ROOT_DIR, CACHE_TARGET));
   17.54      
   17.55      @Override
   17.56      protected Set<Option> getOptions() {
   17.57 @@ -98,18 +98,6 @@
   17.58  
   17.59      @Override
   17.60      protected void process(Env env, Map<Option, String[]> optionValues) throws CommandException {
   17.61 -        if (optionValues.containsKey(RESTART)) {
   17.62 -            LifecycleManager.getDefault().markForRestart();
   17.63 -        }
   17.64 -
   17.65 -        if (optionValues.containsKey(SHUTDOWN) || optionValues.containsKey(RESTART)) {
   17.66 -            LifecycleManager.getDefault().exit();
   17.67 -        }
   17.68 -
   17.69 -        if (optionValues.containsKey(START_SERVER)) {
   17.70 -            startServer(env);
   17.71 -        }
   17.72 -
   17.73          String categoryId = null;
   17.74          String categoryName = null;
   17.75  
   17.76 @@ -139,20 +127,76 @@
   17.77              }
   17.78          }
   17.79  
   17.80 -        if (optionValues.containsKey(INDEX)) {
   17.81 -            if (categoryId == null) {
   17.82 -                env.getErrorStream().println("Error: no category-id specified!");
   17.83 -                return;
   17.84 +        String cacheTarget = optionValues.get(CACHE_TARGET)[0];
   17.85 +        File cache = FileUtil.normalizeFile(new File(cacheTarget));
   17.86 +
   17.87 +        cache.getParentFile().mkdirs();
   17.88 +
   17.89 +        if (categoryId == null) {
   17.90 +            env.getErrorStream().println("Error: no category-id specified!");
   17.91 +            return;
   17.92 +        }
   17.93 +
   17.94 +        try {
   17.95 +            indexProjects(CategoryStorage.getCategoryContent(categoryId), env);
   17.96 +        } catch (InterruptedException ex) {
   17.97 +            throw (CommandException) new CommandException(0).initCause(ex);
   17.98 +        } catch (IOException ex) {
   17.99 +            throw (CommandException) new CommandException(0).initCause(ex);
  17.100 +        }
  17.101 +
  17.102 +        JarOutputStream out = null;
  17.103 +        InputStream segments = null;
  17.104 +
  17.105 +        try {
  17.106 +            FileObject cacheFolder = CacheFolder.getCacheFolder();
  17.107 +
  17.108 +            out = new JarOutputStream(new FileOutputStream(cache));
  17.109 +            pack(out, cacheFolder, categoryId, new StringBuilder());
  17.110 +
  17.111 +            segments = cacheFolder.getFileObject("segments").getInputStream();
  17.112 +            Properties in = new Properties();
  17.113 +
  17.114 +            in.load(segments);
  17.115 +
  17.116 +            segments.close();//XXX: should be in finally!
  17.117 +
  17.118 +            File baseDirFile = new File(optionValues.get(CATEGORY_ROOT_DIR)[0]);
  17.119 +            String baseDir = baseDirFile.toURI().toString();
  17.120 +
  17.121 +            Properties outSegments = new Properties();
  17.122 +
  17.123 +            for (String segment : in.stringPropertyNames()) {
  17.124 +                String url = in.getProperty(segment);
  17.125 +                String rel = url.startsWith(baseDir) ? "rel:/" + url.substring(baseDir.length()) : url;
  17.126 +
  17.127 +                outSegments.setProperty(segment, rel);
  17.128              }
  17.129 -            
  17.130 -            try {
  17.131 -                indexProjects(CategoryStorage.getCategoryContent(categoryId), env);
  17.132 -            } catch (InterruptedException ex) {
  17.133 -                throw (CommandException) new CommandException(0).initCause(ex);
  17.134 -            } catch (IOException ex) {
  17.135 -                throw (CommandException) new CommandException(0).initCause(ex);
  17.136 +
  17.137 +            out.putNextEntry(new ZipEntry(categoryId + "/segments"));
  17.138 +
  17.139 +            outSegments.store(out, "");
  17.140 +        } catch (IOException ex) {
  17.141 +            throw (CommandException) new CommandException(0).initCause(ex);
  17.142 +        } finally {
  17.143 +            if (out != null) {
  17.144 +                try {
  17.145 +                    out.close();
  17.146 +                } catch (IOException ex) {
  17.147 +                    throw (CommandException) new CommandException(0).initCause(ex);
  17.148 +                }
  17.149 +            }
  17.150 +
  17.151 +            if (segments != null) {
  17.152 +                try {
  17.153 +                    segments.close();
  17.154 +                } catch (IOException ex) {
  17.155 +                    throw (CommandException) new CommandException(0).initCause(ex);
  17.156 +                }
  17.157              }
  17.158          }
  17.159 +        
  17.160 +        LifecycleManager.getDefault().exit();
  17.161      }
  17.162  
  17.163      private Set<FileObject> getRoots(String[] projects, Env env) throws IllegalArgumentException, InterruptedException {
  17.164 @@ -205,6 +249,8 @@
  17.165          if (sourceRoots.isEmpty()) {
  17.166              env.getErrorStream().println("Error: There is nothing to index!");
  17.167          } else {
  17.168 +            //XXX: to start up the project systems and RepositoryUpdater:
  17.169 +            ((Runnable) OpenProjects.getDefault().openProjects()).run();
  17.170              System.setProperty(CustomIndexerImpl.class.getName() + "-attributed", "true");//force partially attributed Jackpot index
  17.171              org.netbeans.api.project.ui.OpenProjects.getDefault().getOpenProjects();
  17.172              ClassPath source = ClassPathSupport.createClassPath(sourceRoots.toArray(new FileObject[0]));
  17.173 @@ -219,16 +265,30 @@
  17.174          }
  17.175      }
  17.176  
  17.177 -    private void startServer(Env env) {
  17.178 -        try {
  17.179 -            HttpServer server = HttpServerFactory.create("http://localhost:9998/", new ClassNamesResourceConfig(API.class, UI.class, MainPage.class));
  17.180 +    private void pack(JarOutputStream target, FileObject index, String name, StringBuilder relPath) throws IOException {
  17.181 +        int len = relPath.length();
  17.182 +        boolean first = relPath.length() == 0;
  17.183  
  17.184 -            server.start();
  17.185 -        } catch (IOException ex) {
  17.186 -            Exceptions.printStackTrace(ex);
  17.187 -        } catch (IllegalArgumentException ex) {
  17.188 -            Exceptions.printStackTrace(ex);
  17.189 +        if (!first) relPath.append("/");
  17.190 +        relPath.append(name);
  17.191 +
  17.192 +        for (FileObject c : index.getChildren()) {
  17.193 +            if (first && c.getNameExt().equals("segments")) continue;
  17.194 +            pack(target, c, c.getNameExt(), relPath);
  17.195          }
  17.196 +
  17.197 +        if (index.isData()) {
  17.198 +            target.putNextEntry(new ZipEntry(relPath.toString()));
  17.199 +
  17.200 +            InputStream in = index.getInputStream();
  17.201 +
  17.202 +            try {
  17.203 +                FileUtil.copy(in, target);
  17.204 +            } finally {
  17.205 +                in.close();
  17.206 +            }
  17.207 +        }
  17.208 +
  17.209 +        relPath.delete(len, relPath.length());
  17.210      }
  17.211 -
  17.212  }
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/server/backend/scripts/index.sh	Mon Jun 20 23:27:31 2011 +0200
    18.3 @@ -0,0 +1,14 @@
    18.4 +DIR=`dirname $0`
    18.5 +USERDIR=`tempfile`;
    18.6 +rm $USERDIR
    18.7 +mkdir -p $USERDIR
    18.8 +trap "rm -rf -- '$USERDIR'" EXIT
    18.9 +
   18.10 +ID="$1"; shift
   18.11 +NAME="$1"; shift
   18.12 +TARGET="$1"; shift
   18.13 +ROOT_DIR="$1"; shift
   18.14 +
   18.15 +$DIR/indexer/bin/backend --userdir $USERDIR --nosplash --nogui -J-Xmx2048m --category-id "$ID" --category-name "$NAME" --cache-target "$TARGET" --category-root-dir "$ROOT_DIR" --category-projects "$@"
   18.16 +
   18.17 +exit
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/server/backend/scripts/web.sh	Mon Jun 20 23:27:31 2011 +0200
    19.3 @@ -0,0 +1,2 @@
    19.4 +DIR=`dirname $0`
    19.5 +java -Xbootclasspath/p:$DIR/web/lib/javac-api-nb-7.0-b07.jar:$DIR/web/lib/javac-impl-nb-7.0-b07.jar -jar $DIR/web/web.main.jar "$@"
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/server/backend/type.web.api/build.xml	Mon Jun 20 23:27:31 2011 +0200
    20.3 @@ -0,0 +1,74 @@
    20.4 +<?xml version="1.0" encoding="UTF-8"?>
    20.5 +<!-- You may freely edit this file. See commented blocks below for -->
    20.6 +<!-- some examples of how to customize the build. -->
    20.7 +<!-- (If you delete it and reopen the project it will be recreated.) -->
    20.8 +<!-- By default, only the Clean and Build commands use this build script. -->
    20.9 +<!-- Commands such as Run, Debug, and Test only use this build script if -->
   20.10 +<!-- the Compile on Save feature is turned off for the project. -->
   20.11 +<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
   20.12 +<!-- in the project's Project Properties dialog box.-->
   20.13 +<project name="type.web.api" default="default" basedir=".">
   20.14 +    <description>Builds, tests, and runs the project type.web.api.</description>
   20.15 +    <import file="nbproject/build-impl.xml"/>
   20.16 +    <!--
   20.17 +
   20.18 +    There exist several targets which are by default empty and which can be 
   20.19 +    used for execution of your tasks. These targets are usually executed 
   20.20 +    before and after some main targets. They are: 
   20.21 +
   20.22 +      -pre-init:                 called before initialization of project properties
   20.23 +      -post-init:                called after initialization of project properties
   20.24 +      -pre-compile:              called before javac compilation
   20.25 +      -post-compile:             called after javac compilation
   20.26 +      -pre-compile-single:       called before javac compilation of single file
   20.27 +      -post-compile-single:      called after javac compilation of single file
   20.28 +      -pre-compile-test:         called before javac compilation of JUnit tests
   20.29 +      -post-compile-test:        called after javac compilation of JUnit tests
   20.30 +      -pre-compile-test-single:  called before javac compilation of single JUnit test
   20.31 +      -post-compile-test-single: called after javac compilation of single JUunit test
   20.32 +      -pre-jar:                  called before JAR building
   20.33 +      -post-jar:                 called after JAR building
   20.34 +      -post-clean:               called after cleaning build products
   20.35 +
   20.36 +    (Targets beginning with '-' are not intended to be called on their own.)
   20.37 +
   20.38 +    Example of inserting an obfuscator after compilation could look like this:
   20.39 +
   20.40 +        <target name="-post-compile">
   20.41 +            <obfuscate>
   20.42 +                <fileset dir="${build.classes.dir}"/>
   20.43 +            </obfuscate>
   20.44 +        </target>
   20.45 +
   20.46 +    For list of available properties check the imported 
   20.47 +    nbproject/build-impl.xml file. 
   20.48 +
   20.49 +
   20.50 +    Another way to customize the build is by overriding existing main targets.
   20.51 +    The targets of interest are: 
   20.52 +
   20.53 +      -init-macrodef-javac:     defines macro for javac compilation
   20.54 +      -init-macrodef-junit:     defines macro for junit execution
   20.55 +      -init-macrodef-debug:     defines macro for class debugging
   20.56 +      -init-macrodef-java:      defines macro for class execution
   20.57 +      -do-jar-with-manifest:    JAR building (if you are using a manifest)
   20.58 +      -do-jar-without-manifest: JAR building (if you are not using a manifest)
   20.59 +      run:                      execution of project 
   20.60 +      -javadoc-build:           Javadoc generation
   20.61 +      test-report:              JUnit report generation
   20.62 +
   20.63 +    An example of overriding the target for project execution could look like this:
   20.64 +
   20.65 +        <target name="run" depends="type.web.api-impl.jar">
   20.66 +            <exec dir="bin" executable="launcher.exe">
   20.67 +                <arg file="${dist.jar}"/>
   20.68 +            </exec>
   20.69 +        </target>
   20.70 +
   20.71 +    Notice that the overridden target depends on the jar target and not only on 
   20.72 +    the compile target as the regular run target does. Again, for a list of available 
   20.73 +    properties which you can use, check the target you are overriding in the
   20.74 +    nbproject/build-impl.xml file. 
   20.75 +
   20.76 +    -->
   20.77 +</project>
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/server/backend/type.web.api/manifest.mf	Mon Jun 20 23:27:31 2011 +0200
    21.3 @@ -0,0 +1,3 @@
    21.4 +Manifest-Version: 1.0
    21.5 +X-COMMENT: Main-Class will be added automatically by build
    21.6 +
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/server/backend/type.web.api/nbproject/build-impl.xml	Mon Jun 20 23:27:31 2011 +0200
    22.3 @@ -0,0 +1,1082 @@
    22.4 +<?xml version="1.0" encoding="UTF-8"?>
    22.5 +<!--
    22.6 +*** GENERATED FROM project.xml - DO NOT EDIT  ***
    22.7 +***         EDIT ../build.xml INSTEAD         ***
    22.8 +
    22.9 +For the purpose of easier reading the script
   22.10 +is divided into following sections:
   22.11 +
   22.12 +  - initialization
   22.13 +  - compilation
   22.14 +  - jar
   22.15 +  - execution
   22.16 +  - debugging
   22.17 +  - javadoc
   22.18 +  - junit compilation
   22.19 +  - junit execution
   22.20 +  - junit debugging
   22.21 +  - applet
   22.22 +  - cleanup
   22.23 +
   22.24 +        -->
   22.25 +<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="type.web.api-impl">
   22.26 +    <fail message="Please build using Ant 1.8.0 or higher.">
   22.27 +        <condition>
   22.28 +            <not>
   22.29 +                <antversion atleast="1.8.0"/>
   22.30 +            </not>
   22.31 +        </condition>
   22.32 +    </fail>
   22.33 +    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
   22.34 +    <!-- 
   22.35 +                ======================
   22.36 +                INITIALIZATION SECTION 
   22.37 +                ======================
   22.38 +            -->
   22.39 +    <target name="-pre-init">
   22.40 +        <!-- Empty placeholder for easier customization. -->
   22.41 +        <!-- You can override this target in the ../build.xml file. -->
   22.42 +    </target>
   22.43 +    <target depends="-pre-init" name="-init-private">
   22.44 +        <property file="nbproject/private/config.properties"/>
   22.45 +        <property file="nbproject/private/configs/${config}.properties"/>
   22.46 +        <property file="nbproject/private/private.properties"/>
   22.47 +    </target>
   22.48 +    <target name="-pre-init-libraries">
   22.49 +        <property location="../../lib/nblibraries.properties" name="libraries.path"/>
   22.50 +        <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
   22.51 +        <pathconvert dirsep="/" property="libraries.dir">
   22.52 +            <path path="${libraries.dir.nativedirsep}"/>
   22.53 +        </pathconvert>
   22.54 +        <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
   22.55 +        <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
   22.56 +    </target>
   22.57 +    <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
   22.58 +        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
   22.59 +            <filterchain>
   22.60 +                <replacestring from="$${base}" to="${libraries.dir}"/>
   22.61 +                <escapeunicode/>
   22.62 +            </filterchain>
   22.63 +        </loadproperties>
   22.64 +    </target>
   22.65 +    <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
   22.66 +        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
   22.67 +            <filterchain>
   22.68 +                <replacestring from="$${base}" to="${libraries.dir}"/>
   22.69 +                <escapeunicode/>
   22.70 +            </filterchain>
   22.71 +        </loadproperties>
   22.72 +    </target>
   22.73 +    <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
   22.74 +        <property file="${user.properties.file}"/>
   22.75 +        <!-- The two properties below are usually overridden -->
   22.76 +        <!-- by the active platform. Just a fallback. -->
   22.77 +        <property name="default.javac.source" value="1.4"/>
   22.78 +        <property name="default.javac.target" value="1.4"/>
   22.79 +    </target>
   22.80 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
   22.81 +        <property file="nbproject/configs/${config}.properties"/>
   22.82 +        <property file="nbproject/project.properties"/>
   22.83 +    </target>
   22.84 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
   22.85 +        <available file="${manifest.file}" property="manifest.available"/>
   22.86 +        <condition property="splashscreen.available">
   22.87 +            <and>
   22.88 +                <not>
   22.89 +                    <equals arg1="${application.splash}" arg2="" trim="true"/>
   22.90 +                </not>
   22.91 +                <available file="${application.splash}"/>
   22.92 +            </and>
   22.93 +        </condition>
   22.94 +        <condition property="main.class.available">
   22.95 +            <and>
   22.96 +                <isset property="main.class"/>
   22.97 +                <not>
   22.98 +                    <equals arg1="${main.class}" arg2="" trim="true"/>
   22.99 +                </not>
  22.100 +            </and>
  22.101 +        </condition>
  22.102 +        <condition property="manifest.available+main.class">
  22.103 +            <and>
  22.104 +                <isset property="manifest.available"/>
  22.105 +                <isset property="main.class.available"/>
  22.106 +            </and>
  22.107 +        </condition>
  22.108 +        <condition property="do.archive">
  22.109 +            <not>
  22.110 +                <istrue value="${jar.archive.disabled}"/>
  22.111 +            </not>
  22.112 +        </condition>
  22.113 +        <condition property="do.mkdist">
  22.114 +            <and>
  22.115 +                <isset property="do.archive"/>
  22.116 +                <isset property="libs.CopyLibs.classpath"/>
  22.117 +                <not>
  22.118 +                    <istrue value="${mkdist.disabled}"/>
  22.119 +                </not>
  22.120 +            </and>
  22.121 +        </condition>
  22.122 +        <condition property="manifest.available+main.class+mkdist.available">
  22.123 +            <and>
  22.124 +                <istrue value="${manifest.available+main.class}"/>
  22.125 +                <isset property="do.mkdist"/>
  22.126 +            </and>
  22.127 +        </condition>
  22.128 +        <condition property="do.archive+manifest.available">
  22.129 +            <and>
  22.130 +                <isset property="manifest.available"/>
  22.131 +                <istrue value="${do.archive}"/>
  22.132 +            </and>
  22.133 +        </condition>
  22.134 +        <condition property="do.archive+main.class.available">
  22.135 +            <and>
  22.136 +                <isset property="main.class.available"/>
  22.137 +                <istrue value="${do.archive}"/>
  22.138 +            </and>
  22.139 +        </condition>
  22.140 +        <condition property="do.archive+splashscreen.available">
  22.141 +            <and>
  22.142 +                <isset property="splashscreen.available"/>
  22.143 +                <istrue value="${do.archive}"/>
  22.144 +            </and>
  22.145 +        </condition>
  22.146 +        <condition property="do.archive+manifest.available+main.class">
  22.147 +            <and>
  22.148 +                <istrue value="${manifest.available+main.class}"/>
  22.149 +                <istrue value="${do.archive}"/>
  22.150 +            </and>
  22.151 +        </condition>
  22.152 +        <condition property="manifest.available-mkdist.available">
  22.153 +            <or>
  22.154 +                <istrue value="${manifest.available}"/>
  22.155 +                <isset property="do.mkdist"/>
  22.156 +            </or>
  22.157 +        </condition>
  22.158 +        <condition property="manifest.available+main.class-mkdist.available">
  22.159 +            <or>
  22.160 +                <istrue value="${manifest.available+main.class}"/>
  22.161 +                <isset property="do.mkdist"/>
  22.162 +            </or>
  22.163 +        </condition>
  22.164 +        <condition property="have.tests">
  22.165 +            <or>
  22.166 +                <available file="${test.src.dir}"/>
  22.167 +            </or>
  22.168 +        </condition>
  22.169 +        <condition property="have.sources">
  22.170 +            <or>
  22.171 +                <available file="${src.dir}"/>
  22.172 +            </or>
  22.173 +        </condition>
  22.174 +        <condition property="netbeans.home+have.tests">
  22.175 +            <and>
  22.176 +                <isset property="netbeans.home"/>
  22.177 +                <isset property="have.tests"/>
  22.178 +            </and>
  22.179 +        </condition>
  22.180 +        <condition property="no.javadoc.preview">
  22.181 +            <and>
  22.182 +                <isset property="javadoc.preview"/>
  22.183 +                <isfalse value="${javadoc.preview}"/>
  22.184 +            </and>
  22.185 +        </condition>
  22.186 +        <property name="run.jvmargs" value=""/>
  22.187 +        <property name="javac.compilerargs" value=""/>
  22.188 +        <property name="work.dir" value="${basedir}"/>
  22.189 +        <condition property="no.deps">
  22.190 +            <and>
  22.191 +                <istrue value="${no.dependencies}"/>
  22.192 +            </and>
  22.193 +        </condition>
  22.194 +        <property name="javac.debug" value="true"/>
  22.195 +        <property name="javadoc.preview" value="true"/>
  22.196 +        <property name="application.args" value=""/>
  22.197 +        <property name="source.encoding" value="${file.encoding}"/>
  22.198 +        <property name="runtime.encoding" value="${source.encoding}"/>
  22.199 +        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
  22.200 +            <and>
  22.201 +                <isset property="javadoc.encoding"/>
  22.202 +                <not>
  22.203 +                    <equals arg1="${javadoc.encoding}" arg2=""/>
  22.204 +                </not>
  22.205 +            </and>
  22.206 +        </condition>
  22.207 +        <property name="javadoc.encoding.used" value="${source.encoding}"/>
  22.208 +        <property name="includes" value="**"/>
  22.209 +        <property name="excludes" value=""/>
  22.210 +        <property name="do.depend" value="false"/>
  22.211 +        <condition property="do.depend.true">
  22.212 +            <istrue value="${do.depend}"/>
  22.213 +        </condition>
  22.214 +        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
  22.215 +        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
  22.216 +            <length length="0" string="${endorsed.classpath}" when="greater"/>
  22.217 +        </condition>
  22.218 +        <condition else="false" property="jdkBug6558476">
  22.219 +            <and>
  22.220 +                <matches pattern="1\.[56]" string="${java.specification.version}"/>
  22.221 +                <not>
  22.222 +                    <os family="unix"/>
  22.223 +                </not>
  22.224 +            </and>
  22.225 +        </condition>
  22.226 +        <property name="javac.fork" value="${jdkBug6558476}"/>
  22.227 +        <property name="jar.index" value="false"/>
  22.228 +        <property name="jar.index.metainf" value="${jar.index}"/>
  22.229 +        <property name="copylibs.rebase" value="true"/>
  22.230 +        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
  22.231 +    </target>
  22.232 +    <target name="-post-init">
  22.233 +        <!-- Empty placeholder for easier customization. -->
  22.234 +        <!-- You can override this target in the ../build.xml file. -->
  22.235 +    </target>
  22.236 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
  22.237 +        <fail unless="src.dir">Must set src.dir</fail>
  22.238 +        <fail unless="test.src.dir">Must set test.src.dir</fail>
  22.239 +        <fail unless="build.dir">Must set build.dir</fail>
  22.240 +        <fail unless="dist.dir">Must set dist.dir</fail>
  22.241 +        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
  22.242 +        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
  22.243 +        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
  22.244 +        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
  22.245 +        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
  22.246 +        <fail unless="dist.jar">Must set dist.jar</fail>
  22.247 +    </target>
  22.248 +    <target name="-init-macrodef-property">
  22.249 +        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
  22.250 +            <attribute name="name"/>
  22.251 +            <attribute name="value"/>
  22.252 +            <sequential>
  22.253 +                <property name="@{name}" value="${@{value}}"/>
  22.254 +            </sequential>
  22.255 +        </macrodef>
  22.256 +    </target>
  22.257 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
  22.258 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
  22.259 +            <attribute default="${src.dir}" name="srcdir"/>
  22.260 +            <attribute default="${build.classes.dir}" name="destdir"/>
  22.261 +            <attribute default="${javac.classpath}" name="classpath"/>
  22.262 +            <attribute default="${javac.processorpath}" name="processorpath"/>
  22.263 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
  22.264 +            <attribute default="${includes}" name="includes"/>
  22.265 +            <attribute default="${excludes}" name="excludes"/>
  22.266 +            <attribute default="${javac.debug}" name="debug"/>
  22.267 +            <attribute default="${empty.dir}" name="sourcepath"/>
  22.268 +            <attribute default="${empty.dir}" name="gensrcdir"/>
  22.269 +            <element name="customize" optional="true"/>
  22.270 +            <sequential>
  22.271 +                <property location="${build.dir}/empty" name="empty.dir"/>
  22.272 +                <mkdir dir="${empty.dir}"/>
  22.273 +                <mkdir dir="@{apgeneratedsrcdir}"/>
  22.274 +                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
  22.275 +                    <src>
  22.276 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
  22.277 +                            <include name="*"/>
  22.278 +                        </dirset>
  22.279 +                    </src>
  22.280 +                    <classpath>
  22.281 +                        <path path="@{classpath}"/>
  22.282 +                    </classpath>
  22.283 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
  22.284 +                    <compilerarg line="${javac.compilerargs}"/>
  22.285 +                    <compilerarg value="-processorpath"/>
  22.286 +                    <compilerarg path="@{processorpath}:${empty.dir}"/>
  22.287 +                    <compilerarg line="${ap.processors.internal}"/>
  22.288 +                    <compilerarg line="${annotation.processing.processor.options}"/>
  22.289 +                    <compilerarg value="-s"/>
  22.290 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
  22.291 +                    <compilerarg line="${ap.proc.none.internal}"/>
  22.292 +                    <customize/>
  22.293 +                </javac>
  22.294 +            </sequential>
  22.295 +        </macrodef>
  22.296 +    </target>
  22.297 +    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
  22.298 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
  22.299 +            <attribute default="${src.dir}" name="srcdir"/>
  22.300 +            <attribute default="${build.classes.dir}" name="destdir"/>
  22.301 +            <attribute default="${javac.classpath}" name="classpath"/>
  22.302 +            <attribute default="${javac.processorpath}" name="processorpath"/>
  22.303 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
  22.304 +            <attribute default="${includes}" name="includes"/>
  22.305 +            <attribute default="${excludes}" name="excludes"/>
  22.306 +            <attribute default="${javac.debug}" name="debug"/>
  22.307 +            <attribute default="${empty.dir}" name="sourcepath"/>
  22.308 +            <attribute default="${empty.dir}" name="gensrcdir"/>
  22.309 +            <element name="customize" optional="true"/>
  22.310 +            <sequential>
  22.311 +                <property location="${build.dir}/empty" name="empty.dir"/>
  22.312 +                <mkdir dir="${empty.dir}"/>
  22.313 +                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
  22.314 +                    <src>
  22.315 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
  22.316 +                            <include name="*"/>
  22.317 +                        </dirset>
  22.318 +                    </src>
  22.319 +                    <classpath>
  22.320 +                        <path path="@{classpath}"/>
  22.321 +                    </classpath>
  22.322 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
  22.323 +                    <compilerarg line="${javac.compilerargs}"/>
  22.324 +                    <customize/>
  22.325 +                </javac>
  22.326 +            </sequential>
  22.327 +        </macrodef>
  22.328 +    </target>
  22.329 +    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
  22.330 +        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
  22.331 +            <attribute default="${src.dir}" name="srcdir"/>
  22.332 +            <attribute default="${build.classes.dir}" name="destdir"/>
  22.333 +            <attribute default="${javac.classpath}" name="classpath"/>
  22.334 +            <sequential>
  22.335 +                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
  22.336 +                    <classpath>
  22.337 +                        <path path="@{classpath}"/>
  22.338 +                    </classpath>
  22.339 +                </depend>
  22.340 +            </sequential>
  22.341 +        </macrodef>
  22.342 +        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
  22.343 +            <attribute default="${build.classes.dir}" name="destdir"/>
  22.344 +            <sequential>
  22.345 +                <fail unless="javac.includes">Must set javac.includes</fail>
  22.346 +                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
  22.347 +                    <path>
  22.348 +                        <filelist dir="@{destdir}" files="${javac.includes}"/>
  22.349 +                    </path>
  22.350 +                    <globmapper from="*.java" to="*.class"/>
  22.351 +                </pathconvert>
  22.352 +                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
  22.353 +                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
  22.354 +                <delete>
  22.355 +                    <files includesfile="${javac.includesfile.binary}"/>
  22.356 +                </delete>
  22.357 +                <delete>
  22.358 +                    <fileset file="${javac.includesfile.binary}"/>
  22.359 +                </delete>
  22.360 +            </sequential>
  22.361 +        </macrodef>
  22.362 +    </target>
  22.363 +    <target name="-init-macrodef-junit">
  22.364 +        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
  22.365 +            <attribute default="${includes}" name="includes"/>
  22.366 +            <attribute default="${excludes}" name="excludes"/>
  22.367 +            <attribute default="**" name="testincludes"/>
  22.368 +            <sequential>
  22.369 +                <property name="junit.forkmode" value="perTest"/>
  22.370 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
  22.371 +                    <batchtest todir="${build.test.results.dir}">
  22.372 +                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  22.373 +                            <filename name="@{testincludes}"/>
  22.374 +                        </fileset>
  22.375 +                    </batchtest>
  22.376 +                    <classpath>
  22.377 +                        <path path="${run.test.classpath}"/>
  22.378 +                    </classpath>
  22.379 +                    <syspropertyset>
  22.380 +                        <propertyref prefix="test-sys-prop."/>
  22.381 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
  22.382 +                    </syspropertyset>
  22.383 +                    <formatter type="brief" usefile="false"/>
  22.384 +                    <formatter type="xml"/>
  22.385 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  22.386 +                    <jvmarg value="-ea"/>
  22.387 +                    <jvmarg line="${run.jvmargs}"/>
  22.388 +                </junit>
  22.389 +            </sequential>
  22.390 +        </macrodef>
  22.391 +    </target>
  22.392 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
  22.393 +    <target name="-profile-pre-init">
  22.394 +        <!-- Empty placeholder for easier customization. -->
  22.395 +        <!-- You can override this target in the ../build.xml file. -->
  22.396 +    </target>
  22.397 +    <target name="-profile-post-init">
  22.398 +        <!-- Empty placeholder for easier customization. -->
  22.399 +        <!-- You can override this target in the ../build.xml file. -->
  22.400 +    </target>
  22.401 +    <target name="-profile-init-macrodef-profile">
  22.402 +        <macrodef name="resolve">
  22.403 +            <attribute name="name"/>
  22.404 +            <attribute name="value"/>
  22.405 +            <sequential>
  22.406 +                <property name="@{name}" value="${env.@{value}}"/>
  22.407 +            </sequential>
  22.408 +        </macrodef>
  22.409 +        <macrodef name="profile">
  22.410 +            <attribute default="${main.class}" name="classname"/>
  22.411 +            <element name="customize" optional="true"/>
  22.412 +            <sequential>
  22.413 +                <property environment="env"/>
  22.414 +                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
  22.415 +                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
  22.416 +                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
  22.417 +                    <jvmarg line="${profiler.info.jvmargs}"/>
  22.418 +                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  22.419 +                    <arg line="${application.args}"/>
  22.420 +                    <classpath>
  22.421 +                        <path path="${run.classpath}"/>
  22.422 +                    </classpath>
  22.423 +                    <syspropertyset>
  22.424 +                        <propertyref prefix="run-sys-prop."/>
  22.425 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
  22.426 +                    </syspropertyset>
  22.427 +                    <customize/>
  22.428 +                </java>
  22.429 +            </sequential>
  22.430 +        </macrodef>
  22.431 +    </target>
  22.432 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
  22.433 +        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
  22.434 +        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
  22.435 +    </target>
  22.436 +    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
  22.437 +        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
  22.438 +            <attribute default="${main.class}" name="name"/>
  22.439 +            <attribute default="${debug.classpath}" name="classpath"/>
  22.440 +            <attribute default="" name="stopclassname"/>
  22.441 +            <sequential>
  22.442 +                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
  22.443 +                    <classpath>
  22.444 +                        <path path="@{classpath}"/>
  22.445 +                    </classpath>
  22.446 +                </nbjpdastart>
  22.447 +            </sequential>
  22.448 +        </macrodef>
  22.449 +        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
  22.450 +            <attribute default="${build.classes.dir}" name="dir"/>
  22.451 +            <sequential>
  22.452 +                <nbjpdareload>
  22.453 +                    <fileset dir="@{dir}" includes="${fix.classes}">
  22.454 +                        <include name="${fix.includes}*.class"/>
  22.455 +                    </fileset>
  22.456 +                </nbjpdareload>
  22.457 +            </sequential>
  22.458 +        </macrodef>
  22.459 +    </target>
  22.460 +    <target name="-init-debug-args">
  22.461 +        <property name="version-output" value="java version &quot;${ant.java.version}"/>
  22.462 +        <condition property="have-jdk-older-than-1.4">
  22.463 +            <or>
  22.464 +                <contains string="${version-output}" substring="java version &quot;1.0"/>
  22.465 +                <contains string="${version-output}" substring="java version &quot;1.1"/>
  22.466 +                <contains string="${version-output}" substring="java version &quot;1.2"/>
  22.467 +                <contains string="${version-output}" substring="java version &quot;1.3"/>
  22.468 +            </or>
  22.469 +        </condition>
  22.470 +        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
  22.471 +            <istrue value="${have-jdk-older-than-1.4}"/>
  22.472 +        </condition>
  22.473 +        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
  22.474 +            <os family="windows"/>
  22.475 +        </condition>
  22.476 +        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
  22.477 +            <isset property="debug.transport"/>
  22.478 +        </condition>
  22.479 +    </target>
  22.480 +    <target depends="-init-debug-args" name="-init-macrodef-debug">
  22.481 +        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
  22.482 +            <attribute default="${main.class}" name="classname"/>
  22.483 +            <attribute default="${debug.classpath}" name="classpath"/>
  22.484 +            <element name="customize" optional="true"/>
  22.485 +            <sequential>
  22.486 +                <java classname="@{classname}" dir="${work.dir}" fork="true">
  22.487 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  22.488 +                    <jvmarg line="${debug-args-line}"/>
  22.489 +                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
  22.490 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
  22.491 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
  22.492 +                    <jvmarg line="${run.jvmargs}"/>
  22.493 +                    <classpath>
  22.494 +                        <path path="@{classpath}"/>
  22.495 +                    </classpath>
  22.496 +                    <syspropertyset>
  22.497 +                        <propertyref prefix="run-sys-prop."/>
  22.498 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
  22.499 +                    </syspropertyset>
  22.500 +                    <customize/>
  22.501 +                </java>
  22.502 +            </sequential>
  22.503 +        </macrodef>
  22.504 +    </target>
  22.505 +    <target name="-init-macrodef-java">
  22.506 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
  22.507 +            <attribute default="${main.class}" name="classname"/>
  22.508 +            <attribute default="${run.classpath}" name="classpath"/>
  22.509 +            <element name="customize" optional="true"/>
  22.510 +            <sequential>
  22.511 +                <java classname="@{classname}" dir="${work.dir}" fork="true">
  22.512 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  22.513 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
  22.514 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
  22.515 +                    <jvmarg line="${run.jvmargs}"/>
  22.516 +                    <classpath>
  22.517 +                        <path path="@{classpath}"/>
  22.518 +                    </classpath>
  22.519 +                    <syspropertyset>
  22.520 +                        <propertyref prefix="run-sys-prop."/>
  22.521 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
  22.522 +                    </syspropertyset>
  22.523 +                    <customize/>
  22.524 +                </java>
  22.525 +            </sequential>
  22.526 +        </macrodef>
  22.527 +    </target>
  22.528 +    <target name="-init-macrodef-copylibs">
  22.529 +        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
  22.530 +            <attribute default="${manifest.file}" name="manifest"/>
  22.531 +            <element name="customize" optional="true"/>
  22.532 +            <sequential>
  22.533 +                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  22.534 +                <pathconvert property="run.classpath.without.build.classes.dir">
  22.535 +                    <path path="${run.classpath}"/>
  22.536 +                    <map from="${build.classes.dir.resolved}" to=""/>
  22.537 +                </pathconvert>
  22.538 +                <pathconvert pathsep=" " property="jar.classpath">
  22.539 +                    <path path="${run.classpath.without.build.classes.dir}"/>
  22.540 +                    <chainedmapper>
  22.541 +                        <flattenmapper/>
  22.542 +                        <globmapper from="*" to="lib/*"/>
  22.543 +                    </chainedmapper>
  22.544 +                </pathconvert>
  22.545 +                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
  22.546 +                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
  22.547 +                    <fileset dir="${build.classes.dir}"/>
  22.548 +                    <manifest>
  22.549 +                        <attribute name="Class-Path" value="${jar.classpath}"/>
  22.550 +                        <customize/>
  22.551 +                    </manifest>
  22.552 +                </copylibs>
  22.553 +            </sequential>
  22.554 +        </macrodef>
  22.555 +    </target>
  22.556 +    <target name="-init-presetdef-jar">
  22.557 +        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
  22.558 +            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
  22.559 +                <j2seproject1:fileset dir="${build.classes.dir}"/>
  22.560 +            </jar>
  22.561 +        </presetdef>
  22.562 +    </target>
  22.563 +    <target name="-init-ap-cmdline-properties">
  22.564 +        <property name="annotation.processing.enabled" value="true"/>
  22.565 +        <property name="annotation.processing.processors.list" value=""/>
  22.566 +        <property name="annotation.processing.processor.options" value=""/>
  22.567 +        <property name="annotation.processing.run.all.processors" value="true"/>
  22.568 +        <property name="javac.processorpath" value="${javac.classpath}"/>
  22.569 +        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
  22.570 +        <condition property="ap.supported.internal" value="true">
  22.571 +            <not>
  22.572 +                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
  22.573 +            </not>
  22.574 +        </condition>
  22.575 +    </target>
  22.576 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
  22.577 +        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
  22.578 +            <isfalse value="${annotation.processing.run.all.processors}"/>
  22.579 +        </condition>
  22.580 +        <condition else="" property="ap.proc.none.internal" value="-proc:none">
  22.581 +            <isfalse value="${annotation.processing.enabled}"/>
  22.582 +        </condition>
  22.583 +    </target>
  22.584 +    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
  22.585 +        <property name="ap.cmd.line.internal" value=""/>
  22.586 +    </target>
  22.587 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
  22.588 +    <!--
  22.589 +                ===================
  22.590 +                COMPILATION SECTION
  22.591 +                ===================
  22.592 +            -->
  22.593 +    <target name="-deps-jar-init" unless="built-jar.properties">
  22.594 +        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
  22.595 +        <delete file="${built-jar.properties}" quiet="true"/>
  22.596 +    </target>
  22.597 +    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
  22.598 +        <echo level="warn" message="Cycle detected: type.web.api was already built"/>
  22.599 +    </target>
  22.600 +    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
  22.601 +        <mkdir dir="${build.dir}"/>
  22.602 +        <touch file="${built-jar.properties}" verbose="false"/>
  22.603 +        <property file="${built-jar.properties}" prefix="already.built.jar."/>
  22.604 +        <antcall target="-warn-already-built-jar"/>
  22.605 +        <propertyfile file="${built-jar.properties}">
  22.606 +            <entry key="${basedir}" value=""/>
  22.607 +        </propertyfile>
  22.608 +        <antcall target="-maybe-call-dep">
  22.609 +            <param name="call.built.properties" value="${built-jar.properties}"/>
  22.610 +            <param location="${project.base_web_api}" name="call.subproject"/>
  22.611 +            <param location="${project.base_web_api}/build.xml" name="call.script"/>
  22.612 +            <param name="call.target" value="jar"/>
  22.613 +            <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
  22.614 +        </antcall>
  22.615 +    </target>
  22.616 +    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
  22.617 +    <target depends="init" name="-check-automatic-build">
  22.618 +        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
  22.619 +    </target>
  22.620 +    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
  22.621 +        <antcall target="clean"/>
  22.622 +    </target>
  22.623 +    <target depends="init,deps-jar" name="-pre-pre-compile">
  22.624 +        <mkdir dir="${build.classes.dir}"/>
  22.625 +    </target>
  22.626 +    <target name="-pre-compile">
  22.627 +        <!-- Empty placeholder for easier customization. -->
  22.628 +        <!-- You can override this target in the ../build.xml file. -->
  22.629 +    </target>
  22.630 +    <target if="do.depend.true" name="-compile-depend">
  22.631 +        <pathconvert property="build.generated.subdirs">
  22.632 +            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  22.633 +                <include name="*"/>
  22.634 +            </dirset>
  22.635 +        </pathconvert>
  22.636 +        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
  22.637 +    </target>
  22.638 +    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
  22.639 +        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
  22.640 +        <copy todir="${build.classes.dir}">
  22.641 +            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  22.642 +        </copy>
  22.643 +    </target>
  22.644 +    <target if="has.persistence.xml" name="-copy-persistence-xml">
  22.645 +        <mkdir dir="${build.classes.dir}/META-INF"/>
  22.646 +        <copy todir="${build.classes.dir}/META-INF">
  22.647 +            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
  22.648 +        </copy>
  22.649 +    </target>
  22.650 +    <target name="-post-compile">
  22.651 +        <!-- Empty placeholder for easier customization. -->
  22.652 +        <!-- You can override this target in the ../build.xml file. -->
  22.653 +    </target>
  22.654 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
  22.655 +    <target name="-pre-compile-single">
  22.656 +        <!-- Empty placeholder for easier customization. -->
  22.657 +        <!-- You can override this target in the ../build.xml file. -->
  22.658 +    </target>
  22.659 +    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
  22.660 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  22.661 +        <j2seproject3:force-recompile/>
  22.662 +        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
  22.663 +    </target>
  22.664 +    <target name="-post-compile-single">
  22.665 +        <!-- Empty placeholder for easier customization. -->
  22.666 +        <!-- You can override this target in the ../build.xml file. -->
  22.667 +    </target>
  22.668 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
  22.669 +    <!--
  22.670 +                ====================
  22.671 +                JAR BUILDING SECTION
  22.672 +                ====================
  22.673 +            -->
  22.674 +    <target depends="init" name="-pre-pre-jar">
  22.675 +        <dirname file="${dist.jar}" property="dist.jar.dir"/>
  22.676 +        <mkdir dir="${dist.jar.dir}"/>
  22.677 +    </target>
  22.678 +    <target name="-pre-jar">
  22.679 +        <!-- Empty placeholder for easier customization. -->
  22.680 +        <!-- You can override this target in the ../build.xml file. -->
  22.681 +    </target>
  22.682 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
  22.683 +        <j2seproject1:jar/>
  22.684 +    </target>
  22.685 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
  22.686 +        <j2seproject1:jar manifest="${manifest.file}"/>
  22.687 +    </target>
  22.688 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
  22.689 +        <j2seproject1:jar manifest="${manifest.file}">
  22.690 +            <j2seproject1:manifest>
  22.691 +                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
  22.692 +            </j2seproject1:manifest>
  22.693 +        </j2seproject1:jar>
  22.694 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
  22.695 +        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  22.696 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
  22.697 +        <pathconvert property="run.classpath.with.dist.jar">
  22.698 +            <path path="${run.classpath}"/>
  22.699 +            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
  22.700 +        </pathconvert>
  22.701 +        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
  22.702 +    </target>
  22.703 +    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
  22.704 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  22.705 +        <touch file="${tmp.manifest.file}" verbose="false"/>
  22.706 +    </target>
  22.707 +    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
  22.708 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  22.709 +        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
  22.710 +    </target>
  22.711 +    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
  22.712 +        <manifest file="${tmp.manifest.file}" mode="update">
  22.713 +            <attribute name="Main-Class" value="${main.class}"/>
  22.714 +        </manifest>
  22.715 +    </target>
  22.716 +    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
  22.717 +        <basename file="${application.splash}" property="splashscreen.basename"/>
  22.718 +        <mkdir dir="${build.classes.dir}/META-INF"/>
  22.719 +        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
  22.720 +        <manifest file="${tmp.manifest.file}" mode="update">
  22.721 +            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
  22.722 +        </manifest>
  22.723 +    </target>
  22.724 +    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
  22.725 +        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
  22.726 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
  22.727 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
  22.728 +        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
  22.729 +    </target>
  22.730 +    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
  22.731 +        <delete>
  22.732 +            <fileset file="${tmp.manifest.file}"/>
  22.733 +        </delete>
  22.734 +    </target>
  22.735 +    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
  22.736 +    <target name="-post-jar">
  22.737 +        <!-- Empty placeholder for easier customization. -->
  22.738 +        <!-- You can override this target in the ../build.xml file. -->
  22.739 +    </target>
  22.740 +    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
  22.741 +    <!--
  22.742 +                =================
  22.743 +                EXECUTION SECTION
  22.744 +                =================
  22.745 +            -->
  22.746 +    <target depends="init,compile" description="Run a main class." name="run">
  22.747 +        <j2seproject1:java>
  22.748 +            <customize>
  22.749 +                <arg line="${application.args}"/>
  22.750 +            </customize>
  22.751 +        </j2seproject1:java>
  22.752 +    </target>
  22.753 +    <target name="-do-not-recompile">
  22.754 +        <property name="javac.includes.binary" value=""/>
  22.755 +    </target>
  22.756 +    <target depends="init,compile-single" name="run-single">
  22.757 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  22.758 +        <j2seproject1:java classname="${run.class}"/>
  22.759 +    </target>
  22.760 +    <target depends="init,compile-test-single" name="run-test-with-main">
  22.761 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  22.762 +        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
  22.763 +    </target>
  22.764 +    <!--
  22.765 +                =================
  22.766 +                DEBUGGING SECTION
  22.767 +                =================
  22.768 +            -->
  22.769 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
  22.770 +        <j2seproject1:nbjpdastart name="${debug.class}"/>
  22.771 +    </target>
  22.772 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
  22.773 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
  22.774 +    </target>
  22.775 +    <target depends="init,compile" name="-debug-start-debuggee">
  22.776 +        <j2seproject3:debug>
  22.777 +            <customize>
  22.778 +                <arg line="${application.args}"/>
  22.779 +            </customize>
  22.780 +        </j2seproject3:debug>
  22.781 +    </target>
  22.782 +    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
  22.783 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
  22.784 +        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
  22.785 +    </target>
  22.786 +    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
  22.787 +    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
  22.788 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  22.789 +        <j2seproject3:debug classname="${debug.class}"/>
  22.790 +    </target>
  22.791 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
  22.792 +    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
  22.793 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  22.794 +        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
  22.795 +    </target>
  22.796 +    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
  22.797 +    <target depends="init" name="-pre-debug-fix">
  22.798 +        <fail unless="fix.includes">Must set fix.includes</fail>
  22.799 +        <property name="javac.includes" value="${fix.includes}.java"/>
  22.800 +    </target>
  22.801 +    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
  22.802 +        <j2seproject1:nbjpdareload/>
  22.803 +    </target>
  22.804 +    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
  22.805 +    <!--
  22.806 +                =================
  22.807 +                PROFILING SECTION
  22.808 +                =================
  22.809 +            -->
  22.810 +    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
  22.811 +        <nbprofiledirect>
  22.812 +            <classpath>
  22.813 +                <path path="${run.classpath}"/>
  22.814 +            </classpath>
  22.815 +        </nbprofiledirect>
  22.816 +        <profile/>
  22.817 +    </target>
  22.818 +    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
  22.819 +        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
  22.820 +        <nbprofiledirect>
  22.821 +            <classpath>
  22.822 +                <path path="${run.classpath}"/>
  22.823 +            </classpath>
  22.824 +        </nbprofiledirect>
  22.825 +        <profile classname="${profile.class}"/>
  22.826 +    </target>
  22.827 +    <!--
  22.828 +                =========================
  22.829 +                APPLET PROFILING  SECTION
  22.830 +                =========================
  22.831 +            -->
  22.832 +    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
  22.833 +        <nbprofiledirect>
  22.834 +            <classpath>
  22.835 +                <path path="${run.classpath}"/>
  22.836 +            </classpath>
  22.837 +        </nbprofiledirect>
  22.838 +        <profile classname="sun.applet.AppletViewer">
  22.839 +            <customize>
  22.840 +                <arg value="${applet.url}"/>
  22.841 +            </customize>
  22.842 +        </profile>
  22.843 +    </target>
  22.844 +    <!--
  22.845 +                =========================
  22.846 +                TESTS PROFILING  SECTION
  22.847 +                =========================
  22.848 +            -->
  22.849 +    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
  22.850 +        <nbprofiledirect>
  22.851 +            <classpath>
  22.852 +                <path path="${run.test.classpath}"/>
  22.853 +            </classpath>
  22.854 +        </nbprofiledirect>
  22.855 +        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
  22.856 +            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  22.857 +            <jvmarg value="${profiler.info.jvmargs.agent}"/>
  22.858 +            <jvmarg line="${profiler.info.jvmargs}"/>
  22.859 +            <test name="${profile.class}"/>
  22.860 +            <classpath>
  22.861 +                <path path="${run.test.classpath}"/>
  22.862 +            </classpath>
  22.863 +            <syspropertyset>
  22.864 +                <propertyref prefix="test-sys-prop."/>
  22.865 +                <mapper from="test-sys-prop.*" to="*" type="glob"/>
  22.866 +            </syspropertyset>
  22.867 +            <formatter type="brief" usefile="false"/>
  22.868 +            <formatter type="xml"/>
  22.869 +        </junit>
  22.870 +    </target>
  22.871 +    <!--
  22.872 +                ===============
  22.873 +                JAVADOC SECTION
  22.874 +                ===============
  22.875 +            -->
  22.876 +    <target depends="init" if="have.sources" name="-javadoc-build">
  22.877 +        <mkdir dir="${dist.javadoc.dir}"/>
  22.878 +        <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}">
  22.879 +            <classpath>
  22.880 +                <path path="${javac.classpath}"/>
  22.881 +            </classpath>
  22.882 +            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
  22.883 +                <filename name="**/*.java"/>
  22.884 +            </fileset>
  22.885 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  22.886 +                <include name="**/*.java"/>
  22.887 +                <exclude name="*.java"/>
  22.888 +            </fileset>
  22.889 +        </javadoc>
  22.890 +        <copy todir="${dist.javadoc.dir}">
  22.891 +            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  22.892 +                <filename name="**/doc-files/**"/>
  22.893 +            </fileset>
  22.894 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  22.895 +                <include name="**/doc-files/**"/>
  22.896 +            </fileset>
  22.897 +        </copy>
  22.898 +    </target>
  22.899 +    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
  22.900 +        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
  22.901 +    </target>
  22.902 +    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
  22.903 +    <!--
  22.904 +                =========================
  22.905 +                JUNIT COMPILATION SECTION
  22.906 +                =========================
  22.907 +            -->
  22.908 +    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
  22.909 +        <mkdir dir="${build.test.classes.dir}"/>
  22.910 +    </target>
  22.911 +    <target name="-pre-compile-test">
  22.912 +        <!-- Empty placeholder for easier customization. -->
  22.913 +        <!-- You can override this target in the ../build.xml file. -->
  22.914 +    </target>
  22.915 +    <target if="do.depend.true" name="-compile-test-depend">
  22.916 +        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  22.917 +    </target>
  22.918 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  22.919 +        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
  22.920 +        <copy todir="${build.test.classes.dir}">
  22.921 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  22.922 +        </copy>
  22.923 +    </target>
  22.924 +    <target name="-post-compile-test">
  22.925 +        <!-- Empty placeholder for easier customization. -->
  22.926 +        <!-- You can override this target in the ../build.xml file. -->
  22.927 +    </target>
  22.928 +    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
  22.929 +    <target name="-pre-compile-test-single">
  22.930 +        <!-- Empty placeholder for easier customization. -->
  22.931 +        <!-- You can override this target in the ../build.xml file. -->
  22.932 +    </target>
  22.933 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  22.934 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  22.935 +        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
  22.936 +        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
  22.937 +        <copy todir="${build.test.classes.dir}">
  22.938 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  22.939 +        </copy>
  22.940 +    </target>
  22.941 +    <target name="-post-compile-test-single">
  22.942 +        <!-- Empty placeholder for easier customization. -->
  22.943 +        <!-- You can override this target in the ../build.xml file. -->
  22.944 +    </target>
  22.945 +    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
  22.946 +    <!--
  22.947 +                =======================
  22.948 +                JUNIT EXECUTION SECTION
  22.949 +                =======================
  22.950 +            -->
  22.951 +    <target depends="init" if="have.tests" name="-pre-test-run">
  22.952 +        <mkdir dir="${build.test.results.dir}"/>
  22.953 +    </target>
  22.954 +    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  22.955 +        <j2seproject3:junit testincludes="**/*Test.java"/>
  22.956 +    </target>
  22.957 +    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  22.958 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  22.959 +    </target>
  22.960 +    <target depends="init" if="have.tests" name="test-report"/>
  22.961 +    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
  22.962 +    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
  22.963 +    <target depends="init" if="have.tests" name="-pre-test-run-single">
  22.964 +        <mkdir dir="${build.test.results.dir}"/>
  22.965 +    </target>
  22.966 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  22.967 +        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  22.968 +        <j2seproject3:junit excludes="" includes="${test.includes}"/>
  22.969 +    </target>
  22.970 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
  22.971 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  22.972 +    </target>
  22.973 +    <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"/>
  22.974 +    <!--
  22.975 +                =======================
  22.976 +                JUNIT DEBUGGING SECTION
  22.977 +                =======================
  22.978 +            -->
  22.979 +    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
  22.980 +        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  22.981 +        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
  22.982 +        <delete file="${test.report.file}"/>
  22.983 +        <mkdir dir="${build.test.results.dir}"/>
  22.984 +        <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
  22.985 +            <customize>
  22.986 +                <syspropertyset>
  22.987 +                    <propertyref prefix="test-sys-prop."/>
  22.988 +                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
  22.989 +                </syspropertyset>
  22.990 +                <arg value="${test.class}"/>
  22.991 +                <arg value="showoutput=true"/>
  22.992 +                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
  22.993 +                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
  22.994 +            </customize>
  22.995 +        </j2seproject3:debug>
  22.996 +    </target>
  22.997 +    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
  22.998 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
  22.999 +    </target>
 22.1000 +    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
 22.1001 +    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
 22.1002 +        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
 22.1003 +    </target>
 22.1004 +    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
 22.1005 +    <!--
 22.1006 +                =========================
 22.1007 +                APPLET EXECUTION SECTION
 22.1008 +                =========================
 22.1009 +            -->
 22.1010 +    <target depends="init,compile-single" name="run-applet">
 22.1011 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
 22.1012 +        <j2seproject1:java classname="sun.applet.AppletViewer">
 22.1013 +            <customize>
 22.1014 +                <arg value="${applet.url}"/>
 22.1015 +            </customize>
 22.1016 +        </j2seproject1:java>
 22.1017 +    </target>
 22.1018 +    <!--
 22.1019 +                =========================
 22.1020 +                APPLET DEBUGGING  SECTION
 22.1021 +                =========================
 22.1022 +            -->
 22.1023 +    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
 22.1024 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
 22.1025 +        <j2seproject3:debug classname="sun.applet.AppletViewer">
 22.1026 +            <customize>
 22.1027 +                <arg value="${applet.url}"/>
 22.1028 +            </customize>
 22.1029 +        </j2seproject3:debug>
 22.1030 +    </target>
 22.1031 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
 22.1032 +    <!--
 22.1033 +                ===============
 22.1034 +                CLEANUP SECTION
 22.1035 +                ===============
 22.1036 +            -->
 22.1037 +    <target name="-deps-clean-init" unless="built-clean.properties">
 22.1038 +        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
 22.1039 +        <delete file="${built-clean.properties}" quiet="true"/>
 22.1040 +    </target>
 22.1041 +    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
 22.1042 +        <echo level="warn" message="Cycle detected: type.web.api was already built"/>
 22.1043 +    </target>
 22.1044 +    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
 22.1045 +        <mkdir dir="${build.dir}"/>
 22.1046 +        <touch file="${built-clean.properties}" verbose="false"/>
 22.1047 +        <property file="${built-clean.properties}" prefix="already.built.clean."/>
 22.1048 +        <antcall target="-warn-already-built-clean"/>
 22.1049 +        <propertyfile file="${built-clean.properties}">
 22.1050 +            <entry key="${basedir}" value=""/>
 22.1051 +        </propertyfile>
 22.1052 +        <antcall target="-maybe-call-dep">
 22.1053 +            <param name="call.built.properties" value="${built-clean.properties}"/>
 22.1054 +            <param location="${project.base_web_api}" name="call.subproject"/>
 22.1055 +            <param location="${project.base_web_api}/build.xml" name="call.script"/>
 22.1056 +            <param name="call.target" value="clean"/>
 22.1057 +            <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
 22.1058 +        </antcall>
 22.1059 +    </target>
 22.1060 +    <target depends="init" name="-do-clean">
 22.1061 +        <delete dir="${build.dir}"/>
 22.1062 +        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
 22.1063 +    </target>
 22.1064 +    <target name="-post-clean">
 22.1065 +        <!-- Empty placeholder for easier customization. -->
 22.1066 +        <!-- You can override this target in the ../build.xml file. -->
 22.1067 +    </target>
 22.1068 +    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
 22.1069 +    <target name="-check-call-dep">
 22.1070 +        <property file="${call.built.properties}" prefix="already.built."/>
 22.1071 +        <condition property="should.call.dep">
 22.1072 +            <not>
 22.1073 +                <isset property="already.built.${call.subproject}"/>
 22.1074 +            </not>
 22.1075 +        </condition>
 22.1076 +    </target>
 22.1077 +    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
 22.1078 +        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
 22.1079 +            <propertyset>
 22.1080 +                <propertyref prefix="transfer."/>
 22.1081 +                <mapper from="transfer.*" to="*" type="glob"/>
 22.1082 +            </propertyset>
 22.1083 +        </ant>
 22.1084 +    </target>
 22.1085 +</project>
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/server/backend/type.web.api/nbproject/genfiles.properties	Mon Jun 20 23:27:31 2011 +0200
    23.3 @@ -0,0 +1,8 @@
    23.4 +build.xml.data.CRC32=1bd1d79c
    23.5 +build.xml.script.CRC32=583d72ad
    23.6 +build.xml.stylesheet.CRC32=28e38971@1.45.0.45
    23.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
    23.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    23.9 +nbproject/build-impl.xml.data.CRC32=1bd1d79c
   23.10 +nbproject/build-impl.xml.script.CRC32=5a5278a8
   23.11 +nbproject/build-impl.xml.stylesheet.CRC32=cfcde7f8@1.45.0.45
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/server/backend/type.web.api/nbproject/project.properties	Mon Jun 20 23:27:31 2011 +0200
    24.3 @@ -0,0 +1,96 @@
    24.4 +annotation.processing.enabled=true
    24.5 +annotation.processing.enabled.in.editor=false
    24.6 +annotation.processing.run.all.processors=true
    24.7 +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
    24.8 +application.title=type.web.api
    24.9 +application.vendor=lahvac
   24.10 +build.classes.dir=${build.dir}/classes
   24.11 +build.classes.excludes=**/*.java,**/*.form
   24.12 +# This directory is removed when the project is cleaned:
   24.13 +build.dir=build
   24.14 +build.generated.dir=${build.dir}/generated
   24.15 +build.generated.sources.dir=${build.dir}/generated-sources
   24.16 +# Only compile against the classpath explicitly listed here:
   24.17 +build.sysclasspath=ignore
   24.18 +build.test.classes.dir=${build.dir}/test/classes
   24.19 +build.test.results.dir=${build.dir}/test/results
   24.20 +# Uncomment to specify the preferred debugger connection transport:
   24.21 +#debug.transport=dt_socket
   24.22 +debug.classpath=\
   24.23 +    ${run.classpath}
   24.24 +debug.test.classpath=\
   24.25 +    ${run.test.classpath}
   24.26 +# This directory is removed when the project is cleaned:
   24.27 +dist.dir=dist
   24.28 +dist.jar=${dist.dir}/type.web.api.jar
   24.29 +dist.javadoc.dir=${dist.dir}/javadoc
   24.30 +endorsed.classpath=
   24.31 +excludes=
   24.32 +file.reference.org-netbeans-api-java-classpath.jar=../../lib/org-netbeans-api-java-classpath.jar
   24.33 +file.reference.org-netbeans-modules-java-source.jar=../../lib/org-netbeans-modules-java-source.jar
   24.34 +file.reference.org-netbeans-modules-jumpto.jar=../../lib/org-netbeans-modules-jumpto.jar
   24.35 +file.reference.org-netbeans-modules-parsing-lucene.jar=../../lib/org-netbeans-modules-parsing-lucene.jar
   24.36 +file.reference.org-openide-filesystems.jar=../../lib/org-openide-filesystems.jar
   24.37 +file.reference.util-commons.jar=../../../libs.jerig/external/util-commons.jar
   24.38 +file.reference.util-lutz.jar=../../../libs.jerig/external/util-lutz.jar
   24.39 +file.reference.util-pojson.jar=../../../libs.jerig/external/util-pojson.jar
   24.40 +file.reference.util-strast.jar=../../../libs.jerig/external/util-strast.jar
   24.41 +includes=**
   24.42 +jar.compress=false
   24.43 +javac.classpath=\
   24.44 +    ${libs.lucene.classpath}:\
   24.45 +    ${libs.jersey.classpath}:\
   24.46 +    ${file.reference.org-netbeans-modules-java-source.jar}:\
   24.47 +    ${libs.freemarker.classpath}:\
   24.48 +    ${file.reference.util-commons.jar}:\
   24.49 +    ${file.reference.util-lutz.jar}:\
   24.50 +    ${file.reference.util-pojson.jar}:\
   24.51 +    ${file.reference.util-strast.jar}:\
   24.52 +    ${reference.base_web_api.jar}:\
   24.53 +    ${file.reference.org-openide-filesystems.jar}:\
   24.54 +    ${file.reference.org-netbeans-api-java-classpath.jar}:\
   24.55 +    ${file.reference.org-netbeans-modules-jumpto.jar}:\
   24.56 +    ${file.reference.org-netbeans-modules-parsing-lucene.jar}
   24.57 +# Space-separated list of extra javac options
   24.58 +javac.compilerargs=
   24.59 +javac.deprecation=false
   24.60 +javac.processorpath=\
   24.61 +    ${javac.classpath}
   24.62 +javac.source=1.6
   24.63 +javac.target=1.6
   24.64 +javac.test.classpath=\
   24.65 +    ${javac.classpath}:\
   24.66 +    ${build.classes.dir}
   24.67 +javac.test.processorpath=\
   24.68 +    ${javac.test.classpath}
   24.69 +javadoc.additionalparam=
   24.70 +javadoc.author=false
   24.71 +javadoc.encoding=${source.encoding}
   24.72 +javadoc.noindex=false
   24.73 +javadoc.nonavbar=false
   24.74 +javadoc.notree=false
   24.75 +javadoc.private=false
   24.76 +javadoc.splitindex=true
   24.77 +javadoc.use=true
   24.78 +javadoc.version=false
   24.79 +javadoc.windowtitle=
   24.80 +main.class=type.web.api.TypeWebApi
   24.81 +manifest.file=manifest.mf
   24.82 +meta.inf.dir=${src.dir}/META-INF
   24.83 +mkdist.disabled=false
   24.84 +platform.active=default_platform
   24.85 +project.base_web_api=../base.web.api
   24.86 +reference.base_web_api.jar=${project.base_web_api}/dist/base.web.api.jar
   24.87 +run.classpath=\
   24.88 +    ${javac.classpath}:\
   24.89 +    ${build.classes.dir}
   24.90 +# Space-separated list of JVM arguments used when running the project
   24.91 +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
   24.92 +# or test-sys-prop.name=value to set system properties for unit tests):
   24.93 +run.jvmargs=
   24.94 +run.test.classpath=\
   24.95 +    ${javac.test.classpath}:\
   24.96 +    ${build.test.classes.dir}
   24.97 +source.encoding=UTF-8
   24.98 +src.dir=src
   24.99 +test.src.dir=test
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/server/backend/type.web.api/nbproject/project.xml	Mon Jun 20 23:27:31 2011 +0200
    25.3 @@ -0,0 +1,28 @@
    25.4 +<?xml version="1.0" encoding="UTF-8"?>
    25.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
    25.6 +    <type>org.netbeans.modules.java.j2seproject</type>
    25.7 +    <configuration>
    25.8 +        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
    25.9 +            <name>type.web.api</name>
   25.10 +            <source-roots>
   25.11 +                <root id="src.dir"/>
   25.12 +            </source-roots>
   25.13 +            <test-roots>
   25.14 +                <root id="test.src.dir"/>
   25.15 +            </test-roots>
   25.16 +        </data>
   25.17 +        <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
   25.18 +            <definitions>../../lib/nblibraries.properties</definitions>
   25.19 +        </libraries>
   25.20 +        <references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
   25.21 +            <reference>
   25.22 +                <foreign-project>base_web_api</foreign-project>
   25.23 +                <artifact-type>jar</artifact-type>
   25.24 +                <script>build.xml</script>
   25.25 +                <target>jar</target>
   25.26 +                <clean-target>clean</clean-target>
   25.27 +                <id>jar</id>
   25.28 +            </reference>
   25.29 +        </references>
   25.30 +    </configuration>
   25.31 +</project>
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/server/backend/type.web.api/src/org/netbeans/modules/jackpot30/backend/type/api/API.java	Mon Jun 20 23:27:31 2011 +0200
    26.3 @@ -0,0 +1,133 @@
    26.4 +/*
    26.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    26.6 + *
    26.7 + * Copyright 2009-2011 Sun Microsystems, Inc. All rights reserved.
    26.8 + *
    26.9 + * The contents of this file are subject to the terms of either the GNU
   26.10 + * General Public License Version 2 only ("GPL") or the Common
   26.11 + * Development and Distribution License("CDDL") (collectively, the
   26.12 + * "License"). You may not use this file except in compliance with the
   26.13 + * License. You can obtain a copy of the License at
   26.14 + * http://www.netbeans.org/cddl-gplv2.html
   26.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   26.16 + * specific language governing permissions and limitations under the
   26.17 + * License.  When distributing the software, include this License Header
   26.18 + * Notice in each file and include the License file at
   26.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   26.20 + * particular file as subject to the "Classpath" exception as provided
   26.21 + * by Sun in the GPL Version 2 section of the License file that
   26.22 + * accompanied this code. If applicable, add the following below the
   26.23 + * License Header, with the fields enclosed by brackets [] replaced by
   26.24 + * your own identifying information:
   26.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   26.26 + *
   26.27 + * If you wish your version of this file to be governed by only the CDDL
   26.28 + * or only the GPL Version 2, indicate your decision by adding
   26.29 + * "[Contributor] elects to include this software in this distribution
   26.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   26.31 + * single choice of license, a recipient has the option to distribute
   26.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   26.33 + * to extend the choice of license to its licensees as provided above.
   26.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   26.35 + * Version 2 license, then the option applies only if the new code is
   26.36 + * made subject to such option by the copyright holder.
   26.37 + *
   26.38 + * Contributor(s):
   26.39 + *
   26.40 + * Portions Copyrighted 2009-2011 Sun Microsystems, Inc.
   26.41 + */
   26.42 +
   26.43 +package org.netbeans.modules.jackpot30.backend.type.api;
   26.44 +
   26.45 +import java.io.IOException;
   26.46 +import java.net.URL;
   26.47 +import java.util.ArrayList;
   26.48 +import java.util.EnumSet;
   26.49 +import java.util.HashSet;
   26.50 +import java.util.LinkedHashMap;
   26.51 +import java.util.List;
   26.52 +import java.util.Map;
   26.53 +import java.util.Set;
   26.54 +import javax.lang.model.element.TypeElement;
   26.55 +import javax.ws.rs.DefaultValue;
   26.56 +import javax.ws.rs.GET;
   26.57 +import javax.ws.rs.Path;
   26.58 +import javax.ws.rs.Produces;
   26.59 +import javax.ws.rs.QueryParam;
   26.60 +import org.codeviation.pojson.Pojson;
   26.61 +import org.netbeans.api.java.classpath.ClassPath;
   26.62 +import org.netbeans.api.java.source.ClassIndex.NameKind;
   26.63 +import org.netbeans.api.java.source.ClassIndex.SearchScope;
   26.64 +import org.netbeans.api.java.source.ClasspathInfo;
   26.65 +import org.netbeans.api.java.source.ElementHandle;
   26.66 +import org.netbeans.modules.jackpot30.backend.base.CategoryStorage;
   26.67 +import org.netbeans.modules.java.source.usages.ClassIndexManager;
   26.68 +import org.netbeans.modules.jumpto.type.GoToTypeAction;
   26.69 +import org.netbeans.spi.java.classpath.support.ClassPathSupport;
   26.70 +
   26.71 +/**
   26.72 + *
   26.73 + * @author lahvac
   26.74 + */
   26.75 +@Path("/index/type")
   26.76 +public class API {
   26.77 +
   26.78 +    @GET
   26.79 +    @Path("/search")
   26.80 +    @Produces("text/plain")
   26.81 +    public String findType(@QueryParam("path") String segment, @QueryParam("prefix") String prefix, @QueryParam("casesensitive") @DefaultValue("false") boolean casesensitive, @QueryParam("asynchronous") @DefaultValue(value="false") boolean asynchronous) throws IOException {
   26.82 +        assert !asynchronous;
   26.83 +
   26.84 +        //copied (and converted to NameKind) from jumpto's GoToTypeAction:
   26.85 +        boolean exact = prefix.endsWith(" "); // NOI18N
   26.86 +
   26.87 +        prefix = prefix.trim();
   26.88 +
   26.89 +        if ( prefix.length() == 0) {
   26.90 +            return "";
   26.91 +        }
   26.92 +
   26.93 +        NameKind nameKind;
   26.94 +        int wildcard = GoToTypeAction.containsWildCard(prefix);
   26.95 +
   26.96 +        if (exact) {
   26.97 +            //nameKind = panel.isCaseSensitive() ? SearchType.EXACT_NAME : SearchType.CASE_INSENSITIVE_EXACT_NAME;
   26.98 +            nameKind = NameKind.SIMPLE_NAME;
   26.99 +        }
  26.100 +        else if ((GoToTypeAction.isAllUpper(prefix) && prefix.length() > 1) || GoToTypeAction.isCamelCase(prefix)) {
  26.101 +            nameKind = NameKind.CAMEL_CASE;
  26.102 +        }
  26.103 +        else if (wildcard != -1) {
  26.104 +            nameKind = casesensitive ? NameKind.REGEXP : NameKind.CASE_INSENSITIVE_REGEXP;
  26.105 +        }
  26.106 +        else {
  26.107 +            nameKind = casesensitive ? NameKind.PREFIX : NameKind.CASE_INSENSITIVE_PREFIX;
  26.108 +        }
  26.109 +
  26.110 +        Map<String, List<String>> result = new LinkedHashMap<String, List<String>>();
  26.111 +        CategoryStorage srcRoots = CategoryStorage.forId(segment);
  26.112 +
  26.113 +        for (URL srcRoot : srcRoots.getCategoryIndexFolders()) {
  26.114 +            if (!"rel".equals(srcRoot.getProtocol())) continue;
  26.115 +            String rootId = srcRoot.getPath().substring(1);
  26.116 +            List<String> currentResult = new ArrayList<String>();
  26.117 +
  26.118 +            result.put(rootId, currentResult);
  26.119 +
  26.120 +            ClassIndexManager.getDefault().createUsagesQuery(srcRoot, true).isValid();
  26.121 +            ClasspathInfo cpInfo = ClasspathInfo.create(ClassPath.EMPTY, ClassPath.EMPTY, ClassPathSupport.createClassPath(srcRoot));
  26.122 +            Set<ElementHandle<TypeElement>> names = new HashSet<ElementHandle<TypeElement>>(cpInfo.getClassIndex().getDeclaredTypes(prefix, nameKind, EnumSet.of(SearchScope.SOURCE)));
  26.123 +
  26.124 +            if (nameKind == NameKind.CAMEL_CASE) {
  26.125 +                names.addAll(cpInfo.getClassIndex().getDeclaredTypes(prefix, NameKind.CASE_INSENSITIVE_PREFIX, EnumSet.of(SearchScope.SOURCE)));
  26.126 +            }
  26.127 +
  26.128 +            for (ElementHandle<TypeElement> d : names) {
  26.129 +                currentResult.add(d.getBinaryName());
  26.130 +            }
  26.131 +        }
  26.132 +
  26.133 +        return Pojson.save(result);
  26.134 +    }
  26.135 +
  26.136 +}
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/server/backend/type.web.api/src/org/netbeans/modules/jackpot30/backend/type/ui/UI.java	Mon Jun 20 23:27:31 2011 +0200
    27.3 @@ -0,0 +1,141 @@
    27.4 +/*
    27.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    27.6 + *
    27.7 + * Copyright 2009-2011 Oracle and/or its affiliates. All rights reserved.
    27.8 + *
    27.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   27.10 + * Other names may be trademarks of their respective owners.
   27.11 + *
   27.12 + * The contents of this file are subject to the terms of either the GNU
   27.13 + * General Public License Version 2 only ("GPL") or the Common
   27.14 + * Development and Distribution License("CDDL") (collectively, the
   27.15 + * "License"). You may not use this file except in compliance with the
   27.16 + * License. You can obtain a copy of the License at
   27.17 + * http://www.netbeans.org/cddl-gplv2.html
   27.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   27.19 + * specific language governing permissions and limitations under the
   27.20 + * License.  When distributing the software, include this License Header
   27.21 + * Notice in each file and include the License file at
   27.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   27.23 + * particular file as subject to the "Classpath" exception as provided
   27.24 + * by Oracle in the GPL Version 2 section of the License file that
   27.25 + * accompanied this code. If applicable, add the following below the
   27.26 + * License Header, with the fields enclosed by brackets [] replaced by
   27.27 + * your own identifying information:
   27.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   27.29 + *
   27.30 + * If you wish your version of this file to be governed by only the CDDL
   27.31 + * or only the GPL Version 2, indicate your decision by adding
   27.32 + * "[Contributor] elects to include this software in this distribution
   27.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   27.34 + * single choice of license, a recipient has the option to distribute
   27.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   27.36 + * to extend the choice of license to its licensees as provided above.
   27.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   27.38 + * Version 2 license, then the option applies only if the new code is
   27.39 + * made subject to such option by the copyright holder.
   27.40 + *
   27.41 + * Contributor(s):
   27.42 + *
   27.43 + * Portions Copyrighted 2009-2011 Sun Microsystems, Inc.
   27.44 + */
   27.45 +
   27.46 +package org.netbeans.modules.jackpot30.backend.type.ui;
   27.47 +
   27.48 +import java.util.Comparator;
   27.49 +import java.util.LinkedHashMap;
   27.50 +import java.util.Map.Entry;
   27.51 +import freemarker.template.TemplateException;
   27.52 +import java.io.IOException;
   27.53 +import java.net.URI;
   27.54 +import java.net.URISyntaxException;
   27.55 +import java.util.Collections;
   27.56 +import java.util.HashMap;
   27.57 +import java.util.LinkedList;
   27.58 +import java.util.List;
   27.59 +import java.util.Map;
   27.60 +import javax.ws.rs.GET;
   27.61 +import javax.ws.rs.Path;
   27.62 +import javax.ws.rs.Produces;
   27.63 +import javax.ws.rs.QueryParam;
   27.64 +import org.codeviation.pojson.Pojson;
   27.65 +import org.netbeans.modules.jackpot30.backend.base.FreemarkerUtilities;
   27.66 +import org.netbeans.modules.jackpot30.backend.base.WebUtilities;
   27.67 +import static org.netbeans.modules.jackpot30.backend.base.WebUtilities.escapeForQuery;
   27.68 +
   27.69 +/**
   27.70 + *
   27.71 + * @author lahvac
   27.72 + */
   27.73 +@Path("/index/type/ui")
   27.74 +public class UI {
   27.75 +
   27.76 +    @GET
   27.77 +    @Path("/search")
   27.78 +    @Produces("text/html")
   27.79 +    public String searchType(@QueryParam("path") String path, @QueryParam("prefix") String prefix) throws URISyntaxException, IOException, TemplateException {
   27.80 +        Map<String, Object> configurationData = new HashMap<String, Object>();
   27.81 +
   27.82 +        configurationData.put("paths", list());
   27.83 +        configurationData.put("selectedPath", path);
   27.84 +        configurationData.put("prefix", prefix);
   27.85 +
   27.86 +        if (prefix != null && path != null) {
   27.87 +            URI u = new URI("http://localhost:9998/index/type/search?path=" + escapeForQuery(path) + "&prefix=" + escapeForQuery(prefix));
   27.88 +            long queryTime = System.currentTimeMillis();
   27.89 +            @SuppressWarnings("unchecked") //XXX: should not trust something got from the network!
   27.90 +            Map<String, List<String>> types = Pojson.load(LinkedHashMap.class, u);
   27.91 +            List<Map<String, Object>> results = new LinkedList<Map<String, Object>>();
   27.92 +
   27.93 +            queryTime = System.currentTimeMillis() - queryTime;
   27.94 +
   27.95 +            for (Entry<String, List<String>> e : types.entrySet()) {
   27.96 +                for (String fqn : e.getValue()) {
   27.97 +                    Map<String, Object> found = new HashMap<String, Object>(3);
   27.98 +
   27.99 +                    found.put("fqn", fqn);
  27.100 +
  27.101 +                    if (fqn.contains("$")) {
  27.102 +                        fqn = fqn.substring(0, fqn.indexOf("$"));
  27.103 +                    }
  27.104 +
  27.105 +                    found.put("relativePath", e.getKey() + /*"/" + */fqn.replace('.', '/') + ".java");
  27.106 +
  27.107 +                    results.add(found);
  27.108 +                }
  27.109 +            }
  27.110 +
  27.111 +            Collections.sort(results, new Comparator<Map<String, Object>>() {
  27.112 +                @Override public int compare(Map<String, Object> o1, Map<String, Object> o2) {
  27.113 +                    return ((String) o1.get("fqn")).compareTo((String) o2.get("fqn"));
  27.114 +                }
  27.115 +            });
  27.116 +            
  27.117 +            configurationData.put("results", results);
  27.118 +
  27.119 +            Map<String, Object> statistics = new HashMap<String, Object>();
  27.120 +
  27.121 +            statistics.put("queryTime", queryTime);
  27.122 +
  27.123 +            configurationData.put("statistics", statistics);
  27.124 +        }
  27.125 +
  27.126 +        return FreemarkerUtilities.processTemplate("org/netbeans/modules/jackpot30/backend/type/ui/ui-findType.html", configurationData);
  27.127 +    }
  27.128 +
  27.129 +    private static List<Map<String, String>> list() throws URISyntaxException {
  27.130 +        List<Map<String, String>> result = new LinkedList<Map<String, String>>();
  27.131 +
  27.132 +        for (String enc : WebUtilities.requestStringArrayResponse(new URI("http://localhost:9998/index/list"))) {
  27.133 +            Map<String, String> rootDesc = new HashMap<String, String>();
  27.134 +            String[] col = enc.split(":", 2);
  27.135 +
  27.136 +            rootDesc.put("segment", col[0]);
  27.137 +            rootDesc.put("displayName", col[1]);
  27.138 +            result.add(rootDesc);
  27.139 +        }
  27.140 +
  27.141 +        return result;
  27.142 +    }
  27.143 +    
  27.144 +}
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/server/backend/type.web.api/src/org/netbeans/modules/jackpot30/backend/type/ui/ui-findType.html	Mon Jun 20 23:27:31 2011 +0200
    28.3 @@ -0,0 +1,28 @@
    28.4 +<html>
    28.5 +<head>
    28.6 +    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
    28.7 +</head>
    28.8 +<body>
    28.9 +<form method="get">
   28.10 +<label for="path">Project:</label>
   28.11 +<select size="1" name="path">");
   28.12 +    <#list paths as path>
   28.13 +        <option <#if selectedPath?? && path.segment == selectedPath>selected</#if> value="${path.segment}">
   28.14 +            ${path.displayName}
   28.15 +        </option>
   28.16 +    </#list>
   28.17 +</select>
   28.18 +<br>
   28.19 +<label for="prefix">Type Name:</label><input type="text" name="prefix"<#if prefix??>value="${prefix}"</#if>/><br>
   28.20 +<input type="submit" name="Find Candidates"/>
   28.21 +</form>
   28.22 +
   28.23 +<#if results??>
   28.24 +    Found types:<br>
   28.25 +    <#list results as result>
   28.26 +        <a href="/index/ui/show?path=${selectedPath}&relative=${result.relativePath}">${result.fqn}</a><br>
   28.27 +    </#list>
   28.28 +</#if>
   28.29 +
   28.30 +</body>
   28.31 +</html>
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/server/backend/web.main/build.xml	Mon Jun 20 23:27:31 2011 +0200
    29.3 @@ -0,0 +1,74 @@
    29.4 +<?xml version="1.0" encoding="UTF-8"?>
    29.5 +<!-- You may freely edit this file. See commented blocks below for -->
    29.6 +<!-- some examples of how to customize the build. -->
    29.7 +<!-- (If you delete it and reopen the project it will be recreated.) -->
    29.8 +<!-- By default, only the Clean and Build commands use this build script. -->
    29.9 +<!-- Commands such as Run, Debug, and Test only use this build script if -->
   29.10 +<!-- the Compile on Save feature is turned off for the project. -->
   29.11 +<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
   29.12 +<!-- in the project's Project Properties dialog box.-->
   29.13 +<project name="web.main" default="default" basedir=".">
   29.14 +    <description>Builds, tests, and runs the project web.main.</description>
   29.15 +    <import file="nbproject/build-impl.xml"/>
   29.16 +    <!--
   29.17 +
   29.18 +    There exist several targets which are by default empty and which can be 
   29.19 +    used for execution of your tasks. These targets are usually executed 
   29.20 +    before and after some main targets. They are: 
   29.21 +
   29.22 +      -pre-init:                 called before initialization of project properties
   29.23 +      -post-init:                called after initialization of project properties
   29.24 +      -pre-compile:              called before javac compilation
   29.25 +      -post-compile:             called after javac compilation
   29.26 +      -pre-compile-single:       called before javac compilation of single file
   29.27 +      -post-compile-single:      called after javac compilation of single file
   29.28 +      -pre-compile-test:         called before javac compilation of JUnit tests
   29.29 +      -post-compile-test:        called after javac compilation of JUnit tests
   29.30 +      -pre-compile-test-single:  called before javac compilation of single JUnit test
   29.31 +      -post-compile-test-single: called after javac compilation of single JUunit test
   29.32 +      -pre-jar:                  called before JAR building
   29.33 +      -post-jar:                 called after JAR building
   29.34 +      -post-clean:               called after cleaning build products
   29.35 +
   29.36 +    (Targets beginning with '-' are not intended to be called on their own.)
   29.37 +
   29.38 +    Example of inserting an obfuscator after compilation could look like this:
   29.39 +
   29.40 +        <target name="-post-compile">
   29.41 +            <obfuscate>
   29.42 +                <fileset dir="${build.classes.dir}"/>
   29.43 +            </obfuscate>
   29.44 +        </target>
   29.45 +
   29.46 +    For list of available properties check the imported 
   29.47 +    nbproject/build-impl.xml file. 
   29.48 +
   29.49 +
   29.50 +    Another way to customize the build is by overriding existing main targets.
   29.51 +    The targets of interest are: 
   29.52 +
   29.53 +      -init-macrodef-javac:     defines macro for javac compilation
   29.54 +      -init-macrodef-junit:     defines macro for junit execution
   29.55 +      -init-macrodef-debug:     defines macro for class debugging
   29.56 +      -init-macrodef-java:      defines macro for class execution
   29.57 +      -do-jar-with-manifest:    JAR building (if you are using a manifest)
   29.58 +      -do-jar-without-manifest: JAR building (if you are not using a manifest)
   29.59 +      run:                      execution of project 
   29.60 +      -javadoc-build:           Javadoc generation
   29.61 +      test-report:              JUnit report generation
   29.62 +
   29.63 +    An example of overriding the target for project execution could look like this:
   29.64 +
   29.65 +        <target name="run" depends="web.main-impl.jar">
   29.66 +            <exec dir="bin" executable="launcher.exe">
   29.67 +                <arg file="${dist.jar}"/>
   29.68 +            </exec>
   29.69 +        </target>
   29.70 +
   29.71 +    Notice that the overridden target depends on the jar target and not only on 
   29.72 +    the compile target as the regular run target does. Again, for a list of available 
   29.73 +    properties which you can use, check the target you are overriding in the
   29.74 +    nbproject/build-impl.xml file. 
   29.75 +
   29.76 +    -->
   29.77 +</project>
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/server/backend/web.main/manifest.mf	Mon Jun 20 23:27:31 2011 +0200
    30.3 @@ -0,0 +1,3 @@
    30.4 +Manifest-Version: 1.0
    30.5 +X-COMMENT: Main-Class will be added automatically by build
    30.6 +
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/server/backend/web.main/nbproject/build-impl.xml	Mon Jun 20 23:27:31 2011 +0200
    31.3 @@ -0,0 +1,1096 @@
    31.4 +<?xml version="1.0" encoding="UTF-8"?>
    31.5 +<!--
    31.6 +*** GENERATED FROM project.xml - DO NOT EDIT  ***
    31.7 +***         EDIT ../build.xml INSTEAD         ***
    31.8 +
    31.9 +For the purpose of easier reading the script
   31.10 +is divided into following sections:
   31.11 +
   31.12 +  - initialization
   31.13 +  - compilation
   31.14 +  - jar
   31.15 +  - execution
   31.16 +  - debugging
   31.17 +  - javadoc
   31.18 +  - junit compilation
   31.19 +  - junit execution
   31.20 +  - junit debugging
   31.21 +  - applet
   31.22 +  - cleanup
   31.23 +
   31.24 +        -->
   31.25 +<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="web.main-impl">
   31.26 +    <fail message="Please build using Ant 1.8.0 or higher.">
   31.27 +        <condition>
   31.28 +            <not>
   31.29 +                <antversion atleast="1.8.0"/>
   31.30 +            </not>
   31.31 +        </condition>
   31.32 +    </fail>
   31.33 +    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
   31.34 +    <!-- 
   31.35 +                ======================
   31.36 +                INITIALIZATION SECTION 
   31.37 +                ======================
   31.38 +            -->
   31.39 +    <target name="-pre-init">
   31.40 +        <!-- Empty placeholder for easier customization. -->
   31.41 +        <!-- You can override this target in the ../build.xml file. -->
   31.42 +    </target>
   31.43 +    <target depends="-pre-init" name="-init-private">
   31.44 +        <property file="nbproject/private/config.properties"/>
   31.45 +        <property file="nbproject/private/configs/${config}.properties"/>
   31.46 +        <property file="nbproject/private/private.properties"/>
   31.47 +    </target>
   31.48 +    <target name="-pre-init-libraries">
   31.49 +        <property location="../../lib/nblibraries.properties" name="libraries.path"/>
   31.50 +        <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
   31.51 +        <pathconvert dirsep="/" property="libraries.dir">
   31.52 +            <path path="${libraries.dir.nativedirsep}"/>
   31.53 +        </pathconvert>
   31.54 +        <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
   31.55 +        <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
   31.56 +    </target>
   31.57 +    <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
   31.58 +        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
   31.59 +            <filterchain>
   31.60 +                <replacestring from="$${base}" to="${libraries.dir}"/>
   31.61 +                <escapeunicode/>
   31.62 +            </filterchain>
   31.63 +        </loadproperties>
   31.64 +    </target>
   31.65 +    <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
   31.66 +        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
   31.67 +            <filterchain>
   31.68 +                <replacestring from="$${base}" to="${libraries.dir}"/>
   31.69 +                <escapeunicode/>
   31.70 +            </filterchain>
   31.71 +        </loadproperties>
   31.72 +    </target>
   31.73 +    <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
   31.74 +        <property file="${user.properties.file}"/>
   31.75 +        <!-- The two properties below are usually overridden -->
   31.76 +        <!-- by the active platform. Just a fallback. -->
   31.77 +        <property name="default.javac.source" value="1.4"/>
   31.78 +        <property name="default.javac.target" value="1.4"/>
   31.79 +    </target>
   31.80 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
   31.81 +        <property file="nbproject/configs/${config}.properties"/>
   31.82 +        <property file="nbproject/project.properties"/>
   31.83 +    </target>
   31.84 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
   31.85 +        <available file="${manifest.file}" property="manifest.available"/>
   31.86 +        <condition property="splashscreen.available">
   31.87 +            <and>
   31.88 +                <not>
   31.89 +                    <equals arg1="${application.splash}" arg2="" trim="true"/>
   31.90 +                </not>
   31.91 +                <available file="${application.splash}"/>
   31.92 +            </and>
   31.93 +        </condition>
   31.94 +        <condition property="main.class.available">
   31.95 +            <and>
   31.96 +                <isset property="main.class"/>
   31.97 +                <not>
   31.98 +                    <equals arg1="${main.class}" arg2="" trim="true"/>
   31.99 +                </not>
  31.100 +            </and>
  31.101 +        </condition>
  31.102 +        <condition property="manifest.available+main.class">
  31.103 +            <and>
  31.104 +                <isset property="manifest.available"/>
  31.105 +                <isset property="main.class.available"/>
  31.106 +            </and>
  31.107 +        </condition>
  31.108 +        <condition property="do.archive">
  31.109 +            <not>
  31.110 +                <istrue value="${jar.archive.disabled}"/>
  31.111 +            </not>
  31.112 +        </condition>
  31.113 +        <condition property="do.mkdist">
  31.114 +            <and>
  31.115 +                <isset property="do.archive"/>
  31.116 +                <isset property="libs.CopyLibs.classpath"/>
  31.117 +                <not>
  31.118 +                    <istrue value="${mkdist.disabled}"/>
  31.119 +                </not>
  31.120 +            </and>
  31.121 +        </condition>
  31.122 +        <condition property="manifest.available+main.class+mkdist.available">
  31.123 +            <and>
  31.124 +                <istrue value="${manifest.available+main.class}"/>
  31.125 +                <isset property="do.mkdist"/>
  31.126 +            </and>
  31.127 +        </condition>
  31.128 +        <condition property="do.archive+manifest.available">
  31.129 +            <and>
  31.130 +                <isset property="manifest.available"/>
  31.131 +                <istrue value="${do.archive}"/>
  31.132 +            </and>
  31.133 +        </condition>
  31.134 +        <condition property="do.archive+main.class.available">
  31.135 +            <and>
  31.136 +                <isset property="main.class.available"/>
  31.137 +                <istrue value="${do.archive}"/>
  31.138 +            </and>
  31.139 +        </condition>
  31.140 +        <condition property="do.archive+splashscreen.available">
  31.141 +            <and>
  31.142 +                <isset property="splashscreen.available"/>
  31.143 +                <istrue value="${do.archive}"/>
  31.144 +            </and>
  31.145 +        </condition>
  31.146 +        <condition property="do.archive+manifest.available+main.class">
  31.147 +            <and>
  31.148 +                <istrue value="${manifest.available+main.class}"/>
  31.149 +                <istrue value="${do.archive}"/>
  31.150 +            </and>
  31.151 +        </condition>
  31.152 +        <condition property="manifest.available-mkdist.available">
  31.153 +            <or>
  31.154 +                <istrue value="${manifest.available}"/>
  31.155 +                <isset property="do.mkdist"/>
  31.156 +            </or>
  31.157 +        </condition>
  31.158 +        <condition property="manifest.available+main.class-mkdist.available">
  31.159 +            <or>
  31.160 +                <istrue value="${manifest.available+main.class}"/>
  31.161 +                <isset property="do.mkdist"/>
  31.162 +            </or>
  31.163 +        </condition>
  31.164 +        <condition property="have.tests">
  31.165 +            <or>
  31.166 +                <available file="${test.src.dir}"/>
  31.167 +            </or>
  31.168 +        </condition>
  31.169 +        <condition property="have.sources">
  31.170 +            <or>
  31.171 +                <available file="${src.dir}"/>
  31.172 +            </or>
  31.173 +        </condition>
  31.174 +        <condition property="netbeans.home+have.tests">
  31.175 +            <and>
  31.176 +                <isset property="netbeans.home"/>
  31.177 +                <isset property="have.tests"/>
  31.178 +            </and>
  31.179 +        </condition>
  31.180 +        <condition property="no.javadoc.preview">
  31.181 +            <and>
  31.182 +                <isset property="javadoc.preview"/>
  31.183 +                <isfalse value="${javadoc.preview}"/>
  31.184 +            </and>
  31.185 +        </condition>
  31.186 +        <property name="run.jvmargs" value=""/>
  31.187 +        <property name="javac.compilerargs" value=""/>
  31.188 +        <property name="work.dir" value="${basedir}"/>
  31.189 +        <condition property="no.deps">
  31.190 +            <and>
  31.191 +                <istrue value="${no.dependencies}"/>
  31.192 +            </and>
  31.193 +        </condition>
  31.194 +        <property name="javac.debug" value="true"/>
  31.195 +        <property name="javadoc.preview" value="true"/>
  31.196 +        <property name="application.args" value=""/>
  31.197 +        <property name="source.encoding" value="${file.encoding}"/>
  31.198 +        <property name="runtime.encoding" value="${source.encoding}"/>
  31.199 +        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
  31.200 +            <and>
  31.201 +                <isset property="javadoc.encoding"/>
  31.202 +                <not>
  31.203 +                    <equals arg1="${javadoc.encoding}" arg2=""/>
  31.204 +                </not>
  31.205 +            </and>
  31.206 +        </condition>
  31.207 +        <property name="javadoc.encoding.used" value="${source.encoding}"/>
  31.208 +        <property name="includes" value="**"/>
  31.209 +        <property name="excludes" value=""/>
  31.210 +        <property name="do.depend" value="false"/>
  31.211 +        <condition property="do.depend.true">
  31.212 +            <istrue value="${do.depend}"/>
  31.213 +        </condition>
  31.214 +        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
  31.215 +        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
  31.216 +            <length length="0" string="${endorsed.classpath}" when="greater"/>
  31.217 +        </condition>
  31.218 +        <condition else="false" property="jdkBug6558476">
  31.219 +            <and>
  31.220 +                <matches pattern="1\.[56]" string="${java.specification.version}"/>
  31.221 +                <not>
  31.222 +                    <os family="unix"/>
  31.223 +                </not>
  31.224 +            </and>
  31.225 +        </condition>
  31.226 +        <property name="javac.fork" value="${jdkBug6558476}"/>
  31.227 +        <property name="jar.index" value="false"/>
  31.228 +        <property name="jar.index.metainf" value="${jar.index}"/>
  31.229 +        <property name="copylibs.rebase" value="true"/>
  31.230 +        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
  31.231 +    </target>
  31.232 +    <target name="-post-init">
  31.233 +        <!-- Empty placeholder for easier customization. -->
  31.234 +        <!-- You can override this target in the ../build.xml file. -->
  31.235 +    </target>
  31.236 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
  31.237 +        <fail unless="src.dir">Must set src.dir</fail>
  31.238 +        <fail unless="test.src.dir">Must set test.src.dir</fail>
  31.239 +        <fail unless="build.dir">Must set build.dir</fail>
  31.240 +        <fail unless="dist.dir">Must set dist.dir</fail>
  31.241 +        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
  31.242 +        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
  31.243 +        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
  31.244 +        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
  31.245 +        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
  31.246 +        <fail unless="dist.jar">Must set dist.jar</fail>
  31.247 +    </target>
  31.248 +    <target name="-init-macrodef-property">
  31.249 +        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
  31.250 +            <attribute name="name"/>
  31.251 +            <attribute name="value"/>
  31.252 +            <sequential>
  31.253 +                <property name="@{name}" value="${@{value}}"/>
  31.254 +            </sequential>
  31.255 +        </macrodef>
  31.256 +    </target>
  31.257 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
  31.258 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
  31.259 +            <attribute default="${src.dir}" name="srcdir"/>
  31.260 +            <attribute default="${build.classes.dir}" name="destdir"/>
  31.261 +            <attribute default="${javac.classpath}" name="classpath"/>
  31.262 +            <attribute default="${javac.processorpath}" name="processorpath"/>
  31.263 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
  31.264 +            <attribute default="${includes}" name="includes"/>
  31.265 +            <attribute default="${excludes}" name="excludes"/>
  31.266 +            <attribute default="${javac.debug}" name="debug"/>
  31.267 +            <attribute default="${empty.dir}" name="sourcepath"/>
  31.268 +            <attribute default="${empty.dir}" name="gensrcdir"/>
  31.269 +            <element name="customize" optional="true"/>
  31.270 +            <sequential>
  31.271 +                <property location="${build.dir}/empty" name="empty.dir"/>
  31.272 +                <mkdir dir="${empty.dir}"/>
  31.273 +                <mkdir dir="@{apgeneratedsrcdir}"/>
  31.274 +                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
  31.275 +                    <src>
  31.276 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
  31.277 +                            <include name="*"/>
  31.278 +                        </dirset>
  31.279 +                    </src>
  31.280 +                    <classpath>
  31.281 +                        <path path="@{classpath}"/>
  31.282 +                    </classpath>
  31.283 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
  31.284 +                    <compilerarg line="${javac.compilerargs}"/>
  31.285 +                    <compilerarg value="-processorpath"/>
  31.286 +                    <compilerarg path="@{processorpath}:${empty.dir}"/>
  31.287 +                    <compilerarg line="${ap.processors.internal}"/>
  31.288 +                    <compilerarg line="${annotation.processing.processor.options}"/>
  31.289 +                    <compilerarg value="-s"/>
  31.290 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
  31.291 +                    <compilerarg line="${ap.proc.none.internal}"/>
  31.292 +                    <customize/>
  31.293 +                </javac>
  31.294 +            </sequential>
  31.295 +        </macrodef>
  31.296 +    </target>
  31.297 +    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
  31.298 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
  31.299 +            <attribute default="${src.dir}" name="srcdir"/>
  31.300 +            <attribute default="${build.classes.dir}" name="destdir"/>
  31.301 +            <attribute default="${javac.classpath}" name="classpath"/>
  31.302 +            <attribute default="${javac.processorpath}" name="processorpath"/>
  31.303 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
  31.304 +            <attribute default="${includes}" name="includes"/>
  31.305 +            <attribute default="${excludes}" name="excludes"/>
  31.306 +            <attribute default="${javac.debug}" name="debug"/>
  31.307 +            <attribute default="${empty.dir}" name="sourcepath"/>
  31.308 +            <attribute default="${empty.dir}" name="gensrcdir"/>
  31.309 +            <element name="customize" optional="true"/>
  31.310 +            <sequential>
  31.311 +                <property location="${build.dir}/empty" name="empty.dir"/>
  31.312 +                <mkdir dir="${empty.dir}"/>
  31.313 +                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
  31.314 +                    <src>
  31.315 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
  31.316 +                            <include name="*"/>
  31.317 +                        </dirset>
  31.318 +                    </src>
  31.319 +                    <classpath>
  31.320 +                        <path path="@{classpath}"/>
  31.321 +                    </classpath>
  31.322 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
  31.323 +                    <compilerarg line="${javac.compilerargs}"/>
  31.324 +                    <customize/>
  31.325 +                </javac>
  31.326 +            </sequential>
  31.327 +        </macrodef>
  31.328 +    </target>
  31.329 +    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
  31.330 +        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
  31.331 +            <attribute default="${src.dir}" name="srcdir"/>
  31.332 +            <attribute default="${build.classes.dir}" name="destdir"/>
  31.333 +            <attribute default="${javac.classpath}" name="classpath"/>
  31.334 +            <sequential>
  31.335 +                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
  31.336 +                    <classpath>
  31.337 +                        <path path="@{classpath}"/>
  31.338 +                    </classpath>
  31.339 +                </depend>
  31.340 +            </sequential>
  31.341 +        </macrodef>
  31.342 +        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
  31.343 +            <attribute default="${build.classes.dir}" name="destdir"/>
  31.344 +            <sequential>
  31.345 +                <fail unless="javac.includes">Must set javac.includes</fail>
  31.346 +                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
  31.347 +                    <path>
  31.348 +                        <filelist dir="@{destdir}" files="${javac.includes}"/>
  31.349 +                    </path>
  31.350 +                    <globmapper from="*.java" to="*.class"/>
  31.351 +                </pathconvert>
  31.352 +                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
  31.353 +                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
  31.354 +                <delete>
  31.355 +                    <files includesfile="${javac.includesfile.binary}"/>
  31.356 +                </delete>
  31.357 +                <delete>
  31.358 +                    <fileset file="${javac.includesfile.binary}"/>
  31.359 +                </delete>
  31.360 +            </sequential>
  31.361 +        </macrodef>
  31.362 +    </target>
  31.363 +    <target name="-init-macrodef-junit">
  31.364 +        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
  31.365 +            <attribute default="${includes}" name="includes"/>
  31.366 +            <attribute default="${excludes}" name="excludes"/>
  31.367 +            <attribute default="**" name="testincludes"/>
  31.368 +            <sequential>
  31.369 +                <property name="junit.forkmode" value="perTest"/>
  31.370 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
  31.371 +                    <batchtest todir="${build.test.results.dir}">
  31.372 +                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  31.373 +                            <filename name="@{testincludes}"/>
  31.374 +                        </fileset>
  31.375 +                    </batchtest>
  31.376 +                    <classpath>
  31.377 +                        <path path="${run.test.classpath}"/>
  31.378 +                    </classpath>
  31.379 +                    <syspropertyset>
  31.380 +                        <propertyref prefix="test-sys-prop."/>
  31.381 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
  31.382 +                    </syspropertyset>
  31.383 +                    <formatter type="brief" usefile="false"/>
  31.384 +                    <formatter type="xml"/>
  31.385 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  31.386 +                    <jvmarg value="-ea"/>
  31.387 +                    <jvmarg line="${run.jvmargs}"/>
  31.388 +                </junit>
  31.389 +            </sequential>
  31.390 +        </macrodef>
  31.391 +    </target>
  31.392 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
  31.393 +    <target name="-profile-pre-init">
  31.394 +        <!-- Empty placeholder for easier customization. -->
  31.395 +        <!-- You can override this target in the ../build.xml file. -->
  31.396 +    </target>
  31.397 +    <target name="-profile-post-init">
  31.398 +        <!-- Empty placeholder for easier customization. -->
  31.399 +        <!-- You can override this target in the ../build.xml file. -->
  31.400 +    </target>
  31.401 +    <target name="-profile-init-macrodef-profile">
  31.402 +        <macrodef name="resolve">
  31.403 +            <attribute name="name"/>
  31.404 +            <attribute name="value"/>
  31.405 +            <sequential>
  31.406 +                <property name="@{name}" value="${env.@{value}}"/>
  31.407 +            </sequential>
  31.408 +        </macrodef>
  31.409 +        <macrodef name="profile">
  31.410 +            <attribute default="${main.class}" name="classname"/>
  31.411 +            <element name="customize" optional="true"/>
  31.412 +            <sequential>
  31.413 +                <property environment="env"/>
  31.414 +                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
  31.415 +                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
  31.416 +                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
  31.417 +                    <jvmarg line="${profiler.info.jvmargs}"/>
  31.418 +                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  31.419 +                    <arg line="${application.args}"/>
  31.420 +                    <classpath>
  31.421 +                        <path path="${run.classpath}"/>
  31.422 +                    </classpath>
  31.423 +                    <syspropertyset>
  31.424 +                        <propertyref prefix="run-sys-prop."/>
  31.425 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
  31.426 +                    </syspropertyset>
  31.427 +                    <customize/>
  31.428 +                </java>
  31.429 +            </sequential>
  31.430 +        </macrodef>
  31.431 +    </target>
  31.432 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
  31.433 +        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
  31.434 +        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
  31.435 +    </target>
  31.436 +    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
  31.437 +        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
  31.438 +            <attribute default="${main.class}" name="name"/>
  31.439 +            <attribute default="${debug.classpath}" name="classpath"/>
  31.440 +            <attribute default="" name="stopclassname"/>
  31.441 +            <sequential>
  31.442 +                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
  31.443 +                    <classpath>
  31.444 +                        <path path="@{classpath}"/>
  31.445 +                    </classpath>
  31.446 +                </nbjpdastart>
  31.447 +            </sequential>
  31.448 +        </macrodef>
  31.449 +        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
  31.450 +            <attribute default="${build.classes.dir}" name="dir"/>
  31.451 +            <sequential>
  31.452 +                <nbjpdareload>
  31.453 +                    <fileset dir="@{dir}" includes="${fix.classes}">
  31.454 +                        <include name="${fix.includes}*.class"/>
  31.455 +                    </fileset>
  31.456 +                </nbjpdareload>
  31.457 +            </sequential>
  31.458 +        </macrodef>
  31.459 +    </target>
  31.460 +    <target name="-init-debug-args">
  31.461 +        <property name="version-output" value="java version &quot;${ant.java.version}"/>
  31.462 +        <condition property="have-jdk-older-than-1.4">
  31.463 +            <or>
  31.464 +                <contains string="${version-output}" substring="java version &quot;1.0"/>
  31.465 +                <contains string="${version-output}" substring="java version &quot;1.1"/>
  31.466 +                <contains string="${version-output}" substring="java version &quot;1.2"/>
  31.467 +                <contains string="${version-output}" substring="java version &quot;1.3"/>
  31.468 +            </or>
  31.469 +        </condition>
  31.470 +        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
  31.471 +            <istrue value="${have-jdk-older-than-1.4}"/>
  31.472 +        </condition>
  31.473 +        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
  31.474 +            <os family="windows"/>
  31.475 +        </condition>
  31.476 +        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
  31.477 +            <isset property="debug.transport"/>
  31.478 +        </condition>
  31.479 +    </target>
  31.480 +    <target depends="-init-debug-args" name="-init-macrodef-debug">
  31.481 +        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
  31.482 +            <attribute default="${main.class}" name="classname"/>
  31.483 +            <attribute default="${debug.classpath}" name="classpath"/>
  31.484 +            <element name="customize" optional="true"/>
  31.485 +            <sequential>
  31.486 +                <java classname="@{classname}" dir="${work.dir}" fork="true">
  31.487 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  31.488 +                    <jvmarg line="${debug-args-line}"/>
  31.489 +                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
  31.490 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
  31.491 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
  31.492 +                    <jvmarg line="${run.jvmargs}"/>
  31.493 +                    <classpath>
  31.494 +                        <path path="@{classpath}"/>
  31.495 +                    </classpath>
  31.496 +                    <syspropertyset>
  31.497 +                        <propertyref prefix="run-sys-prop."/>
  31.498 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
  31.499 +                    </syspropertyset>
  31.500 +                    <customize/>
  31.501 +                </java>
  31.502 +            </sequential>
  31.503 +        </macrodef>
  31.504 +    </target>
  31.505 +    <target name="-init-macrodef-java">
  31.506 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
  31.507 +            <attribute default="${main.class}" name="classname"/>
  31.508 +            <attribute default="${run.classpath}" name="classpath"/>
  31.509 +            <element name="customize" optional="true"/>
  31.510 +            <sequential>
  31.511 +                <java classname="@{classname}" dir="${work.dir}" fork="true">
  31.512 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  31.513 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
  31.514 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
  31.515 +                    <jvmarg line="${run.jvmargs}"/>
  31.516 +                    <classpath>
  31.517 +                        <path path="@{classpath}"/>
  31.518 +                    </classpath>
  31.519 +                    <syspropertyset>
  31.520 +                        <propertyref prefix="run-sys-prop."/>
  31.521 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
  31.522 +                    </syspropertyset>
  31.523 +                    <customize/>
  31.524 +                </java>
  31.525 +            </sequential>
  31.526 +        </macrodef>
  31.527 +    </target>
  31.528 +    <target name="-init-macrodef-copylibs">
  31.529 +        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
  31.530 +            <attribute default="${manifest.file}" name="manifest"/>
  31.531 +            <element name="customize" optional="true"/>
  31.532 +            <sequential>
  31.533 +                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  31.534 +                <pathconvert property="run.classpath.without.build.classes.dir">
  31.535 +                    <path path="${run.classpath}"/>
  31.536 +                    <map from="${build.classes.dir.resolved}" to=""/>
  31.537 +                </pathconvert>
  31.538 +                <pathconvert pathsep=" " property="jar.classpath">
  31.539 +                    <path path="${run.classpath.without.build.classes.dir}"/>
  31.540 +                    <chainedmapper>
  31.541 +                        <flattenmapper/>
  31.542 +                        <globmapper from="*" to="lib/*"/>
  31.543 +                    </chainedmapper>
  31.544 +                </pathconvert>
  31.545 +                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
  31.546 +                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
  31.547 +                    <fileset dir="${build.classes.dir}"/>
  31.548 +                    <manifest>
  31.549 +                        <attribute name="Class-Path" value="${jar.classpath}"/>
  31.550 +                        <customize/>
  31.551 +                    </manifest>
  31.552 +                </copylibs>
  31.553 +            </sequential>
  31.554 +        </macrodef>
  31.555 +    </target>
  31.556 +    <target name="-init-presetdef-jar">
  31.557 +        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
  31.558 +            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
  31.559 +                <j2seproject1:fileset dir="${build.classes.dir}"/>
  31.560 +            </jar>
  31.561 +        </presetdef>
  31.562 +    </target>
  31.563 +    <target name="-init-ap-cmdline-properties">
  31.564 +        <property name="annotation.processing.enabled" value="true"/>
  31.565 +        <property name="annotation.processing.processors.list" value=""/>
  31.566 +        <property name="annotation.processing.processor.options" value=""/>
  31.567 +        <property name="annotation.processing.run.all.processors" value="true"/>
  31.568 +        <property name="javac.processorpath" value="${javac.classpath}"/>
  31.569 +        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
  31.570 +        <condition property="ap.supported.internal" value="true">
  31.571 +            <not>
  31.572 +                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
  31.573 +            </not>
  31.574 +        </condition>
  31.575 +    </target>
  31.576 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
  31.577 +        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
  31.578 +            <isfalse value="${annotation.processing.run.all.processors}"/>
  31.579 +        </condition>
  31.580 +        <condition else="" property="ap.proc.none.internal" value="-proc:none">
  31.581 +            <isfalse value="${annotation.processing.enabled}"/>
  31.582 +        </condition>
  31.583 +    </target>
  31.584 +    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
  31.585 +        <property name="ap.cmd.line.internal" value=""/>
  31.586 +    </target>
  31.587 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
  31.588 +    <!--
  31.589 +                ===================
  31.590 +                COMPILATION SECTION
  31.591 +                ===================
  31.592 +            -->
  31.593 +    <target name="-deps-jar-init" unless="built-jar.properties">
  31.594 +        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
  31.595 +        <delete file="${built-jar.properties}" quiet="true"/>
  31.596 +    </target>
  31.597 +    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
  31.598 +        <echo level="warn" message="Cycle detected: web.main was already built"/>
  31.599 +    </target>
  31.600 +    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
  31.601 +        <mkdir dir="${build.dir}"/>
  31.602 +        <touch file="${built-jar.properties}" verbose="false"/>
  31.603 +        <property file="${built-jar.properties}" prefix="already.built.jar."/>
  31.604 +        <antcall target="-warn-already-built-jar"/>
  31.605 +        <propertyfile file="${built-jar.properties}">
  31.606 +            <entry key="${basedir}" value=""/>
  31.607 +        </propertyfile>
  31.608 +        <antcall target="-maybe-call-dep">
  31.609 +            <param name="call.built.properties" value="${built-jar.properties}"/>
  31.610 +            <param location="${project.base_web_api}" name="call.subproject"/>
  31.611 +            <param location="${project.base_web_api}/build.xml" name="call.script"/>
  31.612 +            <param name="call.target" value="jar"/>
  31.613 +            <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
  31.614 +        </antcall>
  31.615 +        <antcall target="-maybe-call-dep">
  31.616 +            <param name="call.built.properties" value="${built-jar.properties}"/>
  31.617 +            <param location="${project.type_web_api}" name="call.subproject"/>
  31.618 +            <param location="${project.type_web_api}/build.xml" name="call.script"/>
  31.619 +            <param name="call.target" value="jar"/>
  31.620 +            <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
  31.621 +        </antcall>
  31.622 +    </target>
  31.623 +    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
  31.624 +    <target depends="init" name="-check-automatic-build">
  31.625 +        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
  31.626 +    </target>
  31.627 +    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
  31.628 +        <antcall target="clean"/>
  31.629 +    </target>
  31.630 +    <target depends="init,deps-jar" name="-pre-pre-compile">
  31.631 +        <mkdir dir="${build.classes.dir}"/>
  31.632 +    </target>
  31.633 +    <target name="-pre-compile">
  31.634 +        <!-- Empty placeholder for easier customization. -->
  31.635 +        <!-- You can override this target in the ../build.xml file. -->
  31.636 +    </target>
  31.637 +    <target if="do.depend.true" name="-compile-depend">
  31.638 +        <pathconvert property="build.generated.subdirs">
  31.639 +            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  31.640 +                <include name="*"/>
  31.641 +            </dirset>
  31.642 +        </pathconvert>
  31.643 +        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
  31.644 +    </target>
  31.645 +    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
  31.646 +        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
  31.647 +        <copy todir="${build.classes.dir}">
  31.648 +            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  31.649 +        </copy>
  31.650 +    </target>
  31.651 +    <target if="has.persistence.xml" name="-copy-persistence-xml">
  31.652 +        <mkdir dir="${build.classes.dir}/META-INF"/>
  31.653 +        <copy todir="${build.classes.dir}/META-INF">
  31.654 +            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
  31.655 +        </copy>
  31.656 +    </target>
  31.657 +    <target name="-post-compile">
  31.658 +        <!-- Empty placeholder for easier customization. -->
  31.659 +        <!-- You can override this target in the ../build.xml file. -->
  31.660 +    </target>
  31.661 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
  31.662 +    <target name="-pre-compile-single">
  31.663 +        <!-- Empty placeholder for easier customization. -->
  31.664 +        <!-- You can override this target in the ../build.xml file. -->
  31.665 +    </target>
  31.666 +    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
  31.667 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  31.668 +        <j2seproject3:force-recompile/>
  31.669 +        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
  31.670 +    </target>
  31.671 +    <target name="-post-compile-single">
  31.672 +        <!-- Empty placeholder for easier customization. -->
  31.673 +        <!-- You can override this target in the ../build.xml file. -->
  31.674 +    </target>
  31.675 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
  31.676 +    <!--
  31.677 +                ====================
  31.678 +                JAR BUILDING SECTION
  31.679 +                ====================
  31.680 +            -->
  31.681 +    <target depends="init" name="-pre-pre-jar">
  31.682 +        <dirname file="${dist.jar}" property="dist.jar.dir"/>
  31.683 +        <mkdir dir="${dist.jar.dir}"/>
  31.684 +    </target>
  31.685 +    <target name="-pre-jar">
  31.686 +        <!-- Empty placeholder for easier customization. -->
  31.687 +        <!-- You can override this target in the ../build.xml file. -->
  31.688 +    </target>
  31.689 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
  31.690 +        <j2seproject1:jar/>
  31.691 +    </target>
  31.692 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
  31.693 +        <j2seproject1:jar manifest="${manifest.file}"/>
  31.694 +    </target>
  31.695 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
  31.696 +        <j2seproject1:jar manifest="${manifest.file}">
  31.697 +            <j2seproject1:manifest>
  31.698 +                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
  31.699 +            </j2seproject1:manifest>
  31.700 +        </j2seproject1:jar>
  31.701 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
  31.702 +        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  31.703 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
  31.704 +        <pathconvert property="run.classpath.with.dist.jar">
  31.705 +            <path path="${run.classpath}"/>
  31.706 +            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
  31.707 +        </pathconvert>
  31.708 +        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
  31.709 +    </target>
  31.710 +    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
  31.711 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  31.712 +        <touch file="${tmp.manifest.file}" verbose="false"/>
  31.713 +    </target>
  31.714 +    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
  31.715 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  31.716 +        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
  31.717 +    </target>
  31.718 +    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
  31.719 +        <manifest file="${tmp.manifest.file}" mode="update">
  31.720 +            <attribute name="Main-Class" value="${main.class}"/>
  31.721 +        </manifest>
  31.722 +    </target>
  31.723 +    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
  31.724 +        <basename file="${application.splash}" property="splashscreen.basename"/>
  31.725 +        <mkdir dir="${build.classes.dir}/META-INF"/>
  31.726 +        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
  31.727 +        <manifest file="${tmp.manifest.file}" mode="update">
  31.728 +            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
  31.729 +        </manifest>
  31.730 +    </target>
  31.731 +    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
  31.732 +        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
  31.733 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
  31.734 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
  31.735 +        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
  31.736 +    </target>
  31.737 +    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
  31.738 +        <delete>
  31.739 +            <fileset file="${tmp.manifest.file}"/>
  31.740 +        </delete>
  31.741 +    </target>
  31.742 +    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
  31.743 +    <target name="-post-jar">
  31.744 +        <!-- Empty placeholder for easier customization. -->
  31.745 +        <!-- You can override this target in the ../build.xml file. -->
  31.746 +    </target>
  31.747 +    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
  31.748 +    <!--
  31.749 +                =================
  31.750 +                EXECUTION SECTION
  31.751 +                =================
  31.752 +            -->
  31.753 +    <target depends="init,compile" description="Run a main class." name="run">
  31.754 +        <j2seproject1:java>
  31.755 +            <customize>
  31.756 +                <arg line="${application.args}"/>
  31.757 +            </customize>
  31.758 +        </j2seproject1:java>
  31.759 +    </target>
  31.760 +    <target name="-do-not-recompile">
  31.761 +        <property name="javac.includes.binary" value=""/>
  31.762 +    </target>
  31.763 +    <target depends="init,compile-single" name="run-single">
  31.764 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  31.765 +        <j2seproject1:java classname="${run.class}"/>
  31.766 +    </target>
  31.767 +    <target depends="init,compile-test-single" name="run-test-with-main">
  31.768 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  31.769 +        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
  31.770 +    </target>
  31.771 +    <!--
  31.772 +                =================
  31.773 +                DEBUGGING SECTION
  31.774 +                =================
  31.775 +            -->
  31.776 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
  31.777 +        <j2seproject1:nbjpdastart name="${debug.class}"/>
  31.778 +    </target>
  31.779 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
  31.780 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
  31.781 +    </target>
  31.782 +    <target depends="init,compile" name="-debug-start-debuggee">
  31.783 +        <j2seproject3:debug>
  31.784 +            <customize>
  31.785 +                <arg line="${application.args}"/>
  31.786 +            </customize>
  31.787 +        </j2seproject3:debug>
  31.788 +    </target>
  31.789 +    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
  31.790 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
  31.791 +        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
  31.792 +    </target>
  31.793 +    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
  31.794 +    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
  31.795 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  31.796 +        <j2seproject3:debug classname="${debug.class}"/>
  31.797 +    </target>
  31.798 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
  31.799 +    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
  31.800 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  31.801 +        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
  31.802 +    </target>
  31.803 +    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
  31.804 +    <target depends="init" name="-pre-debug-fix">
  31.805 +        <fail unless="fix.includes">Must set fix.includes</fail>
  31.806 +        <property name="javac.includes" value="${fix.includes}.java"/>
  31.807 +    </target>
  31.808 +    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
  31.809 +        <j2seproject1:nbjpdareload/>
  31.810 +    </target>
  31.811 +    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
  31.812 +    <!--
  31.813 +                =================
  31.814 +                PROFILING SECTION
  31.815 +                =================
  31.816 +            -->
  31.817 +    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
  31.818 +        <nbprofiledirect>
  31.819 +            <classpath>
  31.820 +                <path path="${run.classpath}"/>
  31.821 +            </classpath>
  31.822 +        </nbprofiledirect>
  31.823 +        <profile/>
  31.824 +    </target>
  31.825 +    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
  31.826 +        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
  31.827 +        <nbprofiledirect>
  31.828 +            <classpath>
  31.829 +                <path path="${run.classpath}"/>
  31.830 +            </classpath>
  31.831 +        </nbprofiledirect>
  31.832 +        <profile classname="${profile.class}"/>
  31.833 +    </target>
  31.834 +    <!--
  31.835 +                =========================
  31.836 +                APPLET PROFILING  SECTION
  31.837 +                =========================
  31.838 +            -->
  31.839 +    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
  31.840 +        <nbprofiledirect>
  31.841 +            <classpath>
  31.842 +                <path path="${run.classpath}"/>
  31.843 +            </classpath>
  31.844 +        </nbprofiledirect>
  31.845 +        <profile classname="sun.applet.AppletViewer">
  31.846 +            <customize>
  31.847 +                <arg value="${applet.url}"/>
  31.848 +            </customize>
  31.849 +        </profile>
  31.850 +    </target>
  31.851 +    <!--
  31.852 +                =========================
  31.853 +                TESTS PROFILING  SECTION
  31.854 +                =========================
  31.855 +            -->
  31.856 +    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
  31.857 +        <nbprofiledirect>
  31.858 +            <classpath>
  31.859 +                <path path="${run.test.classpath}"/>
  31.860 +            </classpath>
  31.861 +        </nbprofiledirect>
  31.862 +        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
  31.863 +            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  31.864 +            <jvmarg value="${profiler.info.jvmargs.agent}"/>
  31.865 +            <jvmarg line="${profiler.info.jvmargs}"/>
  31.866 +            <test name="${profile.class}"/>
  31.867 +            <classpath>
  31.868 +                <path path="${run.test.classpath}"/>
  31.869 +            </classpath>
  31.870 +            <syspropertyset>
  31.871 +                <propertyref prefix="test-sys-prop."/>
  31.872 +                <mapper from="test-sys-prop.*" to="*" type="glob"/>
  31.873 +            </syspropertyset>
  31.874 +            <formatter type="brief" usefile="false"/>
  31.875 +            <formatter type="xml"/>
  31.876 +        </junit>
  31.877 +    </target>
  31.878 +    <!--
  31.879 +                ===============
  31.880 +                JAVADOC SECTION
  31.881 +                ===============
  31.882 +            -->
  31.883 +    <target depends="init" if="have.sources" name="-javadoc-build">
  31.884 +        <mkdir dir="${dist.javadoc.dir}"/>
  31.885 +        <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}">
  31.886 +            <classpath>
  31.887 +                <path path="${javac.classpath}"/>
  31.888 +            </classpath>
  31.889 +            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
  31.890 +                <filename name="**/*.java"/>
  31.891 +            </fileset>
  31.892 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  31.893 +                <include name="**/*.java"/>
  31.894 +                <exclude name="*.java"/>
  31.895 +            </fileset>
  31.896 +        </javadoc>
  31.897 +        <copy todir="${dist.javadoc.dir}">
  31.898 +            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  31.899 +                <filename name="**/doc-files/**"/>
  31.900 +            </fileset>
  31.901 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  31.902 +                <include name="**/doc-files/**"/>
  31.903 +            </fileset>
  31.904 +        </copy>
  31.905 +    </target>
  31.906 +    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
  31.907 +        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
  31.908 +    </target>
  31.909 +    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
  31.910 +    <!--
  31.911 +                =========================
  31.912 +                JUNIT COMPILATION SECTION
  31.913 +                =========================
  31.914 +            -->
  31.915 +    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
  31.916 +        <mkdir dir="${build.test.classes.dir}"/>
  31.917 +    </target>
  31.918 +    <target name="-pre-compile-test">
  31.919 +        <!-- Empty placeholder for easier customization. -->
  31.920 +        <!-- You can override this target in the ../build.xml file. -->
  31.921 +    </target>
  31.922 +    <target if="do.depend.true" name="-compile-test-depend">
  31.923 +        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  31.924 +    </target>
  31.925 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  31.926 +        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
  31.927 +        <copy todir="${build.test.classes.dir}">
  31.928 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  31.929 +        </copy>
  31.930 +    </target>
  31.931 +    <target name="-post-compile-test">
  31.932 +        <!-- Empty placeholder for easier customization. -->
  31.933 +        <!-- You can override this target in the ../build.xml file. -->
  31.934 +    </target>
  31.935 +    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
  31.936 +    <target name="-pre-compile-test-single">
  31.937 +        <!-- Empty placeholder for easier customization. -->
  31.938 +        <!-- You can override this target in the ../build.xml file. -->
  31.939 +    </target>
  31.940 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  31.941 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  31.942 +        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
  31.943 +        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
  31.944 +        <copy todir="${build.test.classes.dir}">
  31.945 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  31.946 +        </copy>
  31.947 +    </target>
  31.948 +    <target name="-post-compile-test-single">
  31.949 +        <!-- Empty placeholder for easier customization. -->
  31.950 +        <!-- You can override this target in the ../build.xml file. -->
  31.951 +    </target>
  31.952 +    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
  31.953 +    <!--
  31.954 +                =======================
  31.955 +                JUNIT EXECUTION SECTION
  31.956 +                =======================
  31.957 +            -->
  31.958 +    <target depends="init" if="have.tests" name="-pre-test-run">
  31.959 +        <mkdir dir="${build.test.results.dir}"/>
  31.960 +    </target>
  31.961 +    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  31.962 +        <j2seproject3:junit testincludes="**/*Test.java"/>
  31.963 +    </target>
  31.964 +    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  31.965 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  31.966 +    </target>
  31.967 +    <target depends="init" if="have.tests" name="test-report"/>
  31.968 +    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
  31.969 +    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
  31.970 +    <target depends="init" if="have.tests" name="-pre-test-run-single">
  31.971 +        <mkdir dir="${build.test.results.dir}"/>
  31.972 +    </target>
  31.973 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  31.974 +        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  31.975 +        <j2seproject3:junit excludes="" includes="${test.includes}"/>
  31.976 +    </target>
  31.977 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
  31.978 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  31.979 +    </target>
  31.980 +    <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"/>
  31.981 +    <!--
  31.982 +                =======================
  31.983 +                JUNIT DEBUGGING SECTION
  31.984 +                =======================
  31.985 +            -->
  31.986 +    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
  31.987 +        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  31.988 +        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
  31.989 +        <delete file="${test.report.file}"/>
  31.990 +        <mkdir dir="${build.test.results.dir}"/>
  31.991 +        <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
  31.992 +            <customize>
  31.993 +                <syspropertyset>
  31.994 +                    <propertyref prefix="test-sys-prop."/>
  31.995 +                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
  31.996 +                </syspropertyset>
  31.997 +                <arg value="${test.class}"/>
  31.998 +                <arg value="showoutput=true"/>
  31.999 +                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
 31.1000 +                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
 31.1001 +            </customize>
 31.1002 +        </j2seproject3:debug>
 31.1003 +    </target>
 31.1004 +    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
 31.1005 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
 31.1006 +    </target>
 31.1007 +    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
 31.1008 +    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
 31.1009 +        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
 31.1010 +    </target>
 31.1011 +    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
 31.1012 +    <!--
 31.1013 +                =========================
 31.1014 +                APPLET EXECUTION SECTION
 31.1015 +                =========================
 31.1016 +            -->
 31.1017 +    <target depends="init,compile-single" name="run-applet">
 31.1018 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
 31.1019 +        <j2seproject1:java classname="sun.applet.AppletViewer">
 31.1020 +            <customize>
 31.1021 +                <arg value="${applet.url}"/>
 31.1022 +            </customize>
 31.1023 +        </j2seproject1:java>
 31.1024 +    </target>
 31.1025 +    <!--
 31.1026 +                =========================
 31.1027 +                APPLET DEBUGGING  SECTION
 31.1028 +                =========================
 31.1029 +            -->
 31.1030 +    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
 31.1031 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
 31.1032 +        <j2seproject3:debug classname="sun.applet.AppletViewer">
 31.1033 +            <customize>
 31.1034 +                <arg value="${applet.url}"/>
 31.1035 +            </customize>
 31.1036 +        </j2seproject3:debug>
 31.1037 +    </target>
 31.1038 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
 31.1039 +    <!--
 31.1040 +                ===============
 31.1041 +                CLEANUP SECTION
 31.1042 +                ===============
 31.1043 +            -->
 31.1044 +    <target name="-deps-clean-init" unless="built-clean.properties">
 31.1045 +        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
 31.1046 +        <delete file="${built-clean.properties}" quiet="true"/>
 31.1047 +    </target>
 31.1048 +    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
 31.1049 +        <echo level="warn" message="Cycle detected: web.main was already built"/>
 31.1050 +    </target>
 31.1051 +    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
 31.1052 +        <mkdir dir="${build.dir}"/>
 31.1053 +        <touch file="${built-clean.properties}" verbose="false"/>
 31.1054 +        <property file="${built-clean.properties}" prefix="already.built.clean."/>
 31.1055 +        <antcall target="-warn-already-built-clean"/>
 31.1056 +        <propertyfile file="${built-clean.properties}">
 31.1057 +            <entry key="${basedir}" value=""/>
 31.1058 +        </propertyfile>
 31.1059 +        <antcall target="-maybe-call-dep">
 31.1060 +            <param name="call.built.properties" value="${built-clean.properties}"/>
 31.1061 +            <param location="${project.base_web_api}" name="call.subproject"/>
 31.1062 +            <param location="${project.base_web_api}/build.xml" name="call.script"/>
 31.1063 +            <param name="call.target" value="clean"/>
 31.1064 +            <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
 31.1065 +        </antcall>
 31.1066 +        <antcall target="-maybe-call-dep">
 31.1067 +            <param name="call.built.properties" value="${built-clean.properties}"/>
 31.1068 +            <param location="${project.type_web_api}" name="call.subproject"/>
 31.1069 +            <param location="${project.type_web_api}/build.xml" name="call.script"/>
 31.1070 +            <param name="call.target" value="clean"/>
 31.1071 +            <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
 31.1072 +        </antcall>
 31.1073 +    </target>
 31.1074 +    <target depends="init" name="-do-clean">
 31.1075 +        <delete dir="${build.dir}"/>
 31.1076 +        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
 31.1077 +    </target>
 31.1078 +    <target name="-post-clean">
 31.1079 +        <!-- Empty placeholder for easier customization. -->
 31.1080 +        <!-- You can override this target in the ../build.xml file. -->
 31.1081 +    </target>
 31.1082 +    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
 31.1083 +    <target name="-check-call-dep">
 31.1084 +        <property file="${call.built.properties}" prefix="already.built."/>
 31.1085 +        <condition property="should.call.dep">
 31.1086 +            <not>
 31.1087 +                <isset property="already.built.${call.subproject}"/>
 31.1088 +            </not>
 31.1089 +        </condition>
 31.1090 +    </target>
 31.1091 +    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
 31.1092 +        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
 31.1093 +            <propertyset>
 31.1094 +                <propertyref prefix="transfer."/>
 31.1095 +                <mapper from="transfer.*" to="*" type="glob"/>
 31.1096 +            </propertyset>
 31.1097 +        </ant>
 31.1098 +    </target>
 31.1099 +</project>
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/server/backend/web.main/nbproject/genfiles.properties	Mon Jun 20 23:27:31 2011 +0200
    32.3 @@ -0,0 +1,8 @@
    32.4 +build.xml.data.CRC32=3059ce8d
    32.5 +build.xml.script.CRC32=5ddf268c
    32.6 +build.xml.stylesheet.CRC32=28e38971@1.45.0.45
    32.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
    32.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    32.9 +nbproject/build-impl.xml.data.CRC32=3059ce8d
   32.10 +nbproject/build-impl.xml.script.CRC32=81ed8c6f
   32.11 +nbproject/build-impl.xml.stylesheet.CRC32=cfcde7f8@1.45.0.45
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/server/backend/web.main/nbproject/project.properties	Mon Jun 20 23:27:31 2011 +0200
    33.3 @@ -0,0 +1,123 @@
    33.4 +annotation.processing.enabled=true
    33.5 +annotation.processing.enabled.in.editor=false
    33.6 +annotation.processing.run.all.processors=true
    33.7 +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
    33.8 +application.title=web.main
    33.9 +application.vendor=lahvac
   33.10 +build.classes.dir=${build.dir}/classes
   33.11 +build.classes.excludes=**/*.java,**/*.form
   33.12 +# This directory is removed when the project is cleaned:
   33.13 +build.dir=build
   33.14 +build.generated.dir=${build.dir}/generated
   33.15 +build.generated.sources.dir=${build.dir}/generated-sources
   33.16 +# Only compile against the classpath explicitly listed here:
   33.17 +build.sysclasspath=ignore
   33.18 +build.test.classes.dir=${build.dir}/test/classes
   33.19 +build.test.results.dir=${build.dir}/test/results
   33.20 +# Uncomment to specify the preferred debugger connection transport:
   33.21 +#debug.transport=dt_socket
   33.22 +debug.classpath=\
   33.23 +    ${run.classpath}
   33.24 +debug.test.classpath=\
   33.25 +    ${run.test.classpath}
   33.26 +# This directory is removed when the project is cleaned:
   33.27 +dist.dir=dist
   33.28 +dist.jar=${dist.dir}/web.main.jar
   33.29 +dist.javadoc.dir=${dist.dir}/javadoc
   33.30 +endorsed.classpath=
   33.31 +excludes=
   33.32 +file.reference.org-netbeans-api-java-classpath.jar=../../lib/org-netbeans-api-java-classpath.jar
   33.33 +file.reference.org-netbeans-modules-java-hints.jar=../../lib/org-netbeans-modules-java-hints.jar
   33.34 +file.reference.org-netbeans-modules-java-project.jar=../../lib/org-netbeans-modules-java-project.jar
   33.35 +file.reference.org-netbeans-modules-java-source.jar=../../lib/org-netbeans-modules-java-source.jar
   33.36 +file.reference.org-netbeans-modules-jumpto.jar=../../lib/org-netbeans-modules-jumpto.jar
   33.37 +file.reference.org-netbeans-modules-masterfs.jar=../../lib/org-netbeans-modules-masterfs.jar
   33.38 +file.reference.org-netbeans-modules-parsing-api.jar=../../lib/org-netbeans-modules-parsing-api.jar
   33.39 +file.reference.org-netbeans-modules-parsing-lucene.jar=../../lib/org-netbeans-modules-parsing-lucene.jar
   33.40 +file.reference.org-netbeans-modules-projectapi.jar=../../lib/org-netbeans-modules-projectapi.jar
   33.41 +file.reference.org-netbeans-modules-sendopts.jar=../../lib/org-netbeans-modules-sendopts.jar
   33.42 +file.reference.org-netbeans-spi-editor-hints.jar=../../lib/org-netbeans-spi-editor-hints.jar
   33.43 +file.reference.org-openide-filesystems.jar=../../lib/org-openide-filesystems.jar
   33.44 +file.reference.org-openide-util-lookup.jar=../../lib/org-openide-util-lookup.jar
   33.45 +file.reference.org-openide-util.jar=../../lib/org-openide-util.jar
   33.46 +file.reference.util-commons.jar=../../../libs.jerig/external/util-commons.jar
   33.47 +file.reference.util-lutz.jar=../../../libs.jerig/external/util-lutz.jar
   33.48 +file.reference.util-pojson.jar=../../../libs.jerig/external/util-pojson.jar
   33.49 +file.reference.util-strast.jar=../../../libs.jerig/external/util-strast.jar
   33.50 +includes=**
   33.51 +jar.compress=false
   33.52 +javac.classpath=\
   33.53 +    ${reference.type_web_api.jar}:\
   33.54 +    ${reference.base_web_api.jar}:\
   33.55 +    ${libs.jersey.classpath}:\
   33.56 +    ${libs.javac.classpath}:\
   33.57 +    ${libs.freemarker.classpath}:\
   33.58 +    ${libs.lucene.classpath}:\
   33.59 +    ${file.reference.org-netbeans-modules-versioning-system-cvss.jar}:\
   33.60 +    ${file.reference.org-netbeans-modules-versioning-util.jar}:\
   33.61 +    ${file.reference.org-netbeans-modules-versioning-indexingbridge.jar}:\
   33.62 +    ${file.reference.org-netbeans-modules-versioning.jar}:\
   33.63 +    ${file.reference.org-netbeans-modules-parsing-api.jar}:\
   33.64 +    ${file.reference.org-netbeans-modules-masterfs.jar}:\
   33.65 +    ${file.reference.org-netbeans-modules-java-source.jar}:\
   33.66 +    ${file.reference.org-openide-util.jar}:\
   33.67 +    ${file.reference.org-openide-util-lookup.jar}:\
   33.68 +    ${file.reference.org-netbeans-spi-editor-hints.jar}:\
   33.69 +    ${file.reference.org-netbeans-api-java-classpath.jar}:\
   33.70 +    ${file.reference.org-netbeans-modules-java-hints.jar}:\
   33.71 +    ${file.reference.org-netbeans-modules-jumpto.jar}:\
   33.72 +    ${file.reference.org-netbeans-modules-projectapi.jar}:\
   33.73 +    ${file.reference.org-netbeans-modules-parsing-lucene.jar}:\
   33.74 +    ${file.reference.org-openide-filesystems.jar}:\
   33.75 +    ${file.reference.org-netbeans-modules-java-project.jar}:\
   33.76 +    ${file.reference.org-netbeans-modules-sendopts.jar}:\
   33.77 +    ${file.reference.util-commons.jar}:\
   33.78 +    ${file.reference.util-lutz.jar}:\
   33.79 +    ${file.reference.util-pojson.jar}:\
   33.80 +    ${file.reference.util-strast.jar}
   33.81 +# Space-separated list of extra javac options
   33.82 +javac.compilerargs=
   33.83 +javac.deprecation=false
   33.84 +javac.processorpath=\
   33.85 +    ${javac.classpath}
   33.86 +javac.source=1.6
   33.87 +javac.target=1.6
   33.88 +javac.test.classpath=\
   33.89 +    ${javac.classpath}:\
   33.90 +    ${build.classes.dir}:\
   33.91 +    ${libs.junit.classpath}
   33.92 +javac.test.processorpath=\
   33.93 +    ${javac.test.classpath}
   33.94 +javadoc.additionalparam=
   33.95 +javadoc.author=false
   33.96 +javadoc.encoding=${source.encoding}
   33.97 +javadoc.noindex=false
   33.98 +javadoc.nonavbar=false
   33.99 +javadoc.notree=false
  33.100 +javadoc.private=false
  33.101 +javadoc.splitindex=true
  33.102 +javadoc.use=true
  33.103 +javadoc.version=false
  33.104 +javadoc.windowtitle=
  33.105 +main.class=web.main.WebMain
  33.106 +manifest.file=manifest.mf
  33.107 +meta.inf.dir=${src.dir}/META-INF
  33.108 +mkdist.disabled=false
  33.109 +platform.active=default_platform
  33.110 +project.base_web_api=../base.web.api
  33.111 +project.type_web_api=../type.web.api
  33.112 +reference.base_web_api.jar=${project.base_web_api}/dist/base.web.api.jar
  33.113 +reference.type_web_api.jar=${project.type_web_api}/dist/type.web.api.jar
  33.114 +run.classpath=\
  33.115 +    ${javac.classpath}:\
  33.116 +    ${build.classes.dir}
  33.117 +# Space-separated list of JVM arguments used when running the project
  33.118 +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
  33.119 +# or test-sys-prop.name=value to set system properties for unit tests):
  33.120 +run.jvmargs=
  33.121 +run.test.classpath=\
  33.122 +    ${javac.test.classpath}:\
  33.123 +    ${build.test.classes.dir}
  33.124 +source.encoding=UTF-8
  33.125 +src.dir=src
  33.126 +test.src.dir=test
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/server/backend/web.main/nbproject/project.xml	Mon Jun 20 23:27:31 2011 +0200
    34.3 @@ -0,0 +1,36 @@
    34.4 +<?xml version="1.0" encoding="UTF-8"?>
    34.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
    34.6 +    <type>org.netbeans.modules.java.j2seproject</type>
    34.7 +    <configuration>
    34.8 +        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
    34.9 +            <name>web.main</name>
   34.10 +            <source-roots>
   34.11 +                <root id="src.dir"/>
   34.12 +            </source-roots>
   34.13 +            <test-roots>
   34.14 +                <root id="test.src.dir"/>
   34.15 +            </test-roots>
   34.16 +        </data>
   34.17 +        <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
   34.18 +            <definitions>../../lib/nblibraries.properties</definitions>
   34.19 +        </libraries>
   34.20 +        <references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
   34.21 +            <reference>
   34.22 +                <foreign-project>base_web_api</foreign-project>
   34.23 +                <artifact-type>jar</artifact-type>
   34.24 +                <script>build.xml</script>
   34.25 +                <target>jar</target>
   34.26 +                <clean-target>clean</clean-target>
   34.27 +                <id>jar</id>
   34.28 +            </reference>
   34.29 +            <reference>
   34.30 +                <foreign-project>type_web_api</foreign-project>
   34.31 +                <artifact-type>jar</artifact-type>
   34.32 +                <script>build.xml</script>
   34.33 +                <target>jar</target>
   34.34 +                <clean-target>clean</clean-target>
   34.35 +                <id>jar</id>
   34.36 +            </reference>
   34.37 +        </references>
   34.38 +    </configuration>
   34.39 +</project>
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/server/backend/web.main/src/web/main/MainPage.java	Mon Jun 20 23:27:31 2011 +0200
    35.3 @@ -0,0 +1,60 @@
    35.4 +/*
    35.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    35.6 + *
    35.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
    35.8 + *
    35.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   35.10 + * Other names may be trademarks of their respective owners.
   35.11 + *
   35.12 + * The contents of this file are subject to the terms of either the GNU
   35.13 + * General Public License Version 2 only ("GPL") or the Common
   35.14 + * Development and Distribution License("CDDL") (collectively, the
   35.15 + * "License"). You may not use this file except in compliance with the
   35.16 + * License. You can obtain a copy of the License at
   35.17 + * http://www.netbeans.org/cddl-gplv2.html
   35.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   35.19 + * specific language governing permissions and limitations under the
   35.20 + * License.  When distributing the software, include this License Header
   35.21 + * Notice in each file and include the License file at
   35.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   35.23 + * particular file as subject to the "Classpath" exception as provided
   35.24 + * by Oracle in the GPL Version 2 section of the License file that
   35.25 + * accompanied this code. If applicable, add the following below the
   35.26 + * License Header, with the fields enclosed by brackets [] replaced by
   35.27 + * your own identifying information:
   35.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   35.29 + *
   35.30 + * If you wish your version of this file to be governed by only the CDDL
   35.31 + * or only the GPL Version 2, indicate your decision by adding
   35.32 + * "[Contributor] elects to include this software in this distribution
   35.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   35.34 + * single choice of license, a recipient has the option to distribute
   35.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   35.36 + * to extend the choice of license to its licensees as provided above.
   35.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   35.38 + * Version 2 license, then the option applies only if the new code is
   35.39 + * made subject to such option by the copyright holder.
   35.40 + *
   35.41 + * Contributor(s):
   35.42 + *
   35.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
   35.44 + */
   35.45 +
   35.46 +package web.main;
   35.47 +
   35.48 +import javax.ws.rs.GET;
   35.49 +import javax.ws.rs.Path;
   35.50 +
   35.51 +/**
   35.52 + *
   35.53 + * @author lahvac
   35.54 + */
   35.55 +@Path("/")
   35.56 +public class MainPage {
   35.57 +
   35.58 +    @GET
   35.59 +    public String main() {
   35.60 +        //XXX: should be constructed automatically from installed plugins
   35.61 +        return "<html><body><ul><li><a href='index/type/ui/search'>Search Type</a></li></ul></body></html>";
   35.62 +    }
   35.63 +}
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/server/backend/web.main/src/web/main/WebMain.java	Mon Jun 20 23:27:31 2011 +0200
    36.3 @@ -0,0 +1,100 @@
    36.4 +/*
    36.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    36.6 + *
    36.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
    36.8 + *
    36.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   36.10 + * Other names may be trademarks of their respective owners.
   36.11 + *
   36.12 + * The contents of this file are subject to the terms of either the GNU
   36.13 + * General Public License Version 2 only ("GPL") or the Common
   36.14 + * Development and Distribution License("CDDL") (collectively, the
   36.15 + * "License"). You may not use this file except in compliance with the
   36.16 + * License. You can obtain a copy of the License at
   36.17 + * http://www.netbeans.org/cddl-gplv2.html
   36.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   36.19 + * specific language governing permissions and limitations under the
   36.20 + * License.  When distributing the software, include this License Header
   36.21 + * Notice in each file and include the License file at
   36.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   36.23 + * particular file as subject to the "Classpath" exception as provided
   36.24 + * by Oracle in the GPL Version 2 section of the License file that
   36.25 + * accompanied this code. If applicable, add the following below the
   36.26 + * License Header, with the fields enclosed by brackets [] replaced by
   36.27 + * your own identifying information:
   36.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   36.29 + *
   36.30 + * If you wish your version of this file to be governed by only the CDDL
   36.31 + * or only the GPL Version 2, indicate your decision by adding
   36.32 + * "[Contributor] elects to include this software in this distribution
   36.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   36.34 + * single choice of license, a recipient has the option to distribute
   36.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   36.36 + * to extend the choice of license to its licensees as provided above.
   36.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   36.38 + * Version 2 license, then the option applies only if the new code is
   36.39 + * made subject to such option by the copyright holder.
   36.40 + *
   36.41 + * Contributor(s):
   36.42 + *
   36.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
   36.44 + */
   36.45 +package web.main;
   36.46 +
   36.47 +import com.sun.grizzly.http.embed.GrizzlyWebServer;
   36.48 +import com.sun.grizzly.http.servlet.ServletAdapter;
   36.49 +import com.sun.grizzly.tcp.http11.GrizzlyAdapter;
   36.50 +import com.sun.grizzly.tcp.http11.GrizzlyRequest;
   36.51 +import com.sun.grizzly.tcp.http11.GrizzlyResponse;
   36.52 +import com.sun.jersey.spi.container.servlet.ServletContainer;
   36.53 +import java.io.File;
   36.54 +import java.io.IOException;
   36.55 +import java.net.URL;
   36.56 +import org.netbeans.modules.jackpot30.backend.base.CategoryStorage;
   36.57 +import org.netbeans.modules.jackpot30.backend.base.RelStreamHandlerFactory;
   36.58 +
   36.59 +/**
   36.60 + *
   36.61 + * @author lahvac
   36.62 + */
   36.63 +public class WebMain {
   36.64 +
   36.65 +    /**
   36.66 +     * @param args the command line arguments
   36.67 +     */
   36.68 +    public static void main(String... args) throws IOException {
   36.69 +        if (args.length != 1 && args.length != 2) {
   36.70 +            System.err.println("Usage: java -jar " + WebMain.class.getProtectionDomain().getCodeSource().getLocation().getPath() + " <cache> [<static-content>]");
   36.71 +            return ;
   36.72 +        }
   36.73 +
   36.74 +        CategoryStorage.setCacheRoot(new File(args[0]));
   36.75 +        
   36.76 +//        org.netbeans.ProxyURLStreamHandlerFactory.register();
   36.77 +        URL.setURLStreamHandlerFactory(new RelStreamHandlerFactory());
   36.78 +        
   36.79 +        GrizzlyWebServer gws;
   36.80 +
   36.81 +        if (args.length == 2) {
   36.82 +            gws = new GrizzlyWebServer(9998, args[1]);
   36.83 +        } else {
   36.84 +            gws = new GrizzlyWebServer(9998);
   36.85 +        }
   36.86 +
   36.87 +        // Jersey web resources
   36.88 +        ServletAdapter jerseyAdapter = new ServletAdapter();
   36.89 +        jerseyAdapter.addInitParameter("com.sun.jersey.config.property.packages", "org.netbeans.modules.jackpot30");
   36.90 +//        jerseyAdapter.setContextPath("/");
   36.91 +        jerseyAdapter.setServletInstance(new ServletContainer());
   36.92 +
   36.93 +        // register all above defined adapters
   36.94 +        gws.addGrizzlyAdapter(jerseyAdapter);
   36.95 +        gws.addGrizzlyAdapter(new GrizzlyAdapter(){
   36.96 +            public void service(GrizzlyRequest request, GrizzlyResponse response){}
   36.97 +        });
   36.98 +
   36.99 +        // let Grizzly run
  36.100 +        gws.start();
  36.101 +    }
  36.102 +
  36.103 +}
    37.1 --- a/server/download.xml	Mon Jun 20 20:20:46 2011 +0200
    37.2 +++ b/server/download.xml	Mon Jun 20 23:27:31 2011 +0200
    37.3 @@ -43,7 +43,7 @@
    37.4          <download url="http://repo1.maven.org/maven2/junit/junit/3.8.2/junit-3.8.2-javadoc.jar" target="junit/junit-3.8.2-javadoc.jar" />
    37.5          <download url="http://repo1.maven.org/maven2/junit/junit/3.8.2/junit-3.8.2-sources.jar" target="junit/junit-3.8.2-sources.jar" />
    37.6  
    37.7 -        <download url="http://bits.netbeans.org/netbeans/6.5/extra_ant_tasks/org-netbeans-modules-java-j2seproject-copylibstask.jar" target="CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar" />
    37.8 +        <download url="http://cdn.bitbucket.org/jlahoda/jackpot30/downloads/org-netbeans-modules-java-j2seproject-copylibstask.jar" target="CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar" />
    37.9          
   37.10          <download url="http://mirrors.ibiblio.org/pub/mirrors/maven2/org/freemarker/freemarker/2.3.16/freemarker-2.3.16.jar" target="freemarker/freemarker-2.3.16.jar" />
   37.11  
    38.1 --- a/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/IndexingBuilder.java	Mon Jun 20 20:20:46 2011 +0200
    38.2 +++ b/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/IndexingBuilder.java	Mon Jun 20 23:27:31 2011 +0200
    38.3 @@ -40,6 +40,7 @@
    38.4  package org.netbeans.modules.jackpot30.hudson;
    38.5  
    38.6  import hudson.Extension;
    38.7 +import hudson.FilePath;
    38.8  import hudson.Launcher;
    38.9  import hudson.Proc;
   38.10  import hudson.model.AbstractBuild;
   38.11 @@ -47,6 +48,7 @@
   38.12  import hudson.model.Descriptor;
   38.13  import hudson.model.Descriptor.FormException;
   38.14  import hudson.model.Hudson;
   38.15 +import hudson.remoting.VirtualChannel;
   38.16  import hudson.scm.ChangeLogSet.AffectedFile;
   38.17  import hudson.scm.ChangeLogSet.Entry;
   38.18  import hudson.scm.EditType;
   38.19 @@ -62,7 +64,10 @@
   38.20  import java.io.OutputStreamWriter;
   38.21  import java.io.Reader;
   38.22  import java.io.Writer;
   38.23 +import java.net.URI;
   38.24 +import java.net.URL;
   38.25  import java.util.Arrays;
   38.26 +import java.util.Collection;
   38.27  import java.util.HashSet;
   38.28  import java.util.List;
   38.29  import java.util.Set;
   38.30 @@ -123,21 +128,21 @@
   38.31  
   38.32          boolean success = doIndex(getDescriptor().getCacheDir(), build, launcher, listener, addedFiles, removedFiles);
   38.33  
   38.34 -        //XXX:
   38.35 -        File info = new File(Cache.findCache("jackpot30", 1002).findCacheRoot(build.getWorkspace().toURI().toURL()), "info");
   38.36 -        String jsonContent = readFully(info);
   38.37 -        JSONObject json = JSONObject.fromObject(jsonContent);
   38.38 -
   38.39 -        String prjName = projectName;
   38.40 -
   38.41 -        if (prjName == null || prjName.isEmpty()) {
   38.42 -            prjName = build.getParent().getDisplayName();
   38.43 -        }
   38.44 -
   38.45 -        if (!prjName.equals(json.get("displayName"))) {
   38.46 -            json.put("displayName", prjName);
   38.47 -            write(info, JSONSerializer.toJSON(json).toString());
   38.48 -        }
   38.49 +//        //XXX:
   38.50 +//        File info = new File(Cache.findCache("jackpot30", 1002).findCacheRoot(build.getWorkspace().toURI().toURL()), "info");
   38.51 +//        String jsonContent = readFully(info);
   38.52 +//        JSONObject json = JSONObject.fromObject(jsonContent);
   38.53 +//
   38.54 +//        String prjName = projectName;
   38.55 +//
   38.56 +//        if (prjName == null || prjName.isEmpty()) {
   38.57 +//            prjName = build.getParent().getDisplayName();
   38.58 +//        }
   38.59 +//
   38.60 +//        if (!prjName.equals(json.get("displayName"))) {
   38.61 +//            json.put("displayName", prjName);
   38.62 +//            write(info, JSONSerializer.toJSON(json).toString());
   38.63 +//        }
   38.64  
   38.65          return success;
   38.66      }
   38.67 @@ -202,22 +207,29 @@
   38.68  
   38.69          t = t.forNode(build.getBuiltOn(), listener);
   38.70  
   38.71 -        listener.getLogger().println("Running: " + toolName);
   38.72 +        RemoteResult res = build.getWorkspace().act(new FilePath.FileCallable<RemoteResult>() {
   38.73 +            public RemoteResult invoke(File file, VirtualChannel vc) throws IOException, InterruptedException {
   38.74 +                Set<String> projects = new HashSet<String>();
   38.75  
   38.76 -        File a = File.createTempFile("jck30", "");
   38.77 -        File r = File.createTempFile("jck30", "");
   38.78 +                findProjects(file, projects, new StringBuilder());
   38.79  
   38.80 -        dumpToFile(a, addedOrModified);
   38.81 -        dumpToFile(r, removed);
   38.82 +                return new RemoteResult(projects, file.getCanonicalPath()/*XXX: will resolve symlinks!!!*/);
   38.83 +            }
   38.84 +        });
   38.85  
   38.86 +        listener.getLogger().println("Running: " + toolName + " on projects: " + res);
   38.87 +
   38.88 +        String codeName = build.getParent().getName();
   38.89          ArgumentListBuilder args = new ArgumentListBuilder();
   38.90 +        FilePath targetZip = build.getWorkspace().createTempFile(codeName, "zip");
   38.91  
   38.92          //XXX: there should be a way to specify Java runtime!
   38.93 -        args.add(new File(t.getHome(), "index")); //XXX
   38.94 -        args.add(".");
   38.95 -        args.add(cacheDir);
   38.96 -        args.add(a.getAbsolutePath());
   38.97 -        args.add(r.getAbsolutePath());
   38.98 +        args.add(new File(t.getHome(), "index.sh")); //XXX
   38.99 +        args.add(codeName);
  38.100 +        args.add(projectName); //XXX
  38.101 +        args.add(targetZip);
  38.102 +        args.add(res.root);
  38.103 +        args.add(res.foundProjects.toArray(new String[0]));
  38.104  
  38.105          Proc indexer = launcher.launch().pwd(build.getWorkspace())
  38.106                                                  .cmds(args)
  38.107 @@ -226,8 +238,20 @@
  38.108  
  38.109          indexer.join();
  38.110  
  38.111 -        a.delete();
  38.112 -        r.delete();
  38.113 +        File oldCacheDir = new File(cacheDir, codeName + ".old");
  38.114 +        File segCacheDir = new File(cacheDir, codeName);
  38.115 +        File newCacheDir = new File(cacheDir, codeName + ".new");
  38.116 +
  38.117 +        targetZip.unzip(new FilePath(newCacheDir));
  38.118 +
  38.119 +        segCacheDir.renameTo(oldCacheDir);
  38.120 +
  38.121 +        new File(newCacheDir, codeName).renameTo(segCacheDir);
  38.122 +
  38.123 +        new URL("http://localhost:9998/index/internal/indexUpdated").openStream().close();
  38.124 +
  38.125 +        new FilePath(newCacheDir).deleteRecursive();
  38.126 +        new FilePath(oldCacheDir).deleteRecursive();
  38.127  
  38.128          return true;
  38.129      }
  38.130 @@ -253,6 +277,34 @@
  38.131          return null;
  38.132      }
  38.133  
  38.134 +    private static void findProjects(File root, Collection<String> result, StringBuilder relPath) {
  38.135 +        int len = relPath.length();
  38.136 +        boolean first = relPath.length() == 0;
  38.137 +
  38.138 +        if (new File(root, "nbproject").isDirectory()) result.add(relPath.toString());
  38.139 +
  38.140 +        File[] children = root.listFiles();
  38.141 +
  38.142 +        if (children != null) {
  38.143 +            for (File c : children) {
  38.144 +                if (!first)
  38.145 +                    relPath.append("/");
  38.146 +                relPath.append(c.getName());
  38.147 +                findProjects(c, result, relPath);
  38.148 +                relPath.delete(len, relPath.length());
  38.149 +            }
  38.150 +        }
  38.151 +    }
  38.152 +
  38.153 +    private static final class RemoteResult {
  38.154 +        private final Collection<String> foundProjects;
  38.155 +        private final String root;
  38.156 +        public RemoteResult(Collection<String> foundProjects, String root) {
  38.157 +            this.foundProjects = foundProjects;
  38.158 +            this.root = root;
  38.159 +        }
  38.160 +    }
  38.161 +    
  38.162      @Extension // this marker indicates Hudson that this is an implementation of an extension point.
  38.163      public static final class DescriptorImpl extends Descriptor<Builder> {
  38.164  
    39.1 --- a/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/StartWebFrontEnd.java	Mon Jun 20 20:20:46 2011 +0200
    39.2 +++ b/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/StartWebFrontEnd.java	Mon Jun 20 23:27:31 2011 +0200
    39.3 @@ -73,7 +73,6 @@
    39.4  
    39.5              if (!cacheDir.exists()) {
    39.6                  cacheDir.mkdirs();
    39.7 -                new FileOutputStream(new File(cacheDir, "segments")).close();
    39.8              }
    39.9              
   39.10              LogTaskListener listener = new LogTaskListener(Logger.global, Level.INFO);
   39.11 @@ -81,7 +80,7 @@
   39.12  
   39.13              ArgumentListBuilder args = new ArgumentListBuilder();
   39.14              Launcher launcher = new Launcher.LocalLauncher(listener);
   39.15 -            args.add(new File(tool.getHome(), "web")); //XXX
   39.16 +            args.add(new File(tool.getHome(), "web.sh")); //XXX
   39.17              args.add(cacheDir);
   39.18  
   39.19              frontend = launcher.launch().cmds(args)
    40.1 --- a/server/temp-build-indexing-backend	Mon Jun 20 20:20:46 2011 +0200
    40.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.3 @@ -1,22 +0,0 @@
    40.4 -#!/bin/bash
    40.5 -(cd indexer; ant clean && ant jar)
    40.6 -(cd web.api; ant clean && ant jar)
    40.7 -mkdir -p ../build/temp-indexing-backend/indexer
    40.8 -mkdir -p ../build/temp-indexing-backend/web.api
    40.9 -cp -r indexer/dist/* ../build/temp-indexing-backend/indexer
   40.10 -cp -r web.api/dist/* ../build/temp-indexing-backend/web.api
   40.11 -
   40.12 -cat >../build/temp-indexing-backend/index <<EOF
   40.13 -DIR=\`dirname \$0\`
   40.14 -java -Xbootclasspath/p:\$DIR/indexer/lib/javac-api-nb-7.0-b07.jar:\$DIR/indexer/lib/javac-impl-nb-7.0-b07.jar -jar \$DIR/indexer/indexer.jar -store-sources "\$@"
   40.15 -EOF
   40.16 -
   40.17 -cat >../build/temp-indexing-backend/web <<EOF
   40.18 -DIR=\`dirname \$0\`
   40.19 -java -Xbootclasspath/p:\$DIR/web.api/lib/javac-api-nb-7.0-b07.jar:\$DIR/web.api/lib/javac-impl-nb-7.0-b07.jar -jar \$DIR/web.api/web.api.jar "\$@"
   40.20 -EOF
   40.21 -
   40.22 -chmod u+x ../build/temp-indexing-backend/index
   40.23 -chmod u+x ../build/temp-indexing-backend/web
   40.24 -
   40.25 -(cd ../build; zip -r temp-indexing-backend.zip temp-indexing-backend)