Reorganizing the code: moving remoting into remoting subfolder
authorJan Lahoda <jlahoda@netbeans.org>
Thu, 23 Jun 2011 15:07:16 +0200
changeset 5974524a9f87990
parent 596 8f4bf9c0a8cf
child 598 2b595c87cfd7
Reorganizing the code: moving remoting into remoting subfolder
.hgignore
api/nbproject/genfiles.properties
api/nbproject/project.xml
api/src/org/netbeans/modules/jackpot30/impl/WebUtilities.java
api/src/org/netbeans/modules/jackpot30/impl/batch/EnhancedScopes.java
api/src/org/netbeans/modules/jackpot30/impl/duplicates/indexing/RemoteDuplicatesIndex.java
api/src/org/netbeans/modules/jackpot30/impl/indexing/Index.java
api/src/org/netbeans/modules/jackpot30/impl/indexing/RemoteIndex.java
api/src/org/netbeans/modules/jackpot30/impl/indexing/options/Bundle.properties
api/src/org/netbeans/modules/jackpot30/impl/indexing/options/CustomizeRemoteIndex.form
api/src/org/netbeans/modules/jackpot30/impl/indexing/options/CustomizeRemoteIndex.java
api/src/org/netbeans/modules/jackpot30/impl/indexing/options/IndexOptionsPanelController.java
api/src/org/netbeans/modules/jackpot30/impl/indexing/options/IndexPanel.form
api/src/org/netbeans/modules/jackpot30/impl/indexing/options/IndexPanel.java
api/src/org/netbeans/modules/jackpot30/impl/refactoring/AddScopePanel.java
api/src/org/netbeans/modules/jackpot30/impl/refactoring/findusages/GlobalFindUsagesRefactoringPlugin.java
api/test/unit/src/org/netbeans/modules/jackpot30/impl/duplicates/indexing/RemoteDuplicatesIndexTest.java
bridges/jumpto/build.xml
bridges/jumpto/manifest.mf
bridges/jumpto/nbproject/build-impl.xml
bridges/jumpto/nbproject/genfiles.properties
bridges/jumpto/nbproject/project.properties
bridges/jumpto/nbproject/project.xml
bridges/jumpto/nbproject/suite.properties
bridges/jumpto/src/org/netbeans/modules/jackpot30/jumpto/Bundle.properties
bridges/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteGoToType.java
cmdline/compiler/nbproject/genfiles.properties
cmdline/compiler/nbproject/project.xml
cmdline/lib/nbproject/project.xml
cmdline/nbproject/platform.properties
hudson/trunk
libs.jerig/build.xml
libs.jerig/jerig-license.txt
libs.jerig/manifest.mf
libs.jerig/nbproject/build-impl.xml
libs.jerig/nbproject/genfiles.properties
libs.jerig/nbproject/project.properties
libs.jerig/nbproject/project.xml
libs.jerig/nbproject/suite.properties
libs.jerig/src/org/netbeans/modules/jeriglib/Bundle.properties
nbproject/platform.properties
nbproject/project.properties
remoting/build-indexing-backend
remoting/ide/api/build.xml
remoting/ide/api/manifest.mf
remoting/ide/api/nbproject/build-impl.xml
remoting/ide/api/nbproject/genfiles.properties
remoting/ide/api/nbproject/project.properties
remoting/ide/api/nbproject/project.xml
remoting/ide/api/nbproject/suite.properties
remoting/ide/api/src/org/netbeans/modules/jackpot30/remoting/api/RemoteIndex.java
remoting/ide/api/src/org/netbeans/modules/jackpot30/remoting/api/WebUtilities.java
remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/Bundle.properties
remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/options/Bundle.properties
remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/options/CustomizeRemoteIndex.form
remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/options/CustomizeRemoteIndex.java
remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/options/IndexOptionsPanelController.java
remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/options/IndexPanel.form
remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/options/IndexPanel.java
remoting/ide/build.xml
remoting/ide/jumpto/build.xml
remoting/ide/jumpto/manifest.mf
remoting/ide/jumpto/nbproject/build-impl.xml
remoting/ide/jumpto/nbproject/genfiles.properties
remoting/ide/jumpto/nbproject/project.properties
remoting/ide/jumpto/nbproject/project.xml
remoting/ide/jumpto/nbproject/suite.properties
remoting/ide/jumpto/src/org/netbeans/modules/jackpot30/jumpto/Bundle.properties
remoting/ide/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteGoToType.java
remoting/ide/nbproject/build-impl.xml
remoting/ide/nbproject/genfiles.properties
remoting/ide/nbproject/platform.properties
remoting/ide/nbproject/project.properties
remoting/ide/nbproject/project.xml
remoting/server/hudson/data/compiler/.must-exist
remoting/server/hudson/pom.xml
remoting/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/Cache.java
remoting/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/ClearIndexProperty.java
remoting/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/IndexingBuilder.java
remoting/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/IndexingTool.java
remoting/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/InstallIndexingTool.java
remoting/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/PluginImpl.java
remoting/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/StartWebFrontEnd.java
remoting/server/hudson/src/main/resources/index.jelly
remoting/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/BuildWrapperImpl/config.jelly
remoting/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/BuildWrapperImpl/help-hardcodedHintsEnabled.html
remoting/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/IndexingBuilder/config.jelly
remoting/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/IndexingBuilder/global.jelly
remoting/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/IndexingBuilder/help-cacheDir.html
remoting/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/IndexingBuilder/help.html
remoting/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/JackpotIndexBuilder/config.jelly
remoting/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/JackpotIndexBuilder/help.html
remoting/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/org.netbeans.modules.jackpot30.hudson.InstallIndexingTool
remoting/server/hudson/src/main/webapp/help-globalConfig.html
remoting/server/hudson/src/test/java/org/netbeans/modules/jackpot30/hudson/IndexingBuilderTest.java
remoting/server/indexer/build.xml
remoting/server/indexer/impl/build.xml
remoting/server/indexer/impl/manifest.mf
remoting/server/indexer/impl/nbproject/build-impl.xml
remoting/server/indexer/impl/nbproject/genfiles.properties
remoting/server/indexer/impl/nbproject/platform.properties
remoting/server/indexer/impl/nbproject/project.properties
remoting/server/indexer/impl/nbproject/project.xml
remoting/server/indexer/impl/nbproject/suite.properties
remoting/server/indexer/impl/src/org/netbeans/modules/jackpot30/backend/impl/Bundle.properties
remoting/server/indexer/impl/src/org/netbeans/modules/jackpot30/backend/impl/CategoryStorage.java
remoting/server/indexer/impl/src/org/netbeans/modules/jackpot30/backend/impl/OptionProcessorImpl.java
remoting/server/indexer/nbproject/build-impl.xml
remoting/server/indexer/nbproject/genfiles.properties
remoting/server/indexer/nbproject/platform.properties
remoting/server/indexer/nbproject/project.properties
remoting/server/indexer/nbproject/project.xml
remoting/server/scripts/index.sh
remoting/server/scripts/web.sh
remoting/server/web/base.web.api/build.xml
remoting/server/web/base.web.api/manifest.mf
remoting/server/web/base.web.api/nbproject/build-impl.xml
remoting/server/web/base.web.api/nbproject/genfiles.properties
remoting/server/web/base.web.api/nbproject/project.properties
remoting/server/web/base.web.api/nbproject/project.xml
remoting/server/web/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/CategoryStorage.java
remoting/server/web/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/FreemarkerUtilities.java
remoting/server/web/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/RelStreamHandlerFactory.java
remoting/server/web/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/WebUtilities.java
remoting/server/web/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/api/API.java
remoting/server/web/type.web.api/build.xml
remoting/server/web/type.web.api/manifest.mf
remoting/server/web/type.web.api/nbproject/build-impl.xml
remoting/server/web/type.web.api/nbproject/genfiles.properties
remoting/server/web/type.web.api/nbproject/project.properties
remoting/server/web/type.web.api/nbproject/project.xml
remoting/server/web/type.web.api/src/org/netbeans/modules/jackpot30/backend/type/api/API.java
remoting/server/web/type.web.api/src/org/netbeans/modules/jackpot30/backend/type/ui/UI.java
remoting/server/web/type.web.api/src/org/netbeans/modules/jackpot30/backend/type/ui/ui-findType.html
remoting/server/web/web.main/build.xml
remoting/server/web/web.main/manifest.mf
remoting/server/web/web.main/nbproject/build-impl.xml
remoting/server/web/web.main/nbproject/genfiles.properties
remoting/server/web/web.main/nbproject/project.properties
remoting/server/web/web.main/nbproject/project.xml
remoting/server/web/web.main/src/web/main/MainPage.java
remoting/server/web/web.main/src/web/main/WebMain.java
sandbox/attributed-index-web/API.java
sandbox/attributed-index-web/Progress.java
sandbox/attributed-index-web/StandaloneFinder.java
sandbox/attributed-index-web/UI.java
sandbox/attributed-index-web/ui-apply.html
sandbox/attributed-index-web/ui-cat.html
sandbox/attributed-index-web/ui-findType.html
sandbox/attributed-index-web/ui-search.html
sandbox/attributed-index-web/ui-snippet.html
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/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties
server/backend/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties
server/backend/build-indexing-backend
server/backend/build.xml
server/backend/impl/build.xml
server/backend/impl/manifest.mf
server/backend/impl/nbproject/build-impl.xml
server/backend/impl/nbproject/genfiles.properties
server/backend/impl/nbproject/project.properties
server/backend/impl/nbproject/project.xml
server/backend/impl/nbproject/suite.properties
server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/Bundle.properties
server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/CategoryStorage.java
server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/OptionProcessorImpl.java
server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/api/API.java
server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/api/Progress.java
server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/api/StandaloneFinder.java
server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/resources/layer.xml
server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/ui/UI.java
server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/ui/ui-apply.html
server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/ui/ui-cat.html
server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/ui/ui-findType.html
server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/ui/ui-search.html
server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/ui/ui-snippet.html
server/backend/nbproject/build-impl.xml
server/backend/nbproject/genfiles.properties
server/backend/nbproject/platform.properties
server/backend/nbproject/project.properties
server/backend/nbproject/project.xml
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/hudson/data/compiler/.must-exist
server/hudson/pom.xml
server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/Cache.java
server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/ClearIndexProperty.java
server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/IndexingBuilder.java
server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/IndexingTool.java
server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/InstallIndexingTool.java
server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/PluginImpl.java
server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/StartWebFrontEnd.java
server/hudson/src/main/resources/index.jelly
server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/BuildWrapperImpl/config.jelly
server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/BuildWrapperImpl/help-hardcodedHintsEnabled.html
server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/IndexingBuilder/config.jelly
server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/IndexingBuilder/global.jelly
server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/IndexingBuilder/help-cacheDir.html
server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/IndexingBuilder/help.html
server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/JackpotIndexBuilder/config.jelly
server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/JackpotIndexBuilder/help.html
server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/org.netbeans.modules.jackpot30.hudson.InstallIndexingTool
server/hudson/src/main/webapp/help-globalConfig.html
server/hudson/src/test/java/org/netbeans/modules/jackpot30/hudson/IndexingBuilderTest.java
server/indexer/nbproject/project.properties
server/web.api/nbproject/project.properties
server/web.api/nbproject/project.xml
server/web.api/src/org/netbeans/modules/jackpot30/server/webapi/UI.java
     1.1 --- a/.hgignore	Wed Jun 22 12:05:27 2011 +0200
     1.2 +++ b/.hgignore	Thu Jun 23 15:07:16 2011 +0200
     1.3 @@ -17,7 +17,7 @@
     1.4  \.ps$
     1.5  \.out$
     1.6  ^server/hudson/work$
     1.7 -^server/hudson/target$
     1.8 +^remoting/server/hudson/target$
     1.9  ^server/hudson/data/compiler/.*.jar$
    1.10  ^server/hudson/data/compiler/indexer/*$
    1.11  ^server/hudson/data/compiler/hints$
     2.1 --- a/api/nbproject/genfiles.properties	Wed Jun 22 12:05:27 2011 +0200
     2.2 +++ b/api/nbproject/genfiles.properties	Thu Jun 23 15:07:16 2011 +0200
     2.3 @@ -3,6 +3,6 @@
     2.4  build.xml.stylesheet.CRC32=79c3b980@1.28.0.7
     2.5  # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
     2.6  # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
     2.7 -nbproject/build-impl.xml.data.CRC32=7a7c1f7c
     2.8 +nbproject/build-impl.xml.data.CRC32=3384ca18
     2.9  nbproject/build-impl.xml.script.CRC32=c4574e66
    2.10  nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.47
     3.1 --- a/api/nbproject/project.xml	Wed Jun 22 12:05:27 2011 +0200
     3.2 +++ b/api/nbproject/project.xml	Thu Jun 23 15:07:16 2011 +0200
     3.3 @@ -123,6 +123,14 @@
     3.4                      </run-dependency>
     3.5                  </dependency>
     3.6                  <dependency>
     3.7 +                    <code-name-base>org.netbeans.modules.jackpot30.remoting.api</code-name-base>
     3.8 +                    <build-prerequisite/>
     3.9 +                    <compile-dependency/>
    3.10 +                    <run-dependency>
    3.11 +                        <specification-version>1.0</specification-version>
    3.12 +                    </run-dependency>
    3.13 +                </dependency>
    3.14 +                <dependency>
    3.15                      <code-name-base>org.netbeans.modules.java.editor</code-name-base>
    3.16                      <build-prerequisite/>
    3.17                      <compile-dependency/>
    3.18 @@ -175,14 +183,6 @@
    3.19                      </run-dependency>
    3.20                  </dependency>
    3.21                  <dependency>
    3.22 -                    <code-name-base>org.netbeans.modules.jeriglib</code-name-base>
    3.23 -                    <build-prerequisite/>
    3.24 -                    <compile-dependency/>
    3.25 -                    <run-dependency>
    3.26 -                        <specification-version>1.0</specification-version>
    3.27 -                    </run-dependency>
    3.28 -                </dependency>
    3.29 -                <dependency>
    3.30                      <code-name-base>org.netbeans.modules.lexer</code-name-base>
    3.31                      <build-prerequisite/>
    3.32                      <compile-dependency/>
     4.1 --- a/api/src/org/netbeans/modules/jackpot30/impl/WebUtilities.java	Wed Jun 22 12:05:27 2011 +0200
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,138 +0,0 @@
     4.4 -/*
     4.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     4.6 - *
     4.7 - * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
     4.8 - *
     4.9 - * The contents of this file are subject to the terms of either the GNU
    4.10 - * General Public License Version 2 only ("GPL") or the Common
    4.11 - * Development and Distribution License("CDDL") (collectively, the
    4.12 - * "License"). You may not use this file except in compliance with the
    4.13 - * License. You can obtain a copy of the License at
    4.14 - * http://www.netbeans.org/cddl-gplv2.html
    4.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    4.16 - * specific language governing permissions and limitations under the
    4.17 - * License.  When distributing the software, include this License Header
    4.18 - * Notice in each file and include the License file at
    4.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
    4.20 - * particular file as subject to the "Classpath" exception as provided
    4.21 - * by Sun in the GPL Version 2 section of the License file that
    4.22 - * accompanied this code. If applicable, add the following below the
    4.23 - * License Header, with the fields enclosed by brackets [] replaced by
    4.24 - * your own identifying information:
    4.25 - * "Portions Copyrighted [year] [name of copyright owner]"
    4.26 - *
    4.27 - * If you wish your version of this file to be governed by only the CDDL
    4.28 - * or only the GPL Version 2, indicate your decision by adding
    4.29 - * "[Contributor] elects to include this software in this distribution
    4.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
    4.31 - * single choice of license, a recipient has the option to distribute
    4.32 - * your version of this file under either the CDDL, the GPL Version 2 or
    4.33 - * to extend the choice of license to its licensees as provided above.
    4.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
    4.35 - * Version 2 license, then the option applies only if the new code is
    4.36 - * made subject to such option by the copyright holder.
    4.37 - *
    4.38 - * Contributor(s):
    4.39 - *
    4.40 - * Portions Copyrighted 2009 Sun Microsystems, Inc.
    4.41 - */
    4.42 -
    4.43 -package org.netbeans.modules.jackpot30.impl;
    4.44 -
    4.45 -import java.io.BufferedReader;
    4.46 -import java.io.IOException;
    4.47 -import java.io.InputStream;
    4.48 -import java.io.InputStreamReader;
    4.49 -import java.net.URI;
    4.50 -import java.net.URISyntaxException;
    4.51 -import java.net.URL;
    4.52 -import java.net.URLConnection;
    4.53 -import java.util.Collection;
    4.54 -import java.util.LinkedList;
    4.55 -import java.util.List;
    4.56 -import java.util.regex.Matcher;
    4.57 -import java.util.regex.Pattern;
    4.58 -import org.netbeans.api.annotations.common.CheckForNull;
    4.59 -
    4.60 -/**
    4.61 - *
    4.62 - */
    4.63 -public class WebUtilities {
    4.64 -
    4.65 -    private WebUtilities() {
    4.66 -    }
    4.67 -
    4.68 -    public static @CheckForNull String requestStringResponse (URI uri) {
    4.69 -        final StringBuffer sb = new StringBuffer ();
    4.70 -        final URL url;
    4.71 -        try {
    4.72 -            url = uri.toURL();
    4.73 -            final URLConnection urlConnection = url.openConnection ();
    4.74 -            urlConnection.connect ();
    4.75 -            final Object content = urlConnection.getContent ();
    4.76 -//            System.out.println (content);
    4.77 -//            System.out.println (content.getClass ());
    4.78 -            final InputStream inputStream = (InputStream) content;
    4.79 -            final BufferedReader reader = new BufferedReader (new InputStreamReader (inputStream, "ASCII"));
    4.80 -            try {
    4.81 -                for (;;) {
    4.82 -                    String line = reader.readLine ();
    4.83 -                    if (line == null)
    4.84 -                        break;
    4.85 -                    sb.append (line).append ('\n');
    4.86 -                }
    4.87 -            } finally {
    4.88 -                reader.close ();
    4.89 -            }
    4.90 -        } catch (IOException e) {
    4.91 -            e.printStackTrace ();  // TODO
    4.92 -            return null;
    4.93 -        }
    4.94 -        return sb.toString ();
    4.95 -    }
    4.96 -    
    4.97 -    public static Collection<? extends String> requestStringArrayResponse (URI uri) {
    4.98 -        final List<String> result = new LinkedList<String> ();
    4.99 -        final URL url;
   4.100 -        try {
   4.101 -            url = uri.toURL();
   4.102 -            final URLConnection urlConnection = url.openConnection ();
   4.103 -            urlConnection.connect ();
   4.104 -            final Object content = urlConnection.getContent ();
   4.105 -//            System.out.println (content);
   4.106 -//            System.out.println (content.getClass ());
   4.107 -            final InputStream inputStream = (InputStream) content;
   4.108 -            final BufferedReader reader = new BufferedReader (new InputStreamReader (inputStream, "ASCII"));
   4.109 -            try {
   4.110 -                for (;;) {
   4.111 -                    String line = reader.readLine ();
   4.112 -                    if (line == null)
   4.113 -                        break;
   4.114 -                    result.add (line);
   4.115 -                }
   4.116 -            } finally {
   4.117 -                reader.close ();
   4.118 -            }
   4.119 -        } catch (IOException e) {
   4.120 -            e.printStackTrace ();  // TODO
   4.121 -        }
   4.122 -        return result;
   4.123 -    }
   4.124 -
   4.125 -    private static String[] c = new String[] {"&", "<", ">", "\n", "\""}; // NOI18N
   4.126 -    private static String[] tags = new String[] {"&amp;", "&lt;", "&gt;", "<br>", "&quot;"}; // NOI18N
   4.127 -
   4.128 -    public static String escapeForHTMLElement(String input) {
   4.129 -        for (int cntr = 0; cntr < c.length; cntr++) {
   4.130 -            input = input.replaceAll(c[cntr], tags[cntr]);
   4.131 -        }
   4.132 -
   4.133 -        return input;
   4.134 -    }
   4.135 -
   4.136 -    public static String escapeForQuery(String pattern) throws URISyntaxException {
   4.137 -        if (pattern == null) return null;
   4.138 -        return new URI(null, null, null, -1, null, pattern, null).getRawQuery().replaceAll(Pattern.quote("&"), Matcher.quoteReplacement("%26"));
   4.139 -    }
   4.140 -
   4.141 -}
     5.1 --- a/api/src/org/netbeans/modules/jackpot30/impl/batch/EnhancedScopes.java	Wed Jun 22 12:05:27 2011 +0200
     5.2 +++ b/api/src/org/netbeans/modules/jackpot30/impl/batch/EnhancedScopes.java	Thu Jun 23 15:07:16 2011 +0200
     5.3 @@ -77,11 +77,11 @@
     5.4  import java.util.logging.Level;
     5.5  import java.util.logging.Logger;
     5.6  import org.codeviation.pojson.Pojson;
     5.7 -import org.netbeans.modules.jackpot30.impl.WebUtilities;
     5.8 +import org.netbeans.modules.jackpot30.remoting.api.WebUtilities;
     5.9  import org.netbeans.modules.jackpot30.impl.indexing.CustomIndexerImpl;
    5.10  import org.netbeans.modules.jackpot30.impl.indexing.FileBasedIndex;
    5.11  import org.netbeans.modules.jackpot30.impl.indexing.Index;
    5.12 -import org.netbeans.modules.jackpot30.impl.indexing.RemoteIndex;
    5.13 +import org.netbeans.modules.jackpot30.remoting.api.RemoteIndex;
    5.14  import org.netbeans.modules.java.hints.jackpot.impl.batch.Scopes;
    5.15  import org.netbeans.spi.editor.hints.ErrorDescription;
    5.16  import org.netbeans.spi.editor.hints.ErrorDescriptionFactory;
    5.17 @@ -89,7 +89,7 @@
    5.18  import org.openide.filesystems.FileStateInvalidException;
    5.19  import org.openide.filesystems.FileUtil;
    5.20  import org.openide.util.Exceptions;
    5.21 -import static org.netbeans.modules.jackpot30.impl.WebUtilities.escapeForQuery;
    5.22 +import static org.netbeans.modules.jackpot30.remoting.api.WebUtilities.escapeForQuery;
    5.23  
    5.24  /**
    5.25   *
     6.1 --- a/api/src/org/netbeans/modules/jackpot30/impl/duplicates/indexing/RemoteDuplicatesIndex.java	Wed Jun 22 12:05:27 2011 +0200
     6.2 +++ b/api/src/org/netbeans/modules/jackpot30/impl/duplicates/indexing/RemoteDuplicatesIndex.java	Thu Jun 23 15:07:16 2011 +0200
     6.3 @@ -79,13 +79,13 @@
     6.4  import org.apache.lucene.search.TermQuery;
     6.5  import org.apache.lucene.store.FSDirectory;
     6.6  import org.codeviation.pojson.Pojson;
     6.7 -import org.netbeans.modules.jackpot30.impl.WebUtilities;
     6.8 +import org.netbeans.modules.jackpot30.remoting.api.WebUtilities;
     6.9  import org.netbeans.modules.jackpot30.impl.duplicates.ComputeDuplicates.DuplicateDescription;
    6.10  import org.netbeans.modules.jackpot30.impl.duplicates.ComputeDuplicates.Span;
    6.11  import org.netbeans.modules.jackpot30.impl.indexing.AbstractLuceneIndex.BitSetCollector;
    6.12  import org.netbeans.modules.jackpot30.impl.indexing.Cache;
    6.13  import org.netbeans.modules.jackpot30.impl.indexing.FileBasedIndex.NoAnalyzer;
    6.14 -import org.netbeans.modules.jackpot30.impl.indexing.RemoteIndex;
    6.15 +import org.netbeans.modules.jackpot30.remoting.api.RemoteIndex;
    6.16  import org.openide.filesystems.FileObject;
    6.17  import org.openide.filesystems.FileUtil;
    6.18  import org.openide.util.Exceptions;
     7.1 --- a/api/src/org/netbeans/modules/jackpot30/impl/indexing/Index.java	Wed Jun 22 12:05:27 2011 +0200
     7.2 +++ b/api/src/org/netbeans/modules/jackpot30/impl/indexing/Index.java	Thu Jun 23 15:07:16 2011 +0200
     7.3 @@ -43,7 +43,7 @@
     7.4  import java.util.Map;
     7.5  import com.sun.source.util.Trees;
     7.6  import javax.lang.model.util.Types;
     7.7 -import org.netbeans.modules.jackpot30.impl.WebUtilities;
     7.8 +import org.netbeans.modules.jackpot30.remoting.api.WebUtilities;
     7.9  import java.util.ArrayList;
    7.10  import com.sun.source.tree.CompilationUnitTree;
    7.11  import java.io.IOException;
    7.12 @@ -57,7 +57,7 @@
    7.13  import org.netbeans.api.annotations.common.NullAllowed;
    7.14  import org.netbeans.api.java.source.CompilationInfo;
    7.15  import org.openide.util.Exceptions;
    7.16 -import static org.netbeans.modules.jackpot30.impl.WebUtilities.escapeForQuery;
    7.17 +import static org.netbeans.modules.jackpot30.remoting.api.WebUtilities.escapeForQuery;
    7.18  
    7.19  /**
    7.20   *
     8.1 --- a/api/src/org/netbeans/modules/jackpot30/impl/indexing/RemoteIndex.java	Wed Jun 22 12:05:27 2011 +0200
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,123 +0,0 @@
     8.4 -/*
     8.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     8.6 - *
     8.7 - * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
     8.8 - *
     8.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    8.10 - * Other names may be trademarks of their respective owners.
    8.11 - *
    8.12 - * The contents of this file are subject to the terms of either the GNU
    8.13 - * General Public License Version 2 only ("GPL") or the Common
    8.14 - * Development and Distribution License("CDDL") (collectively, the
    8.15 - * "License"). You may not use this file except in compliance with the
    8.16 - * License. You can obtain a copy of the License at
    8.17 - * http://www.netbeans.org/cddl-gplv2.html
    8.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    8.19 - * specific language governing permissions and limitations under the
    8.20 - * License.  When distributing the software, include this License Header
    8.21 - * Notice in each file and include the License file at
    8.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
    8.23 - * particular file as subject to the "Classpath" exception as provided
    8.24 - * by Oracle in the GPL Version 2 section of the License file that
    8.25 - * accompanied this code. If applicable, add the following below the
    8.26 - * License Header, with the fields enclosed by brackets [] replaced by
    8.27 - * your own identifying information:
    8.28 - * "Portions Copyrighted [year] [name of copyright owner]"
    8.29 - *
    8.30 - * If you wish your version of this file to be governed by only the CDDL
    8.31 - * or only the GPL Version 2, indicate your decision by adding
    8.32 - * "[Contributor] elects to include this software in this distribution
    8.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
    8.34 - * single choice of license, a recipient has the option to distribute
    8.35 - * your version of this file under either the CDDL, the GPL Version 2 or
    8.36 - * to extend the choice of license to its licensees as provided above.
    8.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
    8.38 - * Version 2 license, then the option applies only if the new code is
    8.39 - * made subject to such option by the copyright holder.
    8.40 - *
    8.41 - * Contributor(s):
    8.42 - *
    8.43 - * Portions Copyrighted 2011 Sun Microsystems, Inc.
    8.44 - */
    8.45 -
    8.46 -package org.netbeans.modules.jackpot30.impl.indexing;
    8.47 -
    8.48 -import java.net.URL;
    8.49 -import java.util.LinkedList;
    8.50 -import java.util.List;
    8.51 -import java.util.prefs.BackingStoreException;
    8.52 -import java.util.prefs.Preferences;
    8.53 -import org.codeviation.pojson.Pojson;
    8.54 -import org.netbeans.modules.jackpot30.impl.refactoring.ScopesPanel;
    8.55 -import org.openide.util.Exceptions;
    8.56 -import org.openide.util.NbPreferences;
    8.57 -
    8.58 -/**
    8.59 - *
    8.60 - * @author lahvac
    8.61 - */
    8.62 -public class RemoteIndex {
    8.63 -
    8.64 -    public final String folder;
    8.65 -    public final URL    remote;
    8.66 -    public final String remoteSegment;
    8.67 -
    8.68 -    public static RemoteIndex create(String folder, URL remote, String remoteSegment) {
    8.69 -        return new RemoteIndex(folder, remote, remoteSegment);
    8.70 -    }
    8.71 -
    8.72 -    private RemoteIndex() {//used by Pojson
    8.73 -        this.folder = null;
    8.74 -        this.remote = null;
    8.75 -        this.remoteSegment = null;
    8.76 -    }
    8.77 -
    8.78 -    private RemoteIndex(String folder, URL remote, String remoteSegment) {
    8.79 -        this.folder = folder;
    8.80 -        this.remote = remote;
    8.81 -        this.remoteSegment = remoteSegment;
    8.82 -    }
    8.83 -
    8.84 -    private static final String KEY_REMOTE_INDICES = RemoteIndex.class.getSimpleName();
    8.85 -
    8.86 -    public static Iterable<? extends RemoteIndex> loadIndices() {
    8.87 -        List<RemoteIndex> result = new LinkedList<RemoteIndex>();
    8.88 -        Preferences prefs = NbPreferences.forModule(RemoteIndex.class).node(KEY_REMOTE_INDICES);
    8.89 -
    8.90 -        if (prefs != null) {
    8.91 -            try {
    8.92 -                for (String key : prefs.keys()) {
    8.93 -                    if (key.startsWith("index")) {
    8.94 -                        result.add(Pojson.load(RemoteIndex.class, prefs.get(key, null)));
    8.95 -                    }
    8.96 -                }
    8.97 -            } catch (BackingStoreException ex) {
    8.98 -                Exceptions.printStackTrace(ex);
    8.99 -            }
   8.100 -        }
   8.101 -
   8.102 -        return result;
   8.103 -    }
   8.104 -    
   8.105 -    public static void saveIndices(Iterable<? extends RemoteIndex> indices) {
   8.106 -        Preferences prefs = NbPreferences.forModule(RemoteIndex.class).node(KEY_REMOTE_INDICES);
   8.107 -
   8.108 -        try {
   8.109 -            prefs.clear();
   8.110 -        } catch (BackingStoreException ex) {
   8.111 -            Exceptions.printStackTrace(ex);
   8.112 -        }
   8.113 -
   8.114 -        int i = 0;
   8.115 -
   8.116 -        for (RemoteIndex idx : indices) {
   8.117 -            prefs.put("index" + i++, Pojson.save(idx));
   8.118 -        }
   8.119 -        
   8.120 -        try {
   8.121 -            prefs.flush();
   8.122 -        } catch (BackingStoreException ex) {
   8.123 -            Exceptions.printStackTrace(ex);
   8.124 -        }
   8.125 -    }
   8.126 -}
     9.1 --- a/api/src/org/netbeans/modules/jackpot30/impl/indexing/options/Bundle.properties	Wed Jun 22 12:05:27 2011 +0200
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,11 +0,0 @@
     9.4 -AdvancedOption_DisplayName_Index=Jackpot 3.0 Indices
     9.5 -AdvancedOption_Keywords_Index=index indices jackpot
     9.6 -CustomizeRemoteIndex.indexURLLabel.text=Index URL:
     9.7 -CustomizeRemoteIndex.indexURL.text=
     9.8 -CustomizeRemoteIndex.jLabel1.text=Subindex:
     9.9 -CustomizeRemoteIndex.folderLabel.text=&Folder:
    9.10 -CustomizeRemoteIndex.folderChooser.text=Browse
    9.11 -CustomizeRemoteIndex.folder.text=
    9.12 -IndexPanel.addButton.text=Add Mapping
    9.13 -IndexPanel.removeButton.text=Remove Mapping
    9.14 -IndexPanel.editButton.text=Edit Mapping
    10.1 --- a/api/src/org/netbeans/modules/jackpot30/impl/indexing/options/CustomizeRemoteIndex.form	Wed Jun 22 12:05:27 2011 +0200
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,178 +0,0 @@
    10.4 -<?xml version="1.1" encoding="UTF-8" ?>
    10.5 -
    10.6 -<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
    10.7 -  <NonVisualComponents>
    10.8 -    <Component class="javax.swing.ButtonGroup" name="buttonGroup1">
    10.9 -    </Component>
   10.10 -  </NonVisualComponents>
   10.11 -  <Properties>
   10.12 -    <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
   10.13 -      <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
   10.14 -        <EmptyBorder bottom="12" left="12" right="12" top="12"/>
   10.15 -      </Border>
   10.16 -    </Property>
   10.17 -  </Properties>
   10.18 -  <AuxValues>
   10.19 -    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
   10.20 -    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
   10.21 -    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
   10.22 -    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
   10.23 -    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
   10.24 -    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
   10.25 -    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
   10.26 -    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
   10.27 -    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
   10.28 -    <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,53,0,0,2,-37"/>
   10.29 -  </AuxValues>
   10.30 -
   10.31 -  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
   10.32 -  <SubComponents>
   10.33 -    <Container class="javax.swing.JPanel" name="folderPanel">
   10.34 -      <Constraints>
   10.35 -        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
   10.36 -          <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="1.0" weightY="0.0"/>
   10.37 -        </Constraint>
   10.38 -      </Constraints>
   10.39 -
   10.40 -      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
   10.41 -      <SubComponents>
   10.42 -        <Component class="javax.swing.JLabel" name="folderLabel">
   10.43 -          <Properties>
   10.44 -            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   10.45 -              <ResourceString bundle="org/netbeans/modules/jackpot30/impl/indexing/options/Bundle.properties" key="CustomizeRemoteIndex.folderLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
   10.46 -            </Property>
   10.47 -          </Properties>
   10.48 -          <Constraints>
   10.49 -            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
   10.50 -              <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="6" anchor="17" weightX="0.0" weightY="0.0"/>
   10.51 -            </Constraint>
   10.52 -          </Constraints>
   10.53 -        </Component>
   10.54 -        <Component class="javax.swing.JButton" name="folderChooser">
   10.55 -          <Properties>
   10.56 -            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   10.57 -              <ResourceString bundle="org/netbeans/modules/jackpot30/impl/indexing/options/Bundle.properties" key="CustomizeRemoteIndex.folderChooser.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
   10.58 -            </Property>
   10.59 -          </Properties>
   10.60 -          <Events>
   10.61 -            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="folderChooserActionPerformed"/>
   10.62 -          </Events>
   10.63 -          <Constraints>
   10.64 -            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
   10.65 -              <GridBagConstraints gridX="2" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
   10.66 -            </Constraint>
   10.67 -          </Constraints>
   10.68 -        </Component>
   10.69 -        <Component class="javax.swing.JTextField" name="folder">
   10.70 -          <Properties>
   10.71 -            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   10.72 -              <ResourceString bundle="org/netbeans/modules/jackpot30/impl/indexing/options/Bundle.properties" key="CustomizeRemoteIndex.folder.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
   10.73 -            </Property>
   10.74 -          </Properties>
   10.75 -          <Constraints>
   10.76 -            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
   10.77 -              <GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
   10.78 -            </Constraint>
   10.79 -          </Constraints>
   10.80 -        </Component>
   10.81 -      </SubComponents>
   10.82 -    </Container>
   10.83 -    <Component class="javax.swing.JTextArea" name="indexInfo">
   10.84 -      <Properties>
   10.85 -        <Property name="columns" type="int" value="20"/>
   10.86 -        <Property name="editable" type="boolean" value="false"/>
   10.87 -        <Property name="rows" type="int" value="5"/>
   10.88 -        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
   10.89 -          <Border info="null"/>
   10.90 -        </Property>
   10.91 -      </Properties>
   10.92 -      <Constraints>
   10.93 -        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
   10.94 -          <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="6" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="1.0" weightY="1.0"/>
   10.95 -        </Constraint>
   10.96 -      </Constraints>
   10.97 -    </Component>
   10.98 -    <Container class="javax.swing.JPanel" name="remoteIndexPanel">
   10.99 -      <Constraints>
  10.100 -        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
  10.101 -          <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
  10.102 -        </Constraint>
  10.103 -      </Constraints>
  10.104 -
  10.105 -      <Layout>
  10.106 -        <DimensionLayout dim="0">
  10.107 -          <Group type="103" groupAlignment="0" attributes="0">
  10.108 -              <Group type="102" alignment="0" attributes="0">
  10.109 -                  <EmptySpace max="-2" attributes="0"/>
  10.110 -                  <Group type="103" groupAlignment="0" attributes="0">
  10.111 -                      <Group type="102" alignment="0" attributes="0">
  10.112 -                          <EmptySpace min="12" pref="12" max="12" attributes="0"/>
  10.113 -                          <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
  10.114 -                          <EmptySpace max="-2" attributes="0"/>
  10.115 -                          <Component id="subIndex" pref="589" max="32767" attributes="0"/>
  10.116 -                      </Group>
  10.117 -                      <Group type="102" alignment="0" attributes="0">
  10.118 -                          <Component id="indexURLLabel" min="-2" max="-2" attributes="0"/>
  10.119 -                          <EmptySpace max="-2" attributes="0"/>
  10.120 -                          <Component id="indexURL" min="-2" max="-2" attributes="0"/>
  10.121 -                      </Group>
  10.122 -                  </Group>
  10.123 -                  <EmptySpace max="-2" attributes="0"/>
  10.124 -              </Group>
  10.125 -          </Group>
  10.126 -        </DimensionLayout>
  10.127 -        <DimensionLayout dim="1">
  10.128 -          <Group type="103" groupAlignment="0" attributes="0">
  10.129 -              <Group type="102" alignment="0" attributes="0">
  10.130 -                  <EmptySpace max="-2" attributes="0"/>
  10.131 -                  <Group type="103" groupAlignment="3" attributes="0">
  10.132 -                      <Component id="indexURLLabel" alignment="3" min="-2" max="-2" attributes="0"/>
  10.133 -                      <Component id="indexURL" alignment="3" min="-2" max="-2" attributes="0"/>
  10.134 -                  </Group>
  10.135 -                  <EmptySpace type="unrelated" max="-2" attributes="0"/>
  10.136 -                  <Group type="103" groupAlignment="3" attributes="0">
  10.137 -                      <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
  10.138 -                      <Component id="subIndex" alignment="3" min="-2" max="-2" attributes="0"/>
  10.139 -                  </Group>
  10.140 -                  <EmptySpace max="32767" attributes="0"/>
  10.141 -              </Group>
  10.142 -          </Group>
  10.143 -        </DimensionLayout>
  10.144 -      </Layout>
  10.145 -      <SubComponents>
  10.146 -        <Component class="javax.swing.JTextField" name="indexURL">
  10.147 -          <Properties>
  10.148 -            <Property name="columns" type="int" value="40"/>
  10.149 -            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  10.150 -              <ResourceString bundle="org/netbeans/modules/jackpot30/impl/indexing/options/Bundle.properties" key="CustomizeRemoteIndex.indexURL.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  10.151 -            </Property>
  10.152 -          </Properties>
  10.153 -        </Component>
  10.154 -        <Component class="javax.swing.JLabel" name="indexURLLabel">
  10.155 -          <Properties>
  10.156 -            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  10.157 -              <ResourceString bundle="org/netbeans/modules/jackpot30/impl/indexing/options/Bundle.properties" key="CustomizeRemoteIndex.indexURLLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  10.158 -            </Property>
  10.159 -          </Properties>
  10.160 -        </Component>
  10.161 -        <Component class="javax.swing.JComboBox" name="subIndex">
  10.162 -          <Properties>
  10.163 -            <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
  10.164 -              <StringArray count="0"/>
  10.165 -            </Property>
  10.166 -          </Properties>
  10.167 -          <Events>
  10.168 -            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="subIndexActionPerformed"/>
  10.169 -          </Events>
  10.170 -        </Component>
  10.171 -        <Component class="javax.swing.JLabel" name="jLabel1">
  10.172 -          <Properties>
  10.173 -            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  10.174 -              <ResourceString bundle="org/netbeans/modules/jackpot30/impl/indexing/options/Bundle.properties" key="CustomizeRemoteIndex.jLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  10.175 -            </Property>
  10.176 -          </Properties>
  10.177 -        </Component>
  10.178 -      </SubComponents>
  10.179 -    </Container>
  10.180 -  </SubComponents>
  10.181 -</Form>
    11.1 --- a/api/src/org/netbeans/modules/jackpot30/impl/indexing/options/CustomizeRemoteIndex.java	Wed Jun 22 12:05:27 2011 +0200
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,484 +0,0 @@
    11.4 -/*
    11.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    11.6 - *
    11.7 - * Copyright 2010-2011 Sun Microsystems, Inc. All rights reserved.
    11.8 - *
    11.9 - * The contents of this file are subject to the terms of either the GNU
   11.10 - * General Public License Version 2 only ("GPL") or the Common
   11.11 - * Development and Distribution License("CDDL") (collectively, the
   11.12 - * "License"). You may not use this file except in compliance with the
   11.13 - * License. You can obtain a copy of the License at
   11.14 - * http://www.netbeans.org/cddl-gplv2.html
   11.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   11.16 - * specific language governing permissions and limitations under the
   11.17 - * License.  When distributing the software, include this License Header
   11.18 - * Notice in each file and include the License file at
   11.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   11.20 - * particular file as subject to the "Classpath" exception as provided
   11.21 - * by Sun in the GPL Version 2 section of the License file that
   11.22 - * accompanied this code. If applicable, add the following below the
   11.23 - * License Header, with the fields enclosed by brackets [] replaced by
   11.24 - * your own identifying information:
   11.25 - * "Portions Copyrighted [year] [name of copyright owner]"
   11.26 - *
   11.27 - * If you wish your version of this file to be governed by only the CDDL
   11.28 - * or only the GPL Version 2, indicate your decision by adding
   11.29 - * "[Contributor] elects to include this software in this distribution
   11.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
   11.31 - * single choice of license, a recipient has the option to distribute
   11.32 - * your version of this file under either the CDDL, the GPL Version 2 or
   11.33 - * to extend the choice of license to its licensees as provided above.
   11.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
   11.35 - * Version 2 license, then the option applies only if the new code is
   11.36 - * made subject to such option by the copyright holder.
   11.37 - *
   11.38 - * Contributor(s):
   11.39 - *
   11.40 - * Portions Copyrighted 2010-2011 Sun Microsystems, Inc.
   11.41 - */
   11.42 -package org.netbeans.modules.jackpot30.impl.indexing.options;
   11.43 -
   11.44 -import java.awt.Component;
   11.45 -import java.io.File;
   11.46 -import java.net.MalformedURLException;
   11.47 -import java.net.URISyntaxException;
   11.48 -import java.net.URL;
   11.49 -import java.text.DateFormat;
   11.50 -import java.util.Collection;
   11.51 -import java.util.Date;
   11.52 -import java.util.HashMap;
   11.53 -import java.util.Map;
   11.54 -import java.util.concurrent.atomic.AtomicBoolean;
   11.55 -import java.util.concurrent.atomic.AtomicReference;
   11.56 -import java.util.logging.Level;
   11.57 -import java.util.logging.Logger;
   11.58 -import javax.swing.DefaultComboBoxModel;
   11.59 -import javax.swing.DefaultListCellRenderer;
   11.60 -import javax.swing.JButton;
   11.61 -import javax.swing.JFileChooser;
   11.62 -import javax.swing.JList;
   11.63 -import javax.swing.JTextField;
   11.64 -import javax.swing.SwingUtilities;
   11.65 -import javax.swing.UIManager;
   11.66 -import javax.swing.event.DocumentEvent;
   11.67 -import javax.swing.event.DocumentListener;
   11.68 -import org.codeviation.pojson.Pojson;
   11.69 -import org.netbeans.modules.jackpot30.impl.WebUtilities;
   11.70 -import org.netbeans.modules.jackpot30.impl.indexing.IndexInfo;
   11.71 -import org.netbeans.modules.jackpot30.impl.indexing.RemoteIndex;
   11.72 -import org.openide.NotificationLineSupport;
   11.73 -import org.openide.util.RequestProcessor;
   11.74 -
   11.75 -/**
   11.76 - *
   11.77 - * @author lahvac
   11.78 - */
   11.79 -public class CustomizeRemoteIndex extends javax.swing.JPanel {
   11.80 -
   11.81 -    private final JButton okButton;
   11.82 -
   11.83 -    public CustomizeRemoteIndex(JButton okButton) {
   11.84 -        this.okButton = okButton;
   11.85 -        initComponents();
   11.86 -        DocumentListener updateErrorsListener = new DocumentListener() {
   11.87 -            public void insertUpdate(DocumentEvent e) {
   11.88 -                updateErrors();
   11.89 -            }
   11.90 -            public void removeUpdate(DocumentEvent e) {
   11.91 -                updateErrors();
   11.92 -            }
   11.93 -            public void changedUpdate(DocumentEvent e) {}
   11.94 -        };
   11.95 -        folder.getDocument().addDocumentListener(updateErrorsListener);
   11.96 -        indexURL.getDocument().addDocumentListener(new DocumentListener() {
   11.97 -            public void insertUpdate(DocumentEvent e) {
   11.98 -                indexURLUpdated();
   11.99 -            }
  11.100 -            public void removeUpdate(DocumentEvent e) {
  11.101 -                indexURLUpdated();
  11.102 -            }
  11.103 -            public void changedUpdate(DocumentEvent e) {
  11.104 -            }
  11.105 -        });
  11.106 -        indexInfo.setFont(UIManager.getFont("Label.font"));
  11.107 -        indexInfo.setBackground(UIManager.getColor("Label.background"));
  11.108 -        indexInfo.setDisabledTextColor(UIManager.getColor("Label.foreground"));
  11.109 -    }
  11.110 -
  11.111 -    /** This method is called from within the constructor to
  11.112 -     * initialize the form.
  11.113 -     * WARNING: Do NOT modify this code. The content of this method is
  11.114 -     * always regenerated by the Form Editor.
  11.115 -     */
  11.116 -    @SuppressWarnings("unchecked")
  11.117 -    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  11.118 -    private void initComponents() {
  11.119 -        java.awt.GridBagConstraints gridBagConstraints;
  11.120 -
  11.121 -        buttonGroup1 = new javax.swing.ButtonGroup();
  11.122 -        folderPanel = new javax.swing.JPanel();
  11.123 -        folderLabel = new javax.swing.JLabel();
  11.124 -        folderChooser = new javax.swing.JButton();
  11.125 -        folder = new javax.swing.JTextField();
  11.126 -        indexInfo = new javax.swing.JTextArea();
  11.127 -        remoteIndexPanel = new javax.swing.JPanel();
  11.128 -        indexURL = new javax.swing.JTextField();
  11.129 -        indexURLLabel = new javax.swing.JLabel();
  11.130 -        subIndex = new javax.swing.JComboBox();
  11.131 -        jLabel1 = new javax.swing.JLabel();
  11.132 -
  11.133 -        setBorder(javax.swing.BorderFactory.createEmptyBorder(12, 12, 12, 12));
  11.134 -        setLayout(new java.awt.GridBagLayout());
  11.135 -
  11.136 -        folderPanel.setLayout(new java.awt.GridBagLayout());
  11.137 -
  11.138 -        org.openide.awt.Mnemonics.setLocalizedText(folderLabel, org.openide.util.NbBundle.getMessage(CustomizeRemoteIndex.class, "CustomizeRemoteIndex.folderLabel.text")); // NOI18N
  11.139 -        gridBagConstraints = new java.awt.GridBagConstraints();
  11.140 -        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
  11.141 -        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 6);
  11.142 -        folderPanel.add(folderLabel, gridBagConstraints);
  11.143 -
  11.144 -        org.openide.awt.Mnemonics.setLocalizedText(folderChooser, org.openide.util.NbBundle.getMessage(CustomizeRemoteIndex.class, "CustomizeRemoteIndex.folderChooser.text")); // NOI18N
  11.145 -        folderChooser.addActionListener(new java.awt.event.ActionListener() {
  11.146 -            public void actionPerformed(java.awt.event.ActionEvent evt) {
  11.147 -                folderChooserActionPerformed(evt);
  11.148 -            }
  11.149 -        });
  11.150 -        gridBagConstraints = new java.awt.GridBagConstraints();
  11.151 -        gridBagConstraints.gridx = 2;
  11.152 -        gridBagConstraints.gridy = 0;
  11.153 -        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
  11.154 -        gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 0);
  11.155 -        folderPanel.add(folderChooser, gridBagConstraints);
  11.156 -
  11.157 -        folder.setText(org.openide.util.NbBundle.getMessage(CustomizeRemoteIndex.class, "CustomizeRemoteIndex.folder.text")); // NOI18N
  11.158 -        gridBagConstraints = new java.awt.GridBagConstraints();
  11.159 -        gridBagConstraints.gridx = 1;
  11.160 -        gridBagConstraints.gridy = 0;
  11.161 -        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
  11.162 -        gridBagConstraints.weightx = 1.0;
  11.163 -        folderPanel.add(folder, gridBagConstraints);
  11.164 -
  11.165 -        gridBagConstraints = new java.awt.GridBagConstraints();
  11.166 -        gridBagConstraints.gridx = 0;
  11.167 -        gridBagConstraints.gridy = 0;
  11.168 -        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
  11.169 -        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
  11.170 -        gridBagConstraints.weightx = 1.0;
  11.171 -        add(folderPanel, gridBagConstraints);
  11.172 -
  11.173 -        indexInfo.setColumns(20);
  11.174 -        indexInfo.setEditable(false);
  11.175 -        indexInfo.setRows(5);
  11.176 -        indexInfo.setBorder(null);
  11.177 -        gridBagConstraints = new java.awt.GridBagConstraints();
  11.178 -        gridBagConstraints.gridx = 0;
  11.179 -        gridBagConstraints.gridy = 2;
  11.180 -        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
  11.181 -        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
  11.182 -        gridBagConstraints.weightx = 1.0;
  11.183 -        gridBagConstraints.weighty = 1.0;
  11.184 -        gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 0);
  11.185 -        add(indexInfo, gridBagConstraints);
  11.186 -
  11.187 -        indexURL.setColumns(40);
  11.188 -        indexURL.setText(org.openide.util.NbBundle.getMessage(CustomizeRemoteIndex.class, "CustomizeRemoteIndex.indexURL.text")); // NOI18N
  11.189 -
  11.190 -        org.openide.awt.Mnemonics.setLocalizedText(indexURLLabel, org.openide.util.NbBundle.getMessage(CustomizeRemoteIndex.class, "CustomizeRemoteIndex.indexURLLabel.text")); // NOI18N
  11.191 -
  11.192 -        subIndex.addActionListener(new java.awt.event.ActionListener() {
  11.193 -            public void actionPerformed(java.awt.event.ActionEvent evt) {
  11.194 -                subIndexActionPerformed(evt);
  11.195 -            }
  11.196 -        });
  11.197 -
  11.198 -        org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(CustomizeRemoteIndex.class, "CustomizeRemoteIndex.jLabel1.text")); // NOI18N
  11.199 -
  11.200 -        javax.swing.GroupLayout remoteIndexPanelLayout = new javax.swing.GroupLayout(remoteIndexPanel);
  11.201 -        remoteIndexPanel.setLayout(remoteIndexPanelLayout);
  11.202 -        remoteIndexPanelLayout.setHorizontalGroup(
  11.203 -            remoteIndexPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  11.204 -            .addGroup(remoteIndexPanelLayout.createSequentialGroup()
  11.205 -                .addContainerGap()
  11.206 -                .addGroup(remoteIndexPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  11.207 -                    .addGroup(remoteIndexPanelLayout.createSequentialGroup()
  11.208 -                        .addGap(12, 12, 12)
  11.209 -                        .addComponent(jLabel1)
  11.210 -                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  11.211 -                        .addComponent(subIndex, 0, 589, Short.MAX_VALUE))
  11.212 -                    .addGroup(remoteIndexPanelLayout.createSequentialGroup()
  11.213 -                        .addComponent(indexURLLabel)
  11.214 -                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  11.215 -                        .addComponent(indexURL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
  11.216 -                .addContainerGap())
  11.217 -        );
  11.218 -        remoteIndexPanelLayout.setVerticalGroup(
  11.219 -            remoteIndexPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  11.220 -            .addGroup(remoteIndexPanelLayout.createSequentialGroup()
  11.221 -                .addContainerGap()
  11.222 -                .addGroup(remoteIndexPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  11.223 -                    .addComponent(indexURLLabel)
  11.224 -                    .addComponent(indexURL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  11.225 -                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  11.226 -                .addGroup(remoteIndexPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  11.227 -                    .addComponent(jLabel1)
  11.228 -                    .addComponent(subIndex, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  11.229 -                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  11.230 -        );
  11.231 -
  11.232 -        gridBagConstraints = new java.awt.GridBagConstraints();
  11.233 -        gridBagConstraints.gridx = 0;
  11.234 -        gridBagConstraints.gridy = 1;
  11.235 -        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
  11.236 -        gridBagConstraints.weightx = 1.0;
  11.237 -        add(remoteIndexPanel, gridBagConstraints);
  11.238 -    }// </editor-fold>//GEN-END:initComponents
  11.239 -
  11.240 -    private void folderChooserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_folderChooserActionPerformed
  11.241 -        showFileChooser(folder);
  11.242 -}//GEN-LAST:event_folderChooserActionPerformed
  11.243 -
  11.244 -    private void subIndexActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_subIndexActionPerformed
  11.245 -        subindexSelectionUpdated();
  11.246 -    }//GEN-LAST:event_subIndexActionPerformed
  11.247 -
  11.248 -    // Variables declaration - do not modify//GEN-BEGIN:variables
  11.249 -    private javax.swing.ButtonGroup buttonGroup1;
  11.250 -    private javax.swing.JTextField folder;
  11.251 -    private javax.swing.JButton folderChooser;
  11.252 -    private javax.swing.JLabel folderLabel;
  11.253 -    private javax.swing.JPanel folderPanel;
  11.254 -    private javax.swing.JTextArea indexInfo;
  11.255 -    private javax.swing.JTextField indexURL;
  11.256 -    private javax.swing.JLabel indexURLLabel;
  11.257 -    private javax.swing.JLabel jLabel1;
  11.258 -    private javax.swing.JPanel remoteIndexPanel;
  11.259 -    private javax.swing.JComboBox subIndex;
  11.260 -    // End of variables declaration//GEN-END:variables
  11.261 -
  11.262 -    private void showFileChooser(JTextField folder) {
  11.263 -        JFileChooser c = new JFileChooser();
  11.264 -
  11.265 -        c.setSelectedFile(new File(folder.getText()));
  11.266 -        c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
  11.267 -        c.setMultiSelectionEnabled(false);
  11.268 -        c.setApproveButtonText("Select");
  11.269 -
  11.270 -        if (c.showDialog(this, null) == JFileChooser.APPROVE_OPTION) {
  11.271 -            folder.setText(c.getSelectedFile().getAbsolutePath());
  11.272 -        }
  11.273 -    }
  11.274 -
  11.275 -    public void setIndex(RemoteIndex index) {
  11.276 -        folder.setText(index.folder);
  11.277 -        indexURL.setText(index.remote.toExternalForm());
  11.278 -        subIndex.setSelectedItem(index.remoteSegment);
  11.279 -    }
  11.280 -
  11.281 -    public RemoteIndex getIndex() {
  11.282 -        try {
  11.283 -            return RemoteIndex.create(folder.getText(), new URL(indexURL.getText()), (String) subIndex.getSelectedItem());
  11.284 -        } catch (MalformedURLException ex) {
  11.285 -            throw new IllegalStateException(ex);
  11.286 -        }
  11.287 -    }
  11.288 -
  11.289 -    private NotificationLineSupport notificationSupport;
  11.290 -
  11.291 -    public void setNotificationSupport(NotificationLineSupport notificationSupport) {
  11.292 -        this.notificationSupport = notificationSupport;
  11.293 -    }
  11.294 -
  11.295 -    private void updateErrors() {
  11.296 -        notificationSupport.clearMessages();
  11.297 -        
  11.298 -        File folderFile = new File(folder.getText());
  11.299 -
  11.300 -        if (!folderFile.exists()) {
  11.301 -            notificationSupport.setErrorMessage("Specified directory does not exist.");
  11.302 -            okButton.setEnabled(false);
  11.303 -            return;
  11.304 -        }
  11.305 -
  11.306 -        if (!folderFile.isDirectory()) {
  11.307 -            notificationSupport.setErrorMessage("Specified directory is not directory.");
  11.308 -            okButton.setEnabled(false);
  11.309 -            return ;
  11.310 -        }
  11.311 -
  11.312 -        if (checkingIndexURL.get()) {
  11.313 -            notificationSupport.setInformationMessage("Checking index URL");
  11.314 -            okButton.setEnabled(false);
  11.315 -            return;
  11.316 -        }
  11.317 -
  11.318 -        String urlError = checkingIndexURLError.get();
  11.319 -
  11.320 -        if (urlError != null) {
  11.321 -            notificationSupport.setErrorMessage(urlError);
  11.322 -            okButton.setEnabled(false);
  11.323 -            return;
  11.324 -        }
  11.325 -        
  11.326 -        okButton.setEnabled(true);
  11.327 -    }
  11.328 -
  11.329 -    private final AtomicBoolean checkingIndexURL = new AtomicBoolean();
  11.330 -    private final AtomicReference<String> checkingIndexURLContentCopy = new AtomicReference<String>();
  11.331 -    private final AtomicReference<String> checkingIndexURLError = new AtomicReference<String>();
  11.332 -
  11.333 -    private void indexURLUpdated() {
  11.334 -        checkingIndexURLContentCopy.set(indexURL.getText());
  11.335 -        urlCheckerTask.cancel();
  11.336 -        urlCheckerTask.schedule(50);
  11.337 -    }
  11.338 -
  11.339 -    private static final RequestProcessor WORKER = new RequestProcessor(CustomizeRemoteIndex.class.getName(), 1, false, false);
  11.340 -    private final RequestProcessor.Task urlCheckerTask = WORKER.create(new Runnable() {
  11.341 -
  11.342 -        public void run() {
  11.343 -            checkingIndexURL.set(true);
  11.344 -            checkingIndexURLError.set(null);
  11.345 -
  11.346 -            SwingUtilities.invokeLater(new Runnable() {
  11.347 -                public void run() {
  11.348 -                    updateErrors();
  11.349 -                }
  11.350 -            });
  11.351 -
  11.352 -            String urlText = checkingIndexURLContentCopy.get();
  11.353 -            Collection<? extends String> subindices = null;
  11.354 -
  11.355 -            try {
  11.356 -                URL url = new URL(urlText);
  11.357 -
  11.358 -                if (!url.getPath().endsWith("/"))
  11.359 -                    url = new URL(url.getProtocol(), url.getHost(), url.getPort(), url.getPath() + "/" + (url.getQuery() != null ? "?" + url.getQuery() : ""));
  11.360 -                
  11.361 -                subindices = WebUtilities.requestStringArrayResponse(url.toURI().resolve("list"));
  11.362 -
  11.363 -                if (subindices.isEmpty()) {
  11.364 -                   checkingIndexURLError.set("Not an index.");
  11.365 -                }
  11.366 -            } catch (URISyntaxException ex) {
  11.367 -                checkingIndexURLError.set(ex.getLocalizedMessage());
  11.368 -            } catch (MalformedURLException ex) {
  11.369 -                checkingIndexURLError.set(ex.getLocalizedMessage());
  11.370 -            } catch (ThreadDeath td) {
  11.371 -                throw td;
  11.372 -            } catch (Throwable t) {//#6541019
  11.373 -                checkingIndexURLError.set("Invalid URL");
  11.374 -            }
  11.375 -            
  11.376 -            checkingIndexURL.set(false);
  11.377 -
  11.378 -            final Collection<? extends String> subindicesFinal = subindices;
  11.379 -
  11.380 -            SwingUtilities.invokeLater(new Runnable() {
  11.381 -                public void run() {
  11.382 -                    updateErrors();
  11.383 -
  11.384 -                    if (subindicesFinal == null || subindicesFinal.isEmpty()) return;
  11.385 -
  11.386 -                    DefaultComboBoxModel model = (DefaultComboBoxModel) subIndex.getModel();
  11.387 -                    String selected = (String) model.getSelectedItem();
  11.388 -
  11.389 -                    model.removeAllElements();
  11.390 -
  11.391 -                    boolean containsSelection = false;
  11.392 -                    Map<String, String> displayNames = new HashMap<String, String>();
  11.393 -
  11.394 -                    for (String subindex : subindicesFinal) {
  11.395 -                        String[] subindexSplit = subindex.split(":", 2);
  11.396 -                        if (subindexSplit[0].equals(selected)) containsSelection = true;
  11.397 -                        model.addElement(subindexSplit[0]);
  11.398 -                        displayNames.put(subindexSplit[0], subindexSplit[1]);
  11.399 -                    }
  11.400 -
  11.401 -                    if (containsSelection) {
  11.402 -                        model.setSelectedItem(selected);
  11.403 -                    }
  11.404 -
  11.405 -                    subindexSelectionUpdated();
  11.406 -                    subIndex.setRenderer(new RendererImpl(displayNames));
  11.407 -                }
  11.408 -            });
  11.409 -        }
  11.410 -    });
  11.411 -
  11.412 -    private final AtomicReference<String> indexInfoURLContentCopy = new AtomicReference<String>();
  11.413 -    private final AtomicReference<String> indexInfoSubIndexCopy = new AtomicReference<String>();
  11.414 -    private void subindexSelectionUpdated() {
  11.415 -        indexInfoURLContentCopy.set(indexURL.getText());
  11.416 -        indexInfoSubIndexCopy.set((String) subIndex.getSelectedItem());
  11.417 -        indexInfoTask.cancel();
  11.418 -        indexInfoTask.schedule(50);
  11.419 -    }
  11.420 -
  11.421 -    private final RequestProcessor.Task indexInfoTask = WORKER.create(new Runnable() {
  11.422 -
  11.423 -        public void run() {
  11.424 -            String urlText = indexInfoURLContentCopy.get();
  11.425 -            String subIndex = indexInfoSubIndexCopy.get();
  11.426 -            IndexInfo info = null;
  11.427 -
  11.428 -            try {
  11.429 -                URL url = new URL(urlText);
  11.430 -
  11.431 -                if (!url.getPath().endsWith("/"))
  11.432 -                    url = new URL(url.getProtocol(), url.getHost(), url.getPort(), url.getPath() + "/" + (url.getQuery() != null ? "?" + url.getQuery() : ""));
  11.433 -
  11.434 -                String indexInfoText = WebUtilities.requestStringResponse(url.toURI().resolve("info?path=" + WebUtilities.escapeForQuery(subIndex)));
  11.435 -                info = IndexInfo.empty();
  11.436 -
  11.437 -                if (indexInfoText != null)
  11.438 -                    Pojson.update(info, indexInfoText);
  11.439 -            } catch (URISyntaxException ex) {
  11.440 -                Logger.getLogger(CustomizeRemoteIndex.class.getName()).log(Level.FINE, null, ex);
  11.441 -            } catch (MalformedURLException ex) {
  11.442 -                Logger.getLogger(CustomizeRemoteIndex.class.getName()).log(Level.FINE, null, ex);
  11.443 -            }
  11.444 -
  11.445 -            final IndexInfo infoFinal = info;
  11.446 -
  11.447 -            SwingUtilities.invokeLater(new Runnable() {
  11.448 -                public void run() {
  11.449 -                    if (infoFinal != null) {
  11.450 -                        indexInfo.setText(toDisplayText(infoFinal));
  11.451 -                    } else {
  11.452 -                        indexInfo.setText("");
  11.453 -                    }
  11.454 -                }
  11.455 -            });
  11.456 -        }
  11.457 -    });
  11.458 -
  11.459 -    private static String toDisplayText(IndexInfo info) {
  11.460 -        StringBuilder sb = new StringBuilder();
  11.461 -
  11.462 -        if (info.sourceLocation != null) {
  11.463 -            sb.append("Source Location: ").append(info.sourceLocation).append("\n");
  11.464 -        }
  11.465 -        if (info.lastUpdate >= 0) {
  11.466 -            sb.append("Last Update:\t").append(DateFormat.getDateTimeInstance().format(new Date(info.lastUpdate))).append("\n");
  11.467 -        }
  11.468 -        if (info.totalFiles >= 0) {
  11.469 -            sb.append("Indexed Files:\t").append(info.totalFiles).append("\n");
  11.470 -        }
  11.471 -
  11.472 -        return sb.toString();
  11.473 -    }
  11.474 -
  11.475 -    private static final class RendererImpl extends DefaultListCellRenderer {
  11.476 -        private final Map<String, String> displayNames;
  11.477 -        public RendererImpl(Map<String, String> displayNames) {
  11.478 -            this.displayNames = displayNames;
  11.479 -        }
  11.480 -
  11.481 -        @Override
  11.482 -        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
  11.483 -            return super.getListCellRendererComponent(list, displayNames.get(value), index, isSelected, cellHasFocus);
  11.484 -        }
  11.485 -
  11.486 -    }
  11.487 -}
    12.1 --- a/api/src/org/netbeans/modules/jackpot30/impl/indexing/options/IndexOptionsPanelController.java	Wed Jun 22 12:05:27 2011 +0200
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,113 +0,0 @@
    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.impl.indexing.options;
   12.46 -
   12.47 -import java.beans.PropertyChangeListener;
   12.48 -import java.beans.PropertyChangeSupport;
   12.49 -import javax.swing.JComponent;
   12.50 -import org.netbeans.spi.options.OptionsPanelController;
   12.51 -import org.openide.util.HelpCtx;
   12.52 -import org.openide.util.Lookup;
   12.53 -
   12.54 -@OptionsPanelController.SubRegistration(location = "Editor",
   12.55 -displayName = "#AdvancedOption_DisplayName_Index",
   12.56 -keywords = "#AdvancedOption_Keywords_Index",
   12.57 -keywordsCategory = "Editor/Index")
   12.58 -public final class IndexOptionsPanelController extends OptionsPanelController {
   12.59 -
   12.60 -    private IndexPanel panel;
   12.61 -    private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
   12.62 -    private boolean changed;
   12.63 -
   12.64 -    public void update() {
   12.65 -        getPanel().load();
   12.66 -        changed = false;
   12.67 -    }
   12.68 -
   12.69 -    public void applyChanges() {
   12.70 -        getPanel().store();
   12.71 -        changed = false;
   12.72 -    }
   12.73 -
   12.74 -    public void cancel() {
   12.75 -        // need not do anything special, if no changes have been persisted yet
   12.76 -    }
   12.77 -
   12.78 -    public boolean isValid() {
   12.79 -        return getPanel().valid();
   12.80 -    }
   12.81 -
   12.82 -    public boolean isChanged() {
   12.83 -        return changed;
   12.84 -    }
   12.85 -
   12.86 -    public HelpCtx getHelpCtx() {
   12.87 -        return null; // new HelpCtx("...ID") if you have a help set
   12.88 -    }
   12.89 -
   12.90 -    public JComponent getComponent(Lookup masterLookup) {
   12.91 -        return getPanel();
   12.92 -    }
   12.93 -
   12.94 -    public void addPropertyChangeListener(PropertyChangeListener l) {
   12.95 -        pcs.addPropertyChangeListener(l);
   12.96 -    }
   12.97 -
   12.98 -    public void removePropertyChangeListener(PropertyChangeListener l) {
   12.99 -        pcs.removePropertyChangeListener(l);
  12.100 -    }
  12.101 -
  12.102 -    private IndexPanel getPanel() {
  12.103 -        if (panel == null) {
  12.104 -            panel = new IndexPanel(this);
  12.105 -        }
  12.106 -        return panel;
  12.107 -    }
  12.108 -
  12.109 -    void changed() {
  12.110 -        if (!changed) {
  12.111 -            changed = true;
  12.112 -            pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
  12.113 -        }
  12.114 -        pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
  12.115 -    }
  12.116 -}
    13.1 --- a/api/src/org/netbeans/modules/jackpot30/impl/indexing/options/IndexPanel.form	Wed Jun 22 12:05:27 2011 +0200
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,106 +0,0 @@
    13.4 -<?xml version="1.1" encoding="UTF-8" ?>
    13.5 -
    13.6 -<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
    13.7 -  <AuxValues>
    13.8 -    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
    13.9 -    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
   13.10 -    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
   13.11 -    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
   13.12 -    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
   13.13 -    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
   13.14 -    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
   13.15 -    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
   13.16 -    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
   13.17 -  </AuxValues>
   13.18 -
   13.19 -  <Layout>
   13.20 -    <DimensionLayout dim="0">
   13.21 -      <Group type="103" groupAlignment="0" attributes="0">
   13.22 -          <Group type="102" alignment="1" attributes="0">
   13.23 -              <EmptySpace max="-2" attributes="0"/>
   13.24 -              <Component id="jScrollPane1" pref="281" max="32767" attributes="0"/>
   13.25 -              <EmptySpace max="-2" attributes="0"/>
   13.26 -              <Group type="103" groupAlignment="1" attributes="0">
   13.27 -                  <Component id="removeButton" alignment="1" pref="154" max="32767" attributes="1"/>
   13.28 -                  <Component id="addButton" alignment="1" pref="154" max="32767" attributes="1"/>
   13.29 -                  <Component id="editButton" alignment="1" pref="154" max="32767" attributes="0"/>
   13.30 -              </Group>
   13.31 -              <EmptySpace max="-2" attributes="0"/>
   13.32 -          </Group>
   13.33 -      </Group>
   13.34 -    </DimensionLayout>
   13.35 -    <DimensionLayout dim="1">
   13.36 -      <Group type="103" groupAlignment="0" attributes="0">
   13.37 -          <Group type="102" alignment="0" attributes="0">
   13.38 -              <EmptySpace max="-2" attributes="0"/>
   13.39 -              <Group type="103" groupAlignment="0" attributes="0">
   13.40 -                  <Component id="jScrollPane1" alignment="0" pref="306" max="32767" attributes="0"/>
   13.41 -                  <Group type="102" alignment="0" attributes="0">
   13.42 -                      <Component id="addButton" min="-2" max="-2" attributes="0"/>
   13.43 -                      <EmptySpace max="-2" attributes="0"/>
   13.44 -                      <Component id="editButton" min="-2" max="-2" attributes="0"/>
   13.45 -                      <EmptySpace max="-2" attributes="0"/>
   13.46 -                      <Component id="removeButton" min="-2" max="-2" attributes="0"/>
   13.47 -                  </Group>
   13.48 -              </Group>
   13.49 -              <EmptySpace max="-2" attributes="0"/>
   13.50 -          </Group>
   13.51 -      </Group>
   13.52 -    </DimensionLayout>
   13.53 -  </Layout>
   13.54 -  <SubComponents>
   13.55 -    <Container class="javax.swing.JScrollPane" name="jScrollPane1">
   13.56 -      <AuxValues>
   13.57 -        <AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
   13.58 -        <AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
   13.59 -        <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
   13.60 -      </AuxValues>
   13.61 -
   13.62 -      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
   13.63 -      <SubComponents>
   13.64 -        <Component class="javax.swing.JTable" name="indices">
   13.65 -          <Properties>
   13.66 -            <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
   13.67 -              <Table columnCount="4" rowCount="4">
   13.68 -                <Column editable="true" title="Title 1" type="java.lang.Object"/>
   13.69 -                <Column editable="true" title="Title 2" type="java.lang.Object"/>
   13.70 -                <Column editable="true" title="Title 3" type="java.lang.Object"/>
   13.71 -                <Column editable="true" title="Title 4" type="java.lang.Object"/>
   13.72 -              </Table>
   13.73 -            </Property>
   13.74 -          </Properties>
   13.75 -        </Component>
   13.76 -      </SubComponents>
   13.77 -    </Container>
   13.78 -    <Component class="javax.swing.JButton" name="addButton">
   13.79 -      <Properties>
   13.80 -        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   13.81 -          <ResourceString bundle="org/netbeans/modules/jackpot30/impl/indexing/options/Bundle.properties" key="IndexPanel.addButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
   13.82 -        </Property>
   13.83 -      </Properties>
   13.84 -      <Events>
   13.85 -        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addButtonActionPerformed"/>
   13.86 -      </Events>
   13.87 -    </Component>
   13.88 -    <Component class="javax.swing.JButton" name="removeButton">
   13.89 -      <Properties>
   13.90 -        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   13.91 -          <ResourceString bundle="org/netbeans/modules/jackpot30/impl/indexing/options/Bundle.properties" key="IndexPanel.removeButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
   13.92 -        </Property>
   13.93 -      </Properties>
   13.94 -      <Events>
   13.95 -        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="removeButtonActionPerformed"/>
   13.96 -      </Events>
   13.97 -    </Component>
   13.98 -    <Component class="javax.swing.JButton" name="editButton">
   13.99 -      <Properties>
  13.100 -        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  13.101 -          <ResourceString bundle="org/netbeans/modules/jackpot30/impl/indexing/options/Bundle.properties" key="IndexPanel.editButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  13.102 -        </Property>
  13.103 -      </Properties>
  13.104 -      <Events>
  13.105 -        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="editButtonActionPerformed"/>
  13.106 -      </Events>
  13.107 -    </Component>
  13.108 -  </SubComponents>
  13.109 -</Form>
    14.1 --- a/api/src/org/netbeans/modules/jackpot30/impl/indexing/options/IndexPanel.java	Wed Jun 22 12:05:27 2011 +0200
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,265 +0,0 @@
    14.4 -/*
    14.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    14.6 - *
    14.7 - * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
    14.8 - *
    14.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   14.10 - * Other names may be trademarks of their respective owners.
   14.11 - *
   14.12 - * The contents of this file are subject to the terms of either the GNU
   14.13 - * General Public License Version 2 only ("GPL") or the Common
   14.14 - * Development and Distribution License("CDDL") (collectively, the
   14.15 - * "License"). You may not use this file except in compliance with the
   14.16 - * License. You can obtain a copy of the License at
   14.17 - * http://www.netbeans.org/cddl-gplv2.html
   14.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   14.19 - * specific language governing permissions and limitations under the
   14.20 - * License.  When distributing the software, include this License Header
   14.21 - * Notice in each file and include the License file at
   14.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   14.23 - * particular file as subject to the "Classpath" exception as provided
   14.24 - * by Oracle in the GPL Version 2 section of the License file that
   14.25 - * accompanied this code. If applicable, add the following below the
   14.26 - * License Header, with the fields enclosed by brackets [] replaced by
   14.27 - * your own identifying information:
   14.28 - * "Portions Copyrighted [year] [name of copyright owner]"
   14.29 - *
   14.30 - * If you wish your version of this file to be governed by only the CDDL
   14.31 - * or only the GPL Version 2, indicate your decision by adding
   14.32 - * "[Contributor] elects to include this software in this distribution
   14.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
   14.34 - * single choice of license, a recipient has the option to distribute
   14.35 - * your version of this file under either the CDDL, the GPL Version 2 or
   14.36 - * to extend the choice of license to its licensees as provided above.
   14.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
   14.38 - * Version 2 license, then the option applies only if the new code is
   14.39 - * made subject to such option by the copyright holder.
   14.40 - *
   14.41 - * Contributor(s):
   14.42 - *
   14.43 - * Portions Copyrighted 2011 Sun Microsystems, Inc.
   14.44 - */
   14.45 -package org.netbeans.modules.jackpot30.impl.indexing.options;
   14.46 -
   14.47 -import java.util.ArrayList;
   14.48 -import java.util.List;
   14.49 -import javax.swing.JButton;
   14.50 -import javax.swing.event.ListSelectionEvent;
   14.51 -import javax.swing.event.ListSelectionListener;
   14.52 -import javax.swing.table.AbstractTableModel;
   14.53 -import org.netbeans.modules.jackpot30.impl.indexing.RemoteIndex;
   14.54 -import org.openide.DialogDescriptor;
   14.55 -import org.openide.DialogDisplayer;
   14.56 -
   14.57 -final class IndexPanel extends javax.swing.JPanel {
   14.58 -
   14.59 -    private final IndexOptionsPanelController controller;
   14.60 -
   14.61 -    IndexPanel(IndexOptionsPanelController controller) {
   14.62 -        this.controller = controller;
   14.63 -        initComponents();
   14.64 -        indices.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
   14.65 -            public void valueChanged(ListSelectionEvent e) {
   14.66 -                enableDisable();
   14.67 -            }
   14.68 -        });
   14.69 -        enableDisable();
   14.70 -    }
   14.71 -
   14.72 -    /** This method is called from within the constructor to
   14.73 -     * initialize the form.
   14.74 -     * WARNING: Do NOT modify this code. The content of this method is
   14.75 -     * always regenerated by the Form Editor.
   14.76 -     */
   14.77 -    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
   14.78 -    private void initComponents() {
   14.79 -
   14.80 -        javax.swing.JScrollPane jScrollPane1 = new javax.swing.JScrollPane();
   14.81 -        indices = new javax.swing.JTable();
   14.82 -        addButton = new javax.swing.JButton();
   14.83 -        removeButton = new javax.swing.JButton();
   14.84 -        editButton = new javax.swing.JButton();
   14.85 -
   14.86 -        indices.setModel(new javax.swing.table.DefaultTableModel(
   14.87 -            new Object [][] {
   14.88 -                {null, null, null, null},
   14.89 -                {null, null, null, null},
   14.90 -                {null, null, null, null},
   14.91 -                {null, null, null, null}
   14.92 -            },
   14.93 -            new String [] {
   14.94 -                "Title 1", "Title 2", "Title 3", "Title 4"
   14.95 -            }
   14.96 -        ));
   14.97 -        jScrollPane1.setViewportView(indices);
   14.98 -
   14.99 -        org.openide.awt.Mnemonics.setLocalizedText(addButton, org.openide.util.NbBundle.getMessage(IndexPanel.class, "IndexPanel.addButton.text")); // NOI18N
  14.100 -        addButton.addActionListener(new java.awt.event.ActionListener() {
  14.101 -            public void actionPerformed(java.awt.event.ActionEvent evt) {
  14.102 -                addButtonActionPerformed(evt);
  14.103 -            }
  14.104 -        });
  14.105 -
  14.106 -        org.openide.awt.Mnemonics.setLocalizedText(removeButton, org.openide.util.NbBundle.getMessage(IndexPanel.class, "IndexPanel.removeButton.text")); // NOI18N
  14.107 -        removeButton.addActionListener(new java.awt.event.ActionListener() {
  14.108 -            public void actionPerformed(java.awt.event.ActionEvent evt) {
  14.109 -                removeButtonActionPerformed(evt);
  14.110 -            }
  14.111 -        });
  14.112 -
  14.113 -        org.openide.awt.Mnemonics.setLocalizedText(editButton, org.openide.util.NbBundle.getMessage(IndexPanel.class, "IndexPanel.editButton.text")); // NOI18N
  14.114 -        editButton.addActionListener(new java.awt.event.ActionListener() {
  14.115 -            public void actionPerformed(java.awt.event.ActionEvent evt) {
  14.116 -                editButtonActionPerformed(evt);
  14.117 -            }
  14.118 -        });
  14.119 -
  14.120 -        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
  14.121 -        this.setLayout(layout);
  14.122 -        layout.setHorizontalGroup(
  14.123 -            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  14.124 -            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
  14.125 -                .addContainerGap()
  14.126 -                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 281, Short.MAX_VALUE)
  14.127 -                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  14.128 -                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  14.129 -                    .addComponent(removeButton, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE)
  14.130 -                    .addComponent(addButton, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE)
  14.131 -                    .addComponent(editButton, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE))
  14.132 -                .addContainerGap())
  14.133 -        );
  14.134 -        layout.setVerticalGroup(
  14.135 -            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  14.136 -            .addGroup(layout.createSequentialGroup()
  14.137 -                .addContainerGap()
  14.138 -                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  14.139 -                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE)
  14.140 -                    .addGroup(layout.createSequentialGroup()
  14.141 -                        .addComponent(addButton)
  14.142 -                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  14.143 -                        .addComponent(editButton)
  14.144 -                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  14.145 -                        .addComponent(removeButton)))
  14.146 -                .addContainerGap())
  14.147 -        );
  14.148 -    }// </editor-fold>//GEN-END:initComponents
  14.149 -
  14.150 -    private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed
  14.151 -        addEditIndex(false);
  14.152 -    }//GEN-LAST:event_addButtonActionPerformed
  14.153 -
  14.154 -    private void editButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editButtonActionPerformed
  14.155 -        addEditIndex(true);
  14.156 -    }//GEN-LAST:event_editButtonActionPerformed
  14.157 -
  14.158 -    private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed
  14.159 -        TableModelImpl model = (TableModelImpl) indices.getModel();
  14.160 -
  14.161 -        model.indices.remove(indices.getSelectedRow());
  14.162 -        model.fireTableDataChanged();
  14.163 -    }//GEN-LAST:event_removeButtonActionPerformed
  14.164 -
  14.165 -    private void addEditIndex(boolean edit) {
  14.166 -        JButton okButton = new JButton("OK");
  14.167 -        CustomizeRemoteIndex panel = new CustomizeRemoteIndex(okButton);
  14.168 -        DialogDescriptor dd = new DialogDescriptor(panel, edit ? "Edit Index" : "Add Index", true, new Object[] {okButton, DialogDescriptor.CANCEL_OPTION}, okButton, DialogDescriptor.DEFAULT_ALIGN, null, null);
  14.169 -
  14.170 -        dd.setClosingOptions(null);
  14.171 -        panel.setNotificationSupport(dd.createNotificationLineSupport());
  14.172 -
  14.173 -        TableModelImpl model = (TableModelImpl) indices.getModel();
  14.174 -
  14.175 -        if (edit) {
  14.176 -            panel.setIndex(model.indices.get(indices.getSelectedRow()));
  14.177 -        }
  14.178 -
  14.179 -        if (DialogDisplayer.getDefault().notify(dd) == okButton) {
  14.180 -            RemoteIndex remoteIndex = panel.getIndex();
  14.181 -
  14.182 -            if (edit) {
  14.183 -                int index = model.indices.indexOf(indices.getSelectedRow());
  14.184 -
  14.185 -                model.indices.remove(index);
  14.186 -                model.indices.add(index, remoteIndex);
  14.187 -            } else {
  14.188 -                model.indices.add(remoteIndex);
  14.189 -            }
  14.190 -
  14.191 -            model.fireTableDataChanged();
  14.192 -        }
  14.193 -    }
  14.194 -
  14.195 -    private void enableDisable() {
  14.196 -        if (indices.getSelectedRow() != (-1)) {
  14.197 -            editButton.setEnabled(true);
  14.198 -            removeButton.setEnabled(true);
  14.199 -        } else {
  14.200 -            editButton.setEnabled(false);
  14.201 -            removeButton.setEnabled(false);
  14.202 -        }
  14.203 -    }
  14.204 -
  14.205 -    void load() {
  14.206 -        TableModelImpl model = new TableModelImpl();
  14.207 -
  14.208 -        for (RemoteIndex idx : RemoteIndex.loadIndices()) {
  14.209 -            model.indices.add(idx);
  14.210 -        }
  14.211 -
  14.212 -        indices.setModel(model);
  14.213 -    }
  14.214 -
  14.215 -    void store() {
  14.216 -        TableModelImpl model = (TableModelImpl) indices.getModel();
  14.217 -        
  14.218 -        RemoteIndex.saveIndices(model.indices);
  14.219 -    }
  14.220 -
  14.221 -    boolean valid() {
  14.222 -        // TODO check whether form is consistent and complete
  14.223 -        return true;
  14.224 -    }
  14.225 -    // Variables declaration - do not modify//GEN-BEGIN:variables
  14.226 -    private javax.swing.JButton addButton;
  14.227 -    private javax.swing.JButton editButton;
  14.228 -    private javax.swing.JTable indices;
  14.229 -    private javax.swing.JButton removeButton;
  14.230 -    // End of variables declaration//GEN-END:variables
  14.231 -
  14.232 -    private static final class TableModelImpl extends AbstractTableModel {
  14.233 -
  14.234 -        private final List<RemoteIndex> indices = new ArrayList<RemoteIndex>();
  14.235 -
  14.236 -        public int getRowCount() {
  14.237 -            return indices.size();
  14.238 -        }
  14.239 -
  14.240 -        public int getColumnCount() {
  14.241 -            return 3;
  14.242 -        }
  14.243 -
  14.244 -        public String getColumnName(int columnIndex) {
  14.245 -            switch (columnIndex) {
  14.246 -                case 0: return "Local folder";
  14.247 -                case 1: return "Remote URL";
  14.248 -                case 2: return "Remote project";
  14.249 -                default: throw new IllegalStateException();
  14.250 -            }
  14.251 -        }
  14.252 -
  14.253 -        public Class<?> getColumnClass(int columnIndex) {
  14.254 -            return String.class;
  14.255 -        }
  14.256 -
  14.257 -        public Object getValueAt(int rowIndex, int columnIndex) {
  14.258 -            RemoteIndex idx = indices.get(rowIndex);
  14.259 -
  14.260 -            switch (columnIndex) {
  14.261 -                case 0: return idx.folder;
  14.262 -                case 1: return idx.remote.toExternalForm();
  14.263 -                case 2: return idx.remoteSegment;
  14.264 -                default: throw new IllegalStateException();
  14.265 -            }
  14.266 -        }
  14.267 -    }
  14.268 -}
    15.1 --- a/api/src/org/netbeans/modules/jackpot30/impl/refactoring/AddScopePanel.java	Wed Jun 22 12:05:27 2011 +0200
    15.2 +++ b/api/src/org/netbeans/modules/jackpot30/impl/refactoring/AddScopePanel.java	Thu Jun 23 15:07:16 2011 +0200
    15.3 @@ -65,7 +65,7 @@
    15.4  import javax.swing.event.DocumentEvent;
    15.5  import javax.swing.event.DocumentListener;
    15.6  import org.codeviation.pojson.Pojson;
    15.7 -import org.netbeans.modules.jackpot30.impl.WebUtilities;
    15.8 +import org.netbeans.modules.jackpot30.remoting.api.WebUtilities;
    15.9  import org.netbeans.modules.jackpot30.impl.batch.EnhancedScopes.GivenFolderScope;
   15.10  import org.netbeans.modules.jackpot30.impl.indexing.FileBasedIndex;
   15.11  import org.netbeans.modules.jackpot30.impl.indexing.Index;
    16.1 --- a/api/src/org/netbeans/modules/jackpot30/impl/refactoring/findusages/GlobalFindUsagesRefactoringPlugin.java	Wed Jun 22 12:05:27 2011 +0200
    16.2 +++ b/api/src/org/netbeans/modules/jackpot30/impl/refactoring/findusages/GlobalFindUsagesRefactoringPlugin.java	Thu Jun 23 15:07:16 2011 +0200
    16.3 @@ -46,7 +46,7 @@
    16.4  import java.util.LinkedList;
    16.5  import java.util.List;
    16.6  import org.netbeans.modules.jackpot30.impl.batch.EnhancedScopes;
    16.7 -import org.netbeans.modules.jackpot30.impl.indexing.RemoteIndex;
    16.8 +import org.netbeans.modules.jackpot30.remoting.api.RemoteIndex;
    16.9  import org.netbeans.modules.jackpot30.impl.refactoring.AbstractApplyHintsRefactoringPlugin;
   16.10  import org.netbeans.modules.jackpot30.spi.PatternConvertor;
   16.11  import org.netbeans.modules.java.hints.jackpot.impl.MessageImpl;
    17.1 --- a/api/test/unit/src/org/netbeans/modules/jackpot30/impl/duplicates/indexing/RemoteDuplicatesIndexTest.java	Wed Jun 22 12:05:27 2011 +0200
    17.2 +++ b/api/test/unit/src/org/netbeans/modules/jackpot30/impl/duplicates/indexing/RemoteDuplicatesIndexTest.java	Thu Jun 23 15:07:16 2011 +0200
    17.3 @@ -57,7 +57,7 @@
    17.4  import org.netbeans.modules.jackpot30.impl.duplicates.ComputeDuplicates.DuplicateDescription;
    17.5  import org.netbeans.modules.jackpot30.impl.duplicates.ComputeDuplicates.Span;
    17.6  import org.netbeans.modules.jackpot30.impl.indexing.Cache;
    17.7 -import org.netbeans.modules.jackpot30.impl.indexing.RemoteIndex;
    17.8 +import org.netbeans.modules.jackpot30.remoting.api.RemoteIndex;
    17.9  import org.openide.filesystems.FileObject;
   17.10  import org.openide.filesystems.FileUtil;
   17.11  
    18.1 --- a/bridges/jumpto/build.xml	Wed Jun 22 12:05:27 2011 +0200
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,9 +0,0 @@
    18.4 -<?xml version="1.0" encoding="UTF-8"?>
    18.5 -<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
    18.6 -<!-- for some information on what you could do (e.g. targets to override). -->
    18.7 -<!-- If you delete this file and reopen the project it will be recreated. -->
    18.8 -<project name="org.netbeans.modules.jackpot30.jumpto" default="netbeans" basedir=".">
    18.9 -    <description>Builds, tests, and runs the project org.netbeans.modules.jackpot30.jumpto.</description>
   18.10 -    <import file="nbproject/build-impl.xml"/>
   18.11 -    <import file="${suite.dir}/findbugs-import.xml"/>
   18.12 -</project>
    19.1 --- a/bridges/jumpto/manifest.mf	Wed Jun 22 12:05:27 2011 +0200
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,5 +0,0 @@
    19.4 -Manifest-Version: 1.0
    19.5 -OpenIDE-Module: org.netbeans.modules.jackpot30.jumpto
    19.6 -OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jackpot30/jumpto/Bundle.properties
    19.7 -OpenIDE-Module-Specification-Version: 1.0
    19.8 -
    20.1 --- a/bridges/jumpto/nbproject/build-impl.xml	Wed Jun 22 12:05:27 2011 +0200
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,45 +0,0 @@
    20.4 -<?xml version="1.0" encoding="UTF-8"?>
    20.5 -<!--
    20.6 -*** GENERATED FROM project.xml - DO NOT EDIT  ***
    20.7 -***         EDIT ../build.xml INSTEAD         ***
    20.8 --->
    20.9 -<project name="org.netbeans.modules.jackpot30.jumpto-impl" basedir="..">
   20.10 -    <fail message="Please build using Ant 1.7.1 or higher.">
   20.11 -        <condition>
   20.12 -            <not>
   20.13 -                <antversion atleast="1.7.1"/>
   20.14 -            </not>
   20.15 -        </condition>
   20.16 -    </fail>
   20.17 -    <property file="nbproject/private/suite-private.properties"/>
   20.18 -    <property file="nbproject/suite.properties"/>
   20.19 -    <fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
   20.20 -    <property file="${suite.dir}/nbproject/private/platform-private.properties"/>
   20.21 -    <property file="${suite.dir}/nbproject/platform.properties"/>
   20.22 -    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
   20.23 -        <attribute name="name"/>
   20.24 -        <attribute name="value"/>
   20.25 -        <sequential>
   20.26 -            <property name="@{name}" value="${@{value}}"/>
   20.27 -        </sequential>
   20.28 -    </macrodef>
   20.29 -    <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
   20.30 -        <attribute name="property"/>
   20.31 -        <attribute name="value"/>
   20.32 -        <sequential>
   20.33 -            <property name="@{property}" value="@{value}"/>
   20.34 -        </sequential>
   20.35 -    </macrodef>
   20.36 -    <property file="${user.properties.file}"/>
   20.37 -    <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
   20.38 -    <nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
   20.39 -    <nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
   20.40 -    <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
   20.41 -        <condition>
   20.42 -            <not>
   20.43 -                <contains string="${cluster.path.evaluated}" substring="platform"/>
   20.44 -            </not>
   20.45 -        </condition>
   20.46 -    </fail>
   20.47 -    <import file="${harness.dir}/build.xml"/>
   20.48 -</project>
    21.1 --- a/bridges/jumpto/nbproject/genfiles.properties	Wed Jun 22 12:05:27 2011 +0200
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,8 +0,0 @@
    21.4 -build.xml.data.CRC32=14c2e29c
    21.5 -build.xml.script.CRC32=c7b5d9b7
    21.6 -build.xml.stylesheet.CRC32=a56c6a5b@1.45
    21.7 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
    21.8 -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    21.9 -nbproject/build-impl.xml.data.CRC32=14c2e29c
   21.10 -nbproject/build-impl.xml.script.CRC32=3404573f
   21.11 -nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.45
    22.1 --- a/bridges/jumpto/nbproject/project.properties	Wed Jun 22 12:05:27 2011 +0200
    22.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.3 @@ -1,2 +0,0 @@
    22.4 -javac.source=1.6
    22.5 -javac.compilerargs=-Xlint -Xlint:-serial
    23.1 --- a/bridges/jumpto/nbproject/project.xml	Wed Jun 22 12:05:27 2011 +0200
    23.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.3 @@ -1,105 +0,0 @@
    23.4 -<?xml version="1.0" encoding="UTF-8"?>
    23.5 -<project xmlns="http://www.netbeans.org/ns/project/1">
    23.6 -    <type>org.netbeans.modules.apisupport.project</type>
    23.7 -    <configuration>
    23.8 -        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
    23.9 -            <code-name-base>org.netbeans.modules.jackpot30.jumpto</code-name-base>
   23.10 -            <suite-component/>
   23.11 -            <module-dependencies>
   23.12 -                <dependency>
   23.13 -                    <code-name-base>org.netbeans.api.java.classpath</code-name-base>
   23.14 -                    <build-prerequisite/>
   23.15 -                    <compile-dependency/>
   23.16 -                    <run-dependency>
   23.17 -                        <release-version>1</release-version>
   23.18 -                        <specification-version>1.28</specification-version>
   23.19 -                    </run-dependency>
   23.20 -                </dependency>
   23.21 -                <dependency>
   23.22 -                    <code-name-base>org.netbeans.libs.javacapi</code-name-base>
   23.23 -                    <build-prerequisite/>
   23.24 -                    <compile-dependency/>
   23.25 -                    <run-dependency>
   23.26 -                        <specification-version>7.5.0.3</specification-version>
   23.27 -                    </run-dependency>
   23.28 -                </dependency>
   23.29 -                <dependency>
   23.30 -                    <code-name-base>org.netbeans.modules.jackpot30.api</code-name-base>
   23.31 -                    <build-prerequisite/>
   23.32 -                    <compile-dependency/>
   23.33 -                    <run-dependency>
   23.34 -                        <implementation-version/>
   23.35 -                    </run-dependency>
   23.36 -                </dependency>
   23.37 -                <dependency>
   23.38 -                    <code-name-base>org.netbeans.modules.java.source</code-name-base>
   23.39 -                    <build-prerequisite/>
   23.40 -                    <compile-dependency/>
   23.41 -                    <run-dependency>
   23.42 -                        <implementation-version/>
   23.43 -                    </run-dependency>
   23.44 -                </dependency>
   23.45 -                <dependency>
   23.46 -                    <code-name-base>org.netbeans.modules.java.sourceui</code-name-base>
   23.47 -                    <build-prerequisite/>
   23.48 -                    <compile-dependency/>
   23.49 -                    <run-dependency>
   23.50 -                        <release-version>1</release-version>
   23.51 -                        <specification-version>1.20.0.1.17</specification-version>
   23.52 -                    </run-dependency>
   23.53 -                </dependency>
   23.54 -                <dependency>
   23.55 -                    <code-name-base>org.netbeans.modules.jeriglib</code-name-base>
   23.56 -                    <build-prerequisite/>
   23.57 -                    <compile-dependency/>
   23.58 -                    <run-dependency>
   23.59 -                        <specification-version>1.16</specification-version>
   23.60 -                    </run-dependency>
   23.61 -                </dependency>
   23.62 -                <dependency>
   23.63 -                    <code-name-base>org.netbeans.modules.jumpto</code-name-base>
   23.64 -                    <build-prerequisite/>
   23.65 -                    <compile-dependency/>
   23.66 -                    <run-dependency>
   23.67 -                        <release-version>1</release-version>
   23.68 -                        <implementation-version/>
   23.69 -                    </run-dependency>
   23.70 -                </dependency>
   23.71 -                <dependency>
   23.72 -                    <code-name-base>org.netbeans.modules.projectapi</code-name-base>
   23.73 -                    <build-prerequisite/>
   23.74 -                    <compile-dependency/>
   23.75 -                    <run-dependency>
   23.76 -                        <release-version>1</release-version>
   23.77 -                        <specification-version>1.35</specification-version>
   23.78 -                    </run-dependency>
   23.79 -                </dependency>
   23.80 -                <dependency>
   23.81 -                    <code-name-base>org.openide.filesystems</code-name-base>
   23.82 -                    <build-prerequisite/>
   23.83 -                    <compile-dependency/>
   23.84 -                    <run-dependency>
   23.85 -                        <specification-version>7.46</specification-version>
   23.86 -                    </run-dependency>
   23.87 -                </dependency>
   23.88 -                <dependency>
   23.89 -                    <code-name-base>org.openide.util</code-name-base>
   23.90 -                    <build-prerequisite/>
   23.91 -                    <compile-dependency/>
   23.92 -                    <run-dependency>
   23.93 -                        <specification-version>8.14</specification-version>
   23.94 -                    </run-dependency>
   23.95 -                </dependency>
   23.96 -                <dependency>
   23.97 -                    <code-name-base>org.openide.util.lookup</code-name-base>
   23.98 -                    <build-prerequisite/>
   23.99 -                    <compile-dependency/>
  23.100 -                    <run-dependency>
  23.101 -                        <specification-version>8.6</specification-version>
  23.102 -                    </run-dependency>
  23.103 -                </dependency>
  23.104 -            </module-dependencies>
  23.105 -            <public-packages/>
  23.106 -        </data>
  23.107 -    </configuration>
  23.108 -</project>
    24.1 --- a/bridges/jumpto/nbproject/suite.properties	Wed Jun 22 12:05:27 2011 +0200
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,1 +0,0 @@
    24.4 -suite.dir=${basedir}/../..
    25.1 --- a/bridges/jumpto/src/org/netbeans/modules/jackpot30/jumpto/Bundle.properties	Wed Jun 22 12:05:27 2011 +0200
    25.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.3 @@ -1,1 +0,0 @@
    25.4 -OpenIDE-Module-Name=jackpot 3.0 Jumpto Bridge
    26.1 --- a/bridges/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteGoToType.java	Wed Jun 22 12:05:27 2011 +0200
    26.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.3 @@ -1,238 +0,0 @@
    26.4 -/*
    26.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    26.6 - *
    26.7 - * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
    26.8 - *
    26.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   26.10 - * Other names may be trademarks of their respective owners.
   26.11 - *
   26.12 - * The contents of this file are subject to the terms of either the GNU
   26.13 - * General Public License Version 2 only ("GPL") or the Common
   26.14 - * Development and Distribution License("CDDL") (collectively, the
   26.15 - * "License"). You may not use this file except in compliance with the
   26.16 - * License. You can obtain a copy of the License at
   26.17 - * http://www.netbeans.org/cddl-gplv2.html
   26.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   26.19 - * specific language governing permissions and limitations under the
   26.20 - * License.  When distributing the software, include this License Header
   26.21 - * Notice in each file and include the License file at
   26.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   26.23 - * particular file as subject to the "Classpath" exception as provided
   26.24 - * by Oracle in the GPL Version 2 section of the License file that
   26.25 - * accompanied this code. If applicable, add the following below the
   26.26 - * License Header, with the fields enclosed by brackets [] replaced by
   26.27 - * your own identifying information:
   26.28 - * "Portions Copyrighted [year] [name of copyright owner]"
   26.29 - *
   26.30 - * If you wish your version of this file to be governed by only the CDDL
   26.31 - * or only the GPL Version 2, indicate your decision by adding
   26.32 - * "[Contributor] elects to include this software in this distribution
   26.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
   26.34 - * single choice of license, a recipient has the option to distribute
   26.35 - * your version of this file under either the CDDL, the GPL Version 2 or
   26.36 - * to extend the choice of license to its licensees as provided above.
   26.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
   26.38 - * Version 2 license, then the option applies only if the new code is
   26.39 - * made subject to such option by the copyright holder.
   26.40 - *
   26.41 - * Contributor(s):
   26.42 - *
   26.43 - * Portions Copyrighted 2011 Sun Microsystems, Inc.
   26.44 - */
   26.45 -package org.netbeans.modules.jackpot30.jumpto;
   26.46 -
   26.47 -import java.io.File;
   26.48 -import java.net.URI;
   26.49 -import java.net.URISyntaxException;
   26.50 -import java.util.EnumSet;
   26.51 -import java.util.LinkedHashMap;
   26.52 -import java.util.List;
   26.53 -import java.util.Map;
   26.54 -import java.util.Map.Entry;
   26.55 -import java.util.concurrent.atomic.AtomicReference;
   26.56 -import javax.lang.model.element.ElementKind;
   26.57 -import javax.lang.model.element.Modifier;
   26.58 -import javax.swing.Icon;
   26.59 -import org.codeviation.pojson.Pojson;
   26.60 -import org.netbeans.api.java.source.ClasspathInfo;
   26.61 -import org.netbeans.api.java.source.ElementHandle;
   26.62 -import org.netbeans.api.java.source.ui.ElementIcons;
   26.63 -import org.netbeans.api.java.source.ui.ElementOpen;
   26.64 -import org.netbeans.api.project.FileOwnerQuery;
   26.65 -import org.netbeans.api.project.Project;
   26.66 -import org.netbeans.api.project.ProjectUtils;
   26.67 -import org.netbeans.modules.jackpot30.impl.WebUtilities;
   26.68 -import org.netbeans.modules.jackpot30.impl.indexing.RemoteIndex;
   26.69 -import org.netbeans.modules.java.source.ElementHandleAccessor;
   26.70 -import org.netbeans.spi.jumpto.type.TypeDescriptor;
   26.71 -import org.netbeans.spi.jumpto.type.TypeProvider;
   26.72 -import org.openide.filesystems.FileObject;
   26.73 -import org.openide.filesystems.FileUtil;
   26.74 -import org.openide.util.Exceptions;
   26.75 -import org.openide.util.lookup.ServiceProvider;
   26.76 -
   26.77 -/**
   26.78 - *
   26.79 - * @author lahvac
   26.80 - */
   26.81 -@ServiceProvider(service=TypeProvider.class)
   26.82 -public class RemoteGoToType implements TypeProvider {
   26.83 -
   26.84 -    @Override
   26.85 -    public String name() {
   26.86 -        return "Jackpot 3.0 Remote Index Type Provider";
   26.87 -    }
   26.88 -
   26.89 -    @Override
   26.90 -    public String getDisplayName() {
   26.91 -        return "Jackpot 3.0 Remote Index Type Provider";
   26.92 -    }
   26.93 -
   26.94 -    @Override
   26.95 -    public void computeTypeNames(Context context, Result result) {
   26.96 -        for (RemoteIndex ri : RemoteIndex.loadIndices()) {
   26.97 -            try {
   26.98 -                URI resolved = new URI(ri.remote.toExternalForm() + "/type/search?path=" + WebUtilities.escapeForQuery(ri.remoteSegment) + "&prefix=" + WebUtilities.escapeForQuery(context.getText()));
   26.99 -                @SuppressWarnings("unchecked") //XXX: should not trust something got from the network!
  26.100 -                Map<String, List<String>> types = Pojson.load(LinkedHashMap.class, WebUtilities.requestStringResponse(resolved));
  26.101 -
  26.102 -                for (Entry<String, List<String>> e : types.entrySet()) {
  26.103 -                    for (String binaryName : e.getValue()) {
  26.104 -                        result.addResult(new RemoteTypeDescriptor(ri, e.getKey(), binaryName));
  26.105 -                    }
  26.106 -                }
  26.107 -            } catch (URISyntaxException ex) {
  26.108 -                Exceptions.printStackTrace(ex);
  26.109 -            }
  26.110 -        }
  26.111 -    }
  26.112 -
  26.113 -    @Override
  26.114 -    public void cancel() {
  26.115 -    }
  26.116 -
  26.117 -    @Override
  26.118 -    public void cleanup() {
  26.119 -    }
  26.120 -
  26.121 -    private static final class RemoteTypeDescriptor extends TypeDescriptor {
  26.122 -
  26.123 -        private final RemoteIndex origin;
  26.124 -        private final String relativePath;
  26.125 -        private final String binaryName;
  26.126 -        private final AtomicReference<FileObject> file = new AtomicReference<FileObject>();
  26.127 -
  26.128 -        public RemoteTypeDescriptor(RemoteIndex origin, String relativePath, String binaryName) {
  26.129 -            this.origin = origin;
  26.130 -            this.relativePath = relativePath;
  26.131 -            this.binaryName = binaryName;
  26.132 -        }
  26.133 -
  26.134 -        @Override
  26.135 -        public String getSimpleName() {
  26.136 -            int dollar = binaryName.lastIndexOf("$");
  26.137 -            
  26.138 -            if (dollar >= 0) return binaryName.substring(dollar + 1);
  26.139 -            else {
  26.140 -                int dot = binaryName.lastIndexOf(".");
  26.141 -                
  26.142 -                if (dot >= 0) return binaryName.substring(dot + 1);
  26.143 -                else return binaryName;
  26.144 -            }
  26.145 -        }
  26.146 -
  26.147 -        @Override
  26.148 -        public String getOuterName() {
  26.149 -            int dollar = binaryName.lastIndexOf("$");
  26.150 -            int dot = binaryName.lastIndexOf(".");
  26.151 -
  26.152 -            if (dollar >= 0 && dot >= 0) return binaryName.substring(dot + 1, dollar).replace("$", ".");
  26.153 -            else return null;
  26.154 -        }
  26.155 -
  26.156 -        @Override
  26.157 -        public String getTypeName() {
  26.158 -            if (getOuterName() != null)
  26.159 -                return getSimpleName() + " in " + getOuterName();
  26.160 -            else
  26.161 -                return getSimpleName();
  26.162 -        }
  26.163 -
  26.164 -        @Override
  26.165 -        public String getContextName() {
  26.166 -            int dot = binaryName.lastIndexOf(".");
  26.167 -
  26.168 -            if (dot >= 0) return " (" + binaryName.substring(0, dot) + ")";
  26.169 -            else return "";
  26.170 -        }
  26.171 -
  26.172 -        @Override
  26.173 -        public Icon getIcon() {
  26.174 -            return ElementIcons.getElementIcon(ElementKind.CLASS, EnumSet.noneOf(Modifier.class));
  26.175 -        }
  26.176 -
  26.177 -        @Override
  26.178 -        public String getProjectName() {
  26.179 -            FileObject file = getFileObject();
  26.180 -
  26.181 -            if (file == null) return null;
  26.182 -
  26.183 -            Project prj = FileOwnerQuery.getOwner(file);
  26.184 -
  26.185 -            if (prj == null) return null;
  26.186 -
  26.187 -            return ProjectUtils.getInformation(prj).getDisplayName();
  26.188 -        }
  26.189 -
  26.190 -        @Override
  26.191 -        public Icon getProjectIcon() {
  26.192 -            FileObject file = getFileObject();
  26.193 -
  26.194 -            if (file == null) return null;
  26.195 -
  26.196 -            Project prj = FileOwnerQuery.getOwner(file);
  26.197 -
  26.198 -            if (prj == null) return null;
  26.199 -
  26.200 -            return ProjectUtils.getInformation(prj).getIcon();
  26.201 -        }
  26.202 -
  26.203 -        @Override
  26.204 -        public FileObject getFileObject() {
  26.205 -            FileObject f = this.file.get();
  26.206 -
  26.207 -            if (f == null) {
  26.208 -                String fqn = binaryName;
  26.209 -
  26.210 -                if (fqn.contains("$")) {
  26.211 -                    fqn = fqn.substring(0, fqn.indexOf("$"));
  26.212 -                }
  26.213 -
  26.214 -                FileObject originFolder = FileUtil.toFileObject(FileUtil.normalizeFile(new File(origin.folder)));
  26.215 -
  26.216 -                if (originFolder != null) f = originFolder.getFileObject(relativePath + "/" + fqn.replace('.', '/') + ".java");
  26.217 -                if (f != null) this.file.set(f);
  26.218 -            }
  26.219 -
  26.220 -            return f;
  26.221 -        }
  26.222 -
  26.223 -        @Override
  26.224 -        public int getOffset() {
  26.225 -            return 0;
  26.226 -        }
  26.227 -
  26.228 -        @Override
  26.229 -        public void open() {
  26.230 -            FileObject file = getFileObject();
  26.231 -
  26.232 -            if (file == null) return ; //XXX tell to the user
  26.233 -
  26.234 -            ClasspathInfo cpInfo = ClasspathInfo.create(file);
  26.235 -            ElementHandle<?> handle = ElementHandleAccessor.INSTANCE.create(ElementKind.CLASS, binaryName);
  26.236 -
  26.237 -            ElementOpen.open(cpInfo, handle);
  26.238 -        }
  26.239 -
  26.240 -    }
  26.241 -}
    27.1 --- a/cmdline/compiler/nbproject/genfiles.properties	Wed Jun 22 12:05:27 2011 +0200
    27.2 +++ b/cmdline/compiler/nbproject/genfiles.properties	Thu Jun 23 15:07:16 2011 +0200
    27.3 @@ -3,6 +3,6 @@
    27.4  build.xml.stylesheet.CRC32=79c3b980@1.33
    27.5  # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
    27.6  # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    27.7 -nbproject/build-impl.xml.data.CRC32=0275465b
    27.8 +nbproject/build-impl.xml.data.CRC32=360ca097
    27.9  nbproject/build-impl.xml.script.CRC32=64f6fe95
   27.10  nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.47
    28.1 --- a/cmdline/compiler/nbproject/project.xml	Wed Jun 22 12:05:27 2011 +0200
    28.2 +++ b/cmdline/compiler/nbproject/project.xml	Thu Jun 23 15:07:16 2011 +0200
    28.3 @@ -76,6 +76,14 @@
    28.4                      </run-dependency>
    28.5                  </dependency>
    28.6                  <dependency>
    28.7 +                    <code-name-base>org.netbeans.modules.jackpot30.remoting.api</code-name-base>
    28.8 +                    <build-prerequisite/>
    28.9 +                    <compile-dependency/>
   28.10 +                    <run-dependency>
   28.11 +                        <specification-version>1.0</specification-version>
   28.12 +                    </run-dependency>
   28.13 +                </dependency>
   28.14 +                <dependency>
   28.15                      <code-name-base>org.netbeans.modules.java.hints</code-name-base>
   28.16                      <build-prerequisite/>
   28.17                      <compile-dependency/>
   28.18 @@ -102,14 +110,6 @@
   28.19                      </run-dependency>
   28.20                  </dependency>
   28.21                  <dependency>
   28.22 -                    <code-name-base>org.netbeans.modules.jeriglib</code-name-base>
   28.23 -                    <build-prerequisite/>
   28.24 -                    <compile-dependency/>
   28.25 -                    <run-dependency>
   28.26 -                        <specification-version>1.10</specification-version>
   28.27 -                    </run-dependency>
   28.28 -                </dependency>
   28.29 -                <dependency>
   28.30                      <code-name-base>org.netbeans.modules.lexer</code-name-base>
   28.31                      <build-prerequisite/>
   28.32                      <compile-dependency/>
    29.1 --- a/cmdline/lib/nbproject/project.xml	Wed Jun 22 12:05:27 2011 +0200
    29.2 +++ b/cmdline/lib/nbproject/project.xml	Thu Jun 23 15:07:16 2011 +0200
    29.3 @@ -76,6 +76,14 @@
    29.4                      </run-dependency>
    29.5                  </dependency>
    29.6                  <dependency>
    29.7 +                    <code-name-base>org.netbeans.modules.jackpot30.remoting.api</code-name-base>
    29.8 +                    <build-prerequisite/>
    29.9 +                    <compile-dependency/>
   29.10 +                    <run-dependency>
   29.11 +                        <specification-version>1.0</specification-version>
   29.12 +                    </run-dependency>
   29.13 +                </dependency>
   29.14 +                <dependency>
   29.15                      <code-name-base>org.netbeans.modules.java.hints</code-name-base>
   29.16                      <build-prerequisite/>
   29.17                      <compile-dependency/>
   29.18 @@ -102,14 +110,6 @@
   29.19                      </run-dependency>
   29.20                  </dependency>
   29.21                  <dependency>
   29.22 -                    <code-name-base>org.netbeans.modules.jeriglib</code-name-base>
   29.23 -                    <build-prerequisite/>
   29.24 -                    <compile-dependency/>
   29.25 -                    <run-dependency>
   29.26 -                        <specification-version>1.10</specification-version>
   29.27 -                    </run-dependency>
   29.28 -                </dependency>
   29.29 -                <dependency>
   29.30                      <code-name-base>org.netbeans.modules.lexer</code-name-base>
   29.31                      <build-prerequisite/>
   29.32                      <compile-dependency/>
    30.1 --- a/cmdline/nbproject/platform.properties	Wed Jun 22 12:05:27 2011 +0200
    30.2 +++ b/cmdline/nbproject/platform.properties	Thu Jun 23 15:07:16 2011 +0200
    30.3 @@ -10,7 +10,9 @@
    30.4      ${nbplatform.active.dir}/platform:\
    30.5      ${nbplatform.active.dir}/profiler:\
    30.6      ${nbplatform.active.dir}/websvccommon:\
    30.7 -    ${nbplatform.active.dir}/extra:\
    30.8      ../build/cluster:\
    30.9 -    ../borrowedtests/build/cluster
   30.10 +    ../borrowedtests/build/cluster:\
   30.11 +    ../remoting/ide/build/cluster
   30.12 +extcluster.../remoting/ide/build/cluster.javadoc=
   30.13 +extcluster.../remoting/ide/build/cluster.sources=
   30.14  nbplatform.active=default
    31.1 --- a/hudson/trunk	Wed Jun 22 12:05:27 2011 +0200
    31.2 +++ b/hudson/trunk	Thu Jun 23 15:07:16 2011 +0200
    31.3 @@ -36,6 +36,7 @@
    31.4  }
    31.5  
    31.6  (cd borrowedtests; call_ant clean && call_ant) || exit
    31.7 +(cd remoting; ./build-indexing-backend -Dnbplatform.default.harness.dir=$PLATFORM/harness -Dnbplatform.default.netbeans.dest.dir=$PLATFORM -Dnbplatform.active.dir=$PLATFORM) || exit 1
    31.8  call_ant clean || exit
    31.9  call_ant build || exit
   31.10  #call_ant coverage-report || exit
   31.11 @@ -51,7 +52,6 @@
   31.12  
   31.13  #(cd cmdline/compiler; call_ant copy-to-hudson) || exit
   31.14  #(cd server/indexer; call_ant copy-to-hudson) || exit
   31.15 -(cd server/hudson; mvn -Dmaven.test.skip=true clean package) || exit
   31.16  (cd cmdline/tool; call_ant create-standalone-tool) || exit
   31.17  (cd cmdline/compiler; call_ant create-standalone-compiler) || exit
   31.18  
   31.19 @@ -60,4 +60,3 @@
   31.20  mkdir -p build/server
   31.21  (cp server/do-indexing server/indexer/dist; cd server/indexer/dist/; zip -r ../../../build/server/indexer.zip *)
   31.22  (cd server/web.api/dist/; zip -r ../../../build/server/web.api.zip *)
   31.23 -(cd server/backend; ./build-indexing-backend -Dnbplatform.default.harness.dir=$PLATFORM/harness -Dnbplatform.default.netbeans.dest.dir=$PLATFORM -Dnbplatform.active.dir=$PLATFORM) || exit
    32.1 --- a/libs.jerig/build.xml	Wed Jun 22 12:05:27 2011 +0200
    32.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.3 @@ -1,28 +0,0 @@
    32.4 -<?xml version="1.0" encoding="UTF-8"?>
    32.5 -<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
    32.6 -<!-- for some information on what you could do (e.g. targets to override). -->
    32.7 -<!-- If you delete this file and reopen the project it will be recreated. -->
    32.8 -<project name="org.netbeans.modules.jeriglib" default="netbeans" basedir=".">
    32.9 -    <description>Builds, tests, and runs the project org.netbeans.modules.jeriglib.</description>
   32.10 -    <import file="nbproject/build-impl.xml"/>
   32.11 -    <target name="-check-jerig-downloaded">
   32.12 -        <available file="external/jerig-36929ddc99ff.zip" property="jerig.downloaded"/>
   32.13 -    </target>
   32.14 -    <target name="-download-jerig" depends="-check-jerig-downloaded" unless="jerig.downloaded">
   32.15 -        <mkdir dir="external" />
   32.16 -        <get src="http://kenai.com/projects/jackpot30/downloads/download/external/jerig-36929ddc99ff.zip" dest="external/jerig-36929ddc99ff.zip" usetimestamp="true"/>
   32.17 -    </target>
   32.18 -    
   32.19 -    <target name="files-init" depends="projectized-common.files-init,-download-jerig">
   32.20 -        <unzip src="external/jerig-36929ddc99ff.zip" dest="external" overwrite="false" />
   32.21 -        <mkdir dir="${cluster}/modules/ext" />
   32.22 -        <copy  todir="${cluster}/modules/ext">
   32.23 -            <fileset dir="external" includes="*.jar" />
   32.24 -        </copy>
   32.25 -    </target>
   32.26 -
   32.27 -    <target name="test" />
   32.28 -    <target name="test-coverage" />
   32.29 -    <target name="coverage-report" />
   32.30 -    <target name="findbugs" />
   32.31 -</project>
    33.1 --- a/libs.jerig/jerig-license.txt	Wed Jun 22 12:05:27 2011 +0200
    33.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.3 @@ -1,826 +0,0 @@
    33.4 -COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
    33.5 -
    33.6 -1. Definitions.
    33.7 -
    33.8 -1.1. "Contributor" means each individual or entity that
    33.9 -creates or contributes to the creation of Modifications.
   33.10 -
   33.11 -1.2. "Contributor Version" means the combination of the
   33.12 -Original Software, prior Modifications used by a
   33.13 -Contributor (if any), and the Modifications made by that
   33.14 -particular Contributor.
   33.15 -
   33.16 -1.3. "Covered Software" means (a) the Original Software, or
   33.17 -(b) Modifications, or (c) the combination of files
   33.18 -containing Original Software with files containing
   33.19 -Modifications, in each case including portions thereof.
   33.20 -
   33.21 -1.4. "Executable" means the Covered Software in any form
   33.22 -other than Source Code.
   33.23 -
   33.24 -1.5. "Initial Developer" means the individual or entity
   33.25 -that first makes Original Software available under this
   33.26 -License.
   33.27 -
   33.28 -1.6. "Larger Work" means a work which combines Covered
   33.29 -Software or portions thereof with code not governed by the
   33.30 -terms of this License.
   33.31 -
   33.32 -1.7. "License" means this document.
   33.33 -
   33.34 -1.8. "Licensable" means having the right to grant, to the
   33.35 -maximum extent possible, whether at the time of the initial
   33.36 -grant or subsequently acquired, any and all of the rights
   33.37 -conveyed herein.
   33.38 -
   33.39 -1.9. "Modifications" means the Source Code and Executable
   33.40 -form of any of the following:
   33.41 -
   33.42 -A. Any file that results from an addition to,
   33.43 -deletion from or modification of the contents of a
   33.44 -file containing Original Software or previous
   33.45 -Modifications;
   33.46 -
   33.47 -B. Any new file that contains any part of the
   33.48 -Original Software or previous Modification; or
   33.49 -
   33.50 -C. Any new file that is contributed or otherwise made
   33.51 -available under the terms of this License.
   33.52 -
   33.53 -1.10. "Original Software" means the Source Code and
   33.54 -Executable form of computer software code that is
   33.55 -originally released under this License.
   33.56 -
   33.57 -1.11. "Patent Claims" means any patent claim(s), now owned
   33.58 -or hereafter acquired, including without limitation,
   33.59 -method, process, and apparatus claims, in any patent
   33.60 -Licensable by grantor.
   33.61 -
   33.62 -1.12. "Source Code" means (a) the common form of computer
   33.63 -software code in which modifications are made and (b)
   33.64 -associated documentation included in or with such code.
   33.65 -
   33.66 -1.13. "You" (or "Your") means an individual or a legal
   33.67 -entity exercising rights under, and complying with all of
   33.68 -the terms of, this License. For legal entities, "You"
   33.69 -includes any entity which controls, is controlled by, or is
   33.70 -under common control with You. For purposes of this
   33.71 -definition, "control" means (a) the power, direct or
   33.72 -indirect, to cause the direction or management of such
   33.73 -entity, whether by contract or otherwise, or (b) ownership
   33.74 -of more than fifty percent (50%) of the outstanding shares
   33.75 -or beneficial ownership of such entity.
   33.76 -
   33.77 -2. License Grants.
   33.78 -
   33.79 -2.1. The Initial Developer Grant.
   33.80 -
   33.81 -Conditioned upon Your compliance with Section 3.1 below and
   33.82 -subject to third party intellectual property claims, the
   33.83 -Initial Developer hereby grants You a world-wide,
   33.84 -royalty-free, non-exclusive license:
   33.85 -
   33.86 -(a) under intellectual property rights (other than
   33.87 -patent or trademark) Licensable by Initial Developer,
   33.88 -to use, reproduce, modify, display, perform,
   33.89 -sublicense and distribute the Original Software (or
   33.90 -portions thereof), with or without Modifications,
   33.91 -and/or as part of a Larger Work; and
   33.92 -
   33.93 -(b) under Patent Claims infringed by the making,
   33.94 -using or selling of Original Software, to make, have
   33.95 -made, use, practice, sell, and offer for sale, and/or
   33.96 -otherwise dispose of the Original Software (or
   33.97 -portions thereof).
   33.98 -
   33.99 -(c) The licenses granted in Sections 2.1(a) and (b)
  33.100 -are effective on the date Initial Developer first
  33.101 -distributes or otherwise makes the Original Software
  33.102 -available to a third party under the terms of this
  33.103 -License.
  33.104 -
  33.105 -(d) Notwithstanding Section 2.1(b) above, no patent
  33.106 -license is granted: (1) for code that You delete from
  33.107 -the Original Software, or (2) for infringements
  33.108 -caused by: (i) the modification of the Original
  33.109 -Software, or (ii) the combination of the Original
  33.110 -Software with other software or devices.
  33.111 -
  33.112 -2.2. Contributor Grant.
  33.113 -
  33.114 -Conditioned upon Your compliance with Section 3.1 below and
  33.115 -subject to third party intellectual property claims, each
  33.116 -Contributor hereby grants You a world-wide, royalty-free,
  33.117 -non-exclusive license:
  33.118 -
  33.119 -(a) under intellectual property rights (other than
  33.120 -patent or trademark) Licensable by Contributor to
  33.121 -use, reproduce, modify, display, perform, sublicense
  33.122 -and distribute the Modifications created by such
  33.123 -Contributor (or portions thereof), either on an
  33.124 -unmodified basis, with other Modifications, as
  33.125 -Covered Software and/or as part of a Larger Work; and
  33.126 -
  33.127 -(b) under Patent Claims infringed by the making,
  33.128 -using, or selling of Modifications made by that
  33.129 -Contributor either alone and/or in combination with
  33.130 -its Contributor Version (or portions of such
  33.131 -combination), to make, use, sell, offer for sale,
  33.132 -have made, and/or otherwise dispose of: (1)
  33.133 -Modifications made by that Contributor (or portions
  33.134 -thereof); and (2) the combination of Modifications
  33.135 -made by that Contributor with its Contributor Version
  33.136 -(or portions of such combination).
  33.137 -
  33.138 -(c) The licenses granted in Sections 2.2(a) and
  33.139 -2.2(b) are effective on the date Contributor first
  33.140 -distributes or otherwise makes the Modifications
  33.141 -available to a third party.
  33.142 -
  33.143 -(d) Notwithstanding Section 2.2(b) above, no patent
  33.144 -license is granted: (1) for any code that Contributor
  33.145 -has deleted from the Contributor Version; (2) for
  33.146 -infringements caused by: (i) third party
  33.147 -modifications of Contributor Version, or (ii) the
  33.148 -combination of Modifications made by that Contributor
  33.149 -with other software (except as part of the
  33.150 -Contributor Version) or other devices; or (3) under
  33.151 -Patent Claims infringed by Covered Software in the
  33.152 -absence of Modifications made by that Contributor.
  33.153 -
  33.154 -3. Distribution Obligations.
  33.155 -
  33.156 -3.1. Availability of Source Code.
  33.157 -
  33.158 -Any Covered Software that You distribute or otherwise make
  33.159 -available in Executable form must also be made available in
  33.160 -Source Code form and that Source Code form must be
  33.161 -distributed only under the terms of this License. You must
  33.162 -include a copy of this License with every copy of the
  33.163 -Source Code form of the Covered Software You distribute or
  33.164 -otherwise make available. You must inform recipients of any
  33.165 -such Covered Software in Executable form as to how they can
  33.166 -obtain such Covered Software in Source Code form in a
  33.167 -reasonable manner on or through a medium customarily used
  33.168 -for software exchange.
  33.169 -
  33.170 -3.2. Modifications.
  33.171 -
  33.172 -The Modifications that You create or to which You
  33.173 -contribute are governed by the terms of this License. You
  33.174 -represent that You believe Your Modifications are Your
  33.175 -original creation(s) and/or You have sufficient rights to
  33.176 -grant the rights conveyed by this License.
  33.177 -
  33.178 -3.3. Required Notices.
  33.179 -
  33.180 -You must include a notice in each of Your Modifications
  33.181 -that identifies You as the Contributor of the Modification.
  33.182 -You may not remove or alter any copyright, patent or
  33.183 -trademark notices contained within the Covered Software, or
  33.184 -any notices of licensing or any descriptive text giving
  33.185 -attribution to any Contributor or the Initial Developer.
  33.186 -
  33.187 -3.4. Application of Additional Terms.
  33.188 -
  33.189 -You may not offer or impose any terms on any Covered
  33.190 -Software in Source Code form that alters or restricts the
  33.191 -applicable version of this License or the recipients'
  33.192 -rights hereunder. You may choose to offer, and to charge a
  33.193 -fee for, warranty, support, indemnity or liability
  33.194 -obligations to one or more recipients of Covered Software.
  33.195 -However, you may do so only on Your own behalf, and not on
  33.196 -behalf of the Initial Developer or any Contributor. You
  33.197 -must make it absolutely clear that any such warranty,
  33.198 -support, indemnity or liability obligation is offered by
  33.199 -You alone, and You hereby agree to indemnify the Initial
  33.200 -Developer and every Contributor for any liability incurred
  33.201 -by the Initial Developer or such Contributor as a result of
  33.202 -warranty, support, indemnity or liability terms You offer.
  33.203 -
  33.204 -3.5. Distribution of Executable Versions.
  33.205 -
  33.206 -You may distribute the Executable form of the Covered
  33.207 -Software under the terms of this License or under the terms
  33.208 -of a license of Your choice, which may contain terms
  33.209 -different from this License, provided that You are in
  33.210 -compliance with the terms of this License and that the
  33.211 -license for the Executable form does not attempt to limit
  33.212 -or alter the recipient's rights in the Source Code form
  33.213 -from the rights set forth in this License. If You
  33.214 -distribute the Covered Software in Executable form under a
  33.215 -different license, You must make it absolutely clear that
  33.216 -any terms which differ from this License are offered by You
  33.217 -alone, not by the Initial Developer or Contributor. You
  33.218 -hereby agree to indemnify the Initial Developer and every
  33.219 -Contributor for any liability incurred by the Initial
  33.220 -Developer or such Contributor as a result of any such terms
  33.221 -You offer.
  33.222 -
  33.223 -3.6. Larger Works.
  33.224 -
  33.225 -You may create a Larger Work by combining Covered Software
  33.226 -with other code not governed by the terms of this License
  33.227 -and distribute the Larger Work as a single product. In such
  33.228 -a case, You must make sure the requirements of this License
  33.229 -are fulfilled for the Covered Software.
  33.230 -
  33.231 -4. Versions of the License.
  33.232 -
  33.233 -4.1. New Versions.
  33.234 -
  33.235 -Sun Microsystems, Inc. is the initial license steward and
  33.236 -may publish revised and/or new versions of this License
  33.237 -from time to time. Each version will be given a
  33.238 -distinguishing version number. Except as provided in
  33.239 -Section 4.3, no one other than the license steward has the
  33.240 -right to modify this License.
  33.241 -
  33.242 -4.2. Effect of New Versions.
  33.243 -
  33.244 -You may always continue to use, distribute or otherwise
  33.245 -make the Covered Software available under the terms of the
  33.246 -version of the License under which You originally received
  33.247 -the Covered Software. If the Initial Developer includes a
  33.248 -notice in the Original Software prohibiting it from being
  33.249 -distributed or otherwise made available under any
  33.250 -subsequent version of the License, You must distribute and
  33.251 -make the Covered Software available under the terms of the
  33.252 -version of the License under which You originally received
  33.253 -the Covered Software. Otherwise, You may also choose to
  33.254 -use, distribute or otherwise make the Covered Software
  33.255 -available under the terms of any subsequent version of the
  33.256 -License published by the license steward.
  33.257 -
  33.258 -4.3. Modified Versions.
  33.259 -
  33.260 -When You are an Initial Developer and You want to create a
  33.261 -new license for Your Original Software, You may create and
  33.262 -use a modified version of this License if You: (a) rename
  33.263 -the license and remove any references to the name of the
  33.264 -license steward (except to note that the license differs
  33.265 -from this License); and (b) otherwise make it clear that
  33.266 -the license contains terms which differ from this License.
  33.267 -
  33.268 -5. DISCLAIMER OF WARRANTY.
  33.269 -
  33.270 -COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS"
  33.271 -BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
  33.272 -INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED
  33.273 -SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR
  33.274 -PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND
  33.275 -PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY
  33.276 -COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE
  33.277 -INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF
  33.278 -ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF
  33.279 -WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
  33.280 -ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
  33.281 -DISCLAIMER.
  33.282 -
  33.283 -6. TERMINATION.
  33.284 -
  33.285 -6.1. This License and the rights granted hereunder will
  33.286 -terminate automatically if You fail to comply with terms
  33.287 -herein and fail to cure such breach within 30 days of
  33.288 -becoming aware of the breach. Provisions which, by their
  33.289 -nature, must remain in effect beyond the termination of
  33.290 -this License shall survive.
  33.291 -
  33.292 -6.2. If You assert a patent infringement claim (excluding
  33.293 -declaratory judgment actions) against Initial Developer or
  33.294 -a Contributor (the Initial Developer or Contributor against
  33.295 -whom You assert such claim is referred to as "Participant")
  33.296 -alleging that the Participant Software (meaning the
  33.297 -Contributor Version where the Participant is a Contributor
  33.298 -or the Original Software where the Participant is the
  33.299 -Initial Developer) directly or indirectly infringes any
  33.300 -patent, then any and all rights granted directly or
  33.301 -indirectly to You by such Participant, the Initial
  33.302 -Developer (if the Initial Developer is not the Participant)
  33.303 -and all Contributors under Sections 2.1 and/or 2.2 of this
  33.304 -License shall, upon 60 days notice from Participant
  33.305 -terminate prospectively and automatically at the expiration
  33.306 -of such 60 day notice period, unless if within such 60 day
  33.307 -period You withdraw Your claim with respect to the
  33.308 -Participant Software against such Participant either
  33.309 -unilaterally or pursuant to a written agreement with
  33.310 -Participant.
  33.311 -
  33.312 -6.3. If You assert a patent infringement claim against
  33.313 -Participant alleging that the Participant Software directly
  33.314 -or indirectly infringes any patent where such claim is
  33.315 -resolved (such as by license or settlement) prior to the
  33.316 -initiation of patent infringement litigation, then the
  33.317 -reasonable value of the licenses granted by such Participant
  33.318 -under Sections 2.1 or 2.2 shall be taken into account in
  33.319 -determining the amount or value of any payment or license.
  33.320 -
  33.321 -6.4. In the event of termination under Sections 6.1 or 6.2
  33.322 -above, all end user licenses that have been validly granted
  33.323 -by You or any distributor hereunder prior to termination
  33.324 -(excluding licenses granted to You by any distributor)
  33.325 -shall survive termination.
  33.326 -
  33.327 -7. LIMITATION OF LIABILITY.
  33.328 -
  33.329 -UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
  33.330 -(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE
  33.331 -INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF
  33.332 -COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE
  33.333 -LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR
  33.334 -CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
  33.335 -LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK
  33.336 -STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
  33.337 -COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
  33.338 -INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
  33.339 -LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL
  33.340 -INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT
  33.341 -APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO
  33.342 -NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR
  33.343 -CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT
  33.344 -APPLY TO YOU.
  33.345 -
  33.346 -8. U.S. GOVERNMENT END USERS.
  33.347 -
  33.348 -The Covered Software is a "commercial item," as that term is
  33.349 -defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial
  33.350 -computer software" (as that term is defined at 48 C.F.R.
  33.351 -§ 252.227-7014(a)(1)) and "commercial computer software
  33.352 -documentation" as such terms are used in 48 C.F.R. 12.212 (Sept.
  33.353 -1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1
  33.354 -through 227.7202-4 (June 1995), all U.S. Government End Users
  33.355 -acquire Covered Software with only those rights set forth herein.
  33.356 -This U.S. Government Rights clause is in lieu of, and supersedes,
  33.357 -any other FAR, DFAR, or other clause or provision that addresses
  33.358 -Government rights in computer software under this License.
  33.359 -
  33.360 -9. MISCELLANEOUS.
  33.361 -
  33.362 -This License represents the complete agreement concerning subject
  33.363 -matter hereof. If any provision of this License is held to be
  33.364 -unenforceable, such provision shall be reformed only to the
  33.365 -extent necessary to make it enforceable. This License shall be
  33.366 -governed by the law of the jurisdiction specified in a notice
  33.367 -contained within the Original Software (except to the extent
  33.368 -applicable law, if any, provides otherwise), excluding such
  33.369 -jurisdiction's conflict-of-law provisions. Any litigation
  33.370 -relating to this License shall be subject to the jurisdiction of
  33.371 -the courts located in the jurisdiction and venue specified in a
  33.372 -notice contained within the Original Software, with the losing
  33.373 -party responsible for costs, including, without limitation, court
  33.374 -costs and reasonable attorneys' fees and expenses. The
  33.375 -application of the United Nations Convention on Contracts for the
  33.376 -International Sale of Goods is expressly excluded. Any law or
  33.377 -regulation which provides that the language of a contract shall
  33.378 -be construed against the drafter shall not apply to this License.
  33.379 -You agree that You alone are responsible for compliance with the
  33.380 -United States export administration regulations (and the export
  33.381 -control laws and regulation of any other countries) when You use,
  33.382 -distribute or otherwise make available any Covered Software.
  33.383 -
  33.384 -10. RESPONSIBILITY FOR CLAIMS.
  33.385 -
  33.386 -As between Initial Developer and the Contributors, each party is
  33.387 -responsible for claims and damages arising, directly or
  33.388 -indirectly, out of its utilization of rights under this License
  33.389 -and You agree to work with Initial Developer and Contributors to
  33.390 -distribute such responsibility on an equitable basis. Nothing
  33.391 -herein is intended or shall be deemed to constitute any admission
  33.392 -of liability.
  33.393 -
  33.394 -NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND
  33.395 -DISTRIBUTION LICENSE (CDDL)
  33.396 -
  33.397 -The code released under the CDDL shall be governed by the laws
  33.398 -of the State of California (excluding conflict-of-law provisions).
  33.399 -Any litigation relating to this License shall be subject to the
  33.400 -jurisdiction of the Federal Courts of the Northern District of
  33.401 -California and the state courts of the State of California, with
  33.402 -venue lying in Santa Clara County, California.
  33.403 -
  33.404 -
  33.405 -The GNU General Public License (GPL)
  33.406 -Version 2, June 1991
  33.407 -
  33.408 - Copyright (C) 1989, 1991 Free Software Foundation, Inc.
  33.409 - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  33.410 - Everyone is permitted to copy and distribute verbatim
  33.411 - copies of this license document, but changing it is not
  33.412 - allowed.
  33.413 -
  33.414 -                      Preamble
  33.415 -
  33.416 -The licenses for most software are designed to take away
  33.417 -your freedom to share and change it. By contrast, the GNU
  33.418 -General Public License is intended to guarantee your freedom
  33.419 -to share and change free software--to make sure the software
  33.420 -is free for all its users. This General Public License
  33.421 -applies to most of the Free Software Foundation's software
  33.422 -and to any other program whose authors commit to using it.
  33.423 -(Some other Free Software Foundation software is covered by
  33.424 -the GNU Library General Public License instead.) You can
  33.425 -apply it to your programs, too.
  33.426 -
  33.427 -When we speak of free software, we are referring to freedom,
  33.428 -not price. Our General Public Licenses are designed to make
  33.429 -sure that you have the freedom to distribute copies of free
  33.430 -software (and charge for this service if you wish), that you
  33.431 -receive source code or can get it if you want it, that you
  33.432 -can change the software or use pieces of it in new free
  33.433 -programs; and that you know you can do these things.
  33.434 -
  33.435 -To protect your rights, we need to make restrictions that
  33.436 -forbid anyone to deny you these rights or to ask you to
  33.437 -surrender the rights. These restrictions translate to
  33.438 -certain responsibilities for you if you distribute copies of
  33.439 -the software, or if you modify it.
  33.440 -
  33.441 -For example, if you distribute copies of such a program,
  33.442 -whether gratis or for a fee, you must give the recipients
  33.443 -all the rights that you have. You must make sure that they,
  33.444 -too, receive or can get the source code. And you must show
  33.445 -them these terms so they know their rights.
  33.446 -
  33.447 -We protect your rights with two steps: (1) copyright the
  33.448 -software, and (2) offer you this license which gives you
  33.449 -legal permission to copy, distribute and/or modify the
  33.450 -software.
  33.451 -
  33.452 -Also, for each author's protection and ours, we want to make
  33.453 -certain that everyone understands that there is no warranty
  33.454 -for this free software. If the software is modified by
  33.455 -someone else and passed on, we want its recipients to know
  33.456 -that what they have is not the original, so that any
  33.457 -problems introduced by others will not reflect on the
  33.458 -original authors' reputations.
  33.459 -
  33.460 -Finally, any free program is threatened constantly by
  33.461 -software patents. We wish to avoid the danger that
  33.462 -redistributors of a free program will individually obtain
  33.463 -patent licenses, in effect making the program proprietary.
  33.464 -To prevent this, we have made it clear that any patent must
  33.465 -be licensed for everyone's free use or not licensed at all.
  33.466 -
  33.467 -The precise terms and conditions for copying, distribution
  33.468 -and modification follow.
  33.469 -
  33.470 -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND
  33.471 -MODIFICATION
  33.472 -
  33.473 -0. This License applies to any program or other work which
  33.474 -contains a notice placed by the copyright holder saying it
  33.475 -may be distributed under the terms of this General Public
  33.476 -License. The "Program", below, refers to any such program or
  33.477 -work, and a "work based on the Program" means either the
  33.478 -Program or any derivative work under copyright law: that is
  33.479 -to say, a work containing the Program or a portion of it,
  33.480 -either verbatim or with modifications and/or translated into
  33.481 -another language. (Hereinafter, translation is included
  33.482 -without limitation in the term "modification".) Each
  33.483 -licensee is addressed as "you".
  33.484 -
  33.485 -Activities other than copying, distribution and modification
  33.486 -are not covered by this License; they are outside its scope.
  33.487 -The act of running the Program is not restricted, and the
  33.488 -output from the Program is covered only if its contents
  33.489 -constitute a work based on the Program (independent of
  33.490 -having been made by running the Program). Whether that is
  33.491 -true depends on what the Program does.
  33.492 -
  33.493 -1. You may copy and distribute verbatim copies of the
  33.494 -Program's source code as you receive it, in any medium,
  33.495 -provided that you conspicuously and appropriately publish on
  33.496 -each copy an appropriate copyright notice and disclaimer of
  33.497 -warranty; keep intact all the notices that refer to this
  33.498 -License and to the absence of any warranty; and give any
  33.499 -other recipients of the Program a copy of this License along
  33.500 -with the Program.
  33.501 -
  33.502 -You may charge a fee for the physical act of transferring a
  33.503 -copy, and you may at your option offer warranty protection
  33.504 -in exchange for a fee.
  33.505 -
  33.506 -2. You may modify your copy or copies of the Program or any
  33.507 -portion of it, thus forming a work based on the Program, and
  33.508 -copy and distribute such modifications or work under the
  33.509 -terms of Section 1 above, provided that you also meet all of
  33.510 -these conditions:
  33.511 -
  33.512 -    a) You must cause the modified files to carry prominent
  33.513 -    notices stating that you changed the files and the date
  33.514 -    of any change.
  33.515 -
  33.516 -    b) You must cause any work that you distribute or
  33.517 -    publish, that in whole or in part contains or is derived
  33.518 -    from the Program or any part thereof, to be licensed as
  33.519 -    a whole at no charge to all third parties under the
  33.520 -    terms of this License.
  33.521 -
  33.522 -    c) If the modified program normally reads commands
  33.523 -    interactively when run, you must cause it, when started
  33.524 -    running for such interactive use in the most ordinary
  33.525 -    way, to print or display an announcement including an
  33.526 -    appropriate copyright notice and a notice that there is
  33.527 -    no warranty (or else, saying that you provide a
  33.528 -    warranty) and that users may redistribute the program
  33.529 -    under these conditions, and telling the user how to view
  33.530 -    a copy of this License. (Exception: if the Program
  33.531 -    itself is interactive but does not normally print such
  33.532 -    an announcement, your work based on the Program is not
  33.533 -    required to print an announcement.)
  33.534 -
  33.535 -These requirements apply to the modified work as a whole. If
  33.536 -identifiable sections of that work are not derived from the
  33.537 -Program, and can be reasonably considered independent and
  33.538 -separate works in themselves, then this License, and its
  33.539 -terms, do not apply to those sections when you distribute
  33.540 -them as separate works. But when you distribute the same
  33.541 -sections as part of a whole which is a work based on the
  33.542 -Program, the distribution of the whole must be on the terms
  33.543 -of this License, whose permissions for other licensees
  33.544 -extend to the entire whole, and thus to each and every part
  33.545 -regardless of who wrote it.
  33.546 -
  33.547 -Thus, it is not the intent of this section to claim rights
  33.548 -or contest your rights to work written entirely by you;
  33.549 -rather, the intent is to exercise the right to control the
  33.550 -distribution of derivative or collective works based on the
  33.551 -Program.
  33.552 -
  33.553 -In addition, mere aggregation of another work not based on
  33.554 -the Program with the Program (or with a work based on the
  33.555 -Program) on a volume of a storage or distribution medium
  33.556 -does not bring the other work under the scope of this
  33.557 -License.
  33.558 -
  33.559 -3. You may copy and distribute the Program (or a work based
  33.560 -on it, under Section 2) in object code or executable form
  33.561 -under the terms of Sections 1 and 2 above provided that you
  33.562 -also do one of the following:
  33.563 -
  33.564 -    a) Accompany it with the complete corresponding
  33.565 -    machine-readable source code, which must be distributed
  33.566 -    under the terms of Sections 1 and 2 above on a medium
  33.567 -    customarily used for software interchange; or,
  33.568 -
  33.569 -    b) Accompany it with a written offer, valid for at least
  33.570 -    three years, to give any third party, for a charge no
  33.571 -    more than your cost of physically performing source
  33.572 -    distribution, a complete machine-readable copy of the
  33.573 -    corresponding source code, to be distributed under the
  33.574 -    terms of Sections 1 and 2 above on a medium customarily
  33.575 -    used for software interchange; or,
  33.576 -
  33.577 -    c) Accompany it with the information you received as to
  33.578 -    the offer to distribute corresponding source code. (This
  33.579 -    alternative is allowed only for noncommercial
  33.580 -    distribution and only if you received the program in
  33.581 -    object code or executable form with such an offer, in
  33.582 -    accord with Subsection b above.)
  33.583 -
  33.584 -The source code for a work means the preferred form of the
  33.585 -work for making modifications to it. For an executable work,
  33.586 -complete source code means all the source code for all
  33.587 -modules it contains, plus any associated interface
  33.588 -definition files, plus the scripts used to control
  33.589 -compilation and installation of the executable. However, as
  33.590 -a special exception, the source code distributed need not
  33.591 -include anything that is normally distributed (in either
  33.592 -source or binary form) with the major components (compiler,
  33.593 -kernel, and so on) of the operating system on which the
  33.594 -executable runs, unless that component itself accompanies
  33.595 -the executable.
  33.596 -
  33.597 -If distribution of executable or object code is made by
  33.598 -offering access to copy from a designated place, then
  33.599 -offering equivalent access to copy the source code from the
  33.600 -same place counts as distribution of the source code, even
  33.601 -though third parties are not compelled to copy the source
  33.602 -along with the object code.
  33.603 -
  33.604 -4. You may not copy, modify, sublicense, or distribute the
  33.605 -Program except as expressly provided under this License. Any
  33.606 -attempt otherwise to copy, modify, sublicense or distribute
  33.607 -the Program is void, and will automatically terminate your
  33.608 -rights under this License. However, parties who have
  33.609 -received copies, or rights, from you under this License will
  33.610 -not have their licenses terminated so long as such parties
  33.611 -remain in full compliance.
  33.612 -
  33.613 -5. You are not required to accept this License, since you
  33.614 -have not signed it. However, nothing else grants you
  33.615 -permission to modify or distribute the Program or its
  33.616 -derivative works. These actions are prohibited by law if you
  33.617 -do not accept this License. Therefore, by modifying or
  33.618 -distributing the Program (or any work based on the Program),
  33.619 -you indicate your acceptance of this License to do so, and
  33.620 -all its terms and conditions for copying, distributing or
  33.621 -modifying the Program or works based on it.
  33.622 -
  33.623 -6. Each time you redistribute the Program (or any work based
  33.624 -on the Program), the recipient automatically receives a
  33.625 -license from the original licensor to copy, distribute or
  33.626 -modify the Program subject to these terms and conditions.
  33.627 -You may not impose any further restrictions on the
  33.628 -recipients' exercise of the rights granted herein. You are
  33.629 -not responsible for enforcing compliance by third parties to
  33.630 -this License.
  33.631 -
  33.632 -7. If, as a consequence of a court judgment or allegation of
  33.633 -patent infringement or for any other reason (not limited to
  33.634 -patent issues), conditions are imposed on you (whether by
  33.635 -court order, agreement or otherwise) that contradict the
  33.636 -conditions of this License, they do not excuse you from the
  33.637 -conditions of this License. If you cannot distribute so as
  33.638 -to satisfy simultaneously your obligations under this
  33.639 -License and any other pertinent obligations, then as a
  33.640 -consequence you may not distribute the Program at all. For
  33.641 -example, if a patent license would not permit royalty-free
  33.642 -redistribution of the Program by all those who receive
  33.643 -copies directly or indirectly through you, then the only way
  33.644 -you could satisfy both it and this License would be to
  33.645 -refrain entirely from distribution of the Program.
  33.646 -
  33.647 -If any portion of this section is held invalid or
  33.648 -unenforceable under any particular circumstance, the balance
  33.649 -of the section is intended to apply and the section as a
  33.650 -whole is intended to apply in other circumstances.
  33.651 -
  33.652 -It is not the purpose of this section to induce you to
  33.653 -infringe any patents or other property right claims or to
  33.654 -contest validity of any such claims; this section has the
  33.655 -sole purpose of protecting the integrity of the free
  33.656 -software distribution system, which is implemented by public
  33.657 -license practices. Many people have made generous
  33.658 -contributions to the wide range of software distributed
  33.659 -through that system in reliance on consistent application of
  33.660 -that system; it is up to the author/donor to decide if he or
  33.661 -she is willing to distribute software through any other
  33.662 -system and a licensee cannot impose that choice.
  33.663 -
  33.664 -This section is intended to make thoroughly clear what is
  33.665 -believed to be a consequence of the rest of this License.
  33.666 -
  33.667 -8. If the distribution and/or use of the Program is
  33.668 -restricted in certain countries either by patents or by
  33.669 -copyrighted interfaces, the original copyright holder who
  33.670 -places the Program under this License may add an explicit
  33.671 -geographical distribution limitation excluding those
  33.672 -countries, so that distribution is permitted only in or
  33.673 -among countries not thus excluded. In such case, this
  33.674 -License incorporates the limitation as if written in the
  33.675 -body of this License.
  33.676 -
  33.677 -9. The Free Software Foundation may publish revised and/or
  33.678 -new versions of the General Public License from time to
  33.679 -time. Such new versions will be similar in spirit to the
  33.680 -present version, but may differ in detail to address new
  33.681 -problems or concerns.
  33.682 -
  33.683 -Each version is given a distinguishing version number. If
  33.684 -the Program specifies a version number of this License which
  33.685 -applies to it and "any later version", you have the option
  33.686 -of following the terms and conditions either of that version
  33.687 -or of any later version published by the Free Software
  33.688 -Foundation. If the Program does not specify a version number
  33.689 -of this License, you may choose any version ever published
  33.690 -by the Free Software Foundation.
  33.691 -
  33.692 -10. If you wish to incorporate parts of the Program into
  33.693 -other free programs whose distribution conditions are
  33.694 -different, write to the author to ask for permission. For
  33.695 -software which is copyrighted by the Free Software
  33.696 -Foundation, write to the Free Software Foundation; we
  33.697 -sometimes make exceptions for this. Our decision will be
  33.698 -guided by the two goals of preserving the free status of all
  33.699 -derivatives of our free software and of promoting the
  33.700 -sharing and reuse of software generally.
  33.701 -
  33.702 -NO WARRANTY
  33.703 -
  33.704 -11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS
  33.705 -NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
  33.706 -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
  33.707 -COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM
  33.708 -"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
  33.709 -IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  33.710 -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  33.711 -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
  33.712 -OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
  33.713 -DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
  33.714 -REPAIR OR CORRECTION.
  33.715 -
  33.716 -12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
  33.717 -TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY
  33.718 -WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED
  33.719 -ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
  33.720 -SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF
  33.721 -THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT
  33.722 -LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
  33.723 -LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
  33.724 -PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
  33.725 -HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
  33.726 -SUCH DAMAGES.
  33.727 -
  33.728 -              END OF TERMS AND CONDITIONS
  33.729 -
  33.730 -       How to Apply These Terms to Your New Programs
  33.731 -
  33.732 -If you develop a new program, and you want it to be of the
  33.733 -greatest possible use to the public, the best way to achieve
  33.734 -this is to make it free software which everyone can
  33.735 -redistribute and change under these terms.
  33.736 -
  33.737 -To do so, attach the following notices to the program. It is
  33.738 -safest to attach them to the start of each source file to
  33.739 -most effectively convey the exclusion of warranty; and each
  33.740 -file should have at least the "copyright" line and a pointer
  33.741 -to where the full notice is found.
  33.742 -
  33.743 -    One line to give the program's name and a brief idea of
  33.744 -    what it does. Copyright (C) <year> <name of author>
  33.745 -
  33.746 -    This program is free software; you can redistribute it
  33.747 -    and/or modify it under the terms of the GNU General
  33.748 -    Public License as published by the Free Software
  33.749 -    Foundation; either version 2 of the License, or (at your
  33.750 -    option) any later version.
  33.751 -
  33.752 -    This program is distributed in the hope that it will be
  33.753 -    useful, but WITHOUT ANY WARRANTY; without even the
  33.754 -    implied warranty of MERCHANTABILITY or FITNESS FOR A
  33.755 -    PARTICULAR PURPOSE. See the GNU General Public License
  33.756 -    for more details.
  33.757 -
  33.758 -    You should have received a copy of the GNU General
  33.759 -    Public License along with this program; if not, write to
  33.760 -    the Free Software Foundation, Inc., 59 Temple Place,
  33.761 -    Suite 330, Boston, MA 02111-1307 USA
  33.762 -
  33.763 -Also add information on how to contact you by electronic and
  33.764 -paper mail.
  33.765 -
  33.766 -If the program is interactive, make it output a short notice
  33.767 -like this when it starts in an interactive mode:
  33.768 -
  33.769 -    Gnomovision version 69, Copyright (C) year name of
  33.770 -    author Gnomovision comes with ABSOLUTELY NO WARRANTY;
  33.771 -    for details type `show w'. This is free software, and
  33.772 -    you are welcome to redistribute it under certain
  33.773 -    conditions; type `show c' for details.
  33.774 -
  33.775 -The hypothetical commands `show w' and `show c' should show
  33.776 -the appropriate parts of the General Public License. Of
  33.777 -course, the commands you use may be called something other
  33.778 -than `show w' and `show c'; they could even be mouse-clicks
  33.779 -or menu items--whatever suits your program.
  33.780 -
  33.781 -You should also get your employer (if you work as a
  33.782 -programmer) or your school, if any, to sign a "copyright
  33.783 -disclaimer" for the program, if necessary. Here is a sample;
  33.784 -alter the names:
  33.785 -
  33.786 -  Yoyodyne, Inc., hereby disclaims all copyright interest in
  33.787 -  the program `Gnomovision' (which makes passes at
  33.788 -  compilers) written by James Hacker.
  33.789 -
  33.790 -  signature of Ty Coon, 1 April 1989
  33.791 -  Ty Coon, President of Vice
  33.792 -
  33.793 -This General Public License does not permit incorporating
  33.794 -your program into proprietary programs. If your program is a
  33.795 -subroutine library, you may consider it more useful to
  33.796 -permit linking proprietary applications with the library. If
  33.797 -this is what you want to do, use the GNU Library General
  33.798 -Public License instead of this License.
  33.799 -
  33.800 -
  33.801 -"CLASSPATH" EXCEPTION TO THE GPL VERSION 2
  33.802 -
  33.803 -
  33.804 -Certain source files distributed by Sun Microsystems, Inc.
  33.805 -are subject to the following clarification and special
  33.806 -exception to the GPL Version 2, but only where Sun has expressly
  33.807 -included in the particular source file's header the words
  33.808 -"Sun designates this particular file as subject to the
  33.809 -"Classpath" exception as provided by Sun in the License file
  33.810 -that accompanied this code."
  33.811 -
  33.812 -Linking this library statically or dynamically with other
  33.813 -modules is making a combined work based on this library.
  33.814 -Thus, the terms and conditions of the GNU General Public
  33.815 -License Version 2 cover the whole combination.
  33.816 -
  33.817 -As a special exception, the copyright holders of this
  33.818 -library give you permission to link this library with
  33.819 -independent modules to produce an executable, regardless of
  33.820 -the license terms of these independent modules, and to copy
  33.821 -and distribute the resulting executable under terms of your
  33.822 -choice, provided that you also meet, for each linked
  33.823 -independent module, the terms and conditions of the license
  33.824 -of that module. An independent module is a module which is
  33.825 -not derived from or based on this library. If you modify
  33.826 -this library, you may extend this exception to your version
  33.827 -of the library, but you are not obligated to do so. If you
  33.828 -do not wish to do so, delete this exception statement from
  33.829 -your version.
    34.1 --- a/libs.jerig/manifest.mf	Wed Jun 22 12:05:27 2011 +0200
    34.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.3 @@ -1,5 +0,0 @@
    34.4 -Manifest-Version: 1.0
    34.5 -OpenIDE-Module: org.netbeans.modules.jeriglib
    34.6 -OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jeriglib/Bundle.properties
    34.7 -OpenIDE-Module-Specification-Version: 1.16
    34.8 -
    35.1 --- a/libs.jerig/nbproject/build-impl.xml	Wed Jun 22 12:05:27 2011 +0200
    35.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.3 @@ -1,45 +0,0 @@
    35.4 -<?xml version="1.0" encoding="UTF-8"?>
    35.5 -<!--
    35.6 -*** GENERATED FROM project.xml - DO NOT EDIT  ***
    35.7 -***         EDIT ../build.xml INSTEAD         ***
    35.8 --->
    35.9 -<project name="org.netbeans.modules.jeriglib-impl" basedir="..">
   35.10 -    <fail message="Please build using Ant 1.7.1 or higher.">
   35.11 -        <condition>
   35.12 -            <not>
   35.13 -                <antversion atleast="1.7.1"/>
   35.14 -            </not>
   35.15 -        </condition>
   35.16 -    </fail>
   35.17 -    <property file="nbproject/private/suite-private.properties"/>
   35.18 -    <property file="nbproject/suite.properties"/>
   35.19 -    <fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
   35.20 -    <property file="${suite.dir}/nbproject/private/platform-private.properties"/>
   35.21 -    <property file="${suite.dir}/nbproject/platform.properties"/>
   35.22 -    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
   35.23 -        <attribute name="name"/>
   35.24 -        <attribute name="value"/>
   35.25 -        <sequential>
   35.26 -            <property name="@{name}" value="${@{value}}"/>
   35.27 -        </sequential>
   35.28 -    </macrodef>
   35.29 -    <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
   35.30 -        <attribute name="property"/>
   35.31 -        <attribute name="value"/>
   35.32 -        <sequential>
   35.33 -            <property name="@{property}" value="@{value}"/>
   35.34 -        </sequential>
   35.35 -    </macrodef>
   35.36 -    <property file="${user.properties.file}"/>
   35.37 -    <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
   35.38 -    <nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
   35.39 -    <nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
   35.40 -    <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
   35.41 -        <condition>
   35.42 -            <not>
   35.43 -                <contains string="${cluster.path.evaluated}" substring="platform"/>
   35.44 -            </not>
   35.45 -        </condition>
   35.46 -    </fail>
   35.47 -    <import file="${harness.dir}/build.xml"/>
   35.48 -</project>
    36.1 --- a/libs.jerig/nbproject/genfiles.properties	Wed Jun 22 12:05:27 2011 +0200
    36.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.3 @@ -1,8 +0,0 @@
    36.4 -build.xml.data.CRC32=3312ee06
    36.5 -build.xml.script.CRC32=efb77c3a
    36.6 -build.xml.stylesheet.CRC32=79c3b980@1.29.0.7
    36.7 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
    36.8 -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    36.9 -nbproject/build-impl.xml.data.CRC32=88a1791a
   36.10 -nbproject/build-impl.xml.script.CRC32=0184319b
   36.11 -nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.44
    37.1 --- a/libs.jerig/nbproject/project.properties	Wed Jun 22 12:05:27 2011 +0200
    37.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.3 @@ -1,4 +0,0 @@
    37.4 -is.autoload=true
    37.5 -license.file=${basedir}/jerig-license.txt
    37.6 -release.dir=external
    37.7 -extra.module.files=modules/ext/util-commons.jar,modules/ext/util-lutz.jar,modules/ext/util-pojson.jar,modules/ext/util-strast.jar
    38.1 --- a/libs.jerig/nbproject/project.xml	Wed Jun 22 12:05:27 2011 +0200
    38.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.3 @@ -1,47 +0,0 @@
    38.4 -<?xml version="1.0" encoding="UTF-8"?>
    38.5 -<project xmlns="http://www.netbeans.org/ns/project/1">
    38.6 -    <type>org.netbeans.modules.apisupport.project</type>
    38.7 -    <configuration>
    38.8 -        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
    38.9 -            <code-name-base>org.netbeans.modules.jeriglib</code-name-base>
   38.10 -            <suite-component/>
   38.11 -            <module-dependencies>
   38.12 -                <dependency>
   38.13 -                    <code-name-base>org.netbeans.libs.lucene</code-name-base>
   38.14 -                    <build-prerequisite/>
   38.15 -                    <compile-dependency/>
   38.16 -                    <run-dependency>
   38.17 -                        <release-version>1-3</release-version>
   38.18 -                        <specification-version>2.13</specification-version>
   38.19 -                    </run-dependency>
   38.20 -                </dependency>
   38.21 -            </module-dependencies>
   38.22 -            <public-packages>
   38.23 -                <package>org.codeviation.classloading</package>
   38.24 -                <package>org.codeviation.commons.patterns</package>
   38.25 -                <package>org.codeviation.commons.reflect</package>
   38.26 -                <package>org.codeviation.commons.utils</package>
   38.27 -                <package>org.codeviation.lutz</package>
   38.28 -                <package>org.codeviation.pojson</package>
   38.29 -                <package>org.codeviation.strast</package>
   38.30 -                <package>org.codeviation.strast.model</package>
   38.31 -            </public-packages>
   38.32 -            <class-path-extension>
   38.33 -                <runtime-relative-path>ext/util-pojson.jar</runtime-relative-path>
   38.34 -                <binary-origin>external/util-pojson.jar</binary-origin>
   38.35 -            </class-path-extension>
   38.36 -            <class-path-extension>
   38.37 -                <runtime-relative-path>ext/util-lutz.jar</runtime-relative-path>
   38.38 -                <binary-origin>external/util-lutz.jar</binary-origin>
   38.39 -            </class-path-extension>
   38.40 -            <class-path-extension>
   38.41 -                <runtime-relative-path>ext/util-strast.jar</runtime-relative-path>
   38.42 -                <binary-origin>external/util-strast.jar</binary-origin>
   38.43 -            </class-path-extension>
   38.44 -            <class-path-extension>
   38.45 -                <runtime-relative-path>ext/util-commons.jar</runtime-relative-path>
   38.46 -                <binary-origin>external/util-commons.jar</binary-origin>
   38.47 -            </class-path-extension>
   38.48 -        </data>
   38.49 -    </configuration>
   38.50 -</project>
    39.1 --- a/libs.jerig/nbproject/suite.properties	Wed Jun 22 12:05:27 2011 +0200
    39.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.3 @@ -1,1 +0,0 @@
    39.4 -suite.dir=${basedir}/..
    40.1 --- a/libs.jerig/src/org/netbeans/modules/jeriglib/Bundle.properties	Wed Jun 22 12:05:27 2011 +0200
    40.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.3 @@ -1,1 +0,0 @@
    40.4 -OpenIDE-Module-Name=Jerig
    41.1 --- a/nbproject/platform.properties	Wed Jun 22 12:05:27 2011 +0200
    41.2 +++ b/nbproject/platform.properties	Thu Jun 23 15:07:16 2011 +0200
    41.3 @@ -1,22 +1,17 @@
    41.4  cluster.path=\
    41.5 -    ${nbplatform.active.dir}/identity:\
    41.6 -    ${nbplatform.active.dir}/enterprise:\
    41.7 -    ${nbplatform.active.dir}/webcommon:\
    41.8 -    ${nbplatform.active.dir}/mobility:\
    41.9 -    ${nbplatform.active.dir}/php:\
   41.10 -    ${nbplatform.active.dir}/harness:\
   41.11 -    ${nbplatform.active.dir}/dlight:\
   41.12 -    ${nbplatform.active.dir}/profiler:\
   41.13 -    ${nbplatform.active.dir}/platform:\
   41.14 -    ${nbplatform.active.dir}/websvccommon:\
   41.15 -    ${nbplatform.active.dir}/nb:\
   41.16      ${nbplatform.active.dir}/apisupport:\
   41.17      ${nbplatform.active.dir}/cnd:\
   41.18 -    ${nbplatform.active.dir}/ergonomics:\
   41.19 +    ${nbplatform.active.dir}/dlight:\
   41.20 +    ${nbplatform.active.dir}/enterprise:\
   41.21 +    ${nbplatform.active.dir}/harness:\
   41.22 +    ${nbplatform.active.dir}/ide:\
   41.23      ${nbplatform.active.dir}/java:\
   41.24 -    ${nbplatform.active.dir}/groovy:\
   41.25 -    ${nbplatform.active.dir}/ruby:\
   41.26 -    ${nbplatform.active.dir}/extra:\
   41.27 -    ${nbplatform.active.dir}/ide:\
   41.28 -    borrowedtests/build/cluster
   41.29 +    ${nbplatform.active.dir}/nb:\
   41.30 +    ${nbplatform.active.dir}/platform:\
   41.31 +    ${nbplatform.active.dir}/profiler:\
   41.32 +    ${nbplatform.active.dir}/websvccommon:\
   41.33 +    borrowedtests/build/cluster:\
   41.34 +    remoting/ide/build/cluster
   41.35 +extcluster.remoting/ide/build/cluster.javadoc=
   41.36 +extcluster.remoting/ide/build/cluster.sources=/usr/local/home/lahvac/tmp/jackpot/remoting/ide
   41.37  nbplatform.active=default
    42.1 --- a/nbproject/project.properties	Wed Jun 22 12:05:27 2011 +0200
    42.2 +++ b/nbproject/project.properties	Thu Jun 23 15:07:16 2011 +0200
    42.3 @@ -5,19 +5,15 @@
    42.4      ${project.org.netbeans.modules.jackpot30.transformers}:\
    42.5      ${project.org.netbeans.modules.jackpot30.kit}:\
    42.6      ${project.org.netbeans.modules.jackpot30.help}:\
    42.7 -    ${project.org.netbeans.modules.libs.jerig}:\
    42.8      ${project.org.netbeans.modules.jackpot30.refactoring}:\
    42.9 -    ${project.org.netbeans.modules.jackpot30.apisupport}:\
   42.10 -    ${project.org.netbeans.modules.jackpot30.jumpto}
   42.11 +    ${project.org.netbeans.modules.jackpot30.apisupport}
   42.12  project.org.netbeans.modules.jackpot30.api=api
   42.13  project.org.netbeans.modules.jackpot30.apisupport=bridges/apisupport
   42.14  project.org.netbeans.modules.jackpot30.file=file
   42.15  project.org.netbeans.modules.jackpot30.help=help
   42.16  project.org.netbeans.modules.jackpot30.hintsimpl=hintsimpl
   42.17 -project.org.netbeans.modules.jackpot30.jumpto=bridges/jumpto
   42.18  project.org.netbeans.modules.jackpot30.kit=kit
   42.19  project.org.netbeans.modules.jackpot30.refactoring=bridges/refactoring
   42.20  project.org.netbeans.modules.jackpot30.transformers=transformer
   42.21 -project.org.netbeans.modules.libs.jerig=libs.jerig
   42.22  
   42.23  project.license=cddl-netbeans-sun
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/remoting/build-indexing-backend	Thu Jun 23 15:07:16 2011 +0200
    43.3 @@ -0,0 +1,17 @@
    43.4 +#!/bin/bash
    43.5 +rm -rf build
    43.6 +mkdir -p build/indexing-backend
    43.7 +(cd server/indexer; ant "$@" clean && ant "$@" build-zip && unzip -d ../../build/indexing-backend dist/indexer.zip) || exit 1
    43.8 +mkdir -p build/indexing-backend/web
    43.9 +(cd server/web/web.main; ant clean && ant jar && cp -r dist/* ../../../build/indexing-backend/web) || exit 1
   43.10 +
   43.11 +cp server/scripts/* build/indexing-backend
   43.12 +
   43.13 +chmod u+x build/temp-indexing-backend/index
   43.14 +chmod u+x build/temp-indexing-backend/web
   43.15 +
   43.16 +(cd build; zip -r indexing-backend.zip indexing-backend) || exit 1
   43.17 +
   43.18 +(cd ide; ant "$@" clean && ant "$@" nbms && cp -r build/updates ../build) || exit 1
   43.19 +
   43.20 +(cd server/hudson; mvn -Dmaven.test.skip=true clean package && cp target/*.hpi ../../build) || exit
    44.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.2 +++ b/remoting/ide/api/build.xml	Thu Jun 23 15:07:16 2011 +0200
    44.3 @@ -0,0 +1,29 @@
    44.4 +<?xml version="1.0" encoding="UTF-8"?>
    44.5 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
    44.6 +<!-- for some information on what you could do (e.g. targets to override). -->
    44.7 +<!-- If you delete this file and reopen the project it will be recreated. -->
    44.8 +<project name="org.netbeans.modules.jackpot30.remoting.api" default="netbeans" basedir=".">
    44.9 +    <description>Builds, tests, and runs the project org.netbeans.modules.jackpot30.remoting.api.</description>
   44.10 +    <import file="nbproject/build-impl.xml"/>
   44.11 +    
   44.12 +    <target name="-check-jerig-downloaded">
   44.13 +        <available file="external/jerig-36929ddc99ff.zip" property="jerig.downloaded"/>
   44.14 +    </target>
   44.15 +    <target name="-download-jerig" depends="-check-jerig-downloaded" unless="jerig.downloaded">
   44.16 +        <mkdir dir="external" />
   44.17 +        <get src="http://kenai.com/projects/jackpot30/downloads/download/external/jerig-36929ddc99ff.zip" dest="external/jerig-36929ddc99ff.zip" usetimestamp="true"/>
   44.18 +    </target>
   44.19 +    
   44.20 +    <target name="files-init" depends="projectized-common.files-init,-download-jerig">
   44.21 +        <unzip src="external/jerig-36929ddc99ff.zip" dest="external" overwrite="false" />
   44.22 +        <mkdir dir="${cluster}/modules/ext" />
   44.23 +        <copy  todir="${cluster}/modules/ext">
   44.24 +            <fileset dir="external" includes="*pojson*.jar" />
   44.25 +            <fileset dir="external" includes="*common*.jar" />
   44.26 +        </copy>
   44.27 +    </target>
   44.28 +
   44.29 +    <target name="test" />
   44.30 +    <target name="test-coverage" />
   44.31 +    <target name="coverage-report" />
   44.32 +</project>
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/remoting/ide/api/manifest.mf	Thu Jun 23 15:07:16 2011 +0200
    45.3 @@ -0,0 +1,5 @@
    45.4 +Manifest-Version: 1.0
    45.5 +OpenIDE-Module: org.netbeans.modules.jackpot30.remoting.api
    45.6 +OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jackpot30/remotingapi/Bundle.properties
    45.7 +OpenIDE-Module-Specification-Version: 1.0
    45.8 +
    46.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.2 +++ b/remoting/ide/api/nbproject/build-impl.xml	Thu Jun 23 15:07:16 2011 +0200
    46.3 @@ -0,0 +1,45 @@
    46.4 +<?xml version="1.0" encoding="UTF-8"?>
    46.5 +<!--
    46.6 +*** GENERATED FROM project.xml - DO NOT EDIT  ***
    46.7 +***         EDIT ../build.xml INSTEAD         ***
    46.8 +-->
    46.9 +<project name="org.netbeans.modules.jackpot30.remoting.api-impl" basedir="..">
   46.10 +    <fail message="Please build using Ant 1.7.1 or higher.">
   46.11 +        <condition>
   46.12 +            <not>
   46.13 +                <antversion atleast="1.7.1"/>
   46.14 +            </not>
   46.15 +        </condition>
   46.16 +    </fail>
   46.17 +    <property file="nbproject/private/suite-private.properties"/>
   46.18 +    <property file="nbproject/suite.properties"/>
   46.19 +    <fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
   46.20 +    <property file="${suite.dir}/nbproject/private/platform-private.properties"/>
   46.21 +    <property file="${suite.dir}/nbproject/platform.properties"/>
   46.22 +    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
   46.23 +        <attribute name="name"/>
   46.24 +        <attribute name="value"/>
   46.25 +        <sequential>
   46.26 +            <property name="@{name}" value="${@{value}}"/>
   46.27 +        </sequential>
   46.28 +    </macrodef>
   46.29 +    <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
   46.30 +        <attribute name="property"/>
   46.31 +        <attribute name="value"/>
   46.32 +        <sequential>
   46.33 +            <property name="@{property}" value="@{value}"/>
   46.34 +        </sequential>
   46.35 +    </macrodef>
   46.36 +    <property file="${user.properties.file}"/>
   46.37 +    <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
   46.38 +    <nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
   46.39 +    <nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
   46.40 +    <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
   46.41 +        <condition>
   46.42 +            <not>
   46.43 +                <contains string="${cluster.path.evaluated}" substring="platform"/>
   46.44 +            </not>
   46.45 +        </condition>
   46.46 +    </fail>
   46.47 +    <import file="${harness.dir}/build.xml"/>
   46.48 +</project>
    47.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.2 +++ b/remoting/ide/api/nbproject/genfiles.properties	Thu Jun 23 15:07:16 2011 +0200
    47.3 @@ -0,0 +1,8 @@
    47.4 +build.xml.data.CRC32=83c779aa
    47.5 +build.xml.script.CRC32=4e65cd58
    47.6 +build.xml.stylesheet.CRC32=a56c6a5b@1.47
    47.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
    47.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    47.9 +nbproject/build-impl.xml.data.CRC32=83c779aa
   47.10 +nbproject/build-impl.xml.script.CRC32=33cac223
   47.11 +nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.47
    48.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.2 +++ b/remoting/ide/api/nbproject/project.properties	Thu Jun 23 15:07:16 2011 +0200
    48.3 @@ -0,0 +1,2 @@
    48.4 +javac.source=1.6
    48.5 +javac.compilerargs=-Xlint -Xlint:-serial
    49.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.2 +++ b/remoting/ide/api/nbproject/project.xml	Thu Jun 23 15:07:16 2011 +0200
    49.3 @@ -0,0 +1,82 @@
    49.4 +<?xml version="1.0" encoding="UTF-8"?>
    49.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
    49.6 +    <type>org.netbeans.modules.apisupport.project</type>
    49.7 +    <configuration>
    49.8 +        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
    49.9 +            <code-name-base>org.netbeans.modules.jackpot30.remoting.api</code-name-base>
   49.10 +            <suite-component/>
   49.11 +            <module-dependencies>
   49.12 +                <dependency>
   49.13 +                    <code-name-base>org.netbeans.api.annotations.common</code-name-base>
   49.14 +                    <build-prerequisite/>
   49.15 +                    <compile-dependency/>
   49.16 +                    <run-dependency>
   49.17 +                        <release-version>1</release-version>
   49.18 +                        <specification-version>1.10</specification-version>
   49.19 +                    </run-dependency>
   49.20 +                </dependency>
   49.21 +                <dependency>
   49.22 +                    <code-name-base>org.netbeans.modules.options.api</code-name-base>
   49.23 +                    <build-prerequisite/>
   49.24 +                    <compile-dependency/>
   49.25 +                    <run-dependency>
   49.26 +                        <release-version>1</release-version>
   49.27 +                        <specification-version>1.23</specification-version>
   49.28 +                    </run-dependency>
   49.29 +                </dependency>
   49.30 +                <dependency>
   49.31 +                    <code-name-base>org.openide.awt</code-name-base>
   49.32 +                    <build-prerequisite/>
   49.33 +                    <compile-dependency/>
   49.34 +                    <run-dependency>
   49.35 +                        <specification-version>7.35</specification-version>
   49.36 +                    </run-dependency>
   49.37 +                </dependency>
   49.38 +                <dependency>
   49.39 +                    <code-name-base>org.openide.dialogs</code-name-base>
   49.40 +                    <build-prerequisite/>
   49.41 +                    <compile-dependency/>
   49.42 +                    <run-dependency>
   49.43 +                        <specification-version>7.21</specification-version>
   49.44 +                    </run-dependency>
   49.45 +                </dependency>
   49.46 +                <dependency>
   49.47 +                    <code-name-base>org.openide.nodes</code-name-base>
   49.48 +                    <build-prerequisite/>
   49.49 +                    <compile-dependency/>
   49.50 +                    <run-dependency>
   49.51 +                        <specification-version>7.23</specification-version>
   49.52 +                    </run-dependency>
   49.53 +                </dependency>
   49.54 +                <dependency>
   49.55 +                    <code-name-base>org.openide.util</code-name-base>
   49.56 +                    <build-prerequisite/>
   49.57 +                    <compile-dependency/>
   49.58 +                    <run-dependency>
   49.59 +                        <specification-version>8.16</specification-version>
   49.60 +                    </run-dependency>
   49.61 +                </dependency>
   49.62 +                <dependency>
   49.63 +                    <code-name-base>org.openide.util.lookup</code-name-base>
   49.64 +                    <build-prerequisite/>
   49.65 +                    <compile-dependency/>
   49.66 +                    <run-dependency>
   49.67 +                        <specification-version>8.9</specification-version>
   49.68 +                    </run-dependency>
   49.69 +                </dependency>
   49.70 +            </module-dependencies>
   49.71 +            <public-packages>
   49.72 +                <package>org.codeviation.pojson</package>
   49.73 +                <package>org.netbeans.modules.jackpot30.remoting.api</package>
   49.74 +            </public-packages>
   49.75 +            <class-path-extension>
   49.76 +                <runtime-relative-path>ext/util-pojson.jar</runtime-relative-path>
   49.77 +                <binary-origin>external/util-pojson.jar</binary-origin>
   49.78 +            </class-path-extension>
   49.79 +            <class-path-extension>
   49.80 +                <runtime-relative-path>ext/util-commons.jar</runtime-relative-path>
   49.81 +                <binary-origin>external/util-commons.jar</binary-origin>
   49.82 +            </class-path-extension>
   49.83 +        </data>
   49.84 +    </configuration>
   49.85 +</project>
    50.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.2 +++ b/remoting/ide/api/nbproject/suite.properties	Thu Jun 23 15:07:16 2011 +0200
    50.3 @@ -0,0 +1,1 @@
    50.4 +suite.dir=${basedir}/..
    51.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.2 +++ b/remoting/ide/api/src/org/netbeans/modules/jackpot30/remoting/api/RemoteIndex.java	Thu Jun 23 15:07:16 2011 +0200
    51.3 @@ -0,0 +1,122 @@
    51.4 +/*
    51.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    51.6 + *
    51.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
    51.8 + *
    51.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   51.10 + * Other names may be trademarks of their respective owners.
   51.11 + *
   51.12 + * The contents of this file are subject to the terms of either the GNU
   51.13 + * General Public License Version 2 only ("GPL") or the Common
   51.14 + * Development and Distribution License("CDDL") (collectively, the
   51.15 + * "License"). You may not use this file except in compliance with the
   51.16 + * License. You can obtain a copy of the License at
   51.17 + * http://www.netbeans.org/cddl-gplv2.html
   51.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   51.19 + * specific language governing permissions and limitations under the
   51.20 + * License.  When distributing the software, include this License Header
   51.21 + * Notice in each file and include the License file at
   51.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   51.23 + * particular file as subject to the "Classpath" exception as provided
   51.24 + * by Oracle in the GPL Version 2 section of the License file that
   51.25 + * accompanied this code. If applicable, add the following below the
   51.26 + * License Header, with the fields enclosed by brackets [] replaced by
   51.27 + * your own identifying information:
   51.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   51.29 + *
   51.30 + * If you wish your version of this file to be governed by only the CDDL
   51.31 + * or only the GPL Version 2, indicate your decision by adding
   51.32 + * "[Contributor] elects to include this software in this distribution
   51.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   51.34 + * single choice of license, a recipient has the option to distribute
   51.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   51.36 + * to extend the choice of license to its licensees as provided above.
   51.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   51.38 + * Version 2 license, then the option applies only if the new code is
   51.39 + * made subject to such option by the copyright holder.
   51.40 + *
   51.41 + * Contributor(s):
   51.42 + *
   51.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
   51.44 + */
   51.45 +
   51.46 +package org.netbeans.modules.jackpot30.remoting.api;
   51.47 +
   51.48 +import java.net.URL;
   51.49 +import java.util.LinkedList;
   51.50 +import java.util.List;
   51.51 +import java.util.prefs.BackingStoreException;
   51.52 +import java.util.prefs.Preferences;
   51.53 +import org.codeviation.pojson.Pojson;
   51.54 +import org.openide.util.Exceptions;
   51.55 +import org.openide.util.NbPreferences;
   51.56 +
   51.57 +/**
   51.58 + *
   51.59 + * @author lahvac
   51.60 + */
   51.61 +public class RemoteIndex {
   51.62 +
   51.63 +    public final String folder;
   51.64 +    public final URL    remote;
   51.65 +    public final String remoteSegment;
   51.66 +
   51.67 +    public static RemoteIndex create(String folder, URL remote, String remoteSegment) {
   51.68 +        return new RemoteIndex(folder, remote, remoteSegment);
   51.69 +    }
   51.70 +
   51.71 +    private RemoteIndex() {//used by Pojson
   51.72 +        this.folder = null;
   51.73 +        this.remote = null;
   51.74 +        this.remoteSegment = null;
   51.75 +    }
   51.76 +
   51.77 +    private RemoteIndex(String folder, URL remote, String remoteSegment) {
   51.78 +        this.folder = folder;
   51.79 +        this.remote = remote;
   51.80 +        this.remoteSegment = remoteSegment;
   51.81 +    }
   51.82 +
   51.83 +    private static final String KEY_REMOTE_INDICES = RemoteIndex.class.getSimpleName();
   51.84 +
   51.85 +    public static Iterable<? extends RemoteIndex> loadIndices() {
   51.86 +        List<RemoteIndex> result = new LinkedList<RemoteIndex>();
   51.87 +        Preferences prefs = NbPreferences.forModule(RemoteIndex.class).node(KEY_REMOTE_INDICES);
   51.88 +
   51.89 +        if (prefs != null) {
   51.90 +            try {
   51.91 +                for (String key : prefs.keys()) {
   51.92 +                    if (key.startsWith("index")) {
   51.93 +                        result.add(Pojson.load(RemoteIndex.class, prefs.get(key, null)));
   51.94 +                    }
   51.95 +                }
   51.96 +            } catch (BackingStoreException ex) {
   51.97 +                Exceptions.printStackTrace(ex);
   51.98 +            }
   51.99 +        }
  51.100 +
  51.101 +        return result;
  51.102 +    }
  51.103 +    
  51.104 +    public static void saveIndices(Iterable<? extends RemoteIndex> indices) {
  51.105 +        Preferences prefs = NbPreferences.forModule(RemoteIndex.class).node(KEY_REMOTE_INDICES);
  51.106 +
  51.107 +        try {
  51.108 +            prefs.clear();
  51.109 +        } catch (BackingStoreException ex) {
  51.110 +            Exceptions.printStackTrace(ex);
  51.111 +        }
  51.112 +
  51.113 +        int i = 0;
  51.114 +
  51.115 +        for (RemoteIndex idx : indices) {
  51.116 +            prefs.put("index" + i++, Pojson.save(idx));
  51.117 +        }
  51.118 +        
  51.119 +        try {
  51.120 +            prefs.flush();
  51.121 +        } catch (BackingStoreException ex) {
  51.122 +            Exceptions.printStackTrace(ex);
  51.123 +        }
  51.124 +    }
  51.125 +}
    52.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.2 +++ b/remoting/ide/api/src/org/netbeans/modules/jackpot30/remoting/api/WebUtilities.java	Thu Jun 23 15:07:16 2011 +0200
    52.3 @@ -0,0 +1,138 @@
    52.4 +/*
    52.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    52.6 + *
    52.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
    52.8 + *
    52.9 + * The contents of this file are subject to the terms of either the GNU
   52.10 + * General Public License Version 2 only ("GPL") or the Common
   52.11 + * Development and Distribution License("CDDL") (collectively, the
   52.12 + * "License"). You may not use this file except in compliance with the
   52.13 + * License. You can obtain a copy of the License at
   52.14 + * http://www.netbeans.org/cddl-gplv2.html
   52.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   52.16 + * specific language governing permissions and limitations under the
   52.17 + * License.  When distributing the software, include this License Header
   52.18 + * Notice in each file and include the License file at
   52.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   52.20 + * particular file as subject to the "Classpath" exception as provided
   52.21 + * by Sun in the GPL Version 2 section of the License file that
   52.22 + * accompanied this code. If applicable, add the following below the
   52.23 + * License Header, with the fields enclosed by brackets [] replaced by
   52.24 + * your own identifying information:
   52.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   52.26 + *
   52.27 + * If you wish your version of this file to be governed by only the CDDL
   52.28 + * or only the GPL Version 2, indicate your decision by adding
   52.29 + * "[Contributor] elects to include this software in this distribution
   52.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   52.31 + * single choice of license, a recipient has the option to distribute
   52.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   52.33 + * to extend the choice of license to its licensees as provided above.
   52.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   52.35 + * Version 2 license, then the option applies only if the new code is
   52.36 + * made subject to such option by the copyright holder.
   52.37 + *
   52.38 + * Contributor(s):
   52.39 + *
   52.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
   52.41 + */
   52.42 +
   52.43 +package org.netbeans.modules.jackpot30.remoting.api;
   52.44 +
   52.45 +import java.io.BufferedReader;
   52.46 +import java.io.IOException;
   52.47 +import java.io.InputStream;
   52.48 +import java.io.InputStreamReader;
   52.49 +import java.net.URI;
   52.50 +import java.net.URISyntaxException;
   52.51 +import java.net.URL;
   52.52 +import java.net.URLConnection;
   52.53 +import java.util.Collection;
   52.54 +import java.util.LinkedList;
   52.55 +import java.util.List;
   52.56 +import java.util.regex.Matcher;
   52.57 +import java.util.regex.Pattern;
   52.58 +import org.netbeans.api.annotations.common.CheckForNull;
   52.59 +
   52.60 +/**
   52.61 + *
   52.62 + */
   52.63 +public class WebUtilities {
   52.64 +
   52.65 +    private WebUtilities() {
   52.66 +    }
   52.67 +
   52.68 +    public static @CheckForNull String requestStringResponse (URI uri) {
   52.69 +        final StringBuffer sb = new StringBuffer ();
   52.70 +        final URL url;
   52.71 +        try {
   52.72 +            url = uri.toURL();
   52.73 +            final URLConnection urlConnection = url.openConnection ();
   52.74 +            urlConnection.connect ();
   52.75 +            final Object content = urlConnection.getContent ();
   52.76 +//            System.out.println (content);
   52.77 +//            System.out.println (content.getClass ());
   52.78 +            final InputStream inputStream = (InputStream) content;
   52.79 +            final BufferedReader reader = new BufferedReader (new InputStreamReader (inputStream, "ASCII"));
   52.80 +            try {
   52.81 +                for (;;) {
   52.82 +                    String line = reader.readLine ();
   52.83 +                    if (line == null)
   52.84 +                        break;
   52.85 +                    sb.append (line).append ('\n');
   52.86 +                }
   52.87 +            } finally {
   52.88 +                reader.close ();
   52.89 +            }
   52.90 +        } catch (IOException e) {
   52.91 +            e.printStackTrace ();  // TODO
   52.92 +            return null;
   52.93 +        }
   52.94 +        return sb.toString ();
   52.95 +    }
   52.96 +    
   52.97 +    public static Collection<? extends String> requestStringArrayResponse (URI uri) {
   52.98 +        final List<String> result = new LinkedList<String> ();
   52.99 +        final URL url;
  52.100 +        try {
  52.101 +            url = uri.toURL();
  52.102 +            final URLConnection urlConnection = url.openConnection ();
  52.103 +            urlConnection.connect ();
  52.104 +            final Object content = urlConnection.getContent ();
  52.105 +//            System.out.println (content);
  52.106 +//            System.out.println (content.getClass ());
  52.107 +            final InputStream inputStream = (InputStream) content;
  52.108 +            final BufferedReader reader = new BufferedReader (new InputStreamReader (inputStream, "ASCII"));
  52.109 +            try {
  52.110 +                for (;;) {
  52.111 +                    String line = reader.readLine ();
  52.112 +                    if (line == null)
  52.113 +                        break;
  52.114 +                    result.add (line);
  52.115 +                }
  52.116 +            } finally {
  52.117 +                reader.close ();
  52.118 +            }
  52.119 +        } catch (IOException e) {
  52.120 +            e.printStackTrace ();  // TODO
  52.121 +        }
  52.122 +        return result;
  52.123 +    }
  52.124 +
  52.125 +    private static String[] c = new String[] {"&", "<", ">", "\n", "\""}; // NOI18N
  52.126 +    private static String[] tags = new String[] {"&amp;", "&lt;", "&gt;", "<br>", "&quot;"}; // NOI18N
  52.127 +
  52.128 +    public static String escapeForHTMLElement(String input) {
  52.129 +        for (int cntr = 0; cntr < c.length; cntr++) {
  52.130 +            input = input.replaceAll(c[cntr], tags[cntr]);
  52.131 +        }
  52.132 +
  52.133 +        return input;
  52.134 +    }
  52.135 +
  52.136 +    public static String escapeForQuery(String pattern) throws URISyntaxException {
  52.137 +        if (pattern == null) return null;
  52.138 +        return new URI(null, null, null, -1, null, pattern, null).getRawQuery().replaceAll(Pattern.quote("&"), Matcher.quoteReplacement("%26"));
  52.139 +    }
  52.140 +
  52.141 +}
    53.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.2 +++ b/remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/Bundle.properties	Thu Jun 23 15:07:16 2011 +0200
    53.3 @@ -0,0 +1,1 @@
    53.4 +OpenIDE-Module-Name=Remoting API
    54.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.2 +++ b/remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/options/Bundle.properties	Thu Jun 23 15:07:16 2011 +0200
    54.3 @@ -0,0 +1,11 @@
    54.4 +AdvancedOption_DisplayName_Index=Jackpot 3.0 Indices
    54.5 +AdvancedOption_Keywords_Index=index indices jackpot
    54.6 +CustomizeRemoteIndex.indexURLLabel.text=Index URL:
    54.7 +CustomizeRemoteIndex.indexURL.text=
    54.8 +CustomizeRemoteIndex.jLabel1.text=Subindex:
    54.9 +CustomizeRemoteIndex.folderLabel.text=&Folder:
   54.10 +CustomizeRemoteIndex.folderChooser.text=Browse
   54.11 +CustomizeRemoteIndex.folder.text=
   54.12 +IndexPanel.addButton.text=Add Mapping
   54.13 +IndexPanel.removeButton.text=Remove Mapping
   54.14 +IndexPanel.editButton.text=Edit Mapping
    55.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.2 +++ b/remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/options/CustomizeRemoteIndex.form	Thu Jun 23 15:07:16 2011 +0200
    55.3 @@ -0,0 +1,178 @@
    55.4 +<?xml version="1.1" encoding="UTF-8" ?>
    55.5 +
    55.6 +<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
    55.7 +  <NonVisualComponents>
    55.8 +    <Component class="javax.swing.ButtonGroup" name="buttonGroup1">
    55.9 +    </Component>
   55.10 +  </NonVisualComponents>
   55.11 +  <Properties>
   55.12 +    <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
   55.13 +      <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
   55.14 +        <EmptyBorder bottom="12" left="12" right="12" top="12"/>
   55.15 +      </Border>
   55.16 +    </Property>
   55.17 +  </Properties>
   55.18 +  <AuxValues>
   55.19 +    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
   55.20 +    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
   55.21 +    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
   55.22 +    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
   55.23 +    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
   55.24 +    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
   55.25 +    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
   55.26 +    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
   55.27 +    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
   55.28 +    <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,53,0,0,2,-37"/>
   55.29 +  </AuxValues>
   55.30 +
   55.31 +  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
   55.32 +  <SubComponents>
   55.33 +    <Container class="javax.swing.JPanel" name="folderPanel">
   55.34 +      <Constraints>
   55.35 +        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
   55.36 +          <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="1.0" weightY="0.0"/>
   55.37 +        </Constraint>
   55.38 +      </Constraints>
   55.39 +
   55.40 +      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
   55.41 +      <SubComponents>
   55.42 +        <Component class="javax.swing.JLabel" name="folderLabel">
   55.43 +          <Properties>
   55.44 +            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   55.45 +              <ResourceString bundle="org/netbeans/modules/jackpot30/remotingapi/options/Bundle.properties" key="CustomizeRemoteIndex.folderLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
   55.46 +            </Property>
   55.47 +          </Properties>
   55.48 +          <Constraints>
   55.49 +            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
   55.50 +              <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="6" anchor="17" weightX="0.0" weightY="0.0"/>
   55.51 +            </Constraint>
   55.52 +          </Constraints>
   55.53 +        </Component>
   55.54 +        <Component class="javax.swing.JButton" name="folderChooser">
   55.55 +          <Properties>
   55.56 +            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   55.57 +              <ResourceString bundle="org/netbeans/modules/jackpot30/remotingapi/options/Bundle.properties" key="CustomizeRemoteIndex.folderChooser.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
   55.58 +            </Property>
   55.59 +          </Properties>
   55.60 +          <Events>
   55.61 +            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="folderChooserActionPerformed"/>
   55.62 +          </Events>
   55.63 +          <Constraints>
   55.64 +            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
   55.65 +              <GridBagConstraints gridX="2" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
   55.66 +            </Constraint>
   55.67 +          </Constraints>
   55.68 +        </Component>
   55.69 +        <Component class="javax.swing.JTextField" name="folder">
   55.70 +          <Properties>
   55.71 +            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   55.72 +              <ResourceString bundle="org/netbeans/modules/jackpot30/remotingapi/options/Bundle.properties" key="CustomizeRemoteIndex.folder.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
   55.73 +            </Property>
   55.74 +          </Properties>
   55.75 +          <Constraints>
   55.76 +            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
   55.77 +              <GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
   55.78 +            </Constraint>
   55.79 +          </Constraints>
   55.80 +        </Component>
   55.81 +      </SubComponents>
   55.82 +    </Container>
   55.83 +    <Component class="javax.swing.JTextArea" name="indexInfo">
   55.84 +      <Properties>
   55.85 +        <Property name="columns" type="int" value="20"/>
   55.86 +        <Property name="editable" type="boolean" value="false"/>
   55.87 +        <Property name="rows" type="int" value="5"/>
   55.88 +        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
   55.89 +          <Border info="null"/>
   55.90 +        </Property>
   55.91 +      </Properties>
   55.92 +      <Constraints>
   55.93 +        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
   55.94 +          <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="6" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="1.0" weightY="1.0"/>
   55.95 +        </Constraint>
   55.96 +      </Constraints>
   55.97 +    </Component>
   55.98 +    <Container class="javax.swing.JPanel" name="remoteIndexPanel">
   55.99 +      <Constraints>
  55.100 +        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
  55.101 +          <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
  55.102 +        </Constraint>
  55.103 +      </Constraints>
  55.104 +
  55.105 +      <Layout>
  55.106 +        <DimensionLayout dim="0">
  55.107 +          <Group type="103" groupAlignment="0" attributes="0">
  55.108 +              <Group type="102" alignment="0" attributes="0">
  55.109 +                  <EmptySpace max="-2" attributes="0"/>
  55.110 +                  <Group type="103" groupAlignment="0" attributes="0">
  55.111 +                      <Group type="102" alignment="0" attributes="0">
  55.112 +                          <EmptySpace min="12" pref="12" max="12" attributes="0"/>
  55.113 +                          <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
  55.114 +                          <EmptySpace max="-2" attributes="0"/>
  55.115 +                          <Component id="subIndex" pref="589" max="32767" attributes="0"/>
  55.116 +                      </Group>
  55.117 +                      <Group type="102" alignment="0" attributes="0">
  55.118 +                          <Component id="indexURLLabel" min="-2" max="-2" attributes="0"/>
  55.119 +                          <EmptySpace max="-2" attributes="0"/>
  55.120 +                          <Component id="indexURL" min="-2" max="-2" attributes="0"/>
  55.121 +                      </Group>
  55.122 +                  </Group>
  55.123 +                  <EmptySpace max="-2" attributes="0"/>
  55.124 +              </Group>
  55.125 +          </Group>
  55.126 +        </DimensionLayout>
  55.127 +        <DimensionLayout dim="1">
  55.128 +          <Group type="103" groupAlignment="0" attributes="0">
  55.129 +              <Group type="102" alignment="0" attributes="0">
  55.130 +                  <EmptySpace max="-2" attributes="0"/>
  55.131 +                  <Group type="103" groupAlignment="3" attributes="0">
  55.132 +                      <Component id="indexURLLabel" alignment="3" min="-2" max="-2" attributes="0"/>
  55.133 +                      <Component id="indexURL" alignment="3" min="-2" max="-2" attributes="0"/>
  55.134 +                  </Group>
  55.135 +                  <EmptySpace type="unrelated" max="-2" attributes="0"/>
  55.136 +                  <Group type="103" groupAlignment="3" attributes="0">
  55.137 +                      <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
  55.138 +                      <Component id="subIndex" alignment="3" min="-2" max="-2" attributes="0"/>
  55.139 +                  </Group>
  55.140 +                  <EmptySpace max="32767" attributes="0"/>
  55.141 +              </Group>
  55.142 +          </Group>
  55.143 +        </DimensionLayout>
  55.144 +      </Layout>
  55.145 +      <SubComponents>
  55.146 +        <Component class="javax.swing.JTextField" name="indexURL">
  55.147 +          <Properties>
  55.148 +            <Property name="columns" type="int" value="40"/>
  55.149 +            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  55.150 +              <ResourceString bundle="org/netbeans/modules/jackpot30/remotingapi/options/Bundle.properties" key="CustomizeRemoteIndex.indexURL.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  55.151 +            </Property>
  55.152 +          </Properties>
  55.153 +        </Component>
  55.154 +        <Component class="javax.swing.JLabel" name="indexURLLabel">
  55.155 +          <Properties>
  55.156 +            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  55.157 +              <ResourceString bundle="org/netbeans/modules/jackpot30/remotingapi/options/Bundle.properties" key="CustomizeRemoteIndex.indexURLLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  55.158 +            </Property>
  55.159 +          </Properties>
  55.160 +        </Component>
  55.161 +        <Component class="javax.swing.JComboBox" name="subIndex">
  55.162 +          <Properties>
  55.163 +            <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
  55.164 +              <StringArray count="0"/>
  55.165 +            </Property>
  55.166 +          </Properties>
  55.167 +          <Events>
  55.168 +            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="subIndexActionPerformed"/>
  55.169 +          </Events>
  55.170 +        </Component>
  55.171 +        <Component class="javax.swing.JLabel" name="jLabel1">
  55.172 +          <Properties>
  55.173 +            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  55.174 +              <ResourceString bundle="org/netbeans/modules/jackpot30/remotingapi/options/Bundle.properties" key="CustomizeRemoteIndex.jLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  55.175 +            </Property>
  55.176 +          </Properties>
  55.177 +        </Component>
  55.178 +      </SubComponents>
  55.179 +    </Container>
  55.180 +  </SubComponents>
  55.181 +</Form>
    56.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.2 +++ b/remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/options/CustomizeRemoteIndex.java	Thu Jun 23 15:07:16 2011 +0200
    56.3 @@ -0,0 +1,479 @@
    56.4 +/*
    56.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    56.6 + *
    56.7 + * Copyright 2010-2011 Sun Microsystems, Inc. All rights reserved.
    56.8 + *
    56.9 + * The contents of this file are subject to the terms of either the GNU
   56.10 + * General Public License Version 2 only ("GPL") or the Common
   56.11 + * Development and Distribution License("CDDL") (collectively, the
   56.12 + * "License"). You may not use this file except in compliance with the
   56.13 + * License. You can obtain a copy of the License at
   56.14 + * http://www.netbeans.org/cddl-gplv2.html
   56.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   56.16 + * specific language governing permissions and limitations under the
   56.17 + * License.  When distributing the software, include this License Header
   56.18 + * Notice in each file and include the License file at
   56.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   56.20 + * particular file as subject to the "Classpath" exception as provided
   56.21 + * by Sun in the GPL Version 2 section of the License file that
   56.22 + * accompanied this code. If applicable, add the following below the
   56.23 + * License Header, with the fields enclosed by brackets [] replaced by
   56.24 + * your own identifying information:
   56.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   56.26 + *
   56.27 + * If you wish your version of this file to be governed by only the CDDL
   56.28 + * or only the GPL Version 2, indicate your decision by adding
   56.29 + * "[Contributor] elects to include this software in this distribution
   56.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   56.31 + * single choice of license, a recipient has the option to distribute
   56.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   56.33 + * to extend the choice of license to its licensees as provided above.
   56.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   56.35 + * Version 2 license, then the option applies only if the new code is
   56.36 + * made subject to such option by the copyright holder.
   56.37 + *
   56.38 + * Contributor(s):
   56.39 + *
   56.40 + * Portions Copyrighted 2010-2011 Sun Microsystems, Inc.
   56.41 + */
   56.42 +package org.netbeans.modules.jackpot30.remotingapi.options;
   56.43 +
   56.44 +import java.awt.Component;
   56.45 +import java.io.File;
   56.46 +import java.net.MalformedURLException;
   56.47 +import java.net.URISyntaxException;
   56.48 +import java.net.URL;
   56.49 +import java.util.Collection;
   56.50 +import java.util.HashMap;
   56.51 +import java.util.Map;
   56.52 +import java.util.concurrent.atomic.AtomicBoolean;
   56.53 +import java.util.concurrent.atomic.AtomicReference;
   56.54 +import javax.swing.DefaultComboBoxModel;
   56.55 +import javax.swing.DefaultListCellRenderer;
   56.56 +import javax.swing.JButton;
   56.57 +import javax.swing.JFileChooser;
   56.58 +import javax.swing.JList;
   56.59 +import javax.swing.JTextField;
   56.60 +import javax.swing.SwingUtilities;
   56.61 +import javax.swing.UIManager;
   56.62 +import javax.swing.event.DocumentEvent;
   56.63 +import javax.swing.event.DocumentListener;
   56.64 +import org.netbeans.modules.jackpot30.remoting.api.RemoteIndex;
   56.65 +import org.netbeans.modules.jackpot30.remoting.api.WebUtilities;
   56.66 +import org.openide.NotificationLineSupport;
   56.67 +import org.openide.util.RequestProcessor;
   56.68 +
   56.69 +/**
   56.70 + *
   56.71 + * @author lahvac
   56.72 + */
   56.73 +public class CustomizeRemoteIndex extends javax.swing.JPanel {
   56.74 +
   56.75 +    private final JButton okButton;
   56.76 +
   56.77 +    public CustomizeRemoteIndex(JButton okButton) {
   56.78 +        this.okButton = okButton;
   56.79 +        initComponents();
   56.80 +        DocumentListener updateErrorsListener = new DocumentListener() {
   56.81 +            public void insertUpdate(DocumentEvent e) {
   56.82 +                updateErrors();
   56.83 +            }
   56.84 +            public void removeUpdate(DocumentEvent e) {
   56.85 +                updateErrors();
   56.86 +            }
   56.87 +            public void changedUpdate(DocumentEvent e) {}
   56.88 +        };
   56.89 +        folder.getDocument().addDocumentListener(updateErrorsListener);
   56.90 +        indexURL.getDocument().addDocumentListener(new DocumentListener() {
   56.91 +            public void insertUpdate(DocumentEvent e) {
   56.92 +                indexURLUpdated();
   56.93 +            }
   56.94 +            public void removeUpdate(DocumentEvent e) {
   56.95 +                indexURLUpdated();
   56.96 +            }
   56.97 +            public void changedUpdate(DocumentEvent e) {
   56.98 +            }
   56.99 +        });
  56.100 +        indexInfo.setFont(UIManager.getFont("Label.font"));
  56.101 +        indexInfo.setBackground(UIManager.getColor("Label.background"));
  56.102 +        indexInfo.setDisabledTextColor(UIManager.getColor("Label.foreground"));
  56.103 +    }
  56.104 +
  56.105 +    /** This method is called from within the constructor to
  56.106 +     * initialize the form.
  56.107 +     * WARNING: Do NOT modify this code. The content of this method is
  56.108 +     * always regenerated by the Form Editor.
  56.109 +     */
  56.110 +    @SuppressWarnings("unchecked")
  56.111 +    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  56.112 +    private void initComponents() {
  56.113 +        java.awt.GridBagConstraints gridBagConstraints;
  56.114 +
  56.115 +        buttonGroup1 = new javax.swing.ButtonGroup();
  56.116 +        folderPanel = new javax.swing.JPanel();
  56.117 +        folderLabel = new javax.swing.JLabel();
  56.118 +        folderChooser = new javax.swing.JButton();
  56.119 +        folder = new javax.swing.JTextField();
  56.120 +        indexInfo = new javax.swing.JTextArea();
  56.121 +        remoteIndexPanel = new javax.swing.JPanel();
  56.122 +        indexURL = new javax.swing.JTextField();
  56.123 +        indexURLLabel = new javax.swing.JLabel();
  56.124 +        subIndex = new javax.swing.JComboBox();
  56.125 +        jLabel1 = new javax.swing.JLabel();
  56.126 +
  56.127 +        setBorder(javax.swing.BorderFactory.createEmptyBorder(12, 12, 12, 12));
  56.128 +        setLayout(new java.awt.GridBagLayout());
  56.129 +
  56.130 +        folderPanel.setLayout(new java.awt.GridBagLayout());
  56.131 +
  56.132 +        org.openide.awt.Mnemonics.setLocalizedText(folderLabel, org.openide.util.NbBundle.getMessage(CustomizeRemoteIndex.class, "CustomizeRemoteIndex.folderLabel.text")); // NOI18N
  56.133 +        gridBagConstraints = new java.awt.GridBagConstraints();
  56.134 +        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
  56.135 +        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 6);
  56.136 +        folderPanel.add(folderLabel, gridBagConstraints);
  56.137 +
  56.138 +        org.openide.awt.Mnemonics.setLocalizedText(folderChooser, org.openide.util.NbBundle.getMessage(CustomizeRemoteIndex.class, "CustomizeRemoteIndex.folderChooser.text")); // NOI18N
  56.139 +        folderChooser.addActionListener(new java.awt.event.ActionListener() {
  56.140 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
  56.141 +                folderChooserActionPerformed(evt);
  56.142 +            }
  56.143 +        });
  56.144 +        gridBagConstraints = new java.awt.GridBagConstraints();
  56.145 +        gridBagConstraints.gridx = 2;
  56.146 +        gridBagConstraints.gridy = 0;
  56.147 +        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
  56.148 +        gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 0);
  56.149 +        folderPanel.add(folderChooser, gridBagConstraints);
  56.150 +
  56.151 +        folder.setText(org.openide.util.NbBundle.getMessage(CustomizeRemoteIndex.class, "CustomizeRemoteIndex.folder.text")); // NOI18N
  56.152 +        gridBagConstraints = new java.awt.GridBagConstraints();
  56.153 +        gridBagConstraints.gridx = 1;
  56.154 +        gridBagConstraints.gridy = 0;
  56.155 +        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
  56.156 +        gridBagConstraints.weightx = 1.0;
  56.157 +        folderPanel.add(folder, gridBagConstraints);
  56.158 +
  56.159 +        gridBagConstraints = new java.awt.GridBagConstraints();
  56.160 +        gridBagConstraints.gridx = 0;
  56.161 +        gridBagConstraints.gridy = 0;
  56.162 +        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
  56.163 +        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
  56.164 +        gridBagConstraints.weightx = 1.0;
  56.165 +        add(folderPanel, gridBagConstraints);
  56.166 +
  56.167 +        indexInfo.setColumns(20);
  56.168 +        indexInfo.setEditable(false);
  56.169 +        indexInfo.setRows(5);
  56.170 +        indexInfo.setBorder(null);
  56.171 +        gridBagConstraints = new java.awt.GridBagConstraints();
  56.172 +        gridBagConstraints.gridx = 0;
  56.173 +        gridBagConstraints.gridy = 2;
  56.174 +        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
  56.175 +        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
  56.176 +        gridBagConstraints.weightx = 1.0;
  56.177 +        gridBagConstraints.weighty = 1.0;
  56.178 +        gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 0);
  56.179 +        add(indexInfo, gridBagConstraints);
  56.180 +
  56.181 +        indexURL.setColumns(40);
  56.182 +        indexURL.setText(org.openide.util.NbBundle.getMessage(CustomizeRemoteIndex.class, "CustomizeRemoteIndex.indexURL.text")); // NOI18N
  56.183 +
  56.184 +        org.openide.awt.Mnemonics.setLocalizedText(indexURLLabel, org.openide.util.NbBundle.getMessage(CustomizeRemoteIndex.class, "CustomizeRemoteIndex.indexURLLabel.text")); // NOI18N
  56.185 +
  56.186 +        subIndex.addActionListener(new java.awt.event.ActionListener() {
  56.187 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
  56.188 +                subIndexActionPerformed(evt);
  56.189 +            }
  56.190 +        });
  56.191 +
  56.192 +        org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(CustomizeRemoteIndex.class, "CustomizeRemoteIndex.jLabel1.text")); // NOI18N
  56.193 +
  56.194 +        javax.swing.GroupLayout remoteIndexPanelLayout = new javax.swing.GroupLayout(remoteIndexPanel);
  56.195 +        remoteIndexPanel.setLayout(remoteIndexPanelLayout);
  56.196 +        remoteIndexPanelLayout.setHorizontalGroup(
  56.197 +            remoteIndexPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  56.198 +            .addGroup(remoteIndexPanelLayout.createSequentialGroup()
  56.199 +                .addContainerGap()
  56.200 +                .addGroup(remoteIndexPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  56.201 +                    .addGroup(remoteIndexPanelLayout.createSequentialGroup()
  56.202 +                        .addGap(12, 12, 12)
  56.203 +                        .addComponent(jLabel1)
  56.204 +                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  56.205 +                        .addComponent(subIndex, 0, 589, Short.MAX_VALUE))
  56.206 +                    .addGroup(remoteIndexPanelLayout.createSequentialGroup()
  56.207 +                        .addComponent(indexURLLabel)
  56.208 +                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  56.209 +                        .addComponent(indexURL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
  56.210 +                .addContainerGap())
  56.211 +        );
  56.212 +        remoteIndexPanelLayout.setVerticalGroup(
  56.213 +            remoteIndexPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  56.214 +            .addGroup(remoteIndexPanelLayout.createSequentialGroup()
  56.215 +                .addContainerGap()
  56.216 +                .addGroup(remoteIndexPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  56.217 +                    .addComponent(indexURLLabel)
  56.218 +                    .addComponent(indexURL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  56.219 +                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  56.220 +                .addGroup(remoteIndexPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  56.221 +                    .addComponent(jLabel1)
  56.222 +                    .addComponent(subIndex, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  56.223 +                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  56.224 +        );
  56.225 +
  56.226 +        gridBagConstraints = new java.awt.GridBagConstraints();
  56.227 +        gridBagConstraints.gridx = 0;
  56.228 +        gridBagConstraints.gridy = 1;
  56.229 +        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
  56.230 +        gridBagConstraints.weightx = 1.0;
  56.231 +        add(remoteIndexPanel, gridBagConstraints);
  56.232 +    }// </editor-fold>//GEN-END:initComponents
  56.233 +
  56.234 +    private void folderChooserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_folderChooserActionPerformed
  56.235 +        showFileChooser(folder);
  56.236 +}//GEN-LAST:event_folderChooserActionPerformed
  56.237 +
  56.238 +    private void subIndexActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_subIndexActionPerformed
  56.239 +        subindexSelectionUpdated();
  56.240 +    }//GEN-LAST:event_subIndexActionPerformed
  56.241 +
  56.242 +    // Variables declaration - do not modify//GEN-BEGIN:variables
  56.243 +    private javax.swing.ButtonGroup buttonGroup1;
  56.244 +    private javax.swing.JTextField folder;
  56.245 +    private javax.swing.JButton folderChooser;
  56.246 +    private javax.swing.JLabel folderLabel;
  56.247 +    private javax.swing.JPanel folderPanel;
  56.248 +    private javax.swing.JTextArea indexInfo;
  56.249 +    private javax.swing.JTextField indexURL;
  56.250 +    private javax.swing.JLabel indexURLLabel;
  56.251 +    private javax.swing.JLabel jLabel1;
  56.252 +    private javax.swing.JPanel remoteIndexPanel;
  56.253 +    private javax.swing.JComboBox subIndex;
  56.254 +    // End of variables declaration//GEN-END:variables
  56.255 +
  56.256 +    private void showFileChooser(JTextField folder) {
  56.257 +        JFileChooser c = new JFileChooser();
  56.258 +
  56.259 +        c.setSelectedFile(new File(folder.getText()));
  56.260 +        c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
  56.261 +        c.setMultiSelectionEnabled(false);
  56.262 +        c.setApproveButtonText("Select");
  56.263 +
  56.264 +        if (c.showDialog(this, null) == JFileChooser.APPROVE_OPTION) {
  56.265 +            folder.setText(c.getSelectedFile().getAbsolutePath());
  56.266 +        }
  56.267 +    }
  56.268 +
  56.269 +    public void setIndex(RemoteIndex index) {
  56.270 +        folder.setText(index.folder);
  56.271 +        indexURL.setText(index.remote.toExternalForm());
  56.272 +        subIndex.setSelectedItem(index.remoteSegment);
  56.273 +    }
  56.274 +
  56.275 +    public RemoteIndex getIndex() {
  56.276 +        try {
  56.277 +            return RemoteIndex.create(folder.getText(), new URL(indexURL.getText()), (String) subIndex.getSelectedItem());
  56.278 +        } catch (MalformedURLException ex) {
  56.279 +            throw new IllegalStateException(ex);
  56.280 +        }
  56.281 +    }
  56.282 +
  56.283 +    private NotificationLineSupport notificationSupport;
  56.284 +
  56.285 +    public void setNotificationSupport(NotificationLineSupport notificationSupport) {
  56.286 +        this.notificationSupport = notificationSupport;
  56.287 +    }
  56.288 +
  56.289 +    private void updateErrors() {
  56.290 +        notificationSupport.clearMessages();
  56.291 +        
  56.292 +        File folderFile = new File(folder.getText());
  56.293 +
  56.294 +        if (!folderFile.exists()) {
  56.295 +            notificationSupport.setErrorMessage("Specified directory does not exist.");
  56.296 +            okButton.setEnabled(false);
  56.297 +            return;
  56.298 +        }
  56.299 +
  56.300 +        if (!folderFile.isDirectory()) {
  56.301 +            notificationSupport.setErrorMessage("Specified directory is not directory.");
  56.302 +            okButton.setEnabled(false);
  56.303 +            return ;
  56.304 +        }
  56.305 +
  56.306 +        if (checkingIndexURL.get()) {
  56.307 +            notificationSupport.setInformationMessage("Checking index URL");
  56.308 +            okButton.setEnabled(false);
  56.309 +            return;
  56.310 +        }
  56.311 +
  56.312 +        String urlError = checkingIndexURLError.get();
  56.313 +
  56.314 +        if (urlError != null) {
  56.315 +            notificationSupport.setErrorMessage(urlError);
  56.316 +            okButton.setEnabled(false);
  56.317 +            return;
  56.318 +        }
  56.319 +        
  56.320 +        okButton.setEnabled(true);
  56.321 +    }
  56.322 +
  56.323 +    private final AtomicBoolean checkingIndexURL = new AtomicBoolean();
  56.324 +    private final AtomicReference<String> checkingIndexURLContentCopy = new AtomicReference<String>();
  56.325 +    private final AtomicReference<String> checkingIndexURLError = new AtomicReference<String>();
  56.326 +
  56.327 +    private void indexURLUpdated() {
  56.328 +        checkingIndexURLContentCopy.set(indexURL.getText());
  56.329 +        urlCheckerTask.cancel();
  56.330 +        urlCheckerTask.schedule(50);
  56.331 +    }
  56.332 +
  56.333 +    private static final RequestProcessor WORKER = new RequestProcessor(CustomizeRemoteIndex.class.getName(), 1, false, false);
  56.334 +    private final RequestProcessor.Task urlCheckerTask = WORKER.create(new Runnable() {
  56.335 +
  56.336 +        public void run() {
  56.337 +            checkingIndexURL.set(true);
  56.338 +            checkingIndexURLError.set(null);
  56.339 +
  56.340 +            SwingUtilities.invokeLater(new Runnable() {
  56.341 +                public void run() {
  56.342 +                    updateErrors();
  56.343 +                }
  56.344 +            });
  56.345 +
  56.346 +            String urlText = checkingIndexURLContentCopy.get();
  56.347 +            Collection<? extends String> subindices = null;
  56.348 +
  56.349 +            try {
  56.350 +                URL url = new URL(urlText);
  56.351 +
  56.352 +                if (!url.getPath().endsWith("/"))
  56.353 +                    url = new URL(url.getProtocol(), url.getHost(), url.getPort(), url.getPath() + "/" + (url.getQuery() != null ? "?" + url.getQuery() : ""));
  56.354 +                
  56.355 +                subindices = WebUtilities.requestStringArrayResponse(url.toURI().resolve("list"));
  56.356 +
  56.357 +                if (subindices.isEmpty()) {
  56.358 +                   checkingIndexURLError.set("Not an index.");
  56.359 +                }
  56.360 +            } catch (URISyntaxException ex) {
  56.361 +                checkingIndexURLError.set(ex.getLocalizedMessage());
  56.362 +            } catch (MalformedURLException ex) {
  56.363 +                checkingIndexURLError.set(ex.getLocalizedMessage());
  56.364 +            } catch (ThreadDeath td) {
  56.365 +                throw td;
  56.366 +            } catch (Throwable t) {//#6541019
  56.367 +                checkingIndexURLError.set("Invalid URL");
  56.368 +            }
  56.369 +            
  56.370 +            checkingIndexURL.set(false);
  56.371 +
  56.372 +            final Collection<? extends String> subindicesFinal = subindices;
  56.373 +
  56.374 +            SwingUtilities.invokeLater(new Runnable() {
  56.375 +                public void run() {
  56.376 +                    updateErrors();
  56.377 +
  56.378 +                    if (subindicesFinal == null || subindicesFinal.isEmpty()) return;
  56.379 +
  56.380 +                    DefaultComboBoxModel model = (DefaultComboBoxModel) subIndex.getModel();
  56.381 +                    String selected = (String) model.getSelectedItem();
  56.382 +
  56.383 +                    model.removeAllElements();
  56.384 +
  56.385 +                    boolean containsSelection = false;
  56.386 +                    Map<String, String> displayNames = new HashMap<String, String>();
  56.387 +
  56.388 +                    for (String subindex : subindicesFinal) {
  56.389 +                        String[] subindexSplit = subindex.split(":", 2);
  56.390 +                        if (subindexSplit[0].equals(selected)) containsSelection = true;
  56.391 +                        model.addElement(subindexSplit[0]);
  56.392 +                        displayNames.put(subindexSplit[0], subindexSplit[1]);
  56.393 +                    }
  56.394 +
  56.395 +                    if (containsSelection) {
  56.396 +                        model.setSelectedItem(selected);
  56.397 +                    }
  56.398 +
  56.399 +                    subindexSelectionUpdated();
  56.400 +                    subIndex.setRenderer(new RendererImpl(displayNames));
  56.401 +                }
  56.402 +            });
  56.403 +        }
  56.404 +    });
  56.405 +
  56.406 +    private final AtomicReference<String> indexInfoURLContentCopy = new AtomicReference<String>();
  56.407 +    private final AtomicReference<String> indexInfoSubIndexCopy = new AtomicReference<String>();
  56.408 +    private void subindexSelectionUpdated() {
  56.409 +        indexInfoURLContentCopy.set(indexURL.getText());
  56.410 +        indexInfoSubIndexCopy.set((String) subIndex.getSelectedItem());
  56.411 +        indexInfoTask.cancel();
  56.412 +        indexInfoTask.schedule(50);
  56.413 +    }
  56.414 +
  56.415 +    private final RequestProcessor.Task indexInfoTask = WORKER.create(new Runnable() {
  56.416 +
  56.417 +        public void run() {
  56.418 +            //XXX: the index currently does not provide the info anyway...
  56.419 +//            String urlText = indexInfoURLContentCopy.get();
  56.420 +//            String subIndex = indexInfoSubIndexCopy.get();
  56.421 +//            IndexInfo info = null;
  56.422 +//
  56.423 +//            try {
  56.424 +//                URL url = new URL(urlText);
  56.425 +//
  56.426 +//                if (!url.getPath().endsWith("/"))
  56.427 +//                    url = new URL(url.getProtocol(), url.getHost(), url.getPort(), url.getPath() + "/" + (url.getQuery() != null ? "?" + url.getQuery() : ""));
  56.428 +//
  56.429 +//                String indexInfoText = WebUtilities.requestStringResponse(url.toURI().resolve("info?path=" + WebUtilities.escapeForQuery(subIndex)));
  56.430 +//                info = IndexInfo.empty();
  56.431 +//
  56.432 +//                if (indexInfoText != null)
  56.433 +//                    Pojson.update(info, indexInfoText);
  56.434 +//            } catch (URISyntaxException ex) {
  56.435 +//                Logger.getLogger(CustomizeRemoteIndex.class.getName()).log(Level.FINE, null, ex);
  56.436 +//            } catch (MalformedURLException ex) {
  56.437 +//                Logger.getLogger(CustomizeRemoteIndex.class.getName()).log(Level.FINE, null, ex);
  56.438 +//            }
  56.439 +//
  56.440 +//            final IndexInfo infoFinal = info;
  56.441 +//
  56.442 +//            SwingUtilities.invokeLater(new Runnable() {
  56.443 +//                public void run() {
  56.444 +//                    if (infoFinal != null) {
  56.445 +//                        indexInfo.setText(toDisplayText(infoFinal));
  56.446 +//                    } else {
  56.447 +//                        indexInfo.setText("");
  56.448 +//                    }
  56.449 +//                }
  56.450 +//            });
  56.451 +        }
  56.452 +    });
  56.453 +
  56.454 +//    private static String toDisplayText(IndexInfo info) {
  56.455 +//        StringBuilder sb = new StringBuilder();
  56.456 +//
  56.457 +//        if (info.sourceLocation != null) {
  56.458 +//            sb.append("Source Location: ").append(info.sourceLocation).append("\n");
  56.459 +//        }
  56.460 +//        if (info.lastUpdate >= 0) {
  56.461 +//            sb.append("Last Update:\t").append(DateFormat.getDateTimeInstance().format(new Date(info.lastUpdate))).append("\n");
  56.462 +//        }
  56.463 +//        if (info.totalFiles >= 0) {
  56.464 +//            sb.append("Indexed Files:\t").append(info.totalFiles).append("\n");
  56.465 +//        }
  56.466 +//
  56.467 +//        return sb.toString();
  56.468 +//    }
  56.469 +
  56.470 +    private static final class RendererImpl extends DefaultListCellRenderer {
  56.471 +        private final Map<String, String> displayNames;
  56.472 +        public RendererImpl(Map<String, String> displayNames) {
  56.473 +            this.displayNames = displayNames;
  56.474 +        }
  56.475 +
  56.476 +        @Override
  56.477 +        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
  56.478 +            return super.getListCellRendererComponent(list, displayNames.get(value), index, isSelected, cellHasFocus);
  56.479 +        }
  56.480 +
  56.481 +    }
  56.482 +}
    57.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.2 +++ b/remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/options/IndexOptionsPanelController.java	Thu Jun 23 15:07:16 2011 +0200
    57.3 @@ -0,0 +1,113 @@
    57.4 +/*
    57.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    57.6 + *
    57.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
    57.8 + *
    57.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   57.10 + * Other names may be trademarks of their respective owners.
   57.11 + *
   57.12 + * The contents of this file are subject to the terms of either the GNU
   57.13 + * General Public License Version 2 only ("GPL") or the Common
   57.14 + * Development and Distribution License("CDDL") (collectively, the
   57.15 + * "License"). You may not use this file except in compliance with the
   57.16 + * License. You can obtain a copy of the License at
   57.17 + * http://www.netbeans.org/cddl-gplv2.html
   57.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   57.19 + * specific language governing permissions and limitations under the
   57.20 + * License.  When distributing the software, include this License Header
   57.21 + * Notice in each file and include the License file at
   57.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   57.23 + * particular file as subject to the "Classpath" exception as provided
   57.24 + * by Oracle in the GPL Version 2 section of the License file that
   57.25 + * accompanied this code. If applicable, add the following below the
   57.26 + * License Header, with the fields enclosed by brackets [] replaced by
   57.27 + * your own identifying information:
   57.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   57.29 + *
   57.30 + * If you wish your version of this file to be governed by only the CDDL
   57.31 + * or only the GPL Version 2, indicate your decision by adding
   57.32 + * "[Contributor] elects to include this software in this distribution
   57.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   57.34 + * single choice of license, a recipient has the option to distribute
   57.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   57.36 + * to extend the choice of license to its licensees as provided above.
   57.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   57.38 + * Version 2 license, then the option applies only if the new code is
   57.39 + * made subject to such option by the copyright holder.
   57.40 + *
   57.41 + * Contributor(s):
   57.42 + *
   57.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
   57.44 + */
   57.45 +package org.netbeans.modules.jackpot30.remotingapi.options;
   57.46 +
   57.47 +import java.beans.PropertyChangeListener;
   57.48 +import java.beans.PropertyChangeSupport;
   57.49 +import javax.swing.JComponent;
   57.50 +import org.netbeans.spi.options.OptionsPanelController;
   57.51 +import org.openide.util.HelpCtx;
   57.52 +import org.openide.util.Lookup;
   57.53 +
   57.54 +@OptionsPanelController.SubRegistration(location = "Editor",
   57.55 +displayName = "#AdvancedOption_DisplayName_Index",
   57.56 +keywords = "#AdvancedOption_Keywords_Index",
   57.57 +keywordsCategory = "Editor/Index")
   57.58 +public final class IndexOptionsPanelController extends OptionsPanelController {
   57.59 +
   57.60 +    private IndexPanel panel;
   57.61 +    private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
   57.62 +    private boolean changed;
   57.63 +
   57.64 +    public void update() {
   57.65 +        getPanel().load();
   57.66 +        changed = false;
   57.67 +    }
   57.68 +
   57.69 +    public void applyChanges() {
   57.70 +        getPanel().store();
   57.71 +        changed = false;
   57.72 +    }
   57.73 +
   57.74 +    public void cancel() {
   57.75 +        // need not do anything special, if no changes have been persisted yet
   57.76 +    }
   57.77 +
   57.78 +    public boolean isValid() {
   57.79 +        return getPanel().valid();
   57.80 +    }
   57.81 +
   57.82 +    public boolean isChanged() {
   57.83 +        return changed;
   57.84 +    }
   57.85 +
   57.86 +    public HelpCtx getHelpCtx() {
   57.87 +        return null; // new HelpCtx("...ID") if you have a help set
   57.88 +    }
   57.89 +
   57.90 +    public JComponent getComponent(Lookup masterLookup) {
   57.91 +        return getPanel();
   57.92 +    }
   57.93 +
   57.94 +    public void addPropertyChangeListener(PropertyChangeListener l) {
   57.95 +        pcs.addPropertyChangeListener(l);
   57.96 +    }
   57.97 +
   57.98 +    public void removePropertyChangeListener(PropertyChangeListener l) {
   57.99 +        pcs.removePropertyChangeListener(l);
  57.100 +    }
  57.101 +
  57.102 +    private IndexPanel getPanel() {
  57.103 +        if (panel == null) {
  57.104 +            panel = new IndexPanel(this);
  57.105 +        }
  57.106 +        return panel;
  57.107 +    }
  57.108 +
  57.109 +    void changed() {
  57.110 +        if (!changed) {
  57.111 +            changed = true;
  57.112 +            pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
  57.113 +        }
  57.114 +        pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
  57.115 +    }
  57.116 +}
    58.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.2 +++ b/remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/options/IndexPanel.form	Thu Jun 23 15:07:16 2011 +0200
    58.3 @@ -0,0 +1,106 @@
    58.4 +<?xml version="1.1" encoding="UTF-8" ?>
    58.5 +
    58.6 +<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
    58.7 +  <AuxValues>
    58.8 +    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
    58.9 +    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
   58.10 +    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
   58.11 +    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
   58.12 +    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
   58.13 +    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
   58.14 +    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
   58.15 +    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
   58.16 +    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
   58.17 +  </AuxValues>
   58.18 +
   58.19 +  <Layout>
   58.20 +    <DimensionLayout dim="0">
   58.21 +      <Group type="103" groupAlignment="0" attributes="0">
   58.22 +          <Group type="102" alignment="1" attributes="0">
   58.23 +              <EmptySpace max="-2" attributes="0"/>
   58.24 +              <Component id="jScrollPane1" pref="281" max="32767" attributes="0"/>
   58.25 +              <EmptySpace max="-2" attributes="0"/>
   58.26 +              <Group type="103" groupAlignment="1" attributes="0">
   58.27 +                  <Component id="removeButton" alignment="1" pref="154" max="32767" attributes="1"/>
   58.28 +                  <Component id="addButton" alignment="1" pref="154" max="32767" attributes="1"/>
   58.29 +                  <Component id="editButton" alignment="1" pref="154" max="32767" attributes="0"/>
   58.30 +              </Group>
   58.31 +              <EmptySpace max="-2" attributes="0"/>
   58.32 +          </Group>
   58.33 +      </Group>
   58.34 +    </DimensionLayout>
   58.35 +    <DimensionLayout dim="1">
   58.36 +      <Group type="103" groupAlignment="0" attributes="0">
   58.37 +          <Group type="102" alignment="0" attributes="0">
   58.38 +              <EmptySpace max="-2" attributes="0"/>
   58.39 +              <Group type="103" groupAlignment="0" attributes="0">
   58.40 +                  <Component id="jScrollPane1" alignment="0" pref="306" max="32767" attributes="0"/>
   58.41 +                  <Group type="102" alignment="0" attributes="0">
   58.42 +                      <Component id="addButton" min="-2" max="-2" attributes="0"/>
   58.43 +                      <EmptySpace max="-2" attributes="0"/>
   58.44 +                      <Component id="editButton" min="-2" max="-2" attributes="0"/>
   58.45 +                      <EmptySpace max="-2" attributes="0"/>
   58.46 +                      <Component id="removeButton" min="-2" max="-2" attributes="0"/>
   58.47 +                  </Group>
   58.48 +              </Group>
   58.49 +              <EmptySpace max="-2" attributes="0"/>
   58.50 +          </Group>
   58.51 +      </Group>
   58.52 +    </DimensionLayout>
   58.53 +  </Layout>
   58.54 +  <SubComponents>
   58.55 +    <Container class="javax.swing.JScrollPane" name="jScrollPane1">
   58.56 +      <AuxValues>
   58.57 +        <AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
   58.58 +        <AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
   58.59 +        <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
   58.60 +      </AuxValues>
   58.61 +
   58.62 +      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
   58.63 +      <SubComponents>
   58.64 +        <Component class="javax.swing.JTable" name="indices">
   58.65 +          <Properties>
   58.66 +            <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
   58.67 +              <Table columnCount="4" rowCount="4">
   58.68 +                <Column editable="true" title="Title 1" type="java.lang.Object"/>
   58.69 +                <Column editable="true" title="Title 2" type="java.lang.Object"/>
   58.70 +                <Column editable="true" title="Title 3" type="java.lang.Object"/>
   58.71 +                <Column editable="true" title="Title 4" type="java.lang.Object"/>
   58.72 +              </Table>
   58.73 +            </Property>
   58.74 +          </Properties>
   58.75 +        </Component>
   58.76 +      </SubComponents>
   58.77 +    </Container>
   58.78 +    <Component class="javax.swing.JButton" name="addButton">
   58.79 +      <Properties>
   58.80 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   58.81 +          <ResourceString bundle="org/netbeans/modules/jackpot30/remotingapi/options/Bundle.properties" key="IndexPanel.addButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
   58.82 +        </Property>
   58.83 +      </Properties>
   58.84 +      <Events>
   58.85 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addButtonActionPerformed"/>
   58.86 +      </Events>
   58.87 +    </Component>
   58.88 +    <Component class="javax.swing.JButton" name="removeButton">
   58.89 +      <Properties>
   58.90 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   58.91 +          <ResourceString bundle="org/netbeans/modules/jackpot30/remotingapi/options/Bundle.properties" key="IndexPanel.removeButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
   58.92 +        </Property>
   58.93 +      </Properties>
   58.94 +      <Events>
   58.95 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="removeButtonActionPerformed"/>
   58.96 +      </Events>
   58.97 +    </Component>
   58.98 +    <Component class="javax.swing.JButton" name="editButton">
   58.99 +      <Properties>
  58.100 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  58.101 +          <ResourceString bundle="org/netbeans/modules/jackpot30/remotingapi/options/Bundle.properties" key="IndexPanel.editButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  58.102 +        </Property>
  58.103 +      </Properties>
  58.104 +      <Events>
  58.105 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="editButtonActionPerformed"/>
  58.106 +      </Events>
  58.107 +    </Component>
  58.108 +  </SubComponents>
  58.109 +</Form>
    59.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    59.2 +++ b/remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/options/IndexPanel.java	Thu Jun 23 15:07:16 2011 +0200
    59.3 @@ -0,0 +1,265 @@
    59.4 +/*
    59.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    59.6 + *
    59.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
    59.8 + *
    59.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   59.10 + * Other names may be trademarks of their respective owners.
   59.11 + *
   59.12 + * The contents of this file are subject to the terms of either the GNU
   59.13 + * General Public License Version 2 only ("GPL") or the Common
   59.14 + * Development and Distribution License("CDDL") (collectively, the
   59.15 + * "License"). You may not use this file except in compliance with the
   59.16 + * License. You can obtain a copy of the License at
   59.17 + * http://www.netbeans.org/cddl-gplv2.html
   59.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   59.19 + * specific language governing permissions and limitations under the
   59.20 + * License.  When distributing the software, include this License Header
   59.21 + * Notice in each file and include the License file at
   59.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   59.23 + * particular file as subject to the "Classpath" exception as provided
   59.24 + * by Oracle in the GPL Version 2 section of the License file that
   59.25 + * accompanied this code. If applicable, add the following below the
   59.26 + * License Header, with the fields enclosed by brackets [] replaced by
   59.27 + * your own identifying information:
   59.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   59.29 + *
   59.30 + * If you wish your version of this file to be governed by only the CDDL
   59.31 + * or only the GPL Version 2, indicate your decision by adding
   59.32 + * "[Contributor] elects to include this software in this distribution
   59.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   59.34 + * single choice of license, a recipient has the option to distribute
   59.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   59.36 + * to extend the choice of license to its licensees as provided above.
   59.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   59.38 + * Version 2 license, then the option applies only if the new code is
   59.39 + * made subject to such option by the copyright holder.
   59.40 + *
   59.41 + * Contributor(s):
   59.42 + *
   59.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
   59.44 + */
   59.45 +package org.netbeans.modules.jackpot30.remotingapi.options;
   59.46 +
   59.47 +import java.util.ArrayList;
   59.48 +import java.util.List;
   59.49 +import javax.swing.JButton;
   59.50 +import javax.swing.event.ListSelectionEvent;
   59.51 +import javax.swing.event.ListSelectionListener;
   59.52 +import javax.swing.table.AbstractTableModel;
   59.53 +import org.netbeans.modules.jackpot30.remoting.api.RemoteIndex;
   59.54 +import org.openide.DialogDescriptor;
   59.55 +import org.openide.DialogDisplayer;
   59.56 +
   59.57 +final class IndexPanel extends javax.swing.JPanel {
   59.58 +
   59.59 +    private final IndexOptionsPanelController controller;
   59.60 +
   59.61 +    IndexPanel(IndexOptionsPanelController controller) {
   59.62 +        this.controller = controller;
   59.63 +        initComponents();
   59.64 +        indices.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
   59.65 +            public void valueChanged(ListSelectionEvent e) {
   59.66 +                enableDisable();
   59.67 +            }
   59.68 +        });
   59.69 +        enableDisable();
   59.70 +    }
   59.71 +
   59.72 +    /** This method is called from within the constructor to
   59.73 +     * initialize the form.
   59.74 +     * WARNING: Do NOT modify this code. The content of this method is
   59.75 +     * always regenerated by the Form Editor.
   59.76 +     */
   59.77 +    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
   59.78 +    private void initComponents() {
   59.79 +
   59.80 +        javax.swing.JScrollPane jScrollPane1 = new javax.swing.JScrollPane();
   59.81 +        indices = new javax.swing.JTable();
   59.82 +        addButton = new javax.swing.JButton();
   59.83 +        removeButton = new javax.swing.JButton();
   59.84 +        editButton = new javax.swing.JButton();
   59.85 +
   59.86 +        indices.setModel(new javax.swing.table.DefaultTableModel(
   59.87 +            new Object [][] {
   59.88 +                {null, null, null, null},
   59.89 +                {null, null, null, null},
   59.90 +                {null, null, null, null},
   59.91 +                {null, null, null, null}
   59.92 +            },
   59.93 +            new String [] {
   59.94 +                "Title 1", "Title 2", "Title 3", "Title 4"
   59.95 +            }
   59.96 +        ));
   59.97 +        jScrollPane1.setViewportView(indices);
   59.98 +
   59.99 +        org.openide.awt.Mnemonics.setLocalizedText(addButton, org.openide.util.NbBundle.getMessage(IndexPanel.class, "IndexPanel.addButton.text")); // NOI18N
  59.100 +        addButton.addActionListener(new java.awt.event.ActionListener() {
  59.101 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
  59.102 +                addButtonActionPerformed(evt);
  59.103 +            }
  59.104 +        });
  59.105 +
  59.106 +        org.openide.awt.Mnemonics.setLocalizedText(removeButton, org.openide.util.NbBundle.getMessage(IndexPanel.class, "IndexPanel.removeButton.text")); // NOI18N
  59.107 +        removeButton.addActionListener(new java.awt.event.ActionListener() {
  59.108 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
  59.109 +                removeButtonActionPerformed(evt);
  59.110 +            }
  59.111 +        });
  59.112 +
  59.113 +        org.openide.awt.Mnemonics.setLocalizedText(editButton, org.openide.util.NbBundle.getMessage(IndexPanel.class, "IndexPanel.editButton.text")); // NOI18N
  59.114 +        editButton.addActionListener(new java.awt.event.ActionListener() {
  59.115 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
  59.116 +                editButtonActionPerformed(evt);
  59.117 +            }
  59.118 +        });
  59.119 +
  59.120 +        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
  59.121 +        this.setLayout(layout);
  59.122 +        layout.setHorizontalGroup(
  59.123 +            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  59.124 +            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
  59.125 +                .addContainerGap()
  59.126 +                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 281, Short.MAX_VALUE)
  59.127 +                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  59.128 +                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  59.129 +                    .addComponent(removeButton, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE)
  59.130 +                    .addComponent(addButton, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE)
  59.131 +                    .addComponent(editButton, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE))
  59.132 +                .addContainerGap())
  59.133 +        );
  59.134 +        layout.setVerticalGroup(
  59.135 +            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  59.136 +            .addGroup(layout.createSequentialGroup()
  59.137 +                .addContainerGap()
  59.138 +                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  59.139 +                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE)
  59.140 +                    .addGroup(layout.createSequentialGroup()
  59.141 +                        .addComponent(addButton)
  59.142 +                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  59.143 +                        .addComponent(editButton)
  59.144 +                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  59.145 +                        .addComponent(removeButton)))
  59.146 +                .addContainerGap())
  59.147 +        );
  59.148 +    }// </editor-fold>//GEN-END:initComponents
  59.149 +
  59.150 +    private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed
  59.151 +        addEditIndex(false);
  59.152 +    }//GEN-LAST:event_addButtonActionPerformed
  59.153 +
  59.154 +    private void editButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editButtonActionPerformed
  59.155 +        addEditIndex(true);
  59.156 +    }//GEN-LAST:event_editButtonActionPerformed
  59.157 +
  59.158 +    private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed
  59.159 +        TableModelImpl model = (TableModelImpl) indices.getModel();
  59.160 +
  59.161 +        model.indices.remove(indices.getSelectedRow());
  59.162 +        model.fireTableDataChanged();
  59.163 +    }//GEN-LAST:event_removeButtonActionPerformed
  59.164 +
  59.165 +    private void addEditIndex(boolean edit) {
  59.166 +        JButton okButton = new JButton("OK");
  59.167 +        CustomizeRemoteIndex panel = new CustomizeRemoteIndex(okButton);
  59.168 +        DialogDescriptor dd = new DialogDescriptor(panel, edit ? "Edit Index" : "Add Index", true, new Object[] {okButton, DialogDescriptor.CANCEL_OPTION}, okButton, DialogDescriptor.DEFAULT_ALIGN, null, null);
  59.169 +
  59.170 +        dd.setClosingOptions(null);
  59.171 +        panel.setNotificationSupport(dd.createNotificationLineSupport());
  59.172 +
  59.173 +        TableModelImpl model = (TableModelImpl) indices.getModel();
  59.174 +
  59.175 +        if (edit) {
  59.176 +            panel.setIndex(model.indices.get(indices.getSelectedRow()));
  59.177 +        }
  59.178 +
  59.179 +        if (DialogDisplayer.getDefault().notify(dd) == okButton) {
  59.180 +            RemoteIndex remoteIndex = panel.getIndex();
  59.181 +
  59.182 +            if (edit) {
  59.183 +                int index = model.indices.indexOf(indices.getSelectedRow());
  59.184 +
  59.185 +                model.indices.remove(index);
  59.186 +                model.indices.add(index, remoteIndex);
  59.187 +            } else {
  59.188 +                model.indices.add(remoteIndex);
  59.189 +            }
  59.190 +
  59.191 +            model.fireTableDataChanged();
  59.192 +        }
  59.193 +    }
  59.194 +
  59.195 +    private void enableDisable() {
  59.196 +        if (indices.getSelectedRow() != (-1)) {
  59.197 +            editButton.setEnabled(true);
  59.198 +            removeButton.setEnabled(true);
  59.199 +        } else {
  59.200 +            editButton.setEnabled(false);
  59.201 +            removeButton.setEnabled(false);
  59.202 +        }
  59.203 +    }
  59.204 +
  59.205 +    void load() {
  59.206 +        TableModelImpl model = new TableModelImpl();
  59.207 +
  59.208 +        for (RemoteIndex idx : RemoteIndex.loadIndices()) {
  59.209 +            model.indices.add(idx);
  59.210 +        }
  59.211 +
  59.212 +        indices.setModel(model);
  59.213 +    }
  59.214 +
  59.215 +    void store() {
  59.216 +        TableModelImpl model = (TableModelImpl) indices.getModel();
  59.217 +        
  59.218 +        RemoteIndex.saveIndices(model.indices);
  59.219 +    }
  59.220 +
  59.221 +    boolean valid() {
  59.222 +        // TODO check whether form is consistent and complete
  59.223 +        return true;
  59.224 +    }
  59.225 +    // Variables declaration - do not modify//GEN-BEGIN:variables
  59.226 +    private javax.swing.JButton addButton;
  59.227 +    private javax.swing.JButton editButton;
  59.228 +    private javax.swing.JTable indices;
  59.229 +    private javax.swing.JButton removeButton;
  59.230 +    // End of variables declaration//GEN-END:variables
  59.231 +
  59.232 +    private static final class TableModelImpl extends AbstractTableModel {
  59.233 +
  59.234 +        private final List<RemoteIndex> indices = new ArrayList<RemoteIndex>();
  59.235 +
  59.236 +        public int getRowCount() {
  59.237 +            return indices.size();
  59.238 +        }
  59.239 +
  59.240 +        public int getColumnCount() {
  59.241 +            return 3;
  59.242 +        }
  59.243 +
  59.244 +        public String getColumnName(int columnIndex) {
  59.245 +            switch (columnIndex) {
  59.246 +                case 0: return "Local folder";
  59.247 +                case 1: return "Remote URL";
  59.248 +                case 2: return "Remote project";
  59.249 +                default: throw new IllegalStateException();
  59.250 +            }
  59.251 +        }
  59.252 +
  59.253 +        public Class<?> getColumnClass(int columnIndex) {
  59.254 +            return String.class;
  59.255 +        }
  59.256 +
  59.257 +        public Object getValueAt(int rowIndex, int columnIndex) {
  59.258 +            RemoteIndex idx = indices.get(rowIndex);
  59.259 +
  59.260 +            switch (columnIndex) {
  59.261 +                case 0: return idx.folder;
  59.262 +                case 1: return idx.remote.toExternalForm();
  59.263 +                case 2: return idx.remoteSegment;
  59.264 +                default: throw new IllegalStateException();
  59.265 +            }
  59.266 +        }
  59.267 +    }
  59.268 +}
    60.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.2 +++ b/remoting/ide/build.xml	Thu Jun 23 15:07:16 2011 +0200
    60.3 @@ -0,0 +1,8 @@
    60.4 +<?xml version="1.0" encoding="UTF-8"?>
    60.5 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
    60.6 +<!-- for some information on what you could do (e.g. targets to override). -->
    60.7 +<!-- If you delete this file and reopen the project it will be recreated. -->
    60.8 +<project name="ide" basedir=".">
    60.9 +    <description>Builds the module suite ide.</description>
   60.10 +    <import file="nbproject/build-impl.xml"/>
   60.11 +</project>
    61.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    61.2 +++ b/remoting/ide/jumpto/build.xml	Thu Jun 23 15:07:16 2011 +0200
    61.3 @@ -0,0 +1,9 @@
    61.4 +<?xml version="1.0" encoding="UTF-8"?>
    61.5 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
    61.6 +<!-- for some information on what you could do (e.g. targets to override). -->
    61.7 +<!-- If you delete this file and reopen the project it will be recreated. -->
    61.8 +<project name="org.netbeans.modules.jackpot30.jumpto" default="netbeans" basedir=".">
    61.9 +    <description>Builds, tests, and runs the project org.netbeans.modules.jackpot30.jumpto.</description>
   61.10 +    <import file="nbproject/build-impl.xml"/>
   61.11 +<!--    <import file="${suite.dir}/findbugs-import.xml"/>-->
   61.12 +</project>
    62.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.2 +++ b/remoting/ide/jumpto/manifest.mf	Thu Jun 23 15:07:16 2011 +0200
    62.3 @@ -0,0 +1,5 @@
    62.4 +Manifest-Version: 1.0
    62.5 +OpenIDE-Module: org.netbeans.modules.jackpot30.jumpto
    62.6 +OpenIDE-Module-Implementation-Version: 1
    62.7 +OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jackpot30/jumpto/Bundle.properties
    62.8 +
    63.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    63.2 +++ b/remoting/ide/jumpto/nbproject/build-impl.xml	Thu Jun 23 15:07:16 2011 +0200
    63.3 @@ -0,0 +1,45 @@
    63.4 +<?xml version="1.0" encoding="UTF-8"?>
    63.5 +<!--
    63.6 +*** GENERATED FROM project.xml - DO NOT EDIT  ***
    63.7 +***         EDIT ../build.xml INSTEAD         ***
    63.8 +-->
    63.9 +<project name="org.netbeans.modules.jackpot30.jumpto-impl" basedir="..">
   63.10 +    <fail message="Please build using Ant 1.7.1 or higher.">
   63.11 +        <condition>
   63.12 +            <not>
   63.13 +                <antversion atleast="1.7.1"/>
   63.14 +            </not>
   63.15 +        </condition>
   63.16 +    </fail>
   63.17 +    <property file="nbproject/private/suite-private.properties"/>
   63.18 +    <property file="nbproject/suite.properties"/>
   63.19 +    <fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
   63.20 +    <property file="${suite.dir}/nbproject/private/platform-private.properties"/>
   63.21 +    <property file="${suite.dir}/nbproject/platform.properties"/>
   63.22 +    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
   63.23 +        <attribute name="name"/>
   63.24 +        <attribute name="value"/>
   63.25 +        <sequential>
   63.26 +            <property name="@{name}" value="${@{value}}"/>
   63.27 +        </sequential>
   63.28 +    </macrodef>
   63.29 +    <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
   63.30 +        <attribute name="property"/>
   63.31 +        <attribute name="value"/>
   63.32 +        <sequential>
   63.33 +            <property name="@{property}" value="@{value}"/>
   63.34 +        </sequential>
   63.35 +    </macrodef>
   63.36 +    <property file="${user.properties.file}"/>
   63.37 +    <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
   63.38 +    <nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
   63.39 +    <nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
   63.40 +    <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
   63.41 +        <condition>
   63.42 +            <not>
   63.43 +                <contains string="${cluster.path.evaluated}" substring="platform"/>
   63.44 +            </not>
   63.45 +        </condition>
   63.46 +    </fail>
   63.47 +    <import file="${harness.dir}/build.xml"/>
   63.48 +</project>
    64.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.2 +++ b/remoting/ide/jumpto/nbproject/genfiles.properties	Thu Jun 23 15:07:16 2011 +0200
    64.3 @@ -0,0 +1,8 @@
    64.4 +build.xml.data.CRC32=14c2e29c
    64.5 +build.xml.script.CRC32=c7b5d9b7
    64.6 +build.xml.stylesheet.CRC32=a56c6a5b@1.45
    64.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
    64.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    64.9 +nbproject/build-impl.xml.data.CRC32=60391694
   64.10 +nbproject/build-impl.xml.script.CRC32=3404573f
   64.11 +nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.47
    65.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.2 +++ b/remoting/ide/jumpto/nbproject/project.properties	Thu Jun 23 15:07:16 2011 +0200
    65.3 @@ -0,0 +1,3 @@
    65.4 +javac.source=1.6
    65.5 +javac.compilerargs=-Xlint -Xlint:-serial
    65.6 +spec.version.base=1.0
    66.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    66.2 +++ b/remoting/ide/jumpto/nbproject/project.xml	Thu Jun 23 15:07:16 2011 +0200
    66.3 @@ -0,0 +1,97 @@
    66.4 +<?xml version="1.0" encoding="UTF-8"?>
    66.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
    66.6 +    <type>org.netbeans.modules.apisupport.project</type>
    66.7 +    <configuration>
    66.8 +        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
    66.9 +            <code-name-base>org.netbeans.modules.jackpot30.jumpto</code-name-base>
   66.10 +            <suite-component/>
   66.11 +            <module-dependencies>
   66.12 +                <dependency>
   66.13 +                    <code-name-base>org.netbeans.api.java.classpath</code-name-base>
   66.14 +                    <build-prerequisite/>
   66.15 +                    <compile-dependency/>
   66.16 +                    <run-dependency>
   66.17 +                        <release-version>1</release-version>
   66.18 +                        <specification-version>1.28</specification-version>
   66.19 +                    </run-dependency>
   66.20 +                </dependency>
   66.21 +                <dependency>
   66.22 +                    <code-name-base>org.netbeans.libs.javacapi</code-name-base>
   66.23 +                    <build-prerequisite/>
   66.24 +                    <compile-dependency/>
   66.25 +                    <run-dependency>
   66.26 +                        <specification-version>7.5.0.3</specification-version>
   66.27 +                    </run-dependency>
   66.28 +                </dependency>
   66.29 +                <dependency>
   66.30 +                    <code-name-base>org.netbeans.modules.jackpot30.remoting.api</code-name-base>
   66.31 +                    <build-prerequisite/>
   66.32 +                    <compile-dependency/>
   66.33 +                    <run-dependency>
   66.34 +                        <specification-version>1.0</specification-version>
   66.35 +                    </run-dependency>
   66.36 +                </dependency>
   66.37 +                <dependency>
   66.38 +                    <code-name-base>org.netbeans.modules.java.source</code-name-base>
   66.39 +                    <build-prerequisite/>
   66.40 +                    <compile-dependency/>
   66.41 +                    <run-dependency>
   66.42 +                        <implementation-version/>
   66.43 +                    </run-dependency>
   66.44 +                </dependency>
   66.45 +                <dependency>
   66.46 +                    <code-name-base>org.netbeans.modules.java.sourceui</code-name-base>
   66.47 +                    <build-prerequisite/>
   66.48 +                    <compile-dependency/>
   66.49 +                    <run-dependency>
   66.50 +                        <release-version>1</release-version>
   66.51 +                        <specification-version>1.20.0.1.17</specification-version>
   66.52 +                    </run-dependency>
   66.53 +                </dependency>
   66.54 +                <dependency>
   66.55 +                    <code-name-base>org.netbeans.modules.jumpto</code-name-base>
   66.56 +                    <build-prerequisite/>
   66.57 +                    <compile-dependency/>
   66.58 +                    <run-dependency>
   66.59 +                        <release-version>1</release-version>
   66.60 +                        <implementation-version/>
   66.61 +                    </run-dependency>
   66.62 +                </dependency>
   66.63 +                <dependency>
   66.64 +                    <code-name-base>org.netbeans.modules.projectapi</code-name-base>
   66.65 +                    <build-prerequisite/>
   66.66 +                    <compile-dependency/>
   66.67 +                    <run-dependency>
   66.68 +                        <release-version>1</release-version>
   66.69 +                        <specification-version>1.35</specification-version>
   66.70 +                    </run-dependency>
   66.71 +                </dependency>
   66.72 +                <dependency>
   66.73 +                    <code-name-base>org.openide.filesystems</code-name-base>
   66.74 +                    <build-prerequisite/>
   66.75 +                    <compile-dependency/>
   66.76 +                    <run-dependency>
   66.77 +                        <specification-version>7.46</specification-version>
   66.78 +                    </run-dependency>
   66.79 +                </dependency>
   66.80 +                <dependency>
   66.81 +                    <code-name-base>org.openide.util</code-name-base>
   66.82 +                    <build-prerequisite/>
   66.83 +                    <compile-dependency/>
   66.84 +                    <run-dependency>
   66.85 +                        <specification-version>8.14</specification-version>
   66.86 +                    </run-dependency>
   66.87 +                </dependency>
   66.88 +                <dependency>
   66.89 +                    <code-name-base>org.openide.util.lookup</code-name-base>
   66.90 +                    <build-prerequisite/>
   66.91 +                    <compile-dependency/>
   66.92 +                    <run-dependency>
   66.93 +                        <specification-version>8.6</specification-version>
   66.94 +                    </run-dependency>
   66.95 +                </dependency>
   66.96 +            </module-dependencies>
   66.97 +            <public-packages/>
   66.98 +        </data>
   66.99 +    </configuration>
  66.100 +</project>
    67.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.2 +++ b/remoting/ide/jumpto/nbproject/suite.properties	Thu Jun 23 15:07:16 2011 +0200
    67.3 @@ -0,0 +1,1 @@
    67.4 +suite.dir=${basedir}/..
    68.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.2 +++ b/remoting/ide/jumpto/src/org/netbeans/modules/jackpot30/jumpto/Bundle.properties	Thu Jun 23 15:07:16 2011 +0200
    68.3 @@ -0,0 +1,1 @@
    68.4 +OpenIDE-Module-Name=jackpot 3.0 Jumpto Bridge
    69.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    69.2 +++ b/remoting/ide/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteGoToType.java	Thu Jun 23 15:07:16 2011 +0200
    69.3 @@ -0,0 +1,238 @@
    69.4 +/*
    69.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    69.6 + *
    69.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
    69.8 + *
    69.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   69.10 + * Other names may be trademarks of their respective owners.
   69.11 + *
   69.12 + * The contents of this file are subject to the terms of either the GNU
   69.13 + * General Public License Version 2 only ("GPL") or the Common
   69.14 + * Development and Distribution License("CDDL") (collectively, the
   69.15 + * "License"). You may not use this file except in compliance with the
   69.16 + * License. You can obtain a copy of the License at
   69.17 + * http://www.netbeans.org/cddl-gplv2.html
   69.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   69.19 + * specific language governing permissions and limitations under the
   69.20 + * License.  When distributing the software, include this License Header
   69.21 + * Notice in each file and include the License file at
   69.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   69.23 + * particular file as subject to the "Classpath" exception as provided
   69.24 + * by Oracle in the GPL Version 2 section of the License file that
   69.25 + * accompanied this code. If applicable, add the following below the
   69.26 + * License Header, with the fields enclosed by brackets [] replaced by
   69.27 + * your own identifying information:
   69.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   69.29 + *
   69.30 + * If you wish your version of this file to be governed by only the CDDL
   69.31 + * or only the GPL Version 2, indicate your decision by adding
   69.32 + * "[Contributor] elects to include this software in this distribution
   69.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   69.34 + * single choice of license, a recipient has the option to distribute
   69.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   69.36 + * to extend the choice of license to its licensees as provided above.
   69.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   69.38 + * Version 2 license, then the option applies only if the new code is
   69.39 + * made subject to such option by the copyright holder.
   69.40 + *
   69.41 + * Contributor(s):
   69.42 + *
   69.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
   69.44 + */
   69.45 +package org.netbeans.modules.jackpot30.jumpto;
   69.46 +
   69.47 +import java.io.File;
   69.48 +import java.net.URI;
   69.49 +import java.net.URISyntaxException;
   69.50 +import java.util.EnumSet;
   69.51 +import java.util.LinkedHashMap;
   69.52 +import java.util.List;
   69.53 +import java.util.Map;
   69.54 +import java.util.Map.Entry;
   69.55 +import java.util.concurrent.atomic.AtomicReference;
   69.56 +import javax.lang.model.element.ElementKind;
   69.57 +import javax.lang.model.element.Modifier;
   69.58 +import javax.swing.Icon;
   69.59 +import org.codeviation.pojson.Pojson;
   69.60 +import org.netbeans.api.java.source.ClasspathInfo;
   69.61 +import org.netbeans.api.java.source.ElementHandle;
   69.62 +import org.netbeans.api.java.source.ui.ElementIcons;
   69.63 +import org.netbeans.api.java.source.ui.ElementOpen;
   69.64 +import org.netbeans.api.project.FileOwnerQuery;
   69.65 +import org.netbeans.api.project.Project;
   69.66 +import org.netbeans.api.project.ProjectUtils;
   69.67 +import org.netbeans.modules.jackpot30.remoting.api.RemoteIndex;
   69.68 +import org.netbeans.modules.jackpot30.remoting.api.WebUtilities;
   69.69 +import org.netbeans.modules.java.source.ElementHandleAccessor;
   69.70 +import org.netbeans.spi.jumpto.type.TypeDescriptor;
   69.71 +import org.netbeans.spi.jumpto.type.TypeProvider;
   69.72 +import org.openide.filesystems.FileObject;
   69.73 +import org.openide.filesystems.FileUtil;
   69.74 +import org.openide.util.Exceptions;
   69.75 +import org.openide.util.lookup.ServiceProvider;
   69.76 +
   69.77 +/**
   69.78 + *
   69.79 + * @author lahvac
   69.80 + */
   69.81 +@ServiceProvider(service=TypeProvider.class)
   69.82 +public class RemoteGoToType implements TypeProvider {
   69.83 +
   69.84 +    @Override
   69.85 +    public String name() {
   69.86 +        return "Jackpot 3.0 Remote Index Type Provider";
   69.87 +    }
   69.88 +
   69.89 +    @Override
   69.90 +    public String getDisplayName() {
   69.91 +        return "Jackpot 3.0 Remote Index Type Provider";
   69.92 +    }
   69.93 +
   69.94 +    @Override
   69.95 +    public void computeTypeNames(Context context, Result result) {
   69.96 +        for (RemoteIndex ri : RemoteIndex.loadIndices()) {
   69.97 +            try {
   69.98 +                URI resolved = new URI(ri.remote.toExternalForm() + "/type/search?path=" + WebUtilities.escapeForQuery(ri.remoteSegment) + "&prefix=" + WebUtilities.escapeForQuery(context.getText()));
   69.99 +                @SuppressWarnings("unchecked") //XXX: should not trust something got from the network!
  69.100 +                Map<String, List<String>> types = Pojson.load(LinkedHashMap.class, WebUtilities.requestStringResponse(resolved));
  69.101 +
  69.102 +                for (Entry<String, List<String>> e : types.entrySet()) {
  69.103 +                    for (String binaryName : e.getValue()) {
  69.104 +                        result.addResult(new RemoteTypeDescriptor(ri, e.getKey(), binaryName));
  69.105 +                    }
  69.106 +                }
  69.107 +            } catch (URISyntaxException ex) {
  69.108 +                Exceptions.printStackTrace(ex);
  69.109 +            }
  69.110 +        }
  69.111 +    }
  69.112 +
  69.113 +    @Override
  69.114 +    public void cancel() {
  69.115 +    }
  69.116 +
  69.117 +    @Override
  69.118 +    public void cleanup() {
  69.119 +    }
  69.120 +
  69.121 +    private static final class RemoteTypeDescriptor extends TypeDescriptor {
  69.122 +
  69.123 +        private final RemoteIndex origin;
  69.124 +        private final String relativePath;
  69.125 +        private final String binaryName;
  69.126 +        private final AtomicReference<FileObject> file = new AtomicReference<FileObject>();
  69.127 +
  69.128 +        public RemoteTypeDescriptor(RemoteIndex origin, String relativePath, String binaryName) {
  69.129 +            this.origin = origin;
  69.130 +            this.relativePath = relativePath;
  69.131 +            this.binaryName = binaryName;
  69.132 +        }
  69.133 +
  69.134 +        @Override
  69.135 +        public String getSimpleName() {
  69.136 +            int dollar = binaryName.lastIndexOf("$");
  69.137 +            
  69.138 +            if (dollar >= 0) return binaryName.substring(dollar + 1);
  69.139 +            else {
  69.140 +                int dot = binaryName.lastIndexOf(".");
  69.141 +                
  69.142 +                if (dot >= 0) return binaryName.substring(dot + 1);
  69.143 +                else return binaryName;
  69.144 +            }
  69.145 +        }
  69.146 +
  69.147 +        @Override
  69.148 +        public String getOuterName() {
  69.149 +            int dollar = binaryName.lastIndexOf("$");
  69.150 +            int dot = binaryName.lastIndexOf(".");
  69.151 +
  69.152 +            if (dollar >= 0 && dot >= 0) return binaryName.substring(dot + 1, dollar).replace("$", ".");
  69.153 +            else return null;
  69.154 +        }
  69.155 +
  69.156 +        @Override
  69.157 +        public String getTypeName() {
  69.158 +            if (getOuterName() != null)
  69.159 +                return getSimpleName() + " in " + getOuterName();
  69.160 +            else
  69.161 +                return getSimpleName();
  69.162 +        }
  69.163 +
  69.164 +        @Override
  69.165 +        public String getContextName() {
  69.166 +            int dot = binaryName.lastIndexOf(".");
  69.167 +
  69.168 +            if (dot >= 0) return " (" + binaryName.substring(0, dot) + ")";
  69.169 +            else return "";
  69.170 +        }
  69.171 +
  69.172 +        @Override
  69.173 +        public Icon getIcon() {
  69.174 +            return ElementIcons.getElementIcon(ElementKind.CLASS, EnumSet.noneOf(Modifier.class));
  69.175 +        }
  69.176 +
  69.177 +        @Override
  69.178 +        public String getProjectName() {
  69.179 +            FileObject file = getFileObject();
  69.180 +
  69.181 +            if (file == null) return null;
  69.182 +
  69.183 +            Project prj = FileOwnerQuery.getOwner(file);
  69.184 +
  69.185 +            if (prj == null) return null;
  69.186 +
  69.187 +            return ProjectUtils.getInformation(prj).getDisplayName();
  69.188 +        }
  69.189 +
  69.190 +        @Override
  69.191 +        public Icon getProjectIcon() {
  69.192 +            FileObject file = getFileObject();
  69.193 +
  69.194 +            if (file == null) return null;
  69.195 +
  69.196 +            Project prj = FileOwnerQuery.getOwner(file);
  69.197 +
  69.198 +            if (prj == null) return null;
  69.199 +
  69.200 +            return ProjectUtils.getInformation(prj).getIcon();
  69.201 +        }
  69.202 +
  69.203 +        @Override
  69.204 +        public FileObject getFileObject() {
  69.205 +            FileObject f = this.file.get();
  69.206 +
  69.207 +            if (f == null) {
  69.208 +                String fqn = binaryName;
  69.209 +
  69.210 +                if (fqn.contains("$")) {
  69.211 +                    fqn = fqn.substring(0, fqn.indexOf("$"));
  69.212 +                }
  69.213 +
  69.214 +                FileObject originFolder = FileUtil.toFileObject(FileUtil.normalizeFile(new File(origin.folder)));
  69.215 +
  69.216 +                if (originFolder != null) f = originFolder.getFileObject(relativePath + "/" + fqn.replace('.', '/') + ".java");
  69.217 +                if (f != null) this.file.set(f);
  69.218 +            }
  69.219 +
  69.220 +            return f;
  69.221 +        }
  69.222 +
  69.223 +        @Override
  69.224 +        public int getOffset() {
  69.225 +            return 0;
  69.226 +        }
  69.227 +
  69.228 +        @Override
  69.229 +        public void open() {
  69.230 +            FileObject file = getFileObject();
  69.231 +
  69.232 +            if (file == null) return ; //XXX tell to the user
  69.233 +
  69.234 +            ClasspathInfo cpInfo = ClasspathInfo.create(file);
  69.235 +            ElementHandle<?> handle = ElementHandleAccessor.INSTANCE.create(ElementKind.CLASS, binaryName);
  69.236 +
  69.237 +            ElementOpen.open(cpInfo, handle);
  69.238 +        }
  69.239 +
  69.240 +    }
  69.241 +}
    70.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.2 +++ b/remoting/ide/nbproject/build-impl.xml	Thu Jun 23 15:07:16 2011 +0200
    70.3 @@ -0,0 +1,49 @@
    70.4 +<?xml version="1.0" encoding="UTF-8"?>
    70.5 +<!--
    70.6 +*** GENERATED FROM project.xml - DO NOT EDIT  ***
    70.7 +***         EDIT ../build.xml INSTEAD         ***
    70.8 +-->
    70.9 +<project name="ide-impl" basedir=".." xmlns:sproject="http://www.netbeans.org/ns/nb-module-suite-project/1">
   70.10 +    <fail message="Please build using Ant 1.7.1 or higher.">
   70.11 +        <condition>
   70.12 +            <not>
   70.13 +                <antversion atleast="1.7.1"/>
   70.14 +            </not>
   70.15 +        </condition>
   70.16 +    </fail>
   70.17 +    <property file="nbproject/private/platform-private.properties"/>
   70.18 +    <property file="nbproject/platform.properties"/>
   70.19 +    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-suite-project/1">
   70.20 +        <attribute name="name"/>
   70.21 +        <attribute name="value"/>
   70.22 +        <sequential>
   70.23 +            <property name="@{name}" value="${@{value}}"/>
   70.24 +        </sequential>
   70.25 +    </macrodef>
   70.26 +    <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-suite-project/1">
   70.27 +        <attribute name="property"/>
   70.28 +        <attribute name="value"/>
   70.29 +        <sequential>
   70.30 +            <property name="@{property}" value="@{value}"/>
   70.31 +        </sequential>
   70.32 +    </macrodef>
   70.33 +    <property file="${user.properties.file}"/>
   70.34 +    <sproject:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir"/>
   70.35 +    <sproject:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir"/>
   70.36 +    <sproject:evalprops property="cluster.path.evaluated" value="${cluster.path}"/>
   70.37 +    <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
   70.38 +        <condition>
   70.39 +            <not>
   70.40 +                <contains string="${cluster.path.evaluated}" substring="platform"/>
   70.41 +            </not>
   70.42 +        </condition>
   70.43 +    </fail>
   70.44 +    <fail message="Cannot find NetBeans build harness. ${line.separator}Check that nbplatform.${nbplatform.active}.netbeans.dest.dir and nbplatform.${nbplatform.active}.harness.dir are defined. ${line.separator}On a developer machine these are normally defined in ${user.properties.file}=${netbeans.user}/build.properties ${line.separator}but for automated builds you should pass these properties to Ant explicitly.">
   70.45 +        <condition>
   70.46 +            <not>
   70.47 +                <available type="dir" file="${harness.dir}"/>
   70.48 +            </not>
   70.49 +        </condition>
   70.50 +    </fail>
   70.51 +    <import file="${harness.dir}/suite.xml"/>
   70.52 +</project>
    71.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.2 +++ b/remoting/ide/nbproject/genfiles.properties	Thu Jun 23 15:07:16 2011 +0200
    71.3 @@ -0,0 +1,8 @@
    71.4 +build.xml.data.CRC32=891734f5
    71.5 +build.xml.script.CRC32=82b74f72
    71.6 +build.xml.stylesheet.CRC32=eaf9f76a@1.47
    71.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
    71.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    71.9 +nbproject/build-impl.xml.data.CRC32=891734f5
   71.10 +nbproject/build-impl.xml.script.CRC32=9098eaa2
   71.11 +nbproject/build-impl.xml.stylesheet.CRC32=183e6ef3@1.47
    72.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.2 +++ b/remoting/ide/nbproject/platform.properties	Thu Jun 23 15:07:16 2011 +0200
    72.3 @@ -0,0 +1,14 @@
    72.4 +cluster.path=\
    72.5 +    ${nbplatform.active.dir}/nb:\
    72.6 +    ${nbplatform.active.dir}/latex:\
    72.7 +    ${nbplatform.active.dir}/enterprise:\
    72.8 +    ${nbplatform.active.dir}/ide:\
    72.9 +    ${nbplatform.active.dir}/java:\
   72.10 +    ${nbplatform.active.dir}/dlight:\
   72.11 +    ${nbplatform.active.dir}/websvccommon:\
   72.12 +    ${nbplatform.active.dir}/apisupport:\
   72.13 +    ${nbplatform.active.dir}/profiler:\
   72.14 +    ${nbplatform.active.dir}/platform:\
   72.15 +    ${nbplatform.active.dir}/cnd:\
   72.16 +    ${nbplatform.active.dir}/harness
   72.17 +nbplatform.active=default
    73.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    73.2 +++ b/remoting/ide/nbproject/project.properties	Thu Jun 23 15:07:16 2011 +0200
    73.3 @@ -0,0 +1,5 @@
    73.4 +modules=\
    73.5 +    ${project.org.netbeans.modules.jackpot30.jumpto}:\
    73.6 +    ${project.org.netbeans.modules.jackpot30.remoting.api}
    73.7 +project.org.netbeans.modules.jackpot30.jumpto=jumpto
    73.8 +project.org.netbeans.modules.jackpot30.remoting.api=api
    74.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    74.2 +++ b/remoting/ide/nbproject/project.xml	Thu Jun 23 15:07:16 2011 +0200
    74.3 @@ -0,0 +1,9 @@
    74.4 +<?xml version="1.0" encoding="UTF-8"?>
    74.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
    74.6 +    <type>org.netbeans.modules.apisupport.project.suite</type>
    74.7 +    <configuration>
    74.8 +        <data xmlns="http://www.netbeans.org/ns/nb-module-suite-project/1">
    74.9 +            <name>ide</name>
   74.10 +        </data>
   74.11 +    </configuration>
   74.12 +</project>
    75.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    75.2 +++ b/remoting/server/hudson/pom.xml	Thu Jun 23 15:07:16 2011 +0200
    75.3 @@ -0,0 +1,48 @@
    75.4 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    75.5 +  <modelVersion>4.0.0</modelVersion>
    75.6 +  <name>Jackpot 3.0 Hudson Plugin</name>
    75.7 +  <parent>
    75.8 +    <groupId>org.jvnet.hudson.plugins</groupId>
    75.9 +    <artifactId>plugin</artifactId>
   75.10 +    <version>1.343</version><!-- which version of Hudson is this plugin built against? -->
   75.11 +    <relativePath>../pom.xml</relativePath>
   75.12 +  </parent>
   75.13 +
   75.14 +  <groupId>org.netbeans.modules.jackpot30.hudson</groupId>
   75.15 +  <artifactId>org.netbeans.modules.jackpot30.hudson</artifactId>
   75.16 +  <version>1.0-SNAPSHOT</version>
   75.17 +  <packaging>hpi</packaging>
   75.18 +
   75.19 +  <!-- get every artifact through maven.glassfish.org, which proxies all the artifacts that we need -->
   75.20 +  <repositories>
   75.21 +    <repository>
   75.22 +      <id>m.g.o-public</id>
   75.23 +      <url>http://maven.glassfish.org/content/groups/public/</url>
   75.24 +    </repository>
   75.25 +  </repositories>
   75.26 +
   75.27 +  <pluginRepositories>
   75.28 +    <pluginRepository>
   75.29 +      <id>m.g.o-public</id>
   75.30 +      <url>http://maven.glassfish.org/content/groups/public/</url>
   75.31 +    </pluginRepository>
   75.32 +  </pluginRepositories>
   75.33 +
   75.34 +  <build>
   75.35 +    <plugins>
   75.36 +      <plugin>
   75.37 +        <groupId>org.jvnet.hudson.tools</groupId>
   75.38 +        <artifactId>maven-hpi-plugin</artifactId>
   75.39 +        <version>1.48</version>
   75.40 +        <configuration>
   75.41 +          <webResources>
   75.42 +            <resource>
   75.43 +              <directory>data</directory>
   75.44 +            </resource>
   75.45 +          </webResources>
   75.46 +        </configuration>
   75.47 +      </plugin>
   75.48 +    </plugins>
   75.49 +  </build>
   75.50 +
   75.51 +</project>
    76.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    76.2 +++ b/remoting/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/Cache.java	Thu Jun 23 15:07:16 2011 +0200
    76.3 @@ -0,0 +1,206 @@
    76.4 +/*
    76.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    76.6 + *
    76.7 + * Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.
    76.8 + *
    76.9 + * The contents of this file are subject to the terms of either the GNU
   76.10 + * General Public License Version 2 only ("GPL") or the Common
   76.11 + * Development and Distribution License("CDDL") (collectively, the
   76.12 + * "License"). You may not use this file except in compliance with the
   76.13 + * License. You can obtain a copy of the License at
   76.14 + * http://www.netbeans.org/cddl-gplv2.html
   76.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   76.16 + * specific language governing permissions and limitations under the
   76.17 + * License.  When distributing the software, include this License Header
   76.18 + * Notice in each file and include the License file at
   76.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   76.20 + * particular file as subject to the "Classpath" exception as provided
   76.21 + * by Sun in the GPL Version 2 section of the License file that
   76.22 + * accompanied this code. If applicable, add the following below the
   76.23 + * License Header, with the fields enclosed by brackets [] replaced by
   76.24 + * your own identifying information:
   76.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   76.26 + *
   76.27 + * If you wish your version of this file to be governed by only the CDDL
   76.28 + * or only the GPL Version 2, indicate your decision by adding
   76.29 + * "[Contributor] elects to include this software in this distribution
   76.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   76.31 + * single choice of license, a recipient has the option to distribute
   76.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   76.33 + * to extend the choice of license to its licensees as provided above.
   76.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   76.35 + * Version 2 license, then the option applies only if the new code is
   76.36 + * made subject to such option by the copyright holder.
   76.37 + *
   76.38 + * Contributor(s):
   76.39 + *
   76.40 + * Portions Copyrighted 1997-2009 Sun Microsystems, Inc.
   76.41 + */
   76.42 +package org.netbeans.modules.jackpot30.hudson;
   76.43 +
   76.44 +import java.io.File;
   76.45 +import java.io.FileInputStream;
   76.46 +import java.io.FileOutputStream;
   76.47 +import java.io.IOException;
   76.48 +import java.io.InputStream;
   76.49 +import java.io.OutputStream;
   76.50 +import java.net.URI;
   76.51 +import java.net.URISyntaxException;
   76.52 +import java.net.URL;
   76.53 +import java.util.HashMap;
   76.54 +import java.util.LinkedList;
   76.55 +import java.util.List;
   76.56 +import java.util.Map;
   76.57 +import java.util.Map.Entry;
   76.58 +import java.util.Properties;
   76.59 +import java.util.logging.Level;
   76.60 +import java.util.logging.Logger;
   76.61 +
   76.62 +/**
   76.63 + *
   76.64 + * @author lahvac
   76.65 + */
   76.66 +public class Cache {
   76.67 +
   76.68 +    public static final int VERSION = 1;
   76.69 +
   76.70 +    private static File standaloneCacheRoot;
   76.71 +    private static Map<String, Cache> name2Cache = new HashMap<String, Cache>();
   76.72 +
   76.73 +    public static Cache findCache(String indexName, int version) {
   76.74 +        Cache cache = name2Cache.get(indexName);
   76.75 +
   76.76 +        if (cache == null) {
   76.77 +            name2Cache.put(indexName, cache = new Cache(indexName, version));
   76.78 +        }
   76.79 +
   76.80 +        return cache;
   76.81 +    }
   76.82 +
   76.83 +    private final String name;
   76.84 +    private final int version;
   76.85 +
   76.86 +    private Cache(String name, int version) {
   76.87 +        this.name = name;
   76.88 +        this.version = version;
   76.89 +    }
   76.90 +    
   76.91 +    public File findCacheRoot(URL sourceRoot) throws IOException {
   76.92 +        try {
   76.93 +            sourceRoot = sourceRoot.toURI().normalize().toURL();
   76.94 +        } catch (URISyntaxException ex) {
   76.95 +            Logger.getLogger(Cache.class.getName()).log(Level.SEVERE, null, ex);
   76.96 +        }
   76.97 +        if (standaloneCacheRoot != null) {
   76.98 +            return getDataFolder(sourceRoot, name, version);
   76.99 +        } else {
  76.100 +            throw new IllegalStateException();
  76.101 +        }
  76.102 +    }
  76.103 +
  76.104 +    public static void setStandaloneCacheRoot(File standaloneCacheRoot) {
  76.105 +        Cache.standaloneCacheRoot = standaloneCacheRoot;
  76.106 +    }
  76.107 +
  76.108 +
  76.109 +    private static Properties segments;
  76.110 +    private static long lastSegmentsTimeStamp = -1;
  76.111 +    private static Map<String, String> invertedSegments;
  76.112 +    private static int index = 0;
  76.113 +
  76.114 +    private static final String SEGMENTS_FILE = "segments";      //NOI18N
  76.115 +    private static final String SLICE_PREFIX = "s";              //NOI18N
  76.116 +
  76.117 +    private static void loadSegments () throws IOException {
  76.118 +        final File folder = standaloneCacheRoot;
  76.119 +        assert folder != null;
  76.120 +        final File segmentsFile = new File(folder, SEGMENTS_FILE);
  76.121 +
  76.122 +        if (lastSegmentsTimeStamp != segmentsFile.lastModified()) {
  76.123 +            lastSegmentsTimeStamp = segmentsFile.lastModified();
  76.124 +            segments = null;
  76.125 +        }
  76.126 +
  76.127 +        if (segments == null) {
  76.128 +            segments = new Properties ();
  76.129 +            invertedSegments = new HashMap<String,String> ();
  76.130 +            if (segmentsFile.canRead()) {
  76.131 +                final InputStream in = new FileInputStream(segmentsFile);
  76.132 +                try {
  76.133 +                    segments.load (in);
  76.134 +                } finally {
  76.135 +                    in.close();
  76.136 +                }
  76.137 +            }
  76.138 +            for (Entry<Object, Object> entry : segments.entrySet()) {
  76.139 +                String segment = (String) entry.getKey();
  76.140 +                String root = (String) entry.getValue();
  76.141 +                invertedSegments.put(root,segment);
  76.142 +                try {
  76.143 +                    index = Math.max (index,Integer.parseInt(segment.substring(SLICE_PREFIX.length())));
  76.144 +                } catch (NumberFormatException nfe) {
  76.145 +                    throw new IllegalStateException(nfe); //TODO: maybe just log the exception?
  76.146 +                }
  76.147 +            }
  76.148 +        }
  76.149 +    }
  76.150 +
  76.151 +    public static synchronized Iterable<? extends String> knownSourceRoots() throws IOException {
  76.152 +        loadSegments();
  76.153 +
  76.154 +        List<String> known = new LinkedList<String>();
  76.155 +        
  76.156 +        for (String segment : segments.stringPropertyNames()) {
  76.157 +            known.add(segment);
  76.158 +        }
  76.159 +
  76.160 +        return known;
  76.161 +    }
  76.162 +
  76.163 +    public static synchronized File sourceRootForKey(String segment) throws IOException {
  76.164 +        loadSegments();
  76.165 +
  76.166 +        try {
  76.167 +            return new File(new File(new URI(segments.getProperty(segment))).getAbsolutePath());
  76.168 +        } catch (URISyntaxException ex) {
  76.169 +            throw new IOException(ex);
  76.170 +        }
  76.171 +    }
  76.172 +
  76.173 +
  76.174 +    private static void storeSegments () throws IOException {
  76.175 +        final File folder = standaloneCacheRoot;
  76.176 +        assert folder != null;
  76.177 +        final File segmentsFile = new File(folder, SEGMENTS_FILE);
  76.178 +        segmentsFile.getParentFile().mkdirs();
  76.179 +        final OutputStream out = new FileOutputStream(segmentsFile);
  76.180 +        try {
  76.181 +            segments.store(out,null);
  76.182 +        } finally {
  76.183 +            out.close();
  76.184 +        }
  76.185 +    }
  76.186 +
  76.187 +    private static synchronized File getDataFolder (final URL root, String name, int version) throws IOException {
  76.188 +        loadSegments ();
  76.189 +        final String rootName = root.toExternalForm();
  76.190 +        String slice = invertedSegments.get (rootName);
  76.191 +        if ( slice == null) {
  76.192 +            slice = SLICE_PREFIX + (++index);
  76.193 +            while (segments.getProperty(slice) != null) {
  76.194 +                slice = SLICE_PREFIX + (++index);
  76.195 +            }
  76.196 +            segments.put (slice,rootName);
  76.197 +            invertedSegments.put(rootName, slice);
  76.198 +            storeSegments ();
  76.199 +        }
  76.200 +        final File folder = standaloneCacheRoot;
  76.201 +        return new File(new File(new File(folder, slice), name), Integer.toString(version));
  76.202 +    }
  76.203 +
  76.204 +    private static synchronized File getCacheFolder () {
  76.205 +        return standaloneCacheRoot;
  76.206 +    }
  76.207 +
  76.208 +
  76.209 +}
    77.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    77.2 +++ b/remoting/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/ClearIndexProperty.java	Thu Jun 23 15:07:16 2011 +0200
    77.3 @@ -0,0 +1,131 @@
    77.4 +/*
    77.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    77.6 + *
    77.7 + * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
    77.8 + *
    77.9 + * The contents of this file are subject to the terms of either the GNU
   77.10 + * General Public License Version 2 only ("GPL") or the Common
   77.11 + * Development and Distribution License("CDDL") (collectively, the
   77.12 + * "License"). You may not use this file except in compliance with the
   77.13 + * License. You can obtain a copy of the License at
   77.14 + * http://www.netbeans.org/cddl-gplv2.html
   77.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   77.16 + * specific language governing permissions and limitations under the
   77.17 + * License.  When distributing the software, include this License Header
   77.18 + * Notice in each file and include the License file at
   77.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   77.20 + * particular file as subject to the "Classpath" exception as provided
   77.21 + * by Sun in the GPL Version 2 section of the License file that
   77.22 + * accompanied this code. If applicable, add the following below the
   77.23 + * License Header, with the fields enclosed by brackets [] replaced by
   77.24 + * your own identifying information:
   77.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   77.26 + *
   77.27 + * If you wish your version of this file to be governed by only the CDDL
   77.28 + * or only the GPL Version 2, indicate your decision by adding
   77.29 + * "[Contributor] elects to include this software in this distribution
   77.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   77.31 + * single choice of license, a recipient has the option to distribute
   77.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   77.33 + * to extend the choice of license to its licensees as provided above.
   77.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   77.35 + * Version 2 license, then the option applies only if the new code is
   77.36 + * made subject to such option by the copyright holder.
   77.37 + *
   77.38 + * Contributor(s):
   77.39 + *
   77.40 + * Portions Copyrighted 2010 Sun Microsystems, Inc.
   77.41 + */
   77.42 +
   77.43 +package org.netbeans.modules.jackpot30.hudson;
   77.44 +
   77.45 +import hudson.Extension;
   77.46 +import hudson.model.Action;
   77.47 +import hudson.model.Hudson;
   77.48 +import hudson.model.Job;
   77.49 +import hudson.model.JobProperty;
   77.50 +import hudson.model.JobPropertyDescriptor;
   77.51 +import hudson.model.Project;
   77.52 +import java.io.File;
   77.53 +import java.io.IOException;
   77.54 +import java.util.Collection;
   77.55 +import java.util.Collections;
   77.56 +import javax.servlet.ServletException;
   77.57 +import net.sf.json.JSONObject;
   77.58 +import org.kohsuke.stapler.StaplerRequest;
   77.59 +import org.kohsuke.stapler.StaplerResponse;
   77.60 +
   77.61 +/**
   77.62 + *
   77.63 + * @author lahvac
   77.64 + */
   77.65 +public class ClearIndexProperty extends JobProperty<Job<?, ?>> {
   77.66 +    
   77.67 +    @Override
   77.68 +    public Collection<? extends Action> getJobActions(Job<?, ?> job) {
   77.69 +        return Collections.singleton(new ClearIndexAction(job));
   77.70 +    }
   77.71 +
   77.72 +    public static final class ClearIndexAction implements Action {
   77.73 +
   77.74 +        private final Job<?, ?> job;
   77.75 +
   77.76 +        public ClearIndexAction(Job<?, ?> job) {
   77.77 +            this.job = job;
   77.78 +        }
   77.79 +
   77.80 +        public String getIconFileName() {
   77.81 +            return "folder-delete.gif";
   77.82 +        }
   77.83 +
   77.84 +        public String getDisplayName() {
   77.85 +            return "Clear Indices";
   77.86 +        }
   77.87 +
   77.88 +        public String getUrlName() {
   77.89 +            return "clearIndex";
   77.90 +        }
   77.91 +
   77.92 +        public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, InterruptedException {
   77.93 +            String jobName = job.getName();
   77.94 +            Project<?, ?> prj = Hudson.getInstance().getItemByFullName(jobName, Project.class);
   77.95 +            File cacheRoot = Cache.findCache("clear-workspace", 0).findCacheRoot(prj.getSomeWorkspace().toURI().toURL()).getParentFile().getParentFile();
   77.96 +
   77.97 +            deleteRecursivelly(cacheRoot);
   77.98 +            
   77.99 +            rsp.forwardToPreviousPage(req);
  77.100 +        }
  77.101 +
  77.102 +        private static void deleteRecursivelly(File f) {
  77.103 +            File[] files = f.listFiles();
  77.104 +
  77.105 +            if (files != null) {
  77.106 +                for (File c : files) {
  77.107 +                    deleteRecursivelly(c);
  77.108 +                }
  77.109 +            }
  77.110 +
  77.111 +            f.delete();
  77.112 +        }
  77.113 +    }
  77.114 +
  77.115 +    @Extension // this marker indicates Hudson that this is an implementation of an extension point.
  77.116 +    public static final class ClearIndexPropertyDescription extends JobPropertyDescriptor  {
  77.117 +
  77.118 +        @Override
  77.119 +        public JobProperty<?> newInstance(StaplerRequest req, JSONObject formData) throws FormException {
  77.120 +            return new ClearIndexProperty();
  77.121 +        }
  77.122 +
  77.123 +        @Override
  77.124 +        public String getDisplayName() {
  77.125 +            return "Clear Indices Desc";
  77.126 +        }
  77.127 +
  77.128 +        @Override
  77.129 +        public boolean isApplicable(Class<? extends Job> jobType) {
  77.130 +            return Project.class.isAssignableFrom(jobType);
  77.131 +        }
  77.132 +
  77.133 +    }
  77.134 +}
    78.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    78.2 +++ b/remoting/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/IndexingBuilder.java	Thu Jun 23 15:07:16 2011 +0200
    78.3 @@ -0,0 +1,340 @@
    78.4 +/*
    78.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    78.6 + *
    78.7 + * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
    78.8 + *
    78.9 + * The contents of this file are subject to the terms of either the GNU
   78.10 + * General Public License Version 2 only ("GPL") or the Common
   78.11 + * Development and Distribution License("CDDL") (collectively, the
   78.12 + * "License"). You may not use this file except in compliance with the
   78.13 + * License. You can obtain a copy of the License at
   78.14 + * http://www.netbeans.org/cddl-gplv2.html
   78.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   78.16 + * specific language governing permissions and limitations under the
   78.17 + * License.  When distributing the software, include this License Header
   78.18 + * Notice in each file and include the License file at
   78.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   78.20 + * particular file as subject to the "Classpath" exception as provided
   78.21 + * by Sun in the GPL Version 2 section of the License file that
   78.22 + * accompanied this code. If applicable, add the following below the
   78.23 + * License Header, with the fields enclosed by brackets [] replaced by
   78.24 + * your own identifying information:
   78.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   78.26 + *
   78.27 + * If you wish your version of this file to be governed by only the CDDL
   78.28 + * or only the GPL Version 2, indicate your decision by adding
   78.29 + * "[Contributor] elects to include this software in this distribution
   78.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   78.31 + * single choice of license, a recipient has the option to distribute
   78.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   78.33 + * to extend the choice of license to its licensees as provided above.
   78.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   78.35 + * Version 2 license, then the option applies only if the new code is
   78.36 + * made subject to such option by the copyright holder.
   78.37 + *
   78.38 + * Contributor(s):
   78.39 + *
   78.40 + * Portions Copyrighted 2010 Sun Microsystems, Inc.
   78.41 + */
   78.42 +
   78.43 +package org.netbeans.modules.jackpot30.hudson;
   78.44 +
   78.45 +import hudson.Extension;
   78.46 +import hudson.FilePath;
   78.47 +import hudson.Launcher;
   78.48 +import hudson.Proc;
   78.49 +import hudson.model.AbstractBuild;
   78.50 +import hudson.model.BuildListener;
   78.51 +import hudson.model.Descriptor;
   78.52 +import hudson.model.Descriptor.FormException;
   78.53 +import hudson.model.Hudson;
   78.54 +import hudson.remoting.VirtualChannel;
   78.55 +import hudson.scm.ChangeLogSet.AffectedFile;
   78.56 +import hudson.scm.ChangeLogSet.Entry;
   78.57 +import hudson.scm.EditType;
   78.58 +import hudson.tasks.Builder;
   78.59 +import hudson.util.ArgumentListBuilder;
   78.60 +import java.io.BufferedReader;
   78.61 +import java.io.BufferedWriter;
   78.62 +import java.io.File;
   78.63 +import java.io.FileInputStream;
   78.64 +import java.io.FileOutputStream;
   78.65 +import java.io.IOException;
   78.66 +import java.io.InputStreamReader;
   78.67 +import java.io.OutputStreamWriter;
   78.68 +import java.io.Reader;
   78.69 +import java.io.Writer;
   78.70 +import java.net.URI;
   78.71 +import java.net.URL;
   78.72 +import java.util.Arrays;
   78.73 +import java.util.Collection;
   78.74 +import java.util.HashSet;
   78.75 +import java.util.List;
   78.76 +import java.util.Set;
   78.77 +import java.util.logging.Level;
   78.78 +import java.util.logging.Logger;
   78.79 +import net.sf.json.JSONObject;
   78.80 +import net.sf.json.JSONSerializer;
   78.81 +import org.kohsuke.stapler.DataBoundConstructor;
   78.82 +import org.kohsuke.stapler.StaplerRequest;
   78.83 +
   78.84 +/**
   78.85 + *
   78.86 + * @author lahvac
   78.87 + */
   78.88 +public class IndexingBuilder extends Builder {
   78.89 +
   78.90 +    private final String projectName;
   78.91 +    private final String toolName;
   78.92 +    
   78.93 +    public IndexingBuilder(StaplerRequest req, JSONObject json) throws FormException {
   78.94 +        projectName = json.getString("projectName");
   78.95 +        toolName = json.optString("toolName", IndexingTool.DEFAULT_INDEXING_NAME);
   78.96 +    }
   78.97 +
   78.98 +    @DataBoundConstructor
   78.99 +    public IndexingBuilder(String projectName, String toolName) {
  78.100 +        this.projectName = projectName;
  78.101 +        this.toolName = toolName;
  78.102 +    }
  78.103 +
  78.104 +    public String getProjectName() {
  78.105 +        return projectName;
  78.106 +    }
  78.107 +
  78.108 +    public String getToolName() {
  78.109 +        return toolName;
  78.110 +    }
  78.111 +
  78.112 +    @Override
  78.113 +    public DescriptorImpl getDescriptor() {
  78.114 +        return (DescriptorImpl) super.getDescriptor();
  78.115 +    }
  78.116 +
  78.117 +    @Override
  78.118 +    public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
  78.119 +        Set<String> addedFiles = new HashSet<String>();
  78.120 +        Set<String> removedFiles = new HashSet<String>();
  78.121 +
  78.122 +        for (Entry e : build.getChangeSet()) {
  78.123 +            for (AffectedFile f : e.getAffectedFiles()) {
  78.124 +                if (f.getEditType() == EditType.DELETE) {
  78.125 +                    removedFiles.add(stripLeadingSlash(f.getPath()));
  78.126 +                } else {
  78.127 +                    addedFiles.add(stripLeadingSlash(f.getPath()));
  78.128 +                }
  78.129 +            }
  78.130 +        }
  78.131 +
  78.132 +        boolean success = doIndex(getDescriptor().getCacheDir(), build, launcher, listener, addedFiles, removedFiles);
  78.133 +
  78.134 +//        //XXX:
  78.135 +//        File info = new File(Cache.findCache("jackpot30", 1002).findCacheRoot(build.getWorkspace().toURI().toURL()), "info");
  78.136 +//        String jsonContent = readFully(info);
  78.137 +//        JSONObject json = JSONObject.fromObject(jsonContent);
  78.138 +//
  78.139 +//        String prjName = projectName;
  78.140 +//
  78.141 +//        if (prjName == null || prjName.isEmpty()) {
  78.142 +//            prjName = build.getParent().getDisplayName();
  78.143 +//        }
  78.144 +//
  78.145 +//        if (!prjName.equals(json.get("displayName"))) {
  78.146 +//            json.put("displayName", prjName);
  78.147 +//            write(info, JSONSerializer.toJSON(json).toString());
  78.148 +//        }
  78.149 +
  78.150 +        return success;
  78.151 +    }
  78.152 +
  78.153 +    private static String readFully(File file) throws IOException {
  78.154 +        Reader in = null;
  78.155 +        StringBuilder result = new StringBuilder();
  78.156 +
  78.157 +        try {
  78.158 +            in = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
  78.159 +
  78.160 +            int read;
  78.161 +
  78.162 +            while ((read = in.read()) != (-1)) {
  78.163 +                result.append((char) read);
  78.164 +            }
  78.165 +        } finally {
  78.166 +            if (in != null) {
  78.167 +                try {
  78.168 +                    in.close();
  78.169 +                } catch (IOException ex) {
  78.170 +                    Logger.getLogger(IndexingBuilder.class.getName()).log(Level.SEVERE, null, ex);
  78.171 +                }
  78.172 +            }
  78.173 +        }
  78.174 +
  78.175 +        return result.toString();
  78.176 +    }
  78.177 +
  78.178 +    private static void write(File file, String content) throws IOException {
  78.179 +        Writer out = null;
  78.180 +
  78.181 +        try {
  78.182 +            out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8"));
  78.183 +            out.write(content);
  78.184 +        } finally {
  78.185 +            if (out != null) {
  78.186 +                try {
  78.187 +                    out.close();
  78.188 +                } catch (IOException ex) {
  78.189 +                    Logger.getLogger(IndexingBuilder.class.getName()).log(Level.SEVERE, null, ex);
  78.190 +                }
  78.191 +            }
  78.192 +        }
  78.193 +    }
  78.194 +
  78.195 +    private String stripLeadingSlash(String path) {
  78.196 +        if (path.length() > 0 && path.charAt(0) == '/') {
  78.197 +            return path.substring(1);
  78.198 +        }
  78.199 +
  78.200 +        return path;
  78.201 +    }
  78.202 +
  78.203 +    protected/*tests*/ boolean doIndex(File cacheDir, AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener, Set<String> addedOrModified, Set<String> removed) throws IOException, InterruptedException {
  78.204 +        IndexingTool t = findSelectedTool();
  78.205 +
  78.206 +        if (t == null) {
  78.207 +            listener.getLogger().println("Cannot find indexing tool: " + toolName);
  78.208 +            return false;
  78.209 +        }
  78.210 +
  78.211 +        t = t.forNode(build.getBuiltOn(), listener);
  78.212 +
  78.213 +        RemoteResult res = build.getWorkspace().act(new FilePath.FileCallable<RemoteResult>() {
  78.214 +            public RemoteResult invoke(File file, VirtualChannel vc) throws IOException, InterruptedException {
  78.215 +                Set<String> projects = new HashSet<String>();
  78.216 +
  78.217 +                findProjects(file, projects, new StringBuilder());
  78.218 +
  78.219 +                return new RemoteResult(projects, file.getCanonicalPath()/*XXX: will resolve symlinks!!!*/);
  78.220 +            }
  78.221 +        });
  78.222 +
  78.223 +        listener.getLogger().println("Running: " + toolName + " on projects: " + res);
  78.224 +
  78.225 +        String codeName = build.getParent().getName();
  78.226 +        ArgumentListBuilder args = new ArgumentListBuilder();
  78.227 +        FilePath targetZip = build.getWorkspace().createTempFile(codeName, "zip");
  78.228 +
  78.229 +        //XXX: there should be a way to specify Java runtime!
  78.230 +        args.add(new File(t.getHome(), "index.sh")); //XXX
  78.231 +        args.add(codeName);
  78.232 +        args.add(projectName); //XXX
  78.233 +        args.add(targetZip);
  78.234 +        args.add(res.root);
  78.235 +        args.add(res.foundProjects.toArray(new String[0]));
  78.236 +
  78.237 +        Proc indexer = launcher.launch().pwd(build.getWorkspace())
  78.238 +                                                .cmds(args)
  78.239 +                                                .stdout(listener)
  78.240 +                                                .start();
  78.241 +
  78.242 +        indexer.join();
  78.243 +
  78.244 +        File oldCacheDir = new File(cacheDir, codeName + ".old");
  78.245 +        File segCacheDir = new File(cacheDir, codeName);
  78.246 +        File newCacheDir = new File(cacheDir, codeName + ".new");
  78.247 +
  78.248 +        targetZip.unzip(new FilePath(newCacheDir));
  78.249 +
  78.250 +        segCacheDir.renameTo(oldCacheDir);
  78.251 +
  78.252 +        new File(newCacheDir, codeName).renameTo(segCacheDir);
  78.253 +
  78.254 +        new URL("http://localhost:9998/index/internal/indexUpdated").openStream().close();
  78.255 +
  78.256 +        new FilePath(newCacheDir).deleteRecursive();
  78.257 +        new FilePath(oldCacheDir).deleteRecursive();
  78.258 +
  78.259 +        return true;
  78.260 +    }
  78.261 +
  78.262 +    private void dumpToFile(File target, Set<String> files) throws IOException {
  78.263 +        Writer out = new OutputStreamWriter(new FileOutputStream(target));
  78.264 +
  78.265 +        try {
  78.266 +            for (String f : files) {
  78.267 +                out.write(f);
  78.268 +                out.write("\n");
  78.269 +            }
  78.270 +        } finally {
  78.271 +            out.close();
  78.272 +        }
  78.273 +    }
  78.274 +
  78.275 +    public IndexingTool findSelectedTool() {
  78.276 +        for (IndexingTool t : getDescriptor().getIndexingTools()) {
  78.277 +            if (toolName.equals(t.getName())) return t;
  78.278 +        }
  78.279 +
  78.280 +        return null;
  78.281 +    }
  78.282 +
  78.283 +    private static void findProjects(File root, Collection<String> result, StringBuilder relPath) {
  78.284 +        int len = relPath.length();
  78.285 +        boolean first = relPath.length() == 0;
  78.286 +
  78.287 +        if (new File(root, "nbproject").isDirectory()) result.add(relPath.toString());
  78.288 +
  78.289 +        File[] children = root.listFiles();
  78.290 +
  78.291 +        if (children != null) {
  78.292 +            for (File c : children) {
  78.293 +                if (!first)
  78.294 +                    relPath.append("/");
  78.295 +                relPath.append(c.getName());
  78.296 +                findProjects(c, result, relPath);
  78.297 +                relPath.delete(len, relPath.length());
  78.298 +            }
  78.299 +        }
  78.300 +    }
  78.301 +
  78.302 +    private static final class RemoteResult {
  78.303 +        private final Collection<String> foundProjects;
  78.304 +        private final String root;
  78.305 +        public RemoteResult(Collection<String> foundProjects, String root) {
  78.306 +            this.foundProjects = foundProjects;
  78.307 +            this.root = root;
  78.308 +        }
  78.309 +    }
  78.310 +    
  78.311 +    @Extension // this marker indicates Hudson that this is an implementation of an extension point.
  78.312 +    public static final class DescriptorImpl extends Descriptor<Builder> {
  78.313 +
  78.314 +        private File cacheDir;
  78.315 +
  78.316 +        public DescriptorImpl() {
  78.317 +            Cache.setStandaloneCacheRoot(cacheDir = new File(Hudson.getInstance().getRootDir(), "index").getAbsoluteFile());
  78.318 +        }
  78.319 +
  78.320 +        public File getCacheDir() {
  78.321 +            return cacheDir;
  78.322 +        }
  78.323 +
  78.324 +        @Override
  78.325 +        public Builder newInstance(StaplerRequest req, JSONObject formData) throws FormException {
  78.326 +            return new IndexingBuilder(req, formData);
  78.327 +        }
  78.328 +
  78.329 +        @Override
  78.330 +        public String getDisplayName() {
  78.331 +            return "Run Indexers";
  78.332 +        }
  78.333 +
  78.334 +        public List<? extends IndexingTool> getIndexingTools() {
  78.335 +            return Arrays.asList(Hudson.getInstance().getDescriptorByType(IndexingTool.DescriptorImpl.class).getInstallations());
  78.336 +        }
  78.337 +
  78.338 +        public boolean hasNonStandardIndexingTool() {
  78.339 +            return getIndexingTools().size() > 1;
  78.340 +        }
  78.341 +    }
  78.342 +
  78.343 +}
    79.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    79.2 +++ b/remoting/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/IndexingTool.java	Thu Jun 23 15:07:16 2011 +0200
    79.3 @@ -0,0 +1,100 @@
    79.4 +/*
    79.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    79.6 + *
    79.7 + * Copyright 2011 Sun Microsystems, Inc. All rights reserved.
    79.8 + *
    79.9 + * The contents of this file are subject to the terms of either the GNU
   79.10 + * General Public License Version 2 only ("GPL") or the Common
   79.11 + * Development and Distribution License("CDDL") (collectively, the
   79.12 + * "License"). You may not use this file except in compliance with the
   79.13 + * License. You can obtain a copy of the License at
   79.14 + * http://www.netbeans.org/cddl-gplv2.html
   79.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   79.16 + * specific language governing permissions and limitations under the
   79.17 + * License.  When distributing the software, include this License Header
   79.18 + * Notice in each file and include the License file at
   79.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   79.20 + * particular file as subject to the "Classpath" exception as provided
   79.21 + * by Sun in the GPL Version 2 section of the License file that
   79.22 + * accompanied this code. If applicable, add the following below the
   79.23 + * License Header, with the fields enclosed by brackets [] replaced by
   79.24 + * your own identifying information:
   79.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   79.26 + *
   79.27 + * If you wish your version of this file to be governed by only the CDDL
   79.28 + * or only the GPL Version 2, indicate your decision by adding
   79.29 + * "[Contributor] elects to include this software in this distribution
   79.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   79.31 + * single choice of license, a recipient has the option to distribute
   79.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   79.33 + * to extend the choice of license to its licensees as provided above.
   79.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   79.35 + * Version 2 license, then the option applies only if the new code is
   79.36 + * made subject to such option by the copyright holder.
   79.37 + *
   79.38 + * Contributor(s):
   79.39 + *
   79.40 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
   79.41 + */
   79.42 +package org.netbeans.modules.jackpot30.hudson;
   79.43 +
   79.44 +import hudson.Extension;
   79.45 +import hudson.model.Node;
   79.46 +import hudson.model.TaskListener;
   79.47 +import hudson.slaves.NodeSpecific;
   79.48 +import hudson.tools.ToolDescriptor;
   79.49 +import hudson.tools.ToolInstallation;
   79.50 +import hudson.tools.ToolProperty;
   79.51 +import java.io.IOException;
   79.52 +import java.util.List;
   79.53 +import org.kohsuke.stapler.DataBoundConstructor;
   79.54 +
   79.55 +/**
   79.56 + *
   79.57 + * @author lahvac
   79.58 + */
   79.59 +public class IndexingTool extends ToolInstallation implements NodeSpecific<IndexingTool> {
   79.60 +
   79.61 +    public static final String DEFAULT_INDEXING_NAME = "Main NetBeans Indexing";
   79.62 +    
   79.63 +    @DataBoundConstructor
   79.64 +    public IndexingTool(String name, String home, List<? extends ToolProperty<?>> properties) {
   79.65 +        super(name, home, properties);
   79.66 +    }
   79.67 +
   79.68 +    public IndexingTool forNode(Node node, TaskListener tl) throws IOException, InterruptedException {
   79.69 +        return new IndexingTool(getName(), translateFor(node, tl), getProperties().toList());
   79.70 +    }
   79.71 +
   79.72 +    @Extension
   79.73 +    public static final class DescriptorImpl extends ToolDescriptor<IndexingTool> {
   79.74 +
   79.75 +        @Override
   79.76 +        public String getDisplayName() {
   79.77 +            return "Indexing Tool";
   79.78 +        }
   79.79 +
   79.80 +        private IndexingTool[] installations;
   79.81 +
   79.82 +        @Override
   79.83 +        public IndexingTool[] getInstallations() {
   79.84 +            if (installations == null) {
   79.85 +                load();
   79.86 +
   79.87 +                if (installations == null) {
   79.88 +                    installations = new IndexingTool[0];
   79.89 +                }
   79.90 +            }
   79.91 +
   79.92 +            return installations.clone();
   79.93 +        }
   79.94 +
   79.95 +        @Override
   79.96 +        public void setInstallations(IndexingTool... installations) {
   79.97 +            this.installations = installations.clone();
   79.98 +            save();
   79.99 +        }
  79.100 +
  79.101 +
  79.102 +    }
  79.103 +}
    80.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    80.2 +++ b/remoting/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/InstallIndexingTool.java	Thu Jun 23 15:07:16 2011 +0200
    80.3 @@ -0,0 +1,103 @@
    80.4 +/*
    80.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    80.6 + *
    80.7 + * Copyright 2011 Sun Microsystems, Inc. All rights reserved.
    80.8 + *
    80.9 + * The contents of this file are subject to the terms of either the GNU
   80.10 + * General Public License Version 2 only ("GPL") or the Common
   80.11 + * Development and Distribution License("CDDL") (collectively, the
   80.12 + * "License"). You may not use this file except in compliance with the
   80.13 + * License. You can obtain a copy of the License at
   80.14 + * http://www.netbeans.org/cddl-gplv2.html
   80.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   80.16 + * specific language governing permissions and limitations under the
   80.17 + * License.  When distributing the software, include this License Header
   80.18 + * Notice in each file and include the License file at
   80.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   80.20 + * particular file as subject to the "Classpath" exception as provided
   80.21 + * by Sun in the GPL Version 2 section of the License file that
   80.22 + * accompanied this code. If applicable, add the following below the
   80.23 + * License Header, with the fields enclosed by brackets [] replaced by
   80.24 + * your own identifying information:
   80.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   80.26 + *
   80.27 + * If you wish your version of this file to be governed by only the CDDL
   80.28 + * or only the GPL Version 2, indicate your decision by adding
   80.29 + * "[Contributor] elects to include this software in this distribution
   80.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   80.31 + * single choice of license, a recipient has the option to distribute
   80.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   80.33 + * to extend the choice of license to its licensees as provided above.
   80.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   80.35 + * Version 2 license, then the option applies only if the new code is
   80.36 + * made subject to such option by the copyright holder.
   80.37 + *
   80.38 + * Contributor(s):
   80.39 + *
   80.40 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
   80.41 + */
   80.42 +package org.netbeans.modules.jackpot30.hudson;
   80.43 +
   80.44 +import hudson.Extension;
   80.45 +import hudson.FilePath;
   80.46 +import hudson.init.InitMilestone;
   80.47 +import hudson.init.Initializer;
   80.48 +import hudson.model.Hudson;
   80.49 +import hudson.model.Node;
   80.50 +import hudson.model.TaskListener;
   80.51 +import hudson.tools.DownloadFromUrlInstaller;
   80.52 +import hudson.tools.InstallSourceProperty;
   80.53 +import hudson.tools.ToolInstallation;
   80.54 +import hudson.tools.ToolProperty;
   80.55 +import java.io.IOException;
   80.56 +import java.util.Arrays;
   80.57 +import org.kohsuke.stapler.DataBoundConstructor;
   80.58 +
   80.59 +/**
   80.60 + *
   80.61 + * @author lahvac
   80.62 + */
   80.63 +public class InstallIndexingTool extends DownloadFromUrlInstaller {
   80.64 +
   80.65 +    @DataBoundConstructor
   80.66 +    public InstallIndexingTool(String id) {
   80.67 +        super(id);
   80.68 +    }
   80.69 +
   80.70 +    @Override
   80.71 +    public FilePath performInstallation(ToolInstallation tool, Node node, TaskListener log) throws IOException, InterruptedException {
   80.72 +        return super.performInstallation(tool, node, log);
   80.73 +    }
   80.74 +
   80.75 +    @Extension
   80.76 +    public static class DescriptorImpl extends DownloadFromUrlInstaller.DescriptorImpl<InstallIndexingTool> {
   80.77 +
   80.78 +        @Override
   80.79 +        public String getDisplayName() {
   80.80 +            return "Install from web";
   80.81 +        }
   80.82 +
   80.83 +        @Override
   80.84 +        public boolean isApplicable(Class<? extends ToolInstallation> toolType) {
   80.85 +            return toolType == IndexingTool.class;
   80.86 +        }
   80.87 +
   80.88 +    }
   80.89 +
   80.90 +    //XXX:
   80.91 +    @Initializer(after=InitMilestone.JOB_LOADED)
   80.92 +    public static void prepareUpdates() throws IOException, InterruptedException {
   80.93 +        FilePath update = new FilePath(new FilePath(Hudson.getInstance().getRootPath(), "updates"), "org.netbeans.modules.jackpot30.hudson.InstallIndexingTool");
   80.94 +
   80.95 +        update.copyFrom(InstallIndexingTool.class.getResource("org.netbeans.modules.jackpot30.hudson.InstallIndexingTool"));
   80.96 +
   80.97 +        //preinstall main tool if it does not exist:
   80.98 +        IndexingTool[] tools = Hudson.getInstance().getDescriptorByType(IndexingTool.DescriptorImpl.class).getInstallations();
   80.99 +
  80.100 +        if (tools.length == 0) {
  80.101 +            ToolProperty<ToolInstallation> install = new InstallSourceProperty(Arrays.asList(new InstallIndexingTool("main")));
  80.102 +            Hudson.getInstance().getDescriptorByType(IndexingTool.DescriptorImpl.class).setInstallations(new IndexingTool(IndexingTool.DEFAULT_INDEXING_NAME, "", Arrays.asList(install)));
  80.103 +        }
  80.104 +    }
  80.105 +
  80.106 +}
    81.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    81.2 +++ b/remoting/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/PluginImpl.java	Thu Jun 23 15:07:16 2011 +0200
    81.3 @@ -0,0 +1,56 @@
    81.4 +/*
    81.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    81.6 + *
    81.7 + * Copyright 2011 Sun Microsystems, Inc. All rights reserved.
    81.8 + *
    81.9 + * The contents of this file are subject to the terms of either the GNU
   81.10 + * General Public License Version 2 only ("GPL") or the Common
   81.11 + * Development and Distribution License("CDDL") (collectively, the
   81.12 + * "License"). You may not use this file except in compliance with the
   81.13 + * License. You can obtain a copy of the License at
   81.14 + * http://www.netbeans.org/cddl-gplv2.html
   81.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   81.16 + * specific language governing permissions and limitations under the
   81.17 + * License.  When distributing the software, include this License Header
   81.18 + * Notice in each file and include the License file at
   81.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   81.20 + * particular file as subject to the "Classpath" exception as provided
   81.21 + * by Sun in the GPL Version 2 section of the License file that
   81.22 + * accompanied this code. If applicable, add the following below the
   81.23 + * License Header, with the fields enclosed by brackets [] replaced by
   81.24 + * your own identifying information:
   81.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   81.26 + *
   81.27 + * If you wish your version of this file to be governed by only the CDDL
   81.28 + * or only the GPL Version 2, indicate your decision by adding
   81.29 + * "[Contributor] elects to include this software in this distribution
   81.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   81.31 + * single choice of license, a recipient has the option to distribute
   81.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   81.33 + * to extend the choice of license to its licensees as provided above.
   81.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   81.35 + * Version 2 license, then the option applies only if the new code is
   81.36 + * made subject to such option by the copyright holder.
   81.37 + *
   81.38 + * Contributor(s):
   81.39 + *
   81.40 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
   81.41 + */
   81.42 +package org.netbeans.modules.jackpot30.hudson;
   81.43 +
   81.44 +import hudson.Plugin;
   81.45 +
   81.46 +/**https://issues.jenkins-ci.org/browse/JENKINS-5427
   81.47 + *
   81.48 + * @author lahvac
   81.49 + */
   81.50 +public class PluginImpl extends Plugin {
   81.51 +
   81.52 +    @Override
   81.53 +    public void postInitialize() throws Exception {
   81.54 +        super.postInitialize();
   81.55 +        InstallIndexingTool.prepareUpdates();
   81.56 +        StartWebFrontEnd.ensureStarted();
   81.57 +    }
   81.58 +
   81.59 +}
    82.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    82.2 +++ b/remoting/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/StartWebFrontEnd.java	Thu Jun 23 15:07:16 2011 +0200
    82.3 @@ -0,0 +1,95 @@
    82.4 +/*
    82.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    82.6 + *
    82.7 + * Copyright 2011 Sun Microsystems, Inc. All rights reserved.
    82.8 + *
    82.9 + * The contents of this file are subject to the terms of either the GNU
   82.10 + * General Public License Version 2 only ("GPL") or the Common
   82.11 + * Development and Distribution License("CDDL") (collectively, the
   82.12 + * "License"). You may not use this file except in compliance with the
   82.13 + * License. You can obtain a copy of the License at
   82.14 + * http://www.netbeans.org/cddl-gplv2.html
   82.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   82.16 + * specific language governing permissions and limitations under the
   82.17 + * License.  When distributing the software, include this License Header
   82.18 + * Notice in each file and include the License file at
   82.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   82.20 + * particular file as subject to the "Classpath" exception as provided
   82.21 + * by Sun in the GPL Version 2 section of the License file that
   82.22 + * accompanied this code. If applicable, add the following below the
   82.23 + * License Header, with the fields enclosed by brackets [] replaced by
   82.24 + * your own identifying information:
   82.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   82.26 + *
   82.27 + * If you wish your version of this file to be governed by only the CDDL
   82.28 + * or only the GPL Version 2, indicate your decision by adding
   82.29 + * "[Contributor] elects to include this software in this distribution
   82.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   82.31 + * single choice of license, a recipient has the option to distribute
   82.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   82.33 + * to extend the choice of license to its licensees as provided above.
   82.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   82.35 + * Version 2 license, then the option applies only if the new code is
   82.36 + * made subject to such option by the copyright holder.
   82.37 + *
   82.38 + * Contributor(s):
   82.39 + *
   82.40 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
   82.41 + */
   82.42 +package org.netbeans.modules.jackpot30.hudson;
   82.43 +
   82.44 +import hudson.Launcher;
   82.45 +import hudson.Proc;
   82.46 +import hudson.model.Hudson;
   82.47 +import hudson.util.ArgumentListBuilder;
   82.48 +import hudson.util.LogTaskListener;
   82.49 +import java.io.File;
   82.50 +import java.io.FileOutputStream;
   82.51 +import java.io.IOException;
   82.52 +import java.util.logging.Level;
   82.53 +import java.util.logging.Logger;
   82.54 +
   82.55 +/**
   82.56 + *
   82.57 + * @author lahvac
   82.58 + */
   82.59 +public class StartWebFrontEnd {
   82.60 +
   82.61 +    public static boolean disable = false;
   82.62 +
   82.63 +    private static Proc frontend;
   82.64 +
   82.65 +    public static void ensureStarted() {
   82.66 +        if (disable) return ;
   82.67 +        
   82.68 +        try {
   82.69 +            if (frontend != null && frontend.isAlive()) return;
   82.70 +
   82.71 +            IndexingTool[] tools = Hudson.getInstance().getDescriptorByType(IndexingTool.DescriptorImpl.class).getInstallations();
   82.72 +
   82.73 +            if (tools.length == 0) return;
   82.74 +
   82.75 +            File cacheDir = Hudson.getInstance().getDescriptorByType(IndexingBuilder.DescriptorImpl.class).getCacheDir();
   82.76 +
   82.77 +            if (!cacheDir.exists()) {
   82.78 +                cacheDir.mkdirs();
   82.79 +            }
   82.80 +            
   82.81 +            LogTaskListener listener = new LogTaskListener(Logger.global, Level.INFO);
   82.82 +            IndexingTool tool = tools[0].forNode(Hudson.getInstance(), listener);
   82.83 +
   82.84 +            ArgumentListBuilder args = new ArgumentListBuilder();
   82.85 +            Launcher launcher = new Launcher.LocalLauncher(listener);
   82.86 +            args.add(new File(tool.getHome(), "web.sh")); //XXX
   82.87 +            args.add(cacheDir);
   82.88 +
   82.89 +            frontend = launcher.launch().cmds(args)
   82.90 +                                        .stdout(listener)
   82.91 +                                        .start();
   82.92 +        } catch (IOException ex) {
   82.93 +            Logger.getLogger(StartWebFrontEnd.class.getName()).log(Level.SEVERE, null, ex);
   82.94 +        } catch (InterruptedException ex) {
   82.95 +            Logger.getLogger(StartWebFrontEnd.class.getName()).log(Level.SEVERE, null, ex);
   82.96 +        }
   82.97 +    }
   82.98 +}
    83.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    83.2 +++ b/remoting/server/hudson/src/main/resources/index.jelly	Thu Jun 23 15:07:16 2011 +0200
    83.3 @@ -0,0 +1,8 @@
    83.4 +<!--
    83.5 +  This view is used to render the plugin list page.
    83.6 +
    83.7 +  Since we don't really have anything dynamic here, let's just use static HTML. 
    83.8 +-->
    83.9 +<div>
   83.10 +  Jackpot 3.0 Hudson plugin.
   83.11 +</div>
   83.12 \ No newline at end of file
    84.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    84.2 +++ b/remoting/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/BuildWrapperImpl/config.jelly	Thu Jun 23 15:07:16 2011 +0200
    84.3 @@ -0,0 +1,79 @@
    84.4 +<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
    84.5 +  <!--
    84.6 +    This jelly script is used for per-project configuration.
    84.7 +
    84.8 +    See global.jelly for a general discussion about jelly script.
    84.9 +  -->
   84.10 +
   84.11 +  <!--
   84.12 +    Creates a text field that shows the value of the "name" property.
   84.13 +    When submitted, it will be passed to the corresponding constructor parameter.
   84.14 +  -->
   84.15 +
   84.16 +<!--  <j:forEach var="category" items="${descriptor.getCategories()}" varStatus="loop">
   84.17 +    <f:block>
   84.18 +      <table>
   84.19 +        <f:optionalBlock title="${category}">
   84.20 +          <j:forEach var="hint" items="${descriptor.getHintsInCategory(category)}" varStatus="loop">
   84.21 +            <f:entry description="${descriptor.getHintDescription(hint)}">
   84.22 +              <f:checkbox name="${hint}" checked="${instance.isHintEnabled(hint)}"/>
   84.23 +              <label class="attach-previous">${descriptor.getHintDisplayName(hint)}</label>
   84.24 +            </f:entry>
   84.25 +          </j:forEach>
   84.26 +        </f:optionalBlock>
   84.27 +      </table>
   84.28 +    </f:block>
   84.29 +  </j:forEach>-->
   84.30 +
   84.31 +  <f:block>
   84.32 +    <table>
   84.33 +      <f:optionalBlock name="classpathBasedHintsEnabled" title="Run hints found on classpath" checked="${instance != null ? instance.isClasspathBasedHintsEnabled() : true}">
   84.34 +            <f:entry>
   84.35 +              <f:checkbox field="classpathBasedHintFixesEnabled" checked="${instance != null ? instance.isClasspathBasedHintFixesEnabled() : false}"/>
   84.36 +              <label class="attach-previous">Apply the primary fix</label>
   84.37 +            </f:entry>
   84.38 +      </f:optionalBlock>
   84.39 +    </table>
   84.40 +  </f:block>
   84.41 +  
   84.42 +  <f:block>
   84.43 +    <table>
   84.44 +      <f:optionalBlock name="hardcodedHintsEnabled" title="Run NetBeans hints" checked="${instance != null ? instance.isHardcodedHintsEnabled() : true}">
   84.45 +  <j:forEach var="category" items="${descriptor.getCategories()}" varStatus="loop">
   84.46 +        <f:section title="${descriptor.getCategoryDisplayName(category)}">
   84.47 +          <j:forEach var="hint" items="${descriptor.getHintsInCategory(category)}" varStatus="loop">
   84.48 +            <f:entry>
   84.49 +    <table>
   84.50 +      <f:optionalBlock name="${hint}" title="${descriptor.getHintDisplayName(hint)}" tooltip="${descriptor.getHintDescription(hint)}" checked="${instance != null ? instance.isHintEnabled(hint) : descriptor.isHintEnabledByDefault(hint)}">
   84.51 +<!--              <f:checkbox name="${hint}" checked="${instance != null ? instance.isHintEnabled(hint) : descriptor.isHintEnabledByDefault(hint)}"/>
   84.52 +              <label class="attach-previous" tooltip="${descriptor.getHintDescription(hint)}">${descriptor.getHintDisplayName(hint)}</label>-->
   84.53 +<!--              <f:nested>-->
   84.54 +            <f:entry>
   84.55 +                <f:checkbox name="${hint}.apply" checked="${instance != null ? instance.isHintApplyEnabled(hint) : descriptor.isHintApplyEnabledByDefault(hint)}"/>
   84.56 +                <label class="attach-previous">Apply the primary fix.</label>
   84.57 +            </f:entry>
   84.58 +<!--              </f:nested>-->
   84.59 +      </f:optionalBlock>
   84.60 +    </table>
   84.61 +            </f:entry>
   84.62 +          </j:forEach>
   84.63 +        </f:section>
   84.64 +  </j:forEach>
   84.65 +      </f:optionalBlock>
   84.66 +    </table>
   84.67 +  </f:block>
   84.68 +
   84.69 +  <f:block>
   84.70 +    <table>
   84.71 +        <f:checkbox name="indexingEnabled" checked="${instance != null ? instance.isIndexingEnabled() : true}"/>
   84.72 +        <label class="attach-previous">Run Indexing</label>
   84.73 +    </table>
   84.74 +  </f:block>
   84.75 +<!--  <j:forEach var="d" items="${descriptor.getHints()}" varStatus="loop">
   84.76 +  <f:entry description="${descriptor.getHintDescription(d)}">
   84.77 +    <f:checkbox name="${d}" checked="${instance.isHintEnabled(d)}"/>
   84.78 +    <label class="attach-previous">${descriptor.getHintDisplayName(d)}</label>
   84.79 +  </f:entry>
   84.80 +  </j:forEach>-->
   84.81 +
   84.82 +</j:jelly>
    85.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    85.2 +++ b/remoting/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/BuildWrapperImpl/help-hardcodedHintsEnabled.html	Thu Jun 23 15:07:16 2011 +0200
    85.3 @@ -0,0 +1,3 @@
    85.4 +<div>
    85.5 +    Whether the standard NetBeans hints should be run during the build.
    85.6 +</div>
    85.7 \ No newline at end of file
    86.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    86.2 +++ b/remoting/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/IndexingBuilder/config.jelly	Thu Jun 23 15:07:16 2011 +0200
    86.3 @@ -0,0 +1,17 @@
    86.4 +<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
    86.5 +
    86.6 +    <f:entry title="Project Name:" field="projectName">
    86.7 +        <f:textbox />
    86.8 +    </f:entry>
    86.9 +
   86.10 +    <j:if test="${descriptor.hasNonStandardIndexingTool}">
   86.11 +        <f:entry title="Indexing Tool">
   86.12 +            <select class="setting-input" name="toolName">
   86.13 +                <j:forEach var="inst" items="${descriptor.indexingTools}">
   86.14 +                    <f:option selected="${inst.name==instance.toolName}" value="${inst.name}">${inst.name}</f:option>
   86.15 +                </j:forEach>
   86.16 +            </select>
   86.17 +        </f:entry>
   86.18 +    </j:if>
   86.19 +
   86.20 +</j:jelly>
    87.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    87.2 +++ b/remoting/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/IndexingBuilder/global.jelly	Thu Jun 23 15:07:16 2011 +0200
    87.3 @@ -0,0 +1,9 @@
    87.4 +<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
    87.5 +
    87.6 +    <f:section title="Indexers">
    87.7 +        <f:entry title="Cache directory:" field="cacheDir">
    87.8 +            <f:textbox />
    87.9 +        </f:entry>
   87.10 +    </f:section>
   87.11 +    
   87.12 +</j:jelly>
    88.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    88.2 +++ b/remoting/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/IndexingBuilder/help-cacheDir.html	Thu Jun 23 15:07:16 2011 +0200
    88.3 @@ -0,0 +1,3 @@
    88.4 +<div>
    88.5 +    Target cache directory.
    88.6 +</div>
    88.7 \ No newline at end of file
    89.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    89.2 +++ b/remoting/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/IndexingBuilder/help.html	Thu Jun 23 15:07:16 2011 +0200
    89.3 @@ -0,0 +1,3 @@
    89.4 +<div>
    89.5 +    Run indexers.
    89.6 +</div>
    89.7 \ No newline at end of file
    90.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    90.2 +++ b/remoting/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/JackpotIndexBuilder/config.jelly	Thu Jun 23 15:07:16 2011 +0200
    90.3 @@ -0,0 +1,3 @@
    90.4 +<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
    90.5 +
    90.6 +</j:jelly>
    91.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    91.2 +++ b/remoting/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/JackpotIndexBuilder/help.html	Thu Jun 23 15:07:16 2011 +0200
    91.3 @@ -0,0 +1,3 @@
    91.4 +<div>
    91.5 +    Run Jackpot 3.0 indexer.
    91.6 +</div>
    91.7 \ No newline at end of file
    92.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    92.2 +++ b/remoting/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/org.netbeans.modules.jackpot30.hudson.InstallIndexingTool	Thu Jun 23 15:07:16 2011 +0200
    92.3 @@ -0,0 +1,1 @@
    92.4 +{"list": [{"id": "main", "name": "main", "url": "http://deadlock.netbeans.org/hudson/job/jackpot30/lastSuccessfulBuild/artifact/remoting/build/indexing-backend.zip"}]}
    92.5 \ No newline at end of file
    93.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    93.2 +++ b/remoting/server/hudson/src/main/webapp/help-globalConfig.html	Thu Jun 23 15:07:16 2011 +0200
    93.3 @@ -0,0 +1,5 @@
    93.4 +<div>
    93.5 +  <p>
    93.6 +    See help-projectConfig.html for more about what these HTMLs do.
    93.7 +  </p>
    93.8 +</div>
    93.9 \ No newline at end of file
    94.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    94.2 +++ b/remoting/server/hudson/src/test/java/org/netbeans/modules/jackpot30/hudson/IndexingBuilderTest.java	Thu Jun 23 15:07:16 2011 +0200
    94.3 @@ -0,0 +1,217 @@
    94.4 +/*
    94.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    94.6 + *
    94.7 + * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
    94.8 + *
    94.9 + * The contents of this file are subject to the terms of either the GNU
   94.10 + * General Public License Version 2 only ("GPL") or the Common
   94.11 + * Development and Distribution License("CDDL") (collectively, the
   94.12 + * "License"). You may not use this file except in compliance with the
   94.13 + * License. You can obtain a copy of the License at
   94.14 + * http://www.netbeans.org/cddl-gplv2.html
   94.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   94.16 + * specific language governing permissions and limitations under the
   94.17 + * License.  When distributing the software, include this License Header
   94.18 + * Notice in each file and include the License file at
   94.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   94.20 + * particular file as subject to the "Classpath" exception as provided
   94.21 + * by Sun in the GPL Version 2 section of the License file that
   94.22 + * accompanied this code. If applicable, add the following below the
   94.23 + * License Header, with the fields enclosed by brackets [] replaced by
   94.24 + * your own identifying information:
   94.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   94.26 + *
   94.27 + * If you wish your version of this file to be governed by only the CDDL
   94.28 + * or only the GPL Version 2, indicate your decision by adding
   94.29 + * "[Contributor] elects to include this software in this distribution
   94.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   94.31 + * single choice of license, a recipient has the option to distribute
   94.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   94.33 + * to extend the choice of license to its licensees as provided above.
   94.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   94.35 + * Version 2 license, then the option applies only if the new code is
   94.36 + * made subject to such option by the copyright holder.
   94.37 + *
   94.38 + * Contributor(s):
   94.39 + *
   94.40 + * Portions Copyrighted 2010 Sun Microsystems, Inc.
   94.41 + */
   94.42 +
   94.43 +package org.netbeans.modules.jackpot30.hudson;
   94.44 +
   94.45 +import hudson.FilePath;
   94.46 +import hudson.Launcher;
   94.47 +import hudson.model.AbstractBuild;
   94.48 +import hudson.model.BuildListener;
   94.49 +import hudson.model.FreeStyleProject;
   94.50 +import hudson.scm.SubversionSCM;
   94.51 +import hudson.scm.SubversionSCM.ModuleLocation;
   94.52 +import hudson.util.ArgumentListBuilder;
   94.53 +import hudson.util.StreamTaskListener;
   94.54 +import java.io.File;
   94.55 +import java.io.FileOutputStream;
   94.56 +import java.io.IOException;
   94.57 +import java.util.Arrays;
   94.58 +import java.util.Collections;
   94.59 +import java.util.Set;
   94.60 +import org.jvnet.hudson.test.HudsonHomeLoader;
   94.61 +import org.jvnet.hudson.test.HudsonTestCase;
   94.62 +import static org.junit.Assert.*;
   94.63 +import org.xml.sax.SAXException;
   94.64 +
   94.65 +/**
   94.66 + *
   94.67 + * @author lahvac
   94.68 + */
   94.69 +public class IndexingBuilderTest extends HudsonTestCase {
   94.70 +
   94.71 +    public IndexingBuilderTest() {
   94.72 +    }
   94.73 +
   94.74 +    @Override
   94.75 +    protected void setUp() throws Exception {
   94.76 +        StartWebFrontEnd.disable = true;
   94.77 +        
   94.78 +        super.setUp();
   94.79 +
   94.80 +        checkoutDir = HudsonHomeLoader.NEW.allocate();
   94.81 +        repositoryDir = HudsonHomeLoader.NEW.allocate();
   94.82 +    }
   94.83 +
   94.84 +    @Override
   94.85 +    protected void tearDown() throws Exception {
   94.86 +        super.tearDown();
   94.87 +
   94.88 +        //XXX: some of the working directories seems to be kept by the testing infra, workarounding:
   94.89 +        new FilePath(checkoutDir).deleteRecursive();
   94.90 +        new FilePath(repositoryDir).deleteRecursive();
   94.91 +        hudson.getRootPath().deleteRecursive();
   94.92 +    }
   94.93 +
   94.94 +    private File checkoutDir;
   94.95 +    private File repositoryDir;
   94.96 +
   94.97 +    public void testUpdate() throws Exception {
   94.98 +        //setup svn repository:
   94.99 +        String repositoryURL = repositoryDir.toURI().toURL().toExternalForm().replace("file:/", "file:///");
  94.100 +        runSubversionAdmin("create", repositoryDir.getAbsolutePath());
  94.101 +        runSubversion("checkout", repositoryURL, ".");
  94.102 +        createFile("A.java");
  94.103 +        createFile("B.java");
  94.104 +        runSubversion("add", "A.java", "B.java");
  94.105 +        runSubversion("commit", "-m", "initial");
  94.106 +
  94.107 +        FreeStyleProject p = createFreeStyleProject();
  94.108 +        ModuleLocation mod1 = new ModuleLocation(repositoryURL, null);
  94.109 +        SubversionSCM scm = new SubversionSCM(Collections.singletonList(mod1), true, null, "", "", "");
  94.110 +        IndexBuilderImpl indexer = new IndexBuilderImpl("test", "test");
  94.111 +        p.setScm(scm);
  94.112 +        p.getBuildersList().add(indexer);
  94.113 +
  94.114 +        doRunProject(p);
  94.115 +
  94.116 +        assertTrue(indexer.called);
  94.117 +
  94.118 +        runSubversion("remove", "B.java");
  94.119 +        createFile("C.java");
  94.120 +        runSubversion("add", "C.java");
  94.121 +        runSubversion("commit", "-m", "");
  94.122 +
  94.123 +        indexer.called = false;
  94.124 +        doRunProject(p);
  94.125 +
  94.126 +        assertTrue(indexer.called);
  94.127 +        assertEquals(Collections.singleton("C.java"), indexer.addedOrModified);
  94.128 +        assertEquals(Collections.singleton("B.java"), indexer.removed);
  94.129 +    }
  94.130 +
  94.131 +    public void DISABLEDtestCheckoutIntoSpecifiedDir() throws Exception {
  94.132 +        //setup svn repository:
  94.133 +        String repositoryURL = repositoryDir.toURI().toURL().toExternalForm().replace("file:/", "file:///");
  94.134 +        runSubversionAdmin("create", repositoryDir.getAbsolutePath());
  94.135 +        runSubversion("checkout", repositoryURL, ".");
  94.136 +        createFile("A.java");
  94.137 +        createFile("B.java");
  94.138 +        runSubversion("add", "A.java", "B.java");
  94.139 +        runSubversion("commit", "-m", "initial");
  94.140 +
  94.141 +        FreeStyleProject p = createFreeStyleProject();
  94.142 +        ModuleLocation mod1 = new ModuleLocation(repositoryURL, "repo1");
  94.143 +        SubversionSCM scm = new SubversionSCM(Collections.singletonList(mod1), true, null, "", "", "");
  94.144 +        IndexBuilderImpl indexer = new IndexBuilderImpl("test", "test");
  94.145 +        p.setScm(scm);
  94.146 +        p.getBuildersList().add(indexer);
  94.147 +
  94.148 +        doRunProject(p);
  94.149 +
  94.150 +        assertTrue(indexer.called);
  94.151 +
  94.152 +        runSubversion("remove", "B.java");
  94.153 +        createFile("C.java");
  94.154 +        runSubversion("add", "C.java");
  94.155 +        runSubversion("commit", "-m", "");
  94.156 +
  94.157 +        indexer.called = false;
  94.158 +        doRunProject(p);
  94.159 +
  94.160 +        assertTrue(indexer.called);
  94.161 +        assertEquals(Arrays.asList(""), indexer.addedOrModified);
  94.162 +        assertEquals(Arrays.asList(""), indexer.removed);
  94.163 +    }
  94.164 +
  94.165 +    private void doRunProject(FreeStyleProject p) throws SAXException, IOException, InterruptedException {
  94.166 +        WebClient w = new WebClient();
  94.167 +        w.getPage(p, "build?delay=0sec");
  94.168 +
  94.169 +        Thread.sleep(5000);
  94.170 +
  94.171 +        while (p.isBuilding()) {
  94.172 +            Thread.sleep(100);
  94.173 +        }
  94.174 +    }
  94.175 +
  94.176 +    private void runSubversion(String... args) throws IOException, InterruptedException {
  94.177 +        Launcher.LocalLauncher l = new Launcher.LocalLauncher(new StreamTaskListener(System.err));
  94.178 +        l.launch().cmds(new ArgumentListBuilder().add("svn").add(args))
  94.179 +                  .pwd(checkoutDir)
  94.180 +                  .start()
  94.181 +                  .join();
  94.182 +    }
  94.183 +
  94.184 +    private void runSubversionAdmin(String... args) throws IOException, InterruptedException {
  94.185 +        Launcher.LocalLauncher l = new Launcher.LocalLauncher(new StreamTaskListener(System.err));
  94.186 +        l.launch().cmds(new ArgumentListBuilder().add("svnadmin").add(args))
  94.187 +                  .pwd(repositoryDir)
  94.188 +                  .start()
  94.189 +                  .join();
  94.190 +    }
  94.191 +
  94.192 +    private void createFile(String relativePath) throws IOException {
  94.193 +        File toCreate = new File(checkoutDir, relativePath.replace('/', File.separatorChar));
  94.194 +
  94.195 +        toCreate.getParentFile().mkdirs();
  94.196 +
  94.197 +        new FileOutputStream(toCreate).close();
  94.198 +    }
  94.199 +
  94.200 +    private static final class IndexBuilderImpl extends IndexingBuilder {
  94.201 +
  94.202 +        private boolean called;
  94.203 +        private Set<String> addedOrModified;
  94.204 +        private Set<String> removed;
  94.205 +
  94.206 +        public IndexBuilderImpl(String projectName, String toolName) {
  94.207 +            super(projectName, toolName);
  94.208 +        }
  94.209 +
  94.210 +        @Override
  94.211 +        protected boolean doIndex(File cacheDir, AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener, Set<String> addedOrModified, Set<String> removed) throws IOException, InterruptedException {
  94.212 +            this.addedOrModified = addedOrModified;
  94.213 +            this.removed = removed;
  94.214 +            called = true;
  94.215 +            return true;
  94.216 +        }
  94.217 +
  94.218 +    }
  94.219 +
  94.220 +}
  94.221 \ No newline at end of file
    95.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    95.2 +++ b/remoting/server/indexer/build.xml	Thu Jun 23 15:07:16 2011 +0200
    95.3 @@ -0,0 +1,8 @@
    95.4 +<?xml version="1.0" encoding="UTF-8"?>
    95.5 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
    95.6 +<!-- for some information on what you could do (e.g. targets to override). -->
    95.7 +<!-- If you delete this file and reopen the project it will be recreated. -->
    95.8 +<project name="indexing" basedir=".">
    95.9 +    <description>Builds the module suite indexing.</description>
   95.10 +    <import file="nbproject/build-impl.xml"/>
   95.11 +</project>
    96.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    96.2 +++ b/remoting/server/indexer/impl/build.xml	Thu Jun 23 15:07:16 2011 +0200
    96.3 @@ -0,0 +1,8 @@
    96.4 +<?xml version="1.0" encoding="UTF-8"?>
    96.5 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
    96.6 +<!-- for some information on what you could do (e.g. targets to override). -->
    96.7 +<!-- If you delete this file and reopen the project it will be recreated. -->
    96.8 +<project name="org.netbeans.modules.jackpot30.backend.impl" default="netbeans" basedir=".">
    96.9 +    <description>Builds, tests, and runs the project org.netbeans.modules.jackpot30.backend.impl.</description>
   96.10 +    <import file="nbproject/build-impl.xml"/>
   96.11 +</project>
    97.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    97.2 +++ b/remoting/server/indexer/impl/manifest.mf	Thu Jun 23 15:07:16 2011 +0200
    97.3 @@ -0,0 +1,4 @@
    97.4 +Manifest-Version: 1.0
    97.5 +OpenIDE-Module: org.netbeans.modules.jackpot30.backend.impl
    97.6 +OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jackpot30/backend/impl/Bundle.properties
    97.7 +OpenIDE-Module-Specification-Version: 1.0
    98.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    98.2 +++ b/remoting/server/indexer/impl/nbproject/build-impl.xml	Thu Jun 23 15:07:16 2011 +0200
    98.3 @@ -0,0 +1,45 @@
    98.4 +<?xml version="1.0" encoding="UTF-8"?>
    98.5 +<!--
    98.6 +*** GENERATED FROM project.xml - DO NOT EDIT  ***
    98.7 +***         EDIT ../build.xml INSTEAD         ***
    98.8 +-->
    98.9 +<project name="org.netbeans.modules.jackpot30.backend.impl-impl" basedir="..">
   98.10 +    <fail message="Please build using Ant 1.7.1 or higher.">
   98.11 +        <condition>
   98.12 +            <not>
   98.13 +                <antversion atleast="1.7.1"/>
   98.14 +            </not>
   98.15 +        </condition>
   98.16 +    </fail>
   98.17 +    <property file="nbproject/private/suite-private.properties"/>
   98.18 +    <property file="nbproject/suite.properties"/>
   98.19 +    <fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
   98.20 +    <property file="${suite.dir}/nbproject/private/platform-private.properties"/>
   98.21 +    <property file="${suite.dir}/nbproject/platform.properties"/>
   98.22 +    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
   98.23 +        <attribute name="name"/>
   98.24 +        <attribute name="value"/>
   98.25 +        <sequential>
   98.26 +            <property name="@{name}" value="${@{value}}"/>
   98.27 +        </sequential>
   98.28 +    </macrodef>
   98.29 +    <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
   98.30 +        <attribute name="property"/>
   98.31 +        <attribute name="value"/>
   98.32 +        <sequential>
   98.33 +            <property name="@{property}" value="@{value}"/>
   98.34 +        </sequential>
   98.35 +    </macrodef>
   98.36 +    <property file="${user.properties.file}"/>
   98.37 +    <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
   98.38 +    <nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
   98.39 +    <nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
   98.40 +    <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
   98.41 +        <condition>
   98.42 +            <not>
   98.43 +                <contains string="${cluster.path.evaluated}" substring="platform"/>
   98.44 +            </not>
   98.45 +        </condition>
   98.46 +    </fail>
   98.47 +    <import file="${harness.dir}/build.xml"/>
   98.48 +</project>
    99.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    99.2 +++ b/remoting/server/indexer/impl/nbproject/genfiles.properties	Thu Jun 23 15:07:16 2011 +0200
    99.3 @@ -0,0 +1,8 @@
    99.4 +build.xml.data.CRC32=f3e356a3
    99.5 +build.xml.script.CRC32=c32e03a8
    99.6 +build.xml.stylesheet.CRC32=a56c6a5b@1.47
    99.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
    99.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    99.9 +nbproject/build-impl.xml.data.CRC32=f3e356a3
   99.10 +nbproject/build-impl.xml.script.CRC32=87e6e497
   99.11 +nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.47
   100.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   100.2 +++ b/remoting/server/indexer/impl/nbproject/platform.properties	Thu Jun 23 15:07:16 2011 +0200
   100.3 @@ -0,0 +1,14 @@
   100.4 +cluster.path=\
   100.5 +    ${nbplatform.active.dir}/nb:\
   100.6 +    ${nbplatform.active.dir}/latex:\
   100.7 +    ${nbplatform.active.dir}/enterprise:\
   100.8 +    ${nbplatform.active.dir}/ide:\
   100.9 +    ${nbplatform.active.dir}/java:\
  100.10 +    ${nbplatform.active.dir}/dlight:\
  100.11 +    ${nbplatform.active.dir}/websvccommon:\
  100.12 +    ${nbplatform.active.dir}/apisupport:\
  100.13 +    ${nbplatform.active.dir}/profiler:\
  100.14 +    ${nbplatform.active.dir}/platform:\
  100.15 +    ${nbplatform.active.dir}/cnd:\
  100.16 +    ${nbplatform.active.dir}/harness
  100.17 +nbplatform.active=trunk
   101.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   101.2 +++ b/remoting/server/indexer/impl/nbproject/project.properties	Thu Jun 23 15:07:16 2011 +0200
   101.3 @@ -0,0 +1,2 @@
   101.4 +javac.source=1.6
   101.5 +javac.compilerargs=-Xlint -Xlint:-serial
   102.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   102.2 +++ b/remoting/server/indexer/impl/nbproject/project.xml	Thu Jun 23 15:07:16 2011 +0200
   102.3 @@ -0,0 +1,222 @@
   102.4 +<?xml version="1.0" encoding="UTF-8"?>
   102.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
   102.6 +    <type>org.netbeans.modules.apisupport.project</type>
   102.7 +    <configuration>
   102.8 +        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
   102.9 +            <code-name-base>org.netbeans.modules.jackpot30.backend.impl</code-name-base>
  102.10 +            <suite-component/>
  102.11 +            <module-dependencies>
  102.12 +                <dependency>
  102.13 +                    <code-name-base>org.netbeans.api.java.classpath</code-name-base>
  102.14 +                    <build-prerequisite/>
  102.15 +                    <compile-dependency/>
  102.16 +                    <run-dependency>
  102.17 +                        <release-version>1</release-version>
  102.18 +                        <specification-version>1.27</specification-version>
  102.19 +                    </run-dependency>
  102.20 +                </dependency>
  102.21 +                <dependency>
  102.22 +                    <code-name-base>org.netbeans.api.progress</code-name-base>
  102.23 +                    <build-prerequisite/>
  102.24 +                    <compile-dependency/>
  102.25 +                    <run-dependency>
  102.26 +                        <release-version>1</release-version>
  102.27 +                        <specification-version>1.22</specification-version>
  102.28 +                    </run-dependency>
  102.29 +                </dependency>
  102.30 +                <dependency>
  102.31 +                    <code-name-base>org.netbeans.libs.freemarker</code-name-base>
  102.32 +                    <build-prerequisite/>
  102.33 +                    <compile-dependency/>
  102.34 +                    <run-dependency>
  102.35 +                        <release-version>1</release-version>
  102.36 +                        <implementation-version/>
  102.37 +                    </run-dependency>
  102.38 +                </dependency>
  102.39 +                <dependency>
  102.40 +                    <code-name-base>org.netbeans.libs.javacapi</code-name-base>
  102.41 +                    <build-prerequisite/>
  102.42 +                    <compile-dependency/>
  102.43 +                    <run-dependency>
  102.44 +                        <specification-version>7.2.0.2</specification-version>
  102.45 +                    </run-dependency>
  102.46 +                </dependency>
  102.47 +                <dependency>
  102.48 +                    <code-name-base>org.netbeans.libs.javacimpl</code-name-base>
  102.49 +                    <build-prerequisite/>
  102.50 +                    <compile-dependency/>
  102.51 +                    <run-dependency>
  102.52 +                        <release-version>1</release-version>
  102.53 +                        <implementation-version/>
  102.54 +                    </run-dependency>
  102.55 +                </dependency>
  102.56 +                <dependency>
  102.57 +                    <code-name-base>org.netbeans.libs.lucene</code-name-base>
  102.58 +                    <build-prerequisite/>
  102.59 +                    <compile-dependency/>
  102.60 +                    <run-dependency>
  102.61 +                        <release-version>3</release-version>
  102.62 +                        <specification-version>3.0</specification-version>
  102.63 +                    </run-dependency>
  102.64 +                </dependency>
  102.65 +                <dependency>
  102.66 +                    <code-name-base>org.netbeans.modules.java.hints</code-name-base>
  102.67 +                    <build-prerequisite/>
  102.68 +                    <compile-dependency/>
  102.69 +                    <run-dependency>
  102.70 +                        <release-version>1</release-version>
  102.71 +                        <implementation-version/>
  102.72 +                    </run-dependency>
  102.73 +                </dependency>
  102.74 +                <dependency>
  102.75 +                    <code-name-base>org.netbeans.modules.java.source</code-name-base>
  102.76 +                    <build-prerequisite/>
  102.77 +                    <compile-dependency/>
  102.78 +                    <run-dependency>
  102.79 +                        <implementation-version/>
  102.80 +                    </run-dependency>
  102.81 +                </dependency>
  102.82 +                <dependency>
  102.83 +                    <code-name-base>org.netbeans.modules.jumpto</code-name-base>
  102.84 +                    <build-prerequisite/>
  102.85 +                    <compile-dependency/>
  102.86 +                    <run-dependency>
  102.87 +                        <release-version>1</release-version>
  102.88 +                        <implementation-version/>
  102.89 +                    </run-dependency>
  102.90 +                </dependency>
  102.91 +                <dependency>
  102.92 +                    <code-name-base>org.netbeans.modules.parsing.api</code-name-base>
  102.93 +                    <build-prerequisite/>
  102.94 +                    <compile-dependency/>
  102.95 +                    <run-dependency>
  102.96 +                        <release-version>1</release-version>
  102.97 +                        <implementation-version/>
  102.98 +                    </run-dependency>
  102.99 +                </dependency>
 102.100 +                <dependency>
 102.101 +                    <code-name-base>org.netbeans.modules.project.ant</code-name-base>
 102.102 +                    <build-prerequisite/>
 102.103 +                    <compile-dependency/>
 102.104 +                    <run-dependency>
 102.105 +                        <release-version>1</release-version>
 102.106 +                        <specification-version>1.39</specification-version>
 102.107 +                    </run-dependency>
 102.108 +                </dependency>
 102.109 +                <dependency>
 102.110 +                    <code-name-base>org.netbeans.modules.projectapi</code-name-base>
 102.111 +                    <build-prerequisite/>
 102.112 +                    <compile-dependency/>
 102.113 +                    <run-dependency>
 102.114 +                        <release-version>1</release-version>
 102.115 +                        <specification-version>1.34</specification-version>
 102.116 +                    </run-dependency>
 102.117 +                </dependency>
 102.118 +                <dependency>
 102.119 +                    <code-name-base>org.netbeans.modules.projectuiapi</code-name-base>
 102.120 +                    <build-prerequisite/>
 102.121 +                    <compile-dependency/>
 102.122 +                    <run-dependency>
 102.123 +                        <release-version>1</release-version>
 102.124 +                        <specification-version>1.49.0.8</specification-version>
 102.125 +                    </run-dependency>
 102.126 +                </dependency>
 102.127 +                <dependency>
 102.128 +                    <code-name-base>org.netbeans.modules.sendopts</code-name-base>
 102.129 +                    <build-prerequisite/>
 102.130 +                    <compile-dependency/>
 102.131 +                    <run-dependency>
 102.132 +                        <release-version>2</release-version>
 102.133 +                        <specification-version>2.11</specification-version>
 102.134 +                    </run-dependency>
 102.135 +                </dependency>
 102.136 +                <dependency>
 102.137 +                    <code-name-base>org.netbeans.modules.servletjspapi</code-name-base>
 102.138 +                    <build-prerequisite/>
 102.139 +                    <compile-dependency/>
 102.140 +                    <run-dependency>
 102.141 +                        <release-version>1</release-version>
 102.142 +                        <specification-version>1.10.0.25</specification-version>
 102.143 +                    </run-dependency>
 102.144 +                </dependency>
 102.145 +                <dependency>
 102.146 +                    <code-name-base>org.netbeans.modules.websvc.restlib</code-name-base>
 102.147 +                    <build-prerequisite/>
 102.148 +                    <compile-dependency/>
 102.149 +                    <run-dependency>
 102.150 +                        <release-version>0</release-version>
 102.151 +                        <specification-version>1.9</specification-version>
 102.152 +                    </run-dependency>
 102.153 +                </dependency>
 102.154 +                <dependency>
 102.155 +                    <code-name-base>org.netbeans.spi.editor.hints</code-name-base>
 102.156 +                    <build-prerequisite/>
 102.157 +                    <compile-dependency/>
 102.158 +                    <run-dependency>
 102.159 +                        <release-version>0</release-version>
 102.160 +                        <specification-version>1.16.0.7.6</specification-version>
 102.161 +                    </run-dependency>
 102.162 +                </dependency>
 102.163 +                <dependency>
 102.164 +                    <code-name-base>org.openide.filesystems</code-name-base>
 102.165 +                    <build-prerequisite/>
 102.166 +                    <compile-dependency/>
 102.167 +                    <run-dependency>
 102.168 +                        <specification-version>7.45</specification-version>
 102.169 +                    </run-dependency>
 102.170 +                </dependency>
 102.171 +                <dependency>
 102.172 +                    <code-name-base>org.openide.modules</code-name-base>
 102.173 +                    <build-prerequisite/>
 102.174 +                    <compile-dependency/>
 102.175 +                    <run-dependency>
 102.176 +                        <specification-version>7.21</specification-version>
 102.177 +                    </run-dependency>
 102.178 +                </dependency>
 102.179 +                <dependency>
 102.180 +                    <code-name-base>org.openide.text</code-name-base>
 102.181 +                    <build-prerequisite/>
 102.182 +                    <compile-dependency/>
 102.183 +                    <run-dependency>
 102.184 +                        <specification-version>6.35</specification-version>
 102.185 +                    </run-dependency>
 102.186 +                </dependency>
 102.187 +                <dependency>
 102.188 +                    <code-name-base>org.openide.util</code-name-base>
 102.189 +                    <build-prerequisite/>
 102.190 +                    <compile-dependency/>
 102.191 +                    <run-dependency>
 102.192 +                        <specification-version>8.12</specification-version>
 102.193 +                    </run-dependency>
 102.194 +                </dependency>
 102.195 +                <dependency>
 102.196 +                    <code-name-base>org.openide.util.lookup</code-name-base>
 102.197 +                    <build-prerequisite/>
 102.198 +                    <compile-dependency/>
 102.199 +                    <run-dependency>
 102.200 +                        <specification-version>8.5</specification-version>
 102.201 +                    </run-dependency>
 102.202 +                </dependency>
 102.203 +            </module-dependencies>
 102.204 +            <test-dependencies>
 102.205 +                <test-type>
 102.206 +                    <name>unit</name>
 102.207 +                    <test-dependency>
 102.208 +                        <code-name-base>org.netbeans.libs.junit4</code-name-base>
 102.209 +                        <compile-dependency/>
 102.210 +                    </test-dependency>
 102.211 +                    <test-dependency>
 102.212 +                        <code-name-base>org.netbeans.modules.junitlib</code-name-base>
 102.213 +                        <compile-dependency/>
 102.214 +                    </test-dependency>
 102.215 +                    <test-dependency>
 102.216 +                        <code-name-base>org.netbeans.modules.nbjunit</code-name-base>
 102.217 +                        <recursive/>
 102.218 +                        <compile-dependency/>
 102.219 +                    </test-dependency>
 102.220 +                </test-type>
 102.221 +            </test-dependencies>
 102.222 +            <public-packages/>
 102.223 +        </data>
 102.224 +    </configuration>
 102.225 +</project>
   103.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   103.2 +++ b/remoting/server/indexer/impl/nbproject/suite.properties	Thu Jun 23 15:07:16 2011 +0200
   103.3 @@ -0,0 +1,1 @@
   103.4 +suite.dir=${basedir}/..
   104.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   104.2 +++ b/remoting/server/indexer/impl/src/org/netbeans/modules/jackpot30/backend/impl/Bundle.properties	Thu Jun 23 15:07:16 2011 +0200
   104.3 @@ -0,0 +1,1 @@
   104.4 +OpenIDE-Module-Name=Jackpot 3.0 Backend Impl
   105.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   105.2 +++ b/remoting/server/indexer/impl/src/org/netbeans/modules/jackpot30/backend/impl/CategoryStorage.java	Thu Jun 23 15:07:16 2011 +0200
   105.3 @@ -0,0 +1,126 @@
   105.4 +/*
   105.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   105.6 + *
   105.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
   105.8 + *
   105.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  105.10 + * Other names may be trademarks of their respective owners.
  105.11 + *
  105.12 + * The contents of this file are subject to the terms of either the GNU
  105.13 + * General Public License Version 2 only ("GPL") or the Common
  105.14 + * Development and Distribution License("CDDL") (collectively, the
  105.15 + * "License"). You may not use this file except in compliance with the
  105.16 + * License. You can obtain a copy of the License at
  105.17 + * http://www.netbeans.org/cddl-gplv2.html
  105.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  105.19 + * specific language governing permissions and limitations under the
  105.20 + * License.  When distributing the software, include this License Header
  105.21 + * Notice in each file and include the License file at
  105.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  105.23 + * particular file as subject to the "Classpath" exception as provided
  105.24 + * by Oracle in the GPL Version 2 section of the License file that
  105.25 + * accompanied this code. If applicable, add the following below the
  105.26 + * License Header, with the fields enclosed by brackets [] replaced by
  105.27 + * your own identifying information:
  105.28 + * "Portions Copyrighted [year] [name of copyright owner]"
  105.29 + *
  105.30 + * If you wish your version of this file to be governed by only the CDDL
  105.31 + * or only the GPL Version 2, indicate your decision by adding
  105.32 + * "[Contributor] elects to include this software in this distribution
  105.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  105.34 + * single choice of license, a recipient has the option to distribute
  105.35 + * your version of this file under either the CDDL, the GPL Version 2 or
  105.36 + * to extend the choice of license to its licensees as provided above.
  105.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  105.38 + * Version 2 license, then the option applies only if the new code is
  105.39 + * made subject to such option by the copyright holder.
  105.40 + *
  105.41 + * Contributor(s):
  105.42 + *
  105.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
  105.44 + */
  105.45 +package org.netbeans.modules.jackpot30.backend.impl;
  105.46 +
  105.47 +import java.net.MalformedURLException;
  105.48 +import java.net.URL;
  105.49 +import java.util.HashMap;
  105.50 +import java.util.HashSet;
  105.51 +import java.util.Map;
  105.52 +import java.util.Set;
  105.53 +import java.util.prefs.BackingStoreException;
  105.54 +import java.util.prefs.Preferences;
  105.55 +import org.openide.filesystems.FileObject;
  105.56 +import org.openide.filesystems.FileStateInvalidException;
  105.57 +import org.openide.filesystems.URLMapper;
  105.58 +import org.openide.util.Exceptions;
  105.59 +import org.openide.util.NbPreferences;
  105.60 +
  105.61 +/**
  105.62 + *
  105.63 + * @author lahvac
  105.64 + */
  105.65 +public class CategoryStorage {
  105.66 +
  105.67 +    public static void setCategoryContent(String categoryId, String categoryName, Set<FileObject> content) {
  105.68 +        Preferences categoriesNode = NbPreferences.forModule(CategoryStorage.class).node("categories");
  105.69 +
  105.70 +        categoriesNode.put(categoryId + "_displayName", categoryName);
  105.71 +
  105.72 +        StringBuilder roots = new StringBuilder();
  105.73 +
  105.74 +        for (FileObject f : content) {
  105.75 +            if (roots.length() > 0) {
  105.76 +                roots.append(';');
  105.77 +            }
  105.78 +
  105.79 +            try {
  105.80 +                roots.append(f.getURL().toExternalForm());
  105.81 +            } catch (FileStateInvalidException ex) {
  105.82 +                Exceptions.printStackTrace(ex);
  105.83 +            }
  105.84 +        }
  105.85 +
  105.86 +        categoriesNode.put(categoryId + "_roots", roots.toString());
  105.87 +    }
  105.88 +
  105.89 +    public static Set<FileObject> getCategoryContent(String categoryId) {
  105.90 +        Preferences categoriesNode = NbPreferences.forModule(CategoryStorage.class).node("categories");
  105.91 +        String roots = categoriesNode.get(categoryId + "_roots", "");
  105.92 +        Set<FileObject> result = new HashSet<FileObject>();
  105.93 +
  105.94 +        for (String urlString : roots.split(";")) {
  105.95 +            if (urlString.isEmpty()) continue;
  105.96 +
  105.97 +            try {
  105.98 +                URL url = new URL(urlString);
  105.99 +                FileObject root = URLMapper.findFileObject(url);
 105.100 +
 105.101 +                if (root != null) {
 105.102 +                    result.add(root);
 105.103 +                }
 105.104 +            } catch (MalformedURLException ex) {
 105.105 +                Exceptions.printStackTrace(ex);
 105.106 +            }
 105.107 +        }
 105.108 +
 105.109 +        return result;
 105.110 +    }
 105.111 +
 105.112 +    public static Map<String, String> listCategoriesWithNames() {
 105.113 +        Map<String, String> result = new HashMap<String, String>();
 105.114 +        Preferences categoriesNode = NbPreferences.forModule(CategoryStorage.class).node("categories");
 105.115 +
 105.116 +        try {
 105.117 +            for (String key : categoriesNode.keys()) {
 105.118 +                if (key.endsWith("_displayName")) {
 105.119 +                    String id = key.substring(0, key.length() - "_displayName".length());
 105.120 +                    result.put(id, categoriesNode.get(key, id));
 105.121 +                }
 105.122 +            }
 105.123 +        } catch (BackingStoreException ex) {
 105.124 +            Exceptions.printStackTrace(ex);
 105.125 +        }
 105.126 +
 105.127 +        return result;
 105.128 +    }
 105.129 +}
   106.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   106.2 +++ b/remoting/server/indexer/impl/src/org/netbeans/modules/jackpot30/backend/impl/OptionProcessorImpl.java	Thu Jun 23 15:07:16 2011 +0200
   106.3 @@ -0,0 +1,286 @@
   106.4 +/*
   106.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   106.6 + *
   106.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
   106.8 + *
   106.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  106.10 + * Other names may be trademarks of their respective owners.
  106.11 + *
  106.12 + * The contents of this file are subject to the terms of either the GNU
  106.13 + * General Public License Version 2 only ("GPL") or the Common
  106.14 + * Development and Distribution License("CDDL") (collectively, the
  106.15 + * "License"). You may not use this file except in compliance with the
  106.16 + * License. You can obtain a copy of the License at
  106.17 + * http://www.netbeans.org/cddl-gplv2.html
  106.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  106.19 + * specific language governing permissions and limitations under the
  106.20 + * License.  When distributing the software, include this License Header
  106.21 + * Notice in each file and include the License file at
  106.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  106.23 + * particular file as subject to the "Classpath" exception as provided
  106.24 + * by Oracle in the GPL Version 2 section of the License file that
  106.25 + * accompanied this code. If applicable, add the following below the
  106.26 + * License Header, with the fields enclosed by brackets [] replaced by
  106.27 + * your own identifying information:
  106.28 + * "Portions Copyrighted [year] [name of copyright owner]"
  106.29 + *
  106.30 + * If you wish your version of this file to be governed by only the CDDL
  106.31 + * or only the GPL Version 2, indicate your decision by adding
  106.32 + * "[Contributor] elects to include this software in this distribution
  106.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  106.34 + * single choice of license, a recipient has the option to distribute
  106.35 + * your version of this file under either the CDDL, the GPL Version 2 or
  106.36 + * to extend the choice of license to its licensees as provided above.
  106.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  106.38 + * Version 2 license, then the option applies only if the new code is
  106.39 + * made subject to such option by the copyright holder.
  106.40 + *
  106.41 + * Contributor(s):
  106.42 + *
  106.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
  106.44 + */
  106.45 +
  106.46 +package org.netbeans.modules.jackpot30.backend.impl;
  106.47 +
  106.48 +import java.io.File;
  106.49 +import java.io.FileOutputStream;
  106.50 +import java.io.IOException;
  106.51 +import java.io.InputStream;
  106.52 +import java.util.Arrays;
  106.53 +import java.util.HashSet;
  106.54 +import java.util.Map;
  106.55 +import java.util.Properties;
  106.56 +import java.util.Set;
  106.57 +import java.util.jar.JarOutputStream;
  106.58 +import java.util.zip.ZipEntry;
  106.59 +import org.netbeans.api.java.classpath.ClassPath;
  106.60 +import org.netbeans.api.java.classpath.GlobalPathRegistry;
  106.61 +import org.netbeans.api.java.source.SourceUtils;
  106.62 +import org.netbeans.api.project.Project;
  106.63 +import org.netbeans.api.project.ProjectManager;
  106.64 +import org.netbeans.api.project.ProjectUtils;
  106.65 +import org.netbeans.api.project.SourceGroup;
  106.66 +import org.netbeans.api.project.ui.OpenProjects;
  106.67 +import org.netbeans.api.sendopts.CommandException;
  106.68 +import org.netbeans.modules.parsing.impl.indexing.CacheFolder;
  106.69 +import org.netbeans.spi.java.classpath.support.ClassPathSupport;
  106.70 +import org.netbeans.spi.project.support.ant.PropertyUtils;
  106.71 +import org.netbeans.spi.sendopts.Env;
  106.72 +import org.netbeans.spi.sendopts.Option;
  106.73 +import org.netbeans.spi.sendopts.OptionProcessor;
  106.74 +import org.openide.LifecycleManager;
  106.75 +import org.openide.filesystems.FileObject;
  106.76 +import org.openide.filesystems.FileUtil;
  106.77 +import org.openide.util.Exceptions;
  106.78 +import org.openide.util.lookup.ServiceProvider;
  106.79 +
  106.80 +/**
  106.81 + *
  106.82 + * @author lahvac
  106.83 + */
  106.84 +@ServiceProvider(service=OptionProcessor.class)
  106.85 +public class OptionProcessorImpl extends OptionProcessor {
  106.86 +
  106.87 +    private final Option CATEGORY_ID = Option.requiredArgument(Option.NO_SHORT_NAME, "category-id");
  106.88 +    private final Option CATEGORY_NAME = Option.requiredArgument(Option.NO_SHORT_NAME, "category-name");
  106.89 +    private final Option CATEGORY_PROJECTS = Option.additionalArguments(Option.NO_SHORT_NAME, "category-projects");
  106.90 +    private final Option CATEGORY_ROOT_DIR = Option.requiredArgument(Option.NO_SHORT_NAME, "category-root-dir");
  106.91 +    private final Option CACHE_TARGET = Option.requiredArgument(Option.NO_SHORT_NAME, "cache-target");
  106.92 +    private final Set<Option> OPTIONS = new HashSet<Option>(Arrays.asList(CATEGORY_ID, CATEGORY_NAME, CATEGORY_PROJECTS, CATEGORY_ROOT_DIR, CACHE_TARGET));
  106.93 +    
  106.94 +    @Override
  106.95 +    protected Set<Option> getOptions() {
  106.96 +        return OPTIONS;
  106.97 +    }
  106.98 +
  106.99 +    @Override
 106.100 +    protected void process(Env env, Map<Option, String[]> optionValues) throws CommandException {
 106.101 +        String categoryId = null;
 106.102 +        String categoryName = null;
 106.103 +
 106.104 +        if (optionValues.containsKey(CATEGORY_ID)) {
 106.105 +            categoryId = optionValues.get(CATEGORY_ID)[0];
 106.106 +        }
 106.107 +
 106.108 +        if (optionValues.containsKey(CATEGORY_NAME)) {
 106.109 +            categoryName = optionValues.get(CATEGORY_NAME)[0];
 106.110 +        }
 106.111 +
 106.112 +        if (optionValues.containsKey(CATEGORY_PROJECTS)) {
 106.113 +            if (categoryId == null) {
 106.114 +                env.getErrorStream().println("Error: no category-id specified!");
 106.115 +                return;
 106.116 +            }
 106.117 +
 106.118 +            if (categoryName == null) {
 106.119 +                env.getErrorStream().println("Warning: no category-name specified.");
 106.120 +                return;
 106.121 +            }
 106.122 +
 106.123 +            try {
 106.124 +                CategoryStorage.setCategoryContent(categoryId, categoryName, getRoots(optionValues.get(CATEGORY_PROJECTS), env));
 106.125 +            } catch (InterruptedException ex) {
 106.126 +                throw (CommandException) new CommandException(0).initCause(ex);
 106.127 +            }
 106.128 +        }
 106.129 +
 106.130 +        String cacheTarget = optionValues.get(CACHE_TARGET)[0];
 106.131 +        File cache = FileUtil.normalizeFile(new File(cacheTarget));
 106.132 +
 106.133 +        cache.getParentFile().mkdirs();
 106.134 +
 106.135 +        if (categoryId == null) {
 106.136 +            env.getErrorStream().println("Error: no category-id specified!");
 106.137 +            return;
 106.138 +        }
 106.139 +
 106.140 +        try {
 106.141 +            indexProjects(CategoryStorage.getCategoryContent(categoryId), env);
 106.142 +        } catch (InterruptedException ex) {
 106.143 +            throw (CommandException) new CommandException(0).initCause(ex);
 106.144 +        } catch (IOException ex) {
 106.145 +            throw (CommandException) new CommandException(0).initCause(ex);
 106.146 +        }
 106.147 +
 106.148 +        JarOutputStream out = null;
 106.149 +        InputStream segments = null;
 106.150 +
 106.151 +        try {
 106.152 +            FileObject cacheFolder = CacheFolder.getCacheFolder();
 106.153 +
 106.154 +            out = new JarOutputStream(new FileOutputStream(cache));
 106.155 +            pack(out, cacheFolder, categoryId, new StringBuilder());
 106.156 +
 106.157 +            segments = cacheFolder.getFileObject("segments").getInputStream();
 106.158 +            Properties in = new Properties();
 106.159 +
 106.160 +            in.load(segments);
 106.161 +
 106.162 +            segments.close();//XXX: should be in finally!
 106.163 +
 106.164 +            File baseDirFile = new File(optionValues.get(CATEGORY_ROOT_DIR)[0]);
 106.165 +            String baseDir = baseDirFile.toURI().toString();
 106.166 +
 106.167 +            Properties outSegments = new Properties();
 106.168 +
 106.169 +            for (String segment : in.stringPropertyNames()) {
 106.170 +                String url = in.getProperty(segment);
 106.171 +                String rel = url.startsWith(baseDir) ? "rel:/" + url.substring(baseDir.length()) : url;
 106.172 +
 106.173 +                outSegments.setProperty(segment, rel);
 106.174 +            }
 106.175 +
 106.176 +            out.putNextEntry(new ZipEntry(categoryId + "/segments"));
 106.177 +
 106.178 +            outSegments.store(out, "");
 106.179 +        } catch (IOException ex) {
 106.180 +            throw (CommandException) new CommandException(0).initCause(ex);
 106.181 +        } finally {
 106.182 +            if (out != null) {
 106.183 +                try {
 106.184 +                    out.close();
 106.185 +                } catch (IOException ex) {
 106.186 +                    throw (CommandException) new CommandException(0).initCause(ex);
 106.187 +                }
 106.188 +            }
 106.189 +
 106.190 +            if (segments != null) {
 106.191 +                try {
 106.192 +                    segments.close();
 106.193 +                } catch (IOException ex) {
 106.194 +                    throw (CommandException) new CommandException(0).initCause(ex);
 106.195 +                }
 106.196 +            }
 106.197 +        }
 106.198 +        
 106.199 +        LifecycleManager.getDefault().exit();
 106.200 +    }
 106.201 +
 106.202 +    private Set<FileObject> getRoots(String[] projects, Env env) throws IllegalArgumentException, InterruptedException {
 106.203 +        Set<FileObject> sourceRoots = new HashSet<FileObject>(projects.length * 4 / 3 + 1);
 106.204 +
 106.205 +        for (String p : projects) {
 106.206 +            File f = PropertyUtils.resolveFile(env.getCurrentDirectory(), p);
 106.207 +            File normalized = FileUtil.normalizeFile(f);
 106.208 +            FileObject prjFO = FileUtil.toFileObject(normalized);
 106.209 +
 106.210 +            if (prjFO == null) {
 106.211 +                env.getErrorStream().println("Project location cannot be found: " + p);
 106.212 +                continue;
 106.213 +            }
 106.214 +
 106.215 +            if (!prjFO.isFolder()) {
 106.216 +                env.getErrorStream().println("Project specified as: " + p + " does not point to a directory (" + FileUtil.getFileDisplayName(prjFO));
 106.217 +                continue;
 106.218 +            }
 106.219 +
 106.220 +            try {
 106.221 +                Project prj = ProjectManager.getDefault().findProject(prjFO);
 106.222 +
 106.223 +                if (prj == null) {
 106.224 +                    env.getErrorStream().println("Project specified as: " + p + " does not resolve to a project (" + FileUtil.getFileDisplayName(prjFO));
 106.225 +                    continue;
 106.226 +                }
 106.227 +
 106.228 +                SourceGroup[] javaSG = ProjectUtils.getSources(prj).getSourceGroups("java");
 106.229 +
 106.230 +                if (javaSG.length == 0) {
 106.231 +                    env.getErrorStream().println("Project specified as: " + p + " does not define a java source groups (" + FileUtil.getFileDisplayName(prjFO));
 106.232 +                    continue;
 106.233 +                }
 106.234 +
 106.235 +                for (SourceGroup sg : javaSG) {
 106.236 +                    sourceRoots.add(sg.getRootFolder());
 106.237 +                }
 106.238 +            } catch (IOException ex) {
 106.239 +                Exceptions.printStackTrace(ex);
 106.240 +            } catch (IllegalArgumentException ex) {
 106.241 +                Exceptions.printStackTrace(ex);
 106.242 +            }
 106.243 +        }
 106.244 +
 106.245 +        return sourceRoots;
 106.246 +    }
 106.247 +
 106.248 +    private void indexProjects(Set<FileObject> sourceRoots, Env env) throws IOException, InterruptedException {
 106.249 +        if (sourceRoots.isEmpty()) {
 106.250 +            env.getErrorStream().println("Error: There is nothing to index!");
 106.251 +        } else {
 106.252 +            //XXX: to start up the project systems and RepositoryUpdater:
 106.253 +            ((Runnable) OpenProjects.getDefault().openProjects()).run();
 106.254 +            org.netbeans.api.project.ui.OpenProjects.getDefault().getOpenProjects();
 106.255 +            ClassPath source = ClassPathSupport.createClassPath(sourceRoots.toArray(new FileObject[0]));
 106.256 +
 106.257 +            GlobalPathRegistry.getDefault().register(ClassPath.SOURCE, new ClassPath[] {source});
 106.258 +            SourceUtils.waitScanFinished();
 106.259 +            GlobalPathRegistry.getDefault().unregister(ClassPath.SOURCE, new ClassPath[] {source});
 106.260 +        }
 106.261 +    }
 106.262 +
 106.263 +    private void pack(JarOutputStream target, FileObject index, String name, StringBuilder relPath) throws IOException {
 106.264 +        int len = relPath.length();
 106.265 +        boolean first = relPath.length() == 0;
 106.266 +
 106.267 +        if (!first) relPath.append("/");
 106.268 +        relPath.append(name);
 106.269 +
 106.270 +        for (FileObject c : index.getChildren()) {
 106.271 +            if (first && c.getNameExt().equals("segments")) continue;
 106.272 +            pack(target, c, c.getNameExt(), relPath);
 106.273 +        }
 106.274 +
 106.275 +        if (index.isData()) {
 106.276 +            target.putNextEntry(new ZipEntry(relPath.toString()));
 106.277 +
 106.278 +            InputStream in = index.getInputStream();
 106.279 +
 106.280 +            try {
 106.281 +                FileUtil.copy(in, target);
 106.282 +            } finally {
 106.283 +                in.close();
 106.284 +            }
 106.285 +        }
 106.286 +
 106.287 +        relPath.delete(len, relPath.length());
 106.288 +    }
 106.289 +}
   107.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   107.2 +++ b/remoting/server/indexer/nbproject/build-impl.xml	Thu Jun 23 15:07:16 2011 +0200
   107.3 @@ -0,0 +1,49 @@
   107.4 +<?xml version="1.0" encoding="UTF-8"?>
   107.5 +<!--
   107.6 +*** GENERATED FROM project.xml - DO NOT EDIT  ***
   107.7 +***         EDIT ../build.xml INSTEAD         ***
   107.8 +-->
   107.9 +<project name="indexing-impl" basedir=".." xmlns:sproject="http://www.netbeans.org/ns/nb-module-suite-project/1">
  107.10 +    <fail message="Please build using Ant 1.7.1 or higher.">
  107.11 +        <condition>
  107.12 +            <not>
  107.13 +                <antversion atleast="1.7.1"/>
  107.14 +            </not>
  107.15 +        </condition>
  107.16 +    </fail>
  107.17 +    <property file="nbproject/private/platform-private.properties"/>
  107.18 +    <property file="nbproject/platform.properties"/>
  107.19 +    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-suite-project/1">
  107.20 +        <attribute name="name"/>
  107.21 +        <attribute name="value"/>
  107.22 +        <sequential>
  107.23 +            <property name="@{name}" value="${@{value}}"/>
  107.24 +        </sequential>
  107.25 +    </macrodef>
  107.26 +    <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-suite-project/1">
  107.27 +        <attribute name="property"/>
  107.28 +        <attribute name="value"/>
  107.29 +        <sequential>
  107.30 +            <property name="@{property}" value="@{value}"/>
  107.31 +        </sequential>
  107.32 +    </macrodef>
  107.33 +    <property file="${user.properties.file}"/>
  107.34 +    <sproject:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir"/>
  107.35 +    <sproject:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir"/>
  107.36 +    <sproject:evalprops property="cluster.path.evaluated" value="${cluster.path}"/>
  107.37 +    <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
  107.38 +        <condition>
  107.39 +            <not>
  107.40 +                <contains string="${cluster.path.evaluated}" substring="platform"/>
  107.41 +            </not>
  107.42 +        </condition>
  107.43 +    </fail>
  107.44 +    <fail message="Cannot find NetBeans build harness. ${line.separator}Check that nbplatform.${nbplatform.active}.netbeans.dest.dir and nbplatform.${nbplatform.active}.harness.dir are defined. ${line.separator}On a developer machine these are normally defined in ${user.properties.file}=${netbeans.user}/build.properties ${line.separator}but for automated builds you should pass these properties to Ant explicitly.">
  107.45 +        <condition>
  107.46 +            <not>
  107.47 +                <available type="dir" file="${harness.dir}"/>
  107.48 +            </not>
  107.49 +        </condition>
  107.50 +    </fail>
  107.51 +    <import file="${harness.dir}/suite.xml"/>
  107.52 +</project>
   108.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   108.2 +++ b/remoting/server/indexer/nbproject/genfiles.properties	Thu Jun 23 15:07:16 2011 +0200
   108.3 @@ -0,0 +1,8 @@
   108.4 +build.xml.data.CRC32=7bd55f34
   108.5 +build.xml.script.CRC32=f378700b
   108.6 +build.xml.stylesheet.CRC32=eaf9f76a@1.47
   108.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
   108.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
   108.9 +nbproject/build-impl.xml.data.CRC32=7bd55f34
  108.10 +nbproject/build-impl.xml.script.CRC32=fddaab7c
  108.11 +nbproject/build-impl.xml.stylesheet.CRC32=183e6ef3@1.47
   109.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   109.2 +++ b/remoting/server/indexer/nbproject/platform.properties	Thu Jun 23 15:07:16 2011 +0200
   109.3 @@ -0,0 +1,14 @@
   109.4 +cluster.path=\
   109.5 +    ${nbplatform.active.dir}/nb:\
   109.6 +    ${nbplatform.active.dir}/latex:\
   109.7 +    ${nbplatform.active.dir}/enterprise:\
   109.8 +    ${nbplatform.active.dir}/ide:\
   109.9 +    ${nbplatform.active.dir}/java:\
  109.10 +    ${nbplatform.active.dir}/dlight:\
  109.11 +    ${nbplatform.active.dir}/websvccommon:\
  109.12 +    ${nbplatform.active.dir}/apisupport:\
  109.13 +    ${nbplatform.active.dir}/profiler:\
  109.14 +    ${nbplatform.active.dir}/platform:\
  109.15 +    ${nbplatform.active.dir}/cnd:\
  109.16 +    ${nbplatform.active.dir}/harness
  109.17 +nbplatform.active=default
   110.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   110.2 +++ b/remoting/server/indexer/nbproject/project.properties	Thu Jun 23 15:07:16 2011 +0200
   110.3 @@ -0,0 +1,5 @@
   110.4 +app.name=indexer
   110.5 +branding.token=${app.name}
   110.6 +modules=\
   110.7 +    ${project.org.netbeans.modules.jackpot30.backend.impl}
   110.8 +project.org.netbeans.modules.jackpot30.backend.impl=impl
   111.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   111.2 +++ b/remoting/server/indexer/nbproject/project.xml	Thu Jun 23 15:07:16 2011 +0200
   111.3 @@ -0,0 +1,9 @@
   111.4 +<?xml version="1.0" encoding="UTF-8"?>
   111.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
   111.6 +    <type>org.netbeans.modules.apisupport.project.suite</type>
   111.7 +    <configuration>
   111.8 +        <data xmlns="http://www.netbeans.org/ns/nb-module-suite-project/1">
   111.9 +            <name>indexing</name>
  111.10 +        </data>
  111.11 +    </configuration>
  111.12 +</project>
   112.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   112.2 +++ b/remoting/server/scripts/index.sh	Thu Jun 23 15:07:16 2011 +0200
   112.3 @@ -0,0 +1,14 @@
   112.4 +DIR=`dirname $0`
   112.5 +USERDIR=`tempfile`;
   112.6 +rm $USERDIR
   112.7 +mkdir -p $USERDIR
   112.8 +trap "rm -rf -- '$USERDIR'" EXIT
   112.9 +
  112.10 +ID="$1"; shift
  112.11 +NAME="$1"; shift
  112.12 +TARGET="$1"; shift
  112.13 +ROOT_DIR="$1"; shift
  112.14 +
  112.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 "$@"
  112.16 +
  112.17 +exit
   113.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   113.2 +++ b/remoting/server/scripts/web.sh	Thu Jun 23 15:07:16 2011 +0200
   113.3 @@ -0,0 +1,2 @@
   113.4 +DIR=`dirname $0`
   113.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 "$@"
   114.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   114.2 +++ b/remoting/server/web/base.web.api/build.xml	Thu Jun 23 15:07:16 2011 +0200
   114.3 @@ -0,0 +1,74 @@
   114.4 +<?xml version="1.0" encoding="UTF-8"?>
   114.5 +<!-- You may freely edit this file. See commented blocks below for -->
   114.6 +<!-- some examples of how to customize the build. -->
   114.7 +<!-- (If you delete it and reopen the project it will be recreated.) -->
   114.8 +<!-- By default, only the Clean and Build commands use this build script. -->
   114.9 +<!-- Commands such as Run, Debug, and Test only use this build script if -->
  114.10 +<!-- the Compile on Save feature is turned off for the project. -->
  114.11 +<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
  114.12 +<!-- in the project's Project Properties dialog box.-->
  114.13 +<project name="base.web.api" default="default" basedir=".">
  114.14 +    <description>Builds, tests, and runs the project base.web.api.</description>
  114.15 +    <import file="nbproject/build-impl.xml"/>
  114.16 +    <!--
  114.17 +
  114.18 +    There exist several targets which are by default empty and which can be 
  114.19 +    used for execution of your tasks. These targets are usually executed 
  114.20 +    before and after some main targets. They are: 
  114.21 +
  114.22 +      -pre-init:                 called before initialization of project properties
  114.23 +      -post-init:                called after initialization of project properties
  114.24 +      -pre-compile:              called before javac compilation
  114.25 +      -post-compile:             called after javac compilation
  114.26 +      -pre-compile-single:       called before javac compilation of single file
  114.27 +      -post-compile-single:      called after javac compilation of single file
  114.28 +      -pre-compile-test:         called before javac compilation of JUnit tests
  114.29 +      -post-compile-test:        called after javac compilation of JUnit tests
  114.30 +      -pre-compile-test-single:  called before javac compilation of single JUnit test
  114.31 +      -post-compile-test-single: called after javac compilation of single JUunit test
  114.32 +      -pre-jar:                  called before JAR building
  114.33 +      -post-jar:                 called after JAR building
  114.34 +      -post-clean:               called after cleaning build products
  114.35 +
  114.36 +    (Targets beginning with '-' are not intended to be called on their own.)
  114.37 +
  114.38 +    Example of inserting an obfuscator after compilation could look like this:
  114.39 +
  114.40 +        <target name="-post-compile">
  114.41 +            <obfuscate>
  114.42 +                <fileset dir="${build.classes.dir}"/>
  114.43 +            </obfuscate>
  114.44 +        </target>
  114.45 +
  114.46 +    For list of available properties check the imported 
  114.47 +    nbproject/build-impl.xml file. 
  114.48 +
  114.49 +
  114.50 +    Another way to customize the build is by overriding existing main targets.
  114.51 +    The targets of interest are: 
  114.52 +
  114.53 +      -init-macrodef-javac:     defines macro for javac compilation
  114.54 +      -init-macrodef-junit:     defines macro for junit execution
  114.55 +      -init-macrodef-debug:     defines macro for class debugging
  114.56 +      -init-macrodef-java:      defines macro for class execution
  114.57 +      -do-jar-with-manifest:    JAR building (if you are using a manifest)
  114.58 +      -do-jar-without-manifest: JAR building (if you are not using a manifest)
  114.59 +      run:                      execution of project 
  114.60 +      -javadoc-build:           Javadoc generation
  114.61 +      test-report:              JUnit report generation
  114.62 +
  114.63 +    An example of overriding the target for project execution could look like this:
  114.64 +
  114.65 +        <target name="run" depends="base.web.api-impl.jar">
  114.66 +            <exec dir="bin" executable="launcher.exe">
  114.67 +                <arg file="${dist.jar}"/>
  114.68 +            </exec>
  114.69 +        </target>
  114.70 +
  114.71 +    Notice that the overridden target depends on the jar target and not only on 
  114.72 +    the compile target as the regular run target does. Again, for a list of available 
  114.73 +    properties which you can use, check the target you are overriding in the
  114.74 +    nbproject/build-impl.xml file. 
  114.75 +
  114.76 +    -->
  114.77 +</project>
   115.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   115.2 +++ b/remoting/server/web/base.web.api/manifest.mf	Thu Jun 23 15:07:16 2011 +0200
   115.3 @@ -0,0 +1,3 @@
   115.4 +Manifest-Version: 1.0
   115.5 +X-COMMENT: Main-Class will be added automatically by build
   115.6 +
   116.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   116.2 +++ b/remoting/server/web/base.web.api/nbproject/build-impl.xml	Thu Jun 23 15:07:16 2011 +0200
   116.3 @@ -0,0 +1,1068 @@
   116.4 +<?xml version="1.0" encoding="UTF-8"?>
   116.5 +<!--
   116.6 +*** GENERATED FROM project.xml - DO NOT EDIT  ***
   116.7 +***         EDIT ../build.xml INSTEAD         ***
   116.8 +
   116.9 +For the purpose of easier reading the script
  116.10 +is divided into following sections:
  116.11 +
  116.12 +  - initialization
  116.13 +  - compilation
  116.14 +  - jar
  116.15 +  - execution
  116.16 +  - debugging
  116.17 +  - javadoc
  116.18 +  - junit compilation
  116.19 +  - junit execution
  116.20 +  - junit debugging
  116.21 +  - applet
  116.22 +  - cleanup
  116.23 +
  116.24 +        -->
  116.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">
  116.26 +    <fail message="Please build using Ant 1.8.0 or higher.">
  116.27 +        <condition>
  116.28 +            <not>
  116.29 +                <antversion atleast="1.8.0"/>
  116.30 +            </not>
  116.31 +        </condition>
  116.32 +    </fail>
  116.33 +    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
  116.34 +    <!-- 
  116.35 +                ======================
  116.36 +                INITIALIZATION SECTION 
  116.37 +                ======================
  116.38 +            -->
  116.39 +    <target name="-pre-init">
  116.40 +        <!-- Empty placeholder for easier customization. -->
  116.41 +        <!-- You can override this target in the ../build.xml file. -->
  116.42 +    </target>
  116.43 +    <target depends="-pre-init" name="-init-private">
  116.44 +        <property file="nbproject/private/config.properties"/>
  116.45 +        <property file="nbproject/private/configs/${config}.properties"/>
  116.46 +        <property file="nbproject/private/private.properties"/>
  116.47 +    </target>
  116.48 +    <target name="-pre-init-libraries">
  116.49 +        <property location="../../../../server/lib/nblibraries.properties" name="libraries.path"/>
  116.50 +        <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
  116.51 +        <pathconvert dirsep="/" property="libraries.dir">
  116.52 +            <path path="${libraries.dir.nativedirsep}"/>
  116.53 +        </pathconvert>
  116.54 +        <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
  116.55 +        <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
  116.56 +    </target>
  116.57 +    <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
  116.58 +        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
  116.59 +            <filterchain>
  116.60 +                <replacestring from="$${base}" to="${libraries.dir}"/>
  116.61 +                <escapeunicode/>
  116.62 +            </filterchain>
  116.63 +        </loadproperties>
  116.64 +    </target>
  116.65 +    <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
  116.66 +        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
  116.67 +            <filterchain>
  116.68 +                <replacestring from="$${base}" to="${libraries.dir}"/>
  116.69 +                <escapeunicode/>
  116.70 +            </filterchain>
  116.71 +        </loadproperties>
  116.72 +    </target>
  116.73 +    <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
  116.74 +        <property file="${user.properties.file}"/>
  116.75 +        <!-- The two properties below are usually overridden -->
  116.76 +        <!-- by the active platform. Just a fallback. -->
  116.77 +        <property name="default.javac.source" value="1.4"/>
  116.78 +        <property name="default.javac.target" value="1.4"/>
  116.79 +    </target>
  116.80 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
  116.81 +        <property file="nbproject/configs/${config}.properties"/>
  116.82 +        <property file="nbproject/project.properties"/>
  116.83 +    </target>
  116.84 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
  116.85 +        <available file="${manifest.file}" property="manifest.available"/>
  116.86 +        <condition property="splashscreen.available">
  116.87 +            <and>
  116.88 +                <not>
  116.89 +                    <equals arg1="${application.splash}" arg2="" trim="true"/>
  116.90 +                </not>
  116.91 +                <available file="${application.splash}"/>
  116.92 +            </and>
  116.93 +        </condition>
  116.94 +        <condition property="main.class.available">
  116.95 +            <and>
  116.96 +                <isset property="main.class"/>
  116.97 +                <not>
  116.98 +                    <equals arg1="${main.class}" arg2="" trim="true"/>
  116.99 +                </not>
 116.100 +            </and>
 116.101 +        </condition>
 116.102 +        <condition property="manifest.available+main.class">
 116.103 +            <and>
 116.104 +                <isset property="manifest.available"/>
 116.105 +                <isset property="main.class.available"/>
 116.106 +            </and>
 116.107 +        </condition>
 116.108 +        <condition property="do.archive">
 116.109 +            <not>
 116.110 +                <istrue value="${jar.archive.disabled}"/>
 116.111 +            </not>
 116.112 +        </condition>
 116.113 +        <condition property="do.mkdist">
 116.114 +            <and>
 116.115 +                <isset property="do.archive"/>
 116.116 +                <isset property="libs.CopyLibs.classpath"/>
 116.117 +                <not>
 116.118 +                    <istrue value="${mkdist.disabled}"/>
 116.119 +                </not>
 116.120 +            </and>
 116.121 +        </condition>
 116.122 +        <condition property="manifest.available+main.class+mkdist.available">
 116.123 +            <and>
 116.124 +                <istrue value="${manifest.available+main.class}"/>
 116.125 +                <isset property="do.mkdist"/>
 116.126 +            </and>
 116.127 +        </condition>
 116.128 +        <condition property="do.archive+manifest.available">
 116.129 +            <and>
 116.130 +                <isset property="manifest.available"/>
 116.131 +                <istrue value="${do.archive}"/>
 116.132 +            </and>
 116.133 +        </condition>
 116.134 +        <condition property="do.archive+main.class.available">
 116.135 +            <and>
 116.136 +                <isset property="main.class.available"/>
 116.137 +                <istrue value="${do.archive}"/>
 116.138 +            </and>
 116.139 +        </condition>
 116.140 +        <condition property="do.archive+splashscreen.available">
 116.141 +            <and>
 116.142 +                <isset property="splashscreen.available"/>
 116.143 +                <istrue value="${do.archive}"/>
 116.144 +            </and>
 116.145 +        </condition>
 116.146 +        <condition property="do.archive+manifest.available+main.class">
 116.147 +            <and>
 116.148 +                <istrue value="${manifest.available+main.class}"/>
 116.149 +                <istrue value="${do.archive}"/>
 116.150 +            </and>
 116.151 +        </condition>
 116.152 +        <condition property="manifest.available-mkdist.available">
 116.153 +            <or>
 116.154 +                <istrue value="${manifest.available}"/>
 116.155 +                <isset property="do.mkdist"/>
 116.156 +            </or>
 116.157 +        </condition>
 116.158 +        <condition property="manifest.available+main.class-mkdist.available">
 116.159 +            <or>
 116.160 +                <istrue value="${manifest.available+main.class}"/>
 116.161 +                <isset property="do.mkdist"/>
 116.162 +            </or>
 116.163 +        </condition>
 116.164 +        <condition property="have.tests">
 116.165 +            <or>
 116.166 +                <available file="${test.src.dir}"/>
 116.167 +            </or>
 116.168 +        </condition>
 116.169 +        <condition property="have.sources">
 116.170 +            <or>
 116.171 +                <available file="${src.dir}"/>
 116.172 +            </or>
 116.173 +        </condition>
 116.174 +        <condition property="netbeans.home+have.tests">
 116.175 +            <and>
 116.176 +                <isset property="netbeans.home"/>
 116.177 +                <isset property="have.tests"/>
 116.178 +            </and>
 116.179 +        </condition>
 116.180 +        <condition property="no.javadoc.preview">
 116.181 +            <and>
 116.182 +                <isset property="javadoc.preview"/>
 116.183 +                <isfalse value="${javadoc.preview}"/>
 116.184 +            </and>
 116.185 +        </condition>
 116.186 +        <property name="run.jvmargs" value=""/>
 116.187 +        <property name="javac.compilerargs" value=""/>
 116.188 +        <property name="work.dir" value="${basedir}"/>
 116.189 +        <condition property="no.deps">
 116.190 +            <and>
 116.191 +                <istrue value="${no.dependencies}"/>
 116.192 +            </and>
 116.193 +        </condition>
 116.194 +        <property name="javac.debug" value="true"/>
 116.195 +        <property name="javadoc.preview" value="true"/>
 116.196 +        <property name="application.args" value=""/>
 116.197 +        <property name="source.encoding" value="${file.encoding}"/>
 116.198 +        <property name="runtime.encoding" value="${source.encoding}"/>
 116.199 +        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
 116.200 +            <and>
 116.201 +                <isset property="javadoc.encoding"/>
 116.202 +                <not>
 116.203 +                    <equals arg1="${javadoc.encoding}" arg2=""/>
 116.204 +                </not>
 116.205 +            </and>
 116.206 +        </condition>
 116.207 +        <property name="javadoc.encoding.used" value="${source.encoding}"/>
 116.208 +        <property name="includes" value="**"/>
 116.209 +        <property name="excludes" value=""/>
 116.210 +        <property name="do.depend" value="false"/>
 116.211 +        <condition property="do.depend.true">
 116.212 +            <istrue value="${do.depend}"/>
 116.213 +        </condition>
 116.214 +        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
 116.215 +        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
 116.216 +            <length length="0" string="${endorsed.classpath}" when="greater"/>
 116.217 +        </condition>
 116.218 +        <condition else="false" property="jdkBug6558476">
 116.219 +            <and>
 116.220 +                <matches pattern="1\.[56]" string="${java.specification.version}"/>
 116.221 +                <not>
 116.222 +                    <os family="unix"/>
 116.223 +                </not>
 116.224 +            </and>
 116.225 +        </condition>
 116.226 +        <property name="javac.fork" value="${jdkBug6558476}"/>
 116.227 +        <property name="jar.index" value="false"/>
 116.228 +        <property name="jar.index.metainf" value="${jar.index}"/>
 116.229 +        <property name="copylibs.rebase" value="true"/>
 116.230 +        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
 116.231 +    </target>
 116.232 +    <target name="-post-init">
 116.233 +        <!-- Empty placeholder for easier customization. -->
 116.234 +        <!-- You can override this target in the ../build.xml file. -->
 116.235 +    </target>
 116.236 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
 116.237 +        <fail unless="src.dir">Must set src.dir</fail>
 116.238 +        <fail unless="test.src.dir">Must set test.src.dir</fail>
 116.239 +        <fail unless="build.dir">Must set build.dir</fail>
 116.240 +        <fail unless="dist.dir">Must set dist.dir</fail>
 116.241 +        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
 116.242 +        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
 116.243 +        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
 116.244 +        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
 116.245 +        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
 116.246 +        <fail unless="dist.jar">Must set dist.jar</fail>
 116.247 +    </target>
 116.248 +    <target name="-init-macrodef-property">
 116.249 +        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
 116.250 +            <attribute name="name"/>
 116.251 +            <attribute name="value"/>
 116.252 +            <sequential>
 116.253 +                <property name="@{name}" value="${@{value}}"/>
 116.254 +            </sequential>
 116.255 +        </macrodef>
 116.256 +    </target>
 116.257 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
 116.258 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
 116.259 +            <attribute default="${src.dir}" name="srcdir"/>
 116.260 +            <attribute default="${build.classes.dir}" name="destdir"/>
 116.261 +            <attribute default="${javac.classpath}" name="classpath"/>
 116.262 +            <attribute default="${javac.processorpath}" name="processorpath"/>
 116.263 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
 116.264 +            <attribute default="${includes}" name="includes"/>
 116.265 +            <attribute default="${excludes}" name="excludes"/>
 116.266 +            <attribute default="${javac.debug}" name="debug"/>
 116.267 +            <attribute default="${empty.dir}" name="sourcepath"/>
 116.268 +            <attribute default="${empty.dir}" name="gensrcdir"/>
 116.269 +            <element name="customize" optional="true"/>
 116.270 +            <sequential>
 116.271 +                <property location="${build.dir}/empty" name="empty.dir"/>
 116.272 +                <mkdir dir="${empty.dir}"/>
 116.273 +                <mkdir dir="@{apgeneratedsrcdir}"/>
 116.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}">
 116.275 +                    <src>
 116.276 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
 116.277 +                            <include name="*"/>
 116.278 +                        </dirset>
 116.279 +                    </src>
 116.280 +                    <classpath>
 116.281 +                        <path path="@{classpath}"/>
 116.282 +                    </classpath>
 116.283 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
 116.284 +                    <compilerarg line="${javac.compilerargs}"/>
 116.285 +                    <compilerarg value="-processorpath"/>
 116.286 +                    <compilerarg path="@{processorpath}:${empty.dir}"/>
 116.287 +                    <compilerarg line="${ap.processors.internal}"/>
 116.288 +                    <compilerarg line="${annotation.processing.processor.options}"/>
 116.289 +                    <compilerarg value="-s"/>
 116.290 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
 116.291 +                    <compilerarg line="${ap.proc.none.internal}"/>
 116.292 +                    <customize/>
 116.293 +                </javac>
 116.294 +            </sequential>
 116.295 +        </macrodef>
 116.296 +    </target>
 116.297 +    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
 116.298 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
 116.299 +            <attribute default="${src.dir}" name="srcdir"/>
 116.300 +            <attribute default="${build.classes.dir}" name="destdir"/>
 116.301 +            <attribute default="${javac.classpath}" name="classpath"/>
 116.302 +            <attribute default="${javac.processorpath}" name="processorpath"/>
 116.303 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
 116.304 +            <attribute default="${includes}" name="includes"/>
 116.305 +            <attribute default="${excludes}" name="excludes"/>
 116.306 +            <attribute default="${javac.debug}" name="debug"/>
 116.307 +            <attribute default="${empty.dir}" name="sourcepath"/>
 116.308 +            <attribute default="${empty.dir}" name="gensrcdir"/>
 116.309 +            <element name="customize" optional="true"/>
 116.310 +            <sequential>
 116.311 +                <property location="${build.dir}/empty" name="empty.dir"/>
 116.312 +                <mkdir dir="${empty.dir}"/>
 116.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}">
 116.314 +                    <src>
 116.315 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
 116.316 +                            <include name="*"/>
 116.317 +                        </dirset>
 116.318 +                    </src>
 116.319 +                    <classpath>
 116.320 +                        <path path="@{classpath}"/>
 116.321 +                    </classpath>
 116.322 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
 116.323 +                    <compilerarg line="${javac.compilerargs}"/>
 116.324 +                    <customize/>
 116.325 +                </javac>
 116.326 +            </sequential>
 116.327 +        </macrodef>
 116.328 +    </target>
 116.329 +    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
 116.330 +        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
 116.331 +            <attribute default="${src.dir}" name="srcdir"/>
 116.332 +            <attribute default="${build.classes.dir}" name="destdir"/>
 116.333 +            <attribute default="${javac.classpath}" name="classpath"/>
 116.334 +            <sequential>
 116.335 +                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
 116.336 +                    <classpath>
 116.337 +                        <path path="@{classpath}"/>
 116.338 +                    </classpath>
 116.339 +                </depend>
 116.340 +            </sequential>
 116.341 +        </macrodef>
 116.342 +        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
 116.343 +            <attribute default="${build.classes.dir}" name="destdir"/>
 116.344 +            <sequential>
 116.345 +                <fail unless="javac.includes">Must set javac.includes</fail>
 116.346 +                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
 116.347 +                    <path>
 116.348 +                        <filelist dir="@{destdir}" files="${javac.includes}"/>
 116.349 +                    </path>
 116.350 +                    <globmapper from="*.java" to="*.class"/>
 116.351 +                </pathconvert>
 116.352 +                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
 116.353 +                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
 116.354 +                <delete>
 116.355 +                    <files includesfile="${javac.includesfile.binary}"/>
 116.356 +                </delete>
 116.357 +                <delete>
 116.358 +                    <fileset file="${javac.includesfile.binary}"/>
 116.359 +                </delete>
 116.360 +            </sequential>
 116.361 +        </macrodef>
 116.362 +    </target>
 116.363 +    <target name="-init-macrodef-junit">
 116.364 +        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
 116.365 +            <attribute default="${includes}" name="includes"/>
 116.366 +            <attribute default="${excludes}" name="excludes"/>
 116.367 +            <attribute default="**" name="testincludes"/>
 116.368 +            <sequential>
 116.369 +                <property name="junit.forkmode" value="perTest"/>
 116.370 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
 116.371 +                    <batchtest todir="${build.test.results.dir}">
 116.372 +                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
 116.373 +                            <filename name="@{testincludes}"/>
 116.374 +                        </fileset>
 116.375 +                    </batchtest>
 116.376 +                    <classpath>
 116.377 +                        <path path="${run.test.classpath}"/>
 116.378 +                    </classpath>
 116.379 +                    <syspropertyset>
 116.380 +                        <propertyref prefix="test-sys-prop."/>
 116.381 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
 116.382 +                    </syspropertyset>
 116.383 +                    <formatter type="brief" usefile="false"/>
 116.384 +                    <formatter type="xml"/>
 116.385 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
 116.386 +                    <jvmarg value="-ea"/>
 116.387 +                    <jvmarg line="${run.jvmargs}"/>
 116.388 +                </junit>
 116.389 +            </sequential>
 116.390 +        </macrodef>
 116.391 +    </target>
 116.392 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
 116.393 +    <target name="-profile-pre-init">
 116.394 +        <!-- Empty placeholder for easier customization. -->
 116.395 +        <!-- You can override this target in the ../build.xml file. -->
 116.396 +    </target>
 116.397 +    <target name="-profile-post-init">
 116.398 +        <!-- Empty placeholder for easier customization. -->
 116.399 +        <!-- You can override this target in the ../build.xml file. -->
 116.400 +    </target>
 116.401 +    <target name="-profile-init-macrodef-profile">
 116.402 +        <macrodef name="resolve">
 116.403 +            <attribute name="name"/>
 116.404 +            <attribute name="value"/>
 116.405 +            <sequential>
 116.406 +                <property name="@{name}" value="${env.@{value}}"/>
 116.407 +            </sequential>
 116.408 +        </macrodef>
 116.409 +        <macrodef name="profile">
 116.410 +            <attribute default="${main.class}" name="classname"/>
 116.411 +            <element name="customize" optional="true"/>
 116.412 +            <sequential>
 116.413 +                <property environment="env"/>
 116.414 +                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
 116.415 +                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
 116.416 +                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
 116.417 +                    <jvmarg line="${profiler.info.jvmargs}"/>
 116.418 +                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
 116.419 +                    <arg line="${application.args}"/>
 116.420 +                    <classpath>
 116.421 +                        <path path="${run.classpath}"/>
 116.422 +                    </classpath>
 116.423 +                    <syspropertyset>
 116.424 +                        <propertyref prefix="run-sys-prop."/>
 116.425 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
 116.426 +                    </syspropertyset>
 116.427 +                    <customize/>
 116.428 +                </java>
 116.429 +            </sequential>
 116.430 +        </macrodef>
 116.431 +    </target>
 116.432 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
 116.433 +        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
 116.434 +        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
 116.435 +    </target>
 116.436 +    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
 116.437 +        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
 116.438 +            <attribute default="${main.class}" name="name"/>
 116.439 +            <attribute default="${debug.classpath}" name="classpath"/>
 116.440 +            <attribute default="" name="stopclassname"/>
 116.441 +            <sequential>
 116.442 +                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
 116.443 +                    <classpath>
 116.444 +                        <path path="@{classpath}"/>
 116.445 +                    </classpath>
 116.446 +                </nbjpdastart>
 116.447 +            </sequential>
 116.448 +        </macrodef>
 116.449 +        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
 116.450 +            <attribute default="${build.classes.dir}" name="dir"/>
 116.451 +            <sequential>
 116.452 +                <nbjpdareload>
 116.453 +                    <fileset dir="@{dir}" includes="${fix.classes}">
 116.454 +                        <include name="${fix.includes}*.class"/>
 116.455 +                    </fileset>
 116.456 +                </nbjpdareload>
 116.457 +            </sequential>
 116.458 +        </macrodef>
 116.459 +    </target>
 116.460 +    <target name="-init-debug-args">
 116.461 +        <property name="version-output" value="java version &quot;${ant.java.version}"/>
 116.462 +        <condition property="have-jdk-older-than-1.4">
 116.463 +            <or>
 116.464 +                <contains string="${version-output}" substring="java version &quot;1.0"/>
 116.465 +                <contains string="${version-output}" substring="java version &quot;1.1"/>
 116.466 +                <contains string="${version-output}" substring="java version &quot;1.2"/>
 116.467 +                <contains string="${version-output}" substring="java version &quot;1.3"/>
 116.468 +            </or>
 116.469 +        </condition>
 116.470 +        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
 116.471 +            <istrue value="${have-jdk-older-than-1.4}"/>
 116.472 +        </condition>
 116.473 +        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
 116.474 +            <os family="windows"/>
 116.475 +        </condition>
 116.476 +        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
 116.477 +            <isset property="debug.transport"/>
 116.478 +        </condition>
 116.479 +    </target>
 116.480 +    <target depends="-init-debug-args" name="-init-macrodef-debug">
 116.481 +        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
 116.482 +            <attribute default="${main.class}" name="classname"/>
 116.483 +            <attribute default="${debug.classpath}" name="classpath"/>
 116.484 +            <element name="customize" optional="true"/>
 116.485 +            <sequential>
 116.486 +                <java classname="@{classname}" dir="${work.dir}" fork="true">
 116.487 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
 116.488 +                    <jvmarg line="${debug-args-line}"/>
 116.489 +                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
 116.490 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
 116.491 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
 116.492 +                    <jvmarg line="${run.jvmargs}"/>
 116.493 +                    <classpath>
 116.494 +                        <path path="@{classpath}"/>
 116.495 +                    </classpath>
 116.496 +                    <syspropertyset>
 116.497 +                        <propertyref prefix="run-sys-prop."/>
 116.498 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
 116.499 +                    </syspropertyset>
 116.500 +                    <customize/>
 116.501 +                </java>
 116.502 +            </sequential>
 116.503 +        </macrodef>
 116.504 +    </target>
 116.505 +    <target name="-init-macrodef-java">
 116.506 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
 116.507 +            <attribute default="${main.class}" name="classname"/>
 116.508 +            <attribute default="${run.classpath}" name="classpath"/>
 116.509 +            <element name="customize" optional="true"/>
 116.510 +            <sequential>
 116.511 +                <java classname="@{classname}" dir="${work.dir}" fork="true">
 116.512 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
 116.513 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
 116.514 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
 116.515 +                    <jvmarg line="${run.jvmargs}"/>
 116.516 +                    <classpath>
 116.517 +                        <path path="@{classpath}"/>
 116.518 +                    </classpath>
 116.519 +                    <syspropertyset>
 116.520 +                        <propertyref prefix="run-sys-prop."/>
 116.521 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
 116.522 +                    </syspropertyset>
 116.523 +                    <customize/>
 116.524 +                </java>
 116.525 +            </sequential>
 116.526 +        </macrodef>
 116.527 +    </target>
 116.528 +    <target name="-init-macrodef-copylibs">
 116.529 +        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
 116.530 +            <attribute default="${manifest.file}" name="manifest"/>
 116.531 +            <element name="customize" optional="true"/>
 116.532 +            <sequential>
 116.533 +                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
 116.534 +                <pathconvert property="run.classpath.without.build.classes.dir">
 116.535 +                    <path path="${run.classpath}"/>
 116.536 +                    <map from="${build.classes.dir.resolved}" to=""/>
 116.537 +                </pathconvert>
 116.538 +                <pathconvert pathsep=" " property="jar.classpath">
 116.539 +                    <path path="${run.classpath.without.build.classes.dir}"/>
 116.540 +                    <chainedmapper>
 116.541 +                        <flattenmapper/>
 116.542 +                        <globmapper from="*" to="lib/*"/>
 116.543 +                    </chainedmapper>
 116.544 +                </pathconvert>
 116.545 +                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
 116.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}">
 116.547 +                    <fileset dir="${build.classes.dir}"/>
 116.548 +                    <manifest>
 116.549 +                        <attribute name="Class-Path" value="${jar.classpath}"/>
 116.550 +                        <customize/>
 116.551 +                    </manifest>
 116.552 +                </copylibs>
 116.553 +            </sequential>
 116.554 +        </macrodef>
 116.555 +    </target>
 116.556 +    <target name="-init-presetdef-jar">
 116.557 +        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
 116.558 +            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
 116.559 +                <j2seproject1:fileset dir="${build.classes.dir}"/>
 116.560 +            </jar>
 116.561 +        </presetdef>
 116.562 +    </target>
 116.563 +    <target name="-init-ap-cmdline-properties">
 116.564 +        <property name="annotation.processing.enabled" value="true"/>
 116.565 +        <property name="annotation.processing.processors.list" value=""/>
 116.566 +        <property name="annotation.processing.processor.options" value=""/>
 116.567 +        <property name="annotation.processing.run.all.processors" value="true"/>
 116.568 +        <property name="javac.processorpath" value="${javac.classpath}"/>
 116.569 +        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
 116.570 +        <condition property="ap.supported.internal" value="true">
 116.571 +            <not>
 116.572 +                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
 116.573 +            </not>
 116.574 +        </condition>
 116.575 +    </target>
 116.576 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
 116.577 +        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
 116.578 +            <isfalse value="${annotation.processing.run.all.processors}"/>
 116.579 +        </condition>
 116.580 +        <condition else="" property="ap.proc.none.internal" value="-proc:none">
 116.581 +            <isfalse value="${annotation.processing.enabled}"/>
 116.582 +        </condition>
 116.583 +    </target>
 116.584 +    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
 116.585 +        <property name="ap.cmd.line.internal" value=""/>
 116.586 +    </target>
 116.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"/>
 116.588 +    <!--
 116.589 +                ===================
 116.590 +                COMPILATION SECTION
 116.591 +                ===================
 116.592 +            -->
 116.593 +    <target name="-deps-jar-init" unless="built-jar.properties">
 116.594 +        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
 116.595 +        <delete file="${built-jar.properties}" quiet="true"/>
 116.596 +    </target>
 116.597 +    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
 116.598 +        <echo level="warn" message="Cycle detected: base.web.api was already built"/>
 116.599 +    </target>
 116.600 +    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
 116.601 +        <mkdir dir="${build.dir}"/>
 116.602 +        <touch file="${built-jar.properties}" verbose="false"/>
 116.603 +        <property file="${built-jar.properties}" prefix="already.built.jar."/>
 116.604 +        <antcall target="-warn-already-built-jar"/>
 116.605 +        <propertyfile file="${built-jar.properties}">
 116.606 +            <entry key="${basedir}" value=""/>
 116.607 +        </propertyfile>
 116.608 +    </target>
 116.609 +    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
 116.610 +    <target depends="init" name="-check-automatic-build">
 116.611 +        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
 116.612 +    </target>
 116.613 +    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
 116.614 +        <antcall target="clean"/>
 116.615 +    </target>
 116.616 +    <target depends="init,deps-jar" name="-pre-pre-compile">
 116.617 +        <mkdir dir="${build.classes.dir}"/>
 116.618 +    </target>
 116.619 +    <target name="-pre-compile">
 116.620 +        <!-- Empty placeholder for easier customization. -->
 116.621 +        <!-- You can override this target in the ../build.xml file. -->
 116.622 +    </target>
 116.623 +    <target if="do.depend.true" name="-compile-depend">
 116.624 +        <pathconvert property="build.generated.subdirs">
 116.625 +            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 116.626 +                <include name="*"/>
 116.627 +            </dirset>
 116.628 +        </pathconvert>
 116.629 +        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
 116.630 +    </target>
 116.631 +    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
 116.632 +        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
 116.633 +        <copy todir="${build.classes.dir}">
 116.634 +            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 116.635 +        </copy>
 116.636 +    </target>
 116.637 +    <target if="has.persistence.xml" name="-copy-persistence-xml">
 116.638 +        <mkdir dir="${build.classes.dir}/META-INF"/>
 116.639 +        <copy todir="${build.classes.dir}/META-INF">
 116.640 +            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
 116.641 +        </copy>
 116.642 +    </target>
 116.643 +    <target name="-post-compile">
 116.644 +        <!-- Empty placeholder for easier customization. -->
 116.645 +        <!-- You can override this target in the ../build.xml file. -->
 116.646 +    </target>
 116.647 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
 116.648 +    <target name="-pre-compile-single">
 116.649 +        <!-- Empty placeholder for easier customization. -->
 116.650 +        <!-- You can override this target in the ../build.xml file. -->
 116.651 +    </target>
 116.652 +    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
 116.653 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
 116.654 +        <j2seproject3:force-recompile/>
 116.655 +        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
 116.656 +    </target>
 116.657 +    <target name="-post-compile-single">
 116.658 +        <!-- Empty placeholder for easier customization. -->
 116.659 +        <!-- You can override this target in the ../build.xml file. -->
 116.660 +    </target>
 116.661 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
 116.662 +    <!--
 116.663 +                ====================
 116.664 +                JAR BUILDING SECTION
 116.665 +                ====================
 116.666 +            -->
 116.667 +    <target depends="init" name="-pre-pre-jar">
 116.668 +        <dirname file="${dist.jar}" property="dist.jar.dir"/>
 116.669 +        <mkdir dir="${dist.jar.dir}"/>
 116.670 +    </target>
 116.671 +    <target name="-pre-jar">
 116.672 +        <!-- Empty placeholder for easier customization. -->
 116.673 +        <!-- You can override this target in the ../build.xml file. -->
 116.674 +    </target>
 116.675 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
 116.676 +        <j2seproject1:jar/>
 116.677 +    </target>
 116.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">
 116.679 +        <j2seproject1:jar manifest="${manifest.file}"/>
 116.680 +    </target>
 116.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">
 116.682 +        <j2seproject1:jar manifest="${manifest.file}">
 116.683 +            <j2seproject1:manifest>
 116.684 +                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
 116.685 +            </j2seproject1:manifest>
 116.686 +        </j2seproject1:jar>
 116.687 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
 116.688 +        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
 116.689 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
 116.690 +        <pathconvert property="run.classpath.with.dist.jar">
 116.691 +            <path path="${run.classpath}"/>
 116.692 +            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
 116.693 +        </pathconvert>
 116.694 +        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
 116.695 +    </target>
 116.696 +    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
 116.697 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
 116.698 +        <touch file="${tmp.manifest.file}" verbose="false"/>
 116.699 +    </target>
 116.700 +    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
 116.701 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
 116.702 +        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
 116.703 +    </target>
 116.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">
 116.705 +        <manifest file="${tmp.manifest.file}" mode="update">
 116.706 +            <attribute name="Main-Class" value="${main.class}"/>
 116.707 +        </manifest>
 116.708 +    </target>
 116.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">
 116.710 +        <basename file="${application.splash}" property="splashscreen.basename"/>
 116.711 +        <mkdir dir="${build.classes.dir}/META-INF"/>
 116.712 +        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
 116.713 +        <manifest file="${tmp.manifest.file}" mode="update">
 116.714 +            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
 116.715 +        </manifest>
 116.716 +    </target>
 116.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">
 116.718 +        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
 116.719 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
 116.720 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
 116.721 +        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
 116.722 +    </target>
 116.723 +    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
 116.724 +        <delete>
 116.725 +            <fileset file="${tmp.manifest.file}"/>
 116.726 +        </delete>
 116.727 +    </target>
 116.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"/>
 116.729 +    <target name="-post-jar">
 116.730 +        <!-- Empty placeholder for easier customization. -->
 116.731 +        <!-- You can override this target in the ../build.xml file. -->
 116.732 +    </target>
 116.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"/>
 116.734 +    <!--
 116.735 +                =================
 116.736 +                EXECUTION SECTION
 116.737 +                =================
 116.738 +            -->
 116.739 +    <target depends="init,compile" description="Run a main class." name="run">
 116.740 +        <j2seproject1:java>
 116.741 +            <customize>
 116.742 +                <arg line="${application.args}"/>
 116.743 +            </customize>
 116.744 +        </j2seproject1:java>
 116.745 +    </target>
 116.746 +    <target name="-do-not-recompile">
 116.747 +        <property name="javac.includes.binary" value=""/>
 116.748 +    </target>
 116.749 +    <target depends="init,compile-single" name="run-single">
 116.750 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
 116.751 +        <j2seproject1:java classname="${run.class}"/>
 116.752 +    </target>
 116.753 +    <target depends="init,compile-test-single" name="run-test-with-main">
 116.754 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
 116.755 +        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
 116.756 +    </target>
 116.757 +    <!--
 116.758 +                =================
 116.759 +                DEBUGGING SECTION
 116.760 +                =================
 116.761 +            -->
 116.762 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
 116.763 +        <j2seproject1:nbjpdastart name="${debug.class}"/>
 116.764 +    </target>
 116.765 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
 116.766 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
 116.767 +    </target>
 116.768 +    <target depends="init,compile" name="-debug-start-debuggee">
 116.769 +        <j2seproject3:debug>
 116.770 +            <customize>
 116.771 +                <arg line="${application.args}"/>
 116.772 +            </customize>
 116.773 +        </j2seproject3:debug>
 116.774 +    </target>
 116.775 +    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
 116.776 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
 116.777 +        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
 116.778 +    </target>
 116.779 +    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
 116.780 +    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
 116.781 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
 116.782 +        <j2seproject3:debug classname="${debug.class}"/>
 116.783 +    </target>
 116.784 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
 116.785 +    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
 116.786 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
 116.787 +        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
 116.788 +    </target>
 116.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"/>
 116.790 +    <target depends="init" name="-pre-debug-fix">
 116.791 +        <fail unless="fix.includes">Must set fix.includes</fail>
 116.792 +        <property name="javac.includes" value="${fix.includes}.java"/>
 116.793 +    </target>
 116.794 +    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
 116.795 +        <j2seproject1:nbjpdareload/>
 116.796 +    </target>
 116.797 +    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
 116.798 +    <!--
 116.799 +                =================
 116.800 +                PROFILING SECTION
 116.801 +                =================
 116.802 +            -->
 116.803 +    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
 116.804 +        <nbprofiledirect>
 116.805 +            <classpath>
 116.806 +                <path path="${run.classpath}"/>
 116.807 +            </classpath>
 116.808 +        </nbprofiledirect>
 116.809 +        <profile/>
 116.810 +    </target>
 116.811 +    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
 116.812 +        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
 116.813 +        <nbprofiledirect>
 116.814 +            <classpath>
 116.815 +                <path path="${run.classpath}"/>
 116.816 +            </classpath>
 116.817 +        </nbprofiledirect>
 116.818 +        <profile classname="${profile.class}"/>
 116.819 +    </target>
 116.820 +    <!--
 116.821 +                =========================
 116.822 +                APPLET PROFILING  SECTION
 116.823 +                =========================
 116.824 +            -->
 116.825 +    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
 116.826 +        <nbprofiledirect>
 116.827 +            <classpath>
 116.828 +                <path path="${run.classpath}"/>
 116.829 +            </classpath>
 116.830 +        </nbprofiledirect>
 116.831 +        <profile classname="sun.applet.AppletViewer">
 116.832 +            <customize>
 116.833 +                <arg value="${applet.url}"/>
 116.834 +            </customize>
 116.835 +        </profile>
 116.836 +    </target>
 116.837 +    <!--
 116.838 +                =========================
 116.839 +                TESTS PROFILING  SECTION
 116.840 +                =========================
 116.841 +            -->
 116.842 +    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
 116.843 +        <nbprofiledirect>
 116.844 +            <classpath>
 116.845 +                <path path="${run.test.classpath}"/>
 116.846 +            </classpath>
 116.847 +        </nbprofiledirect>
 116.848 +        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
 116.849 +            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
 116.850 +            <jvmarg value="${profiler.info.jvmargs.agent}"/>
 116.851 +            <jvmarg line="${profiler.info.jvmargs}"/>
 116.852 +            <test name="${profile.class}"/>
 116.853 +            <classpath>
 116.854 +                <path path="${run.test.classpath}"/>
 116.855 +            </classpath>
 116.856 +            <syspropertyset>
 116.857 +                <propertyref prefix="test-sys-prop."/>
 116.858 +                <mapper from="test-sys-prop.*" to="*" type="glob"/>
 116.859 +            </syspropertyset>
 116.860 +            <formatter type="brief" usefile="false"/>
 116.861 +            <formatter type="xml"/>
 116.862 +        </junit>
 116.863 +    </target>
 116.864 +    <!--
 116.865 +                ===============
 116.866 +                JAVADOC SECTION
 116.867 +                ===============
 116.868 +            -->
 116.869 +    <target depends="init" if="have.sources" name="-javadoc-build">
 116.870 +        <mkdir dir="${dist.javadoc.dir}"/>
 116.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}">
 116.872 +            <classpath>
 116.873 +                <path path="${javac.classpath}"/>
 116.874 +            </classpath>
 116.875 +            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
 116.876 +                <filename name="**/*.java"/>
 116.877 +            </fileset>
 116.878 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 116.879 +                <include name="**/*.java"/>
 116.880 +                <exclude name="*.java"/>
 116.881 +            </fileset>
 116.882 +        </javadoc>
 116.883 +        <copy todir="${dist.javadoc.dir}">
 116.884 +            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
 116.885 +                <filename name="**/doc-files/**"/>
 116.886 +            </fileset>
 116.887 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 116.888 +                <include name="**/doc-files/**"/>
 116.889 +            </fileset>
 116.890 +        </copy>
 116.891 +    </target>
 116.892 +    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
 116.893 +        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
 116.894 +    </target>
 116.895 +    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
 116.896 +    <!--
 116.897 +                =========================
 116.898 +                JUNIT COMPILATION SECTION
 116.899 +                =========================
 116.900 +            -->
 116.901 +    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
 116.902 +        <mkdir dir="${build.test.classes.dir}"/>
 116.903 +    </target>
 116.904 +    <target name="-pre-compile-test">
 116.905 +        <!-- Empty placeholder for easier customization. -->
 116.906 +        <!-- You can override this target in the ../build.xml file. -->
 116.907 +    </target>
 116.908 +    <target if="do.depend.true" name="-compile-test-depend">
 116.909 +        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
 116.910 +    </target>
 116.911 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
 116.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}"/>
 116.913 +        <copy todir="${build.test.classes.dir}">
 116.914 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 116.915 +        </copy>
 116.916 +    </target>
 116.917 +    <target name="-post-compile-test">
 116.918 +        <!-- Empty placeholder for easier customization. -->
 116.919 +        <!-- You can override this target in the ../build.xml file. -->
 116.920 +    </target>
 116.921 +    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
 116.922 +    <target name="-pre-compile-test-single">
 116.923 +        <!-- Empty placeholder for easier customization. -->
 116.924 +        <!-- You can override this target in the ../build.xml file. -->
 116.925 +    </target>
 116.926 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
 116.927 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
 116.928 +        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
 116.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}"/>
 116.930 +        <copy todir="${build.test.classes.dir}">
 116.931 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 116.932 +        </copy>
 116.933 +    </target>
 116.934 +    <target name="-post-compile-test-single">
 116.935 +        <!-- Empty placeholder for easier customization. -->
 116.936 +        <!-- You can override this target in the ../build.xml file. -->
 116.937 +    </target>
 116.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"/>
 116.939 +    <!--
 116.940 +                =======================
 116.941 +                JUNIT EXECUTION SECTION
 116.942 +                =======================
 116.943 +            -->
 116.944 +    <target depends="init" if="have.tests" name="-pre-test-run">
 116.945 +        <mkdir dir="${build.test.results.dir}"/>
 116.946 +    </target>
 116.947 +    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
 116.948 +        <j2seproject3:junit testincludes="**/*Test.java"/>
 116.949 +    </target>
 116.950 +    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
 116.951 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
 116.952 +    </target>
 116.953 +    <target depends="init" if="have.tests" name="test-report"/>
 116.954 +    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
 116.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"/>
 116.956 +    <target depends="init" if="have.tests" name="-pre-test-run-single">
 116.957 +        <mkdir dir="${build.test.results.dir}"/>
 116.958 +    </target>
 116.959 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
 116.960 +        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
 116.961 +        <j2seproject3:junit excludes="" includes="${test.includes}"/>
 116.962 +    </target>
 116.963 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
 116.964 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
 116.965 +    </target>
 116.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"/>
 116.967 +    <!--
 116.968 +                =======================
 116.969 +                JUNIT DEBUGGING SECTION
 116.970 +                =======================
 116.971 +            -->
 116.972 +    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
 116.973 +        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
 116.974 +        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
 116.975 +        <delete file="${test.report.file}"/>
 116.976 +        <mkdir dir="${build.test.results.dir}"/>
 116.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}">
 116.978 +            <customize>
 116.979 +                <syspropertyset>
 116.980 +                    <propertyref prefix="test-sys-prop."/>
 116.981 +                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
 116.982 +                </syspropertyset>
 116.983 +                <arg value="${test.class}"/>
 116.984 +                <arg value="showoutput=true"/>
 116.985 +                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
 116.986 +                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
 116.987 +            </customize>
 116.988 +        </j2seproject3:debug>
 116.989 +    </target>
 116.990 +    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
 116.991 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
 116.992 +    </target>
 116.993 +    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
 116.994 +    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
 116.995 +        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
 116.996 +    </target>
 116.997 +    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
 116.998 +    <!--
 116.999 +                =========================
116.1000 +                APPLET EXECUTION SECTION
116.1001 +                =========================
116.1002 +            -->
116.1003 +    <target depends="init,compile-single" name="run-applet">
116.1004 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
116.1005 +        <j2seproject1:java classname="sun.applet.AppletViewer">
116.1006 +            <customize>
116.1007 +                <arg value="${applet.url}"/>
116.1008 +            </customize>
116.1009 +        </j2seproject1:java>
116.1010 +    </target>
116.1011 +    <!--
116.1012 +                =========================
116.1013 +                APPLET DEBUGGING  SECTION
116.1014 +                =========================
116.1015 +            -->
116.1016 +    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
116.1017 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
116.1018 +        <j2seproject3:debug classname="sun.applet.AppletViewer">
116.1019 +            <customize>
116.1020 +                <arg value="${applet.url}"/>
116.1021 +            </customize>
116.1022 +        </j2seproject3:debug>
116.1023 +    </target>
116.1024 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
116.1025 +    <!--
116.1026 +                ===============
116.1027 +                CLEANUP SECTION
116.1028 +                ===============
116.1029 +            -->
116.1030 +    <target name="-deps-clean-init" unless="built-clean.properties">
116.1031 +        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
116.1032 +        <delete file="${built-clean.properties}" quiet="true"/>
116.1033 +    </target>
116.1034 +    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
116.1035 +        <echo level="warn" message="Cycle detected: base.web.api was already built"/>
116.1036 +    </target>
116.1037 +    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
116.1038 +        <mkdir dir="${build.dir}"/>
116.1039 +        <touch file="${built-clean.properties}" verbose="false"/>
116.1040 +        <property file="${built-clean.properties}" prefix="already.built.clean."/>
116.1041 +        <antcall target="-warn-already-built-clean"/>
116.1042 +        <propertyfile file="${built-clean.properties}">
116.1043 +            <entry key="${basedir}" value=""/>
116.1044 +        </propertyfile>
116.1045 +    </target>
116.1046 +    <target depends="init" name="-do-clean">
116.1047 +        <delete dir="${build.dir}"/>
116.1048 +        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
116.1049 +    </target>
116.1050 +    <target name="-post-clean">
116.1051 +        <!-- Empty placeholder for easier customization. -->
116.1052 +        <!-- You can override this target in the ../build.xml file. -->
116.1053 +    </target>
116.1054 +    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
116.1055 +    <target name="-check-call-dep">
116.1056 +        <property file="${call.built.properties}" prefix="already.built."/>
116.1057 +        <condition property="should.call.dep">
116.1058 +            <not>
116.1059 +                <isset property="already.built.${call.subproject}"/>
116.1060 +            </not>
116.1061 +        </condition>
116.1062 +    </target>
116.1063 +    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
116.1064 +        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
116.1065 +            <propertyset>
116.1066 +                <propertyref prefix="transfer."/>
116.1067 +                <mapper from="transfer.*" to="*" type="glob"/>
116.1068 +            </propertyset>
116.1069 +        </ant>
116.1070 +    </target>
116.1071 +</project>
   117.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   117.2 +++ b/remoting/server/web/base.web.api/nbproject/genfiles.properties	Thu Jun 23 15:07:16 2011 +0200
   117.3 @@ -0,0 +1,8 @@
   117.4 +build.xml.data.CRC32=274e0636
   117.5 +build.xml.script.CRC32=f51e627e
   117.6 +build.xml.stylesheet.CRC32=28e38971@1.45.0.45
   117.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
   117.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
   117.9 +nbproject/build-impl.xml.data.CRC32=274e0636
  117.10 +nbproject/build-impl.xml.script.CRC32=003c6683
  117.11 +nbproject/build-impl.xml.stylesheet.CRC32=cfcde7f8@1.45.0.45
   118.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   118.2 +++ b/remoting/server/web/base.web.api/nbproject/project.properties	Thu Jun 23 15:07:16 2011 +0200
   118.3 @@ -0,0 +1,82 @@
   118.4 +annotation.processing.enabled=true
   118.5 +annotation.processing.enabled.in.editor=false
   118.6 +annotation.processing.run.all.processors=true
   118.7 +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
   118.8 +application.title=base.web.api
   118.9 +application.vendor=lahvac
  118.10 +build.classes.dir=${build.dir}/classes
  118.11 +build.classes.excludes=**/*.java,**/*.form
  118.12 +# This directory is removed when the project is cleaned:
  118.13 +build.dir=build
  118.14 +build.generated.dir=${build.dir}/generated
  118.15 +build.generated.sources.dir=${build.dir}/generated-sources
  118.16 +# Only compile against the classpath explicitly listed here:
  118.17 +build.sysclasspath=ignore
  118.18 +build.test.classes.dir=${build.dir}/test/classes
  118.19 +build.test.results.dir=${build.dir}/test/results
  118.20 +# Uncomment to specify the preferred debugger connection transport:
  118.21 +#debug.transport=dt_socket
  118.22 +debug.classpath=\
  118.23 +    ${run.classpath}
  118.24 +debug.test.classpath=\
  118.25 +    ${run.test.classpath}
  118.26 +# This directory is removed when the project is cleaned:
  118.27 +dist.dir=dist
  118.28 +dist.jar=${dist.dir}/base.web.api.jar
  118.29 +dist.javadoc.dir=${dist.dir}/javadoc
  118.30 +endorsed.classpath=
  118.31 +excludes=
  118.32 +file.reference.org-netbeans-modules-java-source.jar=../../../../server/lib/org-netbeans-modules-java-source.jar
  118.33 +file.reference.org-netbeans-modules-parsing-api.jar=../../../../server/lib/org-netbeans-modules-parsing-api.jar
  118.34 +file.reference.org-openide-filesystems.jar=../../../../server/lib/org-openide-filesystems.jar
  118.35 +file.reference.org-openide-util-lookup.jar=../../../../server/lib/org-openide-util-lookup.jar
  118.36 +includes=**
  118.37 +jar.compress=false
  118.38 +javac.classpath=\
  118.39 +    ${libs.freemarker.classpath}:\
  118.40 +    ${libs.jersey.classpath}:\
  118.41 +    ${file.reference.org-netbeans-modules-java-source.jar}:\
  118.42 +    ${file.reference.org-netbeans-modules-parsing-api.jar}:\
  118.43 +    ${file.reference.org-openide-filesystems.jar}:\
  118.44 +    ${file.reference.org-openide-util-lookup.jar}
  118.45 +# Space-separated list of extra javac options
  118.46 +javac.compilerargs=
  118.47 +javac.deprecation=false
  118.48 +javac.processorpath=\
  118.49 +    ${javac.classpath}
  118.50 +javac.source=1.6
  118.51 +javac.target=1.6
  118.52 +javac.test.classpath=\
  118.53 +    ${javac.classpath}:\
  118.54 +    ${build.classes.dir}
  118.55 +javac.test.processorpath=\
  118.56 +    ${javac.test.classpath}
  118.57 +javadoc.additionalparam=
  118.58 +javadoc.author=false
  118.59 +javadoc.encoding=${source.encoding}
  118.60 +javadoc.noindex=false
  118.61 +javadoc.nonavbar=false
  118.62 +javadoc.notree=false
  118.63 +javadoc.private=false
  118.64 +javadoc.splitindex=true
  118.65 +javadoc.use=true
  118.66 +javadoc.version=false
  118.67 +javadoc.windowtitle=
  118.68 +main.class=org.netbeans.modules.jackpot30.backend.base.BaseWebApi
  118.69 +manifest.file=manifest.mf
  118.70 +meta.inf.dir=${src.dir}/META-INF
  118.71 +mkdist.disabled=false
  118.72 +platform.active=default_platform
  118.73 +run.classpath=\
  118.74 +    ${javac.classpath}:\
  118.75 +    ${build.classes.dir}
  118.76 +# Space-separated list of JVM arguments used when running the project
  118.77 +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
  118.78 +# or test-sys-prop.name=value to set system properties for unit tests):
  118.79 +run.jvmargs=
  118.80 +run.test.classpath=\
  118.81 +    ${javac.test.classpath}:\
  118.82 +    ${build.test.classes.dir}
  118.83 +source.encoding=UTF-8
  118.84 +src.dir=src
  118.85 +test.src.dir=test
   119.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   119.2 +++ b/remoting/server/web/base.web.api/nbproject/project.xml	Thu Jun 23 15:07:16 2011 +0200
   119.3 @@ -0,0 +1,18 @@
   119.4 +<?xml version="1.0" encoding="UTF-8"?>
   119.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
   119.6 +    <type>org.netbeans.modules.java.j2seproject</type>
   119.7 +    <configuration>
   119.8 +        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
   119.9 +            <name>base.web.api</name>
  119.10 +            <source-roots>
  119.11 +                <root id="src.dir"/>
  119.12 +            </source-roots>
  119.13 +            <test-roots>
  119.14 +                <root id="test.src.dir"/>
  119.15 +            </test-roots>
  119.16 +        </data>
  119.17 +        <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
  119.18 +            <definitions>../../../../server/lib/nblibraries.properties</definitions>
  119.19 +        </libraries>
  119.20 +    </configuration>
  119.21 +</project>
   120.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   120.2 +++ b/remoting/server/web/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/CategoryStorage.java	Thu Jun 23 15:07:16 2011 +0200
   120.3 @@ -0,0 +1,141 @@
   120.4 +/*
   120.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   120.6 + *
   120.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
   120.8 + *
   120.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  120.10 + * Other names may be trademarks of their respective owners.
  120.11 + *
  120.12 + * The contents of this file are subject to the terms of either the GNU
  120.13 + * General Public License Version 2 only ("GPL") or the Common
  120.14 + * Development and Distribution License("CDDL") (collectively, the
  120.15 + * "License"). You may not use this file except in compliance with the
  120.16 + * License. You can obtain a copy of the License at
  120.17 + * http://www.netbeans.org/cddl-gplv2.html
  120.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  120.19 + * specific language governing permissions and limitations under the
  120.20 + * License.  When distributing the software, include this License Header
  120.21 + * Notice in each file and include the License file at
  120.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  120.23 + * particular file as subject to the "Classpath" exception as provided
  120.24 + * by Oracle in the GPL Version 2 section of the License file that
  120.25 + * accompanied this code. If applicable, add the following below the
  120.26 + * License Header, with the fields enclosed by brackets [] replaced by
  120.27 + * your own identifying information:
  120.28 + * "Portions Copyrighted [year] [name of copyright owner]"
  120.29 + *
  120.30 + * If you wish your version of this file to be governed by only the CDDL
  120.31 + * or only the GPL Version 2, indicate your decision by adding
  120.32 + * "[Contributor] elects to include this software in this distribution
  120.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  120.34 + * single choice of license, a recipient has the option to distribute
  120.35 + * your version of this file under either the CDDL, the GPL Version 2 or
  120.36 + * to extend the choice of license to its licensees as provided above.
  120.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  120.38 + * Version 2 license, then the option applies only if the new code is
  120.39 + * made subject to such option by the copyright holder.
  120.40 + *
  120.41 + * Contributor(s):
  120.42 + *
  120.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
  120.44 + */
  120.45 +package org.netbeans.modules.jackpot30.backend.base;
  120.46 +
  120.47 +import java.io.File;
  120.48 +import java.io.IOException;
  120.49 +import java.lang.reflect.Field;
  120.50 +import java.net.URL;
  120.51 +import java.util.ArrayList;
  120.52 +import java.util.Collections;
  120.53 +import java.util.HashSet;
  120.54 +import java.util.List;
  120.55 +import java.util.Map;
  120.56 +import java.util.Set;
  120.57 +import java.util.logging.Level;
  120.58 +import java.util.logging.Logger;
  120.59 +import org.netbeans.modules.parsing.impl.indexing.CacheFolder;
  120.60 +import org.openide.filesystems.FileObject;
  120.61 +import org.openide.filesystems.FileUtil;
  120.62 +
  120.63 +/**
  120.64 + *
  120.65 + * @author lahvac
  120.66 + */
  120.67 +public class CategoryStorage {
  120.68 +
  120.69 +    public static void setCacheRoot(File cacheRoot) {
  120.70 +        CategoryStorage.cacheRoot = cacheRoot;
  120.71 +    }
  120.72 +
  120.73 +    private static File cacheRoot;
  120.74 +
  120.75 +    public static Iterable<? extends CategoryStorage> listCategories() {
  120.76 +        List<CategoryStorage> result = new ArrayList<CategoryStorage>();
  120.77 +
  120.78 +        for (File cat : cacheRoot.listFiles()) {
  120.79 +            result.add(new CategoryStorage(cat.getName()));
  120.80 +        }
  120.81 +
  120.82 +        return result;
  120.83 +    }
  120.84 +
  120.85 +    public static CategoryStorage forId(String id) {
  120.86 +        for (CategoryStorage s : listCategories()) {
  120.87 +            if (s.id.equals(id)) return s;
  120.88 +        }
  120.89 +
  120.90 +        return null;
  120.91 +    }
  120.92 +    
  120.93 +    private final String id;
  120.94 +
  120.95 +    private CategoryStorage(String id) {
  120.96 +        this.id = id;
  120.97 +    }
  120.98 +
  120.99 +    public Iterable<? extends URL> getCategoryIndexFolders() {
 120.100 +        try {
 120.101 +            FileObject root = getCacheRoot();
 120.102 +            CacheFolder.setCacheFolder(root);
 120.103 +            Set<URL> result = new HashSet<URL>();
 120.104 +
 120.105 +            CacheFolder.getDataFolder(new URL("file:/"), true);
 120.106 +            
 120.107 +            //XXX:
 120.108 +            Field invertedSegmentsField = CacheFolder.class.getDeclaredField("invertedSegments");
 120.109 +
 120.110 +            invertedSegmentsField.setAccessible(true);
 120.111 +            
 120.112 +            Map<String, String> invertedSegments = (Map<String, String>) invertedSegmentsField.get(null);
 120.113 +
 120.114 +            for (String c : invertedSegments.keySet()) {
 120.115 +                result.add(new URL(c));
 120.116 +            }
 120.117 +
 120.118 +            return result;
 120.119 +        } catch (IllegalArgumentException ex) {
 120.120 +            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
 120.121 +        } catch (IllegalAccessException ex) {
 120.122 +            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
 120.123 +        } catch (NoSuchFieldException ex) {
 120.124 +            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
 120.125 +        } catch (SecurityException ex) {
 120.126 +            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
 120.127 +        } catch (IOException ex) {
 120.128 +            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
 120.129 +        }
 120.130 +        return Collections.emptyList();
 120.131 +    }
 120.132 +
 120.133 +    public String getId() {
 120.134 +        return id;
 120.135 +    }
 120.136 +
 120.137 +    public String getDisplayName() {
 120.138 +        return id;//XXX
 120.139 +    }
 120.140 +
 120.141 +    public FileObject getCacheRoot() {
 120.142 +        return FileUtil.toFileObject(FileUtil.normalizeFile(new File(cacheRoot, id)));
 120.143 +    }
 120.144 +}
   121.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   121.2 +++ b/remoting/server/web/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/FreemarkerUtilities.java	Thu Jun 23 15:07:16 2011 +0200
   121.3 @@ -0,0 +1,94 @@
   121.4 +/*
   121.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   121.6 + *
   121.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
   121.8 + *
   121.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  121.10 + * Other names may be trademarks of their respective owners.
  121.11 + *
  121.12 + * The contents of this file are subject to the terms of either the GNU
  121.13 + * General Public License Version 2 only ("GPL") or the Common
  121.14 + * Development and Distribution License("CDDL") (collectively, the
  121.15 + * "License"). You may not use this file except in compliance with the
  121.16 + * License. You can obtain a copy of the License at
  121.17 + * http://www.netbeans.org/cddl-gplv2.html
  121.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  121.19 + * specific language governing permissions and limitations under the
  121.20 + * License.  When distributing the software, include this License Header
  121.21 + * Notice in each file and include the License file at
  121.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  121.23 + * particular file as subject to the "Classpath" exception as provided
  121.24 + * by Oracle in the GPL Version 2 section of the License file that
  121.25 + * accompanied this code. If applicable, add the following below the
  121.26 + * License Header, with the fields enclosed by brackets [] replaced by
  121.27 + * your own identifying information:
  121.28 + * "Portions Copyrighted [year] [name of copyright owner]"
  121.29 + *
  121.30 + * If you wish your version of this file to be governed by only the CDDL
  121.31 + * or only the GPL Version 2, indicate your decision by adding
  121.32 + * "[Contributor] elects to include this software in this distribution
  121.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  121.34 + * single choice of license, a recipient has the option to distribute
  121.35 + * your version of this file under either the CDDL, the GPL Version 2 or
  121.36 + * to extend the choice of license to its licensees as provided above.
  121.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  121.38 + * Version 2 license, then the option applies only if the new code is
  121.39 + * made subject to such option by the copyright holder.
  121.40 + *
  121.41 + * Contributor(s):
  121.42 + *
  121.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
  121.44 + */
  121.45 +package org.netbeans.modules.jackpot30.backend.base;
  121.46 +
  121.47 +import freemarker.cache.TemplateLoader;
  121.48 +import freemarker.template.Configuration;
  121.49 +import freemarker.template.Template;
  121.50 +import freemarker.template.TemplateException;
  121.51 +import java.io.IOException;
  121.52 +import java.io.InputStream;
  121.53 +import java.io.InputStreamReader;
  121.54 +import java.io.Reader;
  121.55 +import java.io.StringWriter;
  121.56 +import java.util.Map;
  121.57 +
  121.58 +/**
  121.59 + *
  121.60 + * @author lahvac
  121.61 + */
  121.62 +public class FreemarkerUtilities {
  121.63 +
  121.64 +    public static String processTemplate(String template, Map<String, Object> configurationData) throws TemplateException, IOException {
  121.65 +        Configuration conf = new Configuration();
  121.66 +
  121.67 +        conf.setTemplateLoader(new TemplateLoaderImpl());
  121.68 +
  121.69 +        Template templ = conf.getTemplate(template);
  121.70 +        StringWriter out = new StringWriter();
  121.71 +
  121.72 +        templ.process(configurationData, out);
  121.73 +
  121.74 +        return out.toString();
  121.75 +    }
  121.76 +
  121.77 +    private static final class TemplateLoaderImpl implements TemplateLoader {
  121.78 +
  121.79 +        public Object findTemplateSource(String name) throws IOException {
  121.80 +            return TemplateLoaderImpl.class.getResourceAsStream("/" + name);
  121.81 +        }
  121.82 +
  121.83 +        public long getLastModified(Object templateSource) {
  121.84 +            return 0L;
  121.85 +        }
  121.86 +
  121.87 +        public Reader getReader(Object templateSource, String encoding) throws IOException {
  121.88 +            InputStream in = (InputStream) templateSource;
  121.89 +
  121.90 +            return new InputStreamReader(in);
  121.91 +        }
  121.92 +
  121.93 +        public void closeTemplateSource(Object templateSource) throws IOException {
  121.94 +        }
  121.95 +    }
  121.96 +
  121.97 +}
   122.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   122.2 +++ b/remoting/server/web/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/RelStreamHandlerFactory.java	Thu Jun 23 15:07:16 2011 +0200
   122.3 @@ -0,0 +1,72 @@
   122.4 +/*
   122.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   122.6 + *
   122.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
   122.8 + *
   122.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  122.10 + * Other names may be trademarks of their respective owners.
  122.11 + *
  122.12 + * The contents of this file are subject to the terms of either the GNU
  122.13 + * General Public License Version 2 only ("GPL") or the Common
  122.14 + * Development and Distribution License("CDDL") (collectively, the
  122.15 + * "License"). You may not use this file except in compliance with the
  122.16 + * License. You can obtain a copy of the License at
  122.17 + * http://www.netbeans.org/cddl-gplv2.html
  122.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  122.19 + * specific language governing permissions and limitations under the
  122.20 + * License.  When distributing the software, include this License Header
  122.21 + * Notice in each file and include the License file at
  122.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  122.23 + * particular file as subject to the "Classpath" exception as provided
  122.24 + * by Oracle in the GPL Version 2 section of the License file that
  122.25 + * accompanied this code. If applicable, add the following below the
  122.26 + * License Header, with the fields enclosed by brackets [] replaced by
  122.27 + * your own identifying information:
  122.28 + * "Portions Copyrighted [year] [name of copyright owner]"
  122.29 + *
  122.30 + * If you wish your version of this file to be governed by only the CDDL
  122.31 + * or only the GPL Version 2, indicate your decision by adding
  122.32 + * "[Contributor] elects to include this software in this distribution
  122.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  122.34 + * single choice of license, a recipient has the option to distribute
  122.35 + * your version of this file under either the CDDL, the GPL Version 2 or
  122.36 + * to extend the choice of license to its licensees as provided above.
  122.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  122.38 + * Version 2 license, then the option applies only if the new code is
  122.39 + * made subject to such option by the copyright holder.
  122.40 + *
  122.41 + * Contributor(s):
  122.42 + *
  122.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
  122.44 + */
  122.45 +package org.netbeans.modules.jackpot30.backend.base;
  122.46 +
  122.47 +import java.io.IOException;
  122.48 +import java.net.URL;
  122.49 +import java.net.URLConnection;
  122.50 +import java.net.URLStreamHandler;
  122.51 +import java.net.URLStreamHandlerFactory;
  122.52 +import org.openide.util.lookup.ServiceProvider;
  122.53 +
  122.54 +/**
  122.55 + *
  122.56 + * @author lahvac
  122.57 + */
  122.58 +@ServiceProvider(service=URLStreamHandlerFactory.class)
  122.59 +public class RelStreamHandlerFactory implements URLStreamHandlerFactory {
  122.60 +
  122.61 +    @Override
  122.62 +    public URLStreamHandler createURLStreamHandler(String protocol) {
  122.63 +        if ("rel".equals(protocol)) return new RelStreamHandler();
  122.64 +        return null;
  122.65 +    }
  122.66 +
  122.67 +    private static final class RelStreamHandler extends URLStreamHandler {
  122.68 +
  122.69 +        @Override protected URLConnection openConnection(URL u) throws IOException {
  122.70 +            throw new IOException("Cannot open");
  122.71 +        }
  122.72 +
  122.73 +    }
  122.74 +
  122.75 +}
   123.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   123.2 +++ b/remoting/server/web/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/WebUtilities.java	Thu Jun 23 15:07:16 2011 +0200
   123.3 @@ -0,0 +1,137 @@
   123.4 +/*
   123.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   123.6 + *
   123.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   123.8 + *
   123.9 + * The contents of this file are subject to the terms of either the GNU
  123.10 + * General Public License Version 2 only ("GPL") or the Common
  123.11 + * Development and Distribution License("CDDL") (collectively, the
  123.12 + * "License"). You may not use this file except in compliance with the
  123.13 + * License. You can obtain a copy of the License at
  123.14 + * http://www.netbeans.org/cddl-gplv2.html
  123.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  123.16 + * specific language governing permissions and limitations under the
  123.17 + * License.  When distributing the software, include this License Header
  123.18 + * Notice in each file and include the License file at
  123.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  123.20 + * particular file as subject to the "Classpath" exception as provided
  123.21 + * by Sun in the GPL Version 2 section of the License file that
  123.22 + * accompanied this code. If applicable, add the following below the
  123.23 + * License Header, with the fields enclosed by brackets [] replaced by
  123.24 + * your own identifying information:
  123.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  123.26 + *
  123.27 + * If you wish your version of this file to be governed by only the CDDL
  123.28 + * or only the GPL Version 2, indicate your decision by adding
  123.29 + * "[Contributor] elects to include this software in this distribution
  123.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  123.31 + * single choice of license, a recipient has the option to distribute
  123.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  123.33 + * to extend the choice of license to its licensees as provided above.
  123.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  123.35 + * Version 2 license, then the option applies only if the new code is
  123.36 + * made subject to such option by the copyright holder.
  123.37 + *
  123.38 + * Contributor(s):
  123.39 + *
  123.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  123.41 + */
  123.42 +
  123.43 +package org.netbeans.modules.jackpot30.backend.base;
  123.44 +
  123.45 +import java.io.BufferedReader;
  123.46 +import java.io.IOException;
  123.47 +import java.io.InputStream;
  123.48 +import java.io.InputStreamReader;
  123.49 +import java.net.URI;
  123.50 +import java.net.URISyntaxException;
  123.51 +import java.net.URL;
  123.52 +import java.net.URLConnection;
  123.53 +import java.util.Collection;
  123.54 +import java.util.LinkedList;
  123.55 +import java.util.List;
  123.56 +import java.util.regex.Matcher;
  123.57 +import java.util.regex.Pattern;
  123.58 +
  123.59 +/**
  123.60 + *
  123.61 + */
  123.62 +public class WebUtilities {
  123.63 +
  123.64 +    private WebUtilities() {
  123.65 +    }
  123.66 +
  123.67 +    public static String requestStringResponse (URI uri) {
  123.68 +        final StringBuffer sb = new StringBuffer ();
  123.69 +        final URL url;
  123.70 +        try {
  123.71 +            url = uri.toURL();
  123.72 +            final URLConnection urlConnection = url.openConnection ();
  123.73 +            urlConnection.connect ();
  123.74 +            final Object content = urlConnection.getContent ();
  123.75 +//            System.out.println (content);
  123.76 +//            System.out.println (content.getClass ());
  123.77 +            final InputStream inputStream = (InputStream) content;
  123.78 +            final BufferedReader reader = new BufferedReader (new InputStreamReader (inputStream, "ASCII"));
  123.79 +            try {
  123.80 +                for (;;) {
  123.81 +                    String line = reader.readLine ();
  123.82 +                    if (line == null)
  123.83 +                        break;
  123.84 +                    sb.append (line).append ('\n');
  123.85 +                }
  123.86 +            } finally {
  123.87 +                reader.close ();
  123.88 +            }
  123.89 +        } catch (IOException e) {
  123.90 +            e.printStackTrace ();  // TODO
  123.91 +            return null;
  123.92 +        }
  123.93 +        return sb.toString ();
  123.94 +    }
  123.95 +    
  123.96 +    public static Collection<? extends String> requestStringArrayResponse (URI uri) {
  123.97 +        final List<String> result = new LinkedList<String> ();
  123.98 +        final URL url;
  123.99 +        try {
 123.100 +            url = uri.toURL();
 123.101 +            final URLConnection urlConnection = url.openConnection ();
 123.102 +            urlConnection.connect ();
 123.103 +            final Object content = urlConnection.getContent ();
 123.104 +//            System.out.println (content);
 123.105 +//            System.out.println (content.getClass ());
 123.106 +            final InputStream inputStream = (InputStream) content;
 123.107 +            final BufferedReader reader = new BufferedReader (new InputStreamReader (inputStream, "ASCII"));
 123.108 +            try {
 123.109 +                for (;;) {
 123.110 +                    String line = reader.readLine ();
 123.111 +                    if (line == null)
 123.112 +                        break;
 123.113 +                    result.add (line);
 123.114 +                }
 123.115 +            } finally {
 123.116 +                reader.close ();
 123.117 +            }
 123.118 +        } catch (IOException e) {
 123.119 +            e.printStackTrace ();  // TODO
 123.120 +        }
 123.121 +        return result;
 123.122 +    }
 123.123 +
 123.124 +    private static String[] c = new String[] {"&", "<", ">", "\n", "\""}; // NOI18N
 123.125 +    private static String[] tags = new String[] {"&amp;", "&lt;", "&gt;", "<br>", "&quot;"}; // NOI18N
 123.126 +
 123.127 +    public static String escapeForHTMLElement(String input) {
 123.128 +        for (int cntr = 0; cntr < c.length; cntr++) {
 123.129 +            input = input.replaceAll(c[cntr], tags[cntr]);
 123.130 +        }
 123.131 +
 123.132 +        return input;
 123.133 +    }
 123.134 +
 123.135 +    public static String escapeForQuery(String pattern) throws URISyntaxException {
 123.136 +        if (pattern == null) return null;
 123.137 +        return new URI(null, null, null, -1, null, pattern, null).getRawQuery().replaceAll(Pattern.quote("&"), Matcher.quoteReplacement("%26"));
 123.138 +    }
 123.139 +
 123.140 +}
   124.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   124.2 +++ b/remoting/server/web/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/api/API.java	Thu Jun 23 15:07:16 2011 +0200
   124.3 @@ -0,0 +1,122 @@
   124.4 +/*
   124.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   124.6 + *
   124.7 + * Copyright 2009-2011 Sun Microsystems, Inc. All rights reserved.
   124.8 + *
   124.9 + * The contents of this file are subject to the terms of either the GNU
  124.10 + * General Public License Version 2 only ("GPL") or the Common
  124.11 + * Development and Distribution License("CDDL") (collectively, the
  124.12 + * "License"). You may not use this file except in compliance with the
  124.13 + * License. You can obtain a copy of the License at
  124.14 + * http://www.netbeans.org/cddl-gplv2.html
  124.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  124.16 + * specific language governing permissions and limitations under the
  124.17 + * License.  When distributing the software, include this License Header
  124.18 + * Notice in each file and include the License file at
  124.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  124.20 + * particular file as subject to the "Classpath" exception as provided
  124.21 + * by Sun in the GPL Version 2 section of the License file that
  124.22 + * accompanied this code. If applicable, add the following below the
  124.23 + * License Header, with the fields enclosed by brackets [] replaced by
  124.24 + * your own identifying information:
  124.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  124.26 + *
  124.27 + * If you wish your version of this file to be governed by only the CDDL
  124.28 + * or only the GPL Version 2, indicate your decision by adding
  124.29 + * "[Contributor] elects to include this software in this distribution
  124.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  124.31 + * single choice of license, a recipient has the option to distribute
  124.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  124.33 + * to extend the choice of license to its licensees as provided above.
  124.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  124.35 + * Version 2 license, then the option applies only if the new code is
  124.36 + * made subject to such option by the copyright holder.
  124.37 + *
  124.38 + * Contributor(s):
  124.39 + *
  124.40 + * Portions Copyrighted 2009-2011 Sun Microsystems, Inc.
  124.41 + */
  124.42 +
  124.43 +package org.netbeans.modules.jackpot30.backend.base.api;
  124.44 +
  124.45 +import java.io.IOException;
  124.46 +import java.lang.reflect.Field;
  124.47 +import java.lang.reflect.InvocationTargetException;
  124.48 +import java.lang.reflect.Method;
  124.49 +import java.util.Arrays;
  124.50 +import java.util.Map;
  124.51 +import java.util.logging.Level;
  124.52 +import java.util.logging.Logger;
  124.53 +import javax.ws.rs.GET;
  124.54 +import javax.ws.rs.Path;
  124.55 +import javax.ws.rs.Produces;
  124.56 +import org.netbeans.modules.jackpot30.backend.base.CategoryStorage;
  124.57 +import org.netbeans.modules.java.source.usages.ClassIndexImpl;
  124.58 +import org.netbeans.modules.java.source.usages.ClassIndexManager;
  124.59 +
  124.60 +/**
  124.61 + *
  124.62 + * @author lahvac
  124.63 + */
  124.64 +@Path("/index")
  124.65 +public class API {
  124.66 +
  124.67 +    @GET
  124.68 +    @Path("/list")
  124.69 +    @Produces("text/plain")
  124.70 +    public String list() throws IOException {
  124.71 +        StringBuilder sb = new StringBuilder();
  124.72 +
  124.73 +        for (CategoryStorage c : CategoryStorage.listCategories()) {
  124.74 +            sb.append(c.getId());
  124.75 +            sb.append(":");
  124.76 +            sb.append(c.getDisplayName());
  124.77 +            sb.append("\n");
  124.78 +        }
  124.79 +
  124.80 +        return sb.toString();
  124.81 +    }
  124.82 +
  124.83 +    @GET
  124.84 +    @Path("/internal/indexUpdated")
  124.85 +    @Produces("test/plain")
  124.86 +    public String indexUpdated() throws IOException {
  124.87 +        //XXX: should allow individual providers to do their own cleanup:
  124.88 +        //XXX: synchronize with the queries!
  124.89 +        //XXX: well, still does not work!
  124.90 +
  124.91 +        try {
  124.92 +            for (String name : Arrays.asList("instances", "transientInstances")) {
  124.93 +                Field instances = ClassIndexManager.class.getDeclaredField(name);
  124.94 +
  124.95 +                instances.setAccessible(true);
  124.96 +
  124.97 +                Map<?, ClassIndexImpl> toClear = (Map<?, ClassIndexImpl>) instances.get(ClassIndexManager.getDefault());
  124.98 +
  124.99 +                for (ClassIndexImpl impl : toClear.values()) {
 124.100 +                    Method close = ClassIndexImpl.class.getDeclaredMethod("close");
 124.101 +
 124.102 +                    close.setAccessible(true);
 124.103 +                    close.invoke(impl);
 124.104 +                }
 124.105 +
 124.106 +                toClear.clear();
 124.107 +            }
 124.108 +        } catch (InvocationTargetException ex) {
 124.109 +            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
 124.110 +        } catch (NoSuchMethodException ex) {
 124.111 +            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
 124.112 +        } catch (IllegalArgumentException ex) {
 124.113 +            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
 124.114 +        } catch (IllegalAccessException ex) {
 124.115 +            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
 124.116 +        } catch (NoSuchFieldException ex) {
 124.117 +            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
 124.118 +        } catch (SecurityException ex) {
 124.119 +            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
 124.120 +        }
 124.121 +        
 124.122 +        return "Done";
 124.123 +    }
 124.124 +
 124.125 +}
   125.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   125.2 +++ b/remoting/server/web/type.web.api/build.xml	Thu Jun 23 15:07:16 2011 +0200
   125.3 @@ -0,0 +1,74 @@
   125.4 +<?xml version="1.0" encoding="UTF-8"?>
   125.5 +<!-- You may freely edit this file. See commented blocks below for -->
   125.6 +<!-- some examples of how to customize the build. -->
   125.7 +<!-- (If you delete it and reopen the project it will be recreated.) -->
   125.8 +<!-- By default, only the Clean and Build commands use this build script. -->
   125.9 +<!-- Commands such as Run, Debug, and Test only use this build script if -->
  125.10 +<!-- the Compile on Save feature is turned off for the project. -->
  125.11 +<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
  125.12 +<!-- in the project's Project Properties dialog box.-->
  125.13 +<project name="type.web.api" default="default" basedir=".">
  125.14 +    <description>Builds, tests, and runs the project type.web.api.</description>
  125.15 +    <import file="nbproject/build-impl.xml"/>
  125.16 +    <!--
  125.17 +
  125.18 +    There exist several targets which are by default empty and which can be 
  125.19 +    used for execution of your tasks. These targets are usually executed 
  125.20 +    before and after some main targets. They are: 
  125.21 +
  125.22 +      -pre-init:                 called before initialization of project properties
  125.23 +      -post-init:                called after initialization of project properties
  125.24 +      -pre-compile:              called before javac compilation
  125.25 +      -post-compile:             called after javac compilation
  125.26 +      -pre-compile-single:       called before javac compilation of single file
  125.27 +      -post-compile-single:      called after javac compilation of single file
  125.28 +      -pre-compile-test:         called before javac compilation of JUnit tests
  125.29 +      -post-compile-test:        called after javac compilation of JUnit tests
  125.30 +      -pre-compile-test-single:  called before javac compilation of single JUnit test
  125.31 +      -post-compile-test-single: called after javac compilation of single JUunit test
  125.32 +      -pre-jar:                  called before JAR building
  125.33 +      -post-jar:                 called after JAR building
  125.34 +      -post-clean:               called after cleaning build products
  125.35 +
  125.36 +    (Targets beginning with '-' are not intended to be called on their own.)
  125.37 +
  125.38 +    Example of inserting an obfuscator after compilation could look like this:
  125.39 +
  125.40 +        <target name="-post-compile">
  125.41 +            <obfuscate>
  125.42 +                <fileset dir="${build.classes.dir}"/>
  125.43 +            </obfuscate>
  125.44 +        </target>
  125.45 +
  125.46 +    For list of available properties check the imported 
  125.47 +    nbproject/build-impl.xml file. 
  125.48 +
  125.49 +
  125.50 +    Another way to customize the build is by overriding existing main targets.
  125.51 +    The targets of interest are: 
  125.52 +
  125.53 +      -init-macrodef-javac:     defines macro for javac compilation
  125.54 +      -init-macrodef-junit:     defines macro for junit execution
  125.55 +      -init-macrodef-debug:     defines macro for class debugging
  125.56 +      -init-macrodef-java:      defines macro for class execution
  125.57 +      -do-jar-with-manifest:    JAR building (if you are using a manifest)
  125.58 +      -do-jar-without-manifest: JAR building (if you are not using a manifest)
  125.59 +      run:                      execution of project 
  125.60 +      -javadoc-build:           Javadoc generation
  125.61 +      test-report:              JUnit report generation
  125.62 +
  125.63 +    An example of overriding the target for project execution could look like this:
  125.64 +
  125.65 +        <target name="run" depends="type.web.api-impl.jar">
  125.66 +            <exec dir="bin" executable="launcher.exe">
  125.67 +                <arg file="${dist.jar}"/>
  125.68 +            </exec>
  125.69 +        </target>
  125.70 +
  125.71 +    Notice that the overridden target depends on the jar target and not only on 
  125.72 +    the compile target as the regular run target does. Again, for a list of available 
  125.73 +    properties which you can use, check the target you are overriding in the
  125.74 +    nbproject/build-impl.xml file. 
  125.75 +
  125.76 +    -->
  125.77 +</project>
   126.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   126.2 +++ b/remoting/server/web/type.web.api/manifest.mf	Thu Jun 23 15:07:16 2011 +0200
   126.3 @@ -0,0 +1,3 @@
   126.4 +Manifest-Version: 1.0
   126.5 +X-COMMENT: Main-Class will be added automatically by build
   126.6 +
   127.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   127.2 +++ b/remoting/server/web/type.web.api/nbproject/build-impl.xml	Thu Jun 23 15:07:16 2011 +0200
   127.3 @@ -0,0 +1,1082 @@
   127.4 +<?xml version="1.0" encoding="UTF-8"?>
   127.5 +<!--
   127.6 +*** GENERATED FROM project.xml - DO NOT EDIT  ***
   127.7 +***         EDIT ../build.xml INSTEAD         ***
   127.8 +
   127.9 +For the purpose of easier reading the script
  127.10 +is divided into following sections:
  127.11 +
  127.12 +  - initialization
  127.13 +  - compilation
  127.14 +  - jar
  127.15 +  - execution
  127.16 +  - debugging
  127.17 +  - javadoc
  127.18 +  - junit compilation
  127.19 +  - junit execution
  127.20 +  - junit debugging
  127.21 +  - applet
  127.22 +  - cleanup
  127.23 +
  127.24 +        -->
  127.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">
  127.26 +    <fail message="Please build using Ant 1.8.0 or higher.">
  127.27 +        <condition>
  127.28 +            <not>
  127.29 +                <antversion atleast="1.8.0"/>
  127.30 +            </not>
  127.31 +        </condition>
  127.32 +    </fail>
  127.33 +    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
  127.34 +    <!-- 
  127.35 +                ======================
  127.36 +                INITIALIZATION SECTION 
  127.37 +                ======================
  127.38 +            -->
  127.39 +    <target name="-pre-init">
  127.40 +        <!-- Empty placeholder for easier customization. -->
  127.41 +        <!-- You can override this target in the ../build.xml file. -->
  127.42 +    </target>
  127.43 +    <target depends="-pre-init" name="-init-private">
  127.44 +        <property file="nbproject/private/config.properties"/>
  127.45 +        <property file="nbproject/private/configs/${config}.properties"/>
  127.46 +        <property file="nbproject/private/private.properties"/>
  127.47 +    </target>
  127.48 +    <target name="-pre-init-libraries">
  127.49 +        <property location="../../../../server/lib/nblibraries.properties" name="libraries.path"/>
  127.50 +        <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
  127.51 +        <pathconvert dirsep="/" property="libraries.dir">
  127.52 +            <path path="${libraries.dir.nativedirsep}"/>
  127.53 +        </pathconvert>
  127.54 +        <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
  127.55 +        <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
  127.56 +    </target>
  127.57 +    <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
  127.58 +        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
  127.59 +            <filterchain>
  127.60 +                <replacestring from="$${base}" to="${libraries.dir}"/>
  127.61 +                <escapeunicode/>
  127.62 +            </filterchain>
  127.63 +        </loadproperties>
  127.64 +    </target>
  127.65 +    <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
  127.66 +        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
  127.67 +            <filterchain>
  127.68 +                <replacestring from="$${base}" to="${libraries.dir}"/>
  127.69 +                <escapeunicode/>
  127.70 +            </filterchain>
  127.71 +        </loadproperties>
  127.72 +    </target>
  127.73 +    <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
  127.74 +        <property file="${user.properties.file}"/>
  127.75 +        <!-- The two properties below are usually overridden -->
  127.76 +        <!-- by the active platform. Just a fallback. -->
  127.77 +        <property name="default.javac.source" value="1.4"/>
  127.78 +        <property name="default.javac.target" value="1.4"/>
  127.79 +    </target>
  127.80 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
  127.81 +        <property file="nbproject/configs/${config}.properties"/>
  127.82 +        <property file="nbproject/project.properties"/>
  127.83 +    </target>
  127.84 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
  127.85 +        <available file="${manifest.file}" property="manifest.available"/>
  127.86 +        <condition property="splashscreen.available">
  127.87 +            <and>
  127.88 +                <not>
  127.89 +                    <equals arg1="${application.splash}" arg2="" trim="true"/>
  127.90 +                </not>
  127.91 +                <available file="${application.splash}"/>
  127.92 +            </and>
  127.93 +        </condition>
  127.94 +        <condition property="main.class.available">
  127.95 +            <and>
  127.96 +                <isset property="main.class"/>
  127.97 +                <not>
  127.98 +                    <equals arg1="${main.class}" arg2="" trim="true"/>
  127.99 +                </not>
 127.100 +            </and>
 127.101 +        </condition>
 127.102 +        <condition property="manifest.available+main.class">
 127.103 +            <and>
 127.104 +                <isset property="manifest.available"/>
 127.105 +                <isset property="main.class.available"/>
 127.106 +            </and>
 127.107 +        </condition>
 127.108 +        <condition property="do.archive">
 127.109 +            <not>
 127.110 +                <istrue value="${jar.archive.disabled}"/>
 127.111 +            </not>
 127.112 +        </condition>
 127.113 +        <condition property="do.mkdist">
 127.114 +            <and>
 127.115 +                <isset property="do.archive"/>
 127.116 +                <isset property="libs.CopyLibs.classpath"/>
 127.117 +                <not>
 127.118 +                    <istrue value="${mkdist.disabled}"/>
 127.119 +                </not>
 127.120 +            </and>
 127.121 +        </condition>
 127.122 +        <condition property="manifest.available+main.class+mkdist.available">
 127.123 +            <and>
 127.124 +                <istrue value="${manifest.available+main.class}"/>
 127.125 +                <isset property="do.mkdist"/>
 127.126 +            </and>
 127.127 +        </condition>
 127.128 +        <condition property="do.archive+manifest.available">
 127.129 +            <and>
 127.130 +                <isset property="manifest.available"/>
 127.131 +                <istrue value="${do.archive}"/>
 127.132 +            </and>
 127.133 +        </condition>
 127.134 +        <condition property="do.archive+main.class.available">
 127.135 +            <and>
 127.136 +                <isset property="main.class.available"/>
 127.137 +                <istrue value="${do.archive}"/>
 127.138 +            </and>
 127.139 +        </condition>
 127.140 +        <condition property="do.archive+splashscreen.available">
 127.141 +            <and>
 127.142 +                <isset property="splashscreen.available"/>
 127.143 +                <istrue value="${do.archive}"/>
 127.144 +            </and>
 127.145 +        </condition>
 127.146 +        <condition property="do.archive+manifest.available+main.class">
 127.147 +            <and>
 127.148 +                <istrue value="${manifest.available+main.class}"/>
 127.149 +                <istrue value="${do.archive}"/>
 127.150 +            </and>
 127.151 +        </condition>
 127.152 +        <condition property="manifest.available-mkdist.available">
 127.153 +            <or>
 127.154 +                <istrue value="${manifest.available}"/>
 127.155 +                <isset property="do.mkdist"/>
 127.156 +            </or>
 127.157 +        </condition>
 127.158 +        <condition property="manifest.available+main.class-mkdist.available">
 127.159 +            <or>
 127.160 +                <istrue value="${manifest.available+main.class}"/>
 127.161 +                <isset property="do.mkdist"/>
 127.162 +            </or>
 127.163 +        </condition>
 127.164 +        <condition property="have.tests">
 127.165 +            <or>
 127.166 +                <available file="${test.src.dir}"/>
 127.167 +            </or>
 127.168 +        </condition>
 127.169 +        <condition property="have.sources">
 127.170 +            <or>
 127.171 +                <available file="${src.dir}"/>
 127.172 +            </or>
 127.173 +        </condition>
 127.174 +        <condition property="netbeans.home+have.tests">
 127.175 +            <and>
 127.176 +                <isset property="netbeans.home"/>
 127.177 +                <isset property="have.tests"/>
 127.178 +            </and>
 127.179 +        </condition>
 127.180 +        <condition property="no.javadoc.preview">
 127.181 +            <and>
 127.182 +                <isset property="javadoc.preview"/>
 127.183 +                <isfalse value="${javadoc.preview}"/>
 127.184 +            </and>
 127.185 +        </condition>
 127.186 +        <property name="run.jvmargs" value=""/>
 127.187 +        <property name="javac.compilerargs" value=""/>
 127.188 +        <property name="work.dir" value="${basedir}"/>
 127.189 +        <condition property="no.deps">
 127.190 +            <and>
 127.191 +                <istrue value="${no.dependencies}"/>
 127.192 +            </and>
 127.193 +        </condition>
 127.194 +        <property name="javac.debug" value="true"/>
 127.195 +        <property name="javadoc.preview" value="true"/>
 127.196 +        <property name="application.args" value=""/>
 127.197 +        <property name="source.encoding" value="${file.encoding}"/>
 127.198 +        <property name="runtime.encoding" value="${source.encoding}"/>
 127.199 +        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
 127.200 +            <and>
 127.201 +                <isset property="javadoc.encoding"/>
 127.202 +                <not>
 127.203 +                    <equals arg1="${javadoc.encoding}" arg2=""/>
 127.204 +                </not>
 127.205 +            </and>
 127.206 +        </condition>
 127.207 +        <property name="javadoc.encoding.used" value="${source.encoding}"/>
 127.208 +        <property name="includes" value="**"/>
 127.209 +        <property name="excludes" value=""/>
 127.210 +        <property name="do.depend" value="false"/>
 127.211 +        <condition property="do.depend.true">
 127.212 +            <istrue value="${do.depend}"/>
 127.213 +        </condition>
 127.214 +        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
 127.215 +        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
 127.216 +            <length length="0" string="${endorsed.classpath}" when="greater"/>
 127.217 +        </condition>
 127.218 +        <condition else="false" property="jdkBug6558476">
 127.219 +            <and>
 127.220 +                <matches pattern="1\.[56]" string="${java.specification.version}"/>
 127.221 +                <not>
 127.222 +                    <os family="unix"/>
 127.223 +                </not>
 127.224 +            </and>
 127.225 +        </condition>
 127.226 +        <property name="javac.fork" value="${jdkBug6558476}"/>
 127.227 +        <property name="jar.index" value="false"/>
 127.228 +        <property name="jar.index.metainf" value="${jar.index}"/>
 127.229 +        <property name="copylibs.rebase" value="true"/>
 127.230 +        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
 127.231 +    </target>
 127.232 +    <target name="-post-init">
 127.233 +        <!-- Empty placeholder for easier customization. -->
 127.234 +        <!-- You can override this target in the ../build.xml file. -->
 127.235 +    </target>
 127.236 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
 127.237 +        <fail unless="src.dir">Must set src.dir</fail>
 127.238 +        <fail unless="test.src.dir">Must set test.src.dir</fail>
 127.239 +        <fail unless="build.dir">Must set build.dir</fail>
 127.240 +        <fail unless="dist.dir">Must set dist.dir</fail>
 127.241 +        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
 127.242 +        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
 127.243 +        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
 127.244 +        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
 127.245 +        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
 127.246 +        <fail unless="dist.jar">Must set dist.jar</fail>
 127.247 +    </target>
 127.248 +    <target name="-init-macrodef-property">
 127.249 +        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
 127.250 +            <attribute name="name"/>
 127.251 +            <attribute name="value"/>
 127.252 +            <sequential>
 127.253 +                <property name="@{name}" value="${@{value}}"/>
 127.254 +            </sequential>
 127.255 +        </macrodef>
 127.256 +    </target>
 127.257 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
 127.258 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
 127.259 +            <attribute default="${src.dir}" name="srcdir"/>
 127.260 +            <attribute default="${build.classes.dir}" name="destdir"/>
 127.261 +            <attribute default="${javac.classpath}" name="classpath"/>
 127.262 +            <attribute default="${javac.processorpath}" name="processorpath"/>
 127.263 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
 127.264 +            <attribute default="${includes}" name="includes"/>
 127.265 +            <attribute default="${excludes}" name="excludes"/>
 127.266 +            <attribute default="${javac.debug}" name="debug"/>
 127.267 +            <attribute default="${empty.dir}" name="sourcepath"/>
 127.268 +            <attribute default="${empty.dir}" name="gensrcdir"/>
 127.269 +            <element name="customize" optional="true"/>
 127.270 +            <sequential>
 127.271 +                <property location="${build.dir}/empty" name="empty.dir"/>
 127.272 +                <mkdir dir="${empty.dir}"/>
 127.273 +                <mkdir dir="@{apgeneratedsrcdir}"/>
 127.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}">
 127.275 +                    <src>
 127.276 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
 127.277 +                            <include name="*"/>
 127.278 +                        </dirset>
 127.279 +                    </src>
 127.280 +                    <classpath>
 127.281 +                        <path path="@{classpath}"/>
 127.282 +                    </classpath>
 127.283 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
 127.284 +                    <compilerarg line="${javac.compilerargs}"/>
 127.285 +                    <compilerarg value="-processorpath"/>
 127.286 +                    <compilerarg path="@{processorpath}:${empty.dir}"/>
 127.287 +                    <compilerarg line="${ap.processors.internal}"/>
 127.288 +                    <compilerarg line="${annotation.processing.processor.options}"/>
 127.289 +                    <compilerarg value="-s"/>
 127.290 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
 127.291 +                    <compilerarg line="${ap.proc.none.internal}"/>
 127.292 +                    <customize/>
 127.293 +                </javac>
 127.294 +            </sequential>
 127.295 +        </macrodef>
 127.296 +    </target>
 127.297 +    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
 127.298 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
 127.299 +            <attribute default="${src.dir}" name="srcdir"/>
 127.300 +            <attribute default="${build.classes.dir}" name="destdir"/>
 127.301 +            <attribute default="${javac.classpath}" name="classpath"/>
 127.302 +            <attribute default="${javac.processorpath}" name="processorpath"/>
 127.303 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
 127.304 +            <attribute default="${includes}" name="includes"/>
 127.305 +            <attribute default="${excludes}" name="excludes"/>
 127.306 +            <attribute default="${javac.debug}" name="debug"/>
 127.307 +            <attribute default="${empty.dir}" name="sourcepath"/>
 127.308 +            <attribute default="${empty.dir}" name="gensrcdir"/>
 127.309 +            <element name="customize" optional="true"/>
 127.310 +            <sequential>
 127.311 +                <property location="${build.dir}/empty" name="empty.dir"/>
 127.312 +                <mkdir dir="${empty.dir}"/>
 127.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}">
 127.314 +                    <src>
 127.315 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
 127.316 +                            <include name="*"/>
 127.317 +                        </dirset>
 127.318 +                    </src>
 127.319 +                    <classpath>
 127.320 +                        <path path="@{classpath}"/>
 127.321 +                    </classpath>
 127.322 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
 127.323 +                    <compilerarg line="${javac.compilerargs}"/>
 127.324 +                    <customize/>
 127.325 +                </javac>
 127.326 +            </sequential>
 127.327 +        </macrodef>
 127.328 +    </target>
 127.329 +    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
 127.330 +        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
 127.331 +            <attribute default="${src.dir}" name="srcdir"/>
 127.332 +            <attribute default="${build.classes.dir}" name="destdir"/>
 127.333 +            <attribute default="${javac.classpath}" name="classpath"/>
 127.334 +            <sequential>
 127.335 +                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
 127.336 +                    <classpath>
 127.337 +                        <path path="@{classpath}"/>
 127.338 +                    </classpath>
 127.339 +                </depend>
 127.340 +            </sequential>
 127.341 +        </macrodef>
 127.342 +        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
 127.343 +            <attribute default="${build.classes.dir}" name="destdir"/>
 127.344 +            <sequential>
 127.345 +                <fail unless="javac.includes">Must set javac.includes</fail>
 127.346 +                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
 127.347 +                    <path>
 127.348 +                        <filelist dir="@{destdir}" files="${javac.includes}"/>
 127.349 +                    </path>
 127.350 +                    <globmapper from="*.java" to="*.class"/>
 127.351 +                </pathconvert>
 127.352 +                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
 127.353 +                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
 127.354 +                <delete>
 127.355 +                    <files includesfile="${javac.includesfile.binary}"/>
 127.356 +                </delete>
 127.357 +                <delete>
 127.358 +                    <fileset file="${javac.includesfile.binary}"/>
 127.359 +                </delete>
 127.360 +            </sequential>
 127.361 +        </macrodef>
 127.362 +    </target>
 127.363 +    <target name="-init-macrodef-junit">
 127.364 +        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
 127.365 +            <attribute default="${includes}" name="includes"/>
 127.366 +            <attribute default="${excludes}" name="excludes"/>
 127.367 +            <attribute default="**" name="testincludes"/>
 127.368 +            <sequential>
 127.369 +                <property name="junit.forkmode" value="perTest"/>
 127.370 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
 127.371 +                    <batchtest todir="${build.test.results.dir}">
 127.372 +                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
 127.373 +                            <filename name="@{testincludes}"/>
 127.374 +                        </fileset>
 127.375 +                    </batchtest>
 127.376 +                    <classpath>
 127.377 +                        <path path="${run.test.classpath}"/>
 127.378 +                    </classpath>
 127.379 +                    <syspropertyset>
 127.380 +                        <propertyref prefix="test-sys-prop."/>
 127.381 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
 127.382 +                    </syspropertyset>
 127.383 +                    <formatter type="brief" usefile="false"/>
 127.384 +                    <formatter type="xml"/>
 127.385 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
 127.386 +                    <jvmarg value="-ea"/>
 127.387 +                    <jvmarg line="${run.jvmargs}"/>
 127.388 +                </junit>
 127.389 +            </sequential>
 127.390 +        </macrodef>
 127.391 +    </target>
 127.392 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
 127.393 +    <target name="-profile-pre-init">
 127.394 +        <!-- Empty placeholder for easier customization. -->
 127.395 +        <!-- You can override this target in the ../build.xml file. -->
 127.396 +    </target>
 127.397 +    <target name="-profile-post-init">
 127.398 +        <!-- Empty placeholder for easier customization. -->
 127.399 +        <!-- You can override this target in the ../build.xml file. -->
 127.400 +    </target>
 127.401 +    <target name="-profile-init-macrodef-profile">
 127.402 +        <macrodef name="resolve">
 127.403 +            <attribute name="name"/>
 127.404 +            <attribute name="value"/>
 127.405 +            <sequential>
 127.406 +                <property name="@{name}" value="${env.@{value}}"/>
 127.407 +            </sequential>
 127.408 +        </macrodef>
 127.409 +        <macrodef name="profile">
 127.410 +            <attribute default="${main.class}" name="classname"/>
 127.411 +            <element name="customize" optional="true"/>
 127.412 +            <sequential>
 127.413 +                <property environment="env"/>
 127.414 +                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
 127.415 +                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
 127.416 +                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
 127.417 +                    <jvmarg line="${profiler.info.jvmargs}"/>
 127.418 +                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
 127.419 +                    <arg line="${application.args}"/>
 127.420 +                    <classpath>
 127.421 +                        <path path="${run.classpath}"/>
 127.422 +                    </classpath>
 127.423 +                    <syspropertyset>
 127.424 +                        <propertyref prefix="run-sys-prop."/>
 127.425 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
 127.426 +                    </syspropertyset>
 127.427 +                    <customize/>
 127.428 +                </java>
 127.429 +            </sequential>
 127.430 +        </macrodef>
 127.431 +    </target>
 127.432 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
 127.433 +        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
 127.434 +        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
 127.435 +    </target>
 127.436 +    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
 127.437 +        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
 127.438 +            <attribute default="${main.class}" name="name"/>
 127.439 +            <attribute default="${debug.classpath}" name="classpath"/>
 127.440 +            <attribute default="" name="stopclassname"/>
 127.441 +            <sequential>
 127.442 +                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
 127.443 +                    <classpath>
 127.444 +                        <path path="@{classpath}"/>
 127.445 +                    </classpath>
 127.446 +                </nbjpdastart>
 127.447 +            </sequential>
 127.448 +        </macrodef>
 127.449 +        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
 127.450 +            <attribute default="${build.classes.dir}" name="dir"/>
 127.451 +            <sequential>
 127.452 +                <nbjpdareload>
 127.453 +                    <fileset dir="@{dir}" includes="${fix.classes}">
 127.454 +                        <include name="${fix.includes}*.class"/>
 127.455 +                    </fileset>
 127.456 +                </nbjpdareload>
 127.457 +            </sequential>
 127.458 +        </macrodef>
 127.459 +    </target>
 127.460 +    <target name="-init-debug-args">
 127.461 +        <property name="version-output" value="java version &quot;${ant.java.version}"/>
 127.462 +        <condition property="have-jdk-older-than-1.4">
 127.463 +            <or>
 127.464 +                <contains string="${version-output}" substring="java version &quot;1.0"/>
 127.465 +                <contains string="${version-output}" substring="java version &quot;1.1"/>
 127.466 +                <contains string="${version-output}" substring="java version &quot;1.2"/>
 127.467 +                <contains string="${version-output}" substring="java version &quot;1.3"/>
 127.468 +            </or>
 127.469 +        </condition>
 127.470 +        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
 127.471 +            <istrue value="${have-jdk-older-than-1.4}"/>
 127.472 +        </condition>
 127.473 +        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
 127.474 +            <os family="windows"/>
 127.475 +        </condition>
 127.476 +        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
 127.477 +            <isset property="debug.transport"/>
 127.478 +        </condition>
 127.479 +    </target>
 127.480 +    <target depends="-init-debug-args" name="-init-macrodef-debug">
 127.481 +        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
 127.482 +            <attribute default="${main.class}" name="classname"/>
 127.483 +            <attribute default="${debug.classpath}" name="classpath"/>
 127.484 +            <element name="customize" optional="true"/>
 127.485 +            <sequential>
 127.486 +                <java classname="@{classname}" dir="${work.dir}" fork="true">
 127.487 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
 127.488 +                    <jvmarg line="${debug-args-line}"/>
 127.489 +                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
 127.490 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
 127.491 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
 127.492 +                    <jvmarg line="${run.jvmargs}"/>
 127.493 +                    <classpath>
 127.494 +                        <path path="@{classpath}"/>
 127.495 +                    </classpath>
 127.496 +                    <syspropertyset>
 127.497 +                        <propertyref prefix="run-sys-prop."/>
 127.498 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
 127.499 +                    </syspropertyset>
 127.500 +                    <customize/>
 127.501 +                </java>
 127.502 +            </sequential>
 127.503 +        </macrodef>
 127.504 +    </target>
 127.505 +    <target name="-init-macrodef-java">
 127.506 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
 127.507 +            <attribute default="${main.class}" name="classname"/>
 127.508 +            <attribute default="${run.classpath}" name="classpath"/>
 127.509 +            <element name="customize" optional="true"/>
 127.510 +            <sequential>
 127.511 +                <java classname="@{classname}" dir="${work.dir}" fork="true">
 127.512 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
 127.513 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
 127.514 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
 127.515 +                    <jvmarg line="${run.jvmargs}"/>
 127.516 +                    <classpath>
 127.517 +                        <path path="@{classpath}"/>
 127.518 +                    </classpath>
 127.519 +                    <syspropertyset>
 127.520 +                        <propertyref prefix="run-sys-prop."/>
 127.521 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
 127.522 +                    </syspropertyset>
 127.523 +                    <customize/>
 127.524 +                </java>
 127.525 +            </sequential>
 127.526 +        </macrodef>
 127.527 +    </target>
 127.528 +    <target name="-init-macrodef-copylibs">
 127.529 +        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
 127.530 +            <attribute default="${manifest.file}" name="manifest"/>
 127.531 +            <element name="customize" optional="true"/>
 127.532 +            <sequential>
 127.533 +                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
 127.534 +                <pathconvert property="run.classpath.without.build.classes.dir">
 127.535 +                    <path path="${run.classpath}"/>
 127.536 +                    <map from="${build.classes.dir.resolved}" to=""/>
 127.537 +                </pathconvert>
 127.538 +                <pathconvert pathsep=" " property="jar.classpath">
 127.539 +                    <path path="${run.classpath.without.build.classes.dir}"/>
 127.540 +                    <chainedmapper>
 127.541 +                        <flattenmapper/>
 127.542 +                        <globmapper from="*" to="lib/*"/>
 127.543 +                    </chainedmapper>
 127.544 +                </pathconvert>
 127.545 +                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
 127.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}">
 127.547 +                    <fileset dir="${build.classes.dir}"/>
 127.548 +                    <manifest>
 127.549 +                        <attribute name="Class-Path" value="${jar.classpath}"/>
 127.550 +                        <customize/>
 127.551 +                    </manifest>
 127.552 +                </copylibs>
 127.553 +            </sequential>
 127.554 +        </macrodef>
 127.555 +    </target>
 127.556 +    <target name="-init-presetdef-jar">
 127.557 +        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
 127.558 +            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
 127.559 +                <j2seproject1:fileset dir="${build.classes.dir}"/>
 127.560 +            </jar>
 127.561 +        </presetdef>
 127.562 +    </target>
 127.563 +    <target name="-init-ap-cmdline-properties">
 127.564 +        <property name="annotation.processing.enabled" value="true"/>
 127.565 +        <property name="annotation.processing.processors.list" value=""/>
 127.566 +        <property name="annotation.processing.processor.options" value=""/>
 127.567 +        <property name="annotation.processing.run.all.processors" value="true"/>
 127.568 +        <property name="javac.processorpath" value="${javac.classpath}"/>
 127.569 +        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
 127.570 +        <condition property="ap.supported.internal" value="true">
 127.571 +            <not>
 127.572 +                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
 127.573 +            </not>
 127.574 +        </condition>
 127.575 +    </target>
 127.576 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
 127.577 +        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
 127.578 +            <isfalse value="${annotation.processing.run.all.processors}"/>
 127.579 +        </condition>
 127.580 +        <condition else="" property="ap.proc.none.internal" value="-proc:none">
 127.581 +            <isfalse value="${annotation.processing.enabled}"/>
 127.582 +        </condition>
 127.583 +    </target>
 127.584 +    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
 127.585 +        <property name="ap.cmd.line.internal" value=""/>
 127.586 +    </target>
 127.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"/>
 127.588 +    <!--
 127.589 +                ===================
 127.590 +                COMPILATION SECTION
 127.591 +                ===================
 127.592 +            -->
 127.593 +    <target name="-deps-jar-init" unless="built-jar.properties">
 127.594 +        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
 127.595 +        <delete file="${built-jar.properties}" quiet="true"/>
 127.596 +    </target>
 127.597 +    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
 127.598 +        <echo level="warn" message="Cycle detected: type.web.api was already built"/>
 127.599 +    </target>
 127.600 +    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
 127.601 +        <mkdir dir="${build.dir}"/>
 127.602 +        <touch file="${built-jar.properties}" verbose="false"/>
 127.603 +        <property file="${built-jar.properties}" prefix="already.built.jar."/>
 127.604 +        <antcall target="-warn-already-built-jar"/>
 127.605 +        <propertyfile file="${built-jar.properties}">
 127.606 +            <entry key="${basedir}" value=""/>
 127.607 +        </propertyfile>
 127.608 +        <antcall target="-maybe-call-dep">
 127.609 +            <param name="call.built.properties" value="${built-jar.properties}"/>
 127.610 +            <param location="${project.base_web_api}" name="call.subproject"/>
 127.611 +            <param location="${project.base_web_api}/build.xml" name="call.script"/>
 127.612 +            <param name="call.target" value="jar"/>
 127.613 +            <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
 127.614 +        </antcall>
 127.615 +    </target>
 127.616 +    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
 127.617 +    <target depends="init" name="-check-automatic-build">
 127.618 +        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
 127.619 +    </target>
 127.620 +    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
 127.621 +        <antcall target="clean"/>
 127.622 +    </target>
 127.623 +    <target depends="init,deps-jar" name="-pre-pre-compile">
 127.624 +        <mkdir dir="${build.classes.dir}"/>
 127.625 +    </target>
 127.626 +    <target name="-pre-compile">
 127.627 +        <!-- Empty placeholder for easier customization. -->
 127.628 +        <!-- You can override this target in the ../build.xml file. -->
 127.629 +    </target>
 127.630 +    <target if="do.depend.true" name="-compile-depend">
 127.631 +        <pathconvert property="build.generated.subdirs">
 127.632 +            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 127.633 +                <include name="*"/>
 127.634 +            </dirset>
 127.635 +        </pathconvert>
 127.636 +        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
 127.637 +    </target>
 127.638 +    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
 127.639 +        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
 127.640 +        <copy todir="${build.classes.dir}">
 127.641 +            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 127.642 +        </copy>
 127.643 +    </target>
 127.644 +    <target if="has.persistence.xml" name="-copy-persistence-xml">
 127.645 +        <mkdir dir="${build.classes.dir}/META-INF"/>
 127.646 +        <copy todir="${build.classes.dir}/META-INF">
 127.647 +            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
 127.648 +        </copy>
 127.649 +    </target>
 127.650 +    <target name="-post-compile">
 127.651 +        <!-- Empty placeholder for easier customization. -->
 127.652 +        <!-- You can override this target in the ../build.xml file. -->
 127.653 +    </target>
 127.654 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
 127.655 +    <target name="-pre-compile-single">
 127.656 +        <!-- Empty placeholder for easier customization. -->
 127.657 +        <!-- You can override this target in the ../build.xml file. -->
 127.658 +    </target>
 127.659 +    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
 127.660 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
 127.661 +        <j2seproject3:force-recompile/>
 127.662 +        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
 127.663 +    </target>
 127.664 +    <target name="-post-compile-single">
 127.665 +        <!-- Empty placeholder for easier customization. -->
 127.666 +        <!-- You can override this target in the ../build.xml file. -->
 127.667 +    </target>
 127.668 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
 127.669 +    <!--
 127.670 +                ====================
 127.671 +                JAR BUILDING SECTION
 127.672 +                ====================
 127.673 +            -->
 127.674 +    <target depends="init" name="-pre-pre-jar">
 127.675 +        <dirname file="${dist.jar}" property="dist.jar.dir"/>
 127.676 +        <mkdir dir="${dist.jar.dir}"/>
 127.677 +    </target>
 127.678 +    <target name="-pre-jar">
 127.679 +        <!-- Empty placeholder for easier customization. -->
 127.680 +        <!-- You can override this target in the ../build.xml file. -->
 127.681 +    </target>
 127.682 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
 127.683 +        <j2seproject1:jar/>
 127.684 +    </target>
 127.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">
 127.686 +        <j2seproject1:jar manifest="${manifest.file}"/>
 127.687 +    </target>
 127.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">
 127.689 +        <j2seproject1:jar manifest="${manifest.file}">
 127.690 +            <j2seproject1:manifest>
 127.691 +                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
 127.692 +            </j2seproject1:manifest>
 127.693 +        </j2seproject1:jar>
 127.694 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
 127.695 +        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
 127.696 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
 127.697 +        <pathconvert property="run.classpath.with.dist.jar">
 127.698 +            <path path="${run.classpath}"/>
 127.699 +            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
 127.700 +        </pathconvert>
 127.701 +        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
 127.702 +    </target>
 127.703 +    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
 127.704 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
 127.705 +        <touch file="${tmp.manifest.file}" verbose="false"/>
 127.706 +    </target>
 127.707 +    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
 127.708 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
 127.709 +        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
 127.710 +    </target>
 127.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">
 127.712 +        <manifest file="${tmp.manifest.file}" mode="update">
 127.713 +            <attribute name="Main-Class" value="${main.class}"/>
 127.714 +        </manifest>
 127.715 +    </target>
 127.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">
 127.717 +        <basename file="${application.splash}" property="splashscreen.basename"/>
 127.718 +        <mkdir dir="${build.classes.dir}/META-INF"/>
 127.719 +        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
 127.720 +        <manifest file="${tmp.manifest.file}" mode="update">
 127.721 +            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
 127.722 +        </manifest>
 127.723 +    </target>
 127.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">
 127.725 +        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
 127.726 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
 127.727 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
 127.728 +        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
 127.729 +    </target>
 127.730 +    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
 127.731 +        <delete>
 127.732 +            <fileset file="${tmp.manifest.file}"/>
 127.733 +        </delete>
 127.734 +    </target>
 127.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"/>
 127.736 +    <target name="-post-jar">
 127.737 +        <!-- Empty placeholder for easier customization. -->
 127.738 +        <!-- You can override this target in the ../build.xml file. -->
 127.739 +    </target>
 127.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"/>
 127.741 +    <!--
 127.742 +                =================
 127.743 +                EXECUTION SECTION
 127.744 +                =================
 127.745 +            -->
 127.746 +    <target depends="init,compile" description="Run a main class." name="run">
 127.747 +        <j2seproject1:java>
 127.748 +            <customize>
 127.749 +                <arg line="${application.args}"/>
 127.750 +            </customize>
 127.751 +        </j2seproject1:java>
 127.752 +    </target>
 127.753 +    <target name="-do-not-recompile">
 127.754 +        <property name="javac.includes.binary" value=""/>
 127.755 +    </target>
 127.756 +    <target depends="init,compile-single" name="run-single">
 127.757 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
 127.758 +        <j2seproject1:java classname="${run.class}"/>
 127.759 +    </target>
 127.760 +    <target depends="init,compile-test-single" name="run-test-with-main">
 127.761 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
 127.762 +        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
 127.763 +    </target>
 127.764 +    <!--
 127.765 +                =================
 127.766 +                DEBUGGING SECTION
 127.767 +                =================
 127.768 +            -->
 127.769 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
 127.770 +        <j2seproject1:nbjpdastart name="${debug.class}"/>
 127.771 +    </target>
 127.772 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
 127.773 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
 127.774 +    </target>
 127.775 +    <target depends="init,compile" name="-debug-start-debuggee">
 127.776 +        <j2seproject3:debug>
 127.777 +            <customize>
 127.778 +                <arg line="${application.args}"/>
 127.779 +            </customize>
 127.780 +        </j2seproject3:debug>
 127.781 +    </target>
 127.782 +    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
 127.783 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
 127.784 +        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
 127.785 +    </target>
 127.786 +    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
 127.787 +    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
 127.788 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
 127.789 +        <j2seproject3:debug classname="${debug.class}"/>
 127.790 +    </target>
 127.791 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
 127.792 +    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
 127.793 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
 127.794 +        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
 127.795 +    </target>
 127.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"/>
 127.797 +    <target depends="init" name="-pre-debug-fix">
 127.798 +        <fail unless="fix.includes">Must set fix.includes</fail>
 127.799 +        <property name="javac.includes" value="${fix.includes}.java"/>
 127.800 +    </target>
 127.801 +    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
 127.802 +        <j2seproject1:nbjpdareload/>
 127.803 +    </target>
 127.804 +    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
 127.805 +    <!--
 127.806 +                =================
 127.807 +                PROFILING SECTION
 127.808 +                =================
 127.809 +            -->
 127.810 +    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
 127.811 +        <nbprofiledirect>
 127.812 +            <classpath>
 127.813 +                <path path="${run.classpath}"/>
 127.814 +            </classpath>
 127.815 +        </nbprofiledirect>
 127.816 +        <profile/>
 127.817 +    </target>
 127.818 +    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
 127.819 +        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
 127.820 +        <nbprofiledirect>
 127.821 +            <classpath>
 127.822 +                <path path="${run.classpath}"/>
 127.823 +            </classpath>
 127.824 +        </nbprofiledirect>
 127.825 +        <profile classname="${profile.class}"/>
 127.826 +    </target>
 127.827 +    <!--
 127.828 +                =========================
 127.829 +                APPLET PROFILING  SECTION
 127.830 +                =========================
 127.831 +            -->
 127.832 +    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
 127.833 +        <nbprofiledirect>
 127.834 +            <classpath>
 127.835 +                <path path="${run.classpath}"/>
 127.836 +            </classpath>
 127.837 +        </nbprofiledirect>
 127.838 +        <profile classname="sun.applet.AppletViewer">
 127.839 +            <customize>
 127.840 +                <arg value="${applet.url}"/>
 127.841 +            </customize>
 127.842 +        </profile>
 127.843 +    </target>
 127.844 +    <!--
 127.845 +                =========================
 127.846 +                TESTS PROFILING  SECTION
 127.847 +                =========================
 127.848 +            -->
 127.849 +    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
 127.850 +        <nbprofiledirect>
 127.851 +            <classpath>
 127.852 +                <path path="${run.test.classpath}"/>
 127.853 +            </classpath>
 127.854 +        </nbprofiledirect>
 127.855 +        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
 127.856 +            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
 127.857 +            <jvmarg value="${profiler.info.jvmargs.agent}"/>
 127.858 +            <jvmarg line="${profiler.info.jvmargs}"/>
 127.859 +            <test name="${profile.class}"/>
 127.860 +            <classpath>
 127.861 +                <path path="${run.test.classpath}"/>
 127.862 +            </classpath>
 127.863 +            <syspropertyset>
 127.864 +                <propertyref prefix="test-sys-prop."/>
 127.865 +                <mapper from="test-sys-prop.*" to="*" type="glob"/>
 127.866 +            </syspropertyset>
 127.867 +            <formatter type="brief" usefile="false"/>
 127.868 +            <formatter type="xml"/>
 127.869 +        </junit>
 127.870 +    </target>
 127.871 +    <!--
 127.872 +                ===============
 127.873 +                JAVADOC SECTION
 127.874 +                ===============
 127.875 +            -->
 127.876 +    <target depends="init" if="have.sources" name="-javadoc-build">
 127.877 +        <mkdir dir="${dist.javadoc.dir}"/>
 127.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}">
 127.879 +            <classpath>
 127.880 +                <path path="${javac.classpath}"/>
 127.881 +            </classpath>
 127.882 +            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
 127.883 +                <filename name="**/*.java"/>
 127.884 +            </fileset>
 127.885 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 127.886 +                <include name="**/*.java"/>
 127.887 +                <exclude name="*.java"/>
 127.888 +            </fileset>
 127.889 +        </javadoc>
 127.890 +        <copy todir="${dist.javadoc.dir}">
 127.891 +            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
 127.892 +                <filename name="**/doc-files/**"/>
 127.893 +            </fileset>
 127.894 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 127.895 +                <include name="**/doc-files/**"/>
 127.896 +            </fileset>
 127.897 +        </copy>
 127.898 +    </target>
 127.899 +    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
 127.900 +        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
 127.901 +    </target>
 127.902 +    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
 127.903 +    <!--
 127.904 +                =========================
 127.905 +                JUNIT COMPILATION SECTION
 127.906 +                =========================
 127.907 +            -->
 127.908 +    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
 127.909 +        <mkdir dir="${build.test.classes.dir}"/>
 127.910 +    </target>
 127.911 +    <target name="-pre-compile-test">
 127.912 +        <!-- Empty placeholder for easier customization. -->
 127.913 +        <!-- You can override this target in the ../build.xml file. -->
 127.914 +    </target>
 127.915 +    <target if="do.depend.true" name="-compile-test-depend">
 127.916 +        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
 127.917 +    </target>
 127.918 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
 127.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}"/>
 127.920 +        <copy todir="${build.test.classes.dir}">
 127.921 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 127.922 +        </copy>
 127.923 +    </target>
 127.924 +    <target name="-post-compile-test">
 127.925 +        <!-- Empty placeholder for easier customization. -->
 127.926 +        <!-- You can override this target in the ../build.xml file. -->
 127.927 +    </target>
 127.928 +    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
 127.929 +    <target name="-pre-compile-test-single">
 127.930 +        <!-- Empty placeholder for easier customization. -->
 127.931 +        <!-- You can override this target in the ../build.xml file. -->
 127.932 +    </target>
 127.933 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
 127.934 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
 127.935 +        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
 127.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}"/>
 127.937 +        <copy todir="${build.test.classes.dir}">
 127.938 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 127.939 +        </copy>
 127.940 +    </target>
 127.941 +    <target name="-post-compile-test-single">
 127.942 +        <!-- Empty placeholder for easier customization. -->
 127.943 +        <!-- You can override this target in the ../build.xml file. -->
 127.944 +    </target>
 127.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"/>
 127.946 +    <!--
 127.947 +                =======================
 127.948 +                JUNIT EXECUTION SECTION
 127.949 +                =======================
 127.950 +            -->
 127.951 +    <target depends="init" if="have.tests" name="-pre-test-run">
 127.952 +        <mkdir dir="${build.test.results.dir}"/>
 127.953 +    </target>
 127.954 +    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
 127.955 +        <j2seproject3:junit testincludes="**/*Test.java"/>
 127.956 +    </target>
 127.957 +    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
 127.958 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
 127.959 +    </target>
 127.960 +    <target depends="init" if="have.tests" name="test-report"/>
 127.961 +    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
 127.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"/>
 127.963 +    <target depends="init" if="have.tests" name="-pre-test-run-single">
 127.964 +        <mkdir dir="${build.test.results.dir}"/>
 127.965 +    </target>
 127.966 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
 127.967 +        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
 127.968 +        <j2seproject3:junit excludes="" includes="${test.includes}"/>
 127.969 +    </target>
 127.970 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
 127.971 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
 127.972 +    </target>
 127.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"/>
 127.974 +    <!--
 127.975 +                =======================
 127.976 +                JUNIT DEBUGGING SECTION
 127.977 +                =======================
 127.978 +            -->
 127.979 +    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
 127.980 +        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
 127.981 +        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
 127.982 +        <delete file="${test.report.file}"/>
 127.983 +        <mkdir dir="${build.test.results.dir}"/>
 127.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}">
 127.985 +            <customize>
 127.986 +                <syspropertyset>
 127.987 +                    <propertyref prefix="test-sys-prop."/>
 127.988 +                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
 127.989 +                </syspropertyset>
 127.990 +                <arg value="${test.class}"/>
 127.991 +                <arg value="showoutput=true"/>
 127.992 +                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
 127.993 +                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
 127.994 +            </customize>
 127.995 +        </j2seproject3:debug>
 127.996 +    </target>
 127.997 +    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
 127.998 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
 127.999 +    </target>
127.1000 +    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
127.1001 +    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
127.1002 +        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
127.1003 +    </target>
127.1004 +    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
127.1005 +    <!--
127.1006 +                =========================
127.1007 +                APPLET EXECUTION SECTION
127.1008 +                =========================
127.1009 +            -->
127.1010 +    <target depends="init,compile-single" name="run-applet">
127.1011 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
127.1012 +        <j2seproject1:java classname="sun.applet.AppletViewer">
127.1013 +            <customize>
127.1014 +                <arg value="${applet.url}"/>
127.1015 +            </customize>
127.1016 +        </j2seproject1:java>
127.1017 +    </target>
127.1018 +    <!--
127.1019 +                =========================
127.1020 +                APPLET DEBUGGING  SECTION
127.1021 +                =========================
127.1022 +            -->
127.1023 +    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
127.1024 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
127.1025 +        <j2seproject3:debug classname="sun.applet.AppletViewer">
127.1026 +            <customize>
127.1027 +                <arg value="${applet.url}"/>
127.1028 +            </customize>
127.1029 +        </j2seproject3:debug>
127.1030 +    </target>
127.1031 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
127.1032 +    <!--
127.1033 +                ===============
127.1034 +                CLEANUP SECTION
127.1035 +                ===============
127.1036 +            -->
127.1037 +    <target name="-deps-clean-init" unless="built-clean.properties">
127.1038 +        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
127.1039 +        <delete file="${built-clean.properties}" quiet="true"/>
127.1040 +    </target>
127.1041 +    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
127.1042 +        <echo level="warn" message="Cycle detected: type.web.api was already built"/>
127.1043 +    </target>
127.1044 +    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
127.1045 +        <mkdir dir="${build.dir}"/>
127.1046 +        <touch file="${built-clean.properties}" verbose="false"/>
127.1047 +        <property file="${built-clean.properties}" prefix="already.built.clean."/>
127.1048 +        <antcall target="-warn-already-built-clean"/>
127.1049 +        <propertyfile file="${built-clean.properties}">
127.1050 +            <entry key="${basedir}" value=""/>
127.1051 +        </propertyfile>
127.1052 +        <antcall target="-maybe-call-dep">
127.1053 +            <param name="call.built.properties" value="${built-clean.properties}"/>
127.1054 +            <param location="${project.base_web_api}" name="call.subproject"/>
127.1055 +            <param location="${project.base_web_api}/build.xml" name="call.script"/>
127.1056 +            <param name="call.target" value="clean"/>
127.1057 +            <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
127.1058 +        </antcall>
127.1059 +    </target>
127.1060 +    <target depends="init" name="-do-clean">
127.1061 +        <delete dir="${build.dir}"/>
127.1062 +        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
127.1063 +    </target>
127.1064 +    <target name="-post-clean">
127.1065 +        <!-- Empty placeholder for easier customization. -->
127.1066 +        <!-- You can override this target in the ../build.xml file. -->
127.1067 +    </target>
127.1068 +    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
127.1069 +    <target name="-check-call-dep">
127.1070 +        <property file="${call.built.properties}" prefix="already.built."/>
127.1071 +        <condition property="should.call.dep">
127.1072 +            <not>
127.1073 +                <isset property="already.built.${call.subproject}"/>
127.1074 +            </not>
127.1075 +        </condition>
127.1076 +    </target>
127.1077 +    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
127.1078 +        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
127.1079 +            <propertyset>
127.1080 +                <propertyref prefix="transfer."/>
127.1081 +                <mapper from="transfer.*" to="*" type="glob"/>
127.1082 +            </propertyset>
127.1083 +        </ant>
127.1084 +    </target>
127.1085 +</project>
   128.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   128.2 +++ b/remoting/server/web/type.web.api/nbproject/genfiles.properties	Thu Jun 23 15:07:16 2011 +0200
   128.3 @@ -0,0 +1,8 @@
   128.4 +build.xml.data.CRC32=9ceb8e45
   128.5 +build.xml.script.CRC32=583d72ad
   128.6 +build.xml.stylesheet.CRC32=28e38971@1.45.0.45
   128.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
   128.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
   128.9 +nbproject/build-impl.xml.data.CRC32=9ceb8e45
  128.10 +nbproject/build-impl.xml.script.CRC32=1f8b6679
  128.11 +nbproject/build-impl.xml.stylesheet.CRC32=cfcde7f8@1.45.0.45
   129.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   129.2 +++ b/remoting/server/web/type.web.api/nbproject/project.properties	Thu Jun 23 15:07:16 2011 +0200
   129.3 @@ -0,0 +1,92 @@
   129.4 +annotation.processing.enabled=true
   129.5 +annotation.processing.enabled.in.editor=false
   129.6 +annotation.processing.run.all.processors=true
   129.7 +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
   129.8 +application.title=type.web.api
   129.9 +application.vendor=lahvac
  129.10 +build.classes.dir=${build.dir}/classes
  129.11 +build.classes.excludes=**/*.java,**/*.form
  129.12 +# This directory is removed when the project is cleaned:
  129.13 +build.dir=build
  129.14 +build.generated.dir=${build.dir}/generated
  129.15 +build.generated.sources.dir=${build.dir}/generated-sources
  129.16 +# Only compile against the classpath explicitly listed here:
  129.17 +build.sysclasspath=ignore
  129.18 +build.test.classes.dir=${build.dir}/test/classes
  129.19 +build.test.results.dir=${build.dir}/test/results
  129.20 +# Uncomment to specify the preferred debugger connection transport:
  129.21 +#debug.transport=dt_socket
  129.22 +debug.classpath=\
  129.23 +    ${run.classpath}
  129.24 +debug.test.classpath=\
  129.25 +    ${run.test.classpath}
  129.26 +# This directory is removed when the project is cleaned:
  129.27 +dist.dir=dist
  129.28 +dist.jar=${dist.dir}/type.web.api.jar
  129.29 +dist.javadoc.dir=${dist.dir}/javadoc
  129.30 +endorsed.classpath=
  129.31 +excludes=
  129.32 +file.reference.org-netbeans-api-java-classpath.jar=../../../../server/lib/org-netbeans-api-java-classpath.jar
  129.33 +file.reference.org-netbeans-modules-java-source.jar=../../../../server/lib/org-netbeans-modules-java-source.jar
  129.34 +file.reference.org-netbeans-modules-jumpto.jar=../../../../server/lib/org-netbeans-modules-jumpto.jar
  129.35 +file.reference.org-netbeans-modules-parsing-lucene.jar=../../../../server/lib/org-netbeans-modules-parsing-lucene.jar
  129.36 +file.reference.org-openide-filesystems.jar=../../../../server/lib/org-openide-filesystems.jar
  129.37 +file.reference.util-commons.jar-1=../../../ide/api/external/util-commons.jar
  129.38 +file.reference.util-pojson.jar-1=../../../ide/api/external/util-pojson.jar
  129.39 +includes=**
  129.40 +jar.compress=false
  129.41 +javac.classpath=\
  129.42 +    ${libs.lucene.classpath}:\
  129.43 +    ${libs.jersey.classpath}:\
  129.44 +    ${libs.freemarker.classpath}:\
  129.45 +    ${reference.base_web_api.jar}:\
  129.46 +    ${file.reference.org-netbeans-api-java-classpath.jar}:\
  129.47 +    ${file.reference.org-netbeans-modules-java-source.jar}:\
  129.48 +    ${file.reference.org-netbeans-modules-jumpto.jar}:\
  129.49 +    ${file.reference.org-netbeans-modules-parsing-lucene.jar}:\
  129.50 +    ${file.reference.org-openide-filesystems.jar}:\
  129.51 +    ${file.reference.util-commons.jar-1}:\
  129.52 +    ${file.reference.util-pojson.jar-1}
  129.53 +# Space-separated list of extra javac options
  129.54 +javac.compilerargs=
  129.55 +javac.deprecation=false
  129.56 +javac.processorpath=\
  129.57 +    ${javac.classpath}
  129.58 +javac.source=1.6
  129.59 +javac.target=1.6
  129.60 +javac.test.classpath=\
  129.61 +    ${javac.classpath}:\
  129.62 +    ${build.classes.dir}
  129.63 +javac.test.processorpath=\
  129.64 +    ${javac.test.classpath}
  129.65 +javadoc.additionalparam=
  129.66 +javadoc.author=false
  129.67 +javadoc.encoding=${source.encoding}
  129.68 +javadoc.noindex=false
  129.69 +javadoc.nonavbar=false
  129.70 +javadoc.notree=false
  129.71 +javadoc.private=false
  129.72 +javadoc.splitindex=true
  129.73 +javadoc.use=true
  129.74 +javadoc.version=false
  129.75 +javadoc.windowtitle=
  129.76 +main.class=type.web.api.TypeWebApi
  129.77 +manifest.file=manifest.mf
  129.78 +meta.inf.dir=${src.dir}/META-INF
  129.79 +mkdist.disabled=false
  129.80 +platform.active=default_platform
  129.81 +project.base_web_api=../base.web.api
  129.82 +reference.base_web_api.jar=${project.base_web_api}/dist/base.web.api.jar
  129.83 +run.classpath=\
  129.84 +    ${javac.classpath}:\
  129.85 +    ${build.classes.dir}
  129.86 +# Space-separated list of JVM arguments used when running the project
  129.87 +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
  129.88 +# or test-sys-prop.name=value to set system properties for unit tests):
  129.89 +run.jvmargs=
  129.90 +run.test.classpath=\
  129.91 +    ${javac.test.classpath}:\
  129.92 +    ${build.test.classes.dir}
  129.93 +source.encoding=UTF-8
  129.94 +src.dir=src
  129.95 +test.src.dir=test
   130.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   130.2 +++ b/remoting/server/web/type.web.api/nbproject/project.xml	Thu Jun 23 15:07:16 2011 +0200
   130.3 @@ -0,0 +1,28 @@
   130.4 +<?xml version="1.0" encoding="UTF-8"?>
   130.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
   130.6 +    <type>org.netbeans.modules.java.j2seproject</type>
   130.7 +    <configuration>
   130.8 +        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
   130.9 +            <name>type.web.api</name>
  130.10 +            <source-roots>
  130.11 +                <root id="src.dir"/>
  130.12 +            </source-roots>
  130.13 +            <test-roots>
  130.14 +                <root id="test.src.dir"/>
  130.15 +            </test-roots>
  130.16 +        </data>
  130.17 +        <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
  130.18 +            <definitions>../../../../server/lib/nblibraries.properties</definitions>
  130.19 +        </libraries>
  130.20 +        <references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
  130.21 +            <reference>
  130.22 +                <foreign-project>base_web_api</foreign-project>
  130.23 +                <artifact-type>jar</artifact-type>
  130.24 +                <script>build.xml</script>
  130.25 +                <target>jar</target>
  130.26 +                <clean-target>clean</clean-target>
  130.27 +                <id>jar</id>
  130.28 +            </reference>
  130.29 +        </references>
  130.30 +    </configuration>
  130.31 +</project>
   131.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   131.2 +++ b/remoting/server/web/type.web.api/src/org/netbeans/modules/jackpot30/backend/type/api/API.java	Thu Jun 23 15:07:16 2011 +0200
   131.3 @@ -0,0 +1,133 @@
   131.4 +/*
   131.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   131.6 + *
   131.7 + * Copyright 2009-2011 Sun Microsystems, Inc. All rights reserved.
   131.8 + *
   131.9 + * The contents of this file are subject to the terms of either the GNU
  131.10 + * General Public License Version 2 only ("GPL") or the Common
  131.11 + * Development and Distribution License("CDDL") (collectively, the
  131.12 + * "License"). You may not use this file except in compliance with the
  131.13 + * License. You can obtain a copy of the License at
  131.14 + * http://www.netbeans.org/cddl-gplv2.html
  131.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  131.16 + * specific language governing permissions and limitations under the
  131.17 + * License.  When distributing the software, include this License Header
  131.18 + * Notice in each file and include the License file at
  131.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  131.20 + * particular file as subject to the "Classpath" exception as provided
  131.21 + * by Sun in the GPL Version 2 section of the License file that
  131.22 + * accompanied this code. If applicable, add the following below the
  131.23 + * License Header, with the fields enclosed by brackets [] replaced by
  131.24 + * your own identifying information:
  131.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  131.26 + *
  131.27 + * If you wish your version of this file to be governed by only the CDDL
  131.28 + * or only the GPL Version 2, indicate your decision by adding
  131.29 + * "[Contributor] elects to include this software in this distribution
  131.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  131.31 + * single choice of license, a recipient has the option to distribute
  131.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  131.33 + * to extend the choice of license to its licensees as provided above.
  131.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  131.35 + * Version 2 license, then the option applies only if the new code is
  131.36 + * made subject to such option by the copyright holder.
  131.37 + *
  131.38 + * Contributor(s):
  131.39 + *
  131.40 + * Portions Copyrighted 2009-2011 Sun Microsystems, Inc.
  131.41 + */
  131.42 +
  131.43 +package org.netbeans.modules.jackpot30.backend.type.api;
  131.44 +
  131.45 +import java.io.IOException;
  131.46 +import java.net.URL;
  131.47 +import java.util.ArrayList;
  131.48 +import java.util.EnumSet;
  131.49 +import java.util.HashSet;
  131.50 +import java.util.LinkedHashMap;
  131.51 +import java.util.List;
  131.52 +import java.util.Map;
  131.53 +import java.util.Set;
  131.54 +import javax.lang.model.element.TypeElement;
  131.55 +import javax.ws.rs.DefaultValue;
  131.56 +import javax.ws.rs.GET;
  131.57 +import javax.ws.rs.Path;
  131.58 +import javax.ws.rs.Produces;
  131.59 +import javax.ws.rs.QueryParam;
  131.60 +import org.codeviation.pojson.Pojson;
  131.61 +import org.netbeans.api.java.classpath.ClassPath;
  131.62 +import org.netbeans.api.java.source.ClassIndex.NameKind;
  131.63 +import org.netbeans.api.java.source.ClassIndex.SearchScope;
  131.64 +import org.netbeans.api.java.source.ClasspathInfo;
  131.65 +import org.netbeans.api.java.source.ElementHandle;
  131.66 +import org.netbeans.modules.jackpot30.backend.base.CategoryStorage;
  131.67 +import org.netbeans.modules.java.source.usages.ClassIndexManager;
  131.68 +import org.netbeans.modules.jumpto.type.GoToTypeAction;
  131.69 +import org.netbeans.spi.java.classpath.support.ClassPathSupport;
  131.70 +
  131.71 +/**
  131.72 + *
  131.73 + * @author lahvac
  131.74 + */
  131.75 +@Path("/index/type")
  131.76 +public class API {
  131.77 +
  131.78 +    @GET
  131.79 +    @Path("/search")
  131.80 +    @Produces("text/plain")
  131.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 {
  131.82 +        assert !asynchronous;
  131.83 +
  131.84 +        //copied (and converted to NameKind) from jumpto's GoToTypeAction:
  131.85 +        boolean exact = prefix.endsWith(" "); // NOI18N
  131.86 +
  131.87 +        prefix = prefix.trim();
  131.88 +
  131.89 +        if ( prefix.length() == 0) {
  131.90 +            return "";
  131.91 +        }
  131.92 +
  131.93 +        NameKind nameKind;
  131.94 +        int wildcard = GoToTypeAction.containsWildCard(prefix);
  131.95 +
  131.96 +        if (exact) {
  131.97 +            //nameKind = panel.isCaseSensitive() ? SearchType.EXACT_NAME : SearchType.CASE_INSENSITIVE_EXACT_NAME;
  131.98 +            nameKind = NameKind.SIMPLE_NAME;
  131.99 +        }
 131.100 +        else if ((GoToTypeAction.isAllUpper(prefix) && prefix.length() > 1) || GoToTypeAction.isCamelCase(prefix)) {
 131.101 +            nameKind = NameKind.CAMEL_CASE;
 131.102 +        }
 131.103 +        else if (wildcard != -1) {
 131.104 +            nameKind = casesensitive ? NameKind.REGEXP : NameKind.CASE_INSENSITIVE_REGEXP;
 131.105 +        }
 131.106 +        else {
 131.107 +            nameKind = casesensitive ? NameKind.PREFIX : NameKind.CASE_INSENSITIVE_PREFIX;
 131.108 +        }
 131.109 +
 131.110 +        Map<String, List<String>> result = new LinkedHashMap<String, List<String>>();
 131.111 +        CategoryStorage srcRoots = CategoryStorage.forId(segment);
 131.112 +
 131.113 +        for (URL srcRoot : srcRoots.getCategoryIndexFolders()) {
 131.114 +            if (!"rel".equals(srcRoot.getProtocol())) continue;
 131.115 +            String rootId = srcRoot.getPath().substring(1);
 131.116 +            List<String> currentResult = new ArrayList<String>();
 131.117 +
 131.118 +            result.put(rootId, currentResult);
 131.119 +
 131.120 +            ClassIndexManager.getDefault().createUsagesQuery(srcRoot, true).isValid();
 131.121 +            ClasspathInfo cpInfo = ClasspathInfo.create(ClassPath.EMPTY, ClassPath.EMPTY, ClassPathSupport.createClassPath(srcRoot));
 131.122 +            Set<ElementHandle<TypeElement>> names = new HashSet<ElementHandle<TypeElement>>(cpInfo.getClassIndex().getDeclaredTypes(prefix, nameKind, EnumSet.of(SearchScope.SOURCE)));
 131.123 +
 131.124 +            if (nameKind == NameKind.CAMEL_CASE) {
 131.125 +                names.addAll(cpInfo.getClassIndex().getDeclaredTypes(prefix, NameKind.CASE_INSENSITIVE_PREFIX, EnumSet.of(SearchScope.SOURCE)));
 131.126 +            }
 131.127 +
 131.128 +            for (ElementHandle<TypeElement> d : names) {
 131.129 +                currentResult.add(d.getBinaryName());
 131.130 +            }
 131.131 +        }
 131.132 +
 131.133 +        return Pojson.save(result);
 131.134 +    }
 131.135 +
 131.136 +}
   132.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   132.2 +++ b/remoting/server/web/type.web.api/src/org/netbeans/modules/jackpot30/backend/type/ui/UI.java	Thu Jun 23 15:07:16 2011 +0200
   132.3 @@ -0,0 +1,141 @@
   132.4 +/*
   132.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   132.6 + *
   132.7 + * Copyright 2009-2011 Oracle and/or its affiliates. All rights reserved.
   132.8 + *
   132.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  132.10 + * Other names may be trademarks of their respective owners.
  132.11 + *
  132.12 + * The contents of this file are subject to the terms of either the GNU
  132.13 + * General Public License Version 2 only ("GPL") or the Common
  132.14 + * Development and Distribution License("CDDL") (collectively, the
  132.15 + * "License"). You may not use this file except in compliance with the
  132.16 + * License. You can obtain a copy of the License at
  132.17 + * http://www.netbeans.org/cddl-gplv2.html
  132.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  132.19 + * specific language governing permissions and limitations under the
  132.20 + * License.  When distributing the software, include this License Header
  132.21 + * Notice in each file and include the License file at
  132.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  132.23 + * particular file as subject to the "Classpath" exception as provided
  132.24 + * by Oracle in the GPL Version 2 section of the License file that
  132.25 + * accompanied this code. If applicable, add the following below the
  132.26 + * License Header, with the fields enclosed by brackets [] replaced by
  132.27 + * your own identifying information:
  132.28 + * "Portions Copyrighted [year] [name of copyright owner]"
  132.29 + *
  132.30 + * If you wish your version of this file to be governed by only the CDDL
  132.31 + * or only the GPL Version 2, indicate your decision by adding
  132.32 + * "[Contributor] elects to include this software in this distribution
  132.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  132.34 + * single choice of license, a recipient has the option to distribute
  132.35 + * your version of this file under either the CDDL, the GPL Version 2 or
  132.36 + * to extend the choice of license to its licensees as provided above.
  132.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  132.38 + * Version 2 license, then the option applies only if the new code is
  132.39 + * made subject to such option by the copyright holder.
  132.40 + *
  132.41 + * Contributor(s):
  132.42 + *
  132.43 + * Portions Copyrighted 2009-2011 Sun Microsystems, Inc.
  132.44 + */
  132.45 +
  132.46 +package org.netbeans.modules.jackpot30.backend.type.ui;
  132.47 +
  132.48 +import java.util.Comparator;
  132.49 +import java.util.LinkedHashMap;
  132.50 +import java.util.Map.Entry;
  132.51 +import freemarker.template.TemplateException;
  132.52 +import java.io.IOException;
  132.53 +import java.net.URI;
  132.54 +import java.net.URISyntaxException;
  132.55 +import java.util.Collections;
  132.56 +import java.util.HashMap;
  132.57 +import java.util.LinkedList;
  132.58 +import java.util.List;
  132.59 +import java.util.Map;
  132.60 +import javax.ws.rs.GET;
  132.61 +import javax.ws.rs.Path;
  132.62 +import javax.ws.rs.Produces;
  132.63 +import javax.ws.rs.QueryParam;
  132.64 +import org.codeviation.pojson.Pojson;
  132.65 +import org.netbeans.modules.jackpot30.backend.base.FreemarkerUtilities;
  132.66 +import org.netbeans.modules.jackpot30.backend.base.WebUtilities;
  132.67 +import static org.netbeans.modules.jackpot30.backend.base.WebUtilities.escapeForQuery;
  132.68 +
  132.69 +/**
  132.70 + *
  132.71 + * @author lahvac
  132.72 + */
  132.73 +@Path("/index/type/ui")
  132.74 +public class UI {
  132.75 +
  132.76 +    @GET
  132.77 +    @Path("/search")
  132.78 +    @Produces("text/html")
  132.79 +    public String searchType(@QueryParam("path") String path, @QueryParam("prefix") String prefix) throws URISyntaxException, IOException, TemplateException {
  132.80 +        Map<String, Object> configurationData = new HashMap<String, Object>();
  132.81 +
  132.82 +        configurationData.put("paths", list());
  132.83 +        configurationData.put("selectedPath", path);
  132.84 +        configurationData.put("prefix", prefix);
  132.85 +
  132.86 +        if (prefix != null && path != null) {
  132.87 +            URI u = new URI("http://localhost:9998/index/type/search?path=" + escapeForQuery(path) + "&prefix=" + escapeForQuery(prefix));
  132.88 +            long queryTime = System.currentTimeMillis();
  132.89 +            @SuppressWarnings("unchecked") //XXX: should not trust something got from the network!
  132.90 +            Map<String, List<String>> types = Pojson.load(LinkedHashMap.class, u);
  132.91 +            List<Map<String, Object>> results = new LinkedList<Map<String, Object>>();
  132.92 +
  132.93 +            queryTime = System.currentTimeMillis() - queryTime;
  132.94 +
  132.95 +            for (Entry<String, List<String>> e : types.entrySet()) {
  132.96 +                for (String fqn : e.getValue()) {
  132.97 +                    Map<String, Object> found = new HashMap<String, Object>(3);
  132.98 +
  132.99 +                    found.put("fqn", fqn);
 132.100 +
 132.101 +                    if (fqn.contains("$")) {
 132.102 +                        fqn = fqn.substring(0, fqn.indexOf("$"));
 132.103 +                    }
 132.104 +
 132.105 +                    found.put("relativePath", e.getKey() + /*"/" + */fqn.replace('.', '/') + ".java");
 132.106 +
 132.107 +                    results.add(found);
 132.108 +                }
 132.109 +            }
 132.110 +
 132.111 +            Collections.sort(results, new Comparator<Map<String, Object>>() {
 132.112 +                @Override public int compare(Map<String, Object> o1, Map<String, Object> o2) {
 132.113 +                    return ((String) o1.get("fqn")).compareTo((String) o2.get("fqn"));
 132.114 +                }
 132.115 +            });
 132.116 +            
 132.117 +            configurationData.put("results", results);
 132.118 +
 132.119 +            Map<String, Object> statistics = new HashMap<String, Object>();
 132.120 +
 132.121 +            statistics.put("queryTime", queryTime);
 132.122 +
 132.123 +            configurationData.put("statistics", statistics);
 132.124 +        }
 132.125 +
 132.126 +        return FreemarkerUtilities.processTemplate("org/netbeans/modules/jackpot30/backend/type/ui/ui-findType.html", configurationData);
 132.127 +    }
 132.128 +
 132.129 +    private static List<Map<String, String>> list() throws URISyntaxException {
 132.130 +        List<Map<String, String>> result = new LinkedList<Map<String, String>>();
 132.131 +
 132.132 +        for (String enc : WebUtilities.requestStringArrayResponse(new URI("http://localhost:9998/index/list"))) {
 132.133 +            Map<String, String> rootDesc = new HashMap<String, String>();
 132.134 +            String[] col = enc.split(":", 2);
 132.135 +
 132.136 +            rootDesc.put("segment", col[0]);
 132.137 +            rootDesc.put("displayName", col[1]);
 132.138 +            result.add(rootDesc);
 132.139 +        }
 132.140 +
 132.141 +        return result;
 132.142 +    }
 132.143 +    
 132.144 +}
   133.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   133.2 +++ b/remoting/server/web/type.web.api/src/org/netbeans/modules/jackpot30/backend/type/ui/ui-findType.html	Thu Jun 23 15:07:16 2011 +0200
   133.3 @@ -0,0 +1,28 @@
   133.4 +<html>
   133.5 +<head>
   133.6 +    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
   133.7 +</head>
   133.8 +<body>
   133.9 +<form method="get">
  133.10 +<label for="path">Project:</label>
  133.11 +<select size="1" name="path">");
  133.12 +    <#list paths as path>
  133.13 +        <option <#if selectedPath?? && path.segment == selectedPath>selected</#if> value="${path.segment}">
  133.14 +            ${path.displayName}
  133.15 +        </option>
  133.16 +    </#list>
  133.17 +</select>
  133.18 +<br>
  133.19 +<label for="prefix">Type Name:</label><input type="text" name="prefix"<#if prefix??>value="${prefix}"</#if>/><br>
  133.20 +<input type="submit" name="Find Candidates"/>
  133.21 +</form>
  133.22 +
  133.23 +<#if results??>
  133.24 +    Found types:<br>
  133.25 +    <#list results as result>
  133.26 +        <a href="/index/ui/show?path=${selectedPath}&relative=${result.relativePath}">${result.fqn}</a><br>
  133.27 +    </#list>
  133.28 +</#if>
  133.29 +
  133.30 +</body>
  133.31 +</html>
   134.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   134.2 +++ b/remoting/server/web/web.main/build.xml	Thu Jun 23 15:07:16 2011 +0200
   134.3 @@ -0,0 +1,74 @@
   134.4 +<?xml version="1.0" encoding="UTF-8"?>
   134.5 +<!-- You may freely edit this file. See commented blocks below for -->
   134.6 +<!-- some examples of how to customize the build. -->
   134.7 +<!-- (If you delete it and reopen the project it will be recreated.) -->
   134.8 +<!-- By default, only the Clean and Build commands use this build script. -->
   134.9 +<!-- Commands such as Run, Debug, and Test only use this build script if -->
  134.10 +<!-- the Compile on Save feature is turned off for the project. -->
  134.11 +<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
  134.12 +<!-- in the project's Project Properties dialog box.-->
  134.13 +<project name="web.main" default="default" basedir=".">
  134.14 +    <description>Builds, tests, and runs the project web.main.</description>
  134.15 +    <import file="nbproject/build-impl.xml"/>
  134.16 +    <!--
  134.17 +
  134.18 +    There exist several targets which are by default empty and which can be 
  134.19 +    used for execution of your tasks. These targets are usually executed 
  134.20 +    before and after some main targets. They are: 
  134.21 +
  134.22 +      -pre-init:                 called before initialization of project properties
  134.23 +      -post-init:                called after initialization of project properties
  134.24 +      -pre-compile:              called before javac compilation
  134.25 +      -post-compile:             called after javac compilation
  134.26 +      -pre-compile-single:       called before javac compilation of single file
  134.27 +      -post-compile-single:      called after javac compilation of single file
  134.28 +      -pre-compile-test:         called before javac compilation of JUnit tests
  134.29 +      -post-compile-test:        called after javac compilation of JUnit tests
  134.30 +      -pre-compile-test-single:  called before javac compilation of single JUnit test
  134.31 +      -post-compile-test-single: called after javac compilation of single JUunit test
  134.32 +      -pre-jar:                  called before JAR building
  134.33 +      -post-jar:                 called after JAR building
  134.34 +      -post-clean:               called after cleaning build products
  134.35 +
  134.36 +    (Targets beginning with '-' are not intended to be called on their own.)
  134.37 +
  134.38 +    Example of inserting an obfuscator after compilation could look like this:
  134.39 +
  134.40 +        <target name="-post-compile">
  134.41 +            <obfuscate>
  134.42 +                <fileset dir="${build.classes.dir}"/>
  134.43 +            </obfuscate>
  134.44 +        </target>
  134.45 +
  134.46 +    For list of available properties check the imported 
  134.47 +    nbproject/build-impl.xml file. 
  134.48 +
  134.49 +
  134.50 +    Another way to customize the build is by overriding existing main targets.
  134.51 +    The targets of interest are: 
  134.52 +
  134.53 +      -init-macrodef-javac:     defines macro for javac compilation
  134.54 +      -init-macrodef-junit:     defines macro for junit execution
  134.55 +      -init-macrodef-debug:     defines macro for class debugging
  134.56 +      -init-macrodef-java:      defines macro for class execution
  134.57 +      -do-jar-with-manifest:    JAR building (if you are using a manifest)
  134.58 +      -do-jar-without-manifest: JAR building (if you are not using a manifest)
  134.59 +      run:                      execution of project 
  134.60 +      -javadoc-build:           Javadoc generation
  134.61 +      test-report:              JUnit report generation
  134.62 +
  134.63 +    An example of overriding the target for project execution could look like this:
  134.64 +
  134.65 +        <target name="run" depends="web.main-impl.jar">
  134.66 +            <exec dir="bin" executable="launcher.exe">
  134.67 +                <arg file="${dist.jar}"/>
  134.68 +            </exec>
  134.69 +        </target>
  134.70 +
  134.71 +    Notice that the overridden target depends on the jar target and not only on 
  134.72 +    the compile target as the regular run target does. Again, for a list of available 
  134.73 +    properties which you can use, check the target you are overriding in the
  134.74 +    nbproject/build-impl.xml file. 
  134.75 +
  134.76 +    -->
  134.77 +</project>
   135.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   135.2 +++ b/remoting/server/web/web.main/manifest.mf	Thu Jun 23 15:07:16 2011 +0200
   135.3 @@ -0,0 +1,3 @@
   135.4 +Manifest-Version: 1.0
   135.5 +X-COMMENT: Main-Class will be added automatically by build
   135.6 +
   136.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   136.2 +++ b/remoting/server/web/web.main/nbproject/build-impl.xml	Thu Jun 23 15:07:16 2011 +0200
   136.3 @@ -0,0 +1,1096 @@
   136.4 +<?xml version="1.0" encoding="UTF-8"?>
   136.5 +<!--
   136.6 +*** GENERATED FROM project.xml - DO NOT EDIT  ***
   136.7 +***         EDIT ../build.xml INSTEAD         ***
   136.8 +
   136.9 +For the purpose of easier reading the script
  136.10 +is divided into following sections:
  136.11 +
  136.12 +  - initialization
  136.13 +  - compilation
  136.14 +  - jar
  136.15 +  - execution
  136.16 +  - debugging
  136.17 +  - javadoc
  136.18 +  - junit compilation
  136.19 +  - junit execution
  136.20 +  - junit debugging
  136.21 +  - applet
  136.22 +  - cleanup
  136.23 +
  136.24 +        -->
  136.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">
  136.26 +    <fail message="Please build using Ant 1.8.0 or higher.">
  136.27 +        <condition>
  136.28 +            <not>
  136.29 +                <antversion atleast="1.8.0"/>
  136.30 +            </not>
  136.31 +        </condition>
  136.32 +    </fail>
  136.33 +    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
  136.34 +    <!-- 
  136.35 +                ======================
  136.36 +                INITIALIZATION SECTION 
  136.37 +                ======================
  136.38 +            -->
  136.39 +    <target name="-pre-init">
  136.40 +        <!-- Empty placeholder for easier customization. -->
  136.41 +        <!-- You can override this target in the ../build.xml file. -->
  136.42 +    </target>
  136.43 +    <target depends="-pre-init" name="-init-private">
  136.44 +        <property file="nbproject/private/config.properties"/>
  136.45 +        <property file="nbproject/private/configs/${config}.properties"/>
  136.46 +        <property file="nbproject/private/private.properties"/>
  136.47 +    </target>
  136.48 +    <target name="-pre-init-libraries">
  136.49 +        <property location="../../../../server/lib/nblibraries.properties" name="libraries.path"/>
  136.50 +        <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
  136.51 +        <pathconvert dirsep="/" property="libraries.dir">
  136.52 +            <path path="${libraries.dir.nativedirsep}"/>
  136.53 +        </pathconvert>
  136.54 +        <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
  136.55 +        <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
  136.56 +    </target>
  136.57 +    <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
  136.58 +        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
  136.59 +            <filterchain>
  136.60 +                <replacestring from="$${base}" to="${libraries.dir}"/>
  136.61 +                <escapeunicode/>
  136.62 +            </filterchain>
  136.63 +        </loadproperties>
  136.64 +    </target>
  136.65 +    <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
  136.66 +        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
  136.67 +            <filterchain>
  136.68 +                <replacestring from="$${base}" to="${libraries.dir}"/>
  136.69 +                <escapeunicode/>
  136.70 +            </filterchain>
  136.71 +        </loadproperties>
  136.72 +    </target>
  136.73 +    <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
  136.74 +        <property file="${user.properties.file}"/>
  136.75 +        <!-- The two properties below are usually overridden -->
  136.76 +        <!-- by the active platform. Just a fallback. -->
  136.77 +        <property name="default.javac.source" value="1.4"/>
  136.78 +        <property name="default.javac.target" value="1.4"/>
  136.79 +    </target>
  136.80 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
  136.81 +        <property file="nbproject/configs/${config}.properties"/>
  136.82 +        <property file="nbproject/project.properties"/>
  136.83 +    </target>
  136.84 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
  136.85 +        <available file="${manifest.file}" property="manifest.available"/>
  136.86 +        <condition property="splashscreen.available">
  136.87 +            <and>
  136.88 +                <not>
  136.89 +                    <equals arg1="${application.splash}" arg2="" trim="true"/>
  136.90 +                </not>
  136.91 +                <available file="${application.splash}"/>
  136.92 +            </and>
  136.93 +        </condition>
  136.94 +        <condition property="main.class.available">
  136.95 +            <and>
  136.96 +                <isset property="main.class"/>
  136.97 +                <not>
  136.98 +                    <equals arg1="${main.class}" arg2="" trim="true"/>
  136.99 +                </not>
 136.100 +            </and>
 136.101 +        </condition>
 136.102 +        <condition property="manifest.available+main.class">
 136.103 +            <and>
 136.104 +                <isset property="manifest.available"/>
 136.105 +                <isset property="main.class.available"/>
 136.106 +            </and>
 136.107 +        </condition>
 136.108 +        <condition property="do.archive">
 136.109 +            <not>
 136.110 +                <istrue value="${jar.archive.disabled}"/>
 136.111 +            </not>
 136.112 +        </condition>
 136.113 +        <condition property="do.mkdist">
 136.114 +            <and>
 136.115 +                <isset property="do.archive"/>
 136.116 +                <isset property="libs.CopyLibs.classpath"/>
 136.117 +                <not>
 136.118 +                    <istrue value="${mkdist.disabled}"/>
 136.119 +                </not>
 136.120 +            </and>
 136.121 +        </condition>
 136.122 +        <condition property="manifest.available+main.class+mkdist.available">
 136.123 +            <and>
 136.124 +                <istrue value="${manifest.available+main.class}"/>
 136.125 +                <isset property="do.mkdist"/>
 136.126 +            </and>
 136.127 +        </condition>
 136.128 +        <condition property="do.archive+manifest.available">
 136.129 +            <and>
 136.130 +                <isset property="manifest.available"/>
 136.131 +                <istrue value="${do.archive}"/>
 136.132 +            </and>
 136.133 +        </condition>
 136.134 +        <condition property="do.archive+main.class.available">
 136.135 +            <and>
 136.136 +                <isset property="main.class.available"/>
 136.137 +                <istrue value="${do.archive}"/>
 136.138 +            </and>
 136.139 +        </condition>
 136.140 +        <condition property="do.archive+splashscreen.available">
 136.141 +            <and>
 136.142 +                <isset property="splashscreen.available"/>
 136.143 +                <istrue value="${do.archive}"/>
 136.144 +            </and>
 136.145 +        </condition>
 136.146 +        <condition property="do.archive+manifest.available+main.class">
 136.147 +            <and>
 136.148 +                <istrue value="${manifest.available+main.class}"/>
 136.149 +                <istrue value="${do.archive}"/>
 136.150 +            </and>
 136.151 +        </condition>
 136.152 +        <condition property="manifest.available-mkdist.available">
 136.153 +            <or>
 136.154 +                <istrue value="${manifest.available}"/>
 136.155 +                <isset property="do.mkdist"/>
 136.156 +            </or>
 136.157 +        </condition>
 136.158 +        <condition property="manifest.available+main.class-mkdist.available">
 136.159 +            <or>
 136.160 +                <istrue value="${manifest.available+main.class}"/>
 136.161 +                <isset property="do.mkdist"/>
 136.162 +            </or>
 136.163 +        </condition>
 136.164 +        <condition property="have.tests">
 136.165 +            <or>
 136.166 +                <available file="${test.src.dir}"/>
 136.167 +            </or>
 136.168 +        </condition>
 136.169 +        <condition property="have.sources">
 136.170 +            <or>
 136.171 +                <available file="${src.dir}"/>
 136.172 +            </or>
 136.173 +        </condition>
 136.174 +        <condition property="netbeans.home+have.tests">
 136.175 +            <and>
 136.176 +                <isset property="netbeans.home"/>
 136.177 +                <isset property="have.tests"/>
 136.178 +            </and>
 136.179 +        </condition>
 136.180 +        <condition property="no.javadoc.preview">
 136.181 +            <and>
 136.182 +                <isset property="javadoc.preview"/>
 136.183 +                <isfalse value="${javadoc.preview}"/>
 136.184 +            </and>
 136.185 +        </condition>
 136.186 +        <property name="run.jvmargs" value=""/>
 136.187 +        <property name="javac.compilerargs" value=""/>
 136.188 +        <property name="work.dir" value="${basedir}"/>
 136.189 +        <condition property="no.deps">
 136.190 +            <and>
 136.191 +                <istrue value="${no.dependencies}"/>
 136.192 +            </and>
 136.193 +        </condition>
 136.194 +        <property name="javac.debug" value="true"/>
 136.195 +        <property name="javadoc.preview" value="true"/>
 136.196 +        <property name="application.args" value=""/>
 136.197 +        <property name="source.encoding" value="${file.encoding}"/>
 136.198 +        <property name="runtime.encoding" value="${source.encoding}"/>
 136.199 +        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
 136.200 +            <and>
 136.201 +                <isset property="javadoc.encoding"/>
 136.202 +                <not>
 136.203 +                    <equals arg1="${javadoc.encoding}" arg2=""/>
 136.204 +                </not>
 136.205 +            </and>
 136.206 +        </condition>
 136.207 +        <property name="javadoc.encoding.used" value="${source.encoding}"/>
 136.208 +        <property name="includes" value="**"/>
 136.209 +        <property name="excludes" value=""/>
 136.210 +        <property name="do.depend" value="false"/>
 136.211 +        <condition property="do.depend.true">
 136.212 +            <istrue value="${do.depend}"/>
 136.213 +        </condition>
 136.214 +        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
 136.215 +        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
 136.216 +            <length length="0" string="${endorsed.classpath}" when="greater"/>
 136.217 +        </condition>
 136.218 +        <condition else="false" property="jdkBug6558476">
 136.219 +            <and>
 136.220 +                <matches pattern="1\.[56]" string="${java.specification.version}"/>
 136.221 +                <not>
 136.222 +                    <os family="unix"/>
 136.223 +                </not>
 136.224 +            </and>
 136.225 +        </condition>
 136.226 +        <property name="javac.fork" value="${jdkBug6558476}"/>
 136.227 +        <property name="jar.index" value="false"/>
 136.228 +        <property name="jar.index.metainf" value="${jar.index}"/>
 136.229 +        <property name="copylibs.rebase" value="true"/>
 136.230 +        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
 136.231 +    </target>
 136.232 +    <target name="-post-init">
 136.233 +        <!-- Empty placeholder for easier customization. -->
 136.234 +        <!-- You can override this target in the ../build.xml file. -->
 136.235 +    </target>
 136.236 +    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
 136.237 +        <fail unless="src.dir">Must set src.dir</fail>
 136.238 +        <fail unless="test.src.dir">Must set test.src.dir</fail>
 136.239 +        <fail unless="build.dir">Must set build.dir</fail>
 136.240 +        <fail unless="dist.dir">Must set dist.dir</fail>
 136.241 +        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
 136.242 +        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
 136.243 +        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
 136.244 +        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
 136.245 +        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
 136.246 +        <fail unless="dist.jar">Must set dist.jar</fail>
 136.247 +    </target>
 136.248 +    <target name="-init-macrodef-property">
 136.249 +        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
 136.250 +            <attribute name="name"/>
 136.251 +            <attribute name="value"/>
 136.252 +            <sequential>
 136.253 +                <property name="@{name}" value="${@{value}}"/>
 136.254 +            </sequential>
 136.255 +        </macrodef>
 136.256 +    </target>
 136.257 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
 136.258 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
 136.259 +            <attribute default="${src.dir}" name="srcdir"/>
 136.260 +            <attribute default="${build.classes.dir}" name="destdir"/>
 136.261 +            <attribute default="${javac.classpath}" name="classpath"/>
 136.262 +            <attribute default="${javac.processorpath}" name="processorpath"/>
 136.263 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
 136.264 +            <attribute default="${includes}" name="includes"/>
 136.265 +            <attribute default="${excludes}" name="excludes"/>
 136.266 +            <attribute default="${javac.debug}" name="debug"/>
 136.267 +            <attribute default="${empty.dir}" name="sourcepath"/>
 136.268 +            <attribute default="${empty.dir}" name="gensrcdir"/>
 136.269 +            <element name="customize" optional="true"/>
 136.270 +            <sequential>
 136.271 +                <property location="${build.dir}/empty" name="empty.dir"/>
 136.272 +                <mkdir dir="${empty.dir}"/>
 136.273 +                <mkdir dir="@{apgeneratedsrcdir}"/>
 136.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}">
 136.275 +                    <src>
 136.276 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
 136.277 +                            <include name="*"/>
 136.278 +                        </dirset>
 136.279 +                    </src>
 136.280 +                    <classpath>
 136.281 +                        <path path="@{classpath}"/>
 136.282 +                    </classpath>
 136.283 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
 136.284 +                    <compilerarg line="${javac.compilerargs}"/>
 136.285 +                    <compilerarg value="-processorpath"/>
 136.286 +                    <compilerarg path="@{processorpath}:${empty.dir}"/>
 136.287 +                    <compilerarg line="${ap.processors.internal}"/>
 136.288 +                    <compilerarg line="${annotation.processing.processor.options}"/>
 136.289 +                    <compilerarg value="-s"/>
 136.290 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
 136.291 +                    <compilerarg line="${ap.proc.none.internal}"/>
 136.292 +                    <customize/>
 136.293 +                </javac>
 136.294 +            </sequential>
 136.295 +        </macrodef>
 136.296 +    </target>
 136.297 +    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
 136.298 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
 136.299 +            <attribute default="${src.dir}" name="srcdir"/>
 136.300 +            <attribute default="${build.classes.dir}" name="destdir"/>
 136.301 +            <attribute default="${javac.classpath}" name="classpath"/>
 136.302 +            <attribute default="${javac.processorpath}" name="processorpath"/>
 136.303 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
 136.304 +            <attribute default="${includes}" name="includes"/>
 136.305 +            <attribute default="${excludes}" name="excludes"/>
 136.306 +            <attribute default="${javac.debug}" name="debug"/>
 136.307 +            <attribute default="${empty.dir}" name="sourcepath"/>
 136.308 +            <attribute default="${empty.dir}" name="gensrcdir"/>
 136.309 +            <element name="customize" optional="true"/>
 136.310 +            <sequential>
 136.311 +                <property location="${build.dir}/empty" name="empty.dir"/>
 136.312 +                <mkdir dir="${empty.dir}"/>
 136.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}">
 136.314 +                    <src>
 136.315 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
 136.316 +                            <include name="*"/>
 136.317 +                        </dirset>
 136.318 +                    </src>
 136.319 +                    <classpath>
 136.320 +                        <path path="@{classpath}"/>
 136.321 +                    </classpath>
 136.322 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
 136.323 +                    <compilerarg line="${javac.compilerargs}"/>
 136.324 +                    <customize/>
 136.325 +                </javac>
 136.326 +            </sequential>
 136.327 +        </macrodef>
 136.328 +    </target>
 136.329 +    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
 136.330 +        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
 136.331 +            <attribute default="${src.dir}" name="srcdir"/>
 136.332 +            <attribute default="${build.classes.dir}" name="destdir"/>
 136.333 +            <attribute default="${javac.classpath}" name="classpath"/>
 136.334 +            <sequential>
 136.335 +                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
 136.336 +                    <classpath>
 136.337 +                        <path path="@{classpath}"/>
 136.338 +                    </classpath>
 136.339 +                </depend>
 136.340 +            </sequential>
 136.341 +        </macrodef>
 136.342 +        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
 136.343 +            <attribute default="${build.classes.dir}" name="destdir"/>
 136.344 +            <sequential>
 136.345 +                <fail unless="javac.includes">Must set javac.includes</fail>
 136.346 +                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
 136.347 +                    <path>
 136.348 +                        <filelist dir="@{destdir}" files="${javac.includes}"/>
 136.349 +                    </path>
 136.350 +                    <globmapper from="*.java" to="*.class"/>
 136.351 +                </pathconvert>
 136.352 +                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
 136.353 +                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
 136.354 +                <delete>
 136.355 +                    <files includesfile="${javac.includesfile.binary}"/>
 136.356 +                </delete>
 136.357 +                <delete>
 136.358 +                    <fileset file="${javac.includesfile.binary}"/>
 136.359 +                </delete>
 136.360 +            </sequential>
 136.361 +        </macrodef>
 136.362 +    </target>
 136.363 +    <target name="-init-macrodef-junit">
 136.364 +        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
 136.365 +            <attribute default="${includes}" name="includes"/>
 136.366 +            <attribute default="${excludes}" name="excludes"/>
 136.367 +            <attribute default="**" name="testincludes"/>
 136.368 +            <sequential>
 136.369 +                <property name="junit.forkmode" value="perTest"/>
 136.370 +                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
 136.371 +                    <batchtest todir="${build.test.results.dir}">
 136.372 +                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
 136.373 +                            <filename name="@{testincludes}"/>
 136.374 +                        </fileset>
 136.375 +                    </batchtest>
 136.376 +                    <classpath>
 136.377 +                        <path path="${run.test.classpath}"/>
 136.378 +                    </classpath>
 136.379 +                    <syspropertyset>
 136.380 +                        <propertyref prefix="test-sys-prop."/>
 136.381 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
 136.382 +                    </syspropertyset>
 136.383 +                    <formatter type="brief" usefile="false"/>
 136.384 +                    <formatter type="xml"/>
 136.385 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
 136.386 +                    <jvmarg value="-ea"/>
 136.387 +                    <jvmarg line="${run.jvmargs}"/>
 136.388 +                </junit>
 136.389 +            </sequential>
 136.390 +        </macrodef>
 136.391 +    </target>
 136.392 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
 136.393 +    <target name="-profile-pre-init">
 136.394 +        <!-- Empty placeholder for easier customization. -->
 136.395 +        <!-- You can override this target in the ../build.xml file. -->
 136.396 +    </target>
 136.397 +    <target name="-profile-post-init">
 136.398 +        <!-- Empty placeholder for easier customization. -->
 136.399 +        <!-- You can override this target in the ../build.xml file. -->
 136.400 +    </target>
 136.401 +    <target name="-profile-init-macrodef-profile">
 136.402 +        <macrodef name="resolve">
 136.403 +            <attribute name="name"/>
 136.404 +            <attribute name="value"/>
 136.405 +            <sequential>
 136.406 +                <property name="@{name}" value="${env.@{value}}"/>
 136.407 +            </sequential>
 136.408 +        </macrodef>
 136.409 +        <macrodef name="profile">
 136.410 +            <attribute default="${main.class}" name="classname"/>
 136.411 +            <element name="customize" optional="true"/>
 136.412 +            <sequential>
 136.413 +                <property environment="env"/>
 136.414 +                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
 136.415 +                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
 136.416 +                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
 136.417 +                    <jvmarg line="${profiler.info.jvmargs}"/>
 136.418 +                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
 136.419 +                    <arg line="${application.args}"/>
 136.420 +                    <classpath>
 136.421 +                        <path path="${run.classpath}"/>
 136.422 +                    </classpath>
 136.423 +                    <syspropertyset>
 136.424 +                        <propertyref prefix="run-sys-prop."/>
 136.425 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
 136.426 +                    </syspropertyset>
 136.427 +                    <customize/>
 136.428 +                </java>
 136.429 +            </sequential>
 136.430 +        </macrodef>
 136.431 +    </target>
 136.432 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
 136.433 +        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
 136.434 +        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
 136.435 +    </target>
 136.436 +    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
 136.437 +        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
 136.438 +            <attribute default="${main.class}" name="name"/>
 136.439 +            <attribute default="${debug.classpath}" name="classpath"/>
 136.440 +            <attribute default="" name="stopclassname"/>
 136.441 +            <sequential>
 136.442 +                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
 136.443 +                    <classpath>
 136.444 +                        <path path="@{classpath}"/>
 136.445 +                    </classpath>
 136.446 +                </nbjpdastart>
 136.447 +            </sequential>
 136.448 +        </macrodef>
 136.449 +        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
 136.450 +            <attribute default="${build.classes.dir}" name="dir"/>
 136.451 +            <sequential>
 136.452 +                <nbjpdareload>
 136.453 +                    <fileset dir="@{dir}" includes="${fix.classes}">
 136.454 +                        <include name="${fix.includes}*.class"/>
 136.455 +                    </fileset>
 136.456 +                </nbjpdareload>
 136.457 +            </sequential>
 136.458 +        </macrodef>
 136.459 +    </target>
 136.460 +    <target name="-init-debug-args">
 136.461 +        <property name="version-output" value="java version &quot;${ant.java.version}"/>
 136.462 +        <condition property="have-jdk-older-than-1.4">
 136.463 +            <or>
 136.464 +                <contains string="${version-output}" substring="java version &quot;1.0"/>
 136.465 +                <contains string="${version-output}" substring="java version &quot;1.1"/>
 136.466 +                <contains string="${version-output}" substring="java version &quot;1.2"/>
 136.467 +                <contains string="${version-output}" substring="java version &quot;1.3"/>
 136.468 +            </or>
 136.469 +        </condition>
 136.470 +        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
 136.471 +            <istrue value="${have-jdk-older-than-1.4}"/>
 136.472 +        </condition>
 136.473 +        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
 136.474 +            <os family="windows"/>
 136.475 +        </condition>
 136.476 +        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
 136.477 +            <isset property="debug.transport"/>
 136.478 +        </condition>
 136.479 +    </target>
 136.480 +    <target depends="-init-debug-args" name="-init-macrodef-debug">
 136.481 +        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
 136.482 +            <attribute default="${main.class}" name="classname"/>
 136.483 +            <attribute default="${debug.classpath}" name="classpath"/>
 136.484 +            <element name="customize" optional="true"/>
 136.485 +            <sequential>
 136.486 +                <java classname="@{classname}" dir="${work.dir}" fork="true">
 136.487 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
 136.488 +                    <jvmarg line="${debug-args-line}"/>
 136.489 +                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
 136.490 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
 136.491 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
 136.492 +                    <jvmarg line="${run.jvmargs}"/>
 136.493 +                    <classpath>
 136.494 +                        <path path="@{classpath}"/>
 136.495 +                    </classpath>
 136.496 +                    <syspropertyset>
 136.497 +                        <propertyref prefix="run-sys-prop."/>
 136.498 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
 136.499 +                    </syspropertyset>
 136.500 +                    <customize/>
 136.501 +                </java>
 136.502 +            </sequential>
 136.503 +        </macrodef>
 136.504 +    </target>
 136.505 +    <target name="-init-macrodef-java">
 136.506 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
 136.507 +            <attribute default="${main.class}" name="classname"/>
 136.508 +            <attribute default="${run.classpath}" name="classpath"/>
 136.509 +            <element name="customize" optional="true"/>
 136.510 +            <sequential>
 136.511 +                <java classname="@{classname}" dir="${work.dir}" fork="true">
 136.512 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
 136.513 +                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
 136.514 +                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
 136.515 +                    <jvmarg line="${run.jvmargs}"/>
 136.516 +                    <classpath>
 136.517 +                        <path path="@{classpath}"/>
 136.518 +                    </classpath>
 136.519 +                    <syspropertyset>
 136.520 +                        <propertyref prefix="run-sys-prop."/>
 136.521 +                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
 136.522 +                    </syspropertyset>
 136.523 +                    <customize/>
 136.524 +                </java>
 136.525 +            </sequential>
 136.526 +        </macrodef>
 136.527 +    </target>
 136.528 +    <target name="-init-macrodef-copylibs">
 136.529 +        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
 136.530 +            <attribute default="${manifest.file}" name="manifest"/>
 136.531 +            <element name="customize" optional="true"/>
 136.532 +            <sequential>
 136.533 +                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
 136.534 +                <pathconvert property="run.classpath.without.build.classes.dir">
 136.535 +                    <path path="${run.classpath}"/>
 136.536 +                    <map from="${build.classes.dir.resolved}" to=""/>
 136.537 +                </pathconvert>
 136.538 +                <pathconvert pathsep=" " property="jar.classpath">
 136.539 +                    <path path="${run.classpath.without.build.classes.dir}"/>
 136.540 +                    <chainedmapper>
 136.541 +                        <flattenmapper/>
 136.542 +                        <globmapper from="*" to="lib/*"/>
 136.543 +                    </chainedmapper>
 136.544 +                </pathconvert>
 136.545 +                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
 136.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}">
 136.547 +                    <fileset dir="${build.classes.dir}"/>
 136.548 +                    <manifest>
 136.549 +                        <attribute name="Class-Path" value="${jar.classpath}"/>
 136.550 +                        <customize/>
 136.551 +                    </manifest>
 136.552 +                </copylibs>
 136.553 +            </sequential>
 136.554 +        </macrodef>
 136.555 +    </target>
 136.556 +    <target name="-init-presetdef-jar">
 136.557 +        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
 136.558 +            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
 136.559 +                <j2seproject1:fileset dir="${build.classes.dir}"/>
 136.560 +            </jar>
 136.561 +        </presetdef>
 136.562 +    </target>
 136.563 +    <target name="-init-ap-cmdline-properties">
 136.564 +        <property name="annotation.processing.enabled" value="true"/>
 136.565 +        <property name="annotation.processing.processors.list" value=""/>
 136.566 +        <property name="annotation.processing.processor.options" value=""/>
 136.567 +        <property name="annotation.processing.run.all.processors" value="true"/>
 136.568 +        <property name="javac.processorpath" value="${javac.classpath}"/>
 136.569 +        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
 136.570 +        <condition property="ap.supported.internal" value="true">
 136.571 +            <not>
 136.572 +                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
 136.573 +            </not>
 136.574 +        </condition>
 136.575 +    </target>
 136.576 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
 136.577 +        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
 136.578 +            <isfalse value="${annotation.processing.run.all.processors}"/>
 136.579 +        </condition>
 136.580 +        <condition else="" property="ap.proc.none.internal" value="-proc:none">
 136.581 +            <isfalse value="${annotation.processing.enabled}"/>
 136.582 +        </condition>
 136.583 +    </target>
 136.584 +    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
 136.585 +        <property name="ap.cmd.line.internal" value=""/>
 136.586 +    </target>
 136.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"/>
 136.588 +    <!--
 136.589 +                ===================
 136.590 +                COMPILATION SECTION
 136.591 +                ===================
 136.592 +            -->
 136.593 +    <target name="-deps-jar-init" unless="built-jar.properties">
 136.594 +        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
 136.595 +        <delete file="${built-jar.properties}" quiet="true"/>
 136.596 +    </target>
 136.597 +    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
 136.598 +        <echo level="warn" message="Cycle detected: web.main was already built"/>
 136.599 +    </target>
 136.600 +    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
 136.601 +        <mkdir dir="${build.dir}"/>
 136.602 +        <touch file="${built-jar.properties}" verbose="false"/>
 136.603 +        <property file="${built-jar.properties}" prefix="already.built.jar."/>
 136.604 +        <antcall target="-warn-already-built-jar"/>
 136.605 +        <propertyfile file="${built-jar.properties}">
 136.606 +            <entry key="${basedir}" value=""/>
 136.607 +        </propertyfile>
 136.608 +        <antcall target="-maybe-call-dep">
 136.609 +            <param name="call.built.properties" value="${built-jar.properties}"/>
 136.610 +            <param location="${project.base_web_api}" name="call.subproject"/>
 136.611 +            <param location="${project.base_web_api}/build.xml" name="call.script"/>
 136.612 +            <param name="call.target" value="jar"/>
 136.613 +            <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
 136.614 +        </antcall>
 136.615 +        <antcall target="-maybe-call-dep">
 136.616 +            <param name="call.built.properties" value="${built-jar.properties}"/>
 136.617 +            <param location="${project.type_web_api}" name="call.subproject"/>
 136.618 +            <param location="${project.type_web_api}/build.xml" name="call.script"/>
 136.619 +            <param name="call.target" value="jar"/>
 136.620 +            <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
 136.621 +        </antcall>
 136.622 +    </target>
 136.623 +    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
 136.624 +    <target depends="init" name="-check-automatic-build">
 136.625 +        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
 136.626 +    </target>
 136.627 +    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
 136.628 +        <antcall target="clean"/>
 136.629 +    </target>
 136.630 +    <target depends="init,deps-jar" name="-pre-pre-compile">
 136.631 +        <mkdir dir="${build.classes.dir}"/>
 136.632 +    </target>
 136.633 +    <target name="-pre-compile">
 136.634 +        <!-- Empty placeholder for easier customization. -->
 136.635 +        <!-- You can override this target in the ../build.xml file. -->
 136.636 +    </target>
 136.637 +    <target if="do.depend.true" name="-compile-depend">
 136.638 +        <pathconvert property="build.generated.subdirs">
 136.639 +            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 136.640 +                <include name="*"/>
 136.641 +            </dirset>
 136.642 +        </pathconvert>
 136.643 +        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
 136.644 +    </target>
 136.645 +    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
 136.646 +        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
 136.647 +        <copy todir="${build.classes.dir}">
 136.648 +            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 136.649 +        </copy>
 136.650 +    </target>
 136.651 +    <target if="has.persistence.xml" name="-copy-persistence-xml">
 136.652 +        <mkdir dir="${build.classes.dir}/META-INF"/>
 136.653 +        <copy todir="${build.classes.dir}/META-INF">
 136.654 +            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
 136.655 +        </copy>
 136.656 +    </target>
 136.657 +    <target name="-post-compile">
 136.658 +        <!-- Empty placeholder for easier customization. -->
 136.659 +        <!-- You can override this target in the ../build.xml file. -->
 136.660 +    </target>
 136.661 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
 136.662 +    <target name="-pre-compile-single">
 136.663 +        <!-- Empty placeholder for easier customization. -->
 136.664 +        <!-- You can override this target in the ../build.xml file. -->
 136.665 +    </target>
 136.666 +    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
 136.667 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
 136.668 +        <j2seproject3:force-recompile/>
 136.669 +        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
 136.670 +    </target>
 136.671 +    <target name="-post-compile-single">
 136.672 +        <!-- Empty placeholder for easier customization. -->
 136.673 +        <!-- You can override this target in the ../build.xml file. -->
 136.674 +    </target>
 136.675 +    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
 136.676 +    <!--
 136.677 +                ====================
 136.678 +                JAR BUILDING SECTION
 136.679 +                ====================
 136.680 +            -->
 136.681 +    <target depends="init" name="-pre-pre-jar">
 136.682 +        <dirname file="${dist.jar}" property="dist.jar.dir"/>
 136.683 +        <mkdir dir="${dist.jar.dir}"/>
 136.684 +    </target>
 136.685 +    <target name="-pre-jar">
 136.686 +        <!-- Empty placeholder for easier customization. -->
 136.687 +        <!-- You can override this target in the ../build.xml file. -->
 136.688 +    </target>
 136.689 +    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
 136.690 +        <j2seproject1:jar/>
 136.691 +    </target>
 136.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">
 136.693 +        <j2seproject1:jar manifest="${manifest.file}"/>
 136.694 +    </target>
 136.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">
 136.696 +        <j2seproject1:jar manifest="${manifest.file}">
 136.697 +            <j2seproject1:manifest>
 136.698 +                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
 136.699 +            </j2seproject1:manifest>
 136.700 +        </j2seproject1:jar>
 136.701 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
 136.702 +        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
 136.703 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
 136.704 +        <pathconvert property="run.classpath.with.dist.jar">
 136.705 +            <path path="${run.classpath}"/>
 136.706 +            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
 136.707 +        </pathconvert>
 136.708 +        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
 136.709 +    </target>
 136.710 +    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
 136.711 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
 136.712 +        <touch file="${tmp.manifest.file}" verbose="false"/>
 136.713 +    </target>
 136.714 +    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
 136.715 +        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
 136.716 +        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
 136.717 +    </target>
 136.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">
 136.719 +        <manifest file="${tmp.manifest.file}" mode="update">
 136.720 +            <attribute name="Main-Class" value="${main.class}"/>
 136.721 +        </manifest>
 136.722 +    </target>
 136.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">
 136.724 +        <basename file="${application.splash}" property="splashscreen.basename"/>
 136.725 +        <mkdir dir="${build.classes.dir}/META-INF"/>
 136.726 +        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
 136.727 +        <manifest file="${tmp.manifest.file}" mode="update">
 136.728 +            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
 136.729 +        </manifest>
 136.730 +    </target>
 136.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">
 136.732 +        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
 136.733 +        <echo level="info">To run this application from the command line without Ant, try:</echo>
 136.734 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
 136.735 +        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
 136.736 +    </target>
 136.737 +    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
 136.738 +        <delete>
 136.739 +            <fileset file="${tmp.manifest.file}"/>
 136.740 +        </delete>
 136.741 +    </target>
 136.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"/>
 136.743 +    <target name="-post-jar">
 136.744 +        <!-- Empty placeholder for easier customization. -->
 136.745 +        <!-- You can override this target in the ../build.xml file. -->
 136.746 +    </target>
 136.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"/>
 136.748 +    <!--
 136.749 +                =================
 136.750 +                EXECUTION SECTION
 136.751 +                =================
 136.752 +            -->
 136.753 +    <target depends="init,compile" description="Run a main class." name="run">
 136.754 +        <j2seproject1:java>
 136.755 +            <customize>
 136.756 +                <arg line="${application.args}"/>
 136.757 +            </customize>
 136.758 +        </j2seproject1:java>
 136.759 +    </target>
 136.760 +    <target name="-do-not-recompile">
 136.761 +        <property name="javac.includes.binary" value=""/>
 136.762 +    </target>
 136.763 +    <target depends="init,compile-single" name="run-single">
 136.764 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
 136.765 +        <j2seproject1:java classname="${run.class}"/>
 136.766 +    </target>
 136.767 +    <target depends="init,compile-test-single" name="run-test-with-main">
 136.768 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
 136.769 +        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
 136.770 +    </target>
 136.771 +    <!--
 136.772 +                =================
 136.773 +                DEBUGGING SECTION
 136.774 +                =================
 136.775 +            -->
 136.776 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
 136.777 +        <j2seproject1:nbjpdastart name="${debug.class}"/>
 136.778 +    </target>
 136.779 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
 136.780 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
 136.781 +    </target>
 136.782 +    <target depends="init,compile" name="-debug-start-debuggee">
 136.783 +        <j2seproject3:debug>
 136.784 +            <customize>
 136.785 +                <arg line="${application.args}"/>
 136.786 +            </customize>
 136.787 +        </j2seproject3:debug>
 136.788 +    </target>
 136.789 +    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
 136.790 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
 136.791 +        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
 136.792 +    </target>
 136.793 +    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
 136.794 +    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
 136.795 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
 136.796 +        <j2seproject3:debug classname="${debug.class}"/>
 136.797 +    </target>
 136.798 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
 136.799 +    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
 136.800 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
 136.801 +        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
 136.802 +    </target>
 136.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"/>
 136.804 +    <target depends="init" name="-pre-debug-fix">
 136.805 +        <fail unless="fix.includes">Must set fix.includes</fail>
 136.806 +        <property name="javac.includes" value="${fix.includes}.java"/>
 136.807 +    </target>
 136.808 +    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
 136.809 +        <j2seproject1:nbjpdareload/>
 136.810 +    </target>
 136.811 +    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
 136.812 +    <!--
 136.813 +                =================
 136.814 +                PROFILING SECTION
 136.815 +                =================
 136.816 +            -->
 136.817 +    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
 136.818 +        <nbprofiledirect>
 136.819 +            <classpath>
 136.820 +                <path path="${run.classpath}"/>
 136.821 +            </classpath>
 136.822 +        </nbprofiledirect>
 136.823 +        <profile/>
 136.824 +    </target>
 136.825 +    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
 136.826 +        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
 136.827 +        <nbprofiledirect>
 136.828 +            <classpath>
 136.829 +                <path path="${run.classpath}"/>
 136.830 +            </classpath>
 136.831 +        </nbprofiledirect>
 136.832 +        <profile classname="${profile.class}"/>
 136.833 +    </target>
 136.834 +    <!--
 136.835 +                =========================
 136.836 +                APPLET PROFILING  SECTION
 136.837 +                =========================
 136.838 +            -->
 136.839 +    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
 136.840 +        <nbprofiledirect>
 136.841 +            <classpath>
 136.842 +                <path path="${run.classpath}"/>
 136.843 +            </classpath>
 136.844 +        </nbprofiledirect>
 136.845 +        <profile classname="sun.applet.AppletViewer">
 136.846 +            <customize>
 136.847 +                <arg value="${applet.url}"/>
 136.848 +            </customize>
 136.849 +        </profile>
 136.850 +    </target>
 136.851 +    <!--
 136.852 +                =========================
 136.853 +                TESTS PROFILING  SECTION
 136.854 +                =========================
 136.855 +            -->
 136.856 +    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
 136.857 +        <nbprofiledirect>
 136.858 +            <classpath>
 136.859 +                <path path="${run.test.classpath}"/>
 136.860 +            </classpath>
 136.861 +        </nbprofiledirect>
 136.862 +        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
 136.863 +            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
 136.864 +            <jvmarg value="${profiler.info.jvmargs.agent}"/>
 136.865 +            <jvmarg line="${profiler.info.jvmargs}"/>
 136.866 +            <test name="${profile.class}"/>
 136.867 +            <classpath>
 136.868 +                <path path="${run.test.classpath}"/>
 136.869 +            </classpath>
 136.870 +            <syspropertyset>
 136.871 +                <propertyref prefix="test-sys-prop."/>
 136.872 +                <mapper from="test-sys-prop.*" to="*" type="glob"/>
 136.873 +            </syspropertyset>
 136.874 +            <formatter type="brief" usefile="false"/>
 136.875 +            <formatter type="xml"/>
 136.876 +        </junit>
 136.877 +    </target>
 136.878 +    <!--
 136.879 +                ===============
 136.880 +                JAVADOC SECTION
 136.881 +                ===============
 136.882 +            -->
 136.883 +    <target depends="init" if="have.sources" name="-javadoc-build">
 136.884 +        <mkdir dir="${dist.javadoc.dir}"/>
 136.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}">
 136.886 +            <classpath>
 136.887 +                <path path="${javac.classpath}"/>
 136.888 +            </classpath>
 136.889 +            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
 136.890 +                <filename name="**/*.java"/>
 136.891 +            </fileset>
 136.892 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 136.893 +                <include name="**/*.java"/>
 136.894 +                <exclude name="*.java"/>
 136.895 +            </fileset>
 136.896 +        </javadoc>
 136.897 +        <copy todir="${dist.javadoc.dir}">
 136.898 +            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
 136.899 +                <filename name="**/doc-files/**"/>
 136.900 +            </fileset>
 136.901 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 136.902 +                <include name="**/doc-files/**"/>
 136.903 +            </fileset>
 136.904 +        </copy>
 136.905 +    </target>
 136.906 +    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
 136.907 +        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
 136.908 +    </target>
 136.909 +    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
 136.910 +    <!--
 136.911 +                =========================
 136.912 +                JUNIT COMPILATION SECTION
 136.913 +                =========================
 136.914 +            -->
 136.915 +    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
 136.916 +        <mkdir dir="${build.test.classes.dir}"/>
 136.917 +    </target>
 136.918 +    <target name="-pre-compile-test">
 136.919 +        <!-- Empty placeholder for easier customization. -->
 136.920 +        <!-- You can override this target in the ../build.xml file. -->
 136.921 +    </target>
 136.922 +    <target if="do.depend.true" name="-compile-test-depend">
 136.923 +        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
 136.924 +    </target>
 136.925 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
 136.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}"/>
 136.927 +        <copy todir="${build.test.classes.dir}">
 136.928 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 136.929 +        </copy>
 136.930 +    </target>
 136.931 +    <target name="-post-compile-test">
 136.932 +        <!-- Empty placeholder for easier customization. -->
 136.933 +        <!-- You can override this target in the ../build.xml file. -->
 136.934 +    </target>
 136.935 +    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
 136.936 +    <target name="-pre-compile-test-single">
 136.937 +        <!-- Empty placeholder for easier customization. -->
 136.938 +        <!-- You can override this target in the ../build.xml file. -->
 136.939 +    </target>
 136.940 +    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
 136.941 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
 136.942 +        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
 136.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}"/>
 136.944 +        <copy todir="${build.test.classes.dir}">
 136.945 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 136.946 +        </copy>
 136.947 +    </target>
 136.948 +    <target name="-post-compile-test-single">
 136.949 +        <!-- Empty placeholder for easier customization. -->
 136.950 +        <!-- You can override this target in the ../build.xml file. -->
 136.951 +    </target>
 136.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"/>
 136.953 +    <!--
 136.954 +                =======================
 136.955 +                JUNIT EXECUTION SECTION
 136.956 +                =======================
 136.957 +            -->
 136.958 +    <target depends="init" if="have.tests" name="-pre-test-run">
 136.959 +        <mkdir dir="${build.test.results.dir}"/>
 136.960 +    </target>
 136.961 +    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
 136.962 +        <j2seproject3:junit testincludes="**/*Test.java"/>
 136.963 +    </target>
 136.964 +    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
 136.965 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
 136.966 +    </target>
 136.967 +    <target depends="init" if="have.tests" name="test-report"/>
 136.968 +    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
 136.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"/>
 136.970 +    <target depends="init" if="have.tests" name="-pre-test-run-single">
 136.971 +        <mkdir dir="${build.test.results.dir}"/>
 136.972 +    </target>
 136.973 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
 136.974 +        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
 136.975 +        <j2seproject3:junit excludes="" includes="${test.includes}"/>
 136.976 +    </target>
 136.977 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
 136.978 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
 136.979 +    </target>
 136.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"/>
 136.981 +    <!--
 136.982 +                =======================
 136.983 +                JUNIT DEBUGGING SECTION
 136.984 +                =======================
 136.985 +            -->
 136.986 +    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
 136.987 +        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
 136.988 +        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
 136.989 +        <delete file="${test.report.file}"/>
 136.990 +        <mkdir dir="${build.test.results.dir}"/>
 136.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}">
 136.992 +            <customize>
 136.993 +                <syspropertyset>
 136.994 +                    <propertyref prefix="test-sys-prop."/>
 136.995 +                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
 136.996 +                </syspropertyset>
 136.997 +                <arg value="${test.class}"/>
 136.998 +                <arg value="showoutput=true"/>
 136.999 +                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
136.1000 +                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
136.1001 +            </customize>
136.1002 +        </j2seproject3:debug>
136.1003 +    </target>
136.1004 +    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
136.1005 +        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
136.1006 +    </target>
136.1007 +    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
136.1008 +    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
136.1009 +        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
136.1010 +    </target>
136.1011 +    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
136.1012 +    <!--
136.1013 +                =========================
136.1014 +                APPLET EXECUTION SECTION
136.1015 +                =========================
136.1016 +            -->
136.1017 +    <target depends="init,compile-single" name="run-applet">
136.1018 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
136.1019 +        <j2seproject1:java classname="sun.applet.AppletViewer">
136.1020 +            <customize>
136.1021 +                <arg value="${applet.url}"/>
136.1022 +            </customize>
136.1023 +        </j2seproject1:java>
136.1024 +    </target>
136.1025 +    <!--
136.1026 +                =========================
136.1027 +                APPLET DEBUGGING  SECTION
136.1028 +                =========================
136.1029 +            -->
136.1030 +    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
136.1031 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
136.1032 +        <j2seproject3:debug classname="sun.applet.AppletViewer">
136.1033 +            <customize>
136.1034 +                <arg value="${applet.url}"/>
136.1035 +            </customize>
136.1036 +        </j2seproject3:debug>
136.1037 +    </target>
136.1038 +    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
136.1039 +    <!--
136.1040 +                ===============
136.1041 +                CLEANUP SECTION
136.1042 +                ===============
136.1043 +            -->
136.1044 +    <target name="-deps-clean-init" unless="built-clean.properties">
136.1045 +        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
136.1046 +        <delete file="${built-clean.properties}" quiet="true"/>
136.1047 +    </target>
136.1048 +    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
136.1049 +        <echo level="warn" message="Cycle detected: web.main was already built"/>
136.1050 +    </target>
136.1051 +    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
136.1052 +        <mkdir dir="${build.dir}"/>
136.1053 +        <touch file="${built-clean.properties}" verbose="false"/>
136.1054 +        <property file="${built-clean.properties}" prefix="already.built.clean."/>
136.1055 +        <antcall target="-warn-already-built-clean"/>
136.1056 +        <propertyfile file="${built-clean.properties}">
136.1057 +            <entry key="${basedir}" value=""/>
136.1058 +        </propertyfile>
136.1059 +        <antcall target="-maybe-call-dep">
136.1060 +            <param name="call.built.properties" value="${built-clean.properties}"/>
136.1061 +            <param location="${project.base_web_api}" name="call.subproject"/>
136.1062 +            <param location="${project.base_web_api}/build.xml" name="call.script"/>
136.1063 +            <param name="call.target" value="clean"/>
136.1064 +            <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
136.1065 +        </antcall>
136.1066 +        <antcall target="-maybe-call-dep">
136.1067 +            <param name="call.built.properties" value="${built-clean.properties}"/>
136.1068 +            <param location="${project.type_web_api}" name="call.subproject"/>
136.1069 +            <param location="${project.type_web_api}/build.xml" name="call.script"/>
136.1070 +            <param name="call.target" value="clean"/>
136.1071 +            <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
136.1072 +        </antcall>
136.1073 +    </target>
136.1074 +    <target depends="init" name="-do-clean">
136.1075 +        <delete dir="${build.dir}"/>
136.1076 +        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
136.1077 +    </target>
136.1078 +    <target name="-post-clean">
136.1079 +        <!-- Empty placeholder for easier customization. -->
136.1080 +        <!-- You can override this target in the ../build.xml file. -->
136.1081 +    </target>
136.1082 +    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
136.1083 +    <target name="-check-call-dep">
136.1084 +        <property file="${call.built.properties}" prefix="already.built."/>
136.1085 +        <condition property="should.call.dep">
136.1086 +            <not>
136.1087 +                <isset property="already.built.${call.subproject}"/>
136.1088 +            </not>
136.1089 +        </condition>
136.1090 +    </target>
136.1091 +    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
136.1092 +        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
136.1093 +            <propertyset>
136.1094 +                <propertyref prefix="transfer."/>
136.1095 +                <mapper from="transfer.*" to="*" type="glob"/>
136.1096 +            </propertyset>
136.1097 +        </ant>
136.1098 +    </target>
136.1099 +</project>
   137.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   137.2 +++ b/remoting/server/web/web.main/nbproject/genfiles.properties	Thu Jun 23 15:07:16 2011 +0200
   137.3 @@ -0,0 +1,8 @@
   137.4 +build.xml.data.CRC32=2f237923
   137.5 +build.xml.script.CRC32=5ddf268c
   137.6 +build.xml.stylesheet.CRC32=28e38971@1.45.0.45
   137.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
   137.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
   137.9 +nbproject/build-impl.xml.data.CRC32=2f237923
  137.10 +nbproject/build-impl.xml.script.CRC32=96187301
  137.11 +nbproject/build-impl.xml.stylesheet.CRC32=cfcde7f8@1.45.0.45
   138.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   138.2 +++ b/remoting/server/web/web.main/nbproject/project.properties	Thu Jun 23 15:07:16 2011 +0200
   138.3 @@ -0,0 +1,115 @@
   138.4 +annotation.processing.enabled=true
   138.5 +annotation.processing.enabled.in.editor=false
   138.6 +annotation.processing.run.all.processors=true
   138.7 +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
   138.8 +application.title=web.main
   138.9 +application.vendor=lahvac
  138.10 +build.classes.dir=${build.dir}/classes
  138.11 +build.classes.excludes=**/*.java,**/*.form
  138.12 +# This directory is removed when the project is cleaned:
  138.13 +build.dir=build
  138.14 +build.generated.dir=${build.dir}/generated
  138.15 +build.generated.sources.dir=${build.dir}/generated-sources
  138.16 +# Only compile against the classpath explicitly listed here:
  138.17 +build.sysclasspath=ignore
  138.18 +build.test.classes.dir=${build.dir}/test/classes
  138.19 +build.test.results.dir=${build.dir}/test/results
  138.20 +# Uncomment to specify the preferred debugger connection transport:
  138.21 +#debug.transport=dt_socket
  138.22 +debug.classpath=\
  138.23 +    ${run.classpath}
  138.24 +debug.test.classpath=\
  138.25 +    ${run.test.classpath}
  138.26 +# This directory is removed when the project is cleaned:
  138.27 +dist.dir=dist
  138.28 +dist.jar=${dist.dir}/web.main.jar
  138.29 +dist.javadoc.dir=${dist.dir}/javadoc
  138.30 +endorsed.classpath=
  138.31 +excludes=
  138.32 +file.reference.org-netbeans-api-java-classpath.jar=../../../../server/lib/org-netbeans-api-java-classpath.jar
  138.33 +file.reference.org-netbeans-modules-java-hints.jar=../../../../server/lib/org-netbeans-modules-java-hints.jar
  138.34 +file.reference.org-netbeans-modules-java-project.jar=../../../../server/lib/org-netbeans-modules-java-project.jar
  138.35 +file.reference.org-netbeans-modules-java-source.jar=../../../../server/lib/org-netbeans-modules-java-source.jar
  138.36 +file.reference.org-netbeans-modules-jumpto.jar=../../../../server/lib/org-netbeans-modules-jumpto.jar
  138.37 +file.reference.org-netbeans-modules-masterfs.jar=../../../../server/lib/org-netbeans-modules-masterfs.jar
  138.38 +file.reference.org-netbeans-modules-parsing-api.jar=../../../../server/lib/org-netbeans-modules-parsing-api.jar
  138.39 +file.reference.org-netbeans-modules-parsing-lucene.jar=../../../../server/lib/org-netbeans-modules-parsing-lucene.jar
  138.40 +file.reference.org-netbeans-modules-projectapi.jar=../../../../server/lib/org-netbeans-modules-projectapi.jar
  138.41 +file.reference.org-netbeans-modules-sendopts.jar=../../../../server/lib/org-netbeans-modules-sendopts.jar
  138.42 +file.reference.org-netbeans-spi-editor-hints.jar=../../../../server/lib/org-netbeans-spi-editor-hints.jar
  138.43 +file.reference.org-openide-filesystems.jar=../../../../server/lib/org-openide-filesystems.jar
  138.44 +file.reference.org-openide-util-lookup.jar=../../../../server/lib/org-openide-util-lookup.jar
  138.45 +file.reference.org-openide-util.jar=../../../../server/lib/org-openide-util.jar
  138.46 +file.reference.util-commons.jar=../../../ide/api/external/util-commons.jar
  138.47 +file.reference.util-pojson.jar=../../../ide/api/external/util-pojson.jar
  138.48 +includes=**
  138.49 +jar.compress=false
  138.50 +javac.classpath=\
  138.51 +    ${reference.type_web_api.jar}:\
  138.52 +    ${reference.base_web_api.jar}:\
  138.53 +    ${libs.jersey.classpath}:\
  138.54 +    ${libs.javac.classpath}:\
  138.55 +    ${libs.freemarker.classpath}:\
  138.56 +    ${libs.lucene.classpath}:\
  138.57 +    ${file.reference.org-netbeans-api-java-classpath.jar}:\
  138.58 +    ${file.reference.org-netbeans-modules-java-hints.jar}:\
  138.59 +    ${file.reference.org-netbeans-modules-java-project.jar}:\
  138.60 +    ${file.reference.org-netbeans-modules-java-source.jar}:\
  138.61 +    ${file.reference.org-netbeans-modules-jumpto.jar}:\
  138.62 +    ${file.reference.org-netbeans-modules-masterfs.jar}:\
  138.63 +    ${file.reference.org-netbeans-modules-parsing-api.jar}:\
  138.64 +    ${file.reference.org-netbeans-modules-parsing-lucene.jar}:\
  138.65 +    ${file.reference.org-netbeans-modules-projectapi.jar}:\
  138.66 +    ${file.reference.org-netbeans-modules-sendopts.jar}:\
  138.67 +    ${file.reference.org-netbeans-spi-editor-hints.jar}:\
  138.68 +    ${file.reference.org-openide-filesystems.jar}:\
  138.69 +    ${file.reference.org-openide-util-lookup.jar}:\
  138.70 +    ${file.reference.org-openide-util.jar}:\
  138.71 +    ${file.reference.util-commons.jar}:\
  138.72 +    ${file.reference.util-pojson.jar}
  138.73 +# Space-separated list of extra javac options
  138.74 +javac.compilerargs=
  138.75 +javac.deprecation=false
  138.76 +javac.processorpath=\
  138.77 +    ${javac.classpath}
  138.78 +javac.source=1.6
  138.79 +javac.target=1.6
  138.80 +javac.test.classpath=\
  138.81 +    ${javac.classpath}:\
  138.82 +    ${build.classes.dir}:\
  138.83 +    ${libs.junit.classpath}
  138.84 +javac.test.processorpath=\
  138.85 +    ${javac.test.classpath}
  138.86 +javadoc.additionalparam=
  138.87 +javadoc.author=false
  138.88 +javadoc.encoding=${source.encoding}
  138.89 +javadoc.noindex=false
  138.90 +javadoc.nonavbar=false
  138.91 +javadoc.notree=false
  138.92 +javadoc.private=false
  138.93 +javadoc.splitindex=true
  138.94 +javadoc.use=true
  138.95 +javadoc.version=false
  138.96 +javadoc.windowtitle=
  138.97 +main.class=web.main.WebMain
  138.98 +manifest.file=manifest.mf
  138.99 +meta.inf.dir=${src.dir}/META-INF
 138.100 +mkdist.disabled=false
 138.101 +platform.active=default_platform
 138.102 +project.base_web_api=../base.web.api
 138.103 +project.type_web_api=../type.web.api
 138.104 +reference.base_web_api.jar=${project.base_web_api}/dist/base.web.api.jar
 138.105 +reference.type_web_api.jar=${project.type_web_api}/dist/type.web.api.jar
 138.106 +run.classpath=\
 138.107 +    ${javac.classpath}:\
 138.108 +    ${build.classes.dir}
 138.109 +# Space-separated list of JVM arguments used when running the project
 138.110 +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
 138.111 +# or test-sys-prop.name=value to set system properties for unit tests):
 138.112 +run.jvmargs=
 138.113 +run.test.classpath=\
 138.114 +    ${javac.test.classpath}:\
 138.115 +    ${build.test.classes.dir}
 138.116 +source.encoding=UTF-8
 138.117 +src.dir=src
 138.118 +test.src.dir=test
   139.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   139.2 +++ b/remoting/server/web/web.main/nbproject/project.xml	Thu Jun 23 15:07:16 2011 +0200
   139.3 @@ -0,0 +1,36 @@
   139.4 +<?xml version="1.0" encoding="UTF-8"?>
   139.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
   139.6 +    <type>org.netbeans.modules.java.j2seproject</type>
   139.7 +    <configuration>
   139.8 +        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
   139.9 +            <name>web.main</name>
  139.10 +            <source-roots>
  139.11 +                <root id="src.dir"/>
  139.12 +            </source-roots>
  139.13 +            <test-roots>
  139.14 +                <root id="test.src.dir"/>
  139.15 +            </test-roots>
  139.16 +        </data>
  139.17 +        <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
  139.18 +            <definitions>../../../../server/lib/nblibraries.properties</definitions>
  139.19 +        </libraries>
  139.20 +        <references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
  139.21 +            <reference>
  139.22 +                <foreign-project>base_web_api</foreign-project>
  139.23 +                <artifact-type>jar</artifact-type>
  139.24 +                <script>build.xml</script>
  139.25 +                <target>jar</target>
  139.26 +                <clean-target>clean</clean-target>
  139.27 +                <id>jar</id>
  139.28 +            </reference>
  139.29 +            <reference>
  139.30 +                <foreign-project>type_web_api</foreign-project>
  139.31 +                <artifact-type>jar</artifact-type>
  139.32 +                <script>build.xml</script>
  139.33 +                <target>jar</target>
  139.34 +                <clean-target>clean</clean-target>
  139.35 +                <id>jar</id>
  139.36 +            </reference>
  139.37 +        </references>
  139.38 +    </configuration>
  139.39 +</project>
   140.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   140.2 +++ b/remoting/server/web/web.main/src/web/main/MainPage.java	Thu Jun 23 15:07:16 2011 +0200
   140.3 @@ -0,0 +1,60 @@
   140.4 +/*
   140.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   140.6 + *
   140.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
   140.8 + *
   140.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  140.10 + * Other names may be trademarks of their respective owners.
  140.11 + *
  140.12 + * The contents of this file are subject to the terms of either the GNU
  140.13 + * General Public License Version 2 only ("GPL") or the Common
  140.14 + * Development and Distribution License("CDDL") (collectively, the
  140.15 + * "License"). You may not use this file except in compliance with the
  140.16 + * License. You can obtain a copy of the License at
  140.17 + * http://www.netbeans.org/cddl-gplv2.html
  140.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  140.19 + * specific language governing permissions and limitations under the
  140.20 + * License.  When distributing the software, include this License Header
  140.21 + * Notice in each file and include the License file at
  140.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  140.23 + * particular file as subject to the "Classpath" exception as provided
  140.24 + * by Oracle in the GPL Version 2 section of the License file that
  140.25 + * accompanied this code. If applicable, add the following below the
  140.26 + * License Header, with the fields enclosed by brackets [] replaced by
  140.27 + * your own identifying information:
  140.28 + * "Portions Copyrighted [year] [name of copyright owner]"
  140.29 + *
  140.30 + * If you wish your version of this file to be governed by only the CDDL
  140.31 + * or only the GPL Version 2, indicate your decision by adding
  140.32 + * "[Contributor] elects to include this software in this distribution
  140.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  140.34 + * single choice of license, a recipient has the option to distribute
  140.35 + * your version of this file under either the CDDL, the GPL Version 2 or
  140.36 + * to extend the choice of license to its licensees as provided above.
  140.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  140.38 + * Version 2 license, then the option applies only if the new code is
  140.39 + * made subject to such option by the copyright holder.
  140.40 + *
  140.41 + * Contributor(s):
  140.42 + *
  140.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
  140.44 + */
  140.45 +
  140.46 +package web.main;
  140.47 +
  140.48 +import javax.ws.rs.GET;
  140.49 +import javax.ws.rs.Path;
  140.50 +
  140.51 +/**
  140.52 + *
  140.53 + * @author lahvac
  140.54 + */
  140.55 +@Path("/")
  140.56 +public class MainPage {
  140.57 +
  140.58 +    @GET
  140.59 +    public String main() {
  140.60 +        //XXX: should be constructed automatically from installed plugins
  140.61 +        return "<html><body><ul><li><a href='index/type/ui/search'>Search Type</a></li></ul></body></html>";
  140.62 +    }
  140.63 +}
   141.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   141.2 +++ b/remoting/server/web/web.main/src/web/main/WebMain.java	Thu Jun 23 15:07:16 2011 +0200
   141.3 @@ -0,0 +1,100 @@
   141.4 +/*
   141.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   141.6 + *
   141.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
   141.8 + *
   141.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  141.10 + * Other names may be trademarks of their respective owners.
  141.11 + *
  141.12 + * The contents of this file are subject to the terms of either the GNU
  141.13 + * General Public License Version 2 only ("GPL") or the Common
  141.14 + * Development and Distribution License("CDDL") (collectively, the
  141.15 + * "License"). You may not use this file except in compliance with the
  141.16 + * License. You can obtain a copy of the License at
  141.17 + * http://www.netbeans.org/cddl-gplv2.html
  141.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  141.19 + * specific language governing permissions and limitations under the
  141.20 + * License.  When distributing the software, include this License Header
  141.21 + * Notice in each file and include the License file at
  141.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  141.23 + * particular file as subject to the "Classpath" exception as provided
  141.24 + * by Oracle in the GPL Version 2 section of the License file that
  141.25 + * accompanied this code. If applicable, add the following below the
  141.26 + * License Header, with the fields enclosed by brackets [] replaced by
  141.27 + * your own identifying information:
  141.28 + * "Portions Copyrighted [year] [name of copyright owner]"
  141.29 + *
  141.30 + * If you wish your version of this file to be governed by only the CDDL
  141.31 + * or only the GPL Version 2, indicate your decision by adding
  141.32 + * "[Contributor] elects to include this software in this distribution
  141.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  141.34 + * single choice of license, a recipient has the option to distribute
  141.35 + * your version of this file under either the CDDL, the GPL Version 2 or
  141.36 + * to extend the choice of license to its licensees as provided above.
  141.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  141.38 + * Version 2 license, then the option applies only if the new code is
  141.39 + * made subject to such option by the copyright holder.
  141.40 + *
  141.41 + * Contributor(s):
  141.42 + *
  141.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
  141.44 + */
  141.45 +package web.main;
  141.46 +
  141.47 +import com.sun.grizzly.http.embed.GrizzlyWebServer;
  141.48 +import com.sun.grizzly.http.servlet.ServletAdapter;
  141.49 +import com.sun.grizzly.tcp.http11.GrizzlyAdapter;
  141.50 +import com.sun.grizzly.tcp.http11.GrizzlyRequest;
  141.51 +import com.sun.grizzly.tcp.http11.GrizzlyResponse;
  141.52 +import com.sun.jersey.spi.container.servlet.ServletContainer;
  141.53 +import java.io.File;
  141.54 +import java.io.IOException;
  141.55 +import java.net.URL;
  141.56 +import org.netbeans.modules.jackpot30.backend.base.CategoryStorage;
  141.57 +import org.netbeans.modules.jackpot30.backend.base.RelStreamHandlerFactory;
  141.58 +
  141.59 +/**
  141.60 + *
  141.61 + * @author lahvac
  141.62 + */
  141.63 +public class WebMain {
  141.64 +
  141.65 +    /**
  141.66 +     * @param args the command line arguments
  141.67 +     */
  141.68 +    public static void main(String... args) throws IOException {
  141.69 +        if (args.length != 1 && args.length != 2) {
  141.70 +            System.err.println("Usage: java -jar " + WebMain.class.getProtectionDomain().getCodeSource().getLocation().getPath() + " <cache> [<static-content>]");
  141.71 +            return ;
  141.72 +        }
  141.73 +
  141.74 +        CategoryStorage.setCacheRoot(new File(args[0]));
  141.75 +        
  141.76 +//        org.netbeans.ProxyURLStreamHandlerFactory.register();
  141.77 +        URL.setURLStreamHandlerFactory(new RelStreamHandlerFactory());
  141.78 +        
  141.79 +        GrizzlyWebServer gws;
  141.80 +
  141.81 +        if (args.length == 2) {
  141.82 +            gws = new GrizzlyWebServer(9998, args[1]);
  141.83 +        } else {
  141.84 +            gws = new GrizzlyWebServer(9998);
  141.85 +        }
  141.86 +
  141.87 +        // Jersey web resources
  141.88 +        ServletAdapter jerseyAdapter = new ServletAdapter();
  141.89 +        jerseyAdapter.addInitParameter("com.sun.jersey.config.property.packages", "org.netbeans.modules.jackpot30");
  141.90 +//        jerseyAdapter.setContextPath("/");
  141.91 +        jerseyAdapter.setServletInstance(new ServletContainer());
  141.92 +
  141.93 +        // register all above defined adapters
  141.94 +        gws.addGrizzlyAdapter(jerseyAdapter);
  141.95 +        gws.addGrizzlyAdapter(new GrizzlyAdapter(){
  141.96 +            public void service(GrizzlyRequest request, GrizzlyResponse response){}
  141.97 +        });
  141.98 +
  141.99 +        // let Grizzly run
 141.100 +        gws.start();
 141.101 +    }
 141.102 +
 141.103 +}
   142.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   142.2 +++ b/sandbox/attributed-index-web/API.java	Thu Jun 23 15:07:16 2011 +0200
   142.3 @@ -0,0 +1,572 @@
   142.4 +/*
   142.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   142.6 + *
   142.7 + * Copyright 2009-2010 Sun Microsystems, Inc. All rights reserved.
   142.8 + *
   142.9 + * The contents of this file are subject to the terms of either the GNU
  142.10 + * General Public License Version 2 only ("GPL") or the Common
  142.11 + * Development and Distribution License("CDDL") (collectively, the
  142.12 + * "License"). You may not use this file except in compliance with the
  142.13 + * License. You can obtain a copy of the License at
  142.14 + * http://www.netbeans.org/cddl-gplv2.html
  142.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  142.16 + * specific language governing permissions and limitations under the
  142.17 + * License.  When distributing the software, include this License Header
  142.18 + * Notice in each file and include the License file at
  142.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  142.20 + * particular file as subject to the "Classpath" exception as provided
  142.21 + * by Sun in the GPL Version 2 section of the License file that
  142.22 + * accompanied this code. If applicable, add the following below the
  142.23 + * License Header, with the fields enclosed by brackets [] replaced by
  142.24 + * your own identifying information:
  142.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  142.26 + *
  142.27 + * If you wish your version of this file to be governed by only the CDDL
  142.28 + * or only the GPL Version 2, indicate your decision by adding
  142.29 + * "[Contributor] elects to include this software in this distribution
  142.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  142.31 + * single choice of license, a recipient has the option to distribute
  142.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  142.33 + * to extend the choice of license to its licensees as provided above.
  142.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  142.35 + * Version 2 license, then the option applies only if the new code is
  142.36 + * made subject to such option by the copyright holder.
  142.37 + *
  142.38 + * Contributor(s):
  142.39 + *
  142.40 + * Portions Copyrighted 2009-2010 Sun Microsystems, Inc.
  142.41 + */
  142.42 +
  142.43 +package org.netbeans.modules.jackpot30.backend.impl.api;
  142.44 +
  142.45 +import java.io.IOException;
  142.46 +import java.io.OutputStream;
  142.47 +import java.io.OutputStreamWriter;
  142.48 +import java.io.Writer;
  142.49 +import java.lang.reflect.Method;
  142.50 +import java.lang.reflect.Modifier;
  142.51 +import java.util.ArrayList;
  142.52 +import java.util.Arrays;
  142.53 +import java.util.Collection;
  142.54 +import java.util.Collections;
  142.55 +import java.util.EnumSet;
  142.56 +import java.util.HashMap;
  142.57 +import java.util.HashSet;
  142.58 +import java.util.LinkedHashMap;
  142.59 +import java.util.LinkedList;
  142.60 +import java.util.List;
  142.61 +import java.util.Map;
  142.62 +import java.util.Map.Entry;
  142.63 +import java.util.Set;
  142.64 +import java.util.concurrent.atomic.AtomicBoolean;
  142.65 +import java.util.concurrent.atomic.AtomicLong;
  142.66 +import javax.lang.model.element.TypeElement;
  142.67 +import javax.tools.Diagnostic;
  142.68 +import javax.tools.JavaFileObject;
  142.69 +import javax.ws.rs.DefaultValue;
  142.70 +import javax.ws.rs.GET;
  142.71 +import javax.ws.rs.Path;
  142.72 +import javax.ws.rs.Produces;
  142.73 +import javax.ws.rs.QueryParam;
  142.74 +import javax.ws.rs.WebApplicationException;
  142.75 +import javax.ws.rs.core.StreamingOutput;
  142.76 +import org.codeviation.pojson.Pojson;
  142.77 +import org.netbeans.api.java.classpath.ClassPath;
  142.78 +import org.netbeans.api.java.source.ClassIndex.NameKind;
  142.79 +import org.netbeans.api.java.source.ClassIndex.SearchScope;
  142.80 +import org.netbeans.api.java.source.ClasspathInfo;
  142.81 +import org.netbeans.api.java.source.CompilationController;
  142.82 +import org.netbeans.api.java.source.ElementHandle;
  142.83 +import org.netbeans.api.java.source.ModificationResult;
  142.84 +import org.netbeans.modules.jackpot30.backend.impl.CategoryStorage;
  142.85 +import org.netbeans.modules.jackpot30.impl.examples.Example;
  142.86 +import org.netbeans.modules.jackpot30.impl.examples.Example.Option;
  142.87 +import org.netbeans.modules.jackpot30.impl.examples.LoadExamples;
  142.88 +import org.netbeans.modules.jackpot30.impl.indexing.FileBasedIndex;
  142.89 +import org.netbeans.modules.jackpot30.impl.indexing.Index;
  142.90 +import org.netbeans.modules.jackpot30.spi.PatternConvertor;
  142.91 +import org.netbeans.modules.java.hints.jackpot.impl.MessageImpl;
  142.92 +import org.netbeans.modules.java.hints.jackpot.impl.batch.BatchSearch;
  142.93 +import org.netbeans.modules.java.hints.jackpot.impl.batch.BatchSearch.BatchResult;
  142.94 +import org.netbeans.modules.java.hints.jackpot.impl.batch.BatchSearch.Resource;
  142.95 +import org.netbeans.modules.java.hints.jackpot.impl.batch.BatchUtilities;
  142.96 +import org.netbeans.modules.java.hints.jackpot.impl.batch.ProgressHandleWrapper;
  142.97 +import org.netbeans.modules.java.hints.jackpot.impl.batch.Scopes;
  142.98 +import org.netbeans.modules.java.hints.jackpot.spi.HintDescription;
  142.99 +import org.netbeans.modules.java.source.usages.ClassIndexManager;
 142.100 +import org.netbeans.modules.jumpto.type.GoToTypeAction;
 142.101 +import org.netbeans.spi.editor.hints.ErrorDescription;
 142.102 +import org.netbeans.spi.java.classpath.support.ClassPathSupport;
 142.103 +import org.openide.filesystems.FileObject;
 142.104 +import org.openide.filesystems.FileUtil;
 142.105 +import org.openide.util.Exceptions;
 142.106 +
 142.107 +/**
 142.108 + *
 142.109 + * @author lahvac
 142.110 + */
 142.111 +@Path("/index")
 142.112 +public class API {
 142.113 +
 142.114 +    @GET
 142.115 +    @Path("/find")
 142.116 +    @Produces("text/plain")
 142.117 +    //TODO: parameter for "verified"?
 142.118 +    public String find(@QueryParam("path") String segment, @QueryParam("pattern") String pattern, @QueryParam("asynchronous") @DefaultValue(value="false") boolean asynchronous) throws IOException {
 142.119 +        assert !asynchronous;
 142.120 +
 142.121 +        Iterable<? extends HintDescription> hints = PatternConvertor.create(pattern);
 142.122 +        Set<FileObject> srcRoots = CategoryStorage.getCategoryContent(segment);
 142.123 +        final FileObject deepestCommonParent = deepestCommonParent(srcRoots);
 142.124 +        BatchResult batchResult = BatchSearch.findOccurrences(hints, Scopes.specifiedFoldersScope(srcRoots.toArray(new FileObject[0])));
 142.125 +        final StringBuilder result = new StringBuilder();
 142.126 +
 142.127 +        BatchSearch.getVerifiedSpans(batchResult, new ProgressHandleWrapper(1), new BatchSearch.VerifiedSpansCallBack() {
 142.128 +            @Override public void groupStarted() {}
 142.129 +            @Override public boolean spansVerified(CompilationController wc, Resource r, Collection<? extends ErrorDescription> hints) throws Exception {
 142.130 +                if (!hints.isEmpty()) {
 142.131 +                    result.append(FileUtil.getRelativePath(deepestCommonParent, r.getResolvedFile()));
 142.132 +                    result.append("\n");
 142.133 +                }
 142.134 +                return true;
 142.135 +            }
 142.136 +            @Override public void groupFinished() {}
 142.137 +            @Override public void cannotVerifySpan(Resource r) { /*TODO: warn user?*/ }
 142.138 +        }, true, new LinkedList<MessageImpl>()); //TODO: show the messages to the user?
 142.139 +
 142.140 +        return result.toString();
 142.141 +    }
 142.142 +
 142.143 +    @GET
 142.144 +    @Path("/findWithSpans")
 142.145 +    @Produces("text/plain")
 142.146 +    //TODO: parameter for "verified"?
 142.147 +    public String findWithSpans(@QueryParam("path") String segment, @QueryParam("pattern") String pattern, @QueryParam("asynchronous") @DefaultValue(value="false") boolean asynchronous) throws IOException {
 142.148 +        assert !asynchronous;
 142.149 +
 142.150 +        Iterable<? extends HintDescription> hints = PatternConvertor.create(pattern);
 142.151 +        Set<FileObject> srcRoots = CategoryStorage.getCategoryContent(segment);
 142.152 +        final FileObject deepestCommonParent = deepestCommonParent(srcRoots);
 142.153 +        BatchResult batchResult = BatchSearch.findOccurrences(hints, Scopes.specifiedFoldersScope(srcRoots.toArray(new FileObject[0])));
 142.154 +        final Map<String, int[][]> result = new HashMap<String, int[][]>();
 142.155 +
 142.156 +        BatchSearch.getVerifiedSpans(batchResult, new ProgressHandleWrapper(1), new BatchSearch.VerifiedSpansCallBack() {
 142.157 +            @Override public void groupStarted() {}
 142.158 +            @Override public boolean spansVerified(CompilationController wc, Resource r, Collection<? extends ErrorDescription> hints) throws Exception {
 142.159 +                if (!hints.isEmpty()) {
 142.160 +                    int[][] spans = new int[hints.size()][];
 142.161 +                    int i = 0;
 142.162 +
 142.163 +                    for (ErrorDescription ed : hints) {
 142.164 +                        spans[i++] = new int[] {
 142.165 +                            ed.getRange().getBegin().getOffset(),
 142.166 +                            ed.getRange().getEnd().getOffset()
 142.167 +                        };
 142.168 +                    }
 142.169 +
 142.170 +                    result.put(FileUtil.getRelativePath(deepestCommonParent, r.getResolvedFile()), spans);
 142.171 +                }
 142.172 +                return true;
 142.173 +            }
 142.174 +            @Override public void groupFinished() {}
 142.175 +            @Override public void cannotVerifySpan(Resource r) { /*TODO: warn user?*/ }
 142.176 +        }, true, new LinkedList<MessageImpl>()); //TODO: show the messages to the user?
 142.177 +
 142.178 +        return Pojson.save(result);
 142.179 +    }
 142.180 +
 142.181 +//    @GET
 142.182 +//    @Path("/findCategorize")
 142.183 +//    @Produces("text/plain")
 142.184 +//    public String findCategorize(@QueryParam("path") final String segment, @QueryParam("pattern") final String pattern, @QueryParam("asynchronous") @DefaultValue(value="false") boolean asynchronous) throws IOException {
 142.185 +//        assert asynchronous;
 142.186 +//
 142.187 +//        long id = this.id.getAndIncrement();
 142.188 +//        final ProgressImpl progress = new ProgressImpl();
 142.189 +//
 142.190 +//        workInProgress.put(id, progress);
 142.191 +//
 142.192 +//        new Thread(new Runnable() {
 142.193 +//            public void run() {
 142.194 +//                try {
 142.195 +//                    File sourceRoot = Cache.sourceRootForKey(segment);
 142.196 +//                    Index idx = FileBasedIndex.get(sourceRoot.toURI().toURL());
 142.197 +//                    new SortedQuery().query(idx, pattern, progress);
 142.198 +//                } catch (IOException ex) {
 142.199 +//                    ex.printStackTrace();
 142.200 +//                    progress.finish();
 142.201 +//                }
 142.202 +//            }
 142.203 +//        }).start();
 142.204 +//
 142.205 +//        return Long.toString(id);
 142.206 +//    }
 142.207 +
 142.208 +    @GET
 142.209 +    @Path("/findSpans")
 142.210 +    @Produces("text/plain")
 142.211 +    public String findSpans(@QueryParam("path") String segment, @QueryParam("relativePath") String relativePath, @QueryParam("pattern") String pattern) throws IOException {
 142.212 +        Iterable<? extends HintDescription> hints = PatternConvertor.create(pattern);
 142.213 +        Set<FileObject> srcRoots = CategoryStorage.getCategoryContent(segment);
 142.214 +        FileObject deepestCommonParent = deepestCommonParent(srcRoots);
 142.215 +        BatchResult batchResult = BatchSearch.findOccurrences(hints, Scopes.specifiedFoldersScope(deepestCommonParent.getFileObject(relativePath)));
 142.216 +        final StringBuilder result = new StringBuilder();
 142.217 +
 142.218 +        BatchSearch.getVerifiedSpans(batchResult, new ProgressHandleWrapper(1), new BatchSearch.VerifiedSpansCallBack() {
 142.219 +            @Override public void groupStarted() {}
 142.220 +            @Override public boolean spansVerified(CompilationController wc, Resource r, Collection<? extends ErrorDescription> hints) throws Exception {
 142.221 +                for (ErrorDescription ed : hints) {
 142.222 +                    result.append(ed.getRange().getBegin().getOffset());
 142.223 +                    result.append(":");
 142.224 +                    result.append(ed.getRange().getEnd().getOffset());
 142.225 +                    result.append(":");
 142.226 +                }
 142.227 +                return true;
 142.228 +            }
 142.229 +            @Override public void groupFinished() {}
 142.230 +            @Override public void cannotVerifySpan(Resource r) { /*TODO: warn user?*/ }
 142.231 +        }, true, new LinkedList<MessageImpl>()); //TODO: show the messages to the user?
 142.232 +
 142.233 +        if (result.length() > 0) {
 142.234 +            result.delete(result.length() - 1, result.length());
 142.235 +        }
 142.236 +        return result.toString();
 142.237 +    }
 142.238 +
 142.239 +    @GET
 142.240 +    @Path("/list")
 142.241 +    @Produces("text/plain")
 142.242 +    public String list() throws IOException {
 142.243 +        StringBuilder sb = new StringBuilder();
 142.244 +
 142.245 +        for (Entry<String, String> e : CategoryStorage.listCategoriesWithNames().entrySet()) {
 142.246 +            sb.append(e.getKey());
 142.247 +            sb.append(":");
 142.248 +            sb.append(e.getValue());
 142.249 +            sb.append("\n");
 142.250 +        }
 142.251 +
 142.252 +        return sb.toString();
 142.253 +    }
 142.254 +
 142.255 +    @GET
 142.256 +    @Path("/cat")
 142.257 +    @Produces("text/plain")
 142.258 +    public String cat(@QueryParam("path") String segment, @QueryParam("relative") String relative) throws IOException {
 142.259 +        Set<FileObject> srcRoots = CategoryStorage.getCategoryContent(segment);
 142.260 +        FileObject deepestCommonParent = deepestCommonParent(srcRoots);
 142.261 +        FileObject file = deepestCommonParent.getFileObject(relative);
 142.262 +        ClassPath cp = ClassPathSupport.createClassPath(srcRoots.toArray(new FileObject[0]));
 142.263 +        FileObject root = cp.findOwnerRoot(file);
 142.264 +        String path = cp.getResourceName(file);
 142.265 +        Index index = FileBasedIndex.get(root.getURL());
 142.266 +
 142.267 +        if (index == null) {
 142.268 +            throw new IOException("No index");
 142.269 +        }
 142.270 +
 142.271 +        CharSequence source = index.getSourceCode(path);
 142.272 +
 142.273 +        if (source == null) {
 142.274 +            throw new IOException("Source code not found");
 142.275 +        }
 142.276 +        
 142.277 +        return source.toString().replaceAll("\r\n", "\n");
 142.278 +    }
 142.279 +
 142.280 +    @GET
 142.281 +    @Path("/apply")
 142.282 +    @Produces("text/diff")
 142.283 +    //TODO: parameter for "verified"?
 142.284 +    public StreamingOutput apply(@QueryParam("path") String segment, @QueryParam("pattern") String pattern, @QueryParam("asynchronous") @DefaultValue(value="false") boolean asynchronous) throws IOException {
 142.285 +        assert !asynchronous;
 142.286 +
 142.287 +        Iterable<? extends HintDescription> hints = PatternConvertor.create(pattern);
 142.288 +        Set<FileObject> srcRoots = CategoryStorage.getCategoryContent(segment);
 142.289 +        final FileObject deepestCommonParent = deepestCommonParent(srcRoots);
 142.290 +        BatchResult batchResult = BatchSearch.findOccurrences(hints, Scopes.specifiedFoldersScope(srcRoots.toArray(new FileObject[0])));
 142.291 +        final Collection<ModificationResult> modifications = BatchUtilities.applyFixes(batchResult, new ProgressHandleWrapper(1), new AtomicBoolean(), new LinkedList<MessageImpl>());
 142.292 +
 142.293 +        return new StreamingOutput() {
 142.294 +            @Override public void write(OutputStream output) throws IOException, WebApplicationException {
 142.295 +                Writer w = new OutputStreamWriter(output, "UTF-8");
 142.296 +
 142.297 +                try {
 142.298 +                    for (ModificationResult modResult : modifications) {
 142.299 +                        org.netbeans.modules.jackpot30.impl.batch.BatchUtilities.exportDiff(modResult, deepestCommonParent, w);
 142.300 +                    }
 142.301 +                } finally {
 142.302 +                    try {
 142.303 +                        w.close();
 142.304 +                    } catch (IOException ex) {
 142.305 +                        Exceptions.printStackTrace(ex);
 142.306 +                    }
 142.307 +                }
 142.308 +            }
 142.309 +        };
 142.310 +    }
 142.311 +
 142.312 +//    @GET
 142.313 +//    @Path("/info")
 142.314 +//    @Produces("text/plain")
 142.315 +//    public String info(@QueryParam("path") String segment) throws IOException {
 142.316 +//        URL sourceRoot = Cache.sourceRootForKey(segment).toURI().toURL();
 142.317 +//        Index index = FileBasedIndex.get(sourceRoot);
 142.318 +//
 142.319 +//        if (index == null) {
 142.320 +//            throw new IOException("No index");
 142.321 +//        }
 142.322 +//
 142.323 +//        return Pojson.save(index.getIndexInfo());
 142.324 +//    }
 142.325 +
 142.326 +    @GET
 142.327 +    @Path("/examples")
 142.328 +    @Produces("text/plain")
 142.329 +    public String examples() throws IOException {
 142.330 +        List<Map<String, String>> examples = new LinkedList<Map<String, String>>();
 142.331 +
 142.332 +        for (Example ex : LoadExamples.loadExamples()) {
 142.333 +            if (ex.getOptions().contains(Option.VERIFY) || ex.getOptions().contains(Option.FIX)) continue;
 142.334 +            Map<String, String> desc = new HashMap<String, String>();
 142.335 +
 142.336 +            desc.put("displayName", ex.getDisplayName());
 142.337 +            desc.put("pattern", ex.getCode());
 142.338 +
 142.339 +            examples.add(desc);
 142.340 +        }
 142.341 +
 142.342 +        return Pojson.save(examples);
 142.343 +    }
 142.344 +
 142.345 +    @GET
 142.346 +    @Path("/errors")
 142.347 +    @Produces("text/plain")
 142.348 +    public String errors(@QueryParam("pattern") String pattern) throws IOException {
 142.349 +        StringBuilder sb = new StringBuilder();
 142.350 +
 142.351 +        for (Diagnostic<? extends JavaFileObject> d : StandaloneFinder.parseAndReportErrors(pattern)) {
 142.352 +            sb.append(d.getMessage(null));
 142.353 +            sb.append("\n");
 142.354 +        }
 142.355 +
 142.356 +        return sb.toString();
 142.357 +    }
 142.358 +
 142.359 +    @GET
 142.360 +    @Path("/findDuplicates")
 142.361 +    @Produces("text/plain")
 142.362 +    public String findDuplicates(@QueryParam("path") String segment, @QueryParam("hashes") String hashes) throws IOException {
 142.363 +        Map<String, Map<String, Collection<String>>> hash2Segment2Contains = new HashMap<String, Map<String, Collection<String>>>();
 142.364 +        Collection<String> segments = new LinkedList<String>();
 142.365 +
 142.366 +        if (segment != null) segments.add(segment);
 142.367 +        else {
 142.368 +            segments.addAll(CategoryStorage.listCategoriesWithNames().keySet());
 142.369 +        }
 142.370 +
 142.371 +        Iterable<? extends String> hashesList = Arrays.asList(Pojson.load(String[].class, hashes));
 142.372 +
 142.373 +        for (String seg : segments) {
 142.374 +            Set<FileObject> srcRoots = CategoryStorage.getCategoryContent(seg);
 142.375 +            final FileObject deepestCommonParent = deepestCommonParent(srcRoots);
 142.376 +
 142.377 +            for (FileObject root : srcRoots) {
 142.378 +                Map<String, Collection<? extends String>> found = StandaloneFinder.containsHash(FileUtil.toFile(root), hashesList);
 142.379 +
 142.380 +                for (Entry<String, Collection<? extends String>> e : found.entrySet()) {
 142.381 +                    Map<String, Collection<String>> perRoot = hash2Segment2Contains.get(e.getKey());
 142.382 +
 142.383 +                    if (perRoot == null) {
 142.384 +                        hash2Segment2Contains.put(e.getKey(), perRoot = new HashMap<String, Collection<String>>());
 142.385 +                    }
 142.386 +
 142.387 +                    Collection<String> rel = perRoot.get(seg);
 142.388 +
 142.389 +                    if (rel == null) {
 142.390 +                        perRoot.put(seg, rel = new ArrayList<String>(e.getValue().size()));
 142.391 +                    }
 142.392 +
 142.393 +                    for (String r : e.getValue()) {
 142.394 +                        rel.add(FileUtil.getRelativePath(deepestCommonParent, root.getFileObject(r)));
 142.395 +                    }
 142.396 +                }
 142.397 +            }
 142.398 +        }
 142.399 +
 142.400 +        return Pojson.save(hash2Segment2Contains);
 142.401 +    }
 142.402 +
 142.403 +    @GET
 142.404 +    @Path("/checkProgress")
 142.405 +    @Produces("text/plain")
 142.406 +    public String checkProgress(@QueryParam("id") long id) throws IOException {
 142.407 +        ProgressImpl progress = workInProgress.get(id);
 142.408 +        Map<String, Object> result;
 142.409 +
 142.410 +        if (progress == null) {
 142.411 +            result = new HashMap<String, Object>();
 142.412 +            result.put("total", 0);
 142.413 +            result.put("workDone", 0);
 142.414 +            result.put("finished", true);
 142.415 +            result.put("result", Collections.<String>emptyList());
 142.416 +        } else {
 142.417 +            result = progress.progressPacket();
 142.418 +        }
 142.419 +
 142.420 +        if (result.get("finished") == Boolean.TRUE) {
 142.421 +            workInProgress.remove(id);
 142.422 +        }
 142.423 +
 142.424 +        return Pojson.save(result);
 142.425 +    }
 142.426 +
 142.427 +    @GET
 142.428 +    @Path("/cancelProgress")
 142.429 +    @Produces("text/plain")
 142.430 +    public String cancelProgress(@QueryParam("id") long id) throws IOException {
 142.431 +        ProgressImpl progress = workInProgress.get(id);
 142.432 +
 142.433 +        if (progress != null) {
 142.434 +            progress.cancel.set(true);
 142.435 +        }
 142.436 +
 142.437 +        return "done";
 142.438 +    }
 142.439 +
 142.440 +    @GET
 142.441 +    @Path("/capabilities")
 142.442 +    @Produces("text/plain")
 142.443 +    public String capabilities() throws IOException {
 142.444 +        Map<String, Object> result = new HashMap<String, Object>();
 142.445 +        List<String> methods = new ArrayList<String>(API.class.getDeclaredMethods().length);
 142.446 +
 142.447 +        for (Method m : API.class.getDeclaredMethods()) {
 142.448 +            if (m.isAnnotationPresent(GET.class) && (m.getModifiers() & Modifier.PUBLIC) != 0) {
 142.449 +                methods.add(m.getName());
 142.450 +            }
 142.451 +        }
 142.452 +
 142.453 +        result.put("methods", methods);
 142.454 +        result.put("attributed", true);
 142.455 +
 142.456 +        return Pojson.save(result);
 142.457 +    }
 142.458 +
 142.459 +    @GET
 142.460 +    @Path("/findType")
 142.461 +    @Produces("text/plain")
 142.462 +    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 {
 142.463 +        assert !asynchronous;
 142.464 +
 142.465 +        //copied (and converted to NameKind) from jumpto's GoToTypeAction:
 142.466 +        boolean exact = prefix.endsWith(" "); // NOI18N
 142.467 +
 142.468 +        prefix = prefix.trim();
 142.469 +
 142.470 +        if ( prefix.length() == 0) {
 142.471 +            return "";
 142.472 +        }
 142.473 +
 142.474 +        NameKind nameKind;
 142.475 +        int wildcard = GoToTypeAction.containsWildCard(prefix);
 142.476 +
 142.477 +        if (exact) {
 142.478 +            //nameKind = panel.isCaseSensitive() ? SearchType.EXACT_NAME : SearchType.CASE_INSENSITIVE_EXACT_NAME;
 142.479 +            nameKind = NameKind.SIMPLE_NAME;
 142.480 +        }
 142.481 +        else if ((GoToTypeAction.isAllUpper(prefix) && prefix.length() > 1) || GoToTypeAction.isCamelCase(prefix)) {
 142.482 +            nameKind = NameKind.CAMEL_CASE;
 142.483 +        }
 142.484 +        else if (wildcard != -1) {
 142.485 +            nameKind = casesensitive ? NameKind.REGEXP : NameKind.CASE_INSENSITIVE_REGEXP;
 142.486 +        }
 142.487 +        else {
 142.488 +            nameKind = casesensitive ? NameKind.PREFIX : NameKind.CASE_INSENSITIVE_PREFIX;
 142.489 +        }
 142.490 +
 142.491 +        Map<String, List<String>> result = new LinkedHashMap<String, List<String>>();
 142.492 +        Set<FileObject> srcRoots = CategoryStorage.getCategoryContent(segment);
 142.493 +        FileObject deepestCommonParent = deepestCommonParent(srcRoots);
 142.494 +
 142.495 +        for (FileObject srcRoot : srcRoots) {
 142.496 +            String rootId = FileUtil.getRelativePath(deepestCommonParent, srcRoot);
 142.497 +            List<String> currentResult = new ArrayList<String>();
 142.498 +
 142.499 +            result.put(rootId, currentResult);
 142.500 +
 142.501 +            ClassIndexManager.getDefault().createUsagesQuery(srcRoot.getURL(), true);
 142.502 +            ClasspathInfo cpInfo = ClasspathInfo.create(ClassPath.EMPTY, ClassPath.EMPTY, ClassPathSupport.createClassPath(srcRoot));
 142.503 +            Set<ElementHandle<TypeElement>> names = new HashSet<ElementHandle<TypeElement>>(cpInfo.getClassIndex().getDeclaredTypes(prefix, nameKind, EnumSet.of(SearchScope.SOURCE)));
 142.504 +
 142.505 +            if (nameKind == NameKind.CAMEL_CASE) {
 142.506 +                names.addAll(cpInfo.getClassIndex().getDeclaredTypes(prefix, NameKind.CASE_INSENSITIVE_PREFIX, EnumSet.of(SearchScope.SOURCE)));
 142.507 +            }
 142.508 +
 142.509 +            for (ElementHandle<TypeElement> d : names) {
 142.510 +                currentResult.add(d.getBinaryName());
 142.511 +            }
 142.512 +        }
 142.513 +
 142.514 +        return Pojson.save(result);
 142.515 +    }
 142.516 +
 142.517 +    //XXX: not really correct, a base directory(-ies?) should be set in the category!
 142.518 +    private static FileObject deepestCommonParent(Set<FileObject> roots) {
 142.519 +        FileObject result = null;
 142.520 +
 142.521 +        for (FileObject r : roots) {
 142.522 +            if (result == null) {
 142.523 +                result = r;
 142.524 +            } else {
 142.525 +                while (!FileUtil.isParentOf(result, r)) {
 142.526 +                    result = result.getParent();
 142.527 +                }
 142.528 +            }
 142.529 +        }
 142.530 +
 142.531 +        return result;
 142.532 +    }
 142.533 +
 142.534 +    private final static AtomicLong id = new AtomicLong();
 142.535 +    private final static Map<Long, ProgressImpl> workInProgress = new HashMap<Long, ProgressImpl>();//XXX: should be cleared eventually even if not read
 142.536 +
 142.537 +    private static final class ProgressImpl implements Progress {
 142.538 +        private int total = -1;
 142.539 +        private int workDone = 0;
 142.540 +        private boolean finished;
 142.541 +        private final List<String> result = new ArrayList<String>();
 142.542 +        private final AtomicBoolean cancel = new AtomicBoolean();
 142.543 +        public synchronized void setTotalWork(int total) {
 142.544 +            this.total = total;
 142.545 +        }
 142.546 +        public synchronized void progress(int totalDone) {
 142.547 +            workDone = totalDone;
 142.548 +        }
 142.549 +        public synchronized void updateProgress(int updateDone) {
 142.550 +            workDone += updateDone;
 142.551 +        }
 142.552 +        public synchronized void addResultPart(String part) {
 142.553 +            result.add(part);
 142.554 +        }
 142.555 +        public synchronized void finish() {
 142.556 +            finished = true;
 142.557 +        }
 142.558 +        public synchronized boolean isCancelled() {
 142.559 +            return cancel.get();
 142.560 +        }
 142.561 +        synchronized Map<String, Object> progressPacket() {
 142.562 +            Map<String, Object> result = new HashMap<String, Object>();
 142.563 +
 142.564 +            result.put("total", total);
 142.565 +            result.put("workDone", workDone);
 142.566 +            result.put("finished", finished);
 142.567 +            result.put("result", new ArrayList<String>(this.result));
 142.568 +
 142.569 +            this.result.clear();
 142.570 +
 142.571 +            return result;
 142.572 +        }
 142.573 +    }
 142.574 +
 142.575 +}
   143.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   143.2 +++ b/sandbox/attributed-index-web/Progress.java	Thu Jun 23 15:07:16 2011 +0200
   143.3 @@ -0,0 +1,60 @@
   143.4 +/*
   143.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   143.6 + *
   143.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
   143.8 + *
   143.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  143.10 + * Other names may be trademarks of their respective owners.
  143.11 + *
  143.12 + * The contents of this file are subject to the terms of either the GNU
  143.13 + * General Public License Version 2 only ("GPL") or the Common
  143.14 + * Development and Distribution License("CDDL") (collectively, the
  143.15 + * "License"). You may not use this file except in compliance with the
  143.16 + * License. You can obtain a copy of the License at
  143.17 + * http://www.netbeans.org/cddl-gplv2.html
  143.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  143.19 + * specific language governing permissions and limitations under the
  143.20 + * License.  When distributing the software, include this License Header
  143.21 + * Notice in each file and include the License file at
  143.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  143.23 + * particular file as subject to the "Classpath" exception as provided
  143.24 + * by Oracle in the GPL Version 2 section of the License file that
  143.25 + * accompanied this code. If applicable, add the following below the
  143.26 + * License Header, with the fields enclosed by brackets [] replaced by
  143.27 + * your own identifying information:
  143.28 + * "Portions Copyrighted [year] [name of copyright owner]"
  143.29 + *
  143.30 + * If you wish your version of this file to be governed by only the CDDL
  143.31 + * or only the GPL Version 2, indicate your decision by adding
  143.32 + * "[Contributor] elects to include this software in this distribution
  143.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  143.34 + * single choice of license, a recipient has the option to distribute
  143.35 + * your version of this file under either the CDDL, the GPL Version 2 or
  143.36 + * to extend the choice of license to its licensees as provided above.
  143.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  143.38 + * Version 2 license, then the option applies only if the new code is
  143.39 + * made subject to such option by the copyright holder.
  143.40 + *
  143.41 + * Contributor(s):
  143.42 + *
  143.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
  143.44 + */
  143.45 +
  143.46 +package org.netbeans.modules.jackpot30.backend.impl.api;
  143.47 +
  143.48 +/**
  143.49 + *
  143.50 + * @author lahvac
  143.51 + */
  143.52 +public interface Progress {
  143.53 +
  143.54 +    public void setTotalWork(int total);
  143.55 +    public void progress(int totalDone);
  143.56 +    public void updateProgress(int updateDone);
  143.57 +    public void addResultPart(String part);
  143.58 +    public void finish();
  143.59 +    
  143.60 +    public boolean isCancelled();
  143.61 +
  143.62 +
  143.63 +}
   144.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   144.2 +++ b/sandbox/attributed-index-web/StandaloneFinder.java	Thu Jun 23 15:07:16 2011 +0200
   144.3 @@ -0,0 +1,213 @@
   144.4 +/*
   144.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   144.6 + *
   144.7 + * Copyright 2009-2010 Sun Microsystems, Inc. All rights reserved.
   144.8 + *
   144.9 + * The contents of this file are subject to the terms of either the GNU
  144.10 + * General Public License Version 2 only ("GPL") or the Common
  144.11 + * Development and Distribution License("CDDL") (collectively, the
  144.12 + * "License"). You may not use this file except in compliance with the
  144.13 + * License. You can obtain a copy of the License at
  144.14 + * http://www.netbeans.org/cddl-gplv2.html
  144.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  144.16 + * specific language governing permissions and limitations under the
  144.17 + * License.  When distributing the software, include this License Header
  144.18 + * Notice in each file and include the License file at
  144.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  144.20 + * particular file as subject to the "Classpath" exception as provided
  144.21 + * by Sun in the GPL Version 2 section of the License file that
  144.22 + * accompanied this code. If applicable, add the following below the
  144.23 + * License Header, with the fields enclosed by brackets [] replaced by
  144.24 + * your own identifying information:
  144.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  144.26 + *
  144.27 + * If you wish your version of this file to be governed by only the CDDL
  144.28 + * or only the GPL Version 2, indicate your decision by adding
  144.29 + * "[Contributor] elects to include this software in this distribution
  144.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  144.31 + * single choice of license, a recipient has the option to distribute
  144.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  144.33 + * to extend the choice of license to its licensees as provided above.
  144.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  144.35 + * Version 2 license, then the option applies only if the new code is
  144.36 + * made subject to such option by the copyright holder.
  144.37 + *
  144.38 + * Contributor(s):
  144.39 + *
  144.40 + * Portions Copyrighted 2009-2010 Sun Microsystems, Inc.
  144.41 + */
  144.42 +
  144.43 +package org.netbeans.modules.jackpot30.backend.impl.api;
  144.44 +
  144.45 +import com.sun.source.tree.CompilationUnitTree;
  144.46 +import com.sun.source.tree.Tree;
  144.47 +import com.sun.source.util.TreePath;
  144.48 +import com.sun.source.util.Trees;
  144.49 +import com.sun.tools.javac.api.JavacTaskImpl;
  144.50 +import java.io.File;
  144.51 +import java.io.IOException;
  144.52 +import java.net.URI;
  144.53 +import java.net.URL;
  144.54 +import java.util.Arrays;
  144.55 +import java.util.BitSet;
  144.56 +import java.util.Collection;
  144.57 +import java.util.Collections;
  144.58 +import java.util.HashMap;
  144.59 +import java.util.LinkedList;
  144.60 +import java.util.Map;
  144.61 +import javax.tools.Diagnostic;
  144.62 +import javax.tools.JavaCompiler;
  144.63 +import javax.tools.JavaFileObject;
  144.64 +import javax.tools.SimpleJavaFileObject;
  144.65 +import javax.tools.ToolProvider;
  144.66 +import org.apache.lucene.document.Document;
  144.67 +import org.apache.lucene.index.IndexReader;
  144.68 +import org.apache.lucene.index.Term;
  144.69 +import org.apache.lucene.search.Collector;
  144.70 +import org.apache.lucene.search.IndexSearcher;
  144.71 +import org.apache.lucene.search.Query;
  144.72 +import org.apache.lucene.search.Searcher;
  144.73 +import org.apache.lucene.search.TermQuery;
  144.74 +import org.apache.lucene.store.FSDirectory;
  144.75 +import org.netbeans.modules.jackpot30.impl.duplicates.indexing.DuplicatesIndex;
  144.76 +import org.netbeans.modules.jackpot30.impl.indexing.AbstractLuceneIndex.BitSetCollector;
  144.77 +import org.netbeans.modules.jackpot30.impl.indexing.FileBasedIndex;
  144.78 +import org.netbeans.modules.jackpot30.spi.PatternConvertor;
  144.79 +import org.netbeans.modules.java.hints.jackpot.impl.Utilities;
  144.80 +import org.netbeans.modules.java.hints.jackpot.impl.pm.BulkSearch;
  144.81 +import org.netbeans.modules.java.hints.jackpot.impl.pm.BulkSearch.BulkPattern;
  144.82 +import org.netbeans.modules.java.hints.jackpot.spi.HintDescription;
  144.83 +import org.netbeans.modules.java.hints.jackpot.spi.HintDescription.AdditionalQueryConstraints;
  144.84 +import org.netbeans.modules.java.hints.jackpot.spi.Trigger.PatternDescription;
  144.85 +import org.netbeans.modules.parsing.impl.indexing.CacheFolder;
  144.86 +import org.netbeans.modules.parsing.impl.indexing.SPIAccessor;
  144.87 +import org.openide.filesystems.FileObject;
  144.88 +import org.openide.filesystems.FileUtil;
  144.89 +
  144.90 +/**
  144.91 + *
  144.92 + * @author lahvac
  144.93 + */
  144.94 +public class StandaloneFinder {
  144.95 +
  144.96 +    public static Collection<? extends String> findCandidates(File sourceRoot, String pattern) throws IOException {
  144.97 +        BulkPattern bulkPattern = preparePattern(pattern, null);
  144.98 +        
  144.99 +        return FileBasedIndex.get(sourceRoot.toURI().toURL()).findCandidates(bulkPattern);
 144.100 +    }
 144.101 +
 144.102 +    public static int[] findCandidateOccurrenceSpans(File sourceRoot, String relativePath, String pattern) throws IOException {
 144.103 +        BulkPattern bulkPattern = preparePattern(pattern, null);
 144.104 +        CharSequence source = FileBasedIndex.get(sourceRoot.toURI().toURL()).getSourceCode(relativePath).toString().replaceAll("\r\n", "\n");
 144.105 +        JavacTaskImpl jti = prepareJavacTaskImpl();
 144.106 +        CompilationUnitTree cut = jti.parse(new JFOImpl(source)).iterator().next();
 144.107 +        Collection<TreePath> paths = new LinkedList<TreePath>();
 144.108 +        
 144.109 +        for (Collection<TreePath> c : BulkSearch.getDefault().match(null, new TreePath(cut), bulkPattern).values()) {
 144.110 +            paths.addAll(c);
 144.111 +        }
 144.112 +
 144.113 +        Trees t = Trees.instance(jti);
 144.114 +        int[] result = new int[2 * paths.size()];
 144.115 +        int i = 0;
 144.116 +
 144.117 +        for (TreePath tp : paths) {
 144.118 +            result[i++] = (int) t.getSourcePositions().getStartPosition(cut, tp.getLeaf());
 144.119 +            result[i++] = (int) t.getSourcePositions().getEndPosition(cut, tp.getLeaf());
 144.120 +        }
 144.121 +
 144.122 +        return result;
 144.123 +    }
 144.124 +
 144.125 +    public static Collection<Diagnostic<? extends JavaFileObject>> parseAndReportErrors(String pattern) {
 144.126 +        Collection<Diagnostic<? extends JavaFileObject>> errors = new LinkedList<Diagnostic<? extends JavaFileObject>>();
 144.127 +
 144.128 +        preparePattern(pattern, errors);
 144.129 +
 144.130 +        return errors;
 144.131 +    }
 144.132 +
 144.133 +    private static File getIndex(URL url) throws IOException {
 144.134 +        FileObject indexBaseFolder = CacheFolder.getDataFolder(url);
 144.135 +        String path = SPIAccessor.getInstance().getIndexerPath(DuplicatesIndex.NAME, DuplicatesIndex.VERSION);
 144.136 +        FileObject indexFolder = FileUtil.createFolder(indexBaseFolder, path);
 144.137 +        return FileUtil.toFile(indexFolder);
 144.138 +    }
 144.139 +
 144.140 +    public static Map<String, Collection<? extends String>> containsHash(File sourceRoot, Iterable<? extends String> hashes) throws IOException {
 144.141 +        File cacheRoot = getIndex(sourceRoot.toURI().toURL());
 144.142 +        File dir = new File(cacheRoot, "fulltext");
 144.143 +
 144.144 +        if (dir.listFiles() != null && dir.listFiles().length > 0) {
 144.145 +            IndexReader reader = IndexReader.open(FSDirectory.open(dir), true);
 144.146 +            Map<String, Collection<? extends String>> result = new HashMap<String, Collection<? extends String>>();
 144.147 +
 144.148 +            for (String hash : hashes) {
 144.149 +                Collection<String> found = new LinkedList<String>();
 144.150 +                Query query = new TermQuery(new Term("generalized", hash));
 144.151 +                Searcher s = new IndexSearcher(reader);
 144.152 +                BitSet matchingDocuments = new BitSet(reader.maxDoc());
 144.153 +                Collector c = new BitSetCollector(matchingDocuments);
 144.154 +
 144.155 +                s.search(query, c);
 144.156 +
 144.157 +                for (int docNum = matchingDocuments.nextSetBit(0); docNum >= 0; docNum = matchingDocuments.nextSetBit(docNum + 1)) {
 144.158 +                    final Document doc = reader.document(docNum);
 144.159 +
 144.160 +                    found.add(doc.getField("path").stringValue());
 144.161 +                }
 144.162 +
 144.163 +                result.put(hash, found);
 144.164 +            }
 144.165 +            
 144.166 +            return result;
 144.167 +        }
 144.168 +
 144.169 +        return Collections.emptyMap();
 144.170 +    }
 144.171 +    
 144.172 +    private static BulkPattern preparePattern(String pattern, Collection<Diagnostic<? extends JavaFileObject>> errors) {
 144.173 +        return preparePattern(PatternConvertor.create(pattern), errors);
 144.174 +    }
 144.175 +
 144.176 +    //XXX: copied from BatchSearch, may be possible to merge once CompilationInfo is accessible in server mode
 144.177 +    private static BulkPattern preparePattern(final Iterable<? extends HintDescription> patterns, Collection<Diagnostic<? extends JavaFileObject>> errors) {
 144.178 +        JavacTaskImpl javac = prepareJavacTaskImpl();
 144.179 +        Collection<String> code = new LinkedList<String>();
 144.180 +        Collection<Tree> trees = new LinkedList<Tree>();
 144.181 +        Collection<AdditionalQueryConstraints> additionalConstraints = new LinkedList<AdditionalQueryConstraints>();
 144.182 +
 144.183 +        for (HintDescription pattern : patterns) {
 144.184 +            String textPattern = ((PatternDescription) pattern.getTrigger()).getPattern();
 144.185 +
 144.186 +            code.add(textPattern);
 144.187 +            trees.add(Utilities.parseAndAttribute(javac, textPattern, errors));
 144.188 +            additionalConstraints.add(pattern.getAdditionalConstraints());
 144.189 +        }
 144.190 +
 144.191 +        return BulkSearch.getDefault().create(code, trees, additionalConstraints);
 144.192 +    }
 144.193 +
 144.194 +    private static JavacTaskImpl prepareJavacTaskImpl() {
 144.195 +        final String bootPath = System.getProperty("sun.boot.class.path"); //NOI18N
 144.196 +        final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
 144.197 +
 144.198 +        assert tool != null;
 144.199 +
 144.200 +        JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(null, null, null, Arrays.asList("-bootclasspath",  bootPath, "-Xjcov"), null, Collections.<JavaFileObject>emptyList());
 144.201 +        
 144.202 +        return ct;
 144.203 +    }
 144.204 +
 144.205 +    private static final class JFOImpl extends SimpleJavaFileObject {
 144.206 +        private final CharSequence code;
 144.207 +        public JFOImpl(CharSequence code) {
 144.208 +            super(URI.create(""), Kind.SOURCE);
 144.209 +            this.code = code;
 144.210 +        }
 144.211 +        @Override
 144.212 +        public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
 144.213 +            return code;
 144.214 +        }
 144.215 +    }
 144.216 +}
   145.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   145.2 +++ b/sandbox/attributed-index-web/UI.java	Thu Jun 23 15:07:16 2011 +0200
   145.3 @@ -0,0 +1,423 @@
   145.4 +/*
   145.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   145.6 + *
   145.7 + * Copyright 2009-2010 Sun Microsystems, Inc. All rights reserved.
   145.8 + *
   145.9 + * The contents of this file are subject to the terms of either the GNU
  145.10 + * General Public License Version 2 only ("GPL") or the Common
  145.11 + * Development and Distribution License("CDDL") (collectively, the
  145.12 + * "License"). You may not use this file except in compliance with the
  145.13 + * License. You can obtain a copy of the License at
  145.14 + * http://www.netbeans.org/cddl-gplv2.html
  145.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  145.16 + * specific language governing permissions and limitations under the
  145.17 + * License.  When distributing the software, include this License Header
  145.18 + * Notice in each file and include the License file at
  145.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  145.20 + * particular file as subject to the "Classpath" exception as provided
  145.21 + * by Sun in the GPL Version 2 section of the License file that
  145.22 + * accompanied this code. If applicable, add the following below the
  145.23 + * License Header, with the fields enclosed by brackets [] replaced by
  145.24 + * your own identifying information:
  145.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  145.26 + *
  145.27 + * If you wish your version of this file to be governed by only the CDDL
  145.28 + * or only the GPL Version 2, indicate your decision by adding
  145.29 + * "[Contributor] elects to include this software in this distribution
  145.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  145.31 + * single choice of license, a recipient has the option to distribute
  145.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  145.33 + * to extend the choice of license to its licensees as provided above.
  145.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  145.35 + * Version 2 license, then the option applies only if the new code is
  145.36 + * made subject to such option by the copyright holder.
  145.37 + *
  145.38 + * Contributor(s):
  145.39 + *
  145.40 + * Portions Copyrighted 2009-2010 Sun Microsystems, Inc.
  145.41 + */
  145.42 +
  145.43 +package org.netbeans.modules.jackpot30.backend.impl.ui;
  145.44 +
  145.45 +import java.util.Comparator;
  145.46 +import javax.ws.rs.core.Response;
  145.47 +import java.util.LinkedHashMap;
  145.48 +import java.util.Map.Entry;
  145.49 +import freemarker.cache.TemplateLoader;
  145.50 +import freemarker.template.Configuration;
  145.51 +import freemarker.template.Template;
  145.52 +import freemarker.template.TemplateException;
  145.53 +import java.io.IOException;
  145.54 +import java.io.InputStream;
  145.55 +import java.io.InputStreamReader;
  145.56 +import java.io.Reader;
  145.57 +import java.io.StringWriter;
  145.58 +import java.net.URI;
  145.59 +import java.net.URISyntaxException;
  145.60 +import java.util.ArrayList;
  145.61 +import java.util.Collections;
  145.62 +import java.util.HashMap;
  145.63 +import java.util.LinkedList;
  145.64 +import java.util.List;
  145.65 +import java.util.Map;
  145.66 +import javax.ws.rs.DefaultValue;
  145.67 +import javax.ws.rs.GET;
  145.68 +import javax.ws.rs.Path;
  145.69 +import javax.ws.rs.Produces;
  145.70 +import javax.ws.rs.QueryParam;
  145.71 +import org.codeviation.pojson.Pojson;
  145.72 +import org.netbeans.modules.jackpot30.impl.WebUtilities;
  145.73 +import static org.netbeans.modules.jackpot30.impl.WebUtilities.escapeForQuery;
  145.74 +
  145.75 +/**
  145.76 + *
  145.77 + * @author lahvac
  145.78 + */
  145.79 +@Path("/index/ui")
  145.80 +public class UI {
  145.81 +
  145.82 +    @GET
  145.83 +    @Path("/search")
  145.84 +    @Produces("text/html")
  145.85 +    public String search(@QueryParam("path") String path, @QueryParam("pattern") String pattern) throws URISyntaxException, IOException, TemplateException {
  145.86 +        Map<String, Object> configurationData = new HashMap<String, Object>();
  145.87 +
  145.88 +        configurationData.put("paths", list());
  145.89 +        configurationData.put("selectedPath", path);
  145.90 +        configurationData.put("pattern", pattern);
  145.91 +        configurationData.put("patternEscaped", escapeForQuery(pattern));
  145.92 +        configurationData.put("examples", loadExamples());
  145.93 +
  145.94 +        if (pattern != null && path != null) {
  145.95 +            URI u = new URI("http://localhost:9998/index/find?path=" + escapeForQuery(path) + "&pattern=" + escapeForQuery(pattern));
  145.96 +            List<Map<String, Object>> results = new LinkedList<Map<String, Object>>();
  145.97 +            long queryTime = System.currentTimeMillis();
  145.98 +            List<String> candidates = new ArrayList<String>(WebUtilities.requestStringArrayResponse(u));
  145.99 +
 145.100 +            queryTime = System.currentTimeMillis() - queryTime;
 145.101 +
 145.102 +            Collections.sort(candidates);
 145.103 +
 145.104 +            for (String c : candidates) {
 145.105 +                Map<String, Object> found = new HashMap<String, Object>(3);
 145.106 +
 145.107 +                found.put("relativePath", c);
 145.108 +
 145.109 +                results.add(found);
 145.110 +            }
 145.111 +
 145.112 +            configurationData.put("results", results);
 145.113 +
 145.114 +            Map<String, Object> statistics = new HashMap<String, Object>();
 145.115 +
 145.116 +            statistics.put("files", candidates.size());
 145.117 +            statistics.put("queryTime", queryTime);
 145.118 +
 145.119 +            configurationData.put("statistics", statistics);
 145.120 +        }
 145.121 +
 145.122 +        return processTemplate("ui-search.html", configurationData);
 145.123 +    }
 145.124 +
 145.125 +//    @GET
 145.126 +//    @Path("/searchCategorized")
 145.127 +//    @Produces("text/html")
 145.128 +//    public String searchCategorized(@QueryParam("path") String path, @QueryParam("pattern") String pattern) throws URISyntaxException, IOException, TemplateException {
 145.129 +//        Map<String, Object> configurationData = new HashMap<String, Object>();
 145.130 +//
 145.131 +//        configurationData.put("paths", list());
 145.132 +//        configurationData.put("selectedPath", path);
 145.133 +//        configurationData.put("pattern", pattern);
 145.134 +//        configurationData.put("patternEscaped", escapeForQuery(pattern));
 145.135 +//        configurationData.put("examples", loadExamples());
 145.136 +//
 145.137 +//        if (pattern != null && path != null) {
 145.138 +//            Result queryResult = new DoQuery().doQuery(path, pattern, new Cancel() {
 145.139 +//                                                           public boolean isCancelled() {
 145.140 +//                                                               return false;
 145.141 +//                                                           }
 145.142 +//                                                       });
 145.143 +//
 145.144 +//            configurationData.put("result", queryResult.result);
 145.145 +//        }
 145.146 +//
 145.147 +//        return processTemplate("ui-search-categorized.html", configurationData);
 145.148 +//    }
 145.149 +
 145.150 +    @GET
 145.151 +    @Path("/show")
 145.152 +    @Produces("text/html")
 145.153 +    public String show(@QueryParam("path") String path, @QueryParam("relative") String relativePath, @QueryParam("pattern") String pattern) throws URISyntaxException, IOException, TemplateException {
 145.154 +        Map<String, Object> configurationData = new HashMap<String, Object>();
 145.155 +        List<Map<String, String>> occurrences = new LinkedList<Map<String, String>>();
 145.156 +
 145.157 +        configurationData.put("occurrences", occurrences);
 145.158 +
 145.159 +        URI codeURL = new URI("http://localhost:9998/index/cat?path=" + escapeForQuery(path) + "&relative=" + escapeForQuery(relativePath));
 145.160 +        String code = WebUtilities.requestStringResponse(codeURL);
 145.161 +
 145.162 +        if (pattern != null) {
 145.163 +            URI spansURL = new URI("http://localhost:9998/index/findSpans?path=" + escapeForQuery(path) + "&relativePath=" + escapeForQuery(relativePath) + "&pattern=" + escapeForQuery(pattern));
 145.164 +            int currentCodePos = 0;
 145.165 +            for (int[] span : parseSpans(WebUtilities.requestStringResponse(spansURL))) { //XXX: sorted!
 145.166 +                Map<String, String> occ = new HashMap<String, String>();
 145.167 +                occ.put("prefix", WebUtilities.escapeForHTMLElement(code.substring(currentCodePos, span[0])));
 145.168 +                occ.put("occurrence", WebUtilities.escapeForHTMLElement(code.substring(span[0], span[1])));
 145.169 +                occurrences.add(occ);
 145.170 +                currentCodePos = span[1];
 145.171 +            }
 145.172 +
 145.173 +            configurationData.put("suffix", WebUtilities.escapeForHTMLElement(code.substring(currentCodePos, code.length())));
 145.174 +        } else {
 145.175 +            configurationData.put("suffix", WebUtilities.escapeForHTMLElement(code));
 145.176 +        }
 145.177 +
 145.178 +        return processTemplate("ui-cat.html", configurationData);
 145.179 +    }
 145.180 +    
 145.181 +    @GET
 145.182 +    @Path("/snippet")
 145.183 +    @Produces("text/html")
 145.184 +    public String snippet(@QueryParam("path") String path, @QueryParam("relative") String relativePath, @QueryParam("pattern") String pattern) throws URISyntaxException, IOException, TemplateException {
 145.185 +        List<Map<String, String>> snippets = new LinkedList<Map<String, String>>();
 145.186 +
 145.187 +        URI codeURL = new URI("http://localhost:9998/index/cat?path=" + escapeForQuery(path) + "&relative=" + escapeForQuery(relativePath));
 145.188 +        String code = WebUtilities.requestStringResponse(codeURL);
 145.189 +        URI spansURL = new URI("http://localhost:9998/index/findSpans?path=" + escapeForQuery(path) + "&relativePath=" + escapeForQuery(relativePath) + "&pattern=" + escapeForQuery(pattern));
 145.190 +
 145.191 +        for (int[] span : parseSpans(WebUtilities.requestStringResponse(spansURL))) {
 145.192 +            snippets.add(prepareSnippet(code, span));
 145.193 +        }
 145.194 +
 145.195 +        return processTemplate("ui-snippet.html", Collections.<String, Object>singletonMap("snippets", snippets));
 145.196 +    }
 145.197 +
 145.198 +    @GET
 145.199 +    @Path("/apply")
 145.200 +    @Produces("text/html")
 145.201 +    public Response apply(@QueryParam("path") String path, @QueryParam("pattern") String pattern, @QueryParam("preview") @DefaultValue("") String preview, @QueryParam("download") @DefaultValue("") String download) throws URISyntaxException, IOException, TemplateException {
 145.202 +        if (!download.isEmpty()) {
 145.203 +            if (pattern != null && path != null) {
 145.204 +                URI u = new URI("http://localhost:9998/index/apply?path=" + escapeForQuery(path) + "&pattern=" + escapeForQuery(pattern));
 145.205 +
 145.206 +                return Response.temporaryRedirect(u).header("meta", "Content-Disposition: download; filename=\"patch.diff\"").build();
 145.207 +            }
 145.208 +        }
 145.209 +
 145.210 +        Map<String, Object> configurationData = new HashMap<String, Object>();
 145.211 +
 145.212 +        configurationData.put("paths", list());
 145.213 +        configurationData.put("selectedPath", path);
 145.214 +        configurationData.put("pattern", pattern);
 145.215 +        configurationData.put("patternEscaped", escapeForQuery(pattern));
 145.216 +        configurationData.put("examples", loadExamples());
 145.217 +
 145.218 +        if (pattern != null && path != null) {
 145.219 +            URI u = new URI("http://localhost:9998/index/apply?path=" + escapeForQuery(path) + "&pattern=" + escapeForQuery(pattern));
 145.220 +            long queryTime = System.currentTimeMillis();
 145.221 +            String diff = WebUtilities.requestStringResponse(u);
 145.222 +
 145.223 +            queryTime = System.currentTimeMillis() - queryTime;
 145.224 +
 145.225 +            configurationData.put("diff", diff);
 145.226 +
 145.227 +            StringBuilder sb = new StringBuilder();
 145.228 +
 145.229 +            for (String l : diff.split("\n")) {
 145.230 +                sb.append("<span");
 145.231 +
 145.232 +                for (Entry<String, String> e : prefix2SpanName.entrySet()) {
 145.233 +                    if (l.startsWith(e.getKey())) {
 145.234 +                        sb.append(" class='" + e.getValue() + "'");
 145.235 +                        break;
 145.236 +                    }
 145.237 +                }
 145.238 +
 145.239 +                sb.append(">");
 145.240 +                sb.append(l);
 145.241 +                sb.append("</span>\n");
 145.242 +            }
 145.243 +
 145.244 +            configurationData.put("result", sb.toString());
 145.245 +        }
 145.246 +
 145.247 +        return Response.ok(processTemplate("ui-apply.html", configurationData), "text/html").build();
 145.248 +    }
 145.249 +
 145.250 +    @GET
 145.251 +    @Path("/searchType")
 145.252 +    @Produces("text/html")
 145.253 +    public String searchType(@QueryParam("path") String path, @QueryParam("prefix") String prefix) throws URISyntaxException, IOException, TemplateException {
 145.254 +        Map<String, Object> configurationData = new HashMap<String, Object>();
 145.255 +
 145.256 +        configurationData.put("paths", list());
 145.257 +        configurationData.put("selectedPath", path);
 145.258 +        configurationData.put("prefix", prefix);
 145.259 +
 145.260 +        if (prefix != null && path != null) {
 145.261 +            URI u = new URI("http://localhost:9998/index/findType?path=" + escapeForQuery(path) + "&prefix=" + escapeForQuery(prefix));
 145.262 +            long queryTime = System.currentTimeMillis();
 145.263 +            @SuppressWarnings("unchecked") //XXX: should not trust something got from the network!
 145.264 +            Map<String, List<String>> types = Pojson.load(LinkedHashMap.class, u);
 145.265 +            List<Map<String, Object>> results = new LinkedList<Map<String, Object>>();
 145.266 +
 145.267 +            queryTime = System.currentTimeMillis() - queryTime;
 145.268 +
 145.269 +            for (Entry<String, List<String>> e : types.entrySet()) {
 145.270 +                for (String fqn : e.getValue()) {
 145.271 +                    Map<String, Object> found = new HashMap<String, Object>(3);
 145.272 +
 145.273 +                    found.put("fqn", fqn);
 145.274 +
 145.275 +                    if (fqn.contains("$")) {
 145.276 +                        fqn = fqn.substring(0, fqn.indexOf("$"));
 145.277 +                    }
 145.278 +
 145.279 +                    found.put("relativePath", e.getKey() + "/" + fqn.replace('.', '/') + ".java");
 145.280 +
 145.281 +                    results.add(found);
 145.282 +                }
 145.283 +            }
 145.284 +
 145.285 +            Collections.sort(results, new Comparator<Map<String, Object>>() {
 145.286 +                @Override public int compare(Map<String, Object> o1, Map<String, Object> o2) {
 145.287 +                    return ((String) o1.get("fqn")).compareTo((String) o2.get("fqn"));
 145.288 +                }
 145.289 +            });
 145.290 +            
 145.291 +            configurationData.put("results", results);
 145.292 +
 145.293 +            Map<String, Object> statistics = new HashMap<String, Object>();
 145.294 +
 145.295 +            statistics.put("queryTime", queryTime);
 145.296 +
 145.297 +            configurationData.put("statistics", statistics);
 145.298 +        }
 145.299 +
 145.300 +        return processTemplate("ui-findType.html", configurationData);
 145.301 +    }
 145.302 +
 145.303 +    private static final Map<String, String> prefix2SpanName = new LinkedHashMap<String, String>();
 145.304 +
 145.305 +    static {
 145.306 +        prefix2SpanName.put("-", "diff-removed");
 145.307 +        prefix2SpanName.put("+", "diff-added");
 145.308 +        prefix2SpanName.put("@@", "diff-hunk");
 145.309 +        prefix2SpanName.put("Index:", "diff-index");
 145.310 +    }
 145.311 +
 145.312 +    private static List<Map<String, String>> list() throws URISyntaxException {
 145.313 +        List<Map<String, String>> result = new LinkedList<Map<String, String>>();
 145.314 +
 145.315 +        for (String enc : WebUtilities.requestStringArrayResponse(new URI("http://localhost:9998/index/list"))) {
 145.316 +            Map<String, String> rootDesc = new HashMap<String, String>();
 145.317 +            String[] col = enc.split(":", 2);
 145.318 +
 145.319 +            rootDesc.put("segment", col[0]);
 145.320 +            rootDesc.put("displayName", col[1]);
 145.321 +            result.add(rootDesc);
 145.322 +        }
 145.323 +
 145.324 +        return result;
 145.325 +    }
 145.326 +    
 145.327 +    private static Iterable<int[]> parseSpans(String from) {
 145.328 +        if (from.isEmpty()) {
 145.329 +            return Collections.emptyList();
 145.330 +        }
 145.331 +        String[] split = from.split(":");
 145.332 +        List<int[]> result = new LinkedList<int[]>();
 145.333 +
 145.334 +        for (int i = 0; i < split.length; i += 2) {
 145.335 +            result.add(new int[] {
 145.336 +                Integer.parseInt(split[i + 0].trim()),
 145.337 +                Integer.parseInt(split[i + 1].trim())
 145.338 +            });
 145.339 +        }
 145.340 +
 145.341 +        return result;
 145.342 +    }
 145.343 +
 145.344 +    private static final int DESIRED_CONTEXT = 2;
 145.345 +
 145.346 +    private static Map<String, String> prepareSnippet(String code, int[] span) {
 145.347 +        int grandStart = span[0];
 145.348 +        int firstLineStart = grandStart = lineStart(code, grandStart);
 145.349 +
 145.350 +        while (grandStart > 0 && contextLength(code.substring(grandStart, firstLineStart)) < DESIRED_CONTEXT)
 145.351 +            grandStart = lineStart(code, grandStart - 1);
 145.352 +
 145.353 +        int grandEnd = span[1];
 145.354 +        int firstLineEnd = grandEnd = lineEnd(code, grandEnd);
 145.355 +        
 145.356 +        while (grandEnd < code.length() - 1 && contextLength(code.substring(firstLineEnd, grandEnd)) < DESIRED_CONTEXT)
 145.357 +            grandEnd = lineEnd(code, grandEnd + 1);
 145.358 +
 145.359 +        Map<String, String> result = new HashMap<String, String>();
 145.360 +        
 145.361 +        result.put("prefix", WebUtilities.escapeForHTMLElement(code.substring(grandStart, span[0])));
 145.362 +        result.put("occurrence", WebUtilities.escapeForHTMLElement(code.substring(span[0], span[1])));
 145.363 +        result.put("suffix", WebUtilities.escapeForHTMLElement(code.substring(span[1], grandEnd)));
 145.364 +
 145.365 +        return result;
 145.366 +    }
 145.367 +
 145.368 +    private static int lineStart(String code, int o) {
 145.369 +        while (o > 0 && code.charAt(o) != '\n') {
 145.370 +            o--;
 145.371 +        }
 145.372 +
 145.373 +        return o;
 145.374 +    }
 145.375 +
 145.376 +    private static int lineEnd(String code, int o) {
 145.377 +        while (o < code.length() - 1 && code.charAt(o) != '\n') {
 145.378 +            o++;
 145.379 +        }
 145.380 +
 145.381 +        return o;
 145.382 +    }
 145.383 +
 145.384 +    private static int contextLength(String in) {
 145.385 +        return in.replaceAll("\n[ \t]*\n", "\n").trim().split("\n").length;
 145.386 +    }
 145.387 +
 145.388 +    @SuppressWarnings("unchecked")
 145.389 +    private List<Map<String, String>> loadExamples() throws IOException, URISyntaxException {
 145.390 +        return Pojson.load(LinkedList.class, new URI("http://localhost:9998/index/examples"));
 145.391 +    }
 145.392 +
 145.393 +    private static String processTemplate(String template, Map<String, Object> configurationData) throws TemplateException, IOException {
 145.394 +        Configuration conf = new Configuration();
 145.395 +
 145.396 +        conf.setTemplateLoader(new TemplateLoaderImpl());
 145.397 +
 145.398 +        Template templ = conf.getTemplate(template);
 145.399 +        StringWriter out = new StringWriter();
 145.400 +
 145.401 +        templ.process(configurationData, out);
 145.402 +
 145.403 +        return out.toString();
 145.404 +    }
 145.405 +
 145.406 +    private static final class TemplateLoaderImpl implements TemplateLoader {
 145.407 +
 145.408 +        public Object findTemplateSource(String name) throws IOException {
 145.409 +            return TemplateLoaderImpl.class.getResourceAsStream(name);
 145.410 +        }
 145.411 +
 145.412 +        public long getLastModified(Object templateSource) {
 145.413 +            return 0L;
 145.414 +        }
 145.415 +
 145.416 +        public Reader getReader(Object templateSource, String encoding) throws IOException {
 145.417 +            InputStream in = (InputStream) templateSource;
 145.418 +
 145.419 +            return new InputStreamReader(in);
 145.420 +        }
 145.421 +
 145.422 +        public void closeTemplateSource(Object templateSource) throws IOException {
 145.423 +        }
 145.424 +    }
 145.425 +
 145.426 +}
   146.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   146.2 +++ b/sandbox/attributed-index-web/ui-apply.html	Thu Jun 23 15:07:16 2011 +0200
   146.3 @@ -0,0 +1,68 @@
   146.4 +<html>
   146.5 +<head>
   146.6 +    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
   146.7 +<#if results??>
   146.8 +    <script type="text/javascript">
   146.9 +        $(document).ready(function() {
  146.10 +            $('#list').find('dd').hide().end().find('dt').click(function() {
  146.11 +                current_dd=$(this).next();
  146.12 +                //XXX: will do the AJAX call for both show and hide!
  146.13 +                $.get("snippet?path=${selectedPath}&relative=" + current_dd.attr("id") + "&pattern=${patternEscaped}",function(data) {
  146.14 +                    current_dd.html(data).slideToggle();
  146.15 +                })
  146.16 +            });
  146.17 +        });
  146.18 +    </script>
  146.19 +</#if>
  146.20 +    <style type="text/css">
  146.21 +        .occurrence {background: #DDDD00;}
  146.22 +        .diff-removed {color: #FF0000;}
  146.23 +        .diff-added {color: #00FF00;}
  146.24 +        .diff-index {color: #0000FF;}
  146.25 +        .diff-hunk {color: #FF00FF;}
  146.26 +    </style>
  146.27 +</head>
  146.28 +<body>
  146.29 +<form method="get">
  146.30 +
  146.31 +<label for="path">Project:</label>
  146.32 +<select size="1" name="path">");
  146.33 +    <#list paths as path>
  146.34 +        <option <#if selectedPath?? && path.segment == selectedPath>selected</#if> value="${path.segment}">
  146.35 +            ${path.displayName}
  146.36 +        </option>
  146.37 +    </#list>
  146.38 +</select>
  146.39 +<br>
  146.40 +<label for="pattern">Pattern:</label><br>
  146.41 +<textarea rows="10" cols="40" name="pattern">
  146.42 +<#if pattern??>
  146.43 +${pattern}
  146.44 +</#if>
  146.45 +</textarea><br>
  146.46 +<input type="submit" name="preview" value="Show diff preview"/><input type="submit" name="download" value="Download diff"/>
  146.47 +</form>
  146.48 +
  146.49 +<div class="examples">
  146.50 +<#if examples??>
  146.51 +    Examples:
  146.52 +    <dl id="examples-list">
  146.53 +        <#list examples as example>
  146.54 +            <dt>${example.displayName}</dt>
  146.55 +            <dd><pre>${example.pattern}</pre>
  146.56 +            </dd>
  146.57 +        </#list>
  146.58 +    </dl>
  146.59 +</#if>
  146.60 +</div>
  146.61 +
  146.62 +<#if result??>
  146.63 +    Diff for rule: ${pattern}
  146.64 +<pre>${result}</pre>
  146.65 +</#if>
  146.66 +
  146.67 +<#if statistics??>
  146.68 +     Query time: ${statistics.queryTime}ms, matching files: ${statistics.files}.
  146.69 +</#if>
  146.70 +</body>
  146.71 +</html>
   147.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   147.2 +++ b/sandbox/attributed-index-web/ui-cat.html	Thu Jun 23 15:07:16 2011 +0200
   147.3 @@ -0,0 +1,10 @@
   147.4 +<html>
   147.5 +<head>
   147.6 +    <style type="text/css">
   147.7 +        .occurrence {BACKGROUND: #DDDD00;}
   147.8 +    </style>
   147.9 +</head>
  147.10 +<body>
  147.11 +<pre><#list occurrences as occurrence>${occurrence.prefix}<span class="occurrence">${occurrence.occurrence}</span></#list>${suffix}</pre>
  147.12 +</body>
  147.13 +</html>
   148.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   148.2 +++ b/sandbox/attributed-index-web/ui-findType.html	Thu Jun 23 15:07:16 2011 +0200
   148.3 @@ -0,0 +1,28 @@
   148.4 +<html>
   148.5 +<head>
   148.6 +    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
   148.7 +</head>
   148.8 +<body>
   148.9 +<form method="get">
  148.10 +<label for="path">Project:</label>
  148.11 +<select size="1" name="path">");
  148.12 +    <#list paths as path>
  148.13 +        <option <#if selectedPath?? && path.segment == selectedPath>selected</#if> value="${path.segment}">
  148.14 +            ${path.displayName}
  148.15 +        </option>
  148.16 +    </#list>
  148.17 +</select>
  148.18 +<br>
  148.19 +<label for="prefix">Type Name:</label><input type="text" name="prefix"<#if prefix??>value="${prefix}"</#if>/><br>
  148.20 +<input type="submit" name="Find Candidates"/>
  148.21 +</form>
  148.22 +
  148.23 +<#if results??>
  148.24 +    Found types:<br>
  148.25 +    <#list results as result>
  148.26 +        <a href="/index/ui/show?path=${selectedPath}&relative=${result.relativePath}">${result.fqn}</a><br>
  148.27 +    </#list>
  148.28 +</#if>
  148.29 +
  148.30 +</body>
  148.31 +</html>
   149.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   149.2 +++ b/sandbox/attributed-index-web/ui-search.html	Thu Jun 23 15:07:16 2011 +0200
   149.3 @@ -0,0 +1,70 @@
   149.4 +<html>
   149.5 +<head>
   149.6 +    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
   149.7 +<#if results??>
   149.8 +    <script type="text/javascript">
   149.9 +        $(document).ready(function() {
  149.10 +            $('#list').find('dd').hide().end().find('dt').click(function() {
  149.11 +                current_dd=$(this).next();
  149.12 +                //XXX: will do the AJAX call for both show and hide!
  149.13 +                $.get("snippet?path=${selectedPath}&relative=" + current_dd.attr("id") + "&pattern=${patternEscaped}",function(data) {
  149.14 +                    current_dd.html(data).slideToggle();
  149.15 +                })
  149.16 +            });
  149.17 +        });
  149.18 +    </script>
  149.19 +</#if>
  149.20 +    <style type="text/css">
  149.21 +        .occurrence {BACKGROUND: #DDDD00;}
  149.22 +    </style>
  149.23 +</head>
  149.24 +<body>
  149.25 +<form method="get">
  149.26 +
  149.27 +<label for="path">Project:</label>
  149.28 +<select size="1" name="path">");
  149.29 +    <#list paths as path>
  149.30 +        <option <#if selectedPath?? && path.segment == selectedPath>selected</#if> value="${path.segment}">
  149.31 +            ${path.displayName}
  149.32 +        </option>
  149.33 +    </#list>
  149.34 +</select>
  149.35 +<br>
  149.36 +<label for="pattern">Pattern:</label><br>
  149.37 +<textarea rows="10" cols="40" name="pattern">
  149.38 +<#if pattern??>
  149.39 +${pattern}
  149.40 +</#if>
  149.41 +</textarea><br>
  149.42 +<input type="submit" name="Find Candidates"/>
  149.43 +</form>
  149.44 +
  149.45 +<div class="examples">
  149.46 +<#if examples??>
  149.47 +    Examples:
  149.48 +    <dl id="examples-list">
  149.49 +        <#list examples as example>
  149.50 +            <dt>${example.displayName}</dt>
  149.51 +            <dd><pre>${example.pattern}</pre>
  149.52 +            </dd>
  149.53 +        </#list>
  149.54 +    </dl>
  149.55 +</#if>
  149.56 +</div>
  149.57 +
  149.58 +<#if results??>
  149.59 +    Found candidates for pattern: ${pattern}
  149.60 +    <dl id="list">
  149.61 +        <#list results as result>
  149.62 +            <dt>${result.relativePath}<a href="/index/ui/show?path=${selectedPath}&relative=${result.relativePath}&pattern=${patternEscaped}">show</a></dt>
  149.63 +            <dd id="${result.relativePath}">
  149.64 +            </dd>
  149.65 +        </#list>
  149.66 +    </dl>
  149.67 +</#if>
  149.68 +
  149.69 +<#if statistics??>
  149.70 +     Query time: ${statistics.queryTime}ms, matching files: ${statistics.files}.
  149.71 +</#if>
  149.72 +</body>
  149.73 +</html>
   150.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   150.2 +++ b/sandbox/attributed-index-web/ui-snippet.html	Thu Jun 23 15:07:16 2011 +0200
   150.3 @@ -0,0 +1,7 @@
   150.4 +<#if snippets??>
   150.5 +    <#list snippets as snippet>
   150.6 +        <pre>${snippet.prefix}<span class="occurrence">${snippet.occurrence}</span>${snippet.suffix}</pre><br>
   150.7 +    </#list>
   150.8 +<#else>
   150.9 +    No occurrences.
  150.10 +</#if>
   151.1 --- a/server/backend/base.web.api/build.xml	Wed Jun 22 12:05:27 2011 +0200
   151.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   151.3 @@ -1,74 +0,0 @@
   151.4 -<?xml version="1.0" encoding="UTF-8"?>
   151.5 -<!-- You may freely edit this file. See commented blocks below for -->
   151.6 -<!-- some examples of how to customize the build. -->
   151.7 -<!-- (If you delete it and reopen the project it will be recreated.) -->
   151.8 -<!-- By default, only the Clean and Build commands use this build script. -->
   151.9 -<!-- Commands such as Run, Debug, and Test only use this build script if -->
  151.10 -<!-- the Compile on Save feature is turned off for the project. -->
  151.11 -<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
  151.12 -<!-- in the project's Project Properties dialog box.-->
  151.13 -<project name="base.web.api" default="default" basedir=".">
  151.14 -    <description>Builds, tests, and runs the project base.web.api.</description>
  151.15 -    <import file="nbproject/build-impl.xml"/>
  151.16 -    <!--
  151.17 -
  151.18 -    There exist several targets which are by default empty and which can be 
  151.19 -    used for execution of your tasks. These targets are usually executed 
  151.20 -    before and after some main targets. They are: 
  151.21 -
  151.22 -      -pre-init:                 called before initialization of project properties
  151.23 -      -post-init:                called after initialization of project properties
  151.24 -      -pre-compile:              called before javac compilation
  151.25 -      -post-compile:             called after javac compilation
  151.26 -      -pre-compile-single:       called before javac compilation of single file
  151.27 -      -post-compile-single:      called after javac compilation of single file
  151.28 -      -pre-compile-test:         called before javac compilation of JUnit tests
  151.29 -      -post-compile-test:        called after javac compilation of JUnit tests
  151.30 -      -pre-compile-test-single:  called before javac compilation of single JUnit test
  151.31 -      -post-compile-test-single: called after javac compilation of single JUunit test
  151.32 -      -pre-jar:                  called before JAR building
  151.33 -      -post-jar:                 called after JAR building
  151.34 -      -post-clean:               called after cleaning build products
  151.35 -
  151.36 -    (Targets beginning with '-' are not intended to be called on their own.)
  151.37 -
  151.38 -    Example of inserting an obfuscator after compilation could look like this:
  151.39 -
  151.40 -        <target name="-post-compile">
  151.41 -            <obfuscate>
  151.42 -                <fileset dir="${build.classes.dir}"/>
  151.43 -            </obfuscate>
  151.44 -        </target>
  151.45 -
  151.46 -    For list of available properties check the imported 
  151.47 -    nbproject/build-impl.xml file. 
  151.48 -
  151.49 -
  151.50 -    Another way to customize the build is by overriding existing main targets.
  151.51 -    The targets of interest are: 
  151.52 -
  151.53 -      -init-macrodef-javac:     defines macro for javac compilation
  151.54 -      -init-macrodef-junit:     defines macro for junit execution
  151.55 -      -init-macrodef-debug:     defines macro for class debugging
  151.56 -      -init-macrodef-java:      defines macro for class execution
  151.57 -      -do-jar-with-manifest:    JAR building (if you are using a manifest)
  151.58 -      -do-jar-without-manifest: JAR building (if you are not using a manifest)
  151.59 -      run:                      execution of project 
  151.60 -      -javadoc-build:           Javadoc generation
  151.61 -      test-report:              JUnit report generation
  151.62 -
  151.63 -    An example of overriding the target for project execution could look like this:
  151.64 -
  151.65 -        <target name="run" depends="base.web.api-impl.jar">
  151.66 -            <exec dir="bin" executable="launcher.exe">
  151.67 -                <arg file="${dist.jar}"/>
  151.68 -            </exec>
  151.69 -        </target>
  151.70 -
  151.71 -    Notice that the overridden target depends on the jar target and not only on 
  151.72 -    the compile target as the regular run target does. Again, for a list of available 
  151.73 -    properties which you can use, check the target you are overriding in the
  151.74 -    nbproject/build-impl.xml file. 
  151.75 -
  151.76 -    -->
  151.77 -</project>
   152.1 --- a/server/backend/base.web.api/manifest.mf	Wed Jun 22 12:05:27 2011 +0200
   152.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   152.3 @@ -1,3 +0,0 @@
   152.4 -Manifest-Version: 1.0
   152.5 -X-COMMENT: Main-Class will be added automatically by build
   152.6 -
   153.1 --- a/server/backend/base.web.api/nbproject/build-impl.xml	Wed Jun 22 12:05:27 2011 +0200
   153.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   153.3 @@ -1,1068 +0,0 @@
   153.4 -<?xml version="1.0" encoding="UTF-8"?>
   153.5 -<!--
   153.6 -*** GENERATED FROM project.xml - DO NOT EDIT  ***
   153.7 -***         EDIT ../build.xml INSTEAD         ***
   153.8 -
   153.9 -For the purpose of easier reading the script
  153.10 -is divided into following sections:
  153.11 -
  153.12 -  - initialization
  153.13 -  - compilation
  153.14 -  - jar
  153.15 -  - execution
  153.16 -  - debugging
  153.17 -  - javadoc
  153.18 -  - junit compilation
  153.19 -  - junit execution
  153.20 -  - junit debugging
  153.21 -  - applet
  153.22 -  - cleanup
  153.23 -
  153.24 -        -->
  153.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">
  153.26 -    <fail message="Please build using Ant 1.8.0 or higher.">
  153.27 -        <condition>
  153.28 -            <not>
  153.29 -                <antversion atleast="1.8.0"/>
  153.30 -            </not>
  153.31 -        </condition>
  153.32 -    </fail>
  153.33 -    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
  153.34 -    <!-- 
  153.35 -                ======================
  153.36 -                INITIALIZATION SECTION 
  153.37 -                ======================
  153.38 -            -->
  153.39 -    <target name="-pre-init">
  153.40 -        <!-- Empty placeholder for easier customization. -->
  153.41 -        <!-- You can override this target in the ../build.xml file. -->
  153.42 -    </target>
  153.43 -    <target depends="-pre-init" name="-init-private">
  153.44 -        <property file="nbproject/private/config.properties"/>
  153.45 -        <property file="nbproject/private/configs/${config}.properties"/>
  153.46 -        <property file="nbproject/private/private.properties"/>
  153.47 -    </target>
  153.48 -    <target name="-pre-init-libraries">
  153.49 -        <property location="../../lib/nblibraries.properties" name="libraries.path"/>
  153.50 -        <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
  153.51 -        <pathconvert dirsep="/" property="libraries.dir">
  153.52 -            <path path="${libraries.dir.nativedirsep}"/>
  153.53 -        </pathconvert>
  153.54 -        <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
  153.55 -        <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
  153.56 -    </target>
  153.57 -    <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
  153.58 -        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
  153.59 -            <filterchain>
  153.60 -                <replacestring from="$${base}" to="${libraries.dir}"/>
  153.61 -                <escapeunicode/>
  153.62 -            </filterchain>
  153.63 -        </loadproperties>
  153.64 -    </target>
  153.65 -    <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
  153.66 -        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
  153.67 -            <filterchain>
  153.68 -                <replacestring from="$${base}" to="${libraries.dir}"/>
  153.69 -                <escapeunicode/>
  153.70 -            </filterchain>
  153.71 -        </loadproperties>
  153.72 -    </target>
  153.73 -    <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
  153.74 -        <property file="${user.properties.file}"/>
  153.75 -        <!-- The two properties below are usually overridden -->
  153.76 -        <!-- by the active platform. Just a fallback. -->
  153.77 -        <property name="default.javac.source" value="1.4"/>
  153.78 -        <property name="default.javac.target" value="1.4"/>
  153.79 -    </target>
  153.80 -    <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
  153.81 -        <property file="nbproject/configs/${config}.properties"/>
  153.82 -        <property file="nbproject/project.properties"/>
  153.83 -    </target>
  153.84 -    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
  153.85 -        <available file="${manifest.file}" property="manifest.available"/>
  153.86 -        <condition property="splashscreen.available">
  153.87 -            <and>
  153.88 -                <not>
  153.89 -                    <equals arg1="${application.splash}" arg2="" trim="true"/>
  153.90 -                </not>
  153.91 -                <available file="${application.splash}"/>
  153.92 -            </and>
  153.93 -        </condition>
  153.94 -        <condition property="main.class.available">
  153.95 -            <and>
  153.96 -                <isset property="main.class"/>
  153.97 -                <not>
  153.98 -                    <equals arg1="${main.class}" arg2="" trim="true"/>
  153.99 -                </not>
 153.100 -            </and>
 153.101 -        </condition>
 153.102 -        <condition property="manifest.available+main.class">
 153.103 -            <and>
 153.104 -                <isset property="manifest.available"/>
 153.105 -                <isset property="main.class.available"/>
 153.106 -            </and>
 153.107 -        </condition>
 153.108 -        <condition property="do.archive">
 153.109 -            <not>
 153.110 -                <istrue value="${jar.archive.disabled}"/>
 153.111 -            </not>
 153.112 -        </condition>
 153.113 -        <condition property="do.mkdist">
 153.114 -            <and>
 153.115 -                <isset property="do.archive"/>
 153.116 -                <isset property="libs.CopyLibs.classpath"/>
 153.117 -                <not>
 153.118 -                    <istrue value="${mkdist.disabled}"/>
 153.119 -                </not>
 153.120 -            </and>
 153.121 -        </condition>
 153.122 -        <condition property="manifest.available+main.class+mkdist.available">
 153.123 -            <and>
 153.124 -                <istrue value="${manifest.available+main.class}"/>
 153.125 -                <isset property="do.mkdist"/>
 153.126 -            </and>
 153.127 -        </condition>
 153.128 -        <condition property="do.archive+manifest.available">
 153.129 -            <and>
 153.130 -                <isset property="manifest.available"/>
 153.131 -                <istrue value="${do.archive}"/>
 153.132 -            </and>
 153.133 -        </condition>
 153.134 -        <condition property="do.archive+main.class.available">
 153.135 -            <and>
 153.136 -                <isset property="main.class.available"/>
 153.137 -                <istrue value="${do.archive}"/>
 153.138 -            </and>
 153.139 -        </condition>
 153.140 -        <condition property="do.archive+splashscreen.available">
 153.141 -            <and>
 153.142 -                <isset property="splashscreen.available"/>
 153.143 -                <istrue value="${do.archive}"/>
 153.144 -            </and>
 153.145 -        </condition>
 153.146 -        <condition property="do.archive+manifest.available+main.class">
 153.147 -            <and>
 153.148 -                <istrue value="${manifest.available+main.class}"/>
 153.149 -                <istrue value="${do.archive}"/>
 153.150 -            </and>
 153.151 -        </condition>
 153.152 -        <condition property="manifest.available-mkdist.available">
 153.153 -            <or>
 153.154 -                <istrue value="${manifest.available}"/>
 153.155 -                <isset property="do.mkdist"/>
 153.156 -            </or>
 153.157 -        </condition>
 153.158 -        <condition property="manifest.available+main.class-mkdist.available">
 153.159 -            <or>
 153.160 -                <istrue value="${manifest.available+main.class}"/>
 153.161 -                <isset property="do.mkdist"/>
 153.162 -            </or>
 153.163 -        </condition>
 153.164 -        <condition property="have.tests">
 153.165 -            <or>
 153.166 -                <available file="${test.src.dir}"/>
 153.167 -            </or>
 153.168 -        </condition>
 153.169 -        <condition property="have.sources">
 153.170 -            <or>
 153.171 -                <available file="${src.dir}"/>
 153.172 -            </or>
 153.173 -        </condition>
 153.174 -        <condition property="netbeans.home+have.tests">
 153.175 -            <and>
 153.176 -                <isset property="netbeans.home"/>
 153.177 -                <isset property="have.tests"/>
 153.178 -            </and>
 153.179 -        </condition>
 153.180 -        <condition property="no.javadoc.preview">
 153.181 -            <and>
 153.182 -                <isset property="javadoc.preview"/>
 153.183 -                <isfalse value="${javadoc.preview}"/>
 153.184 -            </and>
 153.185 -        </condition>
 153.186 -        <property name="run.jvmargs" value=""/>
 153.187 -        <property name="javac.compilerargs" value=""/>
 153.188 -        <property name="work.dir" value="${basedir}"/>
 153.189 -        <condition property="no.deps">
 153.190 -            <and>
 153.191 -                <istrue value="${no.dependencies}"/>
 153.192 -            </and>
 153.193 -        </condition>
 153.194 -        <property name="javac.debug" value="true"/>
 153.195 -        <property name="javadoc.preview" value="true"/>
 153.196 -        <property name="application.args" value=""/>
 153.197 -        <property name="source.encoding" value="${file.encoding}"/>
 153.198 -        <property name="runtime.encoding" value="${source.encoding}"/>
 153.199 -        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
 153.200 -            <and>
 153.201 -                <isset property="javadoc.encoding"/>
 153.202 -                <not>
 153.203 -                    <equals arg1="${javadoc.encoding}" arg2=""/>
 153.204 -                </not>
 153.205 -            </and>
 153.206 -        </condition>
 153.207 -        <property name="javadoc.encoding.used" value="${source.encoding}"/>
 153.208 -        <property name="includes" value="**"/>
 153.209 -        <property name="excludes" value=""/>
 153.210 -        <property name="do.depend" value="false"/>
 153.211 -        <condition property="do.depend.true">
 153.212 -            <istrue value="${do.depend}"/>
 153.213 -        </condition>
 153.214 -        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
 153.215 -        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
 153.216 -            <length length="0" string="${endorsed.classpath}" when="greater"/>
 153.217 -        </condition>
 153.218 -        <condition else="false" property="jdkBug6558476">
 153.219 -            <and>
 153.220 -                <matches pattern="1\.[56]" string="${java.specification.version}"/>
 153.221 -                <not>
 153.222 -                    <os family="unix"/>
 153.223 -                </not>
 153.224 -            </and>
 153.225 -        </condition>
 153.226 -        <property name="javac.fork" value="${jdkBug6558476}"/>
 153.227 -        <property name="jar.index" value="false"/>
 153.228 -        <property name="jar.index.metainf" value="${jar.index}"/>
 153.229 -        <property name="copylibs.rebase" value="true"/>
 153.230 -        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
 153.231 -    </target>
 153.232 -    <target name="-post-init">
 153.233 -        <!-- Empty placeholder for easier customization. -->
 153.234 -        <!-- You can override this target in the ../build.xml file. -->
 153.235 -    </target>
 153.236 -    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
 153.237 -        <fail unless="src.dir">Must set src.dir</fail>
 153.238 -        <fail unless="test.src.dir">Must set test.src.dir</fail>
 153.239 -        <fail unless="build.dir">Must set build.dir</fail>
 153.240 -        <fail unless="dist.dir">Must set dist.dir</fail>
 153.241 -        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
 153.242 -        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
 153.243 -        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
 153.244 -        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
 153.245 -        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
 153.246 -        <fail unless="dist.jar">Must set dist.jar</fail>
 153.247 -    </target>
 153.248 -    <target name="-init-macrodef-property">
 153.249 -        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
 153.250 -            <attribute name="name"/>
 153.251 -            <attribute name="value"/>
 153.252 -            <sequential>
 153.253 -                <property name="@{name}" value="${@{value}}"/>
 153.254 -            </sequential>
 153.255 -        </macrodef>
 153.256 -    </target>
 153.257 -    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
 153.258 -        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
 153.259 -            <attribute default="${src.dir}" name="srcdir"/>
 153.260 -            <attribute default="${build.classes.dir}" name="destdir"/>
 153.261 -            <attribute default="${javac.classpath}" name="classpath"/>
 153.262 -            <attribute default="${javac.processorpath}" name="processorpath"/>
 153.263 -            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
 153.264 -            <attribute default="${includes}" name="includes"/>
 153.265 -            <attribute default="${excludes}" name="excludes"/>
 153.266 -            <attribute default="${javac.debug}" name="debug"/>
 153.267 -            <attribute default="${empty.dir}" name="sourcepath"/>
 153.268 -            <attribute default="${empty.dir}" name="gensrcdir"/>
 153.269 -            <element name="customize" optional="true"/>
 153.270 -            <sequential>
 153.271 -                <property location="${build.dir}/empty" name="empty.dir"/>
 153.272 -                <mkdir dir="${empty.dir}"/>
 153.273 -                <mkdir dir="@{apgeneratedsrcdir}"/>
 153.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}">
 153.275 -                    <src>
 153.276 -                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
 153.277 -                            <include name="*"/>
 153.278 -                        </dirset>
 153.279 -                    </src>
 153.280 -                    <classpath>
 153.281 -                        <path path="@{classpath}"/>
 153.282 -                    </classpath>
 153.283 -                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
 153.284 -                    <compilerarg line="${javac.compilerargs}"/>
 153.285 -                    <compilerarg value="-processorpath"/>
 153.286 -                    <compilerarg path="@{processorpath}:${empty.dir}"/>
 153.287 -                    <compilerarg line="${ap.processors.internal}"/>
 153.288 -                    <compilerarg line="${annotation.processing.processor.options}"/>
 153.289 -                    <compilerarg value="-s"/>
 153.290 -                    <compilerarg path="@{apgeneratedsrcdir}"/>
 153.291 -                    <compilerarg line="${ap.proc.none.internal}"/>
 153.292 -                    <customize/>
 153.293 -                </javac>
 153.294 -            </sequential>
 153.295 -        </macrodef>
 153.296 -    </target>
 153.297 -    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
 153.298 -        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
 153.299 -            <attribute default="${src.dir}" name="srcdir"/>
 153.300 -            <attribute default="${build.classes.dir}" name="destdir"/>
 153.301 -            <attribute default="${javac.classpath}" name="classpath"/>
 153.302 -            <attribute default="${javac.processorpath}" name="processorpath"/>
 153.303 -            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
 153.304 -            <attribute default="${includes}" name="includes"/>
 153.305 -            <attribute default="${excludes}" name="excludes"/>
 153.306 -            <attribute default="${javac.debug}" name="debug"/>
 153.307 -            <attribute default="${empty.dir}" name="sourcepath"/>
 153.308 -            <attribute default="${empty.dir}" name="gensrcdir"/>
 153.309 -            <element name="customize" optional="true"/>
 153.310 -            <sequential>
 153.311 -                <property location="${build.dir}/empty" name="empty.dir"/>
 153.312 -                <mkdir dir="${empty.dir}"/>
 153.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}">
 153.314 -                    <src>
 153.315 -                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
 153.316 -                            <include name="*"/>
 153.317 -                        </dirset>
 153.318 -                    </src>
 153.319 -                    <classpath>
 153.320 -                        <path path="@{classpath}"/>
 153.321 -                    </classpath>
 153.322 -                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
 153.323 -                    <compilerarg line="${javac.compilerargs}"/>
 153.324 -                    <customize/>
 153.325 -                </javac>
 153.326 -            </sequential>
 153.327 -        </macrodef>
 153.328 -    </target>
 153.329 -    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
 153.330 -        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
 153.331 -            <attribute default="${src.dir}" name="srcdir"/>
 153.332 -            <attribute default="${build.classes.dir}" name="destdir"/>
 153.333 -            <attribute default="${javac.classpath}" name="classpath"/>
 153.334 -            <sequential>
 153.335 -                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
 153.336 -                    <classpath>
 153.337 -                        <path path="@{classpath}"/>
 153.338 -                    </classpath>
 153.339 -                </depend>
 153.340 -            </sequential>
 153.341 -        </macrodef>
 153.342 -        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
 153.343 -            <attribute default="${build.classes.dir}" name="destdir"/>
 153.344 -            <sequential>
 153.345 -                <fail unless="javac.includes">Must set javac.includes</fail>
 153.346 -                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
 153.347 -                    <path>
 153.348 -                        <filelist dir="@{destdir}" files="${javac.includes}"/>
 153.349 -                    </path>
 153.350 -                    <globmapper from="*.java" to="*.class"/>
 153.351 -                </pathconvert>
 153.352 -                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
 153.353 -                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
 153.354 -                <delete>
 153.355 -                    <files includesfile="${javac.includesfile.binary}"/>
 153.356 -                </delete>
 153.357 -                <delete>
 153.358 -                    <fileset file="${javac.includesfile.binary}"/>
 153.359 -                </delete>
 153.360 -            </sequential>
 153.361 -        </macrodef>
 153.362 -    </target>
 153.363 -    <target name="-init-macrodef-junit">
 153.364 -        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
 153.365 -            <attribute default="${includes}" name="includes"/>
 153.366 -            <attribute default="${excludes}" name="excludes"/>
 153.367 -            <attribute default="**" name="testincludes"/>
 153.368 -            <sequential>
 153.369 -                <property name="junit.forkmode" value="perTest"/>
 153.370 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
 153.371 -                    <batchtest todir="${build.test.results.dir}">
 153.372 -                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
 153.373 -                            <filename name="@{testincludes}"/>
 153.374 -                        </fileset>
 153.375 -                    </batchtest>
 153.376 -                    <classpath>
 153.377 -                        <path path="${run.test.classpath}"/>
 153.378 -                    </classpath>
 153.379 -                    <syspropertyset>
 153.380 -                        <propertyref prefix="test-sys-prop."/>
 153.381 -                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
 153.382 -                    </syspropertyset>
 153.383 -                    <formatter type="brief" usefile="false"/>
 153.384 -                    <formatter type="xml"/>
 153.385 -                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
 153.386 -                    <jvmarg value="-ea"/>
 153.387 -                    <jvmarg line="${run.jvmargs}"/>
 153.388 -                </junit>
 153.389 -            </sequential>
 153.390 -        </macrodef>
 153.391 -    </target>
 153.392 -    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
 153.393 -    <target name="-profile-pre-init">
 153.394 -        <!-- Empty placeholder for easier customization. -->
 153.395 -        <!-- You can override this target in the ../build.xml file. -->
 153.396 -    </target>
 153.397 -    <target name="-profile-post-init">
 153.398 -        <!-- Empty placeholder for easier customization. -->
 153.399 -        <!-- You can override this target in the ../build.xml file. -->
 153.400 -    </target>
 153.401 -    <target name="-profile-init-macrodef-profile">
 153.402 -        <macrodef name="resolve">
 153.403 -            <attribute name="name"/>
 153.404 -            <attribute name="value"/>
 153.405 -            <sequential>
 153.406 -                <property name="@{name}" value="${env.@{value}}"/>
 153.407 -            </sequential>
 153.408 -        </macrodef>
 153.409 -        <macrodef name="profile">
 153.410 -            <attribute default="${main.class}" name="classname"/>
 153.411 -            <element name="customize" optional="true"/>
 153.412 -            <sequential>
 153.413 -                <property environment="env"/>
 153.414 -                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
 153.415 -                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
 153.416 -                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
 153.417 -                    <jvmarg line="${profiler.info.jvmargs}"/>
 153.418 -                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
 153.419 -                    <arg line="${application.args}"/>
 153.420 -                    <classpath>
 153.421 -                        <path path="${run.classpath}"/>
 153.422 -                    </classpath>
 153.423 -                    <syspropertyset>
 153.424 -                        <propertyref prefix="run-sys-prop."/>
 153.425 -                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
 153.426 -                    </syspropertyset>
 153.427 -                    <customize/>
 153.428 -                </java>
 153.429 -            </sequential>
 153.430 -        </macrodef>
 153.431 -    </target>
 153.432 -    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
 153.433 -        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
 153.434 -        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
 153.435 -    </target>
 153.436 -    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
 153.437 -        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
 153.438 -            <attribute default="${main.class}" name="name"/>
 153.439 -            <attribute default="${debug.classpath}" name="classpath"/>
 153.440 -            <attribute default="" name="stopclassname"/>
 153.441 -            <sequential>
 153.442 -                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
 153.443 -                    <classpath>
 153.444 -                        <path path="@{classpath}"/>
 153.445 -                    </classpath>
 153.446 -                </nbjpdastart>
 153.447 -            </sequential>
 153.448 -        </macrodef>
 153.449 -        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
 153.450 -            <attribute default="${build.classes.dir}" name="dir"/>
 153.451 -            <sequential>
 153.452 -                <nbjpdareload>
 153.453 -                    <fileset dir="@{dir}" includes="${fix.classes}">
 153.454 -                        <include name="${fix.includes}*.class"/>
 153.455 -                    </fileset>
 153.456 -                </nbjpdareload>
 153.457 -            </sequential>
 153.458 -        </macrodef>
 153.459 -    </target>
 153.460 -    <target name="-init-debug-args">
 153.461 -        <property name="version-output" value="java version &quot;${ant.java.version}"/>
 153.462 -        <condition property="have-jdk-older-than-1.4">
 153.463 -            <or>
 153.464 -                <contains string="${version-output}" substring="java version &quot;1.0"/>
 153.465 -                <contains string="${version-output}" substring="java version &quot;1.1"/>
 153.466 -                <contains string="${version-output}" substring="java version &quot;1.2"/>
 153.467 -                <contains string="${version-output}" substring="java version &quot;1.3"/>
 153.468 -            </or>
 153.469 -        </condition>
 153.470 -        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
 153.471 -            <istrue value="${have-jdk-older-than-1.4}"/>
 153.472 -        </condition>
 153.473 -        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
 153.474 -            <os family="windows"/>
 153.475 -        </condition>
 153.476 -        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
 153.477 -            <isset property="debug.transport"/>
 153.478 -        </condition>
 153.479 -    </target>
 153.480 -    <target depends="-init-debug-args" name="-init-macrodef-debug">
 153.481 -        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
 153.482 -            <attribute default="${main.class}" name="classname"/>
 153.483 -            <attribute default="${debug.classpath}" name="classpath"/>
 153.484 -            <element name="customize" optional="true"/>
 153.485 -            <sequential>
 153.486 -                <java classname="@{classname}" dir="${work.dir}" fork="true">
 153.487 -                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
 153.488 -                    <jvmarg line="${debug-args-line}"/>
 153.489 -                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
 153.490 -                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
 153.491 -                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
 153.492 -                    <jvmarg line="${run.jvmargs}"/>
 153.493 -                    <classpath>
 153.494 -                        <path path="@{classpath}"/>
 153.495 -                    </classpath>
 153.496 -                    <syspropertyset>
 153.497 -                        <propertyref prefix="run-sys-prop."/>
 153.498 -                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
 153.499 -                    </syspropertyset>
 153.500 -                    <customize/>
 153.501 -                </java>
 153.502 -            </sequential>
 153.503 -        </macrodef>
 153.504 -    </target>
 153.505 -    <target name="-init-macrodef-java">
 153.506 -        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
 153.507 -            <attribute default="${main.class}" name="classname"/>
 153.508 -            <attribute default="${run.classpath}" name="classpath"/>
 153.509 -            <element name="customize" optional="true"/>
 153.510 -            <sequential>
 153.511 -                <java classname="@{classname}" dir="${work.dir}" fork="true">
 153.512 -                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
 153.513 -                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
 153.514 -                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
 153.515 -                    <jvmarg line="${run.jvmargs}"/>
 153.516 -                    <classpath>
 153.517 -                        <path path="@{classpath}"/>
 153.518 -                    </classpath>
 153.519 -                    <syspropertyset>
 153.520 -                        <propertyref prefix="run-sys-prop."/>
 153.521 -                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
 153.522 -                    </syspropertyset>
 153.523 -                    <customize/>
 153.524 -                </java>
 153.525 -            </sequential>
 153.526 -        </macrodef>
 153.527 -    </target>
 153.528 -    <target name="-init-macrodef-copylibs">
 153.529 -        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
 153.530 -            <attribute default="${manifest.file}" name="manifest"/>
 153.531 -            <element name="customize" optional="true"/>
 153.532 -            <sequential>
 153.533 -                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
 153.534 -                <pathconvert property="run.classpath.without.build.classes.dir">
 153.535 -                    <path path="${run.classpath}"/>
 153.536 -                    <map from="${build.classes.dir.resolved}" to=""/>
 153.537 -                </pathconvert>
 153.538 -                <pathconvert pathsep=" " property="jar.classpath">
 153.539 -                    <path path="${run.classpath.without.build.classes.dir}"/>
 153.540 -                    <chainedmapper>
 153.541 -                        <flattenmapper/>
 153.542 -                        <globmapper from="*" to="lib/*"/>
 153.543 -                    </chainedmapper>
 153.544 -                </pathconvert>
 153.545 -                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
 153.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}">
 153.547 -                    <fileset dir="${build.classes.dir}"/>
 153.548 -                    <manifest>
 153.549 -                        <attribute name="Class-Path" value="${jar.classpath}"/>
 153.550 -                        <customize/>
 153.551 -                    </manifest>
 153.552 -                </copylibs>
 153.553 -            </sequential>
 153.554 -        </macrodef>
 153.555 -    </target>
 153.556 -    <target name="-init-presetdef-jar">
 153.557 -        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
 153.558 -            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
 153.559 -                <j2seproject1:fileset dir="${build.classes.dir}"/>
 153.560 -            </jar>
 153.561 -        </presetdef>
 153.562 -    </target>
 153.563 -    <target name="-init-ap-cmdline-properties">
 153.564 -        <property name="annotation.processing.enabled" value="true"/>
 153.565 -        <property name="annotation.processing.processors.list" value=""/>
 153.566 -        <property name="annotation.processing.processor.options" value=""/>
 153.567 -        <property name="annotation.processing.run.all.processors" value="true"/>
 153.568 -        <property name="javac.processorpath" value="${javac.classpath}"/>
 153.569 -        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
 153.570 -        <condition property="ap.supported.internal" value="true">
 153.571 -            <not>
 153.572 -                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
 153.573 -            </not>
 153.574 -        </condition>
 153.575 -    </target>
 153.576 -    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
 153.577 -        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
 153.578 -            <isfalse value="${annotation.processing.run.all.processors}"/>
 153.579 -        </condition>
 153.580 -        <condition else="" property="ap.proc.none.internal" value="-proc:none">
 153.581 -            <isfalse value="${annotation.processing.enabled}"/>
 153.582 -        </condition>
 153.583 -    </target>
 153.584 -    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
 153.585 -        <property name="ap.cmd.line.internal" value=""/>
 153.586 -    </target>
 153.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"/>
 153.588 -    <!--
 153.589 -                ===================
 153.590 -                COMPILATION SECTION
 153.591 -                ===================
 153.592 -            -->
 153.593 -    <target name="-deps-jar-init" unless="built-jar.properties">
 153.594 -        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
 153.595 -        <delete file="${built-jar.properties}" quiet="true"/>
 153.596 -    </target>
 153.597 -    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
 153.598 -        <echo level="warn" message="Cycle detected: base.web.api was already built"/>
 153.599 -    </target>
 153.600 -    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
 153.601 -        <mkdir dir="${build.dir}"/>
 153.602 -        <touch file="${built-jar.properties}" verbose="false"/>
 153.603 -        <property file="${built-jar.properties}" prefix="already.built.jar."/>
 153.604 -        <antcall target="-warn-already-built-jar"/>
 153.605 -        <propertyfile file="${built-jar.properties}">
 153.606 -            <entry key="${basedir}" value=""/>
 153.607 -        </propertyfile>
 153.608 -    </target>
 153.609 -    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
 153.610 -    <target depends="init" name="-check-automatic-build">
 153.611 -        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
 153.612 -    </target>
 153.613 -    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
 153.614 -        <antcall target="clean"/>
 153.615 -    </target>
 153.616 -    <target depends="init,deps-jar" name="-pre-pre-compile">
 153.617 -        <mkdir dir="${build.classes.dir}"/>
 153.618 -    </target>
 153.619 -    <target name="-pre-compile">
 153.620 -        <!-- Empty placeholder for easier customization. -->
 153.621 -        <!-- You can override this target in the ../build.xml file. -->
 153.622 -    </target>
 153.623 -    <target if="do.depend.true" name="-compile-depend">
 153.624 -        <pathconvert property="build.generated.subdirs">
 153.625 -            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 153.626 -                <include name="*"/>
 153.627 -            </dirset>
 153.628 -        </pathconvert>
 153.629 -        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
 153.630 -    </target>
 153.631 -    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
 153.632 -        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
 153.633 -        <copy todir="${build.classes.dir}">
 153.634 -            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 153.635 -        </copy>
 153.636 -    </target>
 153.637 -    <target if="has.persistence.xml" name="-copy-persistence-xml">
 153.638 -        <mkdir dir="${build.classes.dir}/META-INF"/>
 153.639 -        <copy todir="${build.classes.dir}/META-INF">
 153.640 -            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
 153.641 -        </copy>
 153.642 -    </target>
 153.643 -    <target name="-post-compile">
 153.644 -        <!-- Empty placeholder for easier customization. -->
 153.645 -        <!-- You can override this target in the ../build.xml file. -->
 153.646 -    </target>
 153.647 -    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
 153.648 -    <target name="-pre-compile-single">
 153.649 -        <!-- Empty placeholder for easier customization. -->
 153.650 -        <!-- You can override this target in the ../build.xml file. -->
 153.651 -    </target>
 153.652 -    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
 153.653 -        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
 153.654 -        <j2seproject3:force-recompile/>
 153.655 -        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
 153.656 -    </target>
 153.657 -    <target name="-post-compile-single">
 153.658 -        <!-- Empty placeholder for easier customization. -->
 153.659 -        <!-- You can override this target in the ../build.xml file. -->
 153.660 -    </target>
 153.661 -    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
 153.662 -    <!--
 153.663 -                ====================
 153.664 -                JAR BUILDING SECTION
 153.665 -                ====================
 153.666 -            -->
 153.667 -    <target depends="init" name="-pre-pre-jar">
 153.668 -        <dirname file="${dist.jar}" property="dist.jar.dir"/>
 153.669 -        <mkdir dir="${dist.jar.dir}"/>
 153.670 -    </target>
 153.671 -    <target name="-pre-jar">
 153.672 -        <!-- Empty placeholder for easier customization. -->
 153.673 -        <!-- You can override this target in the ../build.xml file. -->
 153.674 -    </target>
 153.675 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
 153.676 -        <j2seproject1:jar/>
 153.677 -    </target>
 153.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">
 153.679 -        <j2seproject1:jar manifest="${manifest.file}"/>
 153.680 -    </target>
 153.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">
 153.682 -        <j2seproject1:jar manifest="${manifest.file}">
 153.683 -            <j2seproject1:manifest>
 153.684 -                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
 153.685 -            </j2seproject1:manifest>
 153.686 -        </j2seproject1:jar>
 153.687 -        <echo level="info">To run this application from the command line without Ant, try:</echo>
 153.688 -        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
 153.689 -        <property location="${dist.jar}" name="dist.jar.resolved"/>
 153.690 -        <pathconvert property="run.classpath.with.dist.jar">
 153.691 -            <path path="${run.classpath}"/>
 153.692 -            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
 153.693 -        </pathconvert>
 153.694 -        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
 153.695 -    </target>
 153.696 -    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
 153.697 -        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
 153.698 -        <touch file="${tmp.manifest.file}" verbose="false"/>
 153.699 -    </target>
 153.700 -    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
 153.701 -        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
 153.702 -        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
 153.703 -    </target>
 153.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">
 153.705 -        <manifest file="${tmp.manifest.file}" mode="update">
 153.706 -            <attribute name="Main-Class" value="${main.class}"/>
 153.707 -        </manifest>
 153.708 -    </target>
 153.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">
 153.710 -        <basename file="${application.splash}" property="splashscreen.basename"/>
 153.711 -        <mkdir dir="${build.classes.dir}/META-INF"/>
 153.712 -        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
 153.713 -        <manifest file="${tmp.manifest.file}" mode="update">
 153.714 -            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
 153.715 -        </manifest>
 153.716 -    </target>
 153.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">
 153.718 -        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
 153.719 -        <echo level="info">To run this application from the command line without Ant, try:</echo>
 153.720 -        <property location="${dist.jar}" name="dist.jar.resolved"/>
 153.721 -        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
 153.722 -    </target>
 153.723 -    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
 153.724 -        <delete>
 153.725 -            <fileset file="${tmp.manifest.file}"/>
 153.726 -        </delete>
 153.727 -    </target>
 153.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"/>
 153.729 -    <target name="-post-jar">
 153.730 -        <!-- Empty placeholder for easier customization. -->
 153.731 -        <!-- You can override this target in the ../build.xml file. -->
 153.732 -    </target>
 153.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"/>
 153.734 -    <!--
 153.735 -                =================
 153.736 -                EXECUTION SECTION
 153.737 -                =================
 153.738 -            -->
 153.739 -    <target depends="init,compile" description="Run a main class." name="run">
 153.740 -        <j2seproject1:java>
 153.741 -            <customize>
 153.742 -                <arg line="${application.args}"/>
 153.743 -            </customize>
 153.744 -        </j2seproject1:java>
 153.745 -    </target>
 153.746 -    <target name="-do-not-recompile">
 153.747 -        <property name="javac.includes.binary" value=""/>
 153.748 -    </target>
 153.749 -    <target depends="init,compile-single" name="run-single">
 153.750 -        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
 153.751 -        <j2seproject1:java classname="${run.class}"/>
 153.752 -    </target>
 153.753 -    <target depends="init,compile-test-single" name="run-test-with-main">
 153.754 -        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
 153.755 -        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
 153.756 -    </target>
 153.757 -    <!--
 153.758 -                =================
 153.759 -                DEBUGGING SECTION
 153.760 -                =================
 153.761 -            -->
 153.762 -    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
 153.763 -        <j2seproject1:nbjpdastart name="${debug.class}"/>
 153.764 -    </target>
 153.765 -    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
 153.766 -        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
 153.767 -    </target>
 153.768 -    <target depends="init,compile" name="-debug-start-debuggee">
 153.769 -        <j2seproject3:debug>
 153.770 -            <customize>
 153.771 -                <arg line="${application.args}"/>
 153.772 -            </customize>
 153.773 -        </j2seproject3:debug>
 153.774 -    </target>
 153.775 -    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
 153.776 -    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
 153.777 -        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
 153.778 -    </target>
 153.779 -    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
 153.780 -    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
 153.781 -        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
 153.782 -        <j2seproject3:debug classname="${debug.class}"/>
 153.783 -    </target>
 153.784 -    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
 153.785 -    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
 153.786 -        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
 153.787 -        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
 153.788 -    </target>
 153.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"/>
 153.790 -    <target depends="init" name="-pre-debug-fix">
 153.791 -        <fail unless="fix.includes">Must set fix.includes</fail>
 153.792 -        <property name="javac.includes" value="${fix.includes}.java"/>
 153.793 -    </target>
 153.794 -    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
 153.795 -        <j2seproject1:nbjpdareload/>
 153.796 -    </target>
 153.797 -    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
 153.798 -    <!--
 153.799 -                =================
 153.800 -                PROFILING SECTION
 153.801 -                =================
 153.802 -            -->
 153.803 -    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
 153.804 -        <nbprofiledirect>
 153.805 -            <classpath>
 153.806 -                <path path="${run.classpath}"/>
 153.807 -            </classpath>
 153.808 -        </nbprofiledirect>
 153.809 -        <profile/>
 153.810 -    </target>
 153.811 -    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
 153.812 -        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
 153.813 -        <nbprofiledirect>
 153.814 -            <classpath>
 153.815 -                <path path="${run.classpath}"/>
 153.816 -            </classpath>
 153.817 -        </nbprofiledirect>
 153.818 -        <profile classname="${profile.class}"/>
 153.819 -    </target>
 153.820 -    <!--
 153.821 -                =========================
 153.822 -                APPLET PROFILING  SECTION
 153.823 -                =========================
 153.824 -            -->
 153.825 -    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
 153.826 -        <nbprofiledirect>
 153.827 -            <classpath>
 153.828 -                <path path="${run.classpath}"/>
 153.829 -            </classpath>
 153.830 -        </nbprofiledirect>
 153.831 -        <profile classname="sun.applet.AppletViewer">
 153.832 -            <customize>
 153.833 -                <arg value="${applet.url}"/>
 153.834 -            </customize>
 153.835 -        </profile>
 153.836 -    </target>
 153.837 -    <!--
 153.838 -                =========================
 153.839 -                TESTS PROFILING  SECTION
 153.840 -                =========================
 153.841 -            -->
 153.842 -    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
 153.843 -        <nbprofiledirect>
 153.844 -            <classpath>
 153.845 -                <path path="${run.test.classpath}"/>
 153.846 -            </classpath>
 153.847 -        </nbprofiledirect>
 153.848 -        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
 153.849 -            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
 153.850 -            <jvmarg value="${profiler.info.jvmargs.agent}"/>
 153.851 -            <jvmarg line="${profiler.info.jvmargs}"/>
 153.852 -            <test name="${profile.class}"/>
 153.853 -            <classpath>
 153.854 -                <path path="${run.test.classpath}"/>
 153.855 -            </classpath>
 153.856 -            <syspropertyset>
 153.857 -                <propertyref prefix="test-sys-prop."/>
 153.858 -                <mapper from="test-sys-prop.*" to="*" type="glob"/>
 153.859 -            </syspropertyset>
 153.860 -            <formatter type="brief" usefile="false"/>
 153.861 -            <formatter type="xml"/>
 153.862 -        </junit>
 153.863 -    </target>
 153.864 -    <!--
 153.865 -                ===============
 153.866 -                JAVADOC SECTION
 153.867 -                ===============
 153.868 -            -->
 153.869 -    <target depends="init" if="have.sources" name="-javadoc-build">
 153.870 -        <mkdir dir="${dist.javadoc.dir}"/>
 153.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}">
 153.872 -            <classpath>
 153.873 -                <path path="${javac.classpath}"/>
 153.874 -            </classpath>
 153.875 -            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
 153.876 -                <filename name="**/*.java"/>
 153.877 -            </fileset>
 153.878 -            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 153.879 -                <include name="**/*.java"/>
 153.880 -                <exclude name="*.java"/>
 153.881 -            </fileset>
 153.882 -        </javadoc>
 153.883 -        <copy todir="${dist.javadoc.dir}">
 153.884 -            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
 153.885 -                <filename name="**/doc-files/**"/>
 153.886 -            </fileset>
 153.887 -            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 153.888 -                <include name="**/doc-files/**"/>
 153.889 -            </fileset>
 153.890 -        </copy>
 153.891 -    </target>
 153.892 -    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
 153.893 -        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
 153.894 -    </target>
 153.895 -    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
 153.896 -    <!--
 153.897 -                =========================
 153.898 -                JUNIT COMPILATION SECTION
 153.899 -                =========================
 153.900 -            -->
 153.901 -    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
 153.902 -        <mkdir dir="${build.test.classes.dir}"/>
 153.903 -    </target>
 153.904 -    <target name="-pre-compile-test">
 153.905 -        <!-- Empty placeholder for easier customization. -->
 153.906 -        <!-- You can override this target in the ../build.xml file. -->
 153.907 -    </target>
 153.908 -    <target if="do.depend.true" name="-compile-test-depend">
 153.909 -        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
 153.910 -    </target>
 153.911 -    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
 153.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}"/>
 153.913 -        <copy todir="${build.test.classes.dir}">
 153.914 -            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 153.915 -        </copy>
 153.916 -    </target>
 153.917 -    <target name="-post-compile-test">
 153.918 -        <!-- Empty placeholder for easier customization. -->
 153.919 -        <!-- You can override this target in the ../build.xml file. -->
 153.920 -    </target>
 153.921 -    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
 153.922 -    <target name="-pre-compile-test-single">
 153.923 -        <!-- Empty placeholder for easier customization. -->
 153.924 -        <!-- You can override this target in the ../build.xml file. -->
 153.925 -    </target>
 153.926 -    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
 153.927 -        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
 153.928 -        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
 153.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}"/>
 153.930 -        <copy todir="${build.test.classes.dir}">
 153.931 -            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 153.932 -        </copy>
 153.933 -    </target>
 153.934 -    <target name="-post-compile-test-single">
 153.935 -        <!-- Empty placeholder for easier customization. -->
 153.936 -        <!-- You can override this target in the ../build.xml file. -->
 153.937 -    </target>
 153.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"/>
 153.939 -    <!--
 153.940 -                =======================
 153.941 -                JUNIT EXECUTION SECTION
 153.942 -                =======================
 153.943 -            -->
 153.944 -    <target depends="init" if="have.tests" name="-pre-test-run">
 153.945 -        <mkdir dir="${build.test.results.dir}"/>
 153.946 -    </target>
 153.947 -    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
 153.948 -        <j2seproject3:junit testincludes="**/*Test.java"/>
 153.949 -    </target>
 153.950 -    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
 153.951 -        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
 153.952 -    </target>
 153.953 -    <target depends="init" if="have.tests" name="test-report"/>
 153.954 -    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
 153.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"/>
 153.956 -    <target depends="init" if="have.tests" name="-pre-test-run-single">
 153.957 -        <mkdir dir="${build.test.results.dir}"/>
 153.958 -    </target>
 153.959 -    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
 153.960 -        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
 153.961 -        <j2seproject3:junit excludes="" includes="${test.includes}"/>
 153.962 -    </target>
 153.963 -    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
 153.964 -        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
 153.965 -    </target>
 153.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"/>
 153.967 -    <!--
 153.968 -                =======================
 153.969 -                JUNIT DEBUGGING SECTION
 153.970 -                =======================
 153.971 -            -->
 153.972 -    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
 153.973 -        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
 153.974 -        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
 153.975 -        <delete file="${test.report.file}"/>
 153.976 -        <mkdir dir="${build.test.results.dir}"/>
 153.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}">
 153.978 -            <customize>
 153.979 -                <syspropertyset>
 153.980 -                    <propertyref prefix="test-sys-prop."/>
 153.981 -                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
 153.982 -                </syspropertyset>
 153.983 -                <arg value="${test.class}"/>
 153.984 -                <arg value="showoutput=true"/>
 153.985 -                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
 153.986 -                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
 153.987 -            </customize>
 153.988 -        </j2seproject3:debug>
 153.989 -    </target>
 153.990 -    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
 153.991 -        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
 153.992 -    </target>
 153.993 -    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
 153.994 -    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
 153.995 -        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
 153.996 -    </target>
 153.997 -    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
 153.998 -    <!--
 153.999 -                =========================
153.1000 -                APPLET EXECUTION SECTION
153.1001 -                =========================
153.1002 -            -->
153.1003 -    <target depends="init,compile-single" name="run-applet">
153.1004 -        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
153.1005 -        <j2seproject1:java classname="sun.applet.AppletViewer">
153.1006 -            <customize>
153.1007 -                <arg value="${applet.url}"/>
153.1008 -            </customize>
153.1009 -        </j2seproject1:java>
153.1010 -    </target>
153.1011 -    <!--
153.1012 -                =========================
153.1013 -                APPLET DEBUGGING  SECTION
153.1014 -                =========================
153.1015 -            -->
153.1016 -    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
153.1017 -        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
153.1018 -        <j2seproject3:debug classname="sun.applet.AppletViewer">
153.1019 -            <customize>
153.1020 -                <arg value="${applet.url}"/>
153.1021 -            </customize>
153.1022 -        </j2seproject3:debug>
153.1023 -    </target>
153.1024 -    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
153.1025 -    <!--
153.1026 -                ===============
153.1027 -                CLEANUP SECTION
153.1028 -                ===============
153.1029 -            -->
153.1030 -    <target name="-deps-clean-init" unless="built-clean.properties">
153.1031 -        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
153.1032 -        <delete file="${built-clean.properties}" quiet="true"/>
153.1033 -    </target>
153.1034 -    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
153.1035 -        <echo level="warn" message="Cycle detected: base.web.api was already built"/>
153.1036 -    </target>
153.1037 -    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
153.1038 -        <mkdir dir="${build.dir}"/>
153.1039 -        <touch file="${built-clean.properties}" verbose="false"/>
153.1040 -        <property file="${built-clean.properties}" prefix="already.built.clean."/>
153.1041 -        <antcall target="-warn-already-built-clean"/>
153.1042 -        <propertyfile file="${built-clean.properties}">
153.1043 -            <entry key="${basedir}" value=""/>
153.1044 -        </propertyfile>
153.1045 -    </target>
153.1046 -    <target depends="init" name="-do-clean">
153.1047 -        <delete dir="${build.dir}"/>
153.1048 -        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
153.1049 -    </target>
153.1050 -    <target name="-post-clean">
153.1051 -        <!-- Empty placeholder for easier customization. -->
153.1052 -        <!-- You can override this target in the ../build.xml file. -->
153.1053 -    </target>
153.1054 -    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
153.1055 -    <target name="-check-call-dep">
153.1056 -        <property file="${call.built.properties}" prefix="already.built."/>
153.1057 -        <condition property="should.call.dep">
153.1058 -            <not>
153.1059 -                <isset property="already.built.${call.subproject}"/>
153.1060 -            </not>
153.1061 -        </condition>
153.1062 -    </target>
153.1063 -    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
153.1064 -        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
153.1065 -            <propertyset>
153.1066 -                <propertyref prefix="transfer."/>
153.1067 -                <mapper from="transfer.*" to="*" type="glob"/>
153.1068 -            </propertyset>
153.1069 -        </ant>
153.1070 -    </target>
153.1071 -</project>
   154.1 --- a/server/backend/base.web.api/nbproject/genfiles.properties	Wed Jun 22 12:05:27 2011 +0200
   154.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   154.3 @@ -1,8 +0,0 @@
   154.4 -build.xml.data.CRC32=a7c02ab2
   154.5 -build.xml.script.CRC32=f51e627e
   154.6 -build.xml.stylesheet.CRC32=28e38971@1.45.0.45
   154.7 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
   154.8 -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
   154.9 -nbproject/build-impl.xml.data.CRC32=a7c02ab2
  154.10 -nbproject/build-impl.xml.script.CRC32=e2e70d24
  154.11 -nbproject/build-impl.xml.stylesheet.CRC32=cfcde7f8@1.45.0.45
   155.1 --- a/server/backend/base.web.api/nbproject/project.properties	Wed Jun 22 12:05:27 2011 +0200
   155.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   155.3 @@ -1,81 +0,0 @@
   155.4 -annotation.processing.enabled=true
   155.5 -annotation.processing.enabled.in.editor=false
   155.6 -annotation.processing.processor.options=
   155.7 -annotation.processing.processors.list=
   155.8 -annotation.processing.run.all.processors=true
   155.9 -annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
  155.10 -build.classes.dir=${build.dir}/classes
  155.11 -build.classes.excludes=**/*.java,**/*.form
  155.12 -# This directory is removed when the project is cleaned:
  155.13 -build.dir=build
  155.14 -build.generated.dir=${build.dir}/generated
  155.15 -build.generated.sources.dir=${build.dir}/generated-sources
  155.16 -# Only compile against the classpath explicitly listed here:
  155.17 -build.sysclasspath=ignore
  155.18 -build.test.classes.dir=${build.dir}/test/classes
  155.19 -build.test.results.dir=${build.dir}/test/results
  155.20 -# Uncomment to specify the preferred debugger connection transport:
  155.21 -#debug.transport=dt_socket
  155.22 -debug.classpath=\
  155.23 -    ${run.classpath}
  155.24 -debug.test.classpath=\
  155.25 -    ${run.test.classpath}
  155.26 -# This directory is removed when the project is cleaned:
  155.27 -dist.dir=dist
  155.28 -dist.jar=${dist.dir}/base.web.api.jar
  155.29 -dist.javadoc.dir=${dist.dir}/javadoc
  155.30 -excludes=
  155.31 -file.reference.org-netbeans-modules-java-source.jar=../../lib/org-netbeans-modules-java-source.jar
  155.32 -file.reference.org-netbeans-modules-parsing-api.jar=../../lib/org-netbeans-modules-parsing-api.jar
  155.33 -file.reference.org-openide-filesystems.jar=../../lib/org-openide-filesystems.jar
  155.34 -file.reference.org-openide-util-lookup.jar=../../lib/org-openide-util-lookup.jar
  155.35 -includes=**
  155.36 -jar.compress=false
  155.37 -javac.classpath=\
  155.38 -    ${libs.freemarker.classpath}:\
  155.39 -    ${libs.jersey.classpath}:\
  155.40 -    ${file.reference.org-openide-filesystems.jar}:\
  155.41 -    ${file.reference.org-netbeans-modules-parsing-api.jar}:\
  155.42 -    ${file.reference.org-openide-util-lookup.jar}:\
  155.43 -    ${file.reference.org-netbeans-modules-java-source.jar}
  155.44 -# Space-separated list of extra javac options
  155.45 -javac.compilerargs=
  155.46 -javac.deprecation=false
  155.47 -javac.processorpath=\
  155.48 -    ${javac.classpath}
  155.49 -javac.source=1.6
  155.50 -javac.target=1.6
  155.51 -javac.test.classpath=\
  155.52 -    ${javac.classpath}:\
  155.53 -    ${build.classes.dir}
  155.54 -javac.test.processorpath=\
  155.55 -    ${javac.test.classpath}
  155.56 -javadoc.additionalparam=
  155.57 -javadoc.author=false
  155.58 -javadoc.encoding=${source.encoding}
  155.59 -javadoc.noindex=false
  155.60 -javadoc.nonavbar=false
  155.61 -javadoc.notree=false
  155.62 -javadoc.private=false
  155.63 -javadoc.splitindex=true
  155.64 -javadoc.use=true
  155.65 -javadoc.version=false
  155.66 -javadoc.windowtitle=
  155.67 -main.class=org.netbeans.modules.jackpot30.backend.base.BaseWebApi
  155.68 -manifest.file=manifest.mf
  155.69 -meta.inf.dir=${src.dir}/META-INF
  155.70 -mkdist.disabled=false
  155.71 -platform.active=default_platform
  155.72 -run.classpath=\
  155.73 -    ${javac.classpath}:\
  155.74 -    ${build.classes.dir}
  155.75 -# Space-separated list of JVM arguments used when running the project
  155.76 -# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
  155.77 -# or test-sys-prop.name=value to set system properties for unit tests):
  155.78 -run.jvmargs=
  155.79 -run.test.classpath=\
  155.80 -    ${javac.test.classpath}:\
  155.81 -    ${build.test.classes.dir}
  155.82 -source.encoding=UTF-8
  155.83 -src.dir=src
  155.84 -test.src.dir=test
   156.1 --- a/server/backend/base.web.api/nbproject/project.xml	Wed Jun 22 12:05:27 2011 +0200
   156.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   156.3 @@ -1,18 +0,0 @@
   156.4 -<?xml version="1.0" encoding="UTF-8"?>
   156.5 -<project xmlns="http://www.netbeans.org/ns/project/1">
   156.6 -    <type>org.netbeans.modules.java.j2seproject</type>
   156.7 -    <configuration>
   156.8 -        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
   156.9 -            <name>base.web.api</name>
  156.10 -            <source-roots>
  156.11 -                <root id="src.dir"/>
  156.12 -            </source-roots>
  156.13 -            <test-roots>
  156.14 -                <root id="test.src.dir"/>
  156.15 -            </test-roots>
  156.16 -        </data>
  156.17 -        <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
  156.18 -            <definitions>../../lib/nblibraries.properties</definitions>
  156.19 -        </libraries>
  156.20 -    </configuration>
  156.21 -</project>
   157.1 --- a/server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/CategoryStorage.java	Wed Jun 22 12:05:27 2011 +0200
   157.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   157.3 @@ -1,141 +0,0 @@
   157.4 -/*
   157.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   157.6 - *
   157.7 - * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
   157.8 - *
   157.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  157.10 - * Other names may be trademarks of their respective owners.
  157.11 - *
  157.12 - * The contents of this file are subject to the terms of either the GNU
  157.13 - * General Public License Version 2 only ("GPL") or the Common
  157.14 - * Development and Distribution License("CDDL") (collectively, the
  157.15 - * "License"). You may not use this file except in compliance with the
  157.16 - * License. You can obtain a copy of the License at
  157.17 - * http://www.netbeans.org/cddl-gplv2.html
  157.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  157.19 - * specific language governing permissions and limitations under the
  157.20 - * License.  When distributing the software, include this License Header
  157.21 - * Notice in each file and include the License file at
  157.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  157.23 - * particular file as subject to the "Classpath" exception as provided
  157.24 - * by Oracle in the GPL Version 2 section of the License file that
  157.25 - * accompanied this code. If applicable, add the following below the
  157.26 - * License Header, with the fields enclosed by brackets [] replaced by
  157.27 - * your own identifying information:
  157.28 - * "Portions Copyrighted [year] [name of copyright owner]"
  157.29 - *
  157.30 - * If you wish your version of this file to be governed by only the CDDL
  157.31 - * or only the GPL Version 2, indicate your decision by adding
  157.32 - * "[Contributor] elects to include this software in this distribution
  157.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  157.34 - * single choice of license, a recipient has the option to distribute
  157.35 - * your version of this file under either the CDDL, the GPL Version 2 or
  157.36 - * to extend the choice of license to its licensees as provided above.
  157.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  157.38 - * Version 2 license, then the option applies only if the new code is
  157.39 - * made subject to such option by the copyright holder.
  157.40 - *
  157.41 - * Contributor(s):
  157.42 - *
  157.43 - * Portions Copyrighted 2011 Sun Microsystems, Inc.
  157.44 - */
  157.45 -package org.netbeans.modules.jackpot30.backend.base;
  157.46 -
  157.47 -import java.io.File;
  157.48 -import java.io.IOException;
  157.49 -import java.lang.reflect.Field;
  157.50 -import java.net.URL;
  157.51 -import java.util.ArrayList;
  157.52 -import java.util.Collections;
  157.53 -import java.util.HashSet;
  157.54 -import java.util.List;
  157.55 -import java.util.Map;
  157.56 -import java.util.Set;
  157.57 -import java.util.logging.Level;
  157.58 -import java.util.logging.Logger;
  157.59 -import org.netbeans.modules.parsing.impl.indexing.CacheFolder;
  157.60 -import org.openide.filesystems.FileObject;
  157.61 -import org.openide.filesystems.FileUtil;
  157.62 -
  157.63 -/**
  157.64 - *
  157.65 - * @author lahvac
  157.66 - */
  157.67 -public class CategoryStorage {
  157.68 -
  157.69 -    public static void setCacheRoot(File cacheRoot) {
  157.70 -        CategoryStorage.cacheRoot = cacheRoot;
  157.71 -    }
  157.72 -
  157.73 -    private static File cacheRoot;
  157.74 -
  157.75 -    public static Iterable<? extends CategoryStorage> listCategories() {
  157.76 -        List<CategoryStorage> result = new ArrayList<CategoryStorage>();
  157.77 -
  157.78 -        for (File cat : cacheRoot.listFiles()) {
  157.79 -            result.add(new CategoryStorage(cat.getName()));
  157.80 -        }
  157.81 -
  157.82 -        return result;
  157.83 -    }
  157.84 -
  157.85 -    public static CategoryStorage forId(String id) {
  157.86 -        for (CategoryStorage s : listCategories()) {
  157.87 -            if (s.id.equals(id)) return s;
  157.88 -        }
  157.89 -
  157.90 -        return null;
  157.91 -    }
  157.92 -    
  157.93 -    private final String id;
  157.94 -
  157.95 -    private CategoryStorage(String id) {
  157.96 -        this.id = id;
  157.97 -    }
  157.98 -
  157.99 -    public Iterable<? extends URL> getCategoryIndexFolders() {
 157.100 -        try {
 157.101 -            FileObject root = getCacheRoot();
 157.102 -            CacheFolder.setCacheFolder(root);
 157.103 -            Set<URL> result = new HashSet<URL>();
 157.104 -
 157.105 -            CacheFolder.getDataFolder(new URL("file:/"), true);
 157.106 -            
 157.107 -            //XXX:
 157.108 -            Field invertedSegmentsField = CacheFolder.class.getDeclaredField("invertedSegments");
 157.109 -
 157.110 -            invertedSegmentsField.setAccessible(true);
 157.111 -            
 157.112 -            Map<String, String> invertedSegments = (Map<String, String>) invertedSegmentsField.get(null);
 157.113 -
 157.114 -            for (String c : invertedSegments.keySet()) {
 157.115 -                result.add(new URL(c));
 157.116 -            }
 157.117 -
 157.118 -            return result;
 157.119 -        } catch (IllegalArgumentException ex) {
 157.120 -            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
 157.121 -        } catch (IllegalAccessException ex) {
 157.122 -            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
 157.123 -        } catch (NoSuchFieldException ex) {
 157.124 -            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
 157.125 -        } catch (SecurityException ex) {
 157.126 -            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
 157.127 -        } catch (IOException ex) {
 157.128 -            Logger.getLogger(CategoryStorage.class.getName()).log(Level.SEVERE, null, ex);
 157.129 -        }
 157.130 -        return Collections.emptyList();
 157.131 -    }
 157.132 -
 157.133 -    public String getId() {
 157.134 -        return id;
 157.135 -    }
 157.136 -
 157.137 -    public String getDisplayName() {
 157.138 -        return id;//XXX
 157.139 -    }
 157.140 -
 157.141 -    public FileObject getCacheRoot() {
 157.142 -        return FileUtil.toFileObject(FileUtil.normalizeFile(new File(cacheRoot, id)));
 157.143 -    }
 157.144 -}
   158.1 --- a/server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/FreemarkerUtilities.java	Wed Jun 22 12:05:27 2011 +0200
   158.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   158.3 @@ -1,94 +0,0 @@
   158.4 -/*
   158.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   158.6 - *
   158.7 - * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
   158.8 - *
   158.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  158.10 - * Other names may be trademarks of their respective owners.
  158.11 - *
  158.12 - * The contents of this file are subject to the terms of either the GNU
  158.13 - * General Public License Version 2 only ("GPL") or the Common
  158.14 - * Development and Distribution License("CDDL") (collectively, the
  158.15 - * "License"). You may not use this file except in compliance with the
  158.16 - * License. You can obtain a copy of the License at
  158.17 - * http://www.netbeans.org/cddl-gplv2.html
  158.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  158.19 - * specific language governing permissions and limitations under the
  158.20 - * License.  When distributing the software, include this License Header
  158.21 - * Notice in each file and include the License file at
  158.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  158.23 - * particular file as subject to the "Classpath" exception as provided
  158.24 - * by Oracle in the GPL Version 2 section of the License file that
  158.25 - * accompanied this code. If applicable, add the following below the
  158.26 - * License Header, with the fields enclosed by brackets [] replaced by
  158.27 - * your own identifying information:
  158.28 - * "Portions Copyrighted [year] [name of copyright owner]"
  158.29 - *
  158.30 - * If you wish your version of this file to be governed by only the CDDL
  158.31 - * or only the GPL Version 2, indicate your decision by adding
  158.32 - * "[Contributor] elects to include this software in this distribution
  158.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  158.34 - * single choice of license, a recipient has the option to distribute
  158.35 - * your version of this file under either the CDDL, the GPL Version 2 or
  158.36 - * to extend the choice of license to its licensees as provided above.
  158.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  158.38 - * Version 2 license, then the option applies only if the new code is
  158.39 - * made subject to such option by the copyright holder.
  158.40 - *
  158.41 - * Contributor(s):
  158.42 - *
  158.43 - * Portions Copyrighted 2011 Sun Microsystems, Inc.
  158.44 - */
  158.45 -package org.netbeans.modules.jackpot30.backend.base;
  158.46 -
  158.47 -import freemarker.cache.TemplateLoader;
  158.48 -import freemarker.template.Configuration;
  158.49 -import freemarker.template.Template;
  158.50 -import freemarker.template.TemplateException;
  158.51 -import java.io.IOException;
  158.52 -import java.io.InputStream;
  158.53 -import java.io.InputStreamReader;
  158.54 -import java.io.Reader;
  158.55 -import java.io.StringWriter;
  158.56 -import java.util.Map;
  158.57 -
  158.58 -/**
  158.59 - *
  158.60 - * @author lahvac
  158.61 - */
  158.62 -public class FreemarkerUtilities {
  158.63 -
  158.64 -    public static String processTemplate(String template, Map<String, Object> configurationData) throws TemplateException, IOException {
  158.65 -        Configuration conf = new Configuration();
  158.66 -
  158.67 -        conf.setTemplateLoader(new TemplateLoaderImpl());
  158.68 -
  158.69 -        Template templ = conf.getTemplate(template);
  158.70 -        StringWriter out = new StringWriter();
  158.71 -
  158.72 -        templ.process(configurationData, out);
  158.73 -
  158.74 -        return out.toString();
  158.75 -    }
  158.76 -
  158.77 -    private static final class TemplateLoaderImpl implements TemplateLoader {
  158.78 -
  158.79 -        public Object findTemplateSource(String name) throws IOException {
  158.80 -            return TemplateLoaderImpl.class.getResourceAsStream("/" + name);
  158.81 -        }
  158.82 -
  158.83 -        public long getLastModified(Object templateSource) {
  158.84 -            return 0L;
  158.85 -        }
  158.86 -
  158.87 -        public Reader getReader(Object templateSource, String encoding) throws IOException {
  158.88 -            InputStream in = (InputStream) templateSource;
  158.89 -
  158.90 -            return new InputStreamReader(in);
  158.91 -        }
  158.92 -
  158.93 -        public void closeTemplateSource(Object templateSource) throws IOException {
  158.94 -        }
  158.95 -    }
  158.96 -
  158.97 -}
   159.1 --- a/server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/RelStreamHandlerFactory.java	Wed Jun 22 12:05:27 2011 +0200
   159.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   159.3 @@ -1,72 +0,0 @@
   159.4 -/*
   159.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   159.6 - *
   159.7 - * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
   159.8 - *
   159.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  159.10 - * Other names may be trademarks of their respective owners.
  159.11 - *
  159.12 - * The contents of this file are subject to the terms of either the GNU
  159.13 - * General Public License Version 2 only ("GPL") or the Common
  159.14 - * Development and Distribution License("CDDL") (collectively, the
  159.15 - * "License"). You may not use this file except in compliance with the
  159.16 - * License. You can obtain a copy of the License at
  159.17 - * http://www.netbeans.org/cddl-gplv2.html
  159.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  159.19 - * specific language governing permissions and limitations under the
  159.20 - * License.  When distributing the software, include this License Header
  159.21 - * Notice in each file and include the License file at
  159.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  159.23 - * particular file as subject to the "Classpath" exception as provided
  159.24 - * by Oracle in the GPL Version 2 section of the License file that
  159.25 - * accompanied this code. If applicable, add the following below the
  159.26 - * License Header, with the fields enclosed by brackets [] replaced by
  159.27 - * your own identifying information:
  159.28 - * "Portions Copyrighted [year] [name of copyright owner]"
  159.29 - *
  159.30 - * If you wish your version of this file to be governed by only the CDDL
  159.31 - * or only the GPL Version 2, indicate your decision by adding
  159.32 - * "[Contributor] elects to include this software in this distribution
  159.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  159.34 - * single choice of license, a recipient has the option to distribute
  159.35 - * your version of this file under either the CDDL, the GPL Version 2 or
  159.36 - * to extend the choice of license to its licensees as provided above.
  159.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  159.38 - * Version 2 license, then the option applies only if the new code is
  159.39 - * made subject to such option by the copyright holder.
  159.40 - *
  159.41 - * Contributor(s):
  159.42 - *
  159.43 - * Portions Copyrighted 2011 Sun Microsystems, Inc.
  159.44 - */
  159.45 -package org.netbeans.modules.jackpot30.backend.base;
  159.46 -
  159.47 -import java.io.IOException;
  159.48 -import java.net.URL;
  159.49 -import java.net.URLConnection;
  159.50 -import java.net.URLStreamHandler;
  159.51 -import java.net.URLStreamHandlerFactory;
  159.52 -import org.openide.util.lookup.ServiceProvider;
  159.53 -
  159.54 -/**
  159.55 - *
  159.56 - * @author lahvac
  159.57 - */
  159.58 -@ServiceProvider(service=URLStreamHandlerFactory.class)
  159.59 -public class RelStreamHandlerFactory implements URLStreamHandlerFactory {
  159.60 -
  159.61 -    @Override
  159.62 -    public URLStreamHandler createURLStreamHandler(String protocol) {
  159.63 -        if ("rel".equals(protocol)) return new RelStreamHandler();
  159.64 -        return null;
  159.65 -    }
  159.66 -
  159.67 -    private static final class RelStreamHandler extends URLStreamHandler {
  159.68 -
  159.69 -        @Override protected URLConnection openConnection(URL u) throws IOException {
  159.70 -            throw new IOException("Cannot open");
  159.71 -        }
  159.72 -
  159.73 -    }
  159.74 -
  159.75 -}
   160.1 --- a/server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/WebUtilities.java	Wed Jun 22 12:05:27 2011 +0200
   160.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   160.3 @@ -1,137 +0,0 @@
   160.4 -/*
   160.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   160.6 - *
   160.7 - * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   160.8 - *
   160.9 - * The contents of this file are subject to the terms of either the GNU
  160.10 - * General Public License Version 2 only ("GPL") or the Common
  160.11 - * Development and Distribution License("CDDL") (collectively, the
  160.12 - * "License"). You may not use this file except in compliance with the
  160.13 - * License. You can obtain a copy of the License at
  160.14 - * http://www.netbeans.org/cddl-gplv2.html
  160.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  160.16 - * specific language governing permissions and limitations under the
  160.17 - * License.  When distributing the software, include this License Header
  160.18 - * Notice in each file and include the License file at
  160.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  160.20 - * particular file as subject to the "Classpath" exception as provided
  160.21 - * by Sun in the GPL Version 2 section of the License file that
  160.22 - * accompanied this code. If applicable, add the following below the
  160.23 - * License Header, with the fields enclosed by brackets [] replaced by
  160.24 - * your own identifying information:
  160.25 - * "Portions Copyrighted [year] [name of copyright owner]"
  160.26 - *
  160.27 - * If you wish your version of this file to be governed by only the CDDL
  160.28 - * or only the GPL Version 2, indicate your decision by adding
  160.29 - * "[Contributor] elects to include this software in this distribution
  160.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  160.31 - * single choice of license, a recipient has the option to distribute
  160.32 - * your version of this file under either the CDDL, the GPL Version 2 or
  160.33 - * to extend the choice of license to its licensees as provided above.
  160.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  160.35 - * Version 2 license, then the option applies only if the new code is
  160.36 - * made subject to such option by the copyright holder.
  160.37 - *
  160.38 - * Contributor(s):
  160.39 - *
  160.40 - * Portions Copyrighted 2009 Sun Microsystems, Inc.
  160.41 - */
  160.42 -
  160.43 -package org.netbeans.modules.jackpot30.backend.base;
  160.44 -
  160.45 -import java.io.BufferedReader;
  160.46 -import java.io.IOException;
  160.47 -import java.io.InputStream;
  160.48 -import java.io.InputStreamReader;
  160.49 -import java.net.URI;
  160.50 -import java.net.URISyntaxException;
  160.51 -import java.net.URL;
  160.52 -import java.net.URLConnection;
  160.53 -import java.util.Collection;
  160.54 -import java.util.LinkedList;
  160.55 -import java.util.List;
  160.56 -import java.util.regex.Matcher;
  160.57 -import java.util.regex.Pattern;
  160.58 -
  160.59 -/**
  160.60 - *
  160.61 - */
  160.62 -public class WebUtilities {
  160.63 -
  160.64 -    private WebUtilities() {
  160.65 -    }
  160.66 -
  160.67 -    public static String requestStringResponse (URI uri) {
  160.68 -        final StringBuffer sb = new StringBuffer ();
  160.69 -        final URL url;
  160.70 -        try {
  160.71 -            url = uri.toURL();
  160.72 -            final URLConnection urlConnection = url.openConnection ();
  160.73 -            urlConnection.connect ();
  160.74 -            final Object content = urlConnection.getContent ();
  160.75 -//            System.out.println (content);
  160.76 -//            System.out.println (content.getClass ());
  160.77 -            final InputStream inputStream = (InputStream) content;
  160.78 -            final BufferedReader reader = new BufferedReader (new InputStreamReader (inputStream, "ASCII"));
  160.79 -            try {
  160.80 -                for (;;) {
  160.81 -                    String line = reader.readLine ();
  160.82 -                    if (line == null)
  160.83 -                        break;
  160.84 -                    sb.append (line).append ('\n');
  160.85 -                }
  160.86 -            } finally {
  160.87 -                reader.close ();
  160.88 -            }
  160.89 -        } catch (IOException e) {
  160.90 -            e.printStackTrace ();  // TODO
  160.91 -            return null;
  160.92 -        }
  160.93 -        return sb.toString ();
  160.94 -    }
  160.95 -    
  160.96 -    public static Collection<? extends String> requestStringArrayResponse (URI uri) {
  160.97 -        final List<String> result = new LinkedList<String> ();
  160.98 -        final URL url;
  160.99 -        try {
 160.100 -            url = uri.toURL();
 160.101 -            final URLConnection urlConnection = url.openConnection ();
 160.102 -            urlConnection.connect ();
 160.103 -            final Object content = urlConnection.getContent ();
 160.104 -//            System.out.println (content);
 160.105 -//            System.out.println (content.getClass ());
 160.106 -            final InputStream inputStream = (InputStream) content;
 160.107 -            final BufferedReader reader = new BufferedReader (new InputStreamReader (inputStream, "ASCII"));
 160.108 -            try {
 160.109 -                for (;;) {
 160.110 -                    String line = reader.readLine ();
 160.111 -                    if (line == null)
 160.112 -                        break;
 160.113 -                    result.add (line);
 160.114 -                }
 160.115 -            } finally {
 160.116 -                reader.close ();
 160.117 -            }
 160.118 -        } catch (IOException e) {
 160.119 -            e.printStackTrace ();  // TODO
 160.120 -        }
 160.121 -        return result;
 160.122 -    }
 160.123 -
 160.124 -    private static String[] c = new String[] {"&", "<", ">", "\n", "\""}; // NOI18N
 160.125 -    private static String[] tags = new String[] {"&amp;", "&lt;", "&gt;", "<br>", "&quot;"}; // NOI18N
 160.126 -
 160.127 -    public static String escapeForHTMLElement(String input) {
 160.128 -        for (int cntr = 0; cntr < c.length; cntr++) {
 160.129 -            input = input.replaceAll(c[cntr], tags[cntr]);
 160.130 -        }
 160.131 -
 160.132 -        return input;
 160.133 -    }
 160.134 -
 160.135 -    public static String escapeForQuery(String pattern) throws URISyntaxException {
 160.136 -        if (pattern == null) return null;
 160.137 -        return new URI(null, null, null, -1, null, pattern, null).getRawQuery().replaceAll(Pattern.quote("&"), Matcher.quoteReplacement("%26"));
 160.138 -    }
 160.139 -
 160.140 -}
   161.1 --- a/server/backend/base.web.api/src/org/netbeans/modules/jackpot30/backend/base/api/API.java	Wed Jun 22 12:05:27 2011 +0200
   161.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   161.3 @@ -1,122 +0,0 @@
   161.4 -/*
   161.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   161.6 - *
   161.7 - * Copyright 2009-2011 Sun Microsystems, Inc. All rights reserved.
   161.8 - *
   161.9 - * The contents of this file are subject to the terms of either the GNU
  161.10 - * General Public License Version 2 only ("GPL") or the Common
  161.11 - * Development and Distribution License("CDDL") (collectively, the
  161.12 - * "License"). You may not use this file except in compliance with the
  161.13 - * License. You can obtain a copy of the License at
  161.14 - * http://www.netbeans.org/cddl-gplv2.html
  161.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  161.16 - * specific language governing permissions and limitations under the
  161.17 - * License.  When distributing the software, include this License Header
  161.18 - * Notice in each file and include the License file at
  161.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  161.20 - * particular file as subject to the "Classpath" exception as provided
  161.21 - * by Sun in the GPL Version 2 section of the License file that
  161.22 - * accompanied this code. If applicable, add the following below the
  161.23 - * License Header, with the fields enclosed by brackets [] replaced by
  161.24 - * your own identifying information:
  161.25 - * "Portions Copyrighted [year] [name of copyright owner]"
  161.26 - *
  161.27 - * If you wish your version of this file to be governed by only the CDDL
  161.28 - * or only the GPL Version 2, indicate your decision by adding
  161.29 - * "[Contributor] elects to include this software in this distribution
  161.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  161.31 - * single choice of license, a recipient has the option to distribute
  161.32 - * your version of this file under either the CDDL, the GPL Version 2 or
  161.33 - * to extend the choice of license to its licensees as provided above.
  161.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  161.35 - * Version 2 license, then the option applies only if the new code is
  161.36 - * made subject to such option by the copyright holder.
  161.37 - *
  161.38 - * Contributor(s):
  161.39 - *
  161.40 - * Portions Copyrighted 2009-2011 Sun Microsystems, Inc.
  161.41 - */
  161.42 -
  161.43 -package org.netbeans.modules.jackpot30.backend.base.api;
  161.44 -
  161.45 -import java.io.IOException;
  161.46 -import java.lang.reflect.Field;
  161.47 -import java.lang.reflect.InvocationTargetException;
  161.48 -import java.lang.reflect.Method;
  161.49 -import java.util.Arrays;
  161.50 -import java.util.Map;
  161.51 -import java.util.logging.Level;
  161.52 -import java.util.logging.Logger;
  161.53 -import javax.ws.rs.GET;
  161.54 -import javax.ws.rs.Path;
  161.55 -import javax.ws.rs.Produces;
  161.56 -import org.netbeans.modules.jackpot30.backend.base.CategoryStorage;
  161.57 -import org.netbeans.modules.java.source.usages.ClassIndexImpl;
  161.58 -import org.netbeans.modules.java.source.usages.ClassIndexManager;
  161.59 -
  161.60 -/**
  161.61 - *
  161.62 - * @author lahvac
  161.63 - */
  161.64 -@Path("/index")
  161.65 -public class API {
  161.66 -
  161.67 -    @GET
  161.68 -    @Path("/list")
  161.69 -    @Produces("text/plain")
  161.70 -    public String list() throws IOException {
  161.71 -        StringBuilder sb = new StringBuilder();
  161.72 -
  161.73 -        for (CategoryStorage c : CategoryStorage.listCategories()) {
  161.74 -            sb.append(c.getId());
  161.75 -            sb.append(":");
  161.76 -            sb.append(c.getDisplayName());
  161.77 -            sb.append("\n");
  161.78 -        }
  161.79 -
  161.80 -        return sb.toString();
  161.81 -    }
  161.82 -
  161.83 -    @GET
  161.84 -    @Path("/internal/indexUpdated")
  161.85 -    @Produces("test/plain")
  161.86 -    public String indexUpdated() throws IOException {
  161.87 -        //XXX: should allow individual providers to do their own cleanup:
  161.88 -        //XXX: synchronize with the queries!
  161.89 -        //XXX: well, still does not work!
  161.90 -
  161.91 -        try {
  161.92 -            for (String name : Arrays.asList("instances", "transientInstances")) {
  161.93 -                Field instances = ClassIndexManager.class.getDeclaredField(name);
  161.94 -
  161.95 -                instances.setAccessible(true);
  161.96 -
  161.97 -                Map<?, ClassIndexImpl> toClear = (Map<?, ClassIndexImpl>) instances.get(ClassIndexManager.getDefault());
  161.98 -
  161.99 -                for (ClassIndexImpl impl : toClear.values()) {
 161.100 -                    Method close = ClassIndexImpl.class.getDeclaredMethod("close");
 161.101 -
 161.102 -                    close.setAccessible(true);
 161.103 -                    close.invoke(impl);
 161.104 -                }
 161.105 -
 161.106 -                toClear.clear();
 161.107 -            }
 161.108 -        } catch (InvocationTargetException ex) {
 161.109 -            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
 161.110 -        } catch (NoSuchMethodException ex) {
 161.111 -            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
 161.112 -        } catch (IllegalArgumentException ex) {
 161.113 -            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
 161.114 -        } catch (IllegalAccessException ex) {
 161.115 -            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
 161.116 -        } catch (NoSuchFieldException ex) {
 161.117 -            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
 161.118 -        } catch (SecurityException ex) {
 161.119 -            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
 161.120 -        }
 161.121 -        
 161.122 -        return "Done";
 161.123 -    }
 161.124 -
 161.125 -}
   162.1 --- a/server/backend/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties	Wed Jun 22 12:05:27 2011 +0200
   162.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   162.3 @@ -1,2 +0,0 @@
   162.4 -currentVersion=Jackpot 3.0 Backend {0}
   162.5 -LBL_splash_window_title=Starting Jackpot 3.0 Backend
   163.1 --- a/server/backend/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties	Wed Jun 22 12:05:27 2011 +0200
   163.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   163.3 @@ -1,2 +0,0 @@
   163.4 -CTL_MainWindow_Title=Jackpot 3.0 Backend {0}
   163.5 -CTL_MainWindow_Title_No_Project=Jackpot 3.0 Backend {0}
   164.1 --- a/server/backend/build-indexing-backend	Wed Jun 22 12:05:27 2011 +0200
   164.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   164.3 @@ -1,13 +0,0 @@
   164.4 -#!/bin/bash -x
   164.5 -ant "$@" clean || exit 1
   164.6 -mkdir -p build/indexing-backend
   164.7 -ant "$@" build-zip && unzip -d build/indexing-backend dist/backend.zip && mv build/indexing-backend/backend build/indexing-backend/indexer || exit 1
   164.8 -mkdir -p build/indexing-backend/web
   164.9 -(cd web.main; ant clean && ant jar && cp -r dist/* ../build/indexing-backend/web) || exit 1
  164.10 -
  164.11 -cp scripts/* build/indexing-backend
  164.12 -
  164.13 -chmod u+x build/temp-indexing-backend/index
  164.14 -chmod u+x build/temp-indexing-backend/web
  164.15 -
  164.16 -(cd build; zip -r indexing-backend.zip indexing-backend)
   165.1 --- a/server/backend/build.xml	Wed Jun 22 12:05:27 2011 +0200
   165.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   165.3 @@ -1,8 +0,0 @@
   165.4 -<?xml version="1.0" encoding="UTF-8"?>
   165.5 -<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
   165.6 -<!-- for some information on what you could do (e.g. targets to override). -->
   165.7 -<!-- If you delete this file and reopen the project it will be recreated. -->
   165.8 -<project name="backend" basedir=".">
   165.9 -    <description>Builds the module suite backend.</description>
  165.10 -    <import file="nbproject/build-impl.xml"/>
  165.11 -</project>
   166.1 --- a/server/backend/impl/build.xml	Wed Jun 22 12:05:27 2011 +0200
   166.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   166.3 @@ -1,8 +0,0 @@
   166.4 -<?xml version="1.0" encoding="UTF-8"?>
   166.5 -<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
   166.6 -<!-- for some information on what you could do (e.g. targets to override). -->
   166.7 -<!-- If you delete this file and reopen the project it will be recreated. -->
   166.8 -<project name="org.netbeans.modules.jackpot30.backend.impl" default="netbeans" basedir=".">
   166.9 -    <description>Builds, tests, and runs the project org.netbeans.modules.jackpot30.backend.impl.</description>
  166.10 -    <import file="nbproject/build-impl.xml"/>
  166.11 -</project>
   167.1 --- a/server/backend/impl/manifest.mf	Wed Jun 22 12:05:27 2011 +0200
   167.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   167.3 @@ -1,5 +0,0 @@
   167.4 -Manifest-Version: 1.0
   167.5 -OpenIDE-Module: org.netbeans.modules.jackpot30.backend.impl
   167.6 -OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jackpot30/backend/impl/Bundle.properties
   167.7 -OpenIDE-Module-Specification-Version: 1.0
   167.8 -OpenIDE-Module-Layer: org/netbeans/modules/jackpot30/backend/impl/resources/layer.xml
   168.1 --- a/server/backend/impl/nbproject/build-impl.xml	Wed Jun 22 12:05:27 2011 +0200
   168.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   168.3 @@ -1,45 +0,0 @@
   168.4 -<?xml version="1.0" encoding="UTF-8"?>
   168.5 -<!--
   168.6 -*** GENERATED FROM project.xml - DO NOT EDIT  ***
   168.7 -***         EDIT ../build.xml INSTEAD         ***
   168.8 --->
   168.9 -<project name="org.netbeans.modules.jackpot30.backend.impl-impl" basedir="..">
  168.10 -    <fail message="Please build using Ant 1.7.1 or higher.">
  168.11 -        <condition>
  168.12 -            <not>
  168.13 -                <antversion atleast="1.7.1"/>
  168.14 -            </not>
  168.15 -        </condition>
  168.16 -    </fail>
  168.17 -    <property file="nbproject/private/suite-private.properties"/>
  168.18 -    <property file="nbproject/suite.properties"/>
  168.19 -    <fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
  168.20 -    <property file="${suite.dir}/nbproject/private/platform-private.properties"/>
  168.21 -    <property file="${suite.dir}/nbproject/platform.properties"/>
  168.22 -    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
  168.23 -        <attribute name="name"/>
  168.24 -        <attribute name="value"/>
  168.25 -        <sequential>
  168.26 -            <property name="@{name}" value="${@{value}}"/>
  168.27 -        </sequential>
  168.28 -    </macrodef>
  168.29 -    <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
  168.30 -        <attribute name="property"/>
  168.31 -        <attribute name="value"/>
  168.32 -        <sequential>
  168.33 -            <property name="@{property}" value="@{value}"/>
  168.34 -        </sequential>
  168.35 -    </macrodef>
  168.36 -    <property file="${user.properties.file}"/>
  168.37 -    <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
  168.38 -    <nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
  168.39 -    <nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
  168.40 -    <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
  168.41 -        <condition>
  168.42 -            <not>
  168.43 -                <contains string="${cluster.path.evaluated}" substring="platform"/>
  168.44 -            </not>
  168.45 -        </condition>
  168.46 -    </fail>
  168.47 -    <import file="${harness.dir}/build.xml"/>
  168.48 -</project>
   169.1 --- a/server/backend/impl/nbproject/genfiles.properties	Wed Jun 22 12:05:27 2011 +0200
   169.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   169.3 @@ -1,8 +0,0 @@
   169.4 -build.xml.data.CRC32=e88e5ac7
   169.5 -build.xml.script.CRC32=c32e03a8
   169.6 -build.xml.stylesheet.CRC32=a56c6a5b@1.47
   169.7 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
   169.8 -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
   169.9 -nbproject/build-impl.xml.data.CRC32=e88e5ac7
  169.10 -nbproject/build-impl.xml.script.CRC32=87e6e497
  169.11 -nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.47
   170.1 --- a/server/backend/impl/nbproject/project.properties	Wed Jun 22 12:05:27 2011 +0200
   170.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   170.3 @@ -1,2 +0,0 @@
   170.4 -javac.source=1.6
   170.5 -javac.compilerargs=-Xlint -Xlint:-serial
   171.1 --- a/server/backend/impl/nbproject/project.xml	Wed Jun 22 12:05:27 2011 +0200
   171.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   171.3 @@ -1,238 +0,0 @@
   171.4 -<?xml version="1.0" encoding="UTF-8"?>
   171.5 -<project xmlns="http://www.netbeans.org/ns/project/1">
   171.6 -    <type>org.netbeans.modules.apisupport.project</type>
   171.7 -    <configuration>
   171.8 -        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
   171.9 -            <code-name-base>org.netbeans.modules.jackpot30.backend.impl</code-name-base>
  171.10 -            <suite-component/>
  171.11 -            <module-dependencies>
  171.12 -                <dependency>
  171.13 -                    <code-name-base>org.netbeans.api.java.classpath</code-name-base>
  171.14 -                    <build-prerequisite/>
  171.15 -                    <compile-dependency/>
  171.16 -                    <run-dependency>
  171.17 -                        <release-version>1</release-version>
  171.18 -                        <specification-version>1.27</specification-version>
  171.19 -                    </run-dependency>
  171.20 -                </dependency>
  171.21 -                <dependency>
  171.22 -                    <code-name-base>org.netbeans.api.progress</code-name-base>
  171.23 -                    <build-prerequisite/>
  171.24 -                    <compile-dependency/>
  171.25 -                    <run-dependency>
  171.26 -                        <release-version>1</release-version>
  171.27 -                        <specification-version>1.22</specification-version>
  171.28 -                    </run-dependency>
  171.29 -                </dependency>
  171.30 -                <dependency>
  171.31 -                    <code-name-base>org.netbeans.libs.freemarker</code-name-base>
  171.32 -                    <build-prerequisite/>
  171.33 -                    <compile-dependency/>
  171.34 -                    <run-dependency>
  171.35 -                        <release-version>1</release-version>
  171.36 -                        <implementation-version/>
  171.37 -                    </run-dependency>
  171.38 -                </dependency>
  171.39 -                <dependency>
  171.40 -                    <code-name-base>org.netbeans.libs.javacapi</code-name-base>
  171.41 -                    <build-prerequisite/>
  171.42 -                    <compile-dependency/>
  171.43 -                    <run-dependency>
  171.44 -                        <specification-version>7.2.0.2</specification-version>
  171.45 -                    </run-dependency>
  171.46 -                </dependency>
  171.47 -                <dependency>
  171.48 -                    <code-name-base>org.netbeans.libs.javacimpl</code-name-base>
  171.49 -                    <build-prerequisite/>
  171.50 -                    <compile-dependency/>
  171.51 -                    <run-dependency>
  171.52 -                        <release-version>1</release-version>
  171.53 -                        <implementation-version/>
  171.54 -                    </run-dependency>
  171.55 -                </dependency>
  171.56 -                <dependency>
  171.57 -                    <code-name-base>org.netbeans.libs.lucene</code-name-base>
  171.58 -                    <build-prerequisite/>
  171.59 -                    <compile-dependency/>
  171.60 -                    <run-dependency>
  171.61 -                        <release-version>3</release-version>
  171.62 -                        <specification-version>3.0</specification-version>
  171.63 -                    </run-dependency>
  171.64 -                </dependency>
  171.65 -                <dependency>
  171.66 -                    <code-name-base>org.netbeans.modules.jackpot30.api</code-name-base>
  171.67 -                    <build-prerequisite/>
  171.68 -                    <compile-dependency/>
  171.69 -                    <run-dependency>
  171.70 -                        <implementation-version/>
  171.71 -                    </run-dependency>
  171.72 -                </dependency>
  171.73 -                <dependency>
  171.74 -                    <code-name-base>org.netbeans.modules.java.hints</code-name-base>
  171.75 -                    <build-prerequisite/>
  171.76 -                    <compile-dependency/>
  171.77 -                    <run-dependency>
  171.78 -                        <release-version>1</release-version>
  171.79 -                        <implementation-version/>
  171.80 -                    </run-dependency>
  171.81 -                </dependency>
  171.82 -                <dependency>
  171.83 -                    <code-name-base>org.netbeans.modules.java.source</code-name-base>
  171.84 -                    <build-prerequisite/>
  171.85 -                    <compile-dependency/>
  171.86 -                    <run-dependency>
  171.87 -                        <implementation-version/>
  171.88 -                    </run-dependency>
  171.89 -                </dependency>
  171.90 -                <dependency>
  171.91 -                    <code-name-base>org.netbeans.modules.jeriglib</code-name-base>
  171.92 -                    <build-prerequisite/>
  171.93 -                    <compile-dependency/>
  171.94 -                    <run-dependency>
  171.95 -                        <specification-version>1.16</specification-version>
  171.96 -                    </run-dependency>
  171.97 -                </dependency>
  171.98 -                <dependency>
  171.99 -                    <code-name-base>org.netbeans.modules.jumpto</code-name-base>
 171.100 -                    <build-prerequisite/>
 171.101 -                    <compile-dependency/>
 171.102 -                    <run-dependency>
 171.103 -                        <release-version>1</release-version>
 171.104 -                        <implementation-version/>
 171.105 -                    </run-dependency>
 171.106 -                </dependency>
 171.107 -                <dependency>
 171.108 -                    <code-name-base>org.netbeans.modules.parsing.api</code-name-base>
 171.109 -                    <build-prerequisite/>
 171.110 -                    <compile-dependency/>
 171.111 -                    <run-dependency>
 171.112 -                        <release-version>1</release-version>
 171.113 -                        <implementation-version/>
 171.114 -                    </run-dependency>
 171.115 -                </dependency>
 171.116 -                <dependency>
 171.117 -                    <code-name-base>org.netbeans.modules.project.ant</code-name-base>
 171.118 -                    <build-prerequisite/>
 171.119 -                    <compile-dependency/>
 171.120 -                    <run-dependency>
 171.121 -                        <release-version>1</release-version>
 171.122 -                        <specification-version>1.39</specification-version>
 171.123 -                    </run-dependency>
 171.124 -                </dependency>
 171.125 -                <dependency>
 171.126 -                    <code-name-base>org.netbeans.modules.projectapi</code-name-base>
 171.127 -                    <build-prerequisite/>
 171.128 -                    <compile-dependency/>
 171.129 -                    <run-dependency>
 171.130 -                        <release-version>1</release-version>
 171.131 -                        <specification-version>1.34</specification-version>
 171.132 -                    </run-dependency>
 171.133 -                </dependency>
 171.134 -                <dependency>
 171.135 -                    <code-name-base>org.netbeans.modules.projectuiapi</code-name-base>
 171.136 -                    <build-prerequisite/>
 171.137 -                    <compile-dependency/>
 171.138 -                    <run-dependency>
 171.139 -                        <release-version>1</release-version>
 171.140 -                        <specification-version>1.49.0.8</specification-version>
 171.141 -                    </run-dependency>
 171.142 -                </dependency>
 171.143 -                <dependency>
 171.144 -                    <code-name-base>org.netbeans.modules.sendopts</code-name-base>
 171.145 -                    <build-prerequisite/>
 171.146 -                    <compile-dependency/>
 171.147 -                    <run-dependency>
 171.148 -                        <release-version>2</release-version>
 171.149 -                        <specification-version>2.11</specification-version>
 171.150 -                    </run-dependency>
 171.151 -                </dependency>
 171.152 -                <dependency>
 171.153 -                    <code-name-base>org.netbeans.modules.servletjspapi</code-name-base>
 171.154 -                    <build-prerequisite/>
 171.155 -                    <compile-dependency/>
 171.156 -                    <run-dependency>
 171.157 -                        <release-version>1</release-version>
 171.158 -                        <specification-version>1.10.0.25</specification-version>
 171.159 -                    </run-dependency>
 171.160 -                </dependency>
 171.161 -                <dependency>
 171.162 -                    <code-name-base>org.netbeans.modules.websvc.restlib</code-name-base>
 171.163 -                    <build-prerequisite/>
 171.164 -                    <compile-dependency/>
 171.165 -                    <run-dependency>
 171.166 -                        <release-version>0</release-version>
 171.167 -                        <specification-version>1.9</specification-version>
 171.168 -                    </run-dependency>
 171.169 -                </dependency>
 171.170 -                <dependency>
 171.171 -                    <code-name-base>org.netbeans.spi.editor.hints</code-name-base>
 171.172 -                    <build-prerequisite/>
 171.173 -                    <compile-dependency/>
 171.174 -                    <run-dependency>
 171.175 -                        <release-version>0</release-version>
 171.176 -                        <specification-version>1.16.0.7.6</specification-version>
 171.177 -                    </run-dependency>
 171.178 -                </dependency>
 171.179 -                <dependency>
 171.180 -                    <code-name-base>org.openide.filesystems</code-name-base>
 171.181 -                    <build-prerequisite/>
 171.182 -                    <compile-dependency/>
 171.183 -                    <run-dependency>
 171.184 -                        <specification-version>7.45</specification-version>
 171.185 -                    </run-dependency>
 171.186 -                </dependency>
 171.187 -                <dependency>
 171.188 -                    <code-name-base>org.openide.modules</code-name-base>
 171.189 -                    <build-prerequisite/>
 171.190 -                    <compile-dependency/>
 171.191 -                    <run-dependency>
 171.192 -                        <specification-version>7.21</specification-version>
 171.193 -                    </run-dependency>
 171.194 -                </dependency>
 171.195 -                <dependency>
 171.196 -                    <code-name-base>org.openide.text</code-name-base>
 171.197 -                    <build-prerequisite/>
 171.198 -                    <compile-dependency/>
 171.199 -                    <run-dependency>
 171.200 -                        <specification-version>6.35</specification-version>
 171.201 -                    </run-dependency>
 171.202 -                </dependency>
 171.203 -                <dependency>
 171.204 -                    <code-name-base>org.openide.util</code-name-base>
 171.205 -                    <build-prerequisite/>
 171.206 -                    <compile-dependency/>
 171.207 -                    <run-dependency>
 171.208 -                        <specification-version>8.12</specification-version>
 171.209 -                    </run-dependency>
 171.210 -                </dependency>
 171.211 -                <dependency>
 171.212 -                    <code-name-base>org.openide.util.lookup</code-name-base>
 171.213 -                    <build-prerequisite/>
 171.214 -                    <compile-dependency/>
 171.215 -                    <run-dependency>
 171.216 -                        <specification-version>8.5</specification-version>
 171.217 -                    </run-dependency>
 171.218 -                </dependency>
 171.219 -            </module-dependencies>
 171.220 -            <test-dependencies>
 171.221 -                <test-type>
 171.222 -                    <name>unit</name>
 171.223 -                    <test-dependency>
 171.224 -                        <code-name-base>org.netbeans.libs.junit4</code-name-base>
 171.225 -                        <compile-dependency/>
 171.226 -                    </test-dependency>
 171.227 -                    <test-dependency>
 171.228 -                        <code-name-base>org.netbeans.modules.junitlib</code-name-base>
 171.229 -                        <compile-dependency/>
 171.230 -                    </test-dependency>
 171.231 -                    <test-dependency>
 171.232 -                        <code-name-base>org.netbeans.modules.nbjunit</code-name-base>
 171.233 -                        <recursive/>
 171.234 -                        <compile-dependency/>
 171.235 -                    </test-dependency>
 171.236 -                </test-type>
 171.237 -            </test-dependencies>
 171.238 -            <public-packages/>
 171.239 -        </data>
 171.240 -    </configuration>
 171.241 -</project>
   172.1 --- a/server/backend/impl/nbproject/suite.properties	Wed Jun 22 12:05:27 2011 +0200
   172.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   172.3 @@ -1,1 +0,0 @@
   172.4 -suite.dir=${basedir}/..
   173.1 --- a/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/Bundle.properties	Wed Jun 22 12:05:27 2011 +0200
   173.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   173.3 @@ -1,1 +0,0 @@
   173.4 -OpenIDE-Module-Name=Jackpot 3.0 Backend Impl
   174.1 --- a/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/CategoryStorage.java	Wed Jun 22 12:05:27 2011 +0200
   174.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   174.3 @@ -1,126 +0,0 @@
   174.4 -/*
   174.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   174.6 - *
   174.7 - * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
   174.8 - *
   174.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  174.10 - * Other names may be trademarks of their respective owners.
  174.11 - *
  174.12 - * The contents of this file are subject to the terms of either the GNU
  174.13 - * General Public License Version 2 only ("GPL") or the Common
  174.14 - * Development and Distribution License("CDDL") (collectively, the
  174.15 - * "License"). You may not use this file except in compliance with the
  174.16 - * License. You can obtain a copy of the License at
  174.17 - * http://www.netbeans.org/cddl-gplv2.html
  174.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  174.19 - * specific language governing permissions and limitations under the
  174.20 - * License.  When distributing the software, include this License Header
  174.21 - * Notice in each file and include the License file at
  174.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  174.23 - * particular file as subject to the "Classpath" exception as provided
  174.24 - * by Oracle in the GPL Version 2 section of the License file that
  174.25 - * accompanied this code. If applicable, add the following below the
  174.26 - * License Header, with the fields enclosed by brackets [] replaced by
  174.27 - * your own identifying information:
  174.28 - * "Portions Copyrighted [year] [name of copyright owner]"
  174.29 - *
  174.30 - * If you wish your version of this file to be governed by only the CDDL
  174.31 - * or only the GPL Version 2, indicate your decision by adding
  174.32 - * "[Contributor] elects to include this software in this distribution
  174.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  174.34 - * single choice of license, a recipient has the option to distribute
  174.35 - * your version of this file under either the CDDL, the GPL Version 2 or
  174.36 - * to extend the choice of license to its licensees as provided above.
  174.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  174.38 - * Version 2 license, then the option applies only if the new code is
  174.39 - * made subject to such option by the copyright holder.
  174.40 - *
  174.41 - * Contributor(s):
  174.42 - *
  174.43 - * Portions Copyrighted 2011 Sun Microsystems, Inc.
  174.44 - */
  174.45 -package org.netbeans.modules.jackpot30.backend.impl;
  174.46 -
  174.47 -import java.net.MalformedURLException;
  174.48 -import java.net.URL;
  174.49 -import java.util.HashMap;
  174.50 -import java.util.HashSet;
  174.51 -import java.util.Map;
  174.52 -import java.util.Set;
  174.53 -import java.util.prefs.BackingStoreException;
  174.54 -import java.util.prefs.Preferences;
  174.55 -import org.openide.filesystems.FileObject;
  174.56 -import org.openide.filesystems.FileStateInvalidException;
  174.57 -import org.openide.filesystems.URLMapper;
  174.58 -import org.openide.util.Exceptions;
  174.59 -import org.openide.util.NbPreferences;
  174.60 -
  174.61 -/**
  174.62 - *
  174.63 - * @author lahvac
  174.64 - */
  174.65 -public class CategoryStorage {
  174.66 -
  174.67 -    public static void setCategoryContent(String categoryId, String categoryName, Set<FileObject> content) {
  174.68 -        Preferences categoriesNode = NbPreferences.forModule(CategoryStorage.class).node("categories");
  174.69 -
  174.70 -        categoriesNode.put(categoryId + "_displayName", categoryName);
  174.71 -
  174.72 -        StringBuilder roots = new StringBuilder();
  174.73 -
  174.74 -        for (FileObject f : content) {
  174.75 -            if (roots.length() > 0) {
  174.76 -                roots.append(';');
  174.77 -            }
  174.78 -
  174.79 -            try {
  174.80 -                roots.append(f.getURL().toExternalForm());
  174.81 -            } catch (FileStateInvalidException ex) {
  174.82 -                Exceptions.printStackTrace(ex);
  174.83 -            }
  174.84 -        }
  174.85 -
  174.86 -        categoriesNode.put(categoryId + "_roots", roots.toString());
  174.87 -    }
  174.88 -
  174.89 -    public static Set<FileObject> getCategoryContent(String categoryId) {
  174.90 -        Preferences categoriesNode = NbPreferences.forModule(CategoryStorage.class).node("categories");
  174.91 -        String roots = categoriesNode.get(categoryId + "_roots", "");
  174.92 -        Set<FileObject> result = new HashSet<FileObject>();
  174.93 -
  174.94 -        for (String urlString : roots.split(";")) {
  174.95 -            if (urlString.isEmpty()) continue;
  174.96 -
  174.97 -            try {
  174.98 -                URL url = new URL(urlString);
  174.99 -                FileObject root = URLMapper.findFileObject(url);
 174.100 -
 174.101 -                if (root != null) {
 174.102 -                    result.add(root);
 174.103 -                }
 174.104 -            } catch (MalformedURLException ex) {
 174.105 -                Exceptions.printStackTrace(ex);
 174.106 -            }
 174.107 -        }
 174.108 -
 174.109 -        return result;
 174.110 -    }
 174.111 -
 174.112 -    public static Map<String, String> listCategoriesWithNames() {
 174.113 -        Map<String, String> result = new HashMap<String, String>();
 174.114 -        Preferences categoriesNode = NbPreferences.forModule(CategoryStorage.class).node("categories");
 174.115 -
 174.116 -        try {
 174.117 -            for (String key : categoriesNode.keys()) {
 174.118 -                if (key.endsWith("_displayName")) {
 174.119 -                    String id = key.substring(0, key.length() - "_displayName".length());
 174.120 -                    result.put(id, categoriesNode.get(key, id));
 174.121 -                }
 174.122 -            }
 174.123 -        } catch (BackingStoreException ex) {
 174.124 -            Exceptions.printStackTrace(ex);
 174.125 -        }
 174.126 -
 174.127 -        return result;
 174.128 -    }
 174.129 -}
   175.1 --- a/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/OptionProcessorImpl.java	Wed Jun 22 12:05:27 2011 +0200
   175.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   175.3 @@ -1,294 +0,0 @@
   175.4 -/*
   175.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   175.6 - *
   175.7 - * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
   175.8 - *
   175.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  175.10 - * Other names may be trademarks of their respective owners.
  175.11 - *
  175.12 - * The contents of this file are subject to the terms of either the GNU
  175.13 - * General Public License Version 2 only ("GPL") or the Common
  175.14 - * Development and Distribution License("CDDL") (collectively, the
  175.15 - * "License"). You may not use this file except in compliance with the
  175.16 - * License. You can obtain a copy of the License at
  175.17 - * http://www.netbeans.org/cddl-gplv2.html
  175.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  175.19 - * specific language governing permissions and limitations under the
  175.20 - * License.  When distributing the software, include this License Header
  175.21 - * Notice in each file and include the License file at
  175.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  175.23 - * particular file as subject to the "Classpath" exception as provided
  175.24 - * by Oracle in the GPL Version 2 section of the License file that
  175.25 - * accompanied this code. If applicable, add the following below the
  175.26 - * License Header, with the fields enclosed by brackets [] replaced by
  175.27 - * your own identifying information:
  175.28 - * "Portions Copyrighted [year] [name of copyright owner]"
  175.29 - *
  175.30 - * If you wish your version of this file to be governed by only the CDDL
  175.31 - * or only the GPL Version 2, indicate your decision by adding
  175.32 - * "[Contributor] elects to include this software in this distribution
  175.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  175.34 - * single choice of license, a recipient has the option to distribute
  175.35 - * your version of this file under either the CDDL, the GPL Version 2 or
  175.36 - * to extend the choice of license to its licensees as provided above.
  175.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  175.38 - * Version 2 license, then the option applies only if the new code is
  175.39 - * made subject to such option by the copyright holder.
  175.40 - *
  175.41 - * Contributor(s):
  175.42 - *
  175.43 - * Portions Copyrighted 2011 Sun Microsystems, Inc.
  175.44 - */
  175.45 -
  175.46 -package org.netbeans.modules.jackpot30.backend.impl;
  175.47 -
  175.48 -import java.io.File;
  175.49 -import java.io.FileOutputStream;
  175.50 -import java.io.IOException;
  175.51 -import java.io.InputStream;
  175.52 -import java.util.Arrays;
  175.53 -import java.util.HashSet;
  175.54 -import java.util.Map;
  175.55 -import java.util.Properties;
  175.56 -import java.util.Set;
  175.57 -import java.util.concurrent.atomic.AtomicBoolean;
  175.58 -import java.util.jar.JarOutputStream;
  175.59 -import java.util.zip.ZipEntry;
  175.60 -import org.netbeans.api.java.classpath.ClassPath;
  175.61 -import org.netbeans.api.java.classpath.GlobalPathRegistry;
  175.62 -import org.netbeans.api.java.source.SourceUtils;
  175.63 -import org.netbeans.api.project.Project;
  175.64 -import org.netbeans.api.project.ProjectManager;
  175.65 -import org.netbeans.api.project.ProjectUtils;
  175.66 -import org.netbeans.api.project.SourceGroup;
  175.67 -import org.netbeans.api.project.ui.OpenProjects;
  175.68 -import org.netbeans.api.sendopts.CommandException;
  175.69 -import org.netbeans.modules.jackpot30.impl.duplicates.indexing.DuplicatesCustomIndexerImpl;
  175.70 -import org.netbeans.modules.jackpot30.impl.indexing.CustomIndexerImpl;
  175.71 -import org.netbeans.modules.parsing.impl.indexing.CacheFolder;
  175.72 -import org.netbeans.spi.java.classpath.support.ClassPathSupport;
  175.73 -import org.netbeans.spi.project.support.ant.PropertyUtils;
  175.74 -import org.netbeans.spi.sendopts.Env;
  175.75 -import org.netbeans.spi.sendopts.Option;
  175.76 -import org.netbeans.spi.sendopts.OptionProcessor;
  175.77 -import org.openide.LifecycleManager;
  175.78 -import org.openide.filesystems.FileObject;
  175.79 -import org.openide.filesystems.FileUtil;
  175.80 -import org.openide.util.Exceptions;
  175.81 -import org.openide.util.lookup.ServiceProvider;
  175.82 -
  175.83 -/**
  175.84 - *
  175.85 - * @author lahvac
  175.86 - */
  175.87 -@ServiceProvider(service=OptionProcessor.class)
  175.88 -public class OptionProcessorImpl extends OptionProcessor {
  175.89 -
  175.90 -    private final Option CATEGORY_ID = Option.requiredArgument(Option.NO_SHORT_NAME, "category-id");
  175.91 -    private final Option CATEGORY_NAME = Option.requiredArgument(Option.NO_SHORT_NAME, "category-name");
  175.92 -    private final Option CATEGORY_PROJECTS = Option.additionalArguments(Option.NO_SHORT_NAME, "category-projects");
  175.93 -    private final Option CATEGORY_ROOT_DIR = Option.requiredArgument(Option.NO_SHORT_NAME, "category-root-dir");
  175.94 -    private final Option CACHE_TARGET = Option.requiredArgument(Option.NO_SHORT_NAME, "cache-target");
  175.95 -    private final Set<Option> OPTIONS = new HashSet<Option>(Arrays.asList(CATEGORY_ID, CATEGORY_NAME, CATEGORY_PROJECTS, CATEGORY_ROOT_DIR, CACHE_TARGET));
  175.96 -    
  175.97 -    @Override
  175.98 -    protected Set<Option> getOptions() {
  175.99 -        return OPTIONS;
 175.100 -    }
 175.101 -
 175.102 -    @Override
 175.103 -    protected void process(Env env, Map<Option, String[]> optionValues) throws CommandException {
 175.104 -        String categoryId = null;
 175.105 -        String categoryName = null;
 175.106 -
 175.107 -        if (optionValues.containsKey(CATEGORY_ID)) {
 175.108 -            categoryId = optionValues.get(CATEGORY_ID)[0];
 175.109 -        }
 175.110 -
 175.111 -        if (optionValues.containsKey(CATEGORY_NAME)) {
 175.112 -            categoryName = optionValues.get(CATEGORY_NAME)[0];
 175.113 -        }
 175.114 -
 175.115 -        if (optionValues.containsKey(CATEGORY_PROJECTS)) {
 175.116 -            if (categoryId == null) {
 175.117 -                env.getErrorStream().println("Error: no category-id specified!");
 175.118 -                return;
 175.119 -            }
 175.120 -
 175.121 -            if (categoryName == null) {
 175.122 -                env.getErrorStream().println("Warning: no category-name specified.");
 175.123 -                return;
 175.124 -            }
 175.125 -
 175.126 -            try {
 175.127 -                CategoryStorage.setCategoryContent(categoryId, categoryName, getRoots(optionValues.get(CATEGORY_PROJECTS), env));
 175.128 -            } catch (InterruptedException ex) {
 175.129 -                throw (CommandException) new CommandException(0).initCause(ex);
 175.130 -            }
 175.131 -        }
 175.132 -
 175.133 -        String cacheTarget = optionValues.get(CACHE_TARGET)[0];
 175.134 -        File cache = FileUtil.normalizeFile(new File(cacheTarget));
 175.135 -
 175.136 -        cache.getParentFile().mkdirs();
 175.137 -
 175.138 -        if (categoryId == null) {
 175.139 -            env.getErrorStream().println("Error: no category-id specified!");
 175.140 -            return;
 175.141 -        }
 175.142 -
 175.143 -        try {
 175.144 -            indexProjects(CategoryStorage.getCategoryContent(categoryId), env);
 175.145 -        } catch (InterruptedException ex) {
 175.146 -            throw (CommandException) new CommandException(0).initCause(ex);
 175.147 -        } catch (IOException ex) {
 175.148 -            throw (CommandException) new CommandException(0).initCause(ex);
 175.149 -        }
 175.150 -
 175.151 -        JarOutputStream out = null;
 175.152 -        InputStream segments = null;
 175.153 -
 175.154 -        try {
 175.155 -            FileObject cacheFolder = CacheFolder.getCacheFolder();
 175.156 -
 175.157 -            out = new JarOutputStream(new FileOutputStream(cache));
 175.158 -            pack(out, cacheFolder, categoryId, new StringBuilder());
 175.159 -
 175.160 -            segments = cacheFolder.getFileObject("segments").getInputStream();
 175.161 -            Properties in = new Properties();
 175.162 -
 175.163 -            in.load(segments);
 175.164 -
 175.165 -            segments.close();//XXX: should be in finally!
 175.166 -
 175.167 -            File baseDirFile = new File(optionValues.get(CATEGORY_ROOT_DIR)[0]);
 175.168 -            String baseDir = baseDirFile.toURI().toString();
 175.169 -
 175.170 -            Properties outSegments = new Properties();
 175.171 -
 175.172 -            for (String segment : in.stringPropertyNames()) {
 175.173 -                String url = in.getProperty(segment);
 175.174 -                String rel = url.startsWith(baseDir) ? "rel:/" + url.substring(baseDir.length()) : url;
 175.175 -
 175.176 -                outSegments.setProperty(segment, rel);
 175.177 -            }
 175.178 -
 175.179 -            out.putNextEntry(new ZipEntry(categoryId + "/segments"));
 175.180 -
 175.181 -            outSegments.store(out, "");
 175.182 -        } catch (IOException ex) {
 175.183 -            throw (CommandException) new CommandException(0).initCause(ex);
 175.184 -        } finally {
 175.185 -            if (out != null) {
 175.186 -                try {
 175.187 -                    out.close();
 175.188 -                } catch (IOException ex) {
 175.189 -                    throw (CommandException) new CommandException(0).initCause(ex);
 175.190 -                }
 175.191 -            }
 175.192 -
 175.193 -            if (segments != null) {
 175.194 -                try {
 175.195 -                    segments.close();
 175.196 -                } catch (IOException ex) {
 175.197 -                    throw (CommandException) new CommandException(0).initCause(ex);
 175.198 -                }
 175.199 -            }
 175.200 -        }
 175.201 -        
 175.202 -        LifecycleManager.getDefault().exit();
 175.203 -    }
 175.204 -
 175.205 -    private Set<FileObject> getRoots(String[] projects, Env env) throws IllegalArgumentException, InterruptedException {
 175.206 -        Set<FileObject> sourceRoots = new HashSet<FileObject>(projects.length * 4 / 3 + 1);
 175.207 -
 175.208 -        for (String p : projects) {
 175.209 -            File f = PropertyUtils.resolveFile(env.getCurrentDirectory(), p);
 175.210 -            File normalized = FileUtil.normalizeFile(f);
 175.211 -            FileObject prjFO = FileUtil.toFileObject(normalized);
 175.212 -
 175.213 -            if (prjFO == null) {
 175.214 -                env.getErrorStream().println("Project location cannot be found: " + p);
 175.215 -                continue;
 175.216 -            }
 175.217 -
 175.218 -            if (!prjFO.isFolder()) {
 175.219 -                env.getErrorStream().println("Project specified as: " + p + " does not point to a directory (" + FileUtil.getFileDisplayName(prjFO));
 175.220 -                continue;
 175.221 -            }
 175.222 -
 175.223 -            try {
 175.224 -                Project prj = ProjectManager.getDefault().findProject(prjFO);
 175.225 -
 175.226 -                if (prj == null) {
 175.227 -                    env.getErrorStream().println("Project specified as: " + p + " does not resolve to a project (" + FileUtil.getFileDisplayName(prjFO));
 175.228 -                    continue;
 175.229 -                }
 175.230 -
 175.231 -                SourceGroup[] javaSG = ProjectUtils.getSources(prj).getSourceGroups("java");
 175.232 -
 175.233 -                if (javaSG.length == 0) {
 175.234 -                    env.getErrorStream().println("Project specified as: " + p + " does not define a java source groups (" + FileUtil.getFileDisplayName(prjFO));
 175.235 -                    continue;
 175.236 -                }
 175.237 -
 175.238 -                for (SourceGroup sg : javaSG) {
 175.239 -                    sourceRoots.add(sg.getRootFolder());
 175.240 -                }
 175.241 -            } catch (IOException ex) {
 175.242 -                Exceptions.printStackTrace(ex);
 175.243 -            } catch (IllegalArgumentException ex) {
 175.244 -                Exceptions.printStackTrace(ex);
 175.245 -            }
 175.246 -        }
 175.247 -
 175.248 -        return sourceRoots;
 175.249 -    }
 175.250 -
 175.251 -    private void indexProjects(Set<FileObject> sourceRoots, Env env) throws IOException, InterruptedException {
 175.252 -        if (sourceRoots.isEmpty()) {
 175.253 -            env.getErrorStream().println("Error: There is nothing to index!");
 175.254 -        } else {
 175.255 -            //XXX: to start up the project systems and RepositoryUpdater:
 175.256 -            ((Runnable) OpenProjects.getDefault().openProjects()).run();
 175.257 -            System.setProperty(CustomIndexerImpl.class.getName() + "-attributed", "true");//force partially attributed Jackpot index
 175.258 -            org.netbeans.api.project.ui.OpenProjects.getDefault().getOpenProjects();
 175.259 -            ClassPath source = ClassPathSupport.createClassPath(sourceRoots.toArray(new FileObject[0]));
 175.260 -
 175.261 -            GlobalPathRegistry.getDefault().register(ClassPath.SOURCE, new ClassPath[] {source});
 175.262 -            SourceUtils.waitScanFinished();
 175.263 -
 175.264 -            for (FileObject root : sourceRoots) {
 175.265 -                new DuplicatesCustomIndexerImpl.FactoryImpl().updateIndex(root.getURL(), new AtomicBoolean());
 175.266 -            }
 175.267 -            GlobalPathRegistry.getDefault().unregister(ClassPath.SOURCE, new ClassPath[] {source});
 175.268 -        }
 175.269 -    }
 175.270 -
 175.271 -    private void pack(JarOutputStream target, FileObject index, String name, StringBuilder relPath) throws IOException {
 175.272 -        int len = relPath.length();
 175.273 -        boolean first = relPath.length() == 0;
 175.274 -
 175.275 -        if (!first) relPath.append("/");
 175.276 -        relPath.append(name);
 175.277 -
 175.278 -        for (FileObject c : index.getChildren()) {
 175.279 -            if (first && c.getNameExt().equals("segments")) continue;
 175.280 -            pack(target, c, c.getNameExt(), relPath);
 175.281 -        }
 175.282 -
 175.283 -        if (index.isData()) {
 175.284 -            target.putNextEntry(new ZipEntry(relPath.toString()));
 175.285 -
 175.286 -            InputStream in = index.getInputStream();
 175.287 -
 175.288 -            try {
 175.289 -                FileUtil.copy(in, target);
 175.290 -            } finally {
 175.291 -                in.close();
 175.292 -            }
 175.293 -        }
 175.294 -
 175.295 -        relPath.delete(len, relPath.length());
 175.296 -    }
 175.297 -}
   176.1 --- a/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/api/API.java	Wed Jun 22 12:05:27 2011 +0200
   176.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   176.3 @@ -1,572 +0,0 @@
   176.4 -/*
   176.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   176.6 - *
   176.7 - * Copyright 2009-2010 Sun Microsystems, Inc. All rights reserved.
   176.8 - *
   176.9 - * The contents of this file are subject to the terms of either the GNU
  176.10 - * General Public License Version 2 only ("GPL") or the Common
  176.11 - * Development and Distribution License("CDDL") (collectively, the
  176.12 - * "License"). You may not use this file except in compliance with the
  176.13 - * License. You can obtain a copy of the License at
  176.14 - * http://www.netbeans.org/cddl-gplv2.html
  176.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  176.16 - * specific language governing permissions and limitations under the
  176.17 - * License.  When distributing the software, include this License Header
  176.18 - * Notice in each file and include the License file at
  176.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  176.20 - * particular file as subject to the "Classpath" exception as provided
  176.21 - * by Sun in the GPL Version 2 section of the License file that
  176.22 - * accompanied this code. If applicable, add the following below the
  176.23 - * License Header, with the fields enclosed by brackets [] replaced by
  176.24 - * your own identifying information:
  176.25 - * "Portions Copyrighted [year] [name of copyright owner]"
  176.26 - *
  176.27 - * If you wish your version of this file to be governed by only the CDDL
  176.28 - * or only the GPL Version 2, indicate your decision by adding
  176.29 - * "[Contributor] elects to include this software in this distribution
  176.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  176.31 - * single choice of license, a recipient has the option to distribute
  176.32 - * your version of this file under either the CDDL, the GPL Version 2 or
  176.33 - * to extend the choice of license to its licensees as provided above.
  176.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  176.35 - * Version 2 license, then the option applies only if the new code is
  176.36 - * made subject to such option by the copyright holder.
  176.37 - *
  176.38 - * Contributor(s):
  176.39 - *
  176.40 - * Portions Copyrighted 2009-2010 Sun Microsystems, Inc.
  176.41 - */
  176.42 -
  176.43 -package org.netbeans.modules.jackpot30.backend.impl.api;
  176.44 -
  176.45 -import java.io.IOException;
  176.46 -import java.io.OutputStream;
  176.47 -import java.io.OutputStreamWriter;
  176.48 -import java.io.Writer;
  176.49 -import java.lang.reflect.Method;
  176.50 -import java.lang.reflect.Modifier;
  176.51 -import java.util.ArrayList;
  176.52 -import java.util.Arrays;
  176.53 -import java.util.Collection;
  176.54 -import java.util.Collections;
  176.55 -import java.util.EnumSet;
  176.56 -import java.util.HashMap;
  176.57 -import java.util.HashSet;
  176.58 -import java.util.LinkedHashMap;
  176.59 -import java.util.LinkedList;
  176.60 -import java.util.List;
  176.61 -import java.util.Map;
  176.62 -import java.util.Map.Entry;
  176.63 -import java.util.Set;
  176.64 -import java.util.concurrent.atomic.AtomicBoolean;
  176.65 -import java.util.concurrent.atomic.AtomicLong;
  176.66 -import javax.lang.model.element.TypeElement;
  176.67 -import javax.tools.Diagnostic;
  176.68 -import javax.tools.JavaFileObject;
  176.69 -import javax.ws.rs.DefaultValue;
  176.70 -import javax.ws.rs.GET;
  176.71 -import javax.ws.rs.Path;
  176.72 -import javax.ws.rs.Produces;
  176.73 -import javax.ws.rs.QueryParam;
  176.74 -import javax.ws.rs.WebApplicationException;
  176.75 -import javax.ws.rs.core.StreamingOutput;
  176.76 -import org.codeviation.pojson.Pojson;
  176.77 -import org.netbeans.api.java.classpath.ClassPath;
  176.78 -import org.netbeans.api.java.source.ClassIndex.NameKind;
  176.79 -import org.netbeans.api.java.source.ClassIndex.SearchScope;
  176.80 -import org.netbeans.api.java.source.ClasspathInfo;
  176.81 -import org.netbeans.api.java.source.CompilationController;
  176.82 -import org.netbeans.api.java.source.ElementHandle;
  176.83 -import org.netbeans.api.java.source.ModificationResult;
  176.84 -import org.netbeans.modules.jackpot30.backend.impl.CategoryStorage;
  176.85 -import org.netbeans.modules.jackpot30.impl.examples.Example;
  176.86 -import org.netbeans.modules.jackpot30.impl.examples.Example.Option;
  176.87 -import org.netbeans.modules.jackpot30.impl.examples.LoadExamples;
  176.88 -import org.netbeans.modules.jackpot30.impl.indexing.FileBasedIndex;
  176.89 -import org.netbeans.modules.jackpot30.impl.indexing.Index;
  176.90 -import org.netbeans.modules.jackpot30.spi.PatternConvertor;
  176.91 -import org.netbeans.modules.java.hints.jackpot.impl.MessageImpl;
  176.92 -import org.netbeans.modules.java.hints.jackpot.impl.batch.BatchSearch;
  176.93 -import org.netbeans.modules.java.hints.jackpot.impl.batch.BatchSearch.BatchResult;
  176.94 -import org.netbeans.modules.java.hints.jackpot.impl.batch.BatchSearch.Resource;
  176.95 -import org.netbeans.modules.java.hints.jackpot.impl.batch.BatchUtilities;
  176.96 -import org.netbeans.modules.java.hints.jackpot.impl.batch.ProgressHandleWrapper;
  176.97 -import org.netbeans.modules.java.hints.jackpot.impl.batch.Scopes;
  176.98 -import org.netbeans.modules.java.hints.jackpot.spi.HintDescription;
  176.99 -import org.netbeans.modules.java.source.usages.ClassIndexManager;
 176.100 -import org.netbeans.modules.jumpto.type.GoToTypeAction;
 176.101 -import org.netbeans.spi.editor.hints.ErrorDescription;
 176.102 -import org.netbeans.spi.java.classpath.support.ClassPathSupport;
 176.103 -import org.openide.filesystems.FileObject;
 176.104 -import org.openide.filesystems.FileUtil;
 176.105 -import org.openide.util.Exceptions;
 176.106 -
 176.107 -/**
 176.108 - *
 176.109 - * @author lahvac
 176.110 - */
 176.111 -@Path("/index")
 176.112 -public class API {
 176.113 -
 176.114 -    @GET
 176.115 -    @Path("/find")
 176.116 -    @Produces("text/plain")
 176.117 -    //TODO: parameter for "verified"?
 176.118 -    public String find(@QueryParam("path") String segment, @QueryParam("pattern") String pattern, @QueryParam("asynchronous") @DefaultValue(value="false") boolean asynchronous) throws IOException {
 176.119 -        assert !asynchronous;
 176.120 -
 176.121 -        Iterable<? extends HintDescription> hints = PatternConvertor.create(pattern);
 176.122 -        Set<FileObject> srcRoots = CategoryStorage.getCategoryContent(segment);
 176.123 -        final FileObject deepestCommonParent = deepestCommonParent(srcRoots);
 176.124 -        BatchResult batchResult = BatchSearch.findOccurrences(hints, Scopes.specifiedFoldersScope(srcRoots.toArray(new FileObject[0])));
 176.125 -        final StringBuilder result = new StringBuilder();
 176.126 -
 176.127 -        BatchSearch.getVerifiedSpans(batchResult, new ProgressHandleWrapper(1), new BatchSearch.VerifiedSpansCallBack() {
 176.128 -            @Override public void groupStarted() {}
 176.129 -            @Override public boolean spansVerified(CompilationController wc, Resource r, Collection<? extends ErrorDescription> hints) throws Exception {
 176.130 -                if (!hints.isEmpty()) {
 176.131 -                    result.append(FileUtil.getRelativePath(deepestCommonParent, r.getResolvedFile()));
 176.132 -                    result.append("\n");
 176.133 -                }
 176.134 -                return true;
 176.135 -            }
 176.136 -            @Override public void groupFinished() {}
 176.137 -            @Override public void cannotVerifySpan(Resource r) { /*TODO: warn user?*/ }
 176.138 -        }, true, new LinkedList<MessageImpl>()); //TODO: show the messages to the user?
 176.139 -
 176.140 -        return result.toString();
 176.141 -    }
 176.142 -
 176.143 -    @GET
 176.144 -    @Path("/findWithSpans")
 176.145 -    @Produces("text/plain")
 176.146 -    //TODO: parameter for "verified"?
 176.147 -    public String findWithSpans(@QueryParam("path") String segment, @QueryParam("pattern") String pattern, @QueryParam("asynchronous") @DefaultValue(value="false") boolean asynchronous) throws IOException {
 176.148 -        assert !asynchronous;
 176.149 -
 176.150 -        Iterable<? extends HintDescription> hints = PatternConvertor.create(pattern);
 176.151 -        Set<FileObject> srcRoots = CategoryStorage.getCategoryContent(segment);
 176.152 -        final FileObject deepestCommonParent = deepestCommonParent(srcRoots);
 176.153 -        BatchResult batchResult = BatchSearch.findOccurrences(hints, Scopes.specifiedFoldersScope(srcRoots.toArray(new FileObject[0])));
 176.154 -        final Map<String, int[][]> result = new HashMap<String, int[][]>();
 176.155 -
 176.156 -        BatchSearch.getVerifiedSpans(batchResult, new ProgressHandleWrapper(1), new BatchSearch.VerifiedSpansCallBack() {
 176.157 -            @Override public void groupStarted() {}
 176.158 -            @Override public boolean spansVerified(CompilationController wc, Resource r, Collection<? extends ErrorDescription> hints) throws Exception {
 176.159 -                if (!hints.isEmpty()) {
 176.160 -                    int[][] spans = new int[hints.size()][];
 176.161 -                    int i = 0;
 176.162 -
 176.163 -                    for (ErrorDescription ed : hints) {
 176.164 -                        spans[i++] = new int[] {
 176.165 -                            ed.getRange().getBegin().getOffset(),
 176.166 -                            ed.getRange().getEnd().getOffset()
 176.167 -                        };
 176.168 -                    }
 176.169 -
 176.170 -                    result.put(FileUtil.getRelativePath(deepestCommonParent, r.getResolvedFile()), spans);
 176.171 -                }
 176.172 -                return true;
 176.173 -            }
 176.174 -            @Override public void groupFinished() {}
 176.175 -            @Override public void cannotVerifySpan(Resource r) { /*TODO: warn user?*/ }
 176.176 -        }, true, new LinkedList<MessageImpl>()); //TODO: show the messages to the user?
 176.177 -
 176.178 -        return Pojson.save(result);
 176.179 -    }
 176.180 -
 176.181 -//    @GET
 176.182 -//    @Path("/findCategorize")
 176.183 -//    @Produces("text/plain")
 176.184 -//    public String findCategorize(@QueryParam("path") final String segment, @QueryParam("pattern") final String pattern, @QueryParam("asynchronous") @DefaultValue(value="false") boolean asynchronous) throws IOException {
 176.185 -//        assert asynchronous;
 176.186 -//
 176.187 -//        long id = this.id.getAndIncrement();
 176.188 -//        final ProgressImpl progress = new ProgressImpl();
 176.189 -//
 176.190 -//        workInProgress.put(id, progress);
 176.191 -//
 176.192 -//        new Thread(new Runnable() {
 176.193 -//            public void run() {
 176.194 -//                try {
 176.195 -//                    File sourceRoot = Cache.sourceRootForKey(segment);
 176.196 -//                    Index idx = FileBasedIndex.get(sourceRoot.toURI().toURL());
 176.197 -//                    new SortedQuery().query(idx, pattern, progress);
 176.198 -//                } catch (IOException ex) {
 176.199 -//                    ex.printStackTrace();
 176.200 -//                    progress.finish();
 176.201 -//                }
 176.202 -//            }
 176.203 -//        }).start();
 176.204 -//
 176.205 -//        return Long.toString(id);
 176.206 -//    }
 176.207 -
 176.208 -    @GET
 176.209 -    @Path("/findSpans")
 176.210 -    @Produces("text/plain")
 176.211 -    public String findSpans(@QueryParam("path") String segment, @QueryParam("relativePath") String relativePath, @QueryParam("pattern") String pattern) throws IOException {
 176.212 -        Iterable<? extends HintDescription> hints = PatternConvertor.create(pattern);
 176.213 -        Set<FileObject> srcRoots = CategoryStorage.getCategoryContent(segment);
 176.214 -        FileObject deepestCommonParent = deepestCommonParent(srcRoots);
 176.215 -        BatchResult batchResult = BatchSearch.findOccurrences(hints, Scopes.specifiedFoldersScope(deepestCommonParent.getFileObject(relativePath)));
 176.216 -        final StringBuilder result = new StringBuilder();
 176.217 -
 176.218 -        BatchSearch.getVerifiedSpans(batchResult, new ProgressHandleWrapper(1), new BatchSearch.VerifiedSpansCallBack() {
 176.219 -            @Override public void groupStarted() {}
 176.220 -            @Override public boolean spansVerified(CompilationController wc, Resource r, Collection<? extends ErrorDescription> hints) throws Exception {
 176.221 -                for (ErrorDescription ed : hints) {
 176.222 -                    result.append(ed.getRange().getBegin().getOffset());
 176.223 -                    result.append(":");
 176.224 -                    result.append(ed.getRange().getEnd().getOffset());
 176.225 -                    result.append(":");
 176.226 -                }
 176.227 -                return true;
 176.228 -            }
 176.229 -            @Override public void groupFinished() {}
 176.230 -            @Override public void cannotVerifySpan(Resource r) { /*TODO: warn user?*/ }
 176.231 -        }, true, new LinkedList<MessageImpl>()); //TODO: show the messages to the user?
 176.232 -
 176.233 -        if (result.length() > 0) {
 176.234 -            result.delete(result.length() - 1, result.length());
 176.235 -        }
 176.236 -        return result.toString();
 176.237 -    }
 176.238 -
 176.239 -    @GET
 176.240 -    @Path("/list")
 176.241 -    @Produces("text/plain")
 176.242 -    public String list() throws IOException {
 176.243 -        StringBuilder sb = new StringBuilder();
 176.244 -
 176.245 -        for (Entry<String, String> e : CategoryStorage.listCategoriesWithNames().entrySet()) {
 176.246 -            sb.append(e.getKey());
 176.247 -            sb.append(":");
 176.248 -            sb.append(e.getValue());
 176.249 -            sb.append("\n");
 176.250 -        }
 176.251 -
 176.252 -        return sb.toString();
 176.253 -    }
 176.254 -
 176.255 -    @GET
 176.256 -    @Path("/cat")
 176.257 -    @Produces("text/plain")
 176.258 -    public String cat(@QueryParam("path") String segment, @QueryParam("relative") String relative) throws IOException {
 176.259 -        Set<FileObject> srcRoots = CategoryStorage.getCategoryContent(segment);
 176.260 -        FileObject deepestCommonParent = deepestCommonParent(srcRoots);
 176.261 -        FileObject file = deepestCommonParent.getFileObject(relative);
 176.262 -        ClassPath cp = ClassPathSupport.createClassPath(srcRoots.toArray(new FileObject[0]));
 176.263 -        FileObject root = cp.findOwnerRoot(file);
 176.264 -        String path = cp.getResourceName(file);
 176.265 -        Index index = FileBasedIndex.get(root.getURL());
 176.266 -
 176.267 -        if (index == null) {
 176.268 -            throw new IOException("No index");
 176.269 -        }
 176.270 -
 176.271 -        CharSequence source = index.getSourceCode(path);
 176.272 -
 176.273 -        if (source == null) {
 176.274 -            throw new IOException("Source code not found");
 176.275 -        }
 176.276 -        
 176.277 -        return source.toString().replaceAll("\r\n", "\n");
 176.278 -    }
 176.279 -
 176.280 -    @GET
 176.281 -    @Path("/apply")
 176.282 -    @Produces("text/diff")
 176.283 -    //TODO: parameter for "verified"?
 176.284 -    public StreamingOutput apply(@QueryParam("path") String segment, @QueryParam("pattern") String pattern, @QueryParam("asynchronous") @DefaultValue(value="false") boolean asynchronous) throws IOException {
 176.285 -        assert !asynchronous;
 176.286 -
 176.287 -        Iterable<? extends HintDescription> hints = PatternConvertor.create(pattern);
 176.288 -        Set<FileObject> srcRoots = CategoryStorage.getCategoryContent(segment);
 176.289 -        final FileObject deepestCommonParent = deepestCommonParent(srcRoots);
 176.290 -        BatchResult batchResult = BatchSearch.findOccurrences(hints, Scopes.specifiedFoldersScope(srcRoots.toArray(new FileObject[0])));
 176.291 -        final Collection<ModificationResult> modifications = BatchUtilities.applyFixes(batchResult, new ProgressHandleWrapper(1), new AtomicBoolean(), new LinkedList<MessageImpl>());
 176.292 -
 176.293 -        return new StreamingOutput() {
 176.294 -            @Override public void write(OutputStream output) throws IOException, WebApplicationException {
 176.295 -                Writer w = new OutputStreamWriter(output, "UTF-8");
 176.296 -
 176.297 -                try {
 176.298 -                    for (ModificationResult modResult : modifications) {
 176.299 -                        org.netbeans.modules.jackpot30.impl.batch.BatchUtilities.exportDiff(modResult, deepestCommonParent, w);
 176.300 -                    }
 176.301 -                } finally {
 176.302 -                    try {
 176.303 -                        w.close();
 176.304 -                    } catch (IOException ex) {
 176.305 -                        Exceptions.printStackTrace(ex);
 176.306 -                    }
 176.307 -                }
 176.308 -            }
 176.309 -        };
 176.310 -    }
 176.311 -
 176.312 -//    @GET
 176.313 -//    @Path("/info")
 176.314 -//    @Produces("text/plain")
 176.315 -//    public String info(@QueryParam("path") String segment) throws IOException {
 176.316 -//        URL sourceRoot = Cache.sourceRootForKey(segment).toURI().toURL();
 176.317 -//        Index index = FileBasedIndex.get(sourceRoot);
 176.318 -//
 176.319 -//        if (index == null) {
 176.320 -//            throw new IOException("No index");
 176.321 -//        }
 176.322 -//
 176.323 -//        return Pojson.save(index.getIndexInfo());
 176.324 -//    }
 176.325 -
 176.326 -    @GET
 176.327 -    @Path("/examples")
 176.328 -    @Produces("text/plain")
 176.329 -    public String examples() throws IOException {
 176.330 -        List<Map<String, String>> examples = new LinkedList<Map<String, String>>();
 176.331 -
 176.332 -        for (Example ex : LoadExamples.loadExamples()) {
 176.333 -            if (ex.getOptions().contains(Option.VERIFY) || ex.getOptions().contains(Option.FIX)) continue;
 176.334 -            Map<String, String> desc = new HashMap<String, String>();
 176.335 -
 176.336 -            desc.put("displayName", ex.getDisplayName());
 176.337 -            desc.put("pattern", ex.getCode());
 176.338 -
 176.339 -            examples.add(desc);
 176.340 -        }
 176.341 -
 176.342 -        return Pojson.save(examples);
 176.343 -    }
 176.344 -
 176.345 -    @GET
 176.346 -    @Path("/errors")
 176.347 -    @Produces("text/plain")
 176.348 -    public String errors(@QueryParam("pattern") String pattern) throws IOException {
 176.349 -        StringBuilder sb = new StringBuilder();
 176.350 -
 176.351 -        for (Diagnostic<? extends JavaFileObject> d : StandaloneFinder.parseAndReportErrors(pattern)) {
 176.352 -            sb.append(d.getMessage(null));
 176.353 -            sb.append("\n");
 176.354 -        }
 176.355 -
 176.356 -        return sb.toString();
 176.357 -    }
 176.358 -
 176.359 -    @GET
 176.360 -    @Path("/findDuplicates")
 176.361 -    @Produces("text/plain")
 176.362 -    public String findDuplicates(@QueryParam("path") String segment, @QueryParam("hashes") String hashes) throws IOException {
 176.363 -        Map<String, Map<String, Collection<String>>> hash2Segment2Contains = new HashMap<String, Map<String, Collection<String>>>();
 176.364 -        Collection<String> segments = new LinkedList<String>();
 176.365 -
 176.366 -        if (segment != null) segments.add(segment);
 176.367 -        else {
 176.368 -            segments.addAll(CategoryStorage.listCategoriesWithNames().keySet());
 176.369 -        }
 176.370 -
 176.371 -        Iterable<? extends String> hashesList = Arrays.asList(Pojson.load(String[].class, hashes));
 176.372 -
 176.373 -        for (String seg : segments) {
 176.374 -            Set<FileObject> srcRoots = CategoryStorage.getCategoryContent(seg);
 176.375 -            final FileObject deepestCommonParent = deepestCommonParent(srcRoots);
 176.376 -
 176.377 -            for (FileObject root : srcRoots) {
 176.378 -                Map<String, Collection<? extends String>> found = StandaloneFinder.containsHash(FileUtil.toFile(root), hashesList);
 176.379 -
 176.380 -                for (Entry<String, Collection<? extends String>> e : found.entrySet()) {
 176.381 -                    Map<String, Collection<String>> perRoot = hash2Segment2Contains.get(e.getKey());
 176.382 -
 176.383 -                    if (perRoot == null) {
 176.384 -                        hash2Segment2Contains.put(e.getKey(), perRoot = new HashMap<String, Collection<String>>());
 176.385 -                    }
 176.386 -
 176.387 -                    Collection<String> rel = perRoot.get(seg);
 176.388 -
 176.389 -                    if (rel == null) {
 176.390 -                        perRoot.put(seg, rel = new ArrayList<String>(e.getValue().size()));
 176.391 -                    }
 176.392 -
 176.393 -                    for (String r : e.getValue()) {
 176.394 -                        rel.add(FileUtil.getRelativePath(deepestCommonParent, root.getFileObject(r)));
 176.395 -                    }
 176.396 -                }
 176.397 -            }
 176.398 -        }
 176.399 -
 176.400 -        return Pojson.save(hash2Segment2Contains);
 176.401 -    }
 176.402 -
 176.403 -    @GET
 176.404 -    @Path("/checkProgress")
 176.405 -    @Produces("text/plain")
 176.406 -    public String checkProgress(@QueryParam("id") long id) throws IOException {
 176.407 -        ProgressImpl progress = workInProgress.get(id);
 176.408 -        Map<String, Object> result;
 176.409 -
 176.410 -        if (progress == null) {
 176.411 -            result = new HashMap<String, Object>();
 176.412 -            result.put("total", 0);
 176.413 -            result.put("workDone", 0);
 176.414 -            result.put("finished", true);
 176.415 -            result.put("result", Collections.<String>emptyList());
 176.416 -        } else {
 176.417 -            result = progress.progressPacket();
 176.418 -        }
 176.419 -
 176.420 -        if (result.get("finished") == Boolean.TRUE) {
 176.421 -            workInProgress.remove(id);
 176.422 -        }
 176.423 -
 176.424 -        return Pojson.save(result);
 176.425 -    }
 176.426 -
 176.427 -    @GET
 176.428 -    @Path("/cancelProgress")
 176.429 -    @Produces("text/plain")
 176.430 -    public String cancelProgress(@QueryParam("id") long id) throws IOException {
 176.431 -        ProgressImpl progress = workInProgress.get(id);
 176.432 -
 176.433 -        if (progress != null) {
 176.434 -            progress.cancel.set(true);
 176.435 -        }
 176.436 -
 176.437 -        return "done";
 176.438 -    }
 176.439 -
 176.440 -    @GET
 176.441 -    @Path("/capabilities")
 176.442 -    @Produces("text/plain")
 176.443 -    public String capabilities() throws IOException {
 176.444 -        Map<String, Object> result = new HashMap<String, Object>();
 176.445 -        List<String> methods = new ArrayList<String>(API.class.getDeclaredMethods().length);
 176.446 -
 176.447 -        for (Method m : API.class.getDeclaredMethods()) {
 176.448 -            if (m.isAnnotationPresent(GET.class) && (m.getModifiers() & Modifier.PUBLIC) != 0) {
 176.449 -                methods.add(m.getName());
 176.450 -            }
 176.451 -        }
 176.452 -
 176.453 -        result.put("methods", methods);
 176.454 -        result.put("attributed", true);
 176.455 -
 176.456 -        return Pojson.save(result);
 176.457 -    }
 176.458 -
 176.459 -    @GET
 176.460 -    @Path("/findType")
 176.461 -    @Produces("text/plain")
 176.462 -    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 {
 176.463 -        assert !asynchronous;
 176.464 -
 176.465 -        //copied (and converted to NameKind) from jumpto's GoToTypeAction:
 176.466 -        boolean exact = prefix.endsWith(" "); // NOI18N
 176.467 -
 176.468 -        prefix = prefix.trim();
 176.469 -
 176.470 -        if ( prefix.length() == 0) {
 176.471 -            return "";
 176.472 -        }
 176.473 -
 176.474 -        NameKind nameKind;
 176.475 -        int wildcard = GoToTypeAction.containsWildCard(prefix);
 176.476 -
 176.477 -        if (exact) {
 176.478 -            //nameKind = panel.isCaseSensitive() ? SearchType.EXACT_NAME : SearchType.CASE_INSENSITIVE_EXACT_NAME;
 176.479 -            nameKind = NameKind.SIMPLE_NAME;
 176.480 -        }
 176.481 -        else if ((GoToTypeAction.isAllUpper(prefix) && prefix.length() > 1) || GoToTypeAction.isCamelCase(prefix)) {
 176.482 -            nameKind = NameKind.CAMEL_CASE;
 176.483 -        }
 176.484 -        else if (wildcard != -1) {
 176.485 -            nameKind = casesensitive ? NameKind.REGEXP : NameKind.CASE_INSENSITIVE_REGEXP;
 176.486 -        }
 176.487 -        else {
 176.488 -            nameKind = casesensitive ? NameKind.PREFIX : NameKind.CASE_INSENSITIVE_PREFIX;
 176.489 -        }
 176.490 -
 176.491 -        Map<String, List<String>> result = new LinkedHashMap<String, List<String>>();
 176.492 -        Set<FileObject> srcRoots = CategoryStorage.getCategoryContent(segment);
 176.493 -        FileObject deepestCommonParent = deepestCommonParent(srcRoots);
 176.494 -
 176.495 -        for (FileObject srcRoot : srcRoots) {
 176.496 -            String rootId = FileUtil.getRelativePath(deepestCommonParent, srcRoot);
 176.497 -            List<String> currentResult = new ArrayList<String>();
 176.498 -
 176.499 -            result.put(rootId, currentResult);
 176.500 -
 176.501 -            ClassIndexManager.getDefault().createUsagesQuery(srcRoot.getURL(), true);
 176.502 -            ClasspathInfo cpInfo = ClasspathInfo.create(ClassPath.EMPTY, ClassPath.EMPTY, ClassPathSupport.createClassPath(srcRoot));
 176.503 -            Set<ElementHandle<TypeElement>> names = new HashSet<ElementHandle<TypeElement>>(cpInfo.getClassIndex().getDeclaredTypes(prefix, nameKind, EnumSet.of(SearchScope.SOURCE)));
 176.504 -
 176.505 -            if (nameKind == NameKind.CAMEL_CASE) {
 176.506 -                names.addAll(cpInfo.getClassIndex().getDeclaredTypes(prefix, NameKind.CASE_INSENSITIVE_PREFIX, EnumSet.of(SearchScope.SOURCE)));
 176.507 -            }
 176.508 -
 176.509 -            for (ElementHandle<TypeElement> d : names) {
 176.510 -                currentResult.add(d.getBinaryName());
 176.511 -            }
 176.512 -        }
 176.513 -
 176.514 -        return Pojson.save(result);
 176.515 -    }
 176.516 -
 176.517 -    //XXX: not really correct, a base directory(-ies?) should be set in the category!
 176.518 -    private static FileObject deepestCommonParent(Set<FileObject> roots) {
 176.519 -        FileObject result = null;
 176.520 -
 176.521 -        for (FileObject r : roots) {
 176.522 -            if (result == null) {
 176.523 -                result = r;
 176.524 -            } else {
 176.525 -                while (!FileUtil.isParentOf(result, r)) {
 176.526 -                    result = result.getParent();
 176.527 -                }
 176.528 -            }
 176.529 -        }
 176.530 -
 176.531 -        return result;
 176.532 -    }
 176.533 -
 176.534 -    private final static AtomicLong id = new AtomicLong();
 176.535 -    private final static Map<Long, ProgressImpl> workInProgress = new HashMap<Long, ProgressImpl>();//XXX: should be cleared eventually even if not read
 176.536 -
 176.537 -    private static final class ProgressImpl implements Progress {
 176.538 -        private int total = -1;
 176.539 -        private int workDone = 0;
 176.540 -        private boolean finished;
 176.541 -        private final List<String> result = new ArrayList<String>();
 176.542 -        private final AtomicBoolean cancel = new AtomicBoolean();
 176.543 -        public synchronized void setTotalWork(int total) {
 176.544 -            this.total = total;
 176.545 -        }
 176.546 -        public synchronized void progress(int totalDone) {
 176.547 -            workDone = totalDone;
 176.548 -        }
 176.549 -        public synchronized void updateProgress(int updateDone) {
 176.550 -            workDone += updateDone;
 176.551 -        }
 176.552 -        public synchronized void addResultPart(String part) {
 176.553 -            result.add(part);
 176.554 -        }
 176.555 -        public synchronized void finish() {
 176.556 -            finished = true;
 176.557 -        }
 176.558 -        public synchronized boolean isCancelled() {
 176.559 -            return cancel.get();
 176.560 -        }
 176.561 -        synchronized Map<String, Object> progressPacket() {
 176.562 -            Map<String, Object> result = new HashMap<String, Object>();
 176.563 -
 176.564 -            result.put("total", total);
 176.565 -            result.put("workDone", workDone);
 176.566 -            result.put("finished", finished);
 176.567 -            result.put("result", new ArrayList<String>(this.result));
 176.568 -
 176.569 -            this.result.clear();
 176.570 -
 176.571 -            return result;
 176.572 -        }
 176.573 -    }
 176.574 -
 176.575 -}
   177.1 --- a/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/api/Progress.java	Wed Jun 22 12:05:27 2011 +0200
   177.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   177.3 @@ -1,60 +0,0 @@
   177.4 -/*
   177.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   177.6 - *
   177.7 - * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
   177.8 - *
   177.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  177.10 - * Other names may be trademarks of their respective owners.
  177.11 - *
  177.12 - * The contents of this file are subject to the terms of either the GNU
  177.13 - * General Public License Version 2 only ("GPL") or the Common
  177.14 - * Development and Distribution License("CDDL") (collectively, the
  177.15 - * "License"). You may not use this file except in compliance with the
  177.16 - * License. You can obtain a copy of the License at
  177.17 - * http://www.netbeans.org/cddl-gplv2.html
  177.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  177.19 - * specific language governing permissions and limitations under the
  177.20 - * License.  When distributing the software, include this License Header
  177.21 - * Notice in each file and include the License file at
  177.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  177.23 - * particular file as subject to the "Classpath" exception as provided
  177.24 - * by Oracle in the GPL Version 2 section of the License file that
  177.25 - * accompanied this code. If applicable, add the following below the
  177.26 - * License Header, with the fields enclosed by brackets [] replaced by
  177.27 - * your own identifying information:
  177.28 - * "Portions Copyrighted [year] [name of copyright owner]"
  177.29 - *
  177.30 - * If you wish your version of this file to be governed by only the CDDL
  177.31 - * or only the GPL Version 2, indicate your decision by adding
  177.32 - * "[Contributor] elects to include this software in this distribution
  177.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  177.34 - * single choice of license, a recipient has the option to distribute
  177.35 - * your version of this file under either the CDDL, the GPL Version 2 or
  177.36 - * to extend the choice of license to its licensees as provided above.
  177.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  177.38 - * Version 2 license, then the option applies only if the new code is
  177.39 - * made subject to such option by the copyright holder.
  177.40 - *
  177.41 - * Contributor(s):
  177.42 - *
  177.43 - * Portions Copyrighted 2011 Sun Microsystems, Inc.
  177.44 - */
  177.45 -
  177.46 -package org.netbeans.modules.jackpot30.backend.impl.api;
  177.47 -
  177.48 -/**
  177.49 - *
  177.50 - * @author lahvac
  177.51 - */
  177.52 -public interface Progress {
  177.53 -
  177.54 -    public void setTotalWork(int total);
  177.55 -    public void progress(int totalDone);
  177.56 -    public void updateProgress(int updateDone);
  177.57 -    public void addResultPart(String part);
  177.58 -    public void finish();
  177.59 -    
  177.60 -    public boolean isCancelled();
  177.61 -
  177.62 -
  177.63 -}
   178.1 --- a/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/api/StandaloneFinder.java	Wed Jun 22 12:05:27 2011 +0200
   178.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   178.3 @@ -1,213 +0,0 @@
   178.4 -/*
   178.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   178.6 - *
   178.7 - * Copyright 2009-2010 Sun Microsystems, Inc. All rights reserved.
   178.8 - *
   178.9 - * The contents of this file are subject to the terms of either the GNU
  178.10 - * General Public License Version 2 only ("GPL") or the Common
  178.11 - * Development and Distribution License("CDDL") (collectively, the
  178.12 - * "License"). You may not use this file except in compliance with the
  178.13 - * License. You can obtain a copy of the License at
  178.14 - * http://www.netbeans.org/cddl-gplv2.html
  178.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  178.16 - * specific language governing permissions and limitations under the
  178.17 - * License.  When distributing the software, include this License Header
  178.18 - * Notice in each file and include the License file at
  178.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  178.20 - * particular file as subject to the "Classpath" exception as provided
  178.21 - * by Sun in the GPL Version 2 section of the License file that
  178.22 - * accompanied this code. If applicable, add the following below the
  178.23 - * License Header, with the fields enclosed by brackets [] replaced by
  178.24 - * your own identifying information:
  178.25 - * "Portions Copyrighted [year] [name of copyright owner]"
  178.26 - *
  178.27 - * If you wish your version of this file to be governed by only the CDDL
  178.28 - * or only the GPL Version 2, indicate your decision by adding
  178.29 - * "[Contributor] elects to include this software in this distribution
  178.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  178.31 - * single choice of license, a recipient has the option to distribute
  178.32 - * your version of this file under either the CDDL, the GPL Version 2 or
  178.33 - * to extend the choice of license to its licensees as provided above.
  178.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  178.35 - * Version 2 license, then the option applies only if the new code is
  178.36 - * made subject to such option by the copyright holder.
  178.37 - *
  178.38 - * Contributor(s):
  178.39 - *
  178.40 - * Portions Copyrighted 2009-2010 Sun Microsystems, Inc.
  178.41 - */
  178.42 -
  178.43 -package org.netbeans.modules.jackpot30.backend.impl.api;
  178.44 -
  178.45 -import com.sun.source.tree.CompilationUnitTree;
  178.46 -import com.sun.source.tree.Tree;
  178.47 -import com.sun.source.util.TreePath;
  178.48 -import com.sun.source.util.Trees;
  178.49 -import com.sun.tools.javac.api.JavacTaskImpl;
  178.50 -import java.io.File;
  178.51 -import java.io.IOException;
  178.52 -import java.net.URI;
  178.53 -import java.net.URL;
  178.54 -import java.util.Arrays;
  178.55 -import java.util.BitSet;
  178.56 -import java.util.Collection;
  178.57 -import java.util.Collections;
  178.58 -import java.util.HashMap;
  178.59 -import java.util.LinkedList;
  178.60 -import java.util.Map;
  178.61 -import javax.tools.Diagnostic;
  178.62 -import javax.tools.JavaCompiler;
  178.63 -import javax.tools.JavaFileObject;
  178.64 -import javax.tools.SimpleJavaFileObject;
  178.65 -import javax.tools.ToolProvider;
  178.66 -import org.apache.lucene.document.Document;
  178.67 -import org.apache.lucene.index.IndexReader;
  178.68 -import org.apache.lucene.index.Term;
  178.69 -import org.apache.lucene.search.Collector;
  178.70 -import org.apache.lucene.search.IndexSearcher;
  178.71 -import org.apache.lucene.search.Query;
  178.72 -import org.apache.lucene.search.Searcher;
  178.73 -import org.apache.lucene.search.TermQuery;
  178.74 -import org.apache.lucene.store.FSDirectory;
  178.75 -import org.netbeans.modules.jackpot30.impl.duplicates.indexing.DuplicatesIndex;
  178.76 -import org.netbeans.modules.jackpot30.impl.indexing.AbstractLuceneIndex.BitSetCollector;
  178.77 -import org.netbeans.modules.jackpot30.impl.indexing.FileBasedIndex;
  178.78 -import org.netbeans.modules.jackpot30.spi.PatternConvertor;
  178.79 -import org.netbeans.modules.java.hints.jackpot.impl.Utilities;
  178.80 -import org.netbeans.modules.java.hints.jackpot.impl.pm.BulkSearch;
  178.81 -import org.netbeans.modules.java.hints.jackpot.impl.pm.BulkSearch.BulkPattern;
  178.82 -import org.netbeans.modules.java.hints.jackpot.spi.HintDescription;
  178.83 -import org.netbeans.modules.java.hints.jackpot.spi.HintDescription.AdditionalQueryConstraints;
  178.84 -import org.netbeans.modules.java.hints.jackpot.spi.Trigger.PatternDescription;
  178.85 -import org.netbeans.modules.parsing.impl.indexing.CacheFolder;
  178.86 -import org.netbeans.modules.parsing.impl.indexing.SPIAccessor;
  178.87 -import org.openide.filesystems.FileObject;
  178.88 -import org.openide.filesystems.FileUtil;
  178.89 -
  178.90 -/**
  178.91 - *
  178.92 - * @author lahvac
  178.93 - */
  178.94 -public class StandaloneFinder {
  178.95 -
  178.96 -    public static Collection<? extends String> findCandidates(File sourceRoot, String pattern) throws IOException {
  178.97 -        BulkPattern bulkPattern = preparePattern(pattern, null);
  178.98 -        
  178.99 -        return FileBasedIndex.get(sourceRoot.toURI().toURL()).findCandidates(bulkPattern);
 178.100 -    }
 178.101 -
 178.102 -    public static int[] findCandidateOccurrenceSpans(File sourceRoot, String relativePath, String pattern) throws IOException {
 178.103 -        BulkPattern bulkPattern = preparePattern(pattern, null);
 178.104 -        CharSequence source = FileBasedIndex.get(sourceRoot.toURI().toURL()).getSourceCode(relativePath).toString().replaceAll("\r\n", "\n");
 178.105 -        JavacTaskImpl jti = prepareJavacTaskImpl();
 178.106 -        CompilationUnitTree cut = jti.parse(new JFOImpl(source)).iterator().next();
 178.107 -        Collection<TreePath> paths = new LinkedList<TreePath>();
 178.108 -        
 178.109 -        for (Collection<TreePath> c : BulkSearch.getDefault().match(null, new TreePath(cut), bulkPattern).values()) {
 178.110 -            paths.addAll(c);
 178.111 -        }
 178.112 -
 178.113 -        Trees t = Trees.instance(jti);
 178.114 -        int[] result = new int[2 * paths.size()];
 178.115 -        int i = 0;
 178.116 -
 178.117 -        for (TreePath tp : paths) {
 178.118 -            result[i++] = (int) t.getSourcePositions().getStartPosition(cut, tp.getLeaf());
 178.119 -            result[i++] = (int) t.getSourcePositions().getEndPosition(cut, tp.getLeaf());
 178.120 -        }
 178.121 -
 178.122 -        return result;
 178.123 -    }
 178.124 -
 178.125 -    public static Collection<Diagnostic<? extends JavaFileObject>> parseAndReportErrors(String pattern) {
 178.126 -        Collection<Diagnostic<? extends JavaFileObject>> errors = new LinkedList<Diagnostic<? extends JavaFileObject>>();
 178.127 -
 178.128 -        preparePattern(pattern, errors);
 178.129 -
 178.130 -        return errors;
 178.131 -    }
 178.132 -
 178.133 -    private static File getIndex(URL url) throws IOException {
 178.134 -        FileObject indexBaseFolder = CacheFolder.getDataFolder(url);
 178.135 -        String path = SPIAccessor.getInstance().getIndexerPath(DuplicatesIndex.NAME, DuplicatesIndex.VERSION);
 178.136 -        FileObject indexFolder = FileUtil.createFolder(indexBaseFolder, path);
 178.137 -        return FileUtil.toFile(indexFolder);
 178.138 -    }
 178.139 -
 178.140 -    public static Map<String, Collection<? extends String>> containsHash(File sourceRoot, Iterable<? extends String> hashes) throws IOException {
 178.141 -        File cacheRoot = getIndex(sourceRoot.toURI().toURL());
 178.142 -        File dir = new File(cacheRoot, "fulltext");
 178.143 -
 178.144 -        if (dir.listFiles() != null && dir.listFiles().length > 0) {
 178.145 -            IndexReader reader = IndexReader.open(FSDirectory.open(dir), true);
 178.146 -            Map<String, Collection<? extends String>> result = new HashMap<String, Collection<? extends String>>();
 178.147 -
 178.148 -            for (String hash : hashes) {
 178.149 -                Collection<String> found = new LinkedList<String>();
 178.150 -                Query query = new TermQuery(new Term("generalized", hash));
 178.151 -                Searcher s = new IndexSearcher(reader);
 178.152 -                BitSet matchingDocuments = new BitSet(reader.maxDoc());
 178.153 -                Collector c = new BitSetCollector(matchingDocuments);
 178.154 -
 178.155 -                s.search(query, c);
 178.156 -
 178.157 -                for (int docNum = matchingDocuments.nextSetBit(0); docNum >= 0; docNum = matchingDocuments.nextSetBit(docNum + 1)) {
 178.158 -                    final Document doc = reader.document(docNum);
 178.159 -
 178.160 -                    found.add(doc.getField("path").stringValue());
 178.161 -                }
 178.162 -
 178.163 -                result.put(hash, found);
 178.164 -            }
 178.165 -            
 178.166 -            return result;
 178.167 -        }
 178.168 -
 178.169 -        return Collections.emptyMap();
 178.170 -    }
 178.171 -    
 178.172 -    private static BulkPattern preparePattern(String pattern, Collection<Diagnostic<? extends JavaFileObject>> errors) {
 178.173 -        return preparePattern(PatternConvertor.create(pattern), errors);
 178.174 -    }
 178.175 -
 178.176 -    //XXX: copied from BatchSearch, may be possible to merge once CompilationInfo is accessible in server mode
 178.177 -    private static BulkPattern preparePattern(final Iterable<? extends HintDescription> patterns, Collection<Diagnostic<? extends JavaFileObject>> errors) {
 178.178 -        JavacTaskImpl javac = prepareJavacTaskImpl();
 178.179 -        Collection<String> code = new LinkedList<String>();
 178.180 -        Collection<Tree> trees = new LinkedList<Tree>();
 178.181 -        Collection<AdditionalQueryConstraints> additionalConstraints = new LinkedList<AdditionalQueryConstraints>();
 178.182 -
 178.183 -        for (HintDescription pattern : patterns) {
 178.184 -            String textPattern = ((PatternDescription) pattern.getTrigger()).getPattern();
 178.185 -
 178.186 -            code.add(textPattern);
 178.187 -            trees.add(Utilities.parseAndAttribute(javac, textPattern, errors));
 178.188 -            additionalConstraints.add(pattern.getAdditionalConstraints());
 178.189 -        }
 178.190 -
 178.191 -        return BulkSearch.getDefault().create(code, trees, additionalConstraints);
 178.192 -    }
 178.193 -
 178.194 -    private static JavacTaskImpl prepareJavacTaskImpl() {
 178.195 -        final String bootPath = System.getProperty("sun.boot.class.path"); //NOI18N
 178.196 -        final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
 178.197 -
 178.198 -        assert tool != null;
 178.199 -
 178.200 -        JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(null, null, null, Arrays.asList("-bootclasspath",  bootPath, "-Xjcov"), null, Collections.<JavaFileObject>emptyList());
 178.201 -        
 178.202 -        return ct;
 178.203 -    }
 178.204 -
 178.205 -    private static final class JFOImpl extends SimpleJavaFileObject {
 178.206 -        private final CharSequence code;
 178.207 -        public JFOImpl(CharSequence code) {
 178.208 -            super(URI.create(""), Kind.SOURCE);
 178.209 -            this.code = code;
 178.210 -        }
 178.211 -        @Override
 178.212 -        public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
 178.213 -            return code;
 178.214 -        }
 178.215 -    }
 178.216 -}
   179.1 --- a/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/resources/layer.xml	Wed Jun 22 12:05:27 2011 +0200
   179.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   179.3 @@ -1,14 +0,0 @@
   179.4 -<?xml version="1.0" encoding="UTF-8"?>
   179.5 -<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
   179.6 -<filesystem>
   179.7 -    <folder name="public_html">
   179.8 -        <folder name="index">
   179.9 -            <folder name="find">
  179.10 -                <attr name="net.sf.dvbcentral.http.spi.UnknownPageRequest" methodvalue="org.netbeans.modules.jackpot30.backend.impl.api.API.createFindPageRequest" />
  179.11 -            </folder>
  179.12 -            <folder name="list">
  179.13 -                <attr name="net.sf.dvbcentral.http.spi.UnknownPageRequest" methodvalue="org.netbeans.modules.jackpot30.backend.impl.api.API.createListPageRequest" />
  179.14 -            </folder>
  179.15 -        </folder>
  179.16 -    </folder>
  179.17 -</filesystem>
   180.1 --- a/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/ui/UI.java	Wed Jun 22 12:05:27 2011 +0200
   180.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   180.3 @@ -1,423 +0,0 @@
   180.4 -/*
   180.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   180.6 - *
   180.7 - * Copyright 2009-2010 Sun Microsystems, Inc. All rights reserved.
   180.8 - *
   180.9 - * The contents of this file are subject to the terms of either the GNU
  180.10 - * General Public License Version 2 only ("GPL") or the Common
  180.11 - * Development and Distribution License("CDDL") (collectively, the
  180.12 - * "License"). You may not use this file except in compliance with the
  180.13 - * License. You can obtain a copy of the License at
  180.14 - * http://www.netbeans.org/cddl-gplv2.html
  180.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  180.16 - * specific language governing permissions and limitations under the
  180.17 - * License.  When distributing the software, include this License Header
  180.18 - * Notice in each file and include the License file at
  180.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  180.20 - * particular file as subject to the "Classpath" exception as provided
  180.21 - * by Sun in the GPL Version 2 section of the License file that
  180.22 - * accompanied this code. If applicable, add the following below the
  180.23 - * License Header, with the fields enclosed by brackets [] replaced by
  180.24 - * your own identifying information:
  180.25 - * "Portions Copyrighted [year] [name of copyright owner]"
  180.26 - *
  180.27 - * If you wish your version of this file to be governed by only the CDDL
  180.28 - * or only the GPL Version 2, indicate your decision by adding
  180.29 - * "[Contributor] elects to include this software in this distribution
  180.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  180.31 - * single choice of license, a recipient has the option to distribute
  180.32 - * your version of this file under either the CDDL, the GPL Version 2 or
  180.33 - * to extend the choice of license to its licensees as provided above.
  180.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  180.35 - * Version 2 license, then the option applies only if the new code is
  180.36 - * made subject to such option by the copyright holder.
  180.37 - *
  180.38 - * Contributor(s):
  180.39 - *
  180.40 - * Portions Copyrighted 2009-2010 Sun Microsystems, Inc.
  180.41 - */
  180.42 -
  180.43 -package org.netbeans.modules.jackpot30.backend.impl.ui;
  180.44 -
  180.45 -import java.util.Comparator;
  180.46 -import javax.ws.rs.core.Response;
  180.47 -import java.util.LinkedHashMap;
  180.48 -import java.util.Map.Entry;
  180.49 -import freemarker.cache.TemplateLoader;
  180.50 -import freemarker.template.Configuration;
  180.51 -import freemarker.template.Template;
  180.52 -import freemarker.template.TemplateException;
  180.53 -import java.io.IOException;
  180.54 -import java.io.InputStream;
  180.55 -import java.io.InputStreamReader;
  180.56 -import java.io.Reader;
  180.57 -import java.io.StringWriter;
  180.58 -import java.net.URI;
  180.59 -import java.net.URISyntaxException;
  180.60 -import java.util.ArrayList;
  180.61 -import java.util.Collections;
  180.62 -import java.util.HashMap;
  180.63 -import java.util.LinkedList;
  180.64 -import java.util.List;
  180.65 -import java.util.Map;
  180.66 -import javax.ws.rs.DefaultValue;
  180.67 -import javax.ws.rs.GET;
  180.68 -import javax.ws.rs.Path;
  180.69 -import javax.ws.rs.Produces;
  180.70 -import javax.ws.rs.QueryParam;
  180.71 -import org.codeviation.pojson.Pojson;
  180.72 -import org.netbeans.modules.jackpot30.impl.WebUtilities;
  180.73 -import static org.netbeans.modules.jackpot30.impl.WebUtilities.escapeForQuery;
  180.74 -
  180.75 -/**
  180.76 - *
  180.77 - * @author lahvac
  180.78 - */
  180.79 -@Path("/index/ui")
  180.80 -public class UI {
  180.81 -
  180.82 -    @GET
  180.83 -    @Path("/search")
  180.84 -    @Produces("text/html")
  180.85 -    public String search(@QueryParam("path") String path, @QueryParam("pattern") String pattern) throws URISyntaxException, IOException, TemplateException {
  180.86 -        Map<String, Object> configurationData = new HashMap<String, Object>();
  180.87 -
  180.88 -        configurationData.put("paths", list());
  180.89 -        configurationData.put("selectedPath", path);
  180.90 -        configurationData.put("pattern", pattern);
  180.91 -        configurationData.put("patternEscaped", escapeForQuery(pattern));
  180.92 -        configurationData.put("examples", loadExamples());
  180.93 -
  180.94 -        if (pattern != null && path != null) {
  180.95 -            URI u = new URI("http://localhost:9998/index/find?path=" + escapeForQuery(path) + "&pattern=" + escapeForQuery(pattern));
  180.96 -            List<Map<String, Object>> results = new LinkedList<Map<String, Object>>();
  180.97 -            long queryTime = System.currentTimeMillis();
  180.98 -            List<String> candidates = new ArrayList<String>(WebUtilities.requestStringArrayResponse(u));
  180.99 -
 180.100 -            queryTime = System.currentTimeMillis() - queryTime;
 180.101 -
 180.102 -            Collections.sort(candidates);
 180.103 -
 180.104 -            for (String c : candidates) {
 180.105 -                Map<String, Object> found = new HashMap<String, Object>(3);
 180.106 -
 180.107 -                found.put("relativePath", c);
 180.108 -
 180.109 -                results.add(found);
 180.110 -            }
 180.111 -
 180.112 -            configurationData.put("results", results);
 180.113 -
 180.114 -            Map<String, Object> statistics = new HashMap<String, Object>();
 180.115 -
 180.116 -            statistics.put("files", candidates.size());
 180.117 -            statistics.put("queryTime", queryTime);
 180.118 -
 180.119 -            configurationData.put("statistics", statistics);
 180.120 -        }
 180.121 -
 180.122 -        return processTemplate("ui-search.html", configurationData);
 180.123 -    }
 180.124 -
 180.125 -//    @GET
 180.126 -//    @Path("/searchCategorized")
 180.127 -//    @Produces("text/html")
 180.128 -//    public String searchCategorized(@QueryParam("path") String path, @QueryParam("pattern") String pattern) throws URISyntaxException, IOException, TemplateException {
 180.129 -//        Map<String, Object> configurationData = new HashMap<String, Object>();
 180.130 -//
 180.131 -//        configurationData.put("paths", list());
 180.132 -//        configurationData.put("selectedPath", path);
 180.133 -//        configurationData.put("pattern", pattern);
 180.134 -//        configurationData.put("patternEscaped", escapeForQuery(pattern));
 180.135 -//        configurationData.put("examples", loadExamples());
 180.136 -//
 180.137 -//        if (pattern != null && path != null) {
 180.138 -//            Result queryResult = new DoQuery().doQuery(path, pattern, new Cancel() {
 180.139 -//                                                           public boolean isCancelled() {
 180.140 -//                                                               return false;
 180.141 -//                                                           }
 180.142 -//                                                       });
 180.143 -//
 180.144 -//            configurationData.put("result", queryResult.result);
 180.145 -//        }
 180.146 -//
 180.147 -//        return processTemplate("ui-search-categorized.html", configurationData);
 180.148 -//    }
 180.149 -
 180.150 -    @GET
 180.151 -    @Path("/show")
 180.152 -    @Produces("text/html")
 180.153 -    public String show(@QueryParam("path") String path, @QueryParam("relative") String relativePath, @QueryParam("pattern") String pattern) throws URISyntaxException, IOException, TemplateException {
 180.154 -        Map<String, Object> configurationData = new HashMap<String, Object>();
 180.155 -        List<Map<String, String>> occurrences = new LinkedList<Map<String, String>>();
 180.156 -
 180.157 -        configurationData.put("occurrences", occurrences);
 180.158 -
 180.159 -        URI codeURL = new URI("http://localhost:9998/index/cat?path=" + escapeForQuery(path) + "&relative=" + escapeForQuery(relativePath));
 180.160 -        String code = WebUtilities.requestStringResponse(codeURL);
 180.161 -
 180.162 -        if (pattern != null) {
 180.163 -            URI spansURL = new URI("http://localhost:9998/index/findSpans?path=" + escapeForQuery(path) + "&relativePath=" + escapeForQuery(relativePath) + "&pattern=" + escapeForQuery(pattern));
 180.164 -            int currentCodePos = 0;
 180.165 -            for (int[] span : parseSpans(WebUtilities.requestStringResponse(spansURL))) { //XXX: sorted!
 180.166 -                Map<String, String> occ = new HashMap<String, String>();
 180.167 -                occ.put("prefix", WebUtilities.escapeForHTMLElement(code.substring(currentCodePos, span[0])));
 180.168 -                occ.put("occurrence", WebUtilities.escapeForHTMLElement(code.substring(span[0], span[1])));
 180.169 -                occurrences.add(occ);
 180.170 -                currentCodePos = span[1];
 180.171 -            }
 180.172 -
 180.173 -            configurationData.put("suffix", WebUtilities.escapeForHTMLElement(code.substring(currentCodePos, code.length())));
 180.174 -        } else {
 180.175 -            configurationData.put("suffix", WebUtilities.escapeForHTMLElement(code));
 180.176 -        }
 180.177 -
 180.178 -        return processTemplate("ui-cat.html", configurationData);
 180.179 -    }
 180.180 -    
 180.181 -    @GET
 180.182 -    @Path("/snippet")
 180.183 -    @Produces("text/html")
 180.184 -    public String snippet(@QueryParam("path") String path, @QueryParam("relative") String relativePath, @QueryParam("pattern") String pattern) throws URISyntaxException, IOException, TemplateException {
 180.185 -        List<Map<String, String>> snippets = new LinkedList<Map<String, String>>();
 180.186 -
 180.187 -        URI codeURL = new URI("http://localhost:9998/index/cat?path=" + escapeForQuery(path) + "&relative=" + escapeForQuery(relativePath));
 180.188 -        String code = WebUtilities.requestStringResponse(codeURL);
 180.189 -        URI spansURL = new URI("http://localhost:9998/index/findSpans?path=" + escapeForQuery(path) + "&relativePath=" + escapeForQuery(relativePath) + "&pattern=" + escapeForQuery(pattern));
 180.190 -
 180.191 -        for (int[] span : parseSpans(WebUtilities.requestStringResponse(spansURL))) {
 180.192 -            snippets.add(prepareSnippet(code, span));
 180.193 -        }
 180.194 -
 180.195 -        return processTemplate("ui-snippet.html", Collections.<String, Object>singletonMap("snippets", snippets));
 180.196 -    }
 180.197 -
 180.198 -    @GET
 180.199 -    @Path("/apply")
 180.200 -    @Produces("text/html")
 180.201 -    public Response apply(@QueryParam("path") String path, @QueryParam("pattern") String pattern, @QueryParam("preview") @DefaultValue("") String preview, @QueryParam("download") @DefaultValue("") String download) throws URISyntaxException, IOException, TemplateException {
 180.202 -        if (!download.isEmpty()) {
 180.203 -            if (pattern != null && path != null) {
 180.204 -                URI u = new URI("http://localhost:9998/index/apply?path=" + escapeForQuery(path) + "&pattern=" + escapeForQuery(pattern));
 180.205 -
 180.206 -                return Response.temporaryRedirect(u).header("meta", "Content-Disposition: download; filename=\"patch.diff\"").build();
 180.207 -            }
 180.208 -        }
 180.209 -
 180.210 -        Map<String, Object> configurationData = new HashMap<String, Object>();
 180.211 -
 180.212 -        configurationData.put("paths", list());
 180.213 -        configurationData.put("selectedPath", path);
 180.214 -        configurationData.put("pattern", pattern);
 180.215 -        configurationData.put("patternEscaped", escapeForQuery(pattern));
 180.216 -        configurationData.put("examples", loadExamples());
 180.217 -
 180.218 -        if (pattern != null && path != null) {
 180.219 -            URI u = new URI("http://localhost:9998/index/apply?path=" + escapeForQuery(path) + "&pattern=" + escapeForQuery(pattern));
 180.220 -            long queryTime = System.currentTimeMillis();
 180.221 -            String diff = WebUtilities.requestStringResponse(u);
 180.222 -
 180.223 -            queryTime = System.currentTimeMillis() - queryTime;
 180.224 -
 180.225 -            configurationData.put("diff", diff);
 180.226 -
 180.227 -            StringBuilder sb = new StringBuilder();
 180.228 -
 180.229 -            for (String l : diff.split("\n")) {
 180.230 -                sb.append("<span");
 180.231 -
 180.232 -                for (Entry<String, String> e : prefix2SpanName.entrySet()) {
 180.233 -                    if (l.startsWith(e.getKey())) {
 180.234 -                        sb.append(" class='" + e.getValue() + "'");
 180.235 -                        break;
 180.236 -                    }
 180.237 -                }
 180.238 -
 180.239 -                sb.append(">");
 180.240 -                sb.append(l);
 180.241 -                sb.append("</span>\n");
 180.242 -            }
 180.243 -
 180.244 -            configurationData.put("result", sb.toString());
 180.245 -        }
 180.246 -
 180.247 -        return Response.ok(processTemplate("ui-apply.html", configurationData), "text/html").build();
 180.248 -    }
 180.249 -
 180.250 -    @GET
 180.251 -    @Path("/searchType")
 180.252 -    @Produces("text/html")
 180.253 -    public String searchType(@QueryParam("path") String path, @QueryParam("prefix") String prefix) throws URISyntaxException, IOException, TemplateException {
 180.254 -        Map<String, Object> configurationData = new HashMap<String, Object>();
 180.255 -
 180.256 -        configurationData.put("paths", list());
 180.257 -        configurationData.put("selectedPath", path);
 180.258 -        configurationData.put("prefix", prefix);
 180.259 -
 180.260 -        if (prefix != null && path != null) {
 180.261 -            URI u = new URI("http://localhost:9998/index/findType?path=" + escapeForQuery(path) + "&prefix=" + escapeForQuery(prefix));
 180.262 -            long queryTime = System.currentTimeMillis();
 180.263 -            @SuppressWarnings("unchecked") //XXX: should not trust something got from the network!
 180.264 -            Map<String, List<String>> types = Pojson.load(LinkedHashMap.class, u);
 180.265 -            List<Map<String, Object>> results = new LinkedList<Map<String, Object>>();
 180.266 -
 180.267 -            queryTime = System.currentTimeMillis() - queryTime;
 180.268 -
 180.269 -            for (Entry<String, List<String>> e : types.entrySet()) {
 180.270 -                for (String fqn : e.getValue()) {
 180.271 -                    Map<String, Object> found = new HashMap<String, Object>(3);
 180.272 -
 180.273 -                    found.put("fqn", fqn);
 180.274 -
 180.275 -                    if (fqn.contains("$")) {
 180.276 -                        fqn = fqn.substring(0, fqn.indexOf("$"));
 180.277 -                    }
 180.278 -
 180.279 -                    found.put("relativePath", e.getKey() + "/" + fqn.replace('.', '/') + ".java");
 180.280 -
 180.281 -                    results.add(found);
 180.282 -                }
 180.283 -            }
 180.284 -
 180.285 -            Collections.sort(results, new Comparator<Map<String, Object>>() {
 180.286 -                @Override public int compare(Map<String, Object> o1, Map<String, Object> o2) {
 180.287 -                    return ((String) o1.get("fqn")).compareTo((String) o2.get("fqn"));
 180.288 -                }
 180.289 -            });
 180.290 -            
 180.291 -            configurationData.put("results", results);
 180.292 -
 180.293 -            Map<String, Object> statistics = new HashMap<String, Object>();
 180.294 -
 180.295 -            statistics.put("queryTime", queryTime);
 180.296 -
 180.297 -            configurationData.put("statistics", statistics);
 180.298 -        }
 180.299 -
 180.300 -        return processTemplate("ui-findType.html", configurationData);
 180.301 -    }
 180.302 -
 180.303 -    private static final Map<String, String> prefix2SpanName = new LinkedHashMap<String, String>();
 180.304 -
 180.305 -    static {
 180.306 -        prefix2SpanName.put("-", "diff-removed");
 180.307 -        prefix2SpanName.put("+", "diff-added");
 180.308 -        prefix2SpanName.put("@@", "diff-hunk");
 180.309 -        prefix2SpanName.put("Index:", "diff-index");
 180.310 -    }
 180.311 -
 180.312 -    private static List<Map<String, String>> list() throws URISyntaxException {
 180.313 -        List<Map<String, String>> result = new LinkedList<Map<String, String>>();
 180.314 -
 180.315 -        for (String enc : WebUtilities.requestStringArrayResponse(new URI("http://localhost:9998/index/list"))) {
 180.316 -            Map<String, String> rootDesc = new HashMap<String, String>();
 180.317 -            String[] col = enc.split(":", 2);
 180.318 -
 180.319 -            rootDesc.put("segment", col[0]);
 180.320 -            rootDesc.put("displayName", col[1]);
 180.321 -            result.add(rootDesc);
 180.322 -        }
 180.323 -
 180.324 -        return result;
 180.325 -    }
 180.326 -    
 180.327 -    private static Iterable<int[]> parseSpans(String from) {
 180.328 -        if (from.isEmpty()) {
 180.329 -            return Collections.emptyList();
 180.330 -        }
 180.331 -        String[] split = from.split(":");
 180.332 -        List<int[]> result = new LinkedList<int[]>();
 180.333 -
 180.334 -        for (int i = 0; i < split.length; i += 2) {
 180.335 -            result.add(new int[] {
 180.336 -                Integer.parseInt(split[i + 0].trim()),
 180.337 -                Integer.parseInt(split[i + 1].trim())
 180.338 -            });
 180.339 -        }
 180.340 -
 180.341 -        return result;
 180.342 -    }
 180.343 -
 180.344 -    private static final int DESIRED_CONTEXT = 2;
 180.345 -
 180.346 -    private static Map<String, String> prepareSnippet(String code, int[] span) {
 180.347 -        int grandStart = span[0];
 180.348 -        int firstLineStart = grandStart = lineStart(code, grandStart);
 180.349 -
 180.350 -        while (grandStart > 0 && contextLength(code.substring(grandStart, firstLineStart)) < DESIRED_CONTEXT)
 180.351 -            grandStart = lineStart(code, grandStart - 1);
 180.352 -
 180.353 -        int grandEnd = span[1];
 180.354 -        int firstLineEnd = grandEnd = lineEnd(code, grandEnd);
 180.355 -        
 180.356 -        while (grandEnd < code.length() - 1 && contextLength(code.substring(firstLineEnd, grandEnd)) < DESIRED_CONTEXT)
 180.357 -            grandEnd = lineEnd(code, grandEnd + 1);
 180.358 -
 180.359 -        Map<String, String> result = new HashMap<String, String>();
 180.360 -        
 180.361 -        result.put("prefix", WebUtilities.escapeForHTMLElement(code.substring(grandStart, span[0])));
 180.362 -        result.put("occurrence", WebUtilities.escapeForHTMLElement(code.substring(span[0], span[1])));
 180.363 -        result.put("suffix", WebUtilities.escapeForHTMLElement(code.substring(span[1], grandEnd)));
 180.364 -
 180.365 -        return result;
 180.366 -    }
 180.367 -
 180.368 -    private static int lineStart(String code, int o) {
 180.369 -        while (o > 0 && code.charAt(o) != '\n') {
 180.370 -            o--;
 180.371 -        }
 180.372 -
 180.373 -        return o;
 180.374 -    }
 180.375 -
 180.376 -    private static int lineEnd(String code, int o) {
 180.377 -        while (o < code.length() - 1 && code.charAt(o) != '\n') {
 180.378 -            o++;
 180.379 -        }
 180.380 -
 180.381 -        return o;
 180.382 -    }
 180.383 -
 180.384 -    private static int contextLength(String in) {
 180.385 -        return in.replaceAll("\n[ \t]*\n", "\n").trim().split("\n").length;
 180.386 -    }
 180.387 -
 180.388 -    @SuppressWarnings("unchecked")
 180.389 -    private List<Map<String, String>> loadExamples() throws IOException, URISyntaxException {
 180.390 -        return Pojson.load(LinkedList.class, new URI("http://localhost:9998/index/examples"));
 180.391 -    }
 180.392 -
 180.393 -    private static String processTemplate(String template, Map<String, Object> configurationData) throws TemplateException, IOException {
 180.394 -        Configuration conf = new Configuration();
 180.395 -
 180.396 -        conf.setTemplateLoader(new TemplateLoaderImpl());
 180.397 -
 180.398 -        Template templ = conf.getTemplate(template);
 180.399 -        StringWriter out = new StringWriter();
 180.400 -
 180.401 -        templ.process(configurationData, out);
 180.402 -
 180.403 -        return out.toString();
 180.404 -    }
 180.405 -
 180.406 -    private static final class TemplateLoaderImpl implements TemplateLoader {
 180.407 -
 180.408 -        public Object findTemplateSource(String name) throws IOException {
 180.409 -            return TemplateLoaderImpl.class.getResourceAsStream(name);
 180.410 -        }
 180.411 -
 180.412 -        public long getLastModified(Object templateSource) {
 180.413 -            return 0L;
 180.414 -        }
 180.415 -
 180.416 -        public Reader getReader(Object templateSource, String encoding) throws IOException {
 180.417 -            InputStream in = (InputStream) templateSource;
 180.418 -
 180.419 -            return new InputStreamReader(in);
 180.420 -        }
 180.421 -
 180.422 -        public void closeTemplateSource(Object templateSource) throws IOException {
 180.423 -        }
 180.424 -    }
 180.425 -
 180.426 -}
   181.1 --- a/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/ui/ui-apply.html	Wed Jun 22 12:05:27 2011 +0200
   181.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   181.3 @@ -1,68 +0,0 @@
   181.4 -<html>
   181.5 -<head>
   181.6 -    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
   181.7 -<#if results??>
   181.8 -    <script type="text/javascript">
   181.9 -        $(document).ready(function() {
  181.10 -            $('#list').find('dd').hide().end().find('dt').click(function() {
  181.11 -                current_dd=$(this).next();
  181.12 -                //XXX: will do the AJAX call for both show and hide!
  181.13 -                $.get("snippet?path=${selectedPath}&relative=" + current_dd.attr("id") + "&pattern=${patternEscaped}",function(data) {
  181.14 -                    current_dd.html(data).slideToggle();
  181.15 -                })
  181.16 -            });
  181.17 -        });
  181.18 -    </script>
  181.19 -</#if>
  181.20 -    <style type="text/css">
  181.21 -        .occurrence {background: #DDDD00;}
  181.22 -        .diff-removed {color: #FF0000;}
  181.23 -        .diff-added {color: #00FF00;}
  181.24 -        .diff-index {color: #0000FF;}
  181.25 -        .diff-hunk {color: #FF00FF;}
  181.26 -    </style>
  181.27 -</head>
  181.28 -<body>
  181.29 -<form method="get">
  181.30 -
  181.31 -<label for="path">Project:</label>
  181.32 -<select size="1" name="path">");
  181.33 -    <#list paths as path>
  181.34 -        <option <#if selectedPath?? && path.segment == selectedPath>selected</#if> value="${path.segment}">
  181.35 -            ${path.displayName}
  181.36 -        </option>
  181.37 -    </#list>
  181.38 -</select>
  181.39 -<br>
  181.40 -<label for="pattern">Pattern:</label><br>
  181.41 -<textarea rows="10" cols="40" name="pattern">
  181.42 -<#if pattern??>
  181.43 -${pattern}
  181.44 -</#if>
  181.45 -</textarea><br>
  181.46 -<input type="submit" name="preview" value="Show diff preview"/><input type="submit" name="download" value="Download diff"/>
  181.47 -</form>
  181.48 -
  181.49 -<div class="examples">
  181.50 -<#if examples??>
  181.51 -    Examples:
  181.52 -    <dl id="examples-list">
  181.53 -        <#list examples as example>
  181.54 -            <dt>${example.displayName}</dt>
  181.55 -            <dd><pre>${example.pattern}</pre>
  181.56 -            </dd>
  181.57 -        </#list>
  181.58 -    </dl>
  181.59 -</#if>
  181.60 -</div>
  181.61 -
  181.62 -<#if result??>
  181.63 -    Diff for rule: ${pattern}
  181.64 -<pre>${result}</pre>
  181.65 -</#if>
  181.66 -
  181.67 -<#if statistics??>
  181.68 -     Query time: ${statistics.queryTime}ms, matching files: ${statistics.files}.
  181.69 -</#if>
  181.70 -</body>
  181.71 -</html>
   182.1 --- a/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/ui/ui-cat.html	Wed Jun 22 12:05:27 2011 +0200
   182.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   182.3 @@ -1,10 +0,0 @@
   182.4 -<html>
   182.5 -<head>
   182.6 -    <style type="text/css">
   182.7 -        .occurrence {BACKGROUND: #DDDD00;}
   182.8 -    </style>
   182.9 -</head>
  182.10 -<body>
  182.11 -<pre><#list occurrences as occurrence>${occurrence.prefix}<span class="occurrence">${occurrence.occurrence}</span></#list>${suffix}</pre>
  182.12 -</body>
  182.13 -</html>
   183.1 --- a/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/ui/ui-findType.html	Wed Jun 22 12:05:27 2011 +0200
   183.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   183.3 @@ -1,28 +0,0 @@
   183.4 -<html>
   183.5 -<head>
   183.6 -    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
   183.7 -</head>
   183.8 -<body>
   183.9 -<form method="get">
  183.10 -<label for="path">Project:</label>
  183.11 -<select size="1" name="path">");
  183.12 -    <#list paths as path>
  183.13 -        <option <#if selectedPath?? && path.segment == selectedPath>selected</#if> value="${path.segment}">
  183.14 -            ${path.displayName}
  183.15 -        </option>
  183.16 -    </#list>
  183.17 -</select>
  183.18 -<br>
  183.19 -<label for="prefix">Type Name:</label><input type="text" name="prefix"<#if prefix??>value="${prefix}"</#if>/><br>
  183.20 -<input type="submit" name="Find Candidates"/>
  183.21 -</form>
  183.22 -
  183.23 -<#if results??>
  183.24 -    Found types:<br>
  183.25 -    <#list results as result>
  183.26 -        <a href="/index/ui/show?path=${selectedPath}&relative=${result.relativePath}">${result.fqn}</a><br>
  183.27 -    </#list>
  183.28 -</#if>
  183.29 -
  183.30 -</body>
  183.31 -</html>
   184.1 --- a/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/ui/ui-search.html	Wed Jun 22 12:05:27 2011 +0200
   184.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   184.3 @@ -1,70 +0,0 @@
   184.4 -<html>
   184.5 -<head>
   184.6 -    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
   184.7 -<#if results??>
   184.8 -    <script type="text/javascript">
   184.9 -        $(document).ready(function() {
  184.10 -            $('#list').find('dd').hide().end().find('dt').click(function() {
  184.11 -                current_dd=$(this).next();
  184.12 -                //XXX: will do the AJAX call for both show and hide!
  184.13 -                $.get("snippet?path=${selectedPath}&relative=" + current_dd.attr("id") + "&pattern=${patternEscaped}",function(data) {
  184.14 -                    current_dd.html(data).slideToggle();
  184.15 -                })
  184.16 -            });
  184.17 -        });
  184.18 -    </script>
  184.19 -</#if>
  184.20 -    <style type="text/css">
  184.21 -        .occurrence {BACKGROUND: #DDDD00;}
  184.22 -    </style>
  184.23 -</head>
  184.24 -<body>
  184.25 -<form method="get">
  184.26 -
  184.27 -<label for="path">Project:</label>
  184.28 -<select size="1" name="path">");
  184.29 -    <#list paths as path>
  184.30 -        <option <#if selectedPath?? && path.segment == selectedPath>selected</#if> value="${path.segment}">
  184.31 -            ${path.displayName}
  184.32 -        </option>
  184.33 -    </#list>
  184.34 -</select>
  184.35 -<br>
  184.36 -<label for="pattern">Pattern:</label><br>
  184.37 -<textarea rows="10" cols="40" name="pattern">
  184.38 -<#if pattern??>
  184.39 -${pattern}
  184.40 -</#if>
  184.41 -</textarea><br>
  184.42 -<input type="submit" name="Find Candidates"/>
  184.43 -</form>
  184.44 -
  184.45 -<div class="examples">
  184.46 -<#if examples??>
  184.47 -    Examples:
  184.48 -    <dl id="examples-list">
  184.49 -        <#list examples as example>
  184.50 -            <dt>${example.displayName}</dt>
  184.51 -            <dd><pre>${example.pattern}</pre>
  184.52 -            </dd>
  184.53 -        </#list>
  184.54 -    </dl>
  184.55 -</#if>
  184.56 -</div>
  184.57 -
  184.58 -<#if results??>
  184.59 -    Found candidates for pattern: ${pattern}
  184.60 -    <dl id="list">
  184.61 -        <#list results as result>
  184.62 -            <dt>${result.relativePath}<a href="/index/ui/show?path=${selectedPath}&relative=${result.relativePath}&pattern=${patternEscaped}">show</a></dt>
  184.63 -            <dd id="${result.relativePath}">
  184.64 -            </dd>
  184.65 -        </#list>
  184.66 -    </dl>
  184.67 -</#if>
  184.68 -
  184.69 -<#if statistics??>
  184.70 -     Query time: ${statistics.queryTime}ms, matching files: ${statistics.files}.
  184.71 -</#if>
  184.72 -</body>
  184.73 -</html>
   185.1 --- a/server/backend/impl/src/org/netbeans/modules/jackpot30/backend/impl/ui/ui-snippet.html	Wed Jun 22 12:05:27 2011 +0200
   185.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   185.3 @@ -1,7 +0,0 @@
   185.4 -<#if snippets??>
   185.5 -    <#list snippets as snippet>
   185.6 -        <pre>${snippet.prefix}<span class="occurrence">${snippet.occurrence}</span>${snippet.suffix}</pre><br>
   185.7 -    </#list>
   185.8 -<#else>
   185.9 -    No occurrences.
  185.10 -</#if>
   186.1 --- a/server/backend/nbproject/build-impl.xml	Wed Jun 22 12:05:27 2011 +0200
   186.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   186.3 @@ -1,49 +0,0 @@
   186.4 -<?xml version="1.0" encoding="UTF-8"?>
   186.5 -<!--
   186.6 -*** GENERATED FROM project.xml - DO NOT EDIT  ***
   186.7 -***         EDIT ../build.xml INSTEAD         ***
   186.8 --->
   186.9 -<project name="backend-impl" basedir=".." xmlns:sproject="http://www.netbeans.org/ns/nb-module-suite-project/1">
  186.10 -    <fail message="Please build using Ant 1.7.1 or higher.">
  186.11 -        <condition>
  186.12 -            <not>
  186.13 -                <antversion atleast="1.7.1"/>
  186.14 -            </not>
  186.15 -        </condition>
  186.16 -    </fail>
  186.17 -    <property file="nbproject/private/platform-private.properties"/>
  186.18 -    <property file="nbproject/platform.properties"/>
  186.19 -    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-suite-project/1">
  186.20 -        <attribute name="name"/>
  186.21 -        <attribute name="value"/>
  186.22 -        <sequential>
  186.23 -            <property name="@{name}" value="${@{value}}"/>
  186.24 -        </sequential>
  186.25 -    </macrodef>
  186.26 -    <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-suite-project/1">
  186.27 -        <attribute name="property"/>
  186.28 -        <attribute name="value"/>
  186.29 -        <sequential>
  186.30 -            <property name="@{property}" value="@{value}"/>
  186.31 -        </sequential>
  186.32 -    </macrodef>
  186.33 -    <property file="${user.properties.file}"/>
  186.34 -    <sproject:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir"/>
  186.35 -    <sproject:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir"/>
  186.36 -    <sproject:evalprops property="cluster.path.evaluated" value="${cluster.path}"/>
  186.37 -    <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
  186.38 -        <condition>
  186.39 -            <not>
  186.40 -                <contains string="${cluster.path.evaluated}" substring="platform"/>
  186.41 -            </not>
  186.42 -        </condition>
  186.43 -    </fail>
  186.44 -    <fail message="Cannot find NetBeans build harness. ${line.separator}Check that nbplatform.${nbplatform.active}.netbeans.dest.dir and nbplatform.${nbplatform.active}.harness.dir are defined. ${line.separator}On a developer machine these are normally defined in ${user.properties.file}=${netbeans.user}/build.properties ${line.separator}but for automated builds you should pass these properties to Ant explicitly.">
  186.45 -        <condition>
  186.46 -            <not>
  186.47 -                <available type="dir" file="${harness.dir}"/>
  186.48 -            </not>
  186.49 -        </condition>
  186.50 -    </fail>
  186.51 -    <import file="${harness.dir}/suite.xml"/>
  186.52 -</project>
   187.1 --- a/server/backend/nbproject/genfiles.properties	Wed Jun 22 12:05:27 2011 +0200
   187.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   187.3 @@ -1,8 +0,0 @@
   187.4 -build.xml.data.CRC32=2aaf9598
   187.5 -build.xml.script.CRC32=616acaee
   187.6 -build.xml.stylesheet.CRC32=eaf9f76a@1.44
   187.7 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
   187.8 -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
   187.9 -nbproject/build-impl.xml.data.CRC32=2aaf9598
  187.10 -nbproject/build-impl.xml.script.CRC32=e8ecb000
  187.11 -nbproject/build-impl.xml.stylesheet.CRC32=183e6ef3@1.44
   188.1 --- a/server/backend/nbproject/platform.properties	Wed Jun 22 12:05:27 2011 +0200
   188.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   188.3 @@ -1,12 +0,0 @@
   188.4 -cluster.path=\
   188.5 -    ${nbplatform.active.dir}/apisupport:\
   188.6 -    ${nbplatform.active.dir}/enterprise:\
   188.7 -    ${nbplatform.active.dir}/harness:\
   188.8 -    ${nbplatform.active.dir}/ide:\
   188.9 -    ${nbplatform.active.dir}/java:\
  188.10 -    ${nbplatform.active.dir}/platform:\
  188.11 -    ${nbplatform.active.dir}/profiler:\
  188.12 -    ${nbplatform.active.dir}/websvccommon:\
  188.13 -    ../../build/cluster
  188.14 -disabled.modules=
  188.15 -nbplatform.active=default
   189.1 --- a/server/backend/nbproject/project.properties	Wed Jun 22 12:05:27 2011 +0200
   189.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   189.3 @@ -1,9 +0,0 @@
   189.4 -app.name=backend
   189.5 -app.title=Jackpot 3.0 Backend
   189.6 -branding.token=${app.name}
   189.7 -modules=\
   189.8 -    ${project.org.netbeans.modules.jackpot30.backend.impl}
   189.9 -project.org.netbeans.modules.jackpot30.backend.impl=impl
  189.10 -#should used -nogui, but many parts (i.e. projects) use invokeWhenUIReady which is not invoked currently when -nogui is used:
  189.11 -run.args=--nosplash --start-server -J-Xdebug -J-Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=8889
  189.12 -project.license=cddl-netbeans-sun
   190.1 --- a/server/backend/nbproject/project.xml	Wed Jun 22 12:05:27 2011 +0200
   190.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   190.3 @@ -1,9 +0,0 @@
   190.4 -<?xml version="1.0" encoding="UTF-8"?>
   190.5 -<project xmlns="http://www.netbeans.org/ns/project/1">
   190.6 -    <type>org.netbeans.modules.apisupport.project.suite</type>
   190.7 -    <configuration>
   190.8 -        <data xmlns="http://www.netbeans.org/ns/nb-module-suite-project/1">
   190.9 -            <name>backend</name>
  190.10 -        </data>
  190.11 -    </configuration>
  190.12 -</project>
   191.1 --- a/server/backend/scripts/index.sh	Wed Jun 22 12:05:27 2011 +0200
   191.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   191.3 @@ -1,14 +0,0 @@
   191.4 -DIR=`dirname $0`
   191.5 -USERDIR=`tempfile`;
   191.6 -rm $USERDIR
   191.7 -mkdir -p $USERDIR
   191.8 -trap "rm -rf -- '$USERDIR'" EXIT
   191.9 -
  191.10 -ID="$1"; shift
  191.11 -NAME="$1"; shift
  191.12 -TARGET="$1"; shift
  191.13 -ROOT_DIR="$1"; shift
  191.14 -
  191.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 "$@"
  191.16 -
  191.17 -exit
   192.1 --- a/server/backend/scripts/web.sh	Wed Jun 22 12:05:27 2011 +0200
   192.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   192.3 @@ -1,2 +0,0 @@
   192.4 -DIR=`dirname $0`
   192.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 "$@"
   193.1 --- a/server/backend/type.web.api/build.xml	Wed Jun 22 12:05:27 2011 +0200
   193.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   193.3 @@ -1,74 +0,0 @@
   193.4 -<?xml version="1.0" encoding="UTF-8"?>
   193.5 -<!-- You may freely edit this file. See commented blocks below for -->
   193.6 -<!-- some examples of how to customize the build. -->
   193.7 -<!-- (If you delete it and reopen the project it will be recreated.) -->
   193.8 -<!-- By default, only the Clean and Build commands use this build script. -->
   193.9 -<!-- Commands such as Run, Debug, and Test only use this build script if -->
  193.10 -<!-- the Compile on Save feature is turned off for the project. -->
  193.11 -<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
  193.12 -<!-- in the project's Project Properties dialog box.-->
  193.13 -<project name="type.web.api" default="default" basedir=".">
  193.14 -    <description>Builds, tests, and runs the project type.web.api.</description>
  193.15 -    <import file="nbproject/build-impl.xml"/>
  193.16 -    <!--
  193.17 -
  193.18 -    There exist several targets which are by default empty and which can be 
  193.19 -    used for execution of your tasks. These targets are usually executed 
  193.20 -    before and after some main targets. They are: 
  193.21 -
  193.22 -      -pre-init:                 called before initialization of project properties
  193.23 -      -post-init:                called after initialization of project properties
  193.24 -      -pre-compile:              called before javac compilation
  193.25 -      -post-compile:             called after javac compilation
  193.26 -      -pre-compile-single:       called before javac compilation of single file
  193.27 -      -post-compile-single:      called after javac compilation of single file
  193.28 -      -pre-compile-test:         called before javac compilation of JUnit tests
  193.29 -      -post-compile-test:        called after javac compilation of JUnit tests
  193.30 -      -pre-compile-test-single:  called before javac compilation of single JUnit test
  193.31 -      -post-compile-test-single: called after javac compilation of single JUunit test
  193.32 -      -pre-jar:                  called before JAR building
  193.33 -      -post-jar:                 called after JAR building
  193.34 -      -post-clean:               called after cleaning build products
  193.35 -
  193.36 -    (Targets beginning with '-' are not intended to be called on their own.)
  193.37 -
  193.38 -    Example of inserting an obfuscator after compilation could look like this:
  193.39 -
  193.40 -        <target name="-post-compile">
  193.41 -            <obfuscate>
  193.42 -                <fileset dir="${build.classes.dir}"/>
  193.43 -            </obfuscate>
  193.44 -        </target>
  193.45 -
  193.46 -    For list of available properties check the imported 
  193.47 -    nbproject/build-impl.xml file. 
  193.48 -
  193.49 -
  193.50 -    Another way to customize the build is by overriding existing main targets.
  193.51 -    The targets of interest are: 
  193.52 -
  193.53 -      -init-macrodef-javac:     defines macro for javac compilation
  193.54 -      -init-macrodef-junit:     defines macro for junit execution
  193.55 -      -init-macrodef-debug:     defines macro for class debugging
  193.56 -      -init-macrodef-java:      defines macro for class execution
  193.57 -      -do-jar-with-manifest:    JAR building (if you are using a manifest)
  193.58 -      -do-jar-without-manifest: JAR building (if you are not using a manifest)
  193.59 -      run:                      execution of project 
  193.60 -      -javadoc-build:           Javadoc generation
  193.61 -      test-report:              JUnit report generation
  193.62 -
  193.63 -    An example of overriding the target for project execution could look like this:
  193.64 -
  193.65 -        <target name="run" depends="type.web.api-impl.jar">
  193.66 -            <exec dir="bin" executable="launcher.exe">
  193.67 -                <arg file="${dist.jar}"/>
  193.68 -            </exec>
  193.69 -        </target>
  193.70 -
  193.71 -    Notice that the overridden target depends on the jar target and not only on 
  193.72 -    the compile target as the regular run target does. Again, for a list of available 
  193.73 -    properties which you can use, check the target you are overriding in the
  193.74 -    nbproject/build-impl.xml file. 
  193.75 -
  193.76 -    -->
  193.77 -</project>
   194.1 --- a/server/backend/type.web.api/manifest.mf	Wed Jun 22 12:05:27 2011 +0200
   194.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   194.3 @@ -1,3 +0,0 @@
   194.4 -Manifest-Version: 1.0
   194.5 -X-COMMENT: Main-Class will be added automatically by build
   194.6 -
   195.1 --- a/server/backend/type.web.api/nbproject/build-impl.xml	Wed Jun 22 12:05:27 2011 +0200
   195.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   195.3 @@ -1,1082 +0,0 @@
   195.4 -<?xml version="1.0" encoding="UTF-8"?>
   195.5 -<!--
   195.6 -*** GENERATED FROM project.xml - DO NOT EDIT  ***
   195.7 -***         EDIT ../build.xml INSTEAD         ***
   195.8 -
   195.9 -For the purpose of easier reading the script
  195.10 -is divided into following sections:
  195.11 -
  195.12 -  - initialization
  195.13 -  - compilation
  195.14 -  - jar
  195.15 -  - execution
  195.16 -  - debugging
  195.17 -  - javadoc
  195.18 -  - junit compilation
  195.19 -  - junit execution
  195.20 -  - junit debugging
  195.21 -  - applet
  195.22 -  - cleanup
  195.23 -
  195.24 -        -->
  195.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">
  195.26 -    <fail message="Please build using Ant 1.8.0 or higher.">
  195.27 -        <condition>
  195.28 -            <not>
  195.29 -                <antversion atleast="1.8.0"/>
  195.30 -            </not>
  195.31 -        </condition>
  195.32 -    </fail>
  195.33 -    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
  195.34 -    <!-- 
  195.35 -                ======================
  195.36 -                INITIALIZATION SECTION 
  195.37 -                ======================
  195.38 -            -->
  195.39 -    <target name="-pre-init">
  195.40 -        <!-- Empty placeholder for easier customization. -->
  195.41 -        <!-- You can override this target in the ../build.xml file. -->
  195.42 -    </target>
  195.43 -    <target depends="-pre-init" name="-init-private">
  195.44 -        <property file="nbproject/private/config.properties"/>
  195.45 -        <property file="nbproject/private/configs/${config}.properties"/>
  195.46 -        <property file="nbproject/private/private.properties"/>
  195.47 -    </target>
  195.48 -    <target name="-pre-init-libraries">
  195.49 -        <property location="../../lib/nblibraries.properties" name="libraries.path"/>
  195.50 -        <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
  195.51 -        <pathconvert dirsep="/" property="libraries.dir">
  195.52 -            <path path="${libraries.dir.nativedirsep}"/>
  195.53 -        </pathconvert>
  195.54 -        <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
  195.55 -        <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
  195.56 -    </target>
  195.57 -    <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
  195.58 -        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
  195.59 -            <filterchain>
  195.60 -                <replacestring from="$${base}" to="${libraries.dir}"/>
  195.61 -                <escapeunicode/>
  195.62 -            </filterchain>
  195.63 -        </loadproperties>
  195.64 -    </target>
  195.65 -    <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
  195.66 -        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
  195.67 -            <filterchain>
  195.68 -                <replacestring from="$${base}" to="${libraries.dir}"/>
  195.69 -                <escapeunicode/>
  195.70 -            </filterchain>
  195.71 -        </loadproperties>
  195.72 -    </target>
  195.73 -    <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
  195.74 -        <property file="${user.properties.file}"/>
  195.75 -        <!-- The two properties below are usually overridden -->
  195.76 -        <!-- by the active platform. Just a fallback. -->
  195.77 -        <property name="default.javac.source" value="1.4"/>
  195.78 -        <property name="default.javac.target" value="1.4"/>
  195.79 -    </target>
  195.80 -    <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
  195.81 -        <property file="nbproject/configs/${config}.properties"/>
  195.82 -        <property file="nbproject/project.properties"/>
  195.83 -    </target>
  195.84 -    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
  195.85 -        <available file="${manifest.file}" property="manifest.available"/>
  195.86 -        <condition property="splashscreen.available">
  195.87 -            <and>
  195.88 -                <not>
  195.89 -                    <equals arg1="${application.splash}" arg2="" trim="true"/>
  195.90 -                </not>
  195.91 -                <available file="${application.splash}"/>
  195.92 -            </and>
  195.93 -        </condition>
  195.94 -        <condition property="main.class.available">
  195.95 -            <and>
  195.96 -                <isset property="main.class"/>
  195.97 -                <not>
  195.98 -                    <equals arg1="${main.class}" arg2="" trim="true"/>
  195.99 -                </not>
 195.100 -            </and>
 195.101 -        </condition>
 195.102 -        <condition property="manifest.available+main.class">
 195.103 -            <and>
 195.104 -                <isset property="manifest.available"/>
 195.105 -                <isset property="main.class.available"/>
 195.106 -            </and>
 195.107 -        </condition>
 195.108 -        <condition property="do.archive">
 195.109 -            <not>
 195.110 -                <istrue value="${jar.archive.disabled}"/>
 195.111 -            </not>
 195.112 -        </condition>
 195.113 -        <condition property="do.mkdist">
 195.114 -            <and>
 195.115 -                <isset property="do.archive"/>
 195.116 -                <isset property="libs.CopyLibs.classpath"/>
 195.117 -                <not>
 195.118 -                    <istrue value="${mkdist.disabled}"/>
 195.119 -                </not>
 195.120 -            </and>
 195.121 -        </condition>
 195.122 -        <condition property="manifest.available+main.class+mkdist.available">
 195.123 -            <and>
 195.124 -                <istrue value="${manifest.available+main.class}"/>
 195.125 -                <isset property="do.mkdist"/>
 195.126 -            </and>
 195.127 -        </condition>
 195.128 -        <condition property="do.archive+manifest.available">
 195.129 -            <and>
 195.130 -                <isset property="manifest.available"/>
 195.131 -                <istrue value="${do.archive}"/>
 195.132 -            </and>
 195.133 -        </condition>
 195.134 -        <condition property="do.archive+main.class.available">
 195.135 -            <and>
 195.136 -                <isset property="main.class.available"/>
 195.137 -                <istrue value="${do.archive}"/>
 195.138 -            </and>
 195.139 -        </condition>
 195.140 -        <condition property="do.archive+splashscreen.available">
 195.141 -            <and>
 195.142 -                <isset property="splashscreen.available"/>
 195.143 -                <istrue value="${do.archive}"/>
 195.144 -            </and>
 195.145 -        </condition>
 195.146 -        <condition property="do.archive+manifest.available+main.class">
 195.147 -            <and>
 195.148 -                <istrue value="${manifest.available+main.class}"/>
 195.149 -                <istrue value="${do.archive}"/>
 195.150 -            </and>
 195.151 -        </condition>
 195.152 -        <condition property="manifest.available-mkdist.available">
 195.153 -            <or>
 195.154 -                <istrue value="${manifest.available}"/>
 195.155 -                <isset property="do.mkdist"/>
 195.156 -            </or>
 195.157 -        </condition>
 195.158 -        <condition property="manifest.available+main.class-mkdist.available">
 195.159 -            <or>
 195.160 -                <istrue value="${manifest.available+main.class}"/>
 195.161 -                <isset property="do.mkdist"/>
 195.162 -            </or>
 195.163 -        </condition>
 195.164 -        <condition property="have.tests">
 195.165 -            <or>
 195.166 -                <available file="${test.src.dir}"/>
 195.167 -            </or>
 195.168 -        </condition>
 195.169 -        <condition property="have.sources">
 195.170 -            <or>
 195.171 -                <available file="${src.dir}"/>
 195.172 -            </or>
 195.173 -        </condition>
 195.174 -        <condition property="netbeans.home+have.tests">
 195.175 -            <and>
 195.176 -                <isset property="netbeans.home"/>
 195.177 -                <isset property="have.tests"/>
 195.178 -            </and>
 195.179 -        </condition>
 195.180 -        <condition property="no.javadoc.preview">
 195.181 -            <and>
 195.182 -                <isset property="javadoc.preview"/>
 195.183 -                <isfalse value="${javadoc.preview}"/>
 195.184 -            </and>
 195.185 -        </condition>
 195.186 -        <property name="run.jvmargs" value=""/>
 195.187 -        <property name="javac.compilerargs" value=""/>
 195.188 -        <property name="work.dir" value="${basedir}"/>
 195.189 -        <condition property="no.deps">
 195.190 -            <and>
 195.191 -                <istrue value="${no.dependencies}"/>
 195.192 -            </and>
 195.193 -        </condition>
 195.194 -        <property name="javac.debug" value="true"/>
 195.195 -        <property name="javadoc.preview" value="true"/>
 195.196 -        <property name="application.args" value=""/>
 195.197 -        <property name="source.encoding" value="${file.encoding}"/>
 195.198 -        <property name="runtime.encoding" value="${source.encoding}"/>
 195.199 -        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
 195.200 -            <and>
 195.201 -                <isset property="javadoc.encoding"/>
 195.202 -                <not>
 195.203 -                    <equals arg1="${javadoc.encoding}" arg2=""/>
 195.204 -                </not>
 195.205 -            </and>
 195.206 -        </condition>
 195.207 -        <property name="javadoc.encoding.used" value="${source.encoding}"/>
 195.208 -        <property name="includes" value="**"/>
 195.209 -        <property name="excludes" value=""/>
 195.210 -        <property name="do.depend" value="false"/>
 195.211 -        <condition property="do.depend.true">
 195.212 -            <istrue value="${do.depend}"/>
 195.213 -        </condition>
 195.214 -        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
 195.215 -        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
 195.216 -            <length length="0" string="${endorsed.classpath}" when="greater"/>
 195.217 -        </condition>
 195.218 -        <condition else="false" property="jdkBug6558476">
 195.219 -            <and>
 195.220 -                <matches pattern="1\.[56]" string="${java.specification.version}"/>
 195.221 -                <not>
 195.222 -                    <os family="unix"/>
 195.223 -                </not>
 195.224 -            </and>
 195.225 -        </condition>
 195.226 -        <property name="javac.fork" value="${jdkBug6558476}"/>
 195.227 -        <property name="jar.index" value="false"/>
 195.228 -        <property name="jar.index.metainf" value="${jar.index}"/>
 195.229 -        <property name="copylibs.rebase" value="true"/>
 195.230 -        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
 195.231 -    </target>
 195.232 -    <target name="-post-init">
 195.233 -        <!-- Empty placeholder for easier customization. -->
 195.234 -        <!-- You can override this target in the ../build.xml file. -->
 195.235 -    </target>
 195.236 -    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
 195.237 -        <fail unless="src.dir">Must set src.dir</fail>
 195.238 -        <fail unless="test.src.dir">Must set test.src.dir</fail>
 195.239 -        <fail unless="build.dir">Must set build.dir</fail>
 195.240 -        <fail unless="dist.dir">Must set dist.dir</fail>
 195.241 -        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
 195.242 -        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
 195.243 -        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
 195.244 -        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
 195.245 -        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
 195.246 -        <fail unless="dist.jar">Must set dist.jar</fail>
 195.247 -    </target>
 195.248 -    <target name="-init-macrodef-property">
 195.249 -        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
 195.250 -            <attribute name="name"/>
 195.251 -            <attribute name="value"/>
 195.252 -            <sequential>
 195.253 -                <property name="@{name}" value="${@{value}}"/>
 195.254 -            </sequential>
 195.255 -        </macrodef>
 195.256 -    </target>
 195.257 -    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
 195.258 -        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
 195.259 -            <attribute default="${src.dir}" name="srcdir"/>
 195.260 -            <attribute default="${build.classes.dir}" name="destdir"/>
 195.261 -            <attribute default="${javac.classpath}" name="classpath"/>
 195.262 -            <attribute default="${javac.processorpath}" name="processorpath"/>
 195.263 -            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
 195.264 -            <attribute default="${includes}" name="includes"/>
 195.265 -            <attribute default="${excludes}" name="excludes"/>
 195.266 -            <attribute default="${javac.debug}" name="debug"/>
 195.267 -            <attribute default="${empty.dir}" name="sourcepath"/>
 195.268 -            <attribute default="${empty.dir}" name="gensrcdir"/>
 195.269 -            <element name="customize" optional="true"/>
 195.270 -            <sequential>
 195.271 -                <property location="${build.dir}/empty" name="empty.dir"/>
 195.272 -                <mkdir dir="${empty.dir}"/>
 195.273 -                <mkdir dir="@{apgeneratedsrcdir}"/>
 195.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}">
 195.275 -                    <src>
 195.276 -                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
 195.277 -                            <include name="*"/>
 195.278 -                        </dirset>
 195.279 -                    </src>
 195.280 -                    <classpath>
 195.281 -                        <path path="@{classpath}"/>
 195.282 -                    </classpath>
 195.283 -                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
 195.284 -                    <compilerarg line="${javac.compilerargs}"/>
 195.285 -                    <compilerarg value="-processorpath"/>
 195.286 -                    <compilerarg path="@{processorpath}:${empty.dir}"/>
 195.287 -                    <compilerarg line="${ap.processors.internal}"/>
 195.288 -                    <compilerarg line="${annotation.processing.processor.options}"/>
 195.289 -                    <compilerarg value="-s"/>
 195.290 -                    <compilerarg path="@{apgeneratedsrcdir}"/>
 195.291 -                    <compilerarg line="${ap.proc.none.internal}"/>
 195.292 -                    <customize/>
 195.293 -                </javac>
 195.294 -            </sequential>
 195.295 -        </macrodef>
 195.296 -    </target>
 195.297 -    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
 195.298 -        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
 195.299 -            <attribute default="${src.dir}" name="srcdir"/>
 195.300 -            <attribute default="${build.classes.dir}" name="destdir"/>
 195.301 -            <attribute default="${javac.classpath}" name="classpath"/>
 195.302 -            <attribute default="${javac.processorpath}" name="processorpath"/>
 195.303 -            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
 195.304 -            <attribute default="${includes}" name="includes"/>
 195.305 -            <attribute default="${excludes}" name="excludes"/>
 195.306 -            <attribute default="${javac.debug}" name="debug"/>
 195.307 -            <attribute default="${empty.dir}" name="sourcepath"/>
 195.308 -            <attribute default="${empty.dir}" name="gensrcdir"/>
 195.309 -            <element name="customize" optional="true"/>
 195.310 -            <sequential>
 195.311 -                <property location="${build.dir}/empty" name="empty.dir"/>
 195.312 -                <mkdir dir="${empty.dir}"/>
 195.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}">
 195.314 -                    <src>
 195.315 -                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
 195.316 -                            <include name="*"/>
 195.317 -                        </dirset>
 195.318 -                    </src>
 195.319 -                    <classpath>
 195.320 -                        <path path="@{classpath}"/>
 195.321 -                    </classpath>
 195.322 -                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
 195.323 -                    <compilerarg line="${javac.compilerargs}"/>
 195.324 -                    <customize/>
 195.325 -                </javac>
 195.326 -            </sequential>
 195.327 -        </macrodef>
 195.328 -    </target>
 195.329 -    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
 195.330 -        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
 195.331 -            <attribute default="${src.dir}" name="srcdir"/>
 195.332 -            <attribute default="${build.classes.dir}" name="destdir"/>
 195.333 -            <attribute default="${javac.classpath}" name="classpath"/>
 195.334 -            <sequential>
 195.335 -                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
 195.336 -                    <classpath>
 195.337 -                        <path path="@{classpath}"/>
 195.338 -                    </classpath>
 195.339 -                </depend>
 195.340 -            </sequential>
 195.341 -        </macrodef>
 195.342 -        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
 195.343 -            <attribute default="${build.classes.dir}" name="destdir"/>
 195.344 -            <sequential>
 195.345 -                <fail unless="javac.includes">Must set javac.includes</fail>
 195.346 -                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
 195.347 -                    <path>
 195.348 -                        <filelist dir="@{destdir}" files="${javac.includes}"/>
 195.349 -                    </path>
 195.350 -                    <globmapper from="*.java" to="*.class"/>
 195.351 -                </pathconvert>
 195.352 -                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
 195.353 -                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
 195.354 -                <delete>
 195.355 -                    <files includesfile="${javac.includesfile.binary}"/>
 195.356 -                </delete>
 195.357 -                <delete>
 195.358 -                    <fileset file="${javac.includesfile.binary}"/>
 195.359 -                </delete>
 195.360 -            </sequential>
 195.361 -        </macrodef>
 195.362 -    </target>
 195.363 -    <target name="-init-macrodef-junit">
 195.364 -        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
 195.365 -            <attribute default="${includes}" name="includes"/>
 195.366 -            <attribute default="${excludes}" name="excludes"/>
 195.367 -            <attribute default="**" name="testincludes"/>
 195.368 -            <sequential>
 195.369 -                <property name="junit.forkmode" value="perTest"/>
 195.370 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
 195.371 -                    <batchtest todir="${build.test.results.dir}">
 195.372 -                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
 195.373 -                            <filename name="@{testincludes}"/>
 195.374 -                        </fileset>
 195.375 -                    </batchtest>
 195.376 -                    <classpath>
 195.377 -                        <path path="${run.test.classpath}"/>
 195.378 -                    </classpath>
 195.379 -                    <syspropertyset>
 195.380 -                        <propertyref prefix="test-sys-prop."/>
 195.381 -                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
 195.382 -                    </syspropertyset>
 195.383 -                    <formatter type="brief" usefile="false"/>
 195.384 -                    <formatter type="xml"/>
 195.385 -                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
 195.386 -                    <jvmarg value="-ea"/>
 195.387 -                    <jvmarg line="${run.jvmargs}"/>
 195.388 -                </junit>
 195.389 -            </sequential>
 195.390 -        </macrodef>
 195.391 -    </target>
 195.392 -    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
 195.393 -    <target name="-profile-pre-init">
 195.394 -        <!-- Empty placeholder for easier customization. -->
 195.395 -        <!-- You can override this target in the ../build.xml file. -->
 195.396 -    </target>
 195.397 -    <target name="-profile-post-init">
 195.398 -        <!-- Empty placeholder for easier customization. -->
 195.399 -        <!-- You can override this target in the ../build.xml file. -->
 195.400 -    </target>
 195.401 -    <target name="-profile-init-macrodef-profile">
 195.402 -        <macrodef name="resolve">
 195.403 -            <attribute name="name"/>
 195.404 -            <attribute name="value"/>
 195.405 -            <sequential>
 195.406 -                <property name="@{name}" value="${env.@{value}}"/>
 195.407 -            </sequential>
 195.408 -        </macrodef>
 195.409 -        <macrodef name="profile">
 195.410 -            <attribute default="${main.class}" name="classname"/>
 195.411 -            <element name="customize" optional="true"/>
 195.412 -            <sequential>
 195.413 -                <property environment="env"/>
 195.414 -                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
 195.415 -                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
 195.416 -                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
 195.417 -                    <jvmarg line="${profiler.info.jvmargs}"/>
 195.418 -                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
 195.419 -                    <arg line="${application.args}"/>
 195.420 -                    <classpath>
 195.421 -                        <path path="${run.classpath}"/>
 195.422 -                    </classpath>
 195.423 -                    <syspropertyset>
 195.424 -                        <propertyref prefix="run-sys-prop."/>
 195.425 -                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
 195.426 -                    </syspropertyset>
 195.427 -                    <customize/>
 195.428 -                </java>
 195.429 -            </sequential>
 195.430 -        </macrodef>
 195.431 -    </target>
 195.432 -    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
 195.433 -        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
 195.434 -        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
 195.435 -    </target>
 195.436 -    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
 195.437 -        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
 195.438 -            <attribute default="${main.class}" name="name"/>
 195.439 -            <attribute default="${debug.classpath}" name="classpath"/>
 195.440 -            <attribute default="" name="stopclassname"/>
 195.441 -            <sequential>
 195.442 -                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
 195.443 -                    <classpath>
 195.444 -                        <path path="@{classpath}"/>
 195.445 -                    </classpath>
 195.446 -                </nbjpdastart>
 195.447 -            </sequential>
 195.448 -        </macrodef>
 195.449 -        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
 195.450 -            <attribute default="${build.classes.dir}" name="dir"/>
 195.451 -            <sequential>
 195.452 -                <nbjpdareload>
 195.453 -                    <fileset dir="@{dir}" includes="${fix.classes}">
 195.454 -                        <include name="${fix.includes}*.class"/>
 195.455 -                    </fileset>
 195.456 -                </nbjpdareload>
 195.457 -            </sequential>
 195.458 -        </macrodef>
 195.459 -    </target>
 195.460 -    <target name="-init-debug-args">
 195.461 -        <property name="version-output" value="java version &quot;${ant.java.version}"/>
 195.462 -        <condition property="have-jdk-older-than-1.4">
 195.463 -            <or>
 195.464 -                <contains string="${version-output}" substring="java version &quot;1.0"/>
 195.465 -                <contains string="${version-output}" substring="java version &quot;1.1"/>
 195.466 -                <contains string="${version-output}" substring="java version &quot;1.2"/>
 195.467 -                <contains string="${version-output}" substring="java version &quot;1.3"/>
 195.468 -            </or>
 195.469 -        </condition>
 195.470 -        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
 195.471 -            <istrue value="${have-jdk-older-than-1.4}"/>
 195.472 -        </condition>
 195.473 -        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
 195.474 -            <os family="windows"/>
 195.475 -        </condition>
 195.476 -        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
 195.477 -            <isset property="debug.transport"/>
 195.478 -        </condition>
 195.479 -    </target>
 195.480 -    <target depends="-init-debug-args" name="-init-macrodef-debug">
 195.481 -        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
 195.482 -            <attribute default="${main.class}" name="classname"/>
 195.483 -            <attribute default="${debug.classpath}" name="classpath"/>
 195.484 -            <element name="customize" optional="true"/>
 195.485 -            <sequential>
 195.486 -                <java classname="@{classname}" dir="${work.dir}" fork="true">
 195.487 -                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
 195.488 -                    <jvmarg line="${debug-args-line}"/>
 195.489 -                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
 195.490 -                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
 195.491 -                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
 195.492 -                    <jvmarg line="${run.jvmargs}"/>
 195.493 -                    <classpath>
 195.494 -                        <path path="@{classpath}"/>
 195.495 -                    </classpath>
 195.496 -                    <syspropertyset>
 195.497 -                        <propertyref prefix="run-sys-prop."/>
 195.498 -                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
 195.499 -                    </syspropertyset>
 195.500 -                    <customize/>
 195.501 -                </java>
 195.502 -            </sequential>
 195.503 -        </macrodef>
 195.504 -    </target>
 195.505 -    <target name="-init-macrodef-java">
 195.506 -        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
 195.507 -            <attribute default="${main.class}" name="classname"/>
 195.508 -            <attribute default="${run.classpath}" name="classpath"/>
 195.509 -            <element name="customize" optional="true"/>
 195.510 -            <sequential>
 195.511 -                <java classname="@{classname}" dir="${work.dir}" fork="true">
 195.512 -                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
 195.513 -                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
 195.514 -                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
 195.515 -                    <jvmarg line="${run.jvmargs}"/>
 195.516 -                    <classpath>
 195.517 -                        <path path="@{classpath}"/>
 195.518 -                    </classpath>
 195.519 -                    <syspropertyset>
 195.520 -                        <propertyref prefix="run-sys-prop."/>
 195.521 -                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
 195.522 -                    </syspropertyset>
 195.523 -                    <customize/>
 195.524 -                </java>
 195.525 -            </sequential>
 195.526 -        </macrodef>
 195.527 -    </target>
 195.528 -    <target name="-init-macrodef-copylibs">
 195.529 -        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
 195.530 -            <attribute default="${manifest.file}" name="manifest"/>
 195.531 -            <element name="customize" optional="true"/>
 195.532 -            <sequential>
 195.533 -                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
 195.534 -                <pathconvert property="run.classpath.without.build.classes.dir">
 195.535 -                    <path path="${run.classpath}"/>
 195.536 -                    <map from="${build.classes.dir.resolved}" to=""/>
 195.537 -                </pathconvert>
 195.538 -                <pathconvert pathsep=" " property="jar.classpath">
 195.539 -                    <path path="${run.classpath.without.build.classes.dir}"/>
 195.540 -                    <chainedmapper>
 195.541 -                        <flattenmapper/>
 195.542 -                        <globmapper from="*" to="lib/*"/>
 195.543 -                    </chainedmapper>
 195.544 -                </pathconvert>
 195.545 -                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
 195.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}">
 195.547 -                    <fileset dir="${build.classes.dir}"/>
 195.548 -                    <manifest>
 195.549 -                        <attribute name="Class-Path" value="${jar.classpath}"/>
 195.550 -                        <customize/>
 195.551 -                    </manifest>
 195.552 -                </copylibs>
 195.553 -            </sequential>
 195.554 -        </macrodef>
 195.555 -    </target>
 195.556 -    <target name="-init-presetdef-jar">
 195.557 -        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
 195.558 -            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
 195.559 -                <j2seproject1:fileset dir="${build.classes.dir}"/>
 195.560 -            </jar>
 195.561 -        </presetdef>
 195.562 -    </target>
 195.563 -    <target name="-init-ap-cmdline-properties">
 195.564 -        <property name="annotation.processing.enabled" value="true"/>
 195.565 -        <property name="annotation.processing.processors.list" value=""/>
 195.566 -        <property name="annotation.processing.processor.options" value=""/>
 195.567 -        <property name="annotation.processing.run.all.processors" value="true"/>
 195.568 -        <property name="javac.processorpath" value="${javac.classpath}"/>
 195.569 -        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
 195.570 -        <condition property="ap.supported.internal" value="true">
 195.571 -            <not>
 195.572 -                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
 195.573 -            </not>
 195.574 -        </condition>
 195.575 -    </target>
 195.576 -    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
 195.577 -        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
 195.578 -            <isfalse value="${annotation.processing.run.all.processors}"/>
 195.579 -        </condition>
 195.580 -        <condition else="" property="ap.proc.none.internal" value="-proc:none">
 195.581 -            <isfalse value="${annotation.processing.enabled}"/>
 195.582 -        </condition>
 195.583 -    </target>
 195.584 -    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
 195.585 -        <property name="ap.cmd.line.internal" value=""/>
 195.586 -    </target>
 195.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"/>
 195.588 -    <!--
 195.589 -                ===================
 195.590 -                COMPILATION SECTION
 195.591 -                ===================
 195.592 -            -->
 195.593 -    <target name="-deps-jar-init" unless="built-jar.properties">
 195.594 -        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
 195.595 -        <delete file="${built-jar.properties}" quiet="true"/>
 195.596 -    </target>
 195.597 -    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
 195.598 -        <echo level="warn" message="Cycle detected: type.web.api was already built"/>
 195.599 -    </target>
 195.600 -    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
 195.601 -        <mkdir dir="${build.dir}"/>
 195.602 -        <touch file="${built-jar.properties}" verbose="false"/>
 195.603 -        <property file="${built-jar.properties}" prefix="already.built.jar."/>
 195.604 -        <antcall target="-warn-already-built-jar"/>
 195.605 -        <propertyfile file="${built-jar.properties}">
 195.606 -            <entry key="${basedir}" value=""/>
 195.607 -        </propertyfile>
 195.608 -        <antcall target="-maybe-call-dep">
 195.609 -            <param name="call.built.properties" value="${built-jar.properties}"/>
 195.610 -            <param location="${project.base_web_api}" name="call.subproject"/>
 195.611 -            <param location="${project.base_web_api}/build.xml" name="call.script"/>
 195.612 -            <param name="call.target" value="jar"/>
 195.613 -            <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
 195.614 -        </antcall>
 195.615 -    </target>
 195.616 -    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
 195.617 -    <target depends="init" name="-check-automatic-build">
 195.618 -        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
 195.619 -    </target>
 195.620 -    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
 195.621 -        <antcall target="clean"/>
 195.622 -    </target>
 195.623 -    <target depends="init,deps-jar" name="-pre-pre-compile">
 195.624 -        <mkdir dir="${build.classes.dir}"/>
 195.625 -    </target>
 195.626 -    <target name="-pre-compile">
 195.627 -        <!-- Empty placeholder for easier customization. -->
 195.628 -        <!-- You can override this target in the ../build.xml file. -->
 195.629 -    </target>
 195.630 -    <target if="do.depend.true" name="-compile-depend">
 195.631 -        <pathconvert property="build.generated.subdirs">
 195.632 -            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 195.633 -                <include name="*"/>
 195.634 -            </dirset>
 195.635 -        </pathconvert>
 195.636 -        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
 195.637 -    </target>
 195.638 -    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
 195.639 -        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
 195.640 -        <copy todir="${build.classes.dir}">
 195.641 -            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 195.642 -        </copy>
 195.643 -    </target>
 195.644 -    <target if="has.persistence.xml" name="-copy-persistence-xml">
 195.645 -        <mkdir dir="${build.classes.dir}/META-INF"/>
 195.646 -        <copy todir="${build.classes.dir}/META-INF">
 195.647 -            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
 195.648 -        </copy>
 195.649 -    </target>
 195.650 -    <target name="-post-compile">
 195.651 -        <!-- Empty placeholder for easier customization. -->
 195.652 -        <!-- You can override this target in the ../build.xml file. -->
 195.653 -    </target>
 195.654 -    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
 195.655 -    <target name="-pre-compile-single">
 195.656 -        <!-- Empty placeholder for easier customization. -->
 195.657 -        <!-- You can override this target in the ../build.xml file. -->
 195.658 -    </target>
 195.659 -    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
 195.660 -        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
 195.661 -        <j2seproject3:force-recompile/>
 195.662 -        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
 195.663 -    </target>
 195.664 -    <target name="-post-compile-single">
 195.665 -        <!-- Empty placeholder for easier customization. -->
 195.666 -        <!-- You can override this target in the ../build.xml file. -->
 195.667 -    </target>
 195.668 -    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
 195.669 -    <!--
 195.670 -                ====================
 195.671 -                JAR BUILDING SECTION
 195.672 -                ====================
 195.673 -            -->
 195.674 -    <target depends="init" name="-pre-pre-jar">
 195.675 -        <dirname file="${dist.jar}" property="dist.jar.dir"/>
 195.676 -        <mkdir dir="${dist.jar.dir}"/>
 195.677 -    </target>
 195.678 -    <target name="-pre-jar">
 195.679 -        <!-- Empty placeholder for easier customization. -->
 195.680 -        <!-- You can override this target in the ../build.xml file. -->
 195.681 -    </target>
 195.682 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
 195.683 -        <j2seproject1:jar/>
 195.684 -    </target>
 195.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">
 195.686 -        <j2seproject1:jar manifest="${manifest.file}"/>
 195.687 -    </target>
 195.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">
 195.689 -        <j2seproject1:jar manifest="${manifest.file}">
 195.690 -            <j2seproject1:manifest>
 195.691 -                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
 195.692 -            </j2seproject1:manifest>
 195.693 -        </j2seproject1:jar>
 195.694 -        <echo level="info">To run this application from the command line without Ant, try:</echo>
 195.695 -        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
 195.696 -        <property location="${dist.jar}" name="dist.jar.resolved"/>
 195.697 -        <pathconvert property="run.classpath.with.dist.jar">
 195.698 -            <path path="${run.classpath}"/>
 195.699 -            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
 195.700 -        </pathconvert>
 195.701 -        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
 195.702 -    </target>
 195.703 -    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
 195.704 -        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
 195.705 -        <touch file="${tmp.manifest.file}" verbose="false"/>
 195.706 -    </target>
 195.707 -    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
 195.708 -        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
 195.709 -        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
 195.710 -    </target>
 195.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">
 195.712 -        <manifest file="${tmp.manifest.file}" mode="update">
 195.713 -            <attribute name="Main-Class" value="${main.class}"/>
 195.714 -        </manifest>
 195.715 -    </target>
 195.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">
 195.717 -        <basename file="${application.splash}" property="splashscreen.basename"/>
 195.718 -        <mkdir dir="${build.classes.dir}/META-INF"/>
 195.719 -        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
 195.720 -        <manifest file="${tmp.manifest.file}" mode="update">
 195.721 -            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
 195.722 -        </manifest>
 195.723 -    </target>
 195.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">
 195.725 -        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
 195.726 -        <echo level="info">To run this application from the command line without Ant, try:</echo>
 195.727 -        <property location="${dist.jar}" name="dist.jar.resolved"/>
 195.728 -        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
 195.729 -    </target>
 195.730 -    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
 195.731 -        <delete>
 195.732 -            <fileset file="${tmp.manifest.file}"/>
 195.733 -        </delete>
 195.734 -    </target>
 195.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"/>
 195.736 -    <target name="-post-jar">
 195.737 -        <!-- Empty placeholder for easier customization. -->
 195.738 -        <!-- You can override this target in the ../build.xml file. -->
 195.739 -    </target>
 195.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"/>
 195.741 -    <!--
 195.742 -                =================
 195.743 -                EXECUTION SECTION
 195.744 -                =================
 195.745 -            -->
 195.746 -    <target depends="init,compile" description="Run a main class." name="run">
 195.747 -        <j2seproject1:java>
 195.748 -            <customize>
 195.749 -                <arg line="${application.args}"/>
 195.750 -            </customize>
 195.751 -        </j2seproject1:java>
 195.752 -    </target>
 195.753 -    <target name="-do-not-recompile">
 195.754 -        <property name="javac.includes.binary" value=""/>
 195.755 -    </target>
 195.756 -    <target depends="init,compile-single" name="run-single">
 195.757 -        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
 195.758 -        <j2seproject1:java classname="${run.class}"/>
 195.759 -    </target>
 195.760 -    <target depends="init,compile-test-single" name="run-test-with-main">
 195.761 -        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
 195.762 -        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
 195.763 -    </target>
 195.764 -    <!--
 195.765 -                =================
 195.766 -                DEBUGGING SECTION
 195.767 -                =================
 195.768 -            -->
 195.769 -    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
 195.770 -        <j2seproject1:nbjpdastart name="${debug.class}"/>
 195.771 -    </target>
 195.772 -    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
 195.773 -        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
 195.774 -    </target>
 195.775 -    <target depends="init,compile" name="-debug-start-debuggee">
 195.776 -        <j2seproject3:debug>
 195.777 -            <customize>
 195.778 -                <arg line="${application.args}"/>
 195.779 -            </customize>
 195.780 -        </j2seproject3:debug>
 195.781 -    </target>
 195.782 -    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
 195.783 -    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
 195.784 -        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
 195.785 -    </target>
 195.786 -    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
 195.787 -    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
 195.788 -        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
 195.789 -        <j2seproject3:debug classname="${debug.class}"/>
 195.790 -    </target>
 195.791 -    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
 195.792 -    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
 195.793 -        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
 195.794 -        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
 195.795 -    </target>
 195.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"/>
 195.797 -    <target depends="init" name="-pre-debug-fix">
 195.798 -        <fail unless="fix.includes">Must set fix.includes</fail>
 195.799 -        <property name="javac.includes" value="${fix.includes}.java"/>
 195.800 -    </target>
 195.801 -    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
 195.802 -        <j2seproject1:nbjpdareload/>
 195.803 -    </target>
 195.804 -    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
 195.805 -    <!--
 195.806 -                =================
 195.807 -                PROFILING SECTION
 195.808 -                =================
 195.809 -            -->
 195.810 -    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
 195.811 -        <nbprofiledirect>
 195.812 -            <classpath>
 195.813 -                <path path="${run.classpath}"/>
 195.814 -            </classpath>
 195.815 -        </nbprofiledirect>
 195.816 -        <profile/>
 195.817 -    </target>
 195.818 -    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
 195.819 -        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
 195.820 -        <nbprofiledirect>
 195.821 -            <classpath>
 195.822 -                <path path="${run.classpath}"/>
 195.823 -            </classpath>
 195.824 -        </nbprofiledirect>
 195.825 -        <profile classname="${profile.class}"/>
 195.826 -    </target>
 195.827 -    <!--
 195.828 -                =========================
 195.829 -                APPLET PROFILING  SECTION
 195.830 -                =========================
 195.831 -            -->
 195.832 -    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
 195.833 -        <nbprofiledirect>
 195.834 -            <classpath>
 195.835 -                <path path="${run.classpath}"/>
 195.836 -            </classpath>
 195.837 -        </nbprofiledirect>
 195.838 -        <profile classname="sun.applet.AppletViewer">
 195.839 -            <customize>
 195.840 -                <arg value="${applet.url}"/>
 195.841 -            </customize>
 195.842 -        </profile>
 195.843 -    </target>
 195.844 -    <!--
 195.845 -                =========================
 195.846 -                TESTS PROFILING  SECTION
 195.847 -                =========================
 195.848 -            -->
 195.849 -    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
 195.850 -        <nbprofiledirect>
 195.851 -            <classpath>
 195.852 -                <path path="${run.test.classpath}"/>
 195.853 -            </classpath>
 195.854 -        </nbprofiledirect>
 195.855 -        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
 195.856 -            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
 195.857 -            <jvmarg value="${profiler.info.jvmargs.agent}"/>
 195.858 -            <jvmarg line="${profiler.info.jvmargs}"/>
 195.859 -            <test name="${profile.class}"/>
 195.860 -            <classpath>
 195.861 -                <path path="${run.test.classpath}"/>
 195.862 -            </classpath>
 195.863 -            <syspropertyset>
 195.864 -                <propertyref prefix="test-sys-prop."/>
 195.865 -                <mapper from="test-sys-prop.*" to="*" type="glob"/>
 195.866 -            </syspropertyset>
 195.867 -            <formatter type="brief" usefile="false"/>
 195.868 -            <formatter type="xml"/>
 195.869 -        </junit>
 195.870 -    </target>
 195.871 -    <!--
 195.872 -                ===============
 195.873 -                JAVADOC SECTION
 195.874 -                ===============
 195.875 -            -->
 195.876 -    <target depends="init" if="have.sources" name="-javadoc-build">
 195.877 -        <mkdir dir="${dist.javadoc.dir}"/>
 195.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}">
 195.879 -            <classpath>
 195.880 -                <path path="${javac.classpath}"/>
 195.881 -            </classpath>
 195.882 -            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
 195.883 -                <filename name="**/*.java"/>
 195.884 -            </fileset>
 195.885 -            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 195.886 -                <include name="**/*.java"/>
 195.887 -                <exclude name="*.java"/>
 195.888 -            </fileset>
 195.889 -        </javadoc>
 195.890 -        <copy todir="${dist.javadoc.dir}">
 195.891 -            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
 195.892 -                <filename name="**/doc-files/**"/>
 195.893 -            </fileset>
 195.894 -            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 195.895 -                <include name="**/doc-files/**"/>
 195.896 -            </fileset>
 195.897 -        </copy>
 195.898 -    </target>
 195.899 -    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
 195.900 -        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
 195.901 -    </target>
 195.902 -    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
 195.903 -    <!--
 195.904 -                =========================
 195.905 -                JUNIT COMPILATION SECTION
 195.906 -                =========================
 195.907 -            -->
 195.908 -    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
 195.909 -        <mkdir dir="${build.test.classes.dir}"/>
 195.910 -    </target>
 195.911 -    <target name="-pre-compile-test">
 195.912 -        <!-- Empty placeholder for easier customization. -->
 195.913 -        <!-- You can override this target in the ../build.xml file. -->
 195.914 -    </target>
 195.915 -    <target if="do.depend.true" name="-compile-test-depend">
 195.916 -        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
 195.917 -    </target>
 195.918 -    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
 195.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}"/>
 195.920 -        <copy todir="${build.test.classes.dir}">
 195.921 -            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 195.922 -        </copy>
 195.923 -    </target>
 195.924 -    <target name="-post-compile-test">
 195.925 -        <!-- Empty placeholder for easier customization. -->
 195.926 -        <!-- You can override this target in the ../build.xml file. -->
 195.927 -    </target>
 195.928 -    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
 195.929 -    <target name="-pre-compile-test-single">
 195.930 -        <!-- Empty placeholder for easier customization. -->
 195.931 -        <!-- You can override this target in the ../build.xml file. -->
 195.932 -    </target>
 195.933 -    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
 195.934 -        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
 195.935 -        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
 195.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}"/>
 195.937 -        <copy todir="${build.test.classes.dir}">
 195.938 -            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 195.939 -        </copy>
 195.940 -    </target>
 195.941 -    <target name="-post-compile-test-single">
 195.942 -        <!-- Empty placeholder for easier customization. -->
 195.943 -        <!-- You can override this target in the ../build.xml file. -->
 195.944 -    </target>
 195.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"/>
 195.946 -    <!--
 195.947 -                =======================
 195.948 -                JUNIT EXECUTION SECTION
 195.949 -                =======================
 195.950 -            -->
 195.951 -    <target depends="init" if="have.tests" name="-pre-test-run">
 195.952 -        <mkdir dir="${build.test.results.dir}"/>
 195.953 -    </target>
 195.954 -    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
 195.955 -        <j2seproject3:junit testincludes="**/*Test.java"/>
 195.956 -    </target>
 195.957 -    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
 195.958 -        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
 195.959 -    </target>
 195.960 -    <target depends="init" if="have.tests" name="test-report"/>
 195.961 -    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
 195.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"/>
 195.963 -    <target depends="init" if="have.tests" name="-pre-test-run-single">
 195.964 -        <mkdir dir="${build.test.results.dir}"/>
 195.965 -    </target>
 195.966 -    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
 195.967 -        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
 195.968 -        <j2seproject3:junit excludes="" includes="${test.includes}"/>
 195.969 -    </target>
 195.970 -    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
 195.971 -        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
 195.972 -    </target>
 195.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"/>
 195.974 -    <!--
 195.975 -                =======================
 195.976 -                JUNIT DEBUGGING SECTION
 195.977 -                =======================
 195.978 -            -->
 195.979 -    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
 195.980 -        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
 195.981 -        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
 195.982 -        <delete file="${test.report.file}"/>
 195.983 -        <mkdir dir="${build.test.results.dir}"/>
 195.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}">
 195.985 -            <customize>
 195.986 -                <syspropertyset>
 195.987 -                    <propertyref prefix="test-sys-prop."/>
 195.988 -                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
 195.989 -                </syspropertyset>
 195.990 -                <arg value="${test.class}"/>
 195.991 -                <arg value="showoutput=true"/>
 195.992 -                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
 195.993 -                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
 195.994 -            </customize>
 195.995 -        </j2seproject3:debug>
 195.996 -    </target>
 195.997 -    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
 195.998 -        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
 195.999 -    </target>
195.1000 -    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
195.1001 -    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
195.1002 -        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
195.1003 -    </target>
195.1004 -    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
195.1005 -    <!--
195.1006 -                =========================
195.1007 -                APPLET EXECUTION SECTION
195.1008 -                =========================
195.1009 -            -->
195.1010 -    <target depends="init,compile-single" name="run-applet">
195.1011 -        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
195.1012 -        <j2seproject1:java classname="sun.applet.AppletViewer">
195.1013 -            <customize>
195.1014 -                <arg value="${applet.url}"/>
195.1015 -            </customize>
195.1016 -        </j2seproject1:java>
195.1017 -    </target>
195.1018 -    <!--
195.1019 -                =========================
195.1020 -                APPLET DEBUGGING  SECTION
195.1021 -                =========================
195.1022 -            -->
195.1023 -    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
195.1024 -        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
195.1025 -        <j2seproject3:debug classname="sun.applet.AppletViewer">
195.1026 -            <customize>
195.1027 -                <arg value="${applet.url}"/>
195.1028 -            </customize>
195.1029 -        </j2seproject3:debug>
195.1030 -    </target>
195.1031 -    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
195.1032 -    <!--
195.1033 -                ===============
195.1034 -                CLEANUP SECTION
195.1035 -                ===============
195.1036 -            -->
195.1037 -    <target name="-deps-clean-init" unless="built-clean.properties">
195.1038 -        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
195.1039 -        <delete file="${built-clean.properties}" quiet="true"/>
195.1040 -    </target>
195.1041 -    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
195.1042 -        <echo level="warn" message="Cycle detected: type.web.api was already built"/>
195.1043 -    </target>
195.1044 -    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
195.1045 -        <mkdir dir="${build.dir}"/>
195.1046 -        <touch file="${built-clean.properties}" verbose="false"/>
195.1047 -        <property file="${built-clean.properties}" prefix="already.built.clean."/>
195.1048 -        <antcall target="-warn-already-built-clean"/>
195.1049 -        <propertyfile file="${built-clean.properties}">
195.1050 -            <entry key="${basedir}" value=""/>
195.1051 -        </propertyfile>
195.1052 -        <antcall target="-maybe-call-dep">
195.1053 -            <param name="call.built.properties" value="${built-clean.properties}"/>
195.1054 -            <param location="${project.base_web_api}" name="call.subproject"/>
195.1055 -            <param location="${project.base_web_api}/build.xml" name="call.script"/>
195.1056 -            <param name="call.target" value="clean"/>
195.1057 -            <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
195.1058 -        </antcall>
195.1059 -    </target>
195.1060 -    <target depends="init" name="-do-clean">
195.1061 -        <delete dir="${build.dir}"/>
195.1062 -        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
195.1063 -    </target>
195.1064 -    <target name="-post-clean">
195.1065 -        <!-- Empty placeholder for easier customization. -->
195.1066 -        <!-- You can override this target in the ../build.xml file. -->
195.1067 -    </target>
195.1068 -    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
195.1069 -    <target name="-check-call-dep">
195.1070 -        <property file="${call.built.properties}" prefix="already.built."/>
195.1071 -        <condition property="should.call.dep">
195.1072 -            <not>
195.1073 -                <isset property="already.built.${call.subproject}"/>
195.1074 -            </not>
195.1075 -        </condition>
195.1076 -    </target>
195.1077 -    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
195.1078 -        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
195.1079 -            <propertyset>
195.1080 -                <propertyref prefix="transfer."/>
195.1081 -                <mapper from="transfer.*" to="*" type="glob"/>
195.1082 -            </propertyset>
195.1083 -        </ant>
195.1084 -    </target>
195.1085 -</project>
   196.1 --- a/server/backend/type.web.api/nbproject/genfiles.properties	Wed Jun 22 12:05:27 2011 +0200
   196.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   196.3 @@ -1,8 +0,0 @@
   196.4 -build.xml.data.CRC32=1bd1d79c
   196.5 -build.xml.script.CRC32=583d72ad
   196.6 -build.xml.stylesheet.CRC32=28e38971@1.45.0.45
   196.7 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
   196.8 -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
   196.9 -nbproject/build-impl.xml.data.CRC32=1bd1d79c
  196.10 -nbproject/build-impl.xml.script.CRC32=5a5278a8
  196.11 -nbproject/build-impl.xml.stylesheet.CRC32=cfcde7f8@1.45.0.45
   197.1 --- a/server/backend/type.web.api/nbproject/project.properties	Wed Jun 22 12:05:27 2011 +0200
   197.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   197.3 @@ -1,96 +0,0 @@
   197.4 -annotation.processing.enabled=true
   197.5 -annotation.processing.enabled.in.editor=false
   197.6 -annotation.processing.run.all.processors=true
   197.7 -annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
   197.8 -application.title=type.web.api
   197.9 -application.vendor=lahvac
  197.10 -build.classes.dir=${build.dir}/classes
  197.11 -build.classes.excludes=**/*.java,**/*.form
  197.12 -# This directory is removed when the project is cleaned:
  197.13 -build.dir=build
  197.14 -build.generated.dir=${build.dir}/generated
  197.15 -build.generated.sources.dir=${build.dir}/generated-sources
  197.16 -# Only compile against the classpath explicitly listed here:
  197.17 -build.sysclasspath=ignore
  197.18 -build.test.classes.dir=${build.dir}/test/classes
  197.19 -build.test.results.dir=${build.dir}/test/results
  197.20 -# Uncomment to specify the preferred debugger connection transport:
  197.21 -#debug.transport=dt_socket
  197.22 -debug.classpath=\
  197.23 -    ${run.classpath}
  197.24 -debug.test.classpath=\
  197.25 -    ${run.test.classpath}
  197.26 -# This directory is removed when the project is cleaned:
  197.27 -dist.dir=dist
  197.28 -dist.jar=${dist.dir}/type.web.api.jar
  197.29 -dist.javadoc.dir=${dist.dir}/javadoc
  197.30 -endorsed.classpath=
  197.31 -excludes=
  197.32 -file.reference.org-netbeans-api-java-classpath.jar=../../lib/org-netbeans-api-java-classpath.jar
  197.33 -file.reference.org-netbeans-modules-java-source.jar=../../lib/org-netbeans-modules-java-source.jar
  197.34 -file.reference.org-netbeans-modules-jumpto.jar=../../lib/org-netbeans-modules-jumpto.jar
  197.35 -file.reference.org-netbeans-modules-parsing-lucene.jar=../../lib/org-netbeans-modules-parsing-lucene.jar
  197.36 -file.reference.org-openide-filesystems.jar=../../lib/org-openide-filesystems.jar
  197.37 -file.reference.util-commons.jar=../../../libs.jerig/external/util-commons.jar
  197.38 -file.reference.util-lutz.jar=../../../libs.jerig/external/util-lutz.jar
  197.39 -file.reference.util-pojson.jar=../../../libs.jerig/external/util-pojson.jar
  197.40 -file.reference.util-strast.jar=../../../libs.jerig/external/util-strast.jar
  197.41 -includes=**
  197.42 -jar.compress=false
  197.43 -javac.classpath=\
  197.44 -    ${libs.lucene.classpath}:\
  197.45 -    ${libs.jersey.classpath}:\
  197.46 -    ${file.reference.org-netbeans-modules-java-source.jar}:\
  197.47 -    ${libs.freemarker.classpath}:\
  197.48 -    ${file.reference.util-commons.jar}:\
  197.49 -    ${file.reference.util-lutz.jar}:\
  197.50 -    ${file.reference.util-pojson.jar}:\
  197.51 -    ${file.reference.util-strast.jar}:\
  197.52 -    ${reference.base_web_api.jar}:\
  197.53 -    ${file.reference.org-openide-filesystems.jar}:\
  197.54 -    ${file.reference.org-netbeans-api-java-classpath.jar}:\
  197.55 -    ${file.reference.org-netbeans-modules-jumpto.jar}:\
  197.56 -    ${file.reference.org-netbeans-modules-parsing-lucene.jar}
  197.57 -# Space-separated list of extra javac options
  197.58 -javac.compilerargs=
  197.59 -javac.deprecation=false
  197.60 -javac.processorpath=\
  197.61 -    ${javac.classpath}
  197.62 -javac.source=1.6
  197.63 -javac.target=1.6
  197.64 -javac.test.classpath=\
  197.65 -    ${javac.classpath}:\
  197.66 -    ${build.classes.dir}
  197.67 -javac.test.processorpath=\
  197.68 -    ${javac.test.classpath}
  197.69 -javadoc.additionalparam=
  197.70 -javadoc.author=false
  197.71 -javadoc.encoding=${source.encoding}
  197.72 -javadoc.noindex=false
  197.73 -javadoc.nonavbar=false
  197.74 -javadoc.notree=false
  197.75 -javadoc.private=false
  197.76 -javadoc.splitindex=true
  197.77 -javadoc.use=true
  197.78 -javadoc.version=false
  197.79 -javadoc.windowtitle=
  197.80 -main.class=type.web.api.TypeWebApi
  197.81 -manifest.file=manifest.mf
  197.82 -meta.inf.dir=${src.dir}/META-INF
  197.83 -mkdist.disabled=false
  197.84 -platform.active=default_platform
  197.85 -project.base_web_api=../base.web.api
  197.86 -reference.base_web_api.jar=${project.base_web_api}/dist/base.web.api.jar
  197.87 -run.classpath=\
  197.88 -    ${javac.classpath}:\
  197.89 -    ${build.classes.dir}
  197.90 -# Space-separated list of JVM arguments used when running the project
  197.91 -# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
  197.92 -# or test-sys-prop.name=value to set system properties for unit tests):
  197.93 -run.jvmargs=
  197.94 -run.test.classpath=\
  197.95 -    ${javac.test.classpath}:\
  197.96 -    ${build.test.classes.dir}
  197.97 -source.encoding=UTF-8
  197.98 -src.dir=src
  197.99 -test.src.dir=test
   198.1 --- a/server/backend/type.web.api/nbproject/project.xml	Wed Jun 22 12:05:27 2011 +0200
   198.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   198.3 @@ -1,28 +0,0 @@
   198.4 -<?xml version="1.0" encoding="UTF-8"?>
   198.5 -<project xmlns="http://www.netbeans.org/ns/project/1">
   198.6 -    <type>org.netbeans.modules.java.j2seproject</type>
   198.7 -    <configuration>
   198.8 -        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
   198.9 -            <name>type.web.api</name>
  198.10 -            <source-roots>
  198.11 -                <root id="src.dir"/>
  198.12 -            </source-roots>
  198.13 -            <test-roots>
  198.14 -                <root id="test.src.dir"/>
  198.15 -            </test-roots>
  198.16 -        </data>
  198.17 -        <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
  198.18 -            <definitions>../../lib/nblibraries.properties</definitions>
  198.19 -        </libraries>
  198.20 -        <references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
  198.21 -            <reference>
  198.22 -                <foreign-project>base_web_api</foreign-project>
  198.23 -                <artifact-type>jar</artifact-type>
  198.24 -                <script>build.xml</script>
  198.25 -                <target>jar</target>
  198.26 -                <clean-target>clean</clean-target>
  198.27 -                <id>jar</id>
  198.28 -            </reference>
  198.29 -        </references>
  198.30 -    </configuration>
  198.31 -</project>
   199.1 --- a/server/backend/type.web.api/src/org/netbeans/modules/jackpot30/backend/type/api/API.java	Wed Jun 22 12:05:27 2011 +0200
   199.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   199.3 @@ -1,133 +0,0 @@
   199.4 -/*
   199.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   199.6 - *
   199.7 - * Copyright 2009-2011 Sun Microsystems, Inc. All rights reserved.
   199.8 - *
   199.9 - * The contents of this file are subject to the terms of either the GNU
  199.10 - * General Public License Version 2 only ("GPL") or the Common
  199.11 - * Development and Distribution License("CDDL") (collectively, the
  199.12 - * "License"). You may not use this file except in compliance with the
  199.13 - * License. You can obtain a copy of the License at
  199.14 - * http://www.netbeans.org/cddl-gplv2.html
  199.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  199.16 - * specific language governing permissions and limitations under the
  199.17 - * License.  When distributing the software, include this License Header
  199.18 - * Notice in each file and include the License file at
  199.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  199.20 - * particular file as subject to the "Classpath" exception as provided
  199.21 - * by Sun in the GPL Version 2 section of the License file that
  199.22 - * accompanied this code. If applicable, add the following below the
  199.23 - * License Header, with the fields enclosed by brackets [] replaced by
  199.24 - * your own identifying information:
  199.25 - * "Portions Copyrighted [year] [name of copyright owner]"
  199.26 - *
  199.27 - * If you wish your version of this file to be governed by only the CDDL
  199.28 - * or only the GPL Version 2, indicate your decision by adding
  199.29 - * "[Contributor] elects to include this software in this distribution
  199.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  199.31 - * single choice of license, a recipient has the option to distribute
  199.32 - * your version of this file under either the CDDL, the GPL Version 2 or
  199.33 - * to extend the choice of license to its licensees as provided above.
  199.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  199.35 - * Version 2 license, then the option applies only if the new code is
  199.36 - * made subject to such option by the copyright holder.
  199.37 - *
  199.38 - * Contributor(s):
  199.39 - *
  199.40 - * Portions Copyrighted 2009-2011 Sun Microsystems, Inc.
  199.41 - */
  199.42 -
  199.43 -package org.netbeans.modules.jackpot30.backend.type.api;
  199.44 -
  199.45 -import java.io.IOException;
  199.46 -import java.net.URL;
  199.47 -import java.util.ArrayList;
  199.48 -import java.util.EnumSet;
  199.49 -import java.util.HashSet;
  199.50 -import java.util.LinkedHashMap;
  199.51 -import java.util.List;
  199.52 -import java.util.Map;
  199.53 -import java.util.Set;
  199.54 -import javax.lang.model.element.TypeElement;
  199.55 -import javax.ws.rs.DefaultValue;
  199.56 -import javax.ws.rs.GET;
  199.57 -import javax.ws.rs.Path;
  199.58 -import javax.ws.rs.Produces;
  199.59 -import javax.ws.rs.QueryParam;
  199.60 -import org.codeviation.pojson.Pojson;
  199.61 -import org.netbeans.api.java.classpath.ClassPath;
  199.62 -import org.netbeans.api.java.source.ClassIndex.NameKind;
  199.63 -import org.netbeans.api.java.source.ClassIndex.SearchScope;
  199.64 -import org.netbeans.api.java.source.ClasspathInfo;
  199.65 -import org.netbeans.api.java.source.ElementHandle;
  199.66 -import org.netbeans.modules.jackpot30.backend.base.CategoryStorage;
  199.67 -import org.netbeans.modules.java.source.usages.ClassIndexManager;
  199.68 -import org.netbeans.modules.jumpto.type.GoToTypeAction;
  199.69 -import org.netbeans.spi.java.classpath.support.ClassPathSupport;
  199.70 -
  199.71 -/**
  199.72 - *
  199.73 - * @author lahvac
  199.74 - */
  199.75 -@Path("/index/type")
  199.76 -public class API {
  199.77 -
  199.78 -    @GET
  199.79 -    @Path("/search")
  199.80 -    @Produces("text/plain")
  199.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 {
  199.82 -        assert !asynchronous;
  199.83 -
  199.84 -        //copied (and converted to NameKind) from jumpto's GoToTypeAction:
  199.85 -        boolean exact = prefix.endsWith(" "); // NOI18N
  199.86 -
  199.87 -        prefix = prefix.trim();
  199.88 -
  199.89 -        if ( prefix.length() == 0) {
  199.90 -            return "";
  199.91 -        }
  199.92 -
  199.93 -        NameKind nameKind;
  199.94 -        int wildcard = GoToTypeAction.containsWildCard(prefix);
  199.95 -
  199.96 -        if (exact) {
  199.97 -            //nameKind = panel.isCaseSensitive() ? SearchType.EXACT_NAME : SearchType.CASE_INSENSITIVE_EXACT_NAME;
  199.98 -            nameKind = NameKind.SIMPLE_NAME;
  199.99 -        }
 199.100 -        else if ((GoToTypeAction.isAllUpper(prefix) && prefix.length() > 1) || GoToTypeAction.isCamelCase(prefix)) {
 199.101 -            nameKind = NameKind.CAMEL_CASE;
 199.102 -        }
 199.103 -        else if (wildcard != -1) {
 199.104 -            nameKind = casesensitive ? NameKind.REGEXP : NameKind.CASE_INSENSITIVE_REGEXP;
 199.105 -        }
 199.106 -        else {
 199.107 -            nameKind = casesensitive ? NameKind.PREFIX : NameKind.CASE_INSENSITIVE_PREFIX;
 199.108 -        }
 199.109 -
 199.110 -        Map<String, List<String>> result = new LinkedHashMap<String, List<String>>();
 199.111 -        CategoryStorage srcRoots = CategoryStorage.forId(segment);
 199.112 -
 199.113 -        for (URL srcRoot : srcRoots.getCategoryIndexFolders()) {
 199.114 -            if (!"rel".equals(srcRoot.getProtocol())) continue;
 199.115 -            String rootId = srcRoot.getPath().substring(1);
 199.116 -            List<String> currentResult = new ArrayList<String>();
 199.117 -
 199.118 -            result.put(rootId, currentResult);
 199.119 -
 199.120 -            ClassIndexManager.getDefault().createUsagesQuery(srcRoot, true).isValid();
 199.121 -            ClasspathInfo cpInfo = ClasspathInfo.create(ClassPath.EMPTY, ClassPath.EMPTY, ClassPathSupport.createClassPath(srcRoot));
 199.122 -            Set<ElementHandle<TypeElement>> names = new HashSet<ElementHandle<TypeElement>>(cpInfo.getClassIndex().getDeclaredTypes(prefix, nameKind, EnumSet.of(SearchScope.SOURCE)));
 199.123 -
 199.124 -            if (nameKind == NameKind.CAMEL_CASE) {
 199.125 -                names.addAll(cpInfo.getClassIndex().getDeclaredTypes(prefix, NameKind.CASE_INSENSITIVE_PREFIX, EnumSet.of(SearchScope.SOURCE)));
 199.126 -            }
 199.127 -
 199.128 -            for (ElementHandle<TypeElement> d : names) {
 199.129 -                currentResult.add(d.getBinaryName());
 199.130 -            }
 199.131 -        }
 199.132 -
 199.133 -        return Pojson.save(result);
 199.134 -    }
 199.135 -
 199.136 -}
   200.1 --- a/server/backend/type.web.api/src/org/netbeans/modules/jackpot30/backend/type/ui/UI.java	Wed Jun 22 12:05:27 2011 +0200
   200.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   200.3 @@ -1,141 +0,0 @@
   200.4 -/*
   200.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   200.6 - *
   200.7 - * Copyright 2009-2011 Oracle and/or its affiliates. All rights reserved.
   200.8 - *
   200.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  200.10 - * Other names may be trademarks of their respective owners.
  200.11 - *
  200.12 - * The contents of this file are subject to the terms of either the GNU
  200.13 - * General Public License Version 2 only ("GPL") or the Common
  200.14 - * Development and Distribution License("CDDL") (collectively, the
  200.15 - * "License"). You may not use this file except in compliance with the
  200.16 - * License. You can obtain a copy of the License at
  200.17 - * http://www.netbeans.org/cddl-gplv2.html
  200.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  200.19 - * specific language governing permissions and limitations under the
  200.20 - * License.  When distributing the software, include this License Header
  200.21 - * Notice in each file and include the License file at
  200.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  200.23 - * particular file as subject to the "Classpath" exception as provided
  200.24 - * by Oracle in the GPL Version 2 section of the License file that
  200.25 - * accompanied this code. If applicable, add the following below the
  200.26 - * License Header, with the fields enclosed by brackets [] replaced by
  200.27 - * your own identifying information:
  200.28 - * "Portions Copyrighted [year] [name of copyright owner]"
  200.29 - *
  200.30 - * If you wish your version of this file to be governed by only the CDDL
  200.31 - * or only the GPL Version 2, indicate your decision by adding
  200.32 - * "[Contributor] elects to include this software in this distribution
  200.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  200.34 - * single choice of license, a recipient has the option to distribute
  200.35 - * your version of this file under either the CDDL, the GPL Version 2 or
  200.36 - * to extend the choice of license to its licensees as provided above.
  200.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  200.38 - * Version 2 license, then the option applies only if the new code is
  200.39 - * made subject to such option by the copyright holder.
  200.40 - *
  200.41 - * Contributor(s):
  200.42 - *
  200.43 - * Portions Copyrighted 2009-2011 Sun Microsystems, Inc.
  200.44 - */
  200.45 -
  200.46 -package org.netbeans.modules.jackpot30.backend.type.ui;
  200.47 -
  200.48 -import java.util.Comparator;
  200.49 -import java.util.LinkedHashMap;
  200.50 -import java.util.Map.Entry;
  200.51 -import freemarker.template.TemplateException;
  200.52 -import java.io.IOException;
  200.53 -import java.net.URI;
  200.54 -import java.net.URISyntaxException;
  200.55 -import java.util.Collections;
  200.56 -import java.util.HashMap;
  200.57 -import java.util.LinkedList;
  200.58 -import java.util.List;
  200.59 -import java.util.Map;
  200.60 -import javax.ws.rs.GET;
  200.61 -import javax.ws.rs.Path;
  200.62 -import javax.ws.rs.Produces;
  200.63 -import javax.ws.rs.QueryParam;
  200.64 -import org.codeviation.pojson.Pojson;
  200.65 -import org.netbeans.modules.jackpot30.backend.base.FreemarkerUtilities;
  200.66 -import org.netbeans.modules.jackpot30.backend.base.WebUtilities;
  200.67 -import static org.netbeans.modules.jackpot30.backend.base.WebUtilities.escapeForQuery;
  200.68 -
  200.69 -/**
  200.70 - *
  200.71 - * @author lahvac
  200.72 - */
  200.73 -@Path("/index/type/ui")
  200.74 -public class UI {
  200.75 -
  200.76 -    @GET
  200.77 -    @Path("/search")
  200.78 -    @Produces("text/html")
  200.79 -    public String searchType(@QueryParam("path") String path, @QueryParam("prefix") String prefix) throws URISyntaxException, IOException, TemplateException {
  200.80 -        Map<String, Object> configurationData = new HashMap<String, Object>();
  200.81 -
  200.82 -        configurationData.put("paths", list());
  200.83 -        configurationData.put("selectedPath", path);
  200.84 -        configurationData.put("prefix", prefix);
  200.85 -
  200.86 -        if (prefix != null && path != null) {
  200.87 -            URI u = new URI("http://localhost:9998/index/type/search?path=" + escapeForQuery(path) + "&prefix=" + escapeForQuery(prefix));
  200.88 -            long queryTime = System.currentTimeMillis();
  200.89 -            @SuppressWarnings("unchecked") //XXX: should not trust something got from the network!
  200.90 -            Map<String, List<String>> types = Pojson.load(LinkedHashMap.class, u);
  200.91 -            List<Map<String, Object>> results = new LinkedList<Map<String, Object>>();
  200.92 -
  200.93 -            queryTime = System.currentTimeMillis() - queryTime;
  200.94 -
  200.95 -            for (Entry<String, List<String>> e : types.entrySet()) {
  200.96 -                for (String fqn : e.getValue()) {
  200.97 -                    Map<String, Object> found = new HashMap<String, Object>(3);
  200.98 -
  200.99 -                    found.put("fqn", fqn);
 200.100 -
 200.101 -                    if (fqn.contains("$")) {
 200.102 -                        fqn = fqn.substring(0, fqn.indexOf("$"));
 200.103 -                    }
 200.104 -
 200.105 -                    found.put("relativePath", e.getKey() + /*"/" + */fqn.replace('.', '/') + ".java");
 200.106 -
 200.107 -                    results.add(found);
 200.108 -                }
 200.109 -            }
 200.110 -
 200.111 -            Collections.sort(results, new Comparator<Map<String, Object>>() {
 200.112 -                @Override public int compare(Map<String, Object> o1, Map<String, Object> o2) {
 200.113 -                    return ((String) o1.get("fqn")).compareTo((String) o2.get("fqn"));
 200.114 -                }
 200.115 -            });
 200.116 -            
 200.117 -            configurationData.put("results", results);
 200.118 -
 200.119 -            Map<String, Object> statistics = new HashMap<String, Object>();
 200.120 -
 200.121 -            statistics.put("queryTime", queryTime);
 200.122 -
 200.123 -            configurationData.put("statistics", statistics);
 200.124 -        }
 200.125 -
 200.126 -        return FreemarkerUtilities.processTemplate("org/netbeans/modules/jackpot30/backend/type/ui/ui-findType.html", configurationData);
 200.127 -    }
 200.128 -
 200.129 -    private static List<Map<String, String>> list() throws URISyntaxException {
 200.130 -        List<Map<String, String>> result = new LinkedList<Map<String, String>>();
 200.131 -
 200.132 -        for (String enc : WebUtilities.requestStringArrayResponse(new URI("http://localhost:9998/index/list"))) {
 200.133 -            Map<String, String> rootDesc = new HashMap<String, String>();
 200.134 -            String[] col = enc.split(":", 2);
 200.135 -
 200.136 -            rootDesc.put("segment", col[0]);
 200.137 -            rootDesc.put("displayName", col[1]);
 200.138 -            result.add(rootDesc);
 200.139 -        }
 200.140 -
 200.141 -        return result;
 200.142 -    }
 200.143 -    
 200.144 -}
   201.1 --- a/server/backend/type.web.api/src/org/netbeans/modules/jackpot30/backend/type/ui/ui-findType.html	Wed Jun 22 12:05:27 2011 +0200
   201.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   201.3 @@ -1,28 +0,0 @@
   201.4 -<html>
   201.5 -<head>
   201.6 -    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
   201.7 -</head>
   201.8 -<body>
   201.9 -<form method="get">
  201.10 -<label for="path">Project:</label>
  201.11 -<select size="1" name="path">");
  201.12 -    <#list paths as path>
  201.13 -        <option <#if selectedPath?? && path.segment == selectedPath>selected</#if> value="${path.segment}">
  201.14 -            ${path.displayName}
  201.15 -        </option>
  201.16 -    </#list>
  201.17 -</select>
  201.18 -<br>
  201.19 -<label for="prefix">Type Name:</label><input type="text" name="prefix"<#if prefix??>value="${prefix}"</#if>/><br>
  201.20 -<input type="submit" name="Find Candidates"/>
  201.21 -</form>
  201.22 -
  201.23 -<#if results??>
  201.24 -    Found types:<br>
  201.25 -    <#list results as result>
  201.26 -        <a href="/index/ui/show?path=${selectedPath}&relative=${result.relativePath}">${result.fqn}</a><br>
  201.27 -    </#list>
  201.28 -</#if>
  201.29 -
  201.30 -</body>
  201.31 -</html>
   202.1 --- a/server/backend/web.main/build.xml	Wed Jun 22 12:05:27 2011 +0200
   202.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   202.3 @@ -1,74 +0,0 @@
   202.4 -<?xml version="1.0" encoding="UTF-8"?>
   202.5 -<!-- You may freely edit this file. See commented blocks below for -->
   202.6 -<!-- some examples of how to customize the build. -->
   202.7 -<!-- (If you delete it and reopen the project it will be recreated.) -->
   202.8 -<!-- By default, only the Clean and Build commands use this build script. -->
   202.9 -<!-- Commands such as Run, Debug, and Test only use this build script if -->
  202.10 -<!-- the Compile on Save feature is turned off for the project. -->
  202.11 -<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
  202.12 -<!-- in the project's Project Properties dialog box.-->
  202.13 -<project name="web.main" default="default" basedir=".">
  202.14 -    <description>Builds, tests, and runs the project web.main.</description>
  202.15 -    <import file="nbproject/build-impl.xml"/>
  202.16 -    <!--
  202.17 -
  202.18 -    There exist several targets which are by default empty and which can be 
  202.19 -    used for execution of your tasks. These targets are usually executed 
  202.20 -    before and after some main targets. They are: 
  202.21 -
  202.22 -      -pre-init:                 called before initialization of project properties
  202.23 -      -post-init:                called after initialization of project properties
  202.24 -      -pre-compile:              called before javac compilation
  202.25 -      -post-compile:             called after javac compilation
  202.26 -      -pre-compile-single:       called before javac compilation of single file
  202.27 -      -post-compile-single:      called after javac compilation of single file
  202.28 -      -pre-compile-test:         called before javac compilation of JUnit tests
  202.29 -      -post-compile-test:        called after javac compilation of JUnit tests
  202.30 -      -pre-compile-test-single:  called before javac compilation of single JUnit test
  202.31 -      -post-compile-test-single: called after javac compilation of single JUunit test
  202.32 -      -pre-jar:                  called before JAR building
  202.33 -      -post-jar:                 called after JAR building
  202.34 -      -post-clean:               called after cleaning build products
  202.35 -
  202.36 -    (Targets beginning with '-' are not intended to be called on their own.)
  202.37 -
  202.38 -    Example of inserting an obfuscator after compilation could look like this:
  202.39 -
  202.40 -        <target name="-post-compile">
  202.41 -            <obfuscate>
  202.42 -                <fileset dir="${build.classes.dir}"/>
  202.43 -            </obfuscate>
  202.44 -        </target>
  202.45 -
  202.46 -    For list of available properties check the imported 
  202.47 -    nbproject/build-impl.xml file. 
  202.48 -
  202.49 -
  202.50 -    Another way to customize the build is by overriding existing main targets.
  202.51 -    The targets of interest are: 
  202.52 -
  202.53 -      -init-macrodef-javac:     defines macro for javac compilation
  202.54 -      -init-macrodef-junit:     defines macro for junit execution
  202.55 -      -init-macrodef-debug:     defines macro for class debugging
  202.56 -      -init-macrodef-java:      defines macro for class execution
  202.57 -      -do-jar-with-manifest:    JAR building (if you are using a manifest)
  202.58 -      -do-jar-without-manifest: JAR building (if you are not using a manifest)
  202.59 -      run:                      execution of project 
  202.60 -      -javadoc-build:           Javadoc generation
  202.61 -      test-report:              JUnit report generation
  202.62 -
  202.63 -    An example of overriding the target for project execution could look like this:
  202.64 -
  202.65 -        <target name="run" depends="web.main-impl.jar">
  202.66 -            <exec dir="bin" executable="launcher.exe">
  202.67 -                <arg file="${dist.jar}"/>
  202.68 -            </exec>
  202.69 -        </target>
  202.70 -
  202.71 -    Notice that the overridden target depends on the jar target and not only on 
  202.72 -    the compile target as the regular run target does. Again, for a list of available 
  202.73 -    properties which you can use, check the target you are overriding in the
  202.74 -    nbproject/build-impl.xml file. 
  202.75 -
  202.76 -    -->
  202.77 -</project>
   203.1 --- a/server/backend/web.main/manifest.mf	Wed Jun 22 12:05:27 2011 +0200
   203.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   203.3 @@ -1,3 +0,0 @@
   203.4 -Manifest-Version: 1.0
   203.5 -X-COMMENT: Main-Class will be added automatically by build
   203.6 -
   204.1 --- a/server/backend/web.main/nbproject/build-impl.xml	Wed Jun 22 12:05:27 2011 +0200
   204.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   204.3 @@ -1,1096 +0,0 @@
   204.4 -<?xml version="1.0" encoding="UTF-8"?>
   204.5 -<!--
   204.6 -*** GENERATED FROM project.xml - DO NOT EDIT  ***
   204.7 -***         EDIT ../build.xml INSTEAD         ***
   204.8 -
   204.9 -For the purpose of easier reading the script
  204.10 -is divided into following sections:
  204.11 -
  204.12 -  - initialization
  204.13 -  - compilation
  204.14 -  - jar
  204.15 -  - execution
  204.16 -  - debugging
  204.17 -  - javadoc
  204.18 -  - junit compilation
  204.19 -  - junit execution
  204.20 -  - junit debugging
  204.21 -  - applet
  204.22 -  - cleanup
  204.23 -
  204.24 -        -->
  204.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">
  204.26 -    <fail message="Please build using Ant 1.8.0 or higher.">
  204.27 -        <condition>
  204.28 -            <not>
  204.29 -                <antversion atleast="1.8.0"/>
  204.30 -            </not>
  204.31 -        </condition>
  204.32 -    </fail>
  204.33 -    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
  204.34 -    <!-- 
  204.35 -                ======================
  204.36 -                INITIALIZATION SECTION 
  204.37 -                ======================
  204.38 -            -->
  204.39 -    <target name="-pre-init">
  204.40 -        <!-- Empty placeholder for easier customization. -->
  204.41 -        <!-- You can override this target in the ../build.xml file. -->
  204.42 -    </target>
  204.43 -    <target depends="-pre-init" name="-init-private">
  204.44 -        <property file="nbproject/private/config.properties"/>
  204.45 -        <property file="nbproject/private/configs/${config}.properties"/>
  204.46 -        <property file="nbproject/private/private.properties"/>
  204.47 -    </target>
  204.48 -    <target name="-pre-init-libraries">
  204.49 -        <property location="../../lib/nblibraries.properties" name="libraries.path"/>
  204.50 -        <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
  204.51 -        <pathconvert dirsep="/" property="libraries.dir">
  204.52 -            <path path="${libraries.dir.nativedirsep}"/>
  204.53 -        </pathconvert>
  204.54 -        <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
  204.55 -        <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
  204.56 -    </target>
  204.57 -    <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
  204.58 -        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
  204.59 -            <filterchain>
  204.60 -                <replacestring from="$${base}" to="${libraries.dir}"/>
  204.61 -                <escapeunicode/>
  204.62 -            </filterchain>
  204.63 -        </loadproperties>
  204.64 -    </target>
  204.65 -    <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
  204.66 -        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
  204.67 -            <filterchain>
  204.68 -                <replacestring from="$${base}" to="${libraries.dir}"/>
  204.69 -                <escapeunicode/>
  204.70 -            </filterchain>
  204.71 -        </loadproperties>
  204.72 -    </target>
  204.73 -    <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
  204.74 -        <property file="${user.properties.file}"/>
  204.75 -        <!-- The two properties below are usually overridden -->
  204.76 -        <!-- by the active platform. Just a fallback. -->
  204.77 -        <property name="default.javac.source" value="1.4"/>
  204.78 -        <property name="default.javac.target" value="1.4"/>
  204.79 -    </target>
  204.80 -    <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
  204.81 -        <property file="nbproject/configs/${config}.properties"/>
  204.82 -        <property file="nbproject/project.properties"/>
  204.83 -    </target>
  204.84 -    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
  204.85 -        <available file="${manifest.file}" property="manifest.available"/>
  204.86 -        <condition property="splashscreen.available">
  204.87 -            <and>
  204.88 -                <not>
  204.89 -                    <equals arg1="${application.splash}" arg2="" trim="true"/>
  204.90 -                </not>
  204.91 -                <available file="${application.splash}"/>
  204.92 -            </and>
  204.93 -        </condition>
  204.94 -        <condition property="main.class.available">
  204.95 -            <and>
  204.96 -                <isset property="main.class"/>
  204.97 -                <not>
  204.98 -                    <equals arg1="${main.class}" arg2="" trim="true"/>
  204.99 -                </not>
 204.100 -            </and>
 204.101 -        </condition>
 204.102 -        <condition property="manifest.available+main.class">
 204.103 -            <and>
 204.104 -                <isset property="manifest.available"/>
 204.105 -                <isset property="main.class.available"/>
 204.106 -            </and>
 204.107 -        </condition>
 204.108 -        <condition property="do.archive">
 204.109 -            <not>
 204.110 -                <istrue value="${jar.archive.disabled}"/>
 204.111 -            </not>
 204.112 -        </condition>
 204.113 -        <condition property="do.mkdist">
 204.114 -            <and>
 204.115 -                <isset property="do.archive"/>
 204.116 -                <isset property="libs.CopyLibs.classpath"/>
 204.117 -                <not>
 204.118 -                    <istrue value="${mkdist.disabled}"/>
 204.119 -                </not>
 204.120 -            </and>
 204.121 -        </condition>
 204.122 -        <condition property="manifest.available+main.class+mkdist.available">
 204.123 -            <and>
 204.124 -                <istrue value="${manifest.available+main.class}"/>
 204.125 -                <isset property="do.mkdist"/>
 204.126 -            </and>
 204.127 -        </condition>
 204.128 -        <condition property="do.archive+manifest.available">
 204.129 -            <and>
 204.130 -                <isset property="manifest.available"/>
 204.131 -                <istrue value="${do.archive}"/>
 204.132 -            </and>
 204.133 -        </condition>
 204.134 -        <condition property="do.archive+main.class.available">
 204.135 -            <and>
 204.136 -                <isset property="main.class.available"/>
 204.137 -                <istrue value="${do.archive}"/>
 204.138 -            </and>
 204.139 -        </condition>
 204.140 -        <condition property="do.archive+splashscreen.available">
 204.141 -            <and>
 204.142 -                <isset property="splashscreen.available"/>
 204.143 -                <istrue value="${do.archive}"/>
 204.144 -            </and>
 204.145 -        </condition>
 204.146 -        <condition property="do.archive+manifest.available+main.class">
 204.147 -            <and>
 204.148 -                <istrue value="${manifest.available+main.class}"/>
 204.149 -                <istrue value="${do.archive}"/>
 204.150 -            </and>
 204.151 -        </condition>
 204.152 -        <condition property="manifest.available-mkdist.available">
 204.153 -            <or>
 204.154 -                <istrue value="${manifest.available}"/>
 204.155 -                <isset property="do.mkdist"/>
 204.156 -            </or>
 204.157 -        </condition>
 204.158 -        <condition property="manifest.available+main.class-mkdist.available">
 204.159 -            <or>
 204.160 -                <istrue value="${manifest.available+main.class}"/>
 204.161 -                <isset property="do.mkdist"/>
 204.162 -            </or>
 204.163 -        </condition>
 204.164 -        <condition property="have.tests">
 204.165 -            <or>
 204.166 -                <available file="${test.src.dir}"/>
 204.167 -            </or>
 204.168 -        </condition>
 204.169 -        <condition property="have.sources">
 204.170 -            <or>
 204.171 -                <available file="${src.dir}"/>
 204.172 -            </or>
 204.173 -        </condition>
 204.174 -        <condition property="netbeans.home+have.tests">
 204.175 -            <and>
 204.176 -                <isset property="netbeans.home"/>
 204.177 -                <isset property="have.tests"/>
 204.178 -            </and>
 204.179 -        </condition>
 204.180 -        <condition property="no.javadoc.preview">
 204.181 -            <and>
 204.182 -                <isset property="javadoc.preview"/>
 204.183 -                <isfalse value="${javadoc.preview}"/>
 204.184 -            </and>
 204.185 -        </condition>
 204.186 -        <property name="run.jvmargs" value=""/>
 204.187 -        <property name="javac.compilerargs" value=""/>
 204.188 -        <property name="work.dir" value="${basedir}"/>
 204.189 -        <condition property="no.deps">
 204.190 -            <and>
 204.191 -                <istrue value="${no.dependencies}"/>
 204.192 -            </and>
 204.193 -        </condition>
 204.194 -        <property name="javac.debug" value="true"/>
 204.195 -        <property name="javadoc.preview" value="true"/>
 204.196 -        <property name="application.args" value=""/>
 204.197 -        <property name="source.encoding" value="${file.encoding}"/>
 204.198 -        <property name="runtime.encoding" value="${source.encoding}"/>
 204.199 -        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
 204.200 -            <and>
 204.201 -                <isset property="javadoc.encoding"/>
 204.202 -                <not>
 204.203 -                    <equals arg1="${javadoc.encoding}" arg2=""/>
 204.204 -                </not>
 204.205 -            </and>
 204.206 -        </condition>
 204.207 -        <property name="javadoc.encoding.used" value="${source.encoding}"/>
 204.208 -        <property name="includes" value="**"/>
 204.209 -        <property name="excludes" value=""/>
 204.210 -        <property name="do.depend" value="false"/>
 204.211 -        <condition property="do.depend.true">
 204.212 -            <istrue value="${do.depend}"/>
 204.213 -        </condition>
 204.214 -        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
 204.215 -        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
 204.216 -            <length length="0" string="${endorsed.classpath}" when="greater"/>
 204.217 -        </condition>
 204.218 -        <condition else="false" property="jdkBug6558476">
 204.219 -            <and>
 204.220 -                <matches pattern="1\.[56]" string="${java.specification.version}"/>
 204.221 -                <not>
 204.222 -                    <os family="unix"/>
 204.223 -                </not>
 204.224 -            </and>
 204.225 -        </condition>
 204.226 -        <property name="javac.fork" value="${jdkBug6558476}"/>
 204.227 -        <property name="jar.index" value="false"/>
 204.228 -        <property name="jar.index.metainf" value="${jar.index}"/>
 204.229 -        <property name="copylibs.rebase" value="true"/>
 204.230 -        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
 204.231 -    </target>
 204.232 -    <target name="-post-init">
 204.233 -        <!-- Empty placeholder for easier customization. -->
 204.234 -        <!-- You can override this target in the ../build.xml file. -->
 204.235 -    </target>
 204.236 -    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
 204.237 -        <fail unless="src.dir">Must set src.dir</fail>
 204.238 -        <fail unless="test.src.dir">Must set test.src.dir</fail>
 204.239 -        <fail unless="build.dir">Must set build.dir</fail>
 204.240 -        <fail unless="dist.dir">Must set dist.dir</fail>
 204.241 -        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
 204.242 -        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
 204.243 -        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
 204.244 -        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
 204.245 -        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
 204.246 -        <fail unless="dist.jar">Must set dist.jar</fail>
 204.247 -    </target>
 204.248 -    <target name="-init-macrodef-property">
 204.249 -        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
 204.250 -            <attribute name="name"/>
 204.251 -            <attribute name="value"/>
 204.252 -            <sequential>
 204.253 -                <property name="@{name}" value="${@{value}}"/>
 204.254 -            </sequential>
 204.255 -        </macrodef>
 204.256 -    </target>
 204.257 -    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
 204.258 -        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
 204.259 -            <attribute default="${src.dir}" name="srcdir"/>
 204.260 -            <attribute default="${build.classes.dir}" name="destdir"/>
 204.261 -            <attribute default="${javac.classpath}" name="classpath"/>
 204.262 -            <attribute default="${javac.processorpath}" name="processorpath"/>
 204.263 -            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
 204.264 -            <attribute default="${includes}" name="includes"/>
 204.265 -            <attribute default="${excludes}" name="excludes"/>
 204.266 -            <attribute default="${javac.debug}" name="debug"/>
 204.267 -            <attribute default="${empty.dir}" name="sourcepath"/>
 204.268 -            <attribute default="${empty.dir}" name="gensrcdir"/>
 204.269 -            <element name="customize" optional="true"/>
 204.270 -            <sequential>
 204.271 -                <property location="${build.dir}/empty" name="empty.dir"/>
 204.272 -                <mkdir dir="${empty.dir}"/>
 204.273 -                <mkdir dir="@{apgeneratedsrcdir}"/>
 204.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}">
 204.275 -                    <src>
 204.276 -                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
 204.277 -                            <include name="*"/>
 204.278 -                        </dirset>
 204.279 -                    </src>
 204.280 -                    <classpath>
 204.281 -                        <path path="@{classpath}"/>
 204.282 -                    </classpath>
 204.283 -                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
 204.284 -                    <compilerarg line="${javac.compilerargs}"/>
 204.285 -                    <compilerarg value="-processorpath"/>
 204.286 -                    <compilerarg path="@{processorpath}:${empty.dir}"/>
 204.287 -                    <compilerarg line="${ap.processors.internal}"/>
 204.288 -                    <compilerarg line="${annotation.processing.processor.options}"/>
 204.289 -                    <compilerarg value="-s"/>
 204.290 -                    <compilerarg path="@{apgeneratedsrcdir}"/>
 204.291 -                    <compilerarg line="${ap.proc.none.internal}"/>
 204.292 -                    <customize/>
 204.293 -                </javac>
 204.294 -            </sequential>
 204.295 -        </macrodef>
 204.296 -    </target>
 204.297 -    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
 204.298 -        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
 204.299 -            <attribute default="${src.dir}" name="srcdir"/>
 204.300 -            <attribute default="${build.classes.dir}" name="destdir"/>
 204.301 -            <attribute default="${javac.classpath}" name="classpath"/>
 204.302 -            <attribute default="${javac.processorpath}" name="processorpath"/>
 204.303 -            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
 204.304 -            <attribute default="${includes}" name="includes"/>
 204.305 -            <attribute default="${excludes}" name="excludes"/>
 204.306 -            <attribute default="${javac.debug}" name="debug"/>
 204.307 -            <attribute default="${empty.dir}" name="sourcepath"/>
 204.308 -            <attribute default="${empty.dir}" name="gensrcdir"/>
 204.309 -            <element name="customize" optional="true"/>
 204.310 -            <sequential>
 204.311 -                <property location="${build.dir}/empty" name="empty.dir"/>
 204.312 -                <mkdir dir="${empty.dir}"/>
 204.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}">
 204.314 -                    <src>
 204.315 -                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
 204.316 -                            <include name="*"/>
 204.317 -                        </dirset>
 204.318 -                    </src>
 204.319 -                    <classpath>
 204.320 -                        <path path="@{classpath}"/>
 204.321 -                    </classpath>
 204.322 -                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
 204.323 -                    <compilerarg line="${javac.compilerargs}"/>
 204.324 -                    <customize/>
 204.325 -                </javac>
 204.326 -            </sequential>
 204.327 -        </macrodef>
 204.328 -    </target>
 204.329 -    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
 204.330 -        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
 204.331 -            <attribute default="${src.dir}" name="srcdir"/>
 204.332 -            <attribute default="${build.classes.dir}" name="destdir"/>
 204.333 -            <attribute default="${javac.classpath}" name="classpath"/>
 204.334 -            <sequential>
 204.335 -                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
 204.336 -                    <classpath>
 204.337 -                        <path path="@{classpath}"/>
 204.338 -                    </classpath>
 204.339 -                </depend>
 204.340 -            </sequential>
 204.341 -        </macrodef>
 204.342 -        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
 204.343 -            <attribute default="${build.classes.dir}" name="destdir"/>
 204.344 -            <sequential>
 204.345 -                <fail unless="javac.includes">Must set javac.includes</fail>
 204.346 -                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
 204.347 -                    <path>
 204.348 -                        <filelist dir="@{destdir}" files="${javac.includes}"/>
 204.349 -                    </path>
 204.350 -                    <globmapper from="*.java" to="*.class"/>
 204.351 -                </pathconvert>
 204.352 -                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
 204.353 -                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
 204.354 -                <delete>
 204.355 -                    <files includesfile="${javac.includesfile.binary}"/>
 204.356 -                </delete>
 204.357 -                <delete>
 204.358 -                    <fileset file="${javac.includesfile.binary}"/>
 204.359 -                </delete>
 204.360 -            </sequential>
 204.361 -        </macrodef>
 204.362 -    </target>
 204.363 -    <target name="-init-macrodef-junit">
 204.364 -        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
 204.365 -            <attribute default="${includes}" name="includes"/>
 204.366 -            <attribute default="${excludes}" name="excludes"/>
 204.367 -            <attribute default="**" name="testincludes"/>
 204.368 -            <sequential>
 204.369 -                <property name="junit.forkmode" value="perTest"/>
 204.370 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
 204.371 -                    <batchtest todir="${build.test.results.dir}">
 204.372 -                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
 204.373 -                            <filename name="@{testincludes}"/>
 204.374 -                        </fileset>
 204.375 -                    </batchtest>
 204.376 -                    <classpath>
 204.377 -                        <path path="${run.test.classpath}"/>
 204.378 -                    </classpath>
 204.379 -                    <syspropertyset>
 204.380 -                        <propertyref prefix="test-sys-prop."/>
 204.381 -                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
 204.382 -                    </syspropertyset>
 204.383 -                    <formatter type="brief" usefile="false"/>
 204.384 -                    <formatter type="xml"/>
 204.385 -                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
 204.386 -                    <jvmarg value="-ea"/>
 204.387 -                    <jvmarg line="${run.jvmargs}"/>
 204.388 -                </junit>
 204.389 -            </sequential>
 204.390 -        </macrodef>
 204.391 -    </target>
 204.392 -    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
 204.393 -    <target name="-profile-pre-init">
 204.394 -        <!-- Empty placeholder for easier customization. -->
 204.395 -        <!-- You can override this target in the ../build.xml file. -->
 204.396 -    </target>
 204.397 -    <target name="-profile-post-init">
 204.398 -        <!-- Empty placeholder for easier customization. -->
 204.399 -        <!-- You can override this target in the ../build.xml file. -->
 204.400 -    </target>
 204.401 -    <target name="-profile-init-macrodef-profile">
 204.402 -        <macrodef name="resolve">
 204.403 -            <attribute name="name"/>
 204.404 -            <attribute name="value"/>
 204.405 -            <sequential>
 204.406 -                <property name="@{name}" value="${env.@{value}}"/>
 204.407 -            </sequential>
 204.408 -        </macrodef>
 204.409 -        <macrodef name="profile">
 204.410 -            <attribute default="${main.class}" name="classname"/>
 204.411 -            <element name="customize" optional="true"/>
 204.412 -            <sequential>
 204.413 -                <property environment="env"/>
 204.414 -                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
 204.415 -                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
 204.416 -                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
 204.417 -                    <jvmarg line="${profiler.info.jvmargs}"/>
 204.418 -                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
 204.419 -                    <arg line="${application.args}"/>
 204.420 -                    <classpath>
 204.421 -                        <path path="${run.classpath}"/>
 204.422 -                    </classpath>
 204.423 -                    <syspropertyset>
 204.424 -                        <propertyref prefix="run-sys-prop."/>
 204.425 -                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
 204.426 -                    </syspropertyset>
 204.427 -                    <customize/>
 204.428 -                </java>
 204.429 -            </sequential>
 204.430 -        </macrodef>
 204.431 -    </target>
 204.432 -    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
 204.433 -        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
 204.434 -        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
 204.435 -    </target>
 204.436 -    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
 204.437 -        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
 204.438 -            <attribute default="${main.class}" name="name"/>
 204.439 -            <attribute default="${debug.classpath}" name="classpath"/>
 204.440 -            <attribute default="" name="stopclassname"/>
 204.441 -            <sequential>
 204.442 -                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
 204.443 -                    <classpath>
 204.444 -                        <path path="@{classpath}"/>
 204.445 -                    </classpath>
 204.446 -                </nbjpdastart>
 204.447 -            </sequential>
 204.448 -        </macrodef>
 204.449 -        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
 204.450 -            <attribute default="${build.classes.dir}" name="dir"/>
 204.451 -            <sequential>
 204.452 -                <nbjpdareload>
 204.453 -                    <fileset dir="@{dir}" includes="${fix.classes}">
 204.454 -                        <include name="${fix.includes}*.class"/>
 204.455 -                    </fileset>
 204.456 -                </nbjpdareload>
 204.457 -            </sequential>
 204.458 -        </macrodef>
 204.459 -    </target>
 204.460 -    <target name="-init-debug-args">
 204.461 -        <property name="version-output" value="java version &quot;${ant.java.version}"/>
 204.462 -        <condition property="have-jdk-older-than-1.4">
 204.463 -            <or>
 204.464 -                <contains string="${version-output}" substring="java version &quot;1.0"/>
 204.465 -                <contains string="${version-output}" substring="java version &quot;1.1"/>
 204.466 -                <contains string="${version-output}" substring="java version &quot;1.2"/>
 204.467 -                <contains string="${version-output}" substring="java version &quot;1.3"/>
 204.468 -            </or>
 204.469 -        </condition>
 204.470 -        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
 204.471 -            <istrue value="${have-jdk-older-than-1.4}"/>
 204.472 -        </condition>
 204.473 -        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
 204.474 -            <os family="windows"/>
 204.475 -        </condition>
 204.476 -        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
 204.477 -            <isset property="debug.transport"/>
 204.478 -        </condition>
 204.479 -    </target>
 204.480 -    <target depends="-init-debug-args" name="-init-macrodef-debug">
 204.481 -        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
 204.482 -            <attribute default="${main.class}" name="classname"/>
 204.483 -            <attribute default="${debug.classpath}" name="classpath"/>
 204.484 -            <element name="customize" optional="true"/>
 204.485 -            <sequential>
 204.486 -                <java classname="@{classname}" dir="${work.dir}" fork="true">
 204.487 -                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
 204.488 -                    <jvmarg line="${debug-args-line}"/>
 204.489 -                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
 204.490 -                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
 204.491 -                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
 204.492 -                    <jvmarg line="${run.jvmargs}"/>
 204.493 -                    <classpath>
 204.494 -                        <path path="@{classpath}"/>
 204.495 -                    </classpath>
 204.496 -                    <syspropertyset>
 204.497 -                        <propertyref prefix="run-sys-prop."/>
 204.498 -                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
 204.499 -                    </syspropertyset>
 204.500 -                    <customize/>
 204.501 -                </java>
 204.502 -            </sequential>
 204.503 -        </macrodef>
 204.504 -    </target>
 204.505 -    <target name="-init-macrodef-java">
 204.506 -        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
 204.507 -            <attribute default="${main.class}" name="classname"/>
 204.508 -            <attribute default="${run.classpath}" name="classpath"/>
 204.509 -            <element name="customize" optional="true"/>
 204.510 -            <sequential>
 204.511 -                <java classname="@{classname}" dir="${work.dir}" fork="true">
 204.512 -                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
 204.513 -                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
 204.514 -                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
 204.515 -                    <jvmarg line="${run.jvmargs}"/>
 204.516 -                    <classpath>
 204.517 -                        <path path="@{classpath}"/>
 204.518 -                    </classpath>
 204.519 -                    <syspropertyset>
 204.520 -                        <propertyref prefix="run-sys-prop."/>
 204.521 -                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
 204.522 -                    </syspropertyset>
 204.523 -                    <customize/>
 204.524 -                </java>
 204.525 -            </sequential>
 204.526 -        </macrodef>
 204.527 -    </target>
 204.528 -    <target name="-init-macrodef-copylibs">
 204.529 -        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
 204.530 -            <attribute default="${manifest.file}" name="manifest"/>
 204.531 -            <element name="customize" optional="true"/>
 204.532 -            <sequential>
 204.533 -                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
 204.534 -                <pathconvert property="run.classpath.without.build.classes.dir">
 204.535 -                    <path path="${run.classpath}"/>
 204.536 -                    <map from="${build.classes.dir.resolved}" to=""/>
 204.537 -                </pathconvert>
 204.538 -                <pathconvert pathsep=" " property="jar.classpath">
 204.539 -                    <path path="${run.classpath.without.build.classes.dir}"/>
 204.540 -                    <chainedmapper>
 204.541 -                        <flattenmapper/>
 204.542 -                        <globmapper from="*" to="lib/*"/>
 204.543 -                    </chainedmapper>
 204.544 -                </pathconvert>
 204.545 -                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
 204.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}">
 204.547 -                    <fileset dir="${build.classes.dir}"/>
 204.548 -                    <manifest>
 204.549 -                        <attribute name="Class-Path" value="${jar.classpath}"/>
 204.550 -                        <customize/>
 204.551 -                    </manifest>
 204.552 -                </copylibs>
 204.553 -            </sequential>
 204.554 -        </macrodef>
 204.555 -    </target>
 204.556 -    <target name="-init-presetdef-jar">
 204.557 -        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
 204.558 -            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
 204.559 -                <j2seproject1:fileset dir="${build.classes.dir}"/>
 204.560 -            </jar>
 204.561 -        </presetdef>
 204.562 -    </target>
 204.563 -    <target name="-init-ap-cmdline-properties">
 204.564 -        <property name="annotation.processing.enabled" value="true"/>
 204.565 -        <property name="annotation.processing.processors.list" value=""/>
 204.566 -        <property name="annotation.processing.processor.options" value=""/>
 204.567 -        <property name="annotation.processing.run.all.processors" value="true"/>
 204.568 -        <property name="javac.processorpath" value="${javac.classpath}"/>
 204.569 -        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
 204.570 -        <condition property="ap.supported.internal" value="true">
 204.571 -            <not>
 204.572 -                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
 204.573 -            </not>
 204.574 -        </condition>
 204.575 -    </target>
 204.576 -    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
 204.577 -        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
 204.578 -            <isfalse value="${annotation.processing.run.all.processors}"/>
 204.579 -        </condition>
 204.580 -        <condition else="" property="ap.proc.none.internal" value="-proc:none">
 204.581 -            <isfalse value="${annotation.processing.enabled}"/>
 204.582 -        </condition>
 204.583 -    </target>
 204.584 -    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
 204.585 -        <property name="ap.cmd.line.internal" value=""/>
 204.586 -    </target>
 204.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"/>
 204.588 -    <!--
 204.589 -                ===================
 204.590 -                COMPILATION SECTION
 204.591 -                ===================
 204.592 -            -->
 204.593 -    <target name="-deps-jar-init" unless="built-jar.properties">
 204.594 -        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
 204.595 -        <delete file="${built-jar.properties}" quiet="true"/>
 204.596 -    </target>
 204.597 -    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
 204.598 -        <echo level="warn" message="Cycle detected: web.main was already built"/>
 204.599 -    </target>
 204.600 -    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
 204.601 -        <mkdir dir="${build.dir}"/>
 204.602 -        <touch file="${built-jar.properties}" verbose="false"/>
 204.603 -        <property file="${built-jar.properties}" prefix="already.built.jar."/>
 204.604 -        <antcall target="-warn-already-built-jar"/>
 204.605 -        <propertyfile file="${built-jar.properties}">
 204.606 -            <entry key="${basedir}" value=""/>
 204.607 -        </propertyfile>
 204.608 -        <antcall target="-maybe-call-dep">
 204.609 -            <param name="call.built.properties" value="${built-jar.properties}"/>
 204.610 -            <param location="${project.base_web_api}" name="call.subproject"/>
 204.611 -            <param location="${project.base_web_api}/build.xml" name="call.script"/>
 204.612 -            <param name="call.target" value="jar"/>
 204.613 -            <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
 204.614 -        </antcall>
 204.615 -        <antcall target="-maybe-call-dep">
 204.616 -            <param name="call.built.properties" value="${built-jar.properties}"/>
 204.617 -            <param location="${project.type_web_api}" name="call.subproject"/>
 204.618 -            <param location="${project.type_web_api}/build.xml" name="call.script"/>
 204.619 -            <param name="call.target" value="jar"/>
 204.620 -            <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
 204.621 -        </antcall>
 204.622 -    </target>
 204.623 -    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
 204.624 -    <target depends="init" name="-check-automatic-build">
 204.625 -        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
 204.626 -    </target>
 204.627 -    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
 204.628 -        <antcall target="clean"/>
 204.629 -    </target>
 204.630 -    <target depends="init,deps-jar" name="-pre-pre-compile">
 204.631 -        <mkdir dir="${build.classes.dir}"/>
 204.632 -    </target>
 204.633 -    <target name="-pre-compile">
 204.634 -        <!-- Empty placeholder for easier customization. -->
 204.635 -        <!-- You can override this target in the ../build.xml file. -->
 204.636 -    </target>
 204.637 -    <target if="do.depend.true" name="-compile-depend">
 204.638 -        <pathconvert property="build.generated.subdirs">
 204.639 -            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 204.640 -                <include name="*"/>
 204.641 -            </dirset>
 204.642 -        </pathconvert>
 204.643 -        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
 204.644 -    </target>
 204.645 -    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
 204.646 -        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
 204.647 -        <copy todir="${build.classes.dir}">
 204.648 -            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 204.649 -        </copy>
 204.650 -    </target>
 204.651 -    <target if="has.persistence.xml" name="-copy-persistence-xml">
 204.652 -        <mkdir dir="${build.classes.dir}/META-INF"/>
 204.653 -        <copy todir="${build.classes.dir}/META-INF">
 204.654 -            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
 204.655 -        </copy>
 204.656 -    </target>
 204.657 -    <target name="-post-compile">
 204.658 -        <!-- Empty placeholder for easier customization. -->
 204.659 -        <!-- You can override this target in the ../build.xml file. -->
 204.660 -    </target>
 204.661 -    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
 204.662 -    <target name="-pre-compile-single">
 204.663 -        <!-- Empty placeholder for easier customization. -->
 204.664 -        <!-- You can override this target in the ../build.xml file. -->
 204.665 -    </target>
 204.666 -    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
 204.667 -        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
 204.668 -        <j2seproject3:force-recompile/>
 204.669 -        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
 204.670 -    </target>
 204.671 -    <target name="-post-compile-single">
 204.672 -        <!-- Empty placeholder for easier customization. -->
 204.673 -        <!-- You can override this target in the ../build.xml file. -->
 204.674 -    </target>
 204.675 -    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
 204.676 -    <!--
 204.677 -                ====================
 204.678 -                JAR BUILDING SECTION
 204.679 -                ====================
 204.680 -            -->
 204.681 -    <target depends="init" name="-pre-pre-jar">
 204.682 -        <dirname file="${dist.jar}" property="dist.jar.dir"/>
 204.683 -        <mkdir dir="${dist.jar.dir}"/>
 204.684 -    </target>
 204.685 -    <target name="-pre-jar">
 204.686 -        <!-- Empty placeholder for easier customization. -->
 204.687 -        <!-- You can override this target in the ../build.xml file. -->
 204.688 -    </target>
 204.689 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
 204.690 -        <j2seproject1:jar/>
 204.691 -    </target>
 204.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">
 204.693 -        <j2seproject1:jar manifest="${manifest.file}"/>
 204.694 -    </target>
 204.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">
 204.696 -        <j2seproject1:jar manifest="${manifest.file}">
 204.697 -            <j2seproject1:manifest>
 204.698 -                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
 204.699 -            </j2seproject1:manifest>
 204.700 -        </j2seproject1:jar>
 204.701 -        <echo level="info">To run this application from the command line without Ant, try:</echo>
 204.702 -        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
 204.703 -        <property location="${dist.jar}" name="dist.jar.resolved"/>
 204.704 -        <pathconvert property="run.classpath.with.dist.jar">
 204.705 -            <path path="${run.classpath}"/>
 204.706 -            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
 204.707 -        </pathconvert>
 204.708 -        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
 204.709 -    </target>
 204.710 -    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
 204.711 -        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
 204.712 -        <touch file="${tmp.manifest.file}" verbose="false"/>
 204.713 -    </target>
 204.714 -    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
 204.715 -        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
 204.716 -        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
 204.717 -    </target>
 204.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">
 204.719 -        <manifest file="${tmp.manifest.file}" mode="update">
 204.720 -            <attribute name="Main-Class" value="${main.class}"/>
 204.721 -        </manifest>
 204.722 -    </target>
 204.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">
 204.724 -        <basename file="${application.splash}" property="splashscreen.basename"/>
 204.725 -        <mkdir dir="${build.classes.dir}/META-INF"/>
 204.726 -        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
 204.727 -        <manifest file="${tmp.manifest.file}" mode="update">
 204.728 -            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
 204.729 -        </manifest>
 204.730 -    </target>
 204.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">
 204.732 -        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
 204.733 -        <echo level="info">To run this application from the command line without Ant, try:</echo>
 204.734 -        <property location="${dist.jar}" name="dist.jar.resolved"/>
 204.735 -        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
 204.736 -    </target>
 204.737 -    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
 204.738 -        <delete>
 204.739 -            <fileset file="${tmp.manifest.file}"/>
 204.740 -        </delete>
 204.741 -    </target>
 204.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"/>
 204.743 -    <target name="-post-jar">
 204.744 -        <!-- Empty placeholder for easier customization. -->
 204.745 -        <!-- You can override this target in the ../build.xml file. -->
 204.746 -    </target>
 204.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"/>
 204.748 -    <!--
 204.749 -                =================
 204.750 -                EXECUTION SECTION
 204.751 -                =================
 204.752 -            -->
 204.753 -    <target depends="init,compile" description="Run a main class." name="run">
 204.754 -        <j2seproject1:java>
 204.755 -            <customize>
 204.756 -                <arg line="${application.args}"/>
 204.757 -            </customize>
 204.758 -        </j2seproject1:java>
 204.759 -    </target>
 204.760 -    <target name="-do-not-recompile">
 204.761 -        <property name="javac.includes.binary" value=""/>
 204.762 -    </target>
 204.763 -    <target depends="init,compile-single" name="run-single">
 204.764 -        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
 204.765 -        <j2seproject1:java classname="${run.class}"/>
 204.766 -    </target>
 204.767 -    <target depends="init,compile-test-single" name="run-test-with-main">
 204.768 -        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
 204.769 -        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
 204.770 -    </target>
 204.771 -    <!--
 204.772 -                =================
 204.773 -                DEBUGGING SECTION
 204.774 -                =================
 204.775 -            -->
 204.776 -    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
 204.777 -        <j2seproject1:nbjpdastart name="${debug.class}"/>
 204.778 -    </target>
 204.779 -    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
 204.780 -        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
 204.781 -    </target>
 204.782 -    <target depends="init,compile" name="-debug-start-debuggee">
 204.783 -        <j2seproject3:debug>
 204.784 -            <customize>
 204.785 -                <arg line="${application.args}"/>
 204.786 -            </customize>
 204.787 -        </j2seproject3:debug>
 204.788 -    </target>
 204.789 -    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
 204.790 -    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
 204.791 -        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
 204.792 -    </target>
 204.793 -    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
 204.794 -    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
 204.795 -        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
 204.796 -        <j2seproject3:debug classname="${debug.class}"/>
 204.797 -    </target>
 204.798 -    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
 204.799 -    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
 204.800 -        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
 204.801 -        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
 204.802 -    </target>
 204.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"/>
 204.804 -    <target depends="init" name="-pre-debug-fix">
 204.805 -        <fail unless="fix.includes">Must set fix.includes</fail>
 204.806 -        <property name="javac.includes" value="${fix.includes}.java"/>
 204.807 -    </target>
 204.808 -    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
 204.809 -        <j2seproject1:nbjpdareload/>
 204.810 -    </target>
 204.811 -    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
 204.812 -    <!--
 204.813 -                =================
 204.814 -                PROFILING SECTION
 204.815 -                =================
 204.816 -            -->
 204.817 -    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
 204.818 -        <nbprofiledirect>
 204.819 -            <classpath>
 204.820 -                <path path="${run.classpath}"/>
 204.821 -            </classpath>
 204.822 -        </nbprofiledirect>
 204.823 -        <profile/>
 204.824 -    </target>
 204.825 -    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
 204.826 -        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
 204.827 -        <nbprofiledirect>
 204.828 -            <classpath>
 204.829 -                <path path="${run.classpath}"/>
 204.830 -            </classpath>
 204.831 -        </nbprofiledirect>
 204.832 -        <profile classname="${profile.class}"/>
 204.833 -    </target>
 204.834 -    <!--
 204.835 -                =========================
 204.836 -                APPLET PROFILING  SECTION
 204.837 -                =========================
 204.838 -            -->
 204.839 -    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
 204.840 -        <nbprofiledirect>
 204.841 -            <classpath>
 204.842 -                <path path="${run.classpath}"/>
 204.843 -            </classpath>
 204.844 -        </nbprofiledirect>
 204.845 -        <profile classname="sun.applet.AppletViewer">
 204.846 -            <customize>
 204.847 -                <arg value="${applet.url}"/>
 204.848 -            </customize>
 204.849 -        </profile>
 204.850 -    </target>
 204.851 -    <!--
 204.852 -                =========================
 204.853 -                TESTS PROFILING  SECTION
 204.854 -                =========================
 204.855 -            -->
 204.856 -    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
 204.857 -        <nbprofiledirect>
 204.858 -            <classpath>
 204.859 -                <path path="${run.test.classpath}"/>
 204.860 -            </classpath>
 204.861 -        </nbprofiledirect>
 204.862 -        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
 204.863 -            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
 204.864 -            <jvmarg value="${profiler.info.jvmargs.agent}"/>
 204.865 -            <jvmarg line="${profiler.info.jvmargs}"/>
 204.866 -            <test name="${profile.class}"/>
 204.867 -            <classpath>
 204.868 -                <path path="${run.test.classpath}"/>
 204.869 -            </classpath>
 204.870 -            <syspropertyset>
 204.871 -                <propertyref prefix="test-sys-prop."/>
 204.872 -                <mapper from="test-sys-prop.*" to="*" type="glob"/>
 204.873 -            </syspropertyset>
 204.874 -            <formatter type="brief" usefile="false"/>
 204.875 -            <formatter type="xml"/>
 204.876 -        </junit>
 204.877 -    </target>
 204.878 -    <!--
 204.879 -                ===============
 204.880 -                JAVADOC SECTION
 204.881 -                ===============
 204.882 -            -->
 204.883 -    <target depends="init" if="have.sources" name="-javadoc-build">
 204.884 -        <mkdir dir="${dist.javadoc.dir}"/>
 204.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}">
 204.886 -            <classpath>
 204.887 -                <path path="${javac.classpath}"/>
 204.888 -            </classpath>
 204.889 -            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
 204.890 -                <filename name="**/*.java"/>
 204.891 -            </fileset>
 204.892 -            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 204.893 -                <include name="**/*.java"/>
 204.894 -                <exclude name="*.java"/>
 204.895 -            </fileset>
 204.896 -        </javadoc>
 204.897 -        <copy todir="${dist.javadoc.dir}">
 204.898 -            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
 204.899 -                <filename name="**/doc-files/**"/>
 204.900 -            </fileset>
 204.901 -            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
 204.902 -                <include name="**/doc-files/**"/>
 204.903 -            </fileset>
 204.904 -        </copy>
 204.905 -    </target>
 204.906 -    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
 204.907 -        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
 204.908 -    </target>
 204.909 -    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
 204.910 -    <!--
 204.911 -                =========================
 204.912 -                JUNIT COMPILATION SECTION
 204.913 -                =========================
 204.914 -            -->
 204.915 -    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
 204.916 -        <mkdir dir="${build.test.classes.dir}"/>
 204.917 -    </target>
 204.918 -    <target name="-pre-compile-test">
 204.919 -        <!-- Empty placeholder for easier customization. -->
 204.920 -        <!-- You can override this target in the ../build.xml file. -->
 204.921 -    </target>
 204.922 -    <target if="do.depend.true" name="-compile-test-depend">
 204.923 -        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
 204.924 -    </target>
 204.925 -    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
 204.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}"/>
 204.927 -        <copy todir="${build.test.classes.dir}">
 204.928 -            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 204.929 -        </copy>
 204.930 -    </target>
 204.931 -    <target name="-post-compile-test">
 204.932 -        <!-- Empty placeholder for easier customization. -->
 204.933 -        <!-- You can override this target in the ../build.xml file. -->
 204.934 -    </target>
 204.935 -    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
 204.936 -    <target name="-pre-compile-test-single">
 204.937 -        <!-- Empty placeholder for easier customization. -->
 204.938 -        <!-- You can override this target in the ../build.xml file. -->
 204.939 -    </target>
 204.940 -    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
 204.941 -        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
 204.942 -        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
 204.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}"/>
 204.944 -        <copy todir="${build.test.classes.dir}">
 204.945 -            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
 204.946 -        </copy>
 204.947 -    </target>
 204.948 -    <target name="-post-compile-test-single">
 204.949 -        <!-- Empty placeholder for easier customization. -->
 204.950 -        <!-- You can override this target in the ../build.xml file. -->
 204.951 -    </target>
 204.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"/>
 204.953 -    <!--
 204.954 -                =======================
 204.955 -                JUNIT EXECUTION SECTION
 204.956 -                =======================
 204.957 -            -->
 204.958 -    <target depends="init" if="have.tests" name="-pre-test-run">
 204.959 -        <mkdir dir="${build.test.results.dir}"/>
 204.960 -    </target>
 204.961 -    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
 204.962 -        <j2seproject3:junit testincludes="**/*Test.java"/>
 204.963 -    </target>
 204.964 -    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
 204.965 -        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
 204.966 -    </target>
 204.967 -    <target depends="init" if="have.tests" name="test-report"/>
 204.968 -    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
 204.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"/>
 204.970 -    <target depends="init" if="have.tests" name="-pre-test-run-single">
 204.971 -        <mkdir dir="${build.test.results.dir}"/>
 204.972 -    </target>
 204.973 -    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
 204.974 -        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
 204.975 -        <j2seproject3:junit excludes="" includes="${test.includes}"/>
 204.976 -    </target>
 204.977 -    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
 204.978 -        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
 204.979 -    </target>
 204.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"/>
 204.981 -    <!--
 204.982 -                =======================
 204.983 -                JUNIT DEBUGGING SECTION
 204.984 -                =======================
 204.985 -            -->
 204.986 -    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
 204.987 -        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
 204.988 -        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
 204.989 -        <delete file="${test.report.file}"/>
 204.990 -        <mkdir dir="${build.test.results.dir}"/>
 204.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}">
 204.992 -            <customize>
 204.993 -                <syspropertyset>
 204.994 -                    <propertyref prefix="test-sys-prop."/>
 204.995 -                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
 204.996 -                </syspropertyset>
 204.997 -                <arg value="${test.class}"/>
 204.998 -                <arg value="showoutput=true"/>
 204.999 -                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
204.1000 -                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
204.1001 -            </customize>
204.1002 -        </j2seproject3:debug>
204.1003 -    </target>
204.1004 -    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
204.1005 -        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
204.1006 -    </target>
204.1007 -    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
204.1008 -    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
204.1009 -        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
204.1010 -    </target>
204.1011 -    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
204.1012 -    <!--
204.1013 -                =========================
204.1014 -                APPLET EXECUTION SECTION
204.1015 -                =========================
204.1016 -            -->
204.1017 -    <target depends="init,compile-single" name="run-applet">
204.1018 -        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
204.1019 -        <j2seproject1:java classname="sun.applet.AppletViewer">
204.1020 -            <customize>
204.1021 -                <arg value="${applet.url}"/>
204.1022 -            </customize>
204.1023 -        </j2seproject1:java>
204.1024 -    </target>
204.1025 -    <!--
204.1026 -                =========================
204.1027 -                APPLET DEBUGGING  SECTION
204.1028 -                =========================
204.1029 -            -->
204.1030 -    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
204.1031 -        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
204.1032 -        <j2seproject3:debug classname="sun.applet.AppletViewer">
204.1033 -            <customize>
204.1034 -                <arg value="${applet.url}"/>
204.1035 -            </customize>
204.1036 -        </j2seproject3:debug>
204.1037 -    </target>
204.1038 -    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
204.1039 -    <!--
204.1040 -                ===============
204.1041 -                CLEANUP SECTION
204.1042 -                ===============
204.1043 -            -->
204.1044 -    <target name="-deps-clean-init" unless="built-clean.properties">
204.1045 -        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
204.1046 -        <delete file="${built-clean.properties}" quiet="true"/>
204.1047 -    </target>
204.1048 -    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
204.1049 -        <echo level="warn" message="Cycle detected: web.main was already built"/>
204.1050 -    </target>
204.1051 -    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
204.1052 -        <mkdir dir="${build.dir}"/>
204.1053 -        <touch file="${built-clean.properties}" verbose="false"/>
204.1054 -        <property file="${built-clean.properties}" prefix="already.built.clean."/>
204.1055 -        <antcall target="-warn-already-built-clean"/>
204.1056 -        <propertyfile file="${built-clean.properties}">
204.1057 -            <entry key="${basedir}" value=""/>
204.1058 -        </propertyfile>
204.1059 -        <antcall target="-maybe-call-dep">
204.1060 -            <param name="call.built.properties" value="${built-clean.properties}"/>
204.1061 -            <param location="${project.base_web_api}" name="call.subproject"/>
204.1062 -            <param location="${project.base_web_api}/build.xml" name="call.script"/>
204.1063 -            <param name="call.target" value="clean"/>
204.1064 -            <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
204.1065 -        </antcall>
204.1066 -        <antcall target="-maybe-call-dep">
204.1067 -            <param name="call.built.properties" value="${built-clean.properties}"/>
204.1068 -            <param location="${project.type_web_api}" name="call.subproject"/>
204.1069 -            <param location="${project.type_web_api}/build.xml" name="call.script"/>
204.1070 -            <param name="call.target" value="clean"/>
204.1071 -            <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
204.1072 -        </antcall>
204.1073 -    </target>
204.1074 -    <target depends="init" name="-do-clean">
204.1075 -        <delete dir="${build.dir}"/>
204.1076 -        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
204.1077 -    </target>
204.1078 -    <target name="-post-clean">
204.1079 -        <!-- Empty placeholder for easier customization. -->
204.1080 -        <!-- You can override this target in the ../build.xml file. -->
204.1081 -    </target>
204.1082 -    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
204.1083 -    <target name="-check-call-dep">
204.1084 -        <property file="${call.built.properties}" prefix="already.built."/>
204.1085 -        <condition property="should.call.dep">
204.1086 -            <not>
204.1087 -                <isset property="already.built.${call.subproject}"/>
204.1088 -            </not>
204.1089 -        </condition>
204.1090 -    </target>
204.1091 -    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
204.1092 -        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
204.1093 -            <propertyset>
204.1094 -                <propertyref prefix="transfer."/>
204.1095 -                <mapper from="transfer.*" to="*" type="glob"/>
204.1096 -            </propertyset>
204.1097 -        </ant>
204.1098 -    </target>
204.1099 -</project>
   205.1 --- a/server/backend/web.main/nbproject/genfiles.properties	Wed Jun 22 12:05:27 2011 +0200
   205.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   205.3 @@ -1,8 +0,0 @@
   205.4 -build.xml.data.CRC32=3059ce8d
   205.5 -build.xml.script.CRC32=5ddf268c
   205.6 -build.xml.stylesheet.CRC32=28e38971@1.45.0.45
   205.7 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
   205.8 -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
   205.9 -nbproject/build-impl.xml.data.CRC32=3059ce8d
  205.10 -nbproject/build-impl.xml.script.CRC32=81ed8c6f
  205.11 -nbproject/build-impl.xml.stylesheet.CRC32=cfcde7f8@1.45.0.45
   206.1 --- a/server/backend/web.main/nbproject/project.properties	Wed Jun 22 12:05:27 2011 +0200
   206.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   206.3 @@ -1,123 +0,0 @@
   206.4 -annotation.processing.enabled=true
   206.5 -annotation.processing.enabled.in.editor=false
   206.6 -annotation.processing.run.all.processors=true
   206.7 -annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
   206.8 -application.title=web.main
   206.9 -application.vendor=lahvac
  206.10 -build.classes.dir=${build.dir}/classes
  206.11 -build.classes.excludes=**/*.java,**/*.form
  206.12 -# This directory is removed when the project is cleaned:
  206.13 -build.dir=build
  206.14 -build.generated.dir=${build.dir}/generated
  206.15 -build.generated.sources.dir=${build.dir}/generated-sources
  206.16 -# Only compile against the classpath explicitly listed here:
  206.17 -build.sysclasspath=ignore
  206.18 -build.test.classes.dir=${build.dir}/test/classes
  206.19 -build.test.results.dir=${build.dir}/test/results
  206.20 -# Uncomment to specify the preferred debugger connection transport:
  206.21 -#debug.transport=dt_socket
  206.22 -debug.classpath=\
  206.23 -    ${run.classpath}
  206.24 -debug.test.classpath=\
  206.25 -    ${run.test.classpath}
  206.26 -# This directory is removed when the project is cleaned:
  206.27 -dist.dir=dist
  206.28 -dist.jar=${dist.dir}/web.main.jar
  206.29 -dist.javadoc.dir=${dist.dir}/javadoc
  206.30 -endorsed.classpath=
  206.31 -excludes=
  206.32 -file.reference.org-netbeans-api-java-classpath.jar=../../lib/org-netbeans-api-java-classpath.jar
  206.33 -file.reference.org-netbeans-modules-java-hints.jar=../../lib/org-netbeans-modules-java-hints.jar
  206.34 -file.reference.org-netbeans-modules-java-project.jar=../../lib/org-netbeans-modules-java-project.jar
  206.35 -file.reference.org-netbeans-modules-java-source.jar=../../lib/org-netbeans-modules-java-source.jar
  206.36 -file.reference.org-netbeans-modules-jumpto.jar=../../lib/org-netbeans-modules-jumpto.jar
  206.37 -file.reference.org-netbeans-modules-masterfs.jar=../../lib/org-netbeans-modules-masterfs.jar
  206.38 -file.reference.org-netbeans-modules-parsing-api.jar=../../lib/org-netbeans-modules-parsing-api.jar
  206.39 -file.reference.org-netbeans-modules-parsing-lucene.jar=../../lib/org-netbeans-modules-parsing-lucene.jar
  206.40 -file.reference.org-netbeans-modules-projectapi.jar=../../lib/org-netbeans-modules-projectapi.jar
  206.41 -file.reference.org-netbeans-modules-sendopts.jar=../../lib/org-netbeans-modules-sendopts.jar
  206.42 -file.reference.org-netbeans-spi-editor-hints.jar=../../lib/org-netbeans-spi-editor-hints.jar
  206.43 -file.reference.org-openide-filesystems.jar=../../lib/org-openide-filesystems.jar
  206.44 -file.reference.org-openide-util-lookup.jar=../../lib/org-openide-util-lookup.jar
  206.45 -file.reference.org-openide-util.jar=../../lib/org-openide-util.jar
  206.46 -file.reference.util-commons.jar=../../../libs.jerig/external/util-commons.jar
  206.47 -file.reference.util-lutz.jar=../../../libs.jerig/external/util-lutz.jar
  206.48 -file.reference.util-pojson.jar=../../../libs.jerig/external/util-pojson.jar
  206.49 -file.reference.util-strast.jar=../../../libs.jerig/external/util-strast.jar
  206.50 -includes=**
  206.51 -jar.compress=false
  206.52 -javac.classpath=\
  206.53 -    ${reference.type_web_api.jar}:\
  206.54 -    ${reference.base_web_api.jar}:\
  206.55 -    ${libs.jersey.classpath}:\
  206.56 -    ${libs.javac.classpath}:\
  206.57 -    ${libs.freemarker.classpath}:\
  206.58 -    ${libs.lucene.classpath}:\
  206.59 -    ${file.reference.org-netbeans-modules-versioning-system-cvss.jar}:\
  206.60 -    ${file.reference.org-netbeans-modules-versioning-util.jar}:\
  206.61 -    ${file.reference.org-netbeans-modules-versioning-indexingbridge.jar}:\
  206.62 -    ${file.reference.org-netbeans-modules-versioning.jar}:\
  206.63 -    ${file.reference.org-netbeans-modules-parsing-api.jar}:\
  206.64 -    ${file.reference.org-netbeans-modules-masterfs.jar}:\
  206.65 -    ${file.reference.org-netbeans-modules-java-source.jar}:\
  206.66 -    ${file.reference.org-openide-util.jar}:\
  206.67 -    ${file.reference.org-openide-util-lookup.jar}:\
  206.68 -    ${file.reference.org-netbeans-spi-editor-hints.jar}:\
  206.69 -    ${file.reference.org-netbeans-api-java-classpath.jar}:\
  206.70 -    ${file.reference.org-netbeans-modules-java-hints.jar}:\
  206.71 -    ${file.reference.org-netbeans-modules-jumpto.jar}:\
  206.72 -    ${file.reference.org-netbeans-modules-projectapi.jar}:\
  206.73 -    ${file.reference.org-netbeans-modules-parsing-lucene.jar}:\
  206.74 -    ${file.reference.org-openide-filesystems.jar}:\
  206.75 -    ${file.reference.org-netbeans-modules-java-project.jar}:\
  206.76 -    ${file.reference.org-netbeans-modules-sendopts.jar}:\
  206.77 -    ${file.reference.util-commons.jar}:\
  206.78 -    ${file.reference.util-lutz.jar}:\
  206.79 -    ${file.reference.util-pojson.jar}:\
  206.80 -    ${file.reference.util-strast.jar}
  206.81 -# Space-separated list of extra javac options
  206.82 -javac.compilerargs=
  206.83 -javac.deprecation=false
  206.84 -javac.processorpath=\
  206.85 -    ${javac.classpath}
  206.86 -javac.source=1.6
  206.87 -javac.target=1.6
  206.88 -javac.test.classpath=\
  206.89 -    ${javac.classpath}:\
  206.90 -    ${build.classes.dir}:\
  206.91 -    ${libs.junit.classpath}
  206.92 -javac.test.processorpath=\
  206.93 -    ${javac.test.classpath}
  206.94 -javadoc.additionalparam=
  206.95 -javadoc.author=false
  206.96 -javadoc.encoding=${source.encoding}
  206.97 -javadoc.noindex=false
  206.98 -javadoc.nonavbar=false
  206.99 -javadoc.notree=false
 206.100 -javadoc.private=false
 206.101 -javadoc.splitindex=true
 206.102 -javadoc.use=true
 206.103 -javadoc.version=false
 206.104 -javadoc.windowtitle=
 206.105 -main.class=web.main.WebMain
 206.106 -manifest.file=manifest.mf
 206.107 -meta.inf.dir=${src.dir}/META-INF
 206.108 -mkdist.disabled=false
 206.109 -platform.active=default_platform
 206.110 -project.base_web_api=../base.web.api
 206.111 -project.type_web_api=../type.web.api
 206.112 -reference.base_web_api.jar=${project.base_web_api}/dist/base.web.api.jar
 206.113 -reference.type_web_api.jar=${project.type_web_api}/dist/type.web.api.jar
 206.114 -run.classpath=\
 206.115 -    ${javac.classpath}:\
 206.116 -    ${build.classes.dir}
 206.117 -# Space-separated list of JVM arguments used when running the project
 206.118 -# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
 206.119 -# or test-sys-prop.name=value to set system properties for unit tests):
 206.120 -run.jvmargs=
 206.121 -run.test.classpath=\
 206.122 -    ${javac.test.classpath}:\
 206.123 -    ${build.test.classes.dir}
 206.124 -source.encoding=UTF-8
 206.125 -src.dir=src
 206.126 -test.src.dir=test
   207.1 --- a/server/backend/web.main/nbproject/project.xml	Wed Jun 22 12:05:27 2011 +0200
   207.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   207.3 @@ -1,36 +0,0 @@
   207.4 -<?xml version="1.0" encoding="UTF-8"?>
   207.5 -<project xmlns="http://www.netbeans.org/ns/project/1">
   207.6 -    <type>org.netbeans.modules.java.j2seproject</type>
   207.7 -    <configuration>
   207.8 -        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
   207.9 -            <name>web.main</name>
  207.10 -            <source-roots>
  207.11 -                <root id="src.dir"/>
  207.12 -            </source-roots>
  207.13 -            <test-roots>
  207.14 -                <root id="test.src.dir"/>
  207.15 -            </test-roots>
  207.16 -        </data>
  207.17 -        <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
  207.18 -            <definitions>../../lib/nblibraries.properties</definitions>
  207.19 -        </libraries>
  207.20 -        <references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
  207.21 -            <reference>
  207.22 -                <foreign-project>base_web_api</foreign-project>
  207.23 -                <artifact-type>jar</artifact-type>
  207.24 -                <script>build.xml</script>
  207.25 -                <target>jar</target>
  207.26 -                <clean-target>clean</clean-target>
  207.27 -                <id>jar</id>
  207.28 -            </reference>
  207.29 -            <reference>
  207.30 -                <foreign-project>type_web_api</foreign-project>
  207.31 -                <artifact-type>jar</artifact-type>
  207.32 -                <script>build.xml</script>
  207.33 -                <target>jar</target>
  207.34 -                <clean-target>clean</clean-target>
  207.35 -                <id>jar</id>
  207.36 -            </reference>
  207.37 -        </references>
  207.38 -    </configuration>
  207.39 -</project>
   208.1 --- a/server/backend/web.main/src/web/main/MainPage.java	Wed Jun 22 12:05:27 2011 +0200
   208.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   208.3 @@ -1,60 +0,0 @@
   208.4 -/*
   208.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   208.6 - *
   208.7 - * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
   208.8 - *
   208.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  208.10 - * Other names may be trademarks of their respective owners.
  208.11 - *
  208.12 - * The contents of this file are subject to the terms of either the GNU
  208.13 - * General Public License Version 2 only ("GPL") or the Common
  208.14 - * Development and Distribution License("CDDL") (collectively, the
  208.15 - * "License"). You may not use this file except in compliance with the
  208.16 - * License. You can obtain a copy of the License at
  208.17 - * http://www.netbeans.org/cddl-gplv2.html
  208.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  208.19 - * specific language governing permissions and limitations under the
  208.20 - * License.  When distributing the software, include this License Header
  208.21 - * Notice in each file and include the License file at
  208.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  208.23 - * particular file as subject to the "Classpath" exception as provided
  208.24 - * by Oracle in the GPL Version 2 section of the License file that
  208.25 - * accompanied this code. If applicable, add the following below the
  208.26 - * License Header, with the fields enclosed by brackets [] replaced by
  208.27 - * your own identifying information:
  208.28 - * "Portions Copyrighted [year] [name of copyright owner]"
  208.29 - *
  208.30 - * If you wish your version of this file to be governed by only the CDDL
  208.31 - * or only the GPL Version 2, indicate your decision by adding
  208.32 - * "[Contributor] elects to include this software in this distribution
  208.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  208.34 - * single choice of license, a recipient has the option to distribute
  208.35 - * your version of this file under either the CDDL, the GPL Version 2 or
  208.36 - * to extend the choice of license to its licensees as provided above.
  208.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  208.38 - * Version 2 license, then the option applies only if the new code is
  208.39 - * made subject to such option by the copyright holder.
  208.40 - *
  208.41 - * Contributor(s):
  208.42 - *
  208.43 - * Portions Copyrighted 2011 Sun Microsystems, Inc.
  208.44 - */
  208.45 -
  208.46 -package web.main;
  208.47 -
  208.48 -import javax.ws.rs.GET;
  208.49 -import javax.ws.rs.Path;
  208.50 -
  208.51 -/**
  208.52 - *
  208.53 - * @author lahvac
  208.54 - */
  208.55 -@Path("/")
  208.56 -public class MainPage {
  208.57 -
  208.58 -    @GET
  208.59 -    public String main() {
  208.60 -        //XXX: should be constructed automatically from installed plugins
  208.61 -        return "<html><body><ul><li><a href='index/type/ui/search'>Search Type</a></li></ul></body></html>";
  208.62 -    }
  208.63 -}
   209.1 --- a/server/backend/web.main/src/web/main/WebMain.java	Wed Jun 22 12:05:27 2011 +0200
   209.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   209.3 @@ -1,100 +0,0 @@
   209.4 -/*
   209.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   209.6 - *
   209.7 - * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
   209.8 - *
   209.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  209.10 - * Other names may be trademarks of their respective owners.
  209.11 - *
  209.12 - * The contents of this file are subject to the terms of either the GNU
  209.13 - * General Public License Version 2 only ("GPL") or the Common
  209.14 - * Development and Distribution License("CDDL") (collectively, the
  209.15 - * "License"). You may not use this file except in compliance with the
  209.16 - * License. You can obtain a copy of the License at
  209.17 - * http://www.netbeans.org/cddl-gplv2.html
  209.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  209.19 - * specific language governing permissions and limitations under the
  209.20 - * License.  When distributing the software, include this License Header
  209.21 - * Notice in each file and include the License file at
  209.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  209.23 - * particular file as subject to the "Classpath" exception as provided
  209.24 - * by Oracle in the GPL Version 2 section of the License file that
  209.25 - * accompanied this code. If applicable, add the following below the
  209.26 - * License Header, with the fields enclosed by brackets [] replaced by
  209.27 - * your own identifying information:
  209.28 - * "Portions Copyrighted [year] [name of copyright owner]"
  209.29 - *
  209.30 - * If you wish your version of this file to be governed by only the CDDL
  209.31 - * or only the GPL Version 2, indicate your decision by adding
  209.32 - * "[Contributor] elects to include this software in this distribution
  209.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  209.34 - * single choice of license, a recipient has the option to distribute
  209.35 - * your version of this file under either the CDDL, the GPL Version 2 or
  209.36 - * to extend the choice of license to its licensees as provided above.
  209.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  209.38 - * Version 2 license, then the option applies only if the new code is
  209.39 - * made subject to such option by the copyright holder.
  209.40 - *
  209.41 - * Contributor(s):
  209.42 - *
  209.43 - * Portions Copyrighted 2011 Sun Microsystems, Inc.
  209.44 - */
  209.45 -package web.main;
  209.46 -
  209.47 -import com.sun.grizzly.http.embed.GrizzlyWebServer;
  209.48 -import com.sun.grizzly.http.servlet.ServletAdapter;
  209.49 -import com.sun.grizzly.tcp.http11.GrizzlyAdapter;
  209.50 -import com.sun.grizzly.tcp.http11.GrizzlyRequest;
  209.51 -import com.sun.grizzly.tcp.http11.GrizzlyResponse;
  209.52 -import com.sun.jersey.spi.container.servlet.ServletContainer;
  209.53 -import java.io.File;
  209.54 -import java.io.IOException;
  209.55 -import java.net.URL;
  209.56 -import org.netbeans.modules.jackpot30.backend.base.CategoryStorage;
  209.57 -import org.netbeans.modules.jackpot30.backend.base.RelStreamHandlerFactory;
  209.58 -
  209.59 -/**
  209.60 - *
  209.61 - * @author lahvac
  209.62 - */
  209.63 -public class WebMain {
  209.64 -
  209.65 -    /**
  209.66 -     * @param args the command line arguments
  209.67 -     */
  209.68 -    public static void main(String... args) throws IOException {
  209.69 -        if (args.length != 1 && args.length != 2) {
  209.70 -            System.err.println("Usage: java -jar " + WebMain.class.getProtectionDomain().getCodeSource().getLocation().getPath() + " <cache> [<static-content>]");
  209.71 -            return ;
  209.72 -        }
  209.73 -
  209.74 -        CategoryStorage.setCacheRoot(new File(args[0]));
  209.75 -        
  209.76 -//        org.netbeans.ProxyURLStreamHandlerFactory.register();
  209.77 -        URL.setURLStreamHandlerFactory(new RelStreamHandlerFactory());
  209.78 -        
  209.79 -        GrizzlyWebServer gws;
  209.80 -
  209.81 -        if (args.length == 2) {
  209.82 -            gws = new GrizzlyWebServer(9998, args[1]);
  209.83 -        } else {
  209.84 -            gws = new GrizzlyWebServer(9998);
  209.85 -        }
  209.86 -
  209.87 -        // Jersey web resources
  209.88 -        ServletAdapter jerseyAdapter = new ServletAdapter();
  209.89 -        jerseyAdapter.addInitParameter("com.sun.jersey.config.property.packages", "org.netbeans.modules.jackpot30");
  209.90 -//        jerseyAdapter.setContextPath("/");
  209.91 -        jerseyAdapter.setServletInstance(new ServletContainer());
  209.92 -
  209.93 -        // register all above defined adapters
  209.94 -        gws.addGrizzlyAdapter(jerseyAdapter);
  209.95 -        gws.addGrizzlyAdapter(new GrizzlyAdapter(){
  209.96 -            public void service(GrizzlyRequest request, GrizzlyResponse response){}
  209.97 -        });
  209.98 -
  209.99 -        // let Grizzly run
 209.100 -        gws.start();
 209.101 -    }
 209.102 -
 209.103 -}
   210.1 --- a/server/hudson/pom.xml	Wed Jun 22 12:05:27 2011 +0200
   210.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   210.3 @@ -1,48 +0,0 @@
   210.4 -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   210.5 -  <modelVersion>4.0.0</modelVersion>
   210.6 -  <name>Jackpot 3.0 Hudson Plugin</name>
   210.7 -  <parent>
   210.8 -    <groupId>org.jvnet.hudson.plugins</groupId>
   210.9 -    <artifactId>plugin</artifactId>
  210.10 -    <version>1.343</version><!-- which version of Hudson is this plugin built against? -->
  210.11 -    <relativePath>../pom.xml</relativePath>
  210.12 -  </parent>
  210.13 -
  210.14 -  <groupId>org.netbeans.modules.jackpot30.hudson</groupId>
  210.15 -  <artifactId>org.netbeans.modules.jackpot30.hudson</artifactId>
  210.16 -  <version>1.0-SNAPSHOT</version>
  210.17 -  <packaging>hpi</packaging>
  210.18 -
  210.19 -  <!-- get every artifact through maven.glassfish.org, which proxies all the artifacts that we need -->
  210.20 -  <repositories>
  210.21 -    <repository>
  210.22 -      <id>m.g.o-public</id>
  210.23 -      <url>http://maven.glassfish.org/content/groups/public/</url>
  210.24 -    </repository>
  210.25 -  </repositories>
  210.26 -
  210.27 -  <pluginRepositories>
  210.28 -    <pluginRepository>
  210.29 -      <id>m.g.o-public</id>
  210.30 -      <url>http://maven.glassfish.org/content/groups/public/</url>
  210.31 -    </pluginRepository>
  210.32 -  </pluginRepositories>
  210.33 -
  210.34 -  <build>
  210.35 -    <plugins>
  210.36 -      <plugin>
  210.37 -        <groupId>org.jvnet.hudson.tools</groupId>
  210.38 -        <artifactId>maven-hpi-plugin</artifactId>
  210.39 -        <version>1.48</version>
  210.40 -        <configuration>
  210.41 -          <webResources>
  210.42 -            <resource>
  210.43 -              <directory>data</directory>
  210.44 -            </resource>
  210.45 -          </webResources>
  210.46 -        </configuration>
  210.47 -      </plugin>
  210.48 -    </plugins>
  210.49 -  </build>
  210.50 -
  210.51 -</project>
   211.1 --- a/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/Cache.java	Wed Jun 22 12:05:27 2011 +0200
   211.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   211.3 @@ -1,206 +0,0 @@
   211.4 -/*
   211.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   211.6 - *
   211.7 - * Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.
   211.8 - *
   211.9 - * The contents of this file are subject to the terms of either the GNU
  211.10 - * General Public License Version 2 only ("GPL") or the Common
  211.11 - * Development and Distribution License("CDDL") (collectively, the
  211.12 - * "License"). You may not use this file except in compliance with the
  211.13 - * License. You can obtain a copy of the License at
  211.14 - * http://www.netbeans.org/cddl-gplv2.html
  211.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  211.16 - * specific language governing permissions and limitations under the
  211.17 - * License.  When distributing the software, include this License Header
  211.18 - * Notice in each file and include the License file at
  211.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  211.20 - * particular file as subject to the "Classpath" exception as provided
  211.21 - * by Sun in the GPL Version 2 section of the License file that
  211.22 - * accompanied this code. If applicable, add the following below the
  211.23 - * License Header, with the fields enclosed by brackets [] replaced by
  211.24 - * your own identifying information:
  211.25 - * "Portions Copyrighted [year] [name of copyright owner]"
  211.26 - *
  211.27 - * If you wish your version of this file to be governed by only the CDDL
  211.28 - * or only the GPL Version 2, indicate your decision by adding
  211.29 - * "[Contributor] elects to include this software in this distribution
  211.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  211.31 - * single choice of license, a recipient has the option to distribute
  211.32 - * your version of this file under either the CDDL, the GPL Version 2 or
  211.33 - * to extend the choice of license to its licensees as provided above.
  211.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  211.35 - * Version 2 license, then the option applies only if the new code is
  211.36 - * made subject to such option by the copyright holder.
  211.37 - *
  211.38 - * Contributor(s):
  211.39 - *
  211.40 - * Portions Copyrighted 1997-2009 Sun Microsystems, Inc.
  211.41 - */
  211.42 -package org.netbeans.modules.jackpot30.hudson;
  211.43 -
  211.44 -import java.io.File;
  211.45 -import java.io.FileInputStream;
  211.46 -import java.io.FileOutputStream;
  211.47 -import java.io.IOException;
  211.48 -import java.io.InputStream;
  211.49 -import java.io.OutputStream;
  211.50 -import java.net.URI;
  211.51 -import java.net.URISyntaxException;
  211.52 -import java.net.URL;
  211.53 -import java.util.HashMap;
  211.54 -import java.util.LinkedList;
  211.55 -import java.util.List;
  211.56 -import java.util.Map;
  211.57 -import java.util.Map.Entry;
  211.58 -import java.util.Properties;
  211.59 -import java.util.logging.Level;
  211.60 -import java.util.logging.Logger;
  211.61 -
  211.62 -/**
  211.63 - *
  211.64 - * @author lahvac
  211.65 - */
  211.66 -public class Cache {
  211.67 -
  211.68 -    public static final int VERSION = 1;
  211.69 -
  211.70 -    private static File standaloneCacheRoot;
  211.71 -    private static Map<String, Cache> name2Cache = new HashMap<String, Cache>();
  211.72 -
  211.73 -    public static Cache findCache(String indexName, int version) {
  211.74 -        Cache cache = name2Cache.get(indexName);
  211.75 -
  211.76 -        if (cache == null) {
  211.77 -            name2Cache.put(indexName, cache = new Cache(indexName, version));
  211.78 -        }
  211.79 -
  211.80 -        return cache;
  211.81 -    }
  211.82 -
  211.83 -    private final String name;
  211.84 -    private final int version;
  211.85 -
  211.86 -    private Cache(String name, int version) {
  211.87 -        this.name = name;
  211.88 -        this.version = version;
  211.89 -    }
  211.90 -    
  211.91 -    public File findCacheRoot(URL sourceRoot) throws IOException {
  211.92 -        try {
  211.93 -            sourceRoot = sourceRoot.toURI().normalize().toURL();
  211.94 -        } catch (URISyntaxException ex) {
  211.95 -            Logger.getLogger(Cache.class.getName()).log(Level.SEVERE, null, ex);
  211.96 -        }
  211.97 -        if (standaloneCacheRoot != null) {
  211.98 -            return getDataFolder(sourceRoot, name, version);
  211.99 -        } else {
 211.100 -            throw new IllegalStateException();
 211.101 -        }
 211.102 -    }
 211.103 -
 211.104 -    public static void setStandaloneCacheRoot(File standaloneCacheRoot) {
 211.105 -        Cache.standaloneCacheRoot = standaloneCacheRoot;
 211.106 -    }
 211.107 -
 211.108 -
 211.109 -    private static Properties segments;
 211.110 -    private static long lastSegmentsTimeStamp = -1;
 211.111 -    private static Map<String, String> invertedSegments;
 211.112 -    private static int index = 0;
 211.113 -
 211.114 -    private static final String SEGMENTS_FILE = "segments";      //NOI18N
 211.115 -    private static final String SLICE_PREFIX = "s";              //NOI18N
 211.116 -
 211.117 -    private static void loadSegments () throws IOException {
 211.118 -        final File folder = standaloneCacheRoot;
 211.119 -        assert folder != null;
 211.120 -        final File segmentsFile = new File(folder, SEGMENTS_FILE);
 211.121 -
 211.122 -        if (lastSegmentsTimeStamp != segmentsFile.lastModified()) {
 211.123 -            lastSegmentsTimeStamp = segmentsFile.lastModified();
 211.124 -            segments = null;
 211.125 -        }
 211.126 -
 211.127 -        if (segments == null) {
 211.128 -            segments = new Properties ();
 211.129 -            invertedSegments = new HashMap<String,String> ();
 211.130 -            if (segmentsFile.canRead()) {
 211.131 -                final InputStream in = new FileInputStream(segmentsFile);
 211.132 -                try {
 211.133 -                    segments.load (in);
 211.134 -                } finally {
 211.135 -                    in.close();
 211.136 -                }
 211.137 -            }
 211.138 -            for (Entry<Object, Object> entry : segments.entrySet()) {
 211.139 -                String segment = (String) entry.getKey();
 211.140 -                String root = (String) entry.getValue();
 211.141 -                invertedSegments.put(root,segment);
 211.142 -                try {
 211.143 -                    index = Math.max (index,Integer.parseInt(segment.substring(SLICE_PREFIX.length())));
 211.144 -                } catch (NumberFormatException nfe) {
 211.145 -                    throw new IllegalStateException(nfe); //TODO: maybe just log the exception?
 211.146 -                }
 211.147 -            }
 211.148 -        }
 211.149 -    }
 211.150 -
 211.151 -    public static synchronized Iterable<? extends String> knownSourceRoots() throws IOException {
 211.152 -        loadSegments();
 211.153 -
 211.154 -        List<String> known = new LinkedList<String>();
 211.155 -        
 211.156 -        for (String segment : segments.stringPropertyNames()) {
 211.157 -            known.add(segment);
 211.158 -        }
 211.159 -
 211.160 -        return known;
 211.161 -    }
 211.162 -
 211.163 -    public static synchronized File sourceRootForKey(String segment) throws IOException {
 211.164 -        loadSegments();
 211.165 -
 211.166 -        try {
 211.167 -            return new File(new File(new URI(segments.getProperty(segment))).getAbsolutePath());
 211.168 -        } catch (URISyntaxException ex) {
 211.169 -            throw new IOException(ex);
 211.170 -        }
 211.171 -    }
 211.172 -
 211.173 -
 211.174 -    private static void storeSegments () throws IOException {
 211.175 -        final File folder = standaloneCacheRoot;
 211.176 -        assert folder != null;
 211.177 -        final File segmentsFile = new File(folder, SEGMENTS_FILE);
 211.178 -        segmentsFile.getParentFile().mkdirs();
 211.179 -        final OutputStream out = new FileOutputStream(segmentsFile);
 211.180 -        try {
 211.181 -            segments.store(out,null);
 211.182 -        } finally {
 211.183 -            out.close();
 211.184 -        }
 211.185 -    }
 211.186 -
 211.187 -    private static synchronized File getDataFolder (final URL root, String name, int version) throws IOException {
 211.188 -        loadSegments ();
 211.189 -        final String rootName = root.toExternalForm();
 211.190 -        String slice = invertedSegments.get (rootName);
 211.191 -        if ( slice == null) {
 211.192 -            slice = SLICE_PREFIX + (++index);
 211.193 -            while (segments.getProperty(slice) != null) {
 211.194 -                slice = SLICE_PREFIX + (++index);
 211.195 -            }
 211.196 -            segments.put (slice,rootName);
 211.197 -            invertedSegments.put(rootName, slice);
 211.198 -            storeSegments ();
 211.199 -        }
 211.200 -        final File folder = standaloneCacheRoot;
 211.201 -        return new File(new File(new File(folder, slice), name), Integer.toString(version));
 211.202 -    }
 211.203 -
 211.204 -    private static synchronized File getCacheFolder () {
 211.205 -        return standaloneCacheRoot;
 211.206 -    }
 211.207 -
 211.208 -
 211.209 -}
   212.1 --- a/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/ClearIndexProperty.java	Wed Jun 22 12:05:27 2011 +0200
   212.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   212.3 @@ -1,131 +0,0 @@
   212.4 -/*
   212.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   212.6 - *
   212.7 - * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
   212.8 - *
   212.9 - * The contents of this file are subject to the terms of either the GNU
  212.10 - * General Public License Version 2 only ("GPL") or the Common
  212.11 - * Development and Distribution License("CDDL") (collectively, the
  212.12 - * "License"). You may not use this file except in compliance with the
  212.13 - * License. You can obtain a copy of the License at
  212.14 - * http://www.netbeans.org/cddl-gplv2.html
  212.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  212.16 - * specific language governing permissions and limitations under the
  212.17 - * License.  When distributing the software, include this License Header
  212.18 - * Notice in each file and include the License file at
  212.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  212.20 - * particular file as subject to the "Classpath" exception as provided
  212.21 - * by Sun in the GPL Version 2 section of the License file that
  212.22 - * accompanied this code. If applicable, add the following below the
  212.23 - * License Header, with the fields enclosed by brackets [] replaced by
  212.24 - * your own identifying information:
  212.25 - * "Portions Copyrighted [year] [name of copyright owner]"
  212.26 - *
  212.27 - * If you wish your version of this file to be governed by only the CDDL
  212.28 - * or only the GPL Version 2, indicate your decision by adding
  212.29 - * "[Contributor] elects to include this software in this distribution
  212.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  212.31 - * single choice of license, a recipient has the option to distribute
  212.32 - * your version of this file under either the CDDL, the GPL Version 2 or
  212.33 - * to extend the choice of license to its licensees as provided above.
  212.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  212.35 - * Version 2 license, then the option applies only if the new code is
  212.36 - * made subject to such option by the copyright holder.
  212.37 - *
  212.38 - * Contributor(s):
  212.39 - *
  212.40 - * Portions Copyrighted 2010 Sun Microsystems, Inc.
  212.41 - */
  212.42 -
  212.43 -package org.netbeans.modules.jackpot30.hudson;
  212.44 -
  212.45 -import hudson.Extension;
  212.46 -import hudson.model.Action;
  212.47 -import hudson.model.Hudson;
  212.48 -import hudson.model.Job;
  212.49 -import hudson.model.JobProperty;
  212.50 -import hudson.model.JobPropertyDescriptor;
  212.51 -import hudson.model.Project;
  212.52 -import java.io.File;
  212.53 -import java.io.IOException;
  212.54 -import java.util.Collection;
  212.55 -import java.util.Collections;
  212.56 -import javax.servlet.ServletException;
  212.57 -import net.sf.json.JSONObject;
  212.58 -import org.kohsuke.stapler.StaplerRequest;
  212.59 -import org.kohsuke.stapler.StaplerResponse;
  212.60 -
  212.61 -/**
  212.62 - *
  212.63 - * @author lahvac
  212.64 - */
  212.65 -public class ClearIndexProperty extends JobProperty<Job<?, ?>> {
  212.66 -    
  212.67 -    @Override
  212.68 -    public Collection<? extends Action> getJobActions(Job<?, ?> job) {
  212.69 -        return Collections.singleton(new ClearIndexAction(job));
  212.70 -    }
  212.71 -
  212.72 -    public static final class ClearIndexAction implements Action {
  212.73 -
  212.74 -        private final Job<?, ?> job;
  212.75 -
  212.76 -        public ClearIndexAction(Job<?, ?> job) {
  212.77 -            this.job = job;
  212.78 -        }
  212.79 -
  212.80 -        public String getIconFileName() {
  212.81 -            return "folder-delete.gif";
  212.82 -        }
  212.83 -
  212.84 -        public String getDisplayName() {
  212.85 -            return "Clear Indices";
  212.86 -        }
  212.87 -
  212.88 -        public String getUrlName() {
  212.89 -            return "clearIndex";
  212.90 -        }
  212.91 -
  212.92 -        public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, InterruptedException {
  212.93 -            String jobName = job.getName();
  212.94 -            Project<?, ?> prj = Hudson.getInstance().getItemByFullName(jobName, Project.class);
  212.95 -            File cacheRoot = Cache.findCache("clear-workspace", 0).findCacheRoot(prj.getSomeWorkspace().toURI().toURL()).getParentFile().getParentFile();
  212.96 -
  212.97 -            deleteRecursivelly(cacheRoot);
  212.98 -            
  212.99 -            rsp.forwardToPreviousPage(req);
 212.100 -        }
 212.101 -
 212.102 -        private static void deleteRecursivelly(File f) {
 212.103 -            File[] files = f.listFiles();
 212.104 -
 212.105 -            if (files != null) {
 212.106 -                for (File c : files) {
 212.107 -                    deleteRecursivelly(c);
 212.108 -                }
 212.109 -            }
 212.110 -
 212.111 -            f.delete();
 212.112 -        }
 212.113 -    }
 212.114 -
 212.115 -    @Extension // this marker indicates Hudson that this is an implementation of an extension point.
 212.116 -    public static final class ClearIndexPropertyDescription extends JobPropertyDescriptor  {
 212.117 -
 212.118 -        @Override
 212.119 -        public JobProperty<?> newInstance(StaplerRequest req, JSONObject formData) throws FormException {
 212.120 -            return new ClearIndexProperty();
 212.121 -        }
 212.122 -
 212.123 -        @Override
 212.124 -        public String getDisplayName() {
 212.125 -            return "Clear Indices Desc";
 212.126 -        }
 212.127 -
 212.128 -        @Override
 212.129 -        public boolean isApplicable(Class<? extends Job> jobType) {
 212.130 -            return Project.class.isAssignableFrom(jobType);
 212.131 -        }
 212.132 -
 212.133 -    }
 212.134 -}
   213.1 --- a/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/IndexingBuilder.java	Wed Jun 22 12:05:27 2011 +0200
   213.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   213.3 @@ -1,340 +0,0 @@
   213.4 -/*
   213.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   213.6 - *
   213.7 - * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
   213.8 - *
   213.9 - * The contents of this file are subject to the terms of either the GNU
  213.10 - * General Public License Version 2 only ("GPL") or the Common
  213.11 - * Development and Distribution License("CDDL") (collectively, the
  213.12 - * "License"). You may not use this file except in compliance with the
  213.13 - * License. You can obtain a copy of the License at
  213.14 - * http://www.netbeans.org/cddl-gplv2.html
  213.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  213.16 - * specific language governing permissions and limitations under the
  213.17 - * License.  When distributing the software, include this License Header
  213.18 - * Notice in each file and include the License file at
  213.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  213.20 - * particular file as subject to the "Classpath" exception as provided
  213.21 - * by Sun in the GPL Version 2 section of the License file that
  213.22 - * accompanied this code. If applicable, add the following below the
  213.23 - * License Header, with the fields enclosed by brackets [] replaced by
  213.24 - * your own identifying information:
  213.25 - * "Portions Copyrighted [year] [name of copyright owner]"
  213.26 - *
  213.27 - * If you wish your version of this file to be governed by only the CDDL
  213.28 - * or only the GPL Version 2, indicate your decision by adding
  213.29 - * "[Contributor] elects to include this software in this distribution
  213.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  213.31 - * single choice of license, a recipient has the option to distribute
  213.32 - * your version of this file under either the CDDL, the GPL Version 2 or
  213.33 - * to extend the choice of license to its licensees as provided above.
  213.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  213.35 - * Version 2 license, then the option applies only if the new code is
  213.36 - * made subject to such option by the copyright holder.
  213.37 - *
  213.38 - * Contributor(s):
  213.39 - *
  213.40 - * Portions Copyrighted 2010 Sun Microsystems, Inc.
  213.41 - */
  213.42 -
  213.43 -package org.netbeans.modules.jackpot30.hudson;
  213.44 -
  213.45 -import hudson.Extension;
  213.46 -import hudson.FilePath;
  213.47 -import hudson.Launcher;
  213.48 -import hudson.Proc;
  213.49 -import hudson.model.AbstractBuild;
  213.50 -import hudson.model.BuildListener;
  213.51 -import hudson.model.Descriptor;
  213.52 -import hudson.model.Descriptor.FormException;
  213.53 -import hudson.model.Hudson;
  213.54 -import hudson.remoting.VirtualChannel;
  213.55 -import hudson.scm.ChangeLogSet.AffectedFile;
  213.56 -import hudson.scm.ChangeLogSet.Entry;
  213.57 -import hudson.scm.EditType;
  213.58 -import hudson.tasks.Builder;
  213.59 -import hudson.util.ArgumentListBuilder;
  213.60 -import java.io.BufferedReader;
  213.61 -import java.io.BufferedWriter;
  213.62 -import java.io.File;
  213.63 -import java.io.FileInputStream;
  213.64 -import java.io.FileOutputStream;
  213.65 -import java.io.IOException;
  213.66 -import java.io.InputStreamReader;
  213.67 -import java.io.OutputStreamWriter;
  213.68 -import java.io.Reader;
  213.69 -import java.io.Writer;
  213.70 -import java.net.URI;
  213.71 -import java.net.URL;
  213.72 -import java.util.Arrays;
  213.73 -import java.util.Collection;
  213.74 -import java.util.HashSet;
  213.75 -import java.util.List;
  213.76 -import java.util.Set;
  213.77 -import java.util.logging.Level;
  213.78 -import java.util.logging.Logger;
  213.79 -import net.sf.json.JSONObject;
  213.80 -import net.sf.json.JSONSerializer;
  213.81 -import org.kohsuke.stapler.DataBoundConstructor;
  213.82 -import org.kohsuke.stapler.StaplerRequest;
  213.83 -
  213.84 -/**
  213.85 - *
  213.86 - * @author lahvac
  213.87 - */
  213.88 -public class IndexingBuilder extends Builder {
  213.89 -
  213.90 -    private final String projectName;
  213.91 -    private final String toolName;
  213.92 -    
  213.93 -    public IndexingBuilder(StaplerRequest req, JSONObject json) throws FormException {
  213.94 -        projectName = json.getString("projectName");
  213.95 -        toolName = json.optString("toolName", IndexingTool.DEFAULT_INDEXING_NAME);
  213.96 -    }
  213.97 -
  213.98 -    @DataBoundConstructor
  213.99 -    public IndexingBuilder(String projectName, String toolName) {
 213.100 -        this.projectName = projectName;
 213.101 -        this.toolName = toolName;
 213.102 -    }
 213.103 -
 213.104 -    public String getProjectName() {
 213.105 -        return projectName;
 213.106 -    }
 213.107 -
 213.108 -    public String getToolName() {
 213.109 -        return toolName;
 213.110 -    }
 213.111 -
 213.112 -    @Override
 213.113 -    public DescriptorImpl getDescriptor() {
 213.114 -        return (DescriptorImpl) super.getDescriptor();
 213.115 -    }
 213.116 -
 213.117 -    @Override
 213.118 -    public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
 213.119 -        Set<String> addedFiles = new HashSet<String>();
 213.120 -        Set<String> removedFiles = new HashSet<String>();
 213.121 -
 213.122 -        for (Entry e : build.getChangeSet()) {
 213.123 -            for (AffectedFile f : e.getAffectedFiles()) {
 213.124 -                if (f.getEditType() == EditType.DELETE) {
 213.125 -                    removedFiles.add(stripLeadingSlash(f.getPath()));
 213.126 -                } else {
 213.127 -                    addedFiles.add(stripLeadingSlash(f.getPath()));
 213.128 -                }
 213.129 -            }
 213.130 -        }
 213.131 -
 213.132 -        boolean success = doIndex(getDescriptor().getCacheDir(), build, launcher, listener, addedFiles, removedFiles);
 213.133 -
 213.134 -//        //XXX:
 213.135 -//        File info = new File(Cache.findCache("jackpot30", 1002).findCacheRoot(build.getWorkspace().toURI().toURL()), "info");
 213.136 -//        String jsonContent = readFully(info);
 213.137 -//        JSONObject json = JSONObject.fromObject(jsonContent);
 213.138 -//
 213.139 -//        String prjName = projectName;
 213.140 -//
 213.141 -//        if (prjName == null || prjName.isEmpty()) {
 213.142 -//            prjName = build.getParent().getDisplayName();
 213.143 -//        }
 213.144 -//
 213.145 -//        if (!prjName.equals(json.get("displayName"))) {
 213.146 -//            json.put("displayName", prjName);
 213.147 -//            write(info, JSONSerializer.toJSON(json).toString());
 213.148 -//        }
 213.149 -
 213.150 -        return success;
 213.151 -    }
 213.152 -
 213.153 -    private static String readFully(File file) throws IOException {
 213.154 -        Reader in = null;
 213.155 -        StringBuilder result = new StringBuilder();
 213.156 -
 213.157 -        try {
 213.158 -            in = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
 213.159 -
 213.160 -            int read;
 213.161 -
 213.162 -            while ((read = in.read()) != (-1)) {
 213.163 -                result.append((char) read);
 213.164 -            }
 213.165 -        } finally {
 213.166 -            if (in != null) {
 213.167 -                try {
 213.168 -                    in.close();
 213.169 -                } catch (IOException ex) {
 213.170 -                    Logger.getLogger(IndexingBuilder.class.getName()).log(Level.SEVERE, null, ex);
 213.171 -                }
 213.172 -            }
 213.173 -        }
 213.174 -
 213.175 -        return result.toString();
 213.176 -    }
 213.177 -
 213.178 -    private static void write(File file, String content) throws IOException {
 213.179 -        Writer out = null;
 213.180 -
 213.181 -        try {
 213.182 -            out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8"));
 213.183 -            out.write(content);
 213.184 -        } finally {
 213.185 -            if (out != null) {
 213.186 -                try {
 213.187 -                    out.close();
 213.188 -                } catch (IOException ex) {
 213.189 -                    Logger.getLogger(IndexingBuilder.class.getName()).log(Level.SEVERE, null, ex);
 213.190 -                }
 213.191 -            }
 213.192 -        }
 213.193 -    }
 213.194 -
 213.195 -    private String stripLeadingSlash(String path) {
 213.196 -        if (path.length() > 0 && path.charAt(0) == '/') {
 213.197 -            return path.substring(1);
 213.198 -        }
 213.199 -
 213.200 -        return path;
 213.201 -    }
 213.202 -
 213.203 -    protected/*tests*/ boolean doIndex(File cacheDir, AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener, Set<String> addedOrModified, Set<String> removed) throws IOException, InterruptedException {
 213.204 -        IndexingTool t = findSelectedTool();
 213.205 -
 213.206 -        if (t == null) {
 213.207 -            listener.getLogger().println("Cannot find indexing tool: " + toolName);
 213.208 -            return false;
 213.209 -        }
 213.210 -
 213.211 -        t = t.forNode(build.getBuiltOn(), listener);
 213.212 -
 213.213 -        RemoteResult res = build.getWorkspace().act(new FilePath.FileCallable<RemoteResult>() {
 213.214 -            public RemoteResult invoke(File file, VirtualChannel vc) throws IOException, InterruptedException {
 213.215 -                Set<String> projects = new HashSet<String>();
 213.216 -
 213.217 -                findProjects(file, projects, new StringBuilder());
 213.218 -
 213.219 -                return new RemoteResult(projects, file.getCanonicalPath()/*XXX: will resolve symlinks!!!*/);
 213.220 -            }
 213.221 -        });
 213.222 -
 213.223 -        listener.getLogger().println("Running: " + toolName + " on projects: " + res);
 213.224 -
 213.225 -        String codeName = build.getParent().getName();
 213.226 -        ArgumentListBuilder args = new ArgumentListBuilder();
 213.227 -        FilePath targetZip = build.getWorkspace().createTempFile(codeName, "zip");
 213.228 -
 213.229 -        //XXX: there should be a way to specify Java runtime!
 213.230 -        args.add(new File(t.getHome(), "index.sh")); //XXX
 213.231 -        args.add(codeName);
 213.232 -        args.add(projectName); //XXX
 213.233 -        args.add(targetZip);
 213.234 -        args.add(res.root);
 213.235 -        args.add(res.foundProjects.toArray(new String[0]));
 213.236 -
 213.237 -        Proc indexer = launcher.launch().pwd(build.getWorkspace())
 213.238 -                                                .cmds(args)
 213.239 -                                                .stdout(listener)
 213.240 -                                                .start();
 213.241 -
 213.242 -        indexer.join();
 213.243 -
 213.244 -        File oldCacheDir = new File(cacheDir, codeName + ".old");
 213.245 -        File segCacheDir = new File(cacheDir, codeName);
 213.246 -        File newCacheDir = new File(cacheDir, codeName + ".new");
 213.247 -
 213.248 -        targetZip.unzip(new FilePath(newCacheDir));
 213.249 -
 213.250 -        segCacheDir.renameTo(oldCacheDir);
 213.251 -
 213.252 -        new File(newCacheDir, codeName).renameTo(segCacheDir);
 213.253 -
 213.254 -        new URL("http://localhost:9998/index/internal/indexUpdated").openStream().close();
 213.255 -
 213.256 -        new FilePath(newCacheDir).deleteRecursive();
 213.257 -        new FilePath(oldCacheDir).deleteRecursive();
 213.258 -
 213.259 -        return true;
 213.260 -    }
 213.261 -
 213.262 -    private void dumpToFile(File target, Set<String> files) throws IOException {
 213.263 -        Writer out = new OutputStreamWriter(new FileOutputStream(target));
 213.264 -
 213.265 -        try {
 213.266 -            for (String f : files) {
 213.267 -                out.write(f);
 213.268 -                out.write("\n");
 213.269 -            }
 213.270 -        } finally {
 213.271 -            out.close();
 213.272 -        }
 213.273 -    }
 213.274 -
 213.275 -    public IndexingTool findSelectedTool() {
 213.276 -        for (IndexingTool t : getDescriptor().getIndexingTools()) {
 213.277 -            if (toolName.equals(t.getName())) return t;
 213.278 -        }
 213.279 -
 213.280 -        return null;
 213.281 -    }
 213.282 -
 213.283 -    private static void findProjects(File root, Collection<String> result, StringBuilder relPath) {
 213.284 -        int len = relPath.length();
 213.285 -        boolean first = relPath.length() == 0;
 213.286 -
 213.287 -        if (new File(root, "nbproject").isDirectory()) result.add(relPath.toString());
 213.288 -
 213.289 -        File[] children = root.listFiles();
 213.290 -
 213.291 -        if (children != null) {
 213.292 -            for (File c : children) {
 213.293 -                if (!first)
 213.294 -                    relPath.append("/");
 213.295 -                relPath.append(c.getName());
 213.296 -                findProjects(c, result, relPath);
 213.297 -                relPath.delete(len, relPath.length());
 213.298 -            }
 213.299 -        }
 213.300 -    }
 213.301 -
 213.302 -    private static final class RemoteResult {
 213.303 -        private final Collection<String> foundProjects;
 213.304 -        private final String root;
 213.305 -        public RemoteResult(Collection<String> foundProjects, String root) {
 213.306 -            this.foundProjects = foundProjects;
 213.307 -            this.root = root;
 213.308 -        }
 213.309 -    }
 213.310 -    
 213.311 -    @Extension // this marker indicates Hudson that this is an implementation of an extension point.
 213.312 -    public static final class DescriptorImpl extends Descriptor<Builder> {
 213.313 -
 213.314 -        private File cacheDir;
 213.315 -
 213.316 -        public DescriptorImpl() {
 213.317 -            Cache.setStandaloneCacheRoot(cacheDir = new File(Hudson.getInstance().getRootDir(), "index").getAbsoluteFile());
 213.318 -        }
 213.319 -
 213.320 -        public File getCacheDir() {
 213.321 -            return cacheDir;
 213.322 -        }
 213.323 -
 213.324 -        @Override
 213.325 -        public Builder newInstance(StaplerRequest req, JSONObject formData) throws FormException {
 213.326 -            return new IndexingBuilder(req, formData);
 213.327 -        }
 213.328 -
 213.329 -        @Override
 213.330 -        public String getDisplayName() {
 213.331 -            return "Run Indexers";
 213.332 -        }
 213.333 -
 213.334 -        public List<? extends IndexingTool> getIndexingTools() {
 213.335 -            return Arrays.asList(Hudson.getInstance().getDescriptorByType(IndexingTool.DescriptorImpl.class).getInstallations());
 213.336 -        }
 213.337 -
 213.338 -        public boolean hasNonStandardIndexingTool() {
 213.339 -            return getIndexingTools().size() > 1;
 213.340 -        }
 213.341 -    }
 213.342 -
 213.343 -}
   214.1 --- a/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/IndexingTool.java	Wed Jun 22 12:05:27 2011 +0200
   214.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   214.3 @@ -1,100 +0,0 @@
   214.4 -/*
   214.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   214.6 - *
   214.7 - * Copyright 2011 Sun Microsystems, Inc. All rights reserved.
   214.8 - *
   214.9 - * The contents of this file are subject to the terms of either the GNU
  214.10 - * General Public License Version 2 only ("GPL") or the Common
  214.11 - * Development and Distribution License("CDDL") (collectively, the
  214.12 - * "License"). You may not use this file except in compliance with the
  214.13 - * License. You can obtain a copy of the License at
  214.14 - * http://www.netbeans.org/cddl-gplv2.html
  214.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  214.16 - * specific language governing permissions and limitations under the
  214.17 - * License.  When distributing the software, include this License Header
  214.18 - * Notice in each file and include the License file at
  214.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  214.20 - * particular file as subject to the "Classpath" exception as provided
  214.21 - * by Sun in the GPL Version 2 section of the License file that
  214.22 - * accompanied this code. If applicable, add the following below the
  214.23 - * License Header, with the fields enclosed by brackets [] replaced by
  214.24 - * your own identifying information:
  214.25 - * "Portions Copyrighted [year] [name of copyright owner]"
  214.26 - *
  214.27 - * If you wish your version of this file to be governed by only the CDDL
  214.28 - * or only the GPL Version 2, indicate your decision by adding
  214.29 - * "[Contributor] elects to include this software in this distribution
  214.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  214.31 - * single choice of license, a recipient has the option to distribute
  214.32 - * your version of this file under either the CDDL, the GPL Version 2 or
  214.33 - * to extend the choice of license to its licensees as provided above.
  214.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  214.35 - * Version 2 license, then the option applies only if the new code is
  214.36 - * made subject to such option by the copyright holder.
  214.37 - *
  214.38 - * Contributor(s):
  214.39 - *
  214.40 - * Portions Copyrighted 2011 Sun Microsystems, Inc.
  214.41 - */
  214.42 -package org.netbeans.modules.jackpot30.hudson;
  214.43 -
  214.44 -import hudson.Extension;
  214.45 -import hudson.model.Node;
  214.46 -import hudson.model.TaskListener;
  214.47 -import hudson.slaves.NodeSpecific;
  214.48 -import hudson.tools.ToolDescriptor;
  214.49 -import hudson.tools.ToolInstallation;
  214.50 -import hudson.tools.ToolProperty;
  214.51 -import java.io.IOException;
  214.52 -import java.util.List;
  214.53 -import org.kohsuke.stapler.DataBoundConstructor;
  214.54 -
  214.55 -/**
  214.56 - *
  214.57 - * @author lahvac
  214.58 - */
  214.59 -public class IndexingTool extends ToolInstallation implements NodeSpecific<IndexingTool> {
  214.60 -
  214.61 -    public static final String DEFAULT_INDEXING_NAME = "Main NetBeans Indexing";
  214.62 -    
  214.63 -    @DataBoundConstructor
  214.64 -    public IndexingTool(String name, String home, List<? extends ToolProperty<?>> properties) {
  214.65 -        super(name, home, properties);
  214.66 -    }
  214.67 -
  214.68 -    public IndexingTool forNode(Node node, TaskListener tl) throws IOException, InterruptedException {
  214.69 -        return new IndexingTool(getName(), translateFor(node, tl), getProperties().toList());
  214.70 -    }
  214.71 -
  214.72 -    @Extension
  214.73 -    public static final class DescriptorImpl extends ToolDescriptor<IndexingTool> {
  214.74 -
  214.75 -        @Override
  214.76 -        public String getDisplayName() {
  214.77 -            return "Indexing Tool";
  214.78 -        }
  214.79 -
  214.80 -        private IndexingTool[] installations;
  214.81 -
  214.82 -        @Override
  214.83 -        public IndexingTool[] getInstallations() {
  214.84 -            if (installations == null) {
  214.85 -                load();
  214.86 -
  214.87 -                if (installations == null) {
  214.88 -                    installations = new IndexingTool[0];
  214.89 -                }
  214.90 -            }
  214.91 -
  214.92 -            return installations.clone();
  214.93 -        }
  214.94 -
  214.95 -        @Override
  214.96 -        public void setInstallations(IndexingTool... installations) {
  214.97 -            this.installations = installations.clone();
  214.98 -            save();
  214.99 -        }
 214.100 -
 214.101 -
 214.102 -    }
 214.103 -}
   215.1 --- a/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/InstallIndexingTool.java	Wed Jun 22 12:05:27 2011 +0200
   215.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   215.3 @@ -1,103 +0,0 @@
   215.4 -/*
   215.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   215.6 - *
   215.7 - * Copyright 2011 Sun Microsystems, Inc. All rights reserved.
   215.8 - *
   215.9 - * The contents of this file are subject to the terms of either the GNU
  215.10 - * General Public License Version 2 only ("GPL") or the Common
  215.11 - * Development and Distribution License("CDDL") (collectively, the
  215.12 - * "License"). You may not use this file except in compliance with the
  215.13 - * License. You can obtain a copy of the License at
  215.14 - * http://www.netbeans.org/cddl-gplv2.html
  215.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  215.16 - * specific language governing permissions and limitations under the
  215.17 - * License.  When distributing the software, include this License Header
  215.18 - * Notice in each file and include the License file at
  215.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  215.20 - * particular file as subject to the "Classpath" exception as provided
  215.21 - * by Sun in the GPL Version 2 section of the License file that
  215.22 - * accompanied this code. If applicable, add the following below the
  215.23 - * License Header, with the fields enclosed by brackets [] replaced by
  215.24 - * your own identifying information:
  215.25 - * "Portions Copyrighted [year] [name of copyright owner]"
  215.26 - *
  215.27 - * If you wish your version of this file to be governed by only the CDDL
  215.28 - * or only the GPL Version 2, indicate your decision by adding
  215.29 - * "[Contributor] elects to include this software in this distribution
  215.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  215.31 - * single choice of license, a recipient has the option to distribute
  215.32 - * your version of this file under either the CDDL, the GPL Version 2 or
  215.33 - * to extend the choice of license to its licensees as provided above.
  215.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  215.35 - * Version 2 license, then the option applies only if the new code is
  215.36 - * made subject to such option by the copyright holder.
  215.37 - *
  215.38 - * Contributor(s):
  215.39 - *
  215.40 - * Portions Copyrighted 2011 Sun Microsystems, Inc.
  215.41 - */
  215.42 -package org.netbeans.modules.jackpot30.hudson;
  215.43 -
  215.44 -import hudson.Extension;
  215.45 -import hudson.FilePath;
  215.46 -import hudson.init.InitMilestone;
  215.47 -import hudson.init.Initializer;
  215.48 -import hudson.model.Hudson;
  215.49 -import hudson.model.Node;
  215.50 -import hudson.model.TaskListener;
  215.51 -import hudson.tools.DownloadFromUrlInstaller;
  215.52 -import hudson.tools.InstallSourceProperty;
  215.53 -import hudson.tools.ToolInstallation;
  215.54 -import hudson.tools.ToolProperty;
  215.55 -import java.io.IOException;
  215.56 -import java.util.Arrays;
  215.57 -import org.kohsuke.stapler.DataBoundConstructor;
  215.58 -
  215.59 -/**
  215.60 - *
  215.61 - * @author lahvac
  215.62 - */
  215.63 -public class InstallIndexingTool extends DownloadFromUrlInstaller {
  215.64 -
  215.65 -    @DataBoundConstructor
  215.66 -    public InstallIndexingTool(String id) {
  215.67 -        super(id);
  215.68 -    }
  215.69 -
  215.70 -    @Override
  215.71 -    public FilePath performInstallation(ToolInstallation tool, Node node, TaskListener log) throws IOException, InterruptedException {
  215.72 -        return super.performInstallation(tool, node, log);
  215.73 -    }
  215.74 -
  215.75 -    @Extension
  215.76 -    public static class DescriptorImpl extends DownloadFromUrlInstaller.DescriptorImpl<InstallIndexingTool> {
  215.77 -
  215.78 -        @Override
  215.79 -        public String getDisplayName() {
  215.80 -            return "Install from web";
  215.81 -        }
  215.82 -
  215.83 -        @Override
  215.84 -        public boolean isApplicable(Class<? extends ToolInstallation> toolType) {
  215.85 -            return toolType == IndexingTool.class;
  215.86 -        }
  215.87 -
  215.88 -    }
  215.89 -
  215.90 -    //XXX:
  215.91 -    @Initializer(after=InitMilestone.JOB_LOADED)
  215.92 -    public static void prepareUpdates() throws IOException, InterruptedException {
  215.93 -        FilePath update = new FilePath(new FilePath(Hudson.getInstance().getRootPath(), "updates"), "org.netbeans.modules.jackpot30.hudson.InstallIndexingTool");
  215.94 -
  215.95 -        update.copyFrom(InstallIndexingTool.class.getResource("org.netbeans.modules.jackpot30.hudson.InstallIndexingTool"));
  215.96 -
  215.97 -        //preinstall main tool if it does not exist:
  215.98 -        IndexingTool[] tools = Hudson.getInstance().getDescriptorByType(IndexingTool.DescriptorImpl.class).getInstallations();
  215.99 -
 215.100 -        if (tools.length == 0) {
 215.101 -            ToolProperty<ToolInstallation> install = new InstallSourceProperty(Arrays.asList(new InstallIndexingTool("main")));
 215.102 -            Hudson.getInstance().getDescriptorByType(IndexingTool.DescriptorImpl.class).setInstallations(new IndexingTool(IndexingTool.DEFAULT_INDEXING_NAME, "", Arrays.asList(install)));
 215.103 -        }
 215.104 -    }
 215.105 -
 215.106 -}
   216.1 --- a/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/PluginImpl.java	Wed Jun 22 12:05:27 2011 +0200
   216.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   216.3 @@ -1,56 +0,0 @@
   216.4 -/*
   216.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   216.6 - *
   216.7 - * Copyright 2011 Sun Microsystems, Inc. All rights reserved.
   216.8 - *
   216.9 - * The contents of this file are subject to the terms of either the GNU
  216.10 - * General Public License Version 2 only ("GPL") or the Common
  216.11 - * Development and Distribution License("CDDL") (collectively, the
  216.12 - * "License"). You may not use this file except in compliance with the
  216.13 - * License. You can obtain a copy of the License at
  216.14 - * http://www.netbeans.org/cddl-gplv2.html
  216.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  216.16 - * specific language governing permissions and limitations under the
  216.17 - * License.  When distributing the software, include this License Header
  216.18 - * Notice in each file and include the License file at
  216.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  216.20 - * particular file as subject to the "Classpath" exception as provided
  216.21 - * by Sun in the GPL Version 2 section of the License file that
  216.22 - * accompanied this code. If applicable, add the following below the
  216.23 - * License Header, with the fields enclosed by brackets [] replaced by
  216.24 - * your own identifying information:
  216.25 - * "Portions Copyrighted [year] [name of copyright owner]"
  216.26 - *
  216.27 - * If you wish your version of this file to be governed by only the CDDL
  216.28 - * or only the GPL Version 2, indicate your decision by adding
  216.29 - * "[Contributor] elects to include this software in this distribution
  216.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  216.31 - * single choice of license, a recipient has the option to distribute
  216.32 - * your version of this file under either the CDDL, the GPL Version 2 or
  216.33 - * to extend the choice of license to its licensees as provided above.
  216.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  216.35 - * Version 2 license, then the option applies only if the new code is
  216.36 - * made subject to such option by the copyright holder.
  216.37 - *
  216.38 - * Contributor(s):
  216.39 - *
  216.40 - * Portions Copyrighted 2011 Sun Microsystems, Inc.
  216.41 - */
  216.42 -package org.netbeans.modules.jackpot30.hudson;
  216.43 -
  216.44 -import hudson.Plugin;
  216.45 -
  216.46 -/**https://issues.jenkins-ci.org/browse/JENKINS-5427
  216.47 - *
  216.48 - * @author lahvac
  216.49 - */
  216.50 -public class PluginImpl extends Plugin {
  216.51 -
  216.52 -    @Override
  216.53 -    public void postInitialize() throws Exception {
  216.54 -        super.postInitialize();
  216.55 -        InstallIndexingTool.prepareUpdates();
  216.56 -        StartWebFrontEnd.ensureStarted();
  216.57 -    }
  216.58 -
  216.59 -}
   217.1 --- a/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/StartWebFrontEnd.java	Wed Jun 22 12:05:27 2011 +0200
   217.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   217.3 @@ -1,95 +0,0 @@
   217.4 -/*
   217.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   217.6 - *
   217.7 - * Copyright 2011 Sun Microsystems, Inc. All rights reserved.
   217.8 - *
   217.9 - * The contents of this file are subject to the terms of either the GNU
  217.10 - * General Public License Version 2 only ("GPL") or the Common
  217.11 - * Development and Distribution License("CDDL") (collectively, the
  217.12 - * "License"). You may not use this file except in compliance with the
  217.13 - * License. You can obtain a copy of the License at
  217.14 - * http://www.netbeans.org/cddl-gplv2.html
  217.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  217.16 - * specific language governing permissions and limitations under the
  217.17 - * License.  When distributing the software, include this License Header
  217.18 - * Notice in each file and include the License file at
  217.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  217.20 - * particular file as subject to the "Classpath" exception as provided
  217.21 - * by Sun in the GPL Version 2 section of the License file that
  217.22 - * accompanied this code. If applicable, add the following below the
  217.23 - * License Header, with the fields enclosed by brackets [] replaced by
  217.24 - * your own identifying information:
  217.25 - * "Portions Copyrighted [year] [name of copyright owner]"
  217.26 - *
  217.27 - * If you wish your version of this file to be governed by only the CDDL
  217.28 - * or only the GPL Version 2, indicate your decision by adding
  217.29 - * "[Contributor] elects to include this software in this distribution
  217.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  217.31 - * single choice of license, a recipient has the option to distribute
  217.32 - * your version of this file under either the CDDL, the GPL Version 2 or
  217.33 - * to extend the choice of license to its licensees as provided above.
  217.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  217.35 - * Version 2 license, then the option applies only if the new code is
  217.36 - * made subject to such option by the copyright holder.
  217.37 - *
  217.38 - * Contributor(s):
  217.39 - *
  217.40 - * Portions Copyrighted 2011 Sun Microsystems, Inc.
  217.41 - */
  217.42 -package org.netbeans.modules.jackpot30.hudson;
  217.43 -
  217.44 -import hudson.Launcher;
  217.45 -import hudson.Proc;
  217.46 -import hudson.model.Hudson;
  217.47 -import hudson.util.ArgumentListBuilder;
  217.48 -import hudson.util.LogTaskListener;
  217.49 -import java.io.File;
  217.50 -import java.io.FileOutputStream;
  217.51 -import java.io.IOException;
  217.52 -import java.util.logging.Level;
  217.53 -import java.util.logging.Logger;
  217.54 -
  217.55 -/**
  217.56 - *
  217.57 - * @author lahvac
  217.58 - */
  217.59 -public class StartWebFrontEnd {
  217.60 -
  217.61 -    public static boolean disable = false;
  217.62 -
  217.63 -    private static Proc frontend;
  217.64 -
  217.65 -    public static void ensureStarted() {
  217.66 -        if (disable) return ;
  217.67 -        
  217.68 -        try {
  217.69 -            if (frontend != null && frontend.isAlive()) return;
  217.70 -
  217.71 -            IndexingTool[] tools = Hudson.getInstance().getDescriptorByType(IndexingTool.DescriptorImpl.class).getInstallations();
  217.72 -
  217.73 -            if (tools.length == 0) return;
  217.74 -
  217.75 -            File cacheDir = Hudson.getInstance().getDescriptorByType(IndexingBuilder.DescriptorImpl.class).getCacheDir();
  217.76 -
  217.77 -            if (!cacheDir.exists()) {
  217.78 -                cacheDir.mkdirs();
  217.79 -            }
  217.80 -            
  217.81 -            LogTaskListener listener = new LogTaskListener(Logger.global, Level.INFO);
  217.82 -            IndexingTool tool = tools[0].forNode(Hudson.getInstance(), listener);
  217.83 -
  217.84 -            ArgumentListBuilder args = new ArgumentListBuilder();
  217.85 -            Launcher launcher = new Launcher.LocalLauncher(listener);
  217.86 -            args.add(new File(tool.getHome(), "web.sh")); //XXX
  217.87 -            args.add(cacheDir);
  217.88 -
  217.89 -            frontend = launcher.launch().cmds(args)
  217.90 -                                        .stdout(listener)
  217.91 -                                        .start();
  217.92 -        } catch (IOException ex) {
  217.93 -            Logger.getLogger(StartWebFrontEnd.class.getName()).log(Level.SEVERE, null, ex);
  217.94 -        } catch (InterruptedException ex) {
  217.95 -            Logger.getLogger(StartWebFrontEnd.class.getName()).log(Level.SEVERE, null, ex);
  217.96 -        }
  217.97 -    }
  217.98 -}
   218.1 --- a/server/hudson/src/main/resources/index.jelly	Wed Jun 22 12:05:27 2011 +0200
   218.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   218.3 @@ -1,8 +0,0 @@
   218.4 -<!--
   218.5 -  This view is used to render the plugin list page.
   218.6 -
   218.7 -  Since we don't really have anything dynamic here, let's just use static HTML. 
   218.8 --->
   218.9 -<div>
  218.10 -  Jackpot 3.0 Hudson plugin.
  218.11 -</div>
  218.12 \ No newline at end of file
   219.1 --- a/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/BuildWrapperImpl/config.jelly	Wed Jun 22 12:05:27 2011 +0200
   219.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   219.3 @@ -1,79 +0,0 @@
   219.4 -<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
   219.5 -  <!--
   219.6 -    This jelly script is used for per-project configuration.
   219.7 -
   219.8 -    See global.jelly for a general discussion about jelly script.
   219.9 -  -->
  219.10 -
  219.11 -  <!--
  219.12 -    Creates a text field that shows the value of the "name" property.
  219.13 -    When submitted, it will be passed to the corresponding constructor parameter.
  219.14 -  -->
  219.15 -
  219.16 -<!--  <j:forEach var="category" items="${descriptor.getCategories()}" varStatus="loop">
  219.17 -    <f:block>
  219.18 -      <table>
  219.19 -        <f:optionalBlock title="${category}">
  219.20 -          <j:forEach var="hint" items="${descriptor.getHintsInCategory(category)}" varStatus="loop">
  219.21 -            <f:entry description="${descriptor.getHintDescription(hint)}">
  219.22 -              <f:checkbox name="${hint}" checked="${instance.isHintEnabled(hint)}"/>
  219.23 -              <label class="attach-previous">${descriptor.getHintDisplayName(hint)}</label>
  219.24 -            </f:entry>
  219.25 -          </j:forEach>
  219.26 -        </f:optionalBlock>
  219.27 -      </table>
  219.28 -    </f:block>
  219.29 -  </j:forEach>-->
  219.30 -
  219.31 -  <f:block>
  219.32 -    <table>
  219.33 -      <f:optionalBlock name="classpathBasedHintsEnabled" title="Run hints found on classpath" checked="${instance != null ? instance.isClasspathBasedHintsEnabled() : true}">
  219.34 -            <f:entry>
  219.35 -              <f:checkbox field="classpathBasedHintFixesEnabled" checked="${instance != null ? instance.isClasspathBasedHintFixesEnabled() : false}"/>
  219.36 -              <label class="attach-previous">Apply the primary fix</label>
  219.37 -            </f:entry>
  219.38 -      </f:optionalBlock>
  219.39 -    </table>
  219.40 -  </f:block>
  219.41 -  
  219.42 -  <f:block>
  219.43 -    <table>
  219.44 -      <f:optionalBlock name="hardcodedHintsEnabled" title="Run NetBeans hints" checked="${instance != null ? instance.isHardcodedHintsEnabled() : true}">
  219.45 -  <j:forEach var="category" items="${descriptor.getCategories()}" varStatus="loop">
  219.46 -        <f:section title="${descriptor.getCategoryDisplayName(category)}">
  219.47 -          <j:forEach var="hint" items="${descriptor.getHintsInCategory(category)}" varStatus="loop">
  219.48 -            <f:entry>
  219.49 -    <table>
  219.50 -      <f:optionalBlock name="${hint}" title="${descriptor.getHintDisplayName(hint)}" tooltip="${descriptor.getHintDescription(hint)}" checked="${instance != null ? instance.isHintEnabled(hint) : descriptor.isHintEnabledByDefault(hint)}">
  219.51 -<!--              <f:checkbox name="${hint}" checked="${instance != null ? instance.isHintEnabled(hint) : descriptor.isHintEnabledByDefault(hint)}"/>
  219.52 -              <label class="attach-previous" tooltip="${descriptor.getHintDescription(hint)}">${descriptor.getHintDisplayName(hint)}</label>-->
  219.53 -<!--              <f:nested>-->
  219.54 -            <f:entry>
  219.55 -                <f:checkbox name="${hint}.apply" checked="${instance != null ? instance.isHintApplyEnabled(hint) : descriptor.isHintApplyEnabledByDefault(hint)}"/>
  219.56 -                <label class="attach-previous">Apply the primary fix.</label>
  219.57 -            </f:entry>
  219.58 -<!--              </f:nested>-->
  219.59 -      </f:optionalBlock>
  219.60 -    </table>
  219.61 -            </f:entry>
  219.62 -          </j:forEach>
  219.63 -        </f:section>
  219.64 -  </j:forEach>
  219.65 -      </f:optionalBlock>
  219.66 -    </table>
  219.67 -  </f:block>
  219.68 -
  219.69 -  <f:block>
  219.70 -    <table>
  219.71 -        <f:checkbox name="indexingEnabled" checked="${instance != null ? instance.isIndexingEnabled() : true}"/>
  219.72 -        <label class="attach-previous">Run Indexing</label>
  219.73 -    </table>
  219.74 -  </f:block>
  219.75 -<!--  <j:forEach var="d" items="${descriptor.getHints()}" varStatus="loop">
  219.76 -  <f:entry description="${descriptor.getHintDescription(d)}">
  219.77 -    <f:checkbox name="${d}" checked="${instance.isHintEnabled(d)}"/>
  219.78 -    <label class="attach-previous">${descriptor.getHintDisplayName(d)}</label>
  219.79 -  </f:entry>
  219.80 -  </j:forEach>-->
  219.81 -
  219.82 -</j:jelly>
   220.1 --- a/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/BuildWrapperImpl/help-hardcodedHintsEnabled.html	Wed Jun 22 12:05:27 2011 +0200
   220.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   220.3 @@ -1,3 +0,0 @@
   220.4 -<div>
   220.5 -    Whether the standard NetBeans hints should be run during the build.
   220.6 -</div>
   220.7 \ No newline at end of file
   221.1 --- a/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/IndexingBuilder/config.jelly	Wed Jun 22 12:05:27 2011 +0200
   221.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   221.3 @@ -1,17 +0,0 @@
   221.4 -<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
   221.5 -
   221.6 -    <f:entry title="Project Name:" field="projectName">
   221.7 -        <f:textbox />
   221.8 -    </f:entry>
   221.9 -
  221.10 -    <j:if test="${descriptor.hasNonStandardIndexingTool}">
  221.11 -        <f:entry title="Indexing Tool">
  221.12 -            <select class="setting-input" name="toolName">
  221.13 -                <j:forEach var="inst" items="${descriptor.indexingTools}">
  221.14 -                    <f:option selected="${inst.name==instance.toolName}" value="${inst.name}">${inst.name}</f:option>
  221.15 -                </j:forEach>
  221.16 -            </select>
  221.17 -        </f:entry>
  221.18 -    </j:if>
  221.19 -
  221.20 -</j:jelly>
   222.1 --- a/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/IndexingBuilder/global.jelly	Wed Jun 22 12:05:27 2011 +0200
   222.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   222.3 @@ -1,9 +0,0 @@
   222.4 -<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
   222.5 -
   222.6 -    <f:section title="Indexers">
   222.7 -        <f:entry title="Cache directory:" field="cacheDir">
   222.8 -            <f:textbox />
   222.9 -        </f:entry>
  222.10 -    </f:section>
  222.11 -    
  222.12 -</j:jelly>
   223.1 --- a/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/IndexingBuilder/help-cacheDir.html	Wed Jun 22 12:05:27 2011 +0200
   223.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   223.3 @@ -1,3 +0,0 @@
   223.4 -<div>
   223.5 -    Target cache directory.
   223.6 -</div>
   223.7 \ No newline at end of file
   224.1 --- a/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/IndexingBuilder/help.html	Wed Jun 22 12:05:27 2011 +0200
   224.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   224.3 @@ -1,3 +0,0 @@
   224.4 -<div>
   224.5 -    Run indexers.
   224.6 -</div>
   224.7 \ No newline at end of file
   225.1 --- a/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/JackpotIndexBuilder/config.jelly	Wed Jun 22 12:05:27 2011 +0200
   225.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   225.3 @@ -1,3 +0,0 @@
   225.4 -<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
   225.5 -
   225.6 -</j:jelly>
   226.1 --- a/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/JackpotIndexBuilder/help.html	Wed Jun 22 12:05:27 2011 +0200
   226.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   226.3 @@ -1,3 +0,0 @@
   226.4 -<div>
   226.5 -    Run Jackpot 3.0 indexer.
   226.6 -</div>
   226.7 \ No newline at end of file
   227.1 --- a/server/hudson/src/main/resources/org/netbeans/modules/jackpot30/hudson/org.netbeans.modules.jackpot30.hudson.InstallIndexingTool	Wed Jun 22 12:05:27 2011 +0200
   227.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   227.3 @@ -1,1 +0,0 @@
   227.4 -{"list": [{"id": "main", "name": "main", "url": "http://deadlock.netbeans.org/hudson/job/jackpot30/lastSuccessfulBuild/artifact/server/backend/build/indexing-backend.zip"}]}
   227.5 \ No newline at end of file
   228.1 --- a/server/hudson/src/main/webapp/help-globalConfig.html	Wed Jun 22 12:05:27 2011 +0200
   228.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   228.3 @@ -1,5 +0,0 @@
   228.4 -<div>
   228.5 -  <p>
   228.6 -    See help-projectConfig.html for more about what these HTMLs do.
   228.7 -  </p>
   228.8 -</div>
   228.9 \ No newline at end of file
   229.1 --- a/server/hudson/src/test/java/org/netbeans/modules/jackpot30/hudson/IndexingBuilderTest.java	Wed Jun 22 12:05:27 2011 +0200
   229.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   229.3 @@ -1,217 +0,0 @@
   229.4 -/*
   229.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   229.6 - *
   229.7 - * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
   229.8 - *
   229.9 - * The contents of this file are subject to the terms of either the GNU
  229.10 - * General Public License Version 2 only ("GPL") or the Common
  229.11 - * Development and Distribution License("CDDL") (collectively, the
  229.12 - * "License"). You may not use this file except in compliance with the
  229.13 - * License. You can obtain a copy of the License at
  229.14 - * http://www.netbeans.org/cddl-gplv2.html
  229.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  229.16 - * specific language governing permissions and limitations under the
  229.17 - * License.  When distributing the software, include this License Header
  229.18 - * Notice in each file and include the License file at
  229.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  229.20 - * particular file as subject to the "Classpath" exception as provided
  229.21 - * by Sun in the GPL Version 2 section of the License file that
  229.22 - * accompanied this code. If applicable, add the following below the
  229.23 - * License Header, with the fields enclosed by brackets [] replaced by
  229.24 - * your own identifying information:
  229.25 - * "Portions Copyrighted [year] [name of copyright owner]"
  229.26 - *
  229.27 - * If you wish your version of this file to be governed by only the CDDL
  229.28 - * or only the GPL Version 2, indicate your decision by adding
  229.29 - * "[Contributor] elects to include this software in this distribution
  229.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  229.31 - * single choice of license, a recipient has the option to distribute
  229.32 - * your version of this file under either the CDDL, the GPL Version 2 or
  229.33 - * to extend the choice of license to its licensees as provided above.
  229.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  229.35 - * Version 2 license, then the option applies only if the new code is
  229.36 - * made subject to such option by the copyright holder.
  229.37 - *
  229.38 - * Contributor(s):
  229.39 - *
  229.40 - * Portions Copyrighted 2010 Sun Microsystems, Inc.
  229.41 - */
  229.42 -
  229.43 -package org.netbeans.modules.jackpot30.hudson;
  229.44 -
  229.45 -import hudson.FilePath;
  229.46 -import hudson.Launcher;
  229.47 -import hudson.model.AbstractBuild;
  229.48 -import hudson.model.BuildListener;
  229.49 -import hudson.model.FreeStyleProject;
  229.50 -import hudson.scm.SubversionSCM;
  229.51 -import hudson.scm.SubversionSCM.ModuleLocation;
  229.52 -import hudson.util.ArgumentListBuilder;
  229.53 -import hudson.util.StreamTaskListener;
  229.54 -import java.io.File;
  229.55 -import java.io.FileOutputStream;
  229.56 -import java.io.IOException;
  229.57 -import java.util.Arrays;
  229.58 -import java.util.Collections;
  229.59 -import java.util.Set;
  229.60 -import org.jvnet.hudson.test.HudsonHomeLoader;
  229.61 -import org.jvnet.hudson.test.HudsonTestCase;
  229.62 -import static org.junit.Assert.*;
  229.63 -import org.xml.sax.SAXException;
  229.64 -
  229.65 -/**
  229.66 - *
  229.67 - * @author lahvac
  229.68 - */
  229.69 -public class IndexingBuilderTest extends HudsonTestCase {
  229.70 -
  229.71 -    public IndexingBuilderTest() {
  229.72 -    }
  229.73 -
  229.74 -    @Override
  229.75 -    protected void setUp() throws Exception {
  229.76 -        StartWebFrontEnd.disable = true;
  229.77 -        
  229.78 -        super.setUp();
  229.79 -
  229.80 -        checkoutDir = HudsonHomeLoader.NEW.allocate();
  229.81 -        repositoryDir = HudsonHomeLoader.NEW.allocate();
  229.82 -    }
  229.83 -
  229.84 -    @Override
  229.85 -    protected void tearDown() throws Exception {
  229.86 -        super.tearDown();
  229.87 -
  229.88 -        //XXX: some of the working directories seems to be kept by the testing infra, workarounding:
  229.89 -        new FilePath(checkoutDir).deleteRecursive();
  229.90 -        new FilePath(repositoryDir).deleteRecursive();
  229.91 -        hudson.getRootPath().deleteRecursive();
  229.92 -    }
  229.93 -
  229.94 -    private File checkoutDir;
  229.95 -    private File repositoryDir;
  229.96 -
  229.97 -    public void testUpdate() throws Exception {
  229.98 -        //setup svn repository:
  229.99 -        String repositoryURL = repositoryDir.toURI().toURL().toExternalForm().replace("file:/", "file:///");
 229.100 -        runSubversionAdmin("create", repositoryDir.getAbsolutePath());
 229.101 -        runSubversion("checkout", repositoryURL, ".");
 229.102 -        createFile("A.java");
 229.103 -        createFile("B.java");
 229.104 -        runSubversion("add", "A.java", "B.java");
 229.105 -        runSubversion("commit", "-m", "initial");
 229.106 -
 229.107 -        FreeStyleProject p = createFreeStyleProject();
 229.108 -        ModuleLocation mod1 = new ModuleLocation(repositoryURL, null);
 229.109 -        SubversionSCM scm = new SubversionSCM(Collections.singletonList(mod1), true, null, "", "", "");
 229.110 -        IndexBuilderImpl indexer = new IndexBuilderImpl("test", "test");
 229.111 -        p.setScm(scm);
 229.112 -        p.getBuildersList().add(indexer);
 229.113 -
 229.114 -        doRunProject(p);
 229.115 -
 229.116 -        assertTrue(indexer.called);
 229.117 -
 229.118 -        runSubversion("remove", "B.java");
 229.119 -        createFile("C.java");
 229.120 -        runSubversion("add", "C.java");
 229.121 -        runSubversion("commit", "-m", "");
 229.122 -
 229.123 -        indexer.called = false;
 229.124 -        doRunProject(p);
 229.125 -
 229.126 -        assertTrue(indexer.called);
 229.127 -        assertEquals(Collections.singleton("C.java"), indexer.addedOrModified);
 229.128 -        assertEquals(Collections.singleton("B.java"), indexer.removed);
 229.129 -    }
 229.130 -
 229.131 -    public void DISABLEDtestCheckoutIntoSpecifiedDir() throws Exception {
 229.132 -        //setup svn repository:
 229.133 -        String repositoryURL = repositoryDir.toURI().toURL().toExternalForm().replace("file:/", "file:///");
 229.134 -        runSubversionAdmin("create", repositoryDir.getAbsolutePath());
 229.135 -        runSubversion("checkout", repositoryURL, ".");
 229.136 -        createFile("A.java");
 229.137 -        createFile("B.java");
 229.138 -        runSubversion("add", "A.java", "B.java");
 229.139 -        runSubversion("commit", "-m", "initial");
 229.140 -
 229.141 -        FreeStyleProject p = createFreeStyleProject();
 229.142 -        ModuleLocation mod1 = new ModuleLocation(repositoryURL, "repo1");
 229.143 -        SubversionSCM scm = new SubversionSCM(Collections.singletonList(mod1), true, null, "", "", "");
 229.144 -        IndexBuilderImpl indexer = new IndexBuilderImpl("test", "test");
 229.145 -        p.setScm(scm);
 229.146 -        p.getBuildersList().add(indexer);
 229.147 -
 229.148 -        doRunProject(p);
 229.149 -
 229.150 -        assertTrue(indexer.called);
 229.151 -
 229.152 -        runSubversion("remove", "B.java");
 229.153 -        createFile("C.java");
 229.154 -        runSubversion("add", "C.java");
 229.155 -        runSubversion("commit", "-m", "");
 229.156 -
 229.157 -        indexer.called = false;
 229.158 -        doRunProject(p);
 229.159 -
 229.160 -        assertTrue(indexer.called);
 229.161 -        assertEquals(Arrays.asList(""), indexer.addedOrModified);
 229.162 -        assertEquals(Arrays.asList(""), indexer.removed);
 229.163 -    }
 229.164 -
 229.165 -    private void doRunProject(FreeStyleProject p) throws SAXException, IOException, InterruptedException {
 229.166 -        WebClient w = new WebClient();
 229.167 -        w.getPage(p, "build?delay=0sec");
 229.168 -
 229.169 -        Thread.sleep(5000);
 229.170 -
 229.171 -        while (p.isBuilding()) {
 229.172 -            Thread.sleep(100);
 229.173 -        }
 229.174 -    }
 229.175 -
 229.176 -    private void runSubversion(String... args) throws IOException, InterruptedException {
 229.177 -        Launcher.LocalLauncher l = new Launcher.LocalLauncher(new StreamTaskListener(System.err));
 229.178 -        l.launch().cmds(new ArgumentListBuilder().add("svn").add(args))
 229.179 -                  .pwd(checkoutDir)
 229.180 -                  .start()
 229.181 -                  .join();
 229.182 -    }
 229.183 -
 229.184 -    private void runSubversionAdmin(String... args) throws IOException, InterruptedException {
 229.185 -        Launcher.LocalLauncher l = new Launcher.LocalLauncher(new StreamTaskListener(System.err));
 229.186 -        l.launch().cmds(new ArgumentListBuilder().add("svnadmin").add(args))
 229.187 -                  .pwd(repositoryDir)
 229.188 -                  .start()
 229.189 -                  .join();
 229.190 -    }
 229.191 -
 229.192 -    private void createFile(String relativePath) throws IOException {
 229.193 -        File toCreate = new File(checkoutDir, relativePath.replace('/', File.separatorChar));
 229.194 -
 229.195 -        toCreate.getParentFile().mkdirs();
 229.196 -
 229.197 -        new FileOutputStream(toCreate).close();
 229.198 -    }
 229.199 -
 229.200 -    private static final class IndexBuilderImpl extends IndexingBuilder {
 229.201 -
 229.202 -        private boolean called;
 229.203 -        private Set<String> addedOrModified;
 229.204 -        private Set<String> removed;
 229.205 -
 229.206 -        public IndexBuilderImpl(String projectName, String toolName) {
 229.207 -            super(projectName, toolName);
 229.208 -        }
 229.209 -
 229.210 -        @Override
 229.211 -        protected boolean doIndex(File cacheDir, AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener, Set<String> addedOrModified, Set<String> removed) throws IOException, InterruptedException {
 229.212 -            this.addedOrModified = addedOrModified;
 229.213 -            this.removed = removed;
 229.214 -            called = true;
 229.215 -            return true;
 229.216 -        }
 229.217 -
 229.218 -    }
 229.219 -
 229.220 -}
 229.221 \ No newline at end of file
   230.1 --- a/server/indexer/nbproject/project.properties	Wed Jun 22 12:05:27 2011 +0200
   230.2 +++ b/server/indexer/nbproject/project.properties	Thu Jun 23 15:07:16 2011 +0200
   230.3 @@ -23,7 +23,8 @@
   230.4  dist.dir=dist
   230.5  dist.jar=${dist.dir}/indexer.jar
   230.6  dist.javadoc.dir=${dist.dir}/javadoc
   230.7 -endorsed.classpath=${libs.javac.classpath}
   230.8 +endorsed.classpath=\
   230.9 +    ${libs.javac.classpath}
  230.10  excludes=
  230.11  file.reference.org-netbeans-modules-java-hints.jar=../lib/org-netbeans-modules-java-hints.jar
  230.12  file.reference.org-netbeans-modules-java-source.jar=../lib/org-netbeans-modules-java-source.jar
  230.13 @@ -31,10 +32,8 @@
  230.14  file.reference.org-openide-filesystems.jar=../lib/org-openide-filesystems.jar
  230.15  file.reference.org-openide-util-lookup.jar=../lib/org-openide-util-lookup.jar
  230.16  file.reference.org-openide-util.jar=../lib/org-openide-util.jar
  230.17 -file.reference.util-commons.jar=../../libs.jerig/external/util-commons.jar
  230.18 -file.reference.util-lutz.jar=../../libs.jerig/external/util-lutz.jar
  230.19 -file.reference.util-pojson.jar=../../libs.jerig/external/util-pojson.jar
  230.20 -file.reference.util-strast.jar=../../libs.jerig/external/util-strast.jar
  230.21 +file.reference.util-commons.jar-1=../../remoting/ide/api/external/util-commons.jar
  230.22 +file.reference.util-pojson.jar-1=../../remoting/ide/api/external/util-pojson.jar
  230.23  includes=**
  230.24  jar.compress=false
  230.25  javac.classpath=\
  230.26 @@ -42,15 +41,13 @@
  230.27      ${libs.lucene.classpath}:\
  230.28      ${libs.javac.classpath}:\
  230.29      ${file.reference.org-netbeans-modules-java-source.jar}:\
  230.30 -    ${file.reference.util-commons.jar}:\
  230.31 -    ${file.reference.util-lutz.jar}:\
  230.32 -    ${file.reference.util-pojson.jar}:\
  230.33 -    ${file.reference.util-strast.jar}:\
  230.34      ${file.reference.org-openide-filesystems.jar}:\
  230.35      ${file.reference.org-openide-util.jar}:\
  230.36      ${file.reference.org-openide-util-lookup.jar}:\
  230.37      ${file.reference.org-netbeans-spi-editor-hints.jar}:\
  230.38 -    ${file.reference.org-netbeans-modules-java-hints.jar}
  230.39 +    ${file.reference.org-netbeans-modules-java-hints.jar}:\
  230.40 +    ${file.reference.util-commons.jar-1}:\
  230.41 +    ${file.reference.util-pojson.jar-1}
  230.42  # Space-separated list of extra javac options
  230.43  javac.compilerargs=
  230.44  javac.deprecation=false
  230.45 @@ -77,6 +74,7 @@
  230.46  main.class=org.netbeans.modules.jackpot30.server.indexer.Index
  230.47  manifest.file=manifest.mf
  230.48  meta.inf.dir=${src.dir}/META-INF
  230.49 +mkdist.disabled=false
  230.50  platform.active=default_platform
  230.51  project.org_netbeans_modules_jackpot30_api=../../api
  230.52  reference.org_netbeans_modules_jackpot30_api.module=${project.org_netbeans_modules_jackpot30_api}/../build/cluster/modules/org-netbeans-modules-jackpot30-api.jar
   231.1 --- a/server/web.api/nbproject/project.properties	Wed Jun 22 12:05:27 2011 +0200
   231.2 +++ b/server/web.api/nbproject/project.properties	Thu Jun 23 15:07:16 2011 +0200
   231.3 @@ -23,17 +23,16 @@
   231.4  dist.dir=dist
   231.5  dist.jar=${dist.dir}/web.api.jar
   231.6  dist.javadoc.dir=${dist.dir}/javadoc
   231.7 -endorsed.classpath=${libs.javac.classpath}
   231.8 +endorsed.classpath=\
   231.9 +    ${libs.javac.classpath}
  231.10  excludes=
  231.11  file.reference.org-netbeans-modules-java-source.jar=../lib/org-netbeans-modules-java-source.jar
  231.12  file.reference.org-netbeans-spi-editor-hints.jar=../lib/org-netbeans-spi-editor-hints.jar
  231.13  file.reference.org-openide-filesystems.jar=../lib/org-openide-filesystems.jar
  231.14  file.reference.org-openide-util-lookup.jar=../lib/org-openide-util-lookup.jar
  231.15  file.reference.org-openide-util.jar=../lib/org-openide-util.jar
  231.16 -file.reference.util-commons.jar=../../libs.jerig/external/util-commons.jar
  231.17 -file.reference.util-lutz.jar=../../libs.jerig/external/util-lutz.jar
  231.18 -file.reference.util-pojson.jar=../../libs.jerig/external/util-pojson.jar
  231.19 -file.reference.util-strast.jar=../../libs.jerig/external/util-strast.jar
  231.20 +file.reference.util-commons.jar=../../remoting/ide/api/external/util-commons.jar
  231.21 +file.reference.util-pojson.jar=../../remoting/ide/api/external/util-pojson.jar
  231.22  includes=**
  231.23  jar.compress=false
  231.24  javac.classpath=\
  231.25 @@ -43,15 +42,14 @@
  231.26      ${libs.javac.classpath}:\
  231.27      ${reference.indexer.jar}:\
  231.28      ${file.reference.org-netbeans-modules-java-source.jar}:\
  231.29 +    ${file.reference.org-openide-filesystems.jar}:\
  231.30      ${file.reference.util-commons.jar}:\
  231.31 -    ${file.reference.util-lutz.jar}:\
  231.32      ${file.reference.util-pojson.jar}:\
  231.33 -    ${file.reference.util-strast.jar}:\
  231.34 -    ${file.reference.org-openide-filesystems.jar}:\
  231.35      ${libs.freemarker.classpath}:\
  231.36      ${file.reference.org-openide-util.jar}:\
  231.37      ${file.reference.org-openide-util-lookup.jar}:\
  231.38 -    ${file.reference.org-netbeans-spi-editor-hints.jar}
  231.39 +    ${file.reference.org-netbeans-spi-editor-hints.jar}:\
  231.40 +    ${reference.org_netbeans_modules_jackpot30_remoting_api.module}
  231.41  # Space-separated list of extra javac options
  231.42  javac.compilerargs=
  231.43  javac.deprecation=false
  231.44 @@ -78,11 +76,14 @@
  231.45  main.class=org.netbeans.modules.jackpot30.server.webapi.Main
  231.46  manifest.file=manifest.mf
  231.47  meta.inf.dir=${src.dir}/META-INF
  231.48 +mkdist.disabled=false
  231.49  platform.active=default_platform
  231.50  project.indexer=../indexer
  231.51  project.org_netbeans_modules_jackpot30_api=../../api
  231.52 +project.org_netbeans_modules_jackpot30_remoting_api=../../remoting/ide/api
  231.53  reference.indexer.jar=${project.indexer}/dist/indexer.jar
  231.54  reference.org_netbeans_modules_jackpot30_api.module=${project.org_netbeans_modules_jackpot30_api}/../build/cluster/modules/org-netbeans-modules-jackpot30-api.jar
  231.55 +reference.org_netbeans_modules_jackpot30_remoting_api.module=${project.org_netbeans_modules_jackpot30_remoting_api}/../build/cluster/modules/org-netbeans-modules-jackpot30-remoting-api.jar
  231.56  run.classpath=\
  231.57      ${javac.classpath}:\
  231.58      ${build.classes.dir}
   232.1 --- a/server/web.api/nbproject/project.xml	Wed Jun 22 12:05:27 2011 +0200
   232.2 +++ b/server/web.api/nbproject/project.xml	Thu Jun 23 15:07:16 2011 +0200
   232.3 @@ -31,6 +31,14 @@
   232.4                  <clean-target>clean</clean-target>
   232.5                  <id>module</id>
   232.6              </reference>
   232.7 +            <reference>
   232.8 +                <foreign-project>org_netbeans_modules_jackpot30_remoting_api</foreign-project>
   232.9 +                <artifact-type>jar</artifact-type>
  232.10 +                <script>build.xml</script>
  232.11 +                <target>netbeans</target>
  232.12 +                <clean-target>clean</clean-target>
  232.13 +                <id>module</id>
  232.14 +            </reference>
  232.15          </references>
  232.16      </configuration>
  232.17  </project>
   233.1 --- a/server/web.api/src/org/netbeans/modules/jackpot30/server/webapi/UI.java	Wed Jun 22 12:05:27 2011 +0200
   233.2 +++ b/server/web.api/src/org/netbeans/modules/jackpot30/server/webapi/UI.java	Thu Jun 23 15:07:16 2011 +0200
   233.3 @@ -56,18 +56,13 @@
   233.4  import java.util.LinkedList;
   233.5  import java.util.List;
   233.6  import java.util.Map;
   233.7 -import java.util.Properties;
   233.8 -import java.util.logging.Level;
   233.9 -import java.util.logging.Logger;
  233.10 -import java.util.regex.Matcher;
  233.11 -import java.util.regex.Pattern;
  233.12  import javax.ws.rs.GET;
  233.13  import javax.ws.rs.Path;
  233.14  import javax.ws.rs.Produces;
  233.15  import javax.ws.rs.QueryParam;
  233.16  import org.codeviation.pojson.Pojson;
  233.17 -import org.netbeans.modules.jackpot30.impl.WebUtilities;
  233.18 -import static org.netbeans.modules.jackpot30.impl.WebUtilities.escapeForQuery;
  233.19 +import org.netbeans.modules.jackpot30.remoting.api.WebUtilities;
  233.20 +import static org.netbeans.modules.jackpot30.remoting.api.WebUtilities.escapeForQuery;
  233.21  
  233.22  /**
  233.23   *