You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jl...@apache.org on 2008/08/02 00:25:43 UTC
svn commit: r681869 - in /geronimo/sandbox/geronimo-netbeans-plugin:
nbproject/ src/org/apache/geronimo/netbeans/
Author: jlaskowski
Date: Fri Aug 1 15:25:42 2008
New Revision: 681869
URL: http://svn.apache.org/viewvc?rev=681869&view=rev
Log:
Register Servlet and JSP libs so jsps are not marked as invalid due to missing javax.servlet.jsp.* classes
Modified:
geronimo/sandbox/geronimo-netbeans-plugin/nbproject/genfiles.properties
geronimo/sandbox/geronimo-netbeans-plugin/nbproject/project.xml
geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/Bundle.properties
geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoJ2eePlatformFactory.java
geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoJ2eePlatformImpl.java
Modified: geronimo/sandbox/geronimo-netbeans-plugin/nbproject/genfiles.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/nbproject/genfiles.properties?rev=681869&r1=681868&r2=681869&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/nbproject/genfiles.properties (original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/nbproject/genfiles.properties Fri Aug 1 15:25:42 2008
@@ -1,8 +1,8 @@
-build.xml.data.CRC32=81e31c7d
+build.xml.data.CRC32=59a67c31
build.xml.script.CRC32=06cbcef2
build.xml.stylesheet.CRC32=79c3b980
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=81e31c7d
+nbproject/build-impl.xml.data.CRC32=59a67c31
nbproject/build-impl.xml.script.CRC32=47f49d5d
nbproject/build-impl.xml.stylesheet.CRC32=deb65f65
Modified: geronimo/sandbox/geronimo-netbeans-plugin/nbproject/project.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/nbproject/project.xml?rev=681869&r1=681868&r2=681869&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/nbproject/project.xml (original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/nbproject/project.xml Fri Aug 1 15:25:42 2008
@@ -52,6 +52,15 @@
</run-dependency>
</dependency>
<dependency>
+ <code-name-base>org.netbeans.modules.server</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>0-1</release-version>
+ <specification-version>1.2</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
<code-name-base>org.openide.actions</code-name-base>
<build-prerequisite/>
<compile-dependency/>
Modified: geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/Bundle.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/Bundle.properties?rev=681869&r1=681868&r2=681869&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/Bundle.properties (original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/Bundle.properties Fri Aug 1 15:25:42 2008
@@ -37,4 +37,7 @@
MSG_StartFailed={0} Start Failed
MSG_StartServerTimeout=IDE can't recognize whether the server has been started, \
please use the Refresh button or context menu item to update its status.
-MSG_InstanceRegistrationFailed={0} Registration Failed
\ No newline at end of file
+MSG_InstanceRegistrationFailed={0} Registration Failed
+
+servlet25=Java Servlet 2.5 API
+jsp21=JavaServer Pages 2.1 API
\ No newline at end of file
Modified: geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoJ2eePlatformFactory.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoJ2eePlatformFactory.java?rev=681869&r1=681868&r2=681869&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoJ2eePlatformFactory.java (original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoJ2eePlatformFactory.java Fri Aug 1 15:25:42 2008
@@ -26,7 +26,9 @@
public class GeronimoJ2eePlatformFactory extends J2eePlatformFactory {
public J2eePlatformImpl getJ2eePlatformImpl(DeploymentManager dm) {
- return new GeronimoJ2eePlatformImpl();
+ GeronimoDeploymentManager gdm = (GeronimoDeploymentManager)dm;
+ String installLocation = gdm.getInstanceProperties().getProperty(GeronimoPluginProperties.PROPERTY_SERVER_DIR);
+ return new GeronimoJ2eePlatformImpl(installLocation);
}
}
Modified: geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoJ2eePlatformImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoJ2eePlatformImpl.java?rev=681869&r1=681868&r2=681869&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoJ2eePlatformImpl.java (original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoJ2eePlatformImpl.java Fri Aug 1 15:25:42 2008
@@ -18,13 +18,21 @@
import java.awt.Image;
import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.netbeans.api.java.platform.JavaPlatform;
import org.netbeans.api.java.platform.JavaPlatformManager;
+import org.netbeans.modules.j2ee.deployment.common.api.J2eeLibraryTypeProvider;
import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
import org.netbeans.modules.j2ee.deployment.plugins.spi.J2eePlatformImpl;
import org.netbeans.spi.project.libraries.LibraryImplementation;
+import org.openide.ErrorManager;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;
@@ -52,10 +60,46 @@
static {
JAVA_VERSIONS.add("1.4");
JAVA_VERSIONS.add("1.5");
+ JAVA_VERSIONS.add("1.6");
+ }
+
+ private String installLocation;
+ private static final Logger logger = Logger.getLogger(GeronimoJ2eePlatformImpl.class.getName());
+
+ public GeronimoJ2eePlatformImpl(String installLocation) {
+ this.installLocation = installLocation;
}
public LibraryImplementation[] getLibraries() {
- return new LibraryImplementation[0];
+ List<LibraryImplementation> libs = new ArrayList<LibraryImplementation>();
+ try {
+ J2eeLibraryTypeProvider lp = new J2eeLibraryTypeProvider();
+
+ LibraryImplementation lib = lp.createLibrary();
+ lib.setName(NbBundle.getMessage(GeronimoJ2eePlatformImpl.class, "servlet25"));
+ List<URL> classpath = new ArrayList<URL>();
+ // FIXME: Compute the path at runtime
+ classpath.add(new File(installLocation, "/repository/org/apache/geronimo/specs/geronimo-servlet_2.5_spec/1.2/geronimo-servlet_2.5_spec-1.2.jar").toURI().toURL());
+ lib.setContent(J2eeLibraryTypeProvider.VOLUME_TYPE_CLASSPATH, classpath);
+ // FIXME: Add SRC and JAVADOC
+ lib.setContent(J2eeLibraryTypeProvider.VOLUME_TYPE_SRC, Collections.EMPTY_LIST);
+ lib.setContent(J2eeLibraryTypeProvider.VOLUME_TYPE_JAVADOC, Collections.EMPTY_LIST);
+ libs.add(lib);
+
+ lib = lp.createLibrary();
+ lib.setName(NbBundle.getMessage(GeronimoJ2eePlatformImpl.class, "jsp21"));
+
+ classpath = new ArrayList<URL>();
+ classpath.add(new File(installLocation, "/repository/org/apache/geronimo/specs/geronimo-jsp_2.1_spec/1.0.1/geronimo-jsp_2.1_spec-1.0.1.jar").toURI().toURL());
+ lib.setContent(J2eeLibraryTypeProvider.VOLUME_TYPE_CLASSPATH, classpath);
+ // FIXME: Add SRC and JAVADOC
+ lib.setContent(J2eeLibraryTypeProvider.VOLUME_TYPE_SRC, Collections.EMPTY_LIST);
+ lib.setContent(J2eeLibraryTypeProvider.VOLUME_TYPE_JAVADOC, Collections.EMPTY_LIST);
+ libs.add(lib);
+ } catch (Exception ex) {
+ logger.log(Level.WARNING, ex.getMessage(), ex);
+ }
+ return (LibraryImplementation[]) libs.toArray(new LibraryImplementation[libs.size()]);
}
public String getDisplayName() {
@@ -67,14 +111,16 @@
}
public File[] getPlatformRoots() {
- return new File[0];
+ return new File[]{new File(installLocation)};
}
public File[] getToolClasspathEntries(String toolName) {
+ System.out.println("getToolClasspathEntries.toolName: " + toolName);
return new File[0];
}
public boolean isToolSupported(String toolName) {
+ System.out.println("isToolSupported.toolName: " + toolName);
return false;
}