JBoss Tools SVN: r11782 - trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-11-14 02:58:03 -0500 (Fri, 14 Nov 2008)
New Revision: 11782
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java
Log:
JBIDE-3196:change the genereted wsdl file's location
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java 2008-11-14 07:20:12 UTC (rev 11781)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java 2008-11-14 07:58:03 UTC (rev 11782)
@@ -87,8 +87,7 @@
if (model.isGenWSDL()) {
commandLine.append(" -w ");
}
- commandLine.append(" -r ").append(projectRoot).append(Path.SEPARATOR)
- .append("WebContent").append(Path.SEPARATOR).append("wsdl ");
+ commandLine.append(" -r ").append(projectRoot).append(Path.SEPARATOR).append("wsdl ");
commandLine.append(model.getServiceClasses().get(0));
return commandLine.toString();
17 years, 5 months
JBoss Tools SVN: r11781 - trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-11-14 02:20:12 -0500 (Fri, 14 Nov 2008)
New Revision: 11781
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/AbstractGenerateCodeCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java
Log:
JBIDE-3195:remove the generated output folder from AS/bin folder
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/AbstractGenerateCodeCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/AbstractGenerateCodeCommand.java 2008-11-14 06:49:46 UTC (rev 11780)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/AbstractGenerateCodeCommand.java 2008-11-14 07:20:12 UTC (rev 11781)
@@ -16,6 +16,8 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
import org.jboss.tools.ws.core.utils.StatusUtils;
@@ -24,92 +26,106 @@
import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
-abstract class AbstractGenerateCodeCommand extends AbstractDataModelOperation{
+abstract class AbstractGenerateCodeCommand extends AbstractDataModelOperation {
protected ServiceModel model;
- private String cmdFileName_linux;
- private String cmdFileName_win;
+ private String cmdFileName_linux;
+ private String cmdFileName_win;
-
- public AbstractGenerateCodeCommand(ServiceModel model){
+ public AbstractGenerateCodeCommand(ServiceModel model) {
this.model = model;
cmdFileName_linux = getCommandLineFileName_linux();
cmdFileName_win = getCommandLineFileName_win();
}
-
+
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
IStatus status = Status.OK_STATUS;
-
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(model
- .getWebProjectName());
-
+
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
+ model.getWebProjectName());
+
+ String projectRoot = JBossWSCreationUtils.getProjectRoot(
+ model.getWebProjectName()).toOSString();
+ IJavaProject javaProject = JavaCore.create(project);
try {
- String runtimeLocation = JBossWSCreationUtils.getJBossWSRuntimeLocation(project);
- String commandLocation = runtimeLocation + Path.SEPARATOR + "bin";
+ String runtimeLocation = JBossWSCreationUtils
+ .getJBossWSRuntimeLocation(project);
+ String commandLocation = runtimeLocation + Path.SEPARATOR + "bin";
IPath path = new Path(commandLocation);
- String command = "sh " + cmdFileName_linux;
- if(System.getProperty("os.name").toLowerCase().indexOf("win") >= 0){
- command = "cmd.exe /c " + cmdFileName_win;
+ StringBuffer command = new StringBuffer();
+ if (System.getProperty("os.name").toLowerCase().indexOf("win") >= 0) {
+ command.append("cmd.exe /c ").append(cmdFileName_win);
path = path.append(cmdFileName_win);
- }else{
+ } else {
+ command.append("sh ").append(cmdFileName_linux);
path = path.append(cmdFileName_linux);
}
-
- if(!path.toFile().getAbsoluteFile().exists()){
- return StatusUtils.errorStatus(
- NLS.bind(JBossWSCreationCoreMessages.Error_Message_Command_File_Not_Found,
- new String[] {path.toOSString()}));
+
+ if (!path.toFile().getAbsoluteFile().exists()) {
+ return StatusUtils
+ .errorStatus(NLS
+ .bind(
+ JBossWSCreationCoreMessages.Error_Message_Command_File_Not_Found,
+ new String[] { path.toOSString() }));
}
-
- String args = getCommandlineArgs();
- command += " -k " + args + " " + model.getWsdlURI();
+
+ String args = getCommandlineArgs();
+ command.append(" -k ").append(args).append(" ");
+ if(model.getWsdlURI() != null){
+ command.append(model.getWsdlURI());
+ }
+ command.append(" -o ").append(projectRoot).append(Path.SEPARATOR)
+ .append(
+ javaProject.getOutputLocation()
+ .removeFirstSegments(1).toOSString());
Runtime rt = Runtime.getRuntime();
- Process proc = rt.exec(command, null, new File(commandLocation));
- StringBuffer errorResult = new StringBuffer();
- StringBuffer inputResult = new StringBuffer();
-
- convertInputStreamToString(errorResult, proc.getErrorStream());
- convertInputStreamToString(inputResult, proc.getInputStream());
-
- int exitValue = proc.waitFor();
-
- if(exitValue != 0){
- return StatusUtils.errorStatus(errorResult.toString());
- }else{
- String resultInput = inputResult.toString();
- if(resultInput != null && resultInput.indexOf("[ERROR]") >= 0){
- JBossWSCreationCore.getDefault().logError(resultInput);
- IStatus errorStatus = StatusUtils.errorStatus(resultInput);
- status = StatusUtils
- .errorStatus(
- JBossWSCreationCoreMessages.Error_Message_Failed_To_Generate_Code,
- new CoreException(errorStatus));
- }else{
- JBossWSCreationCore.getDefault().logInfo(resultInput);
- }
- }
-
+ Process proc = rt.exec(command.toString(), null, new File(
+ commandLocation));
+ StringBuffer errorResult = new StringBuffer();
+ StringBuffer inputResult = new StringBuffer();
+
+ convertInputStreamToString(errorResult, proc.getErrorStream());
+ convertInputStreamToString(inputResult, proc.getInputStream());
+
+ int exitValue = proc.waitFor();
+
+ if (exitValue != 0) {
+ return StatusUtils.errorStatus(errorResult.toString());
+ } else {
+ String resultInput = inputResult.toString();
+ if (resultInput != null && resultInput.indexOf("[ERROR]") >= 0) {
+ JBossWSCreationCore.getDefault().logError(resultInput);
+ IStatus errorStatus = StatusUtils.errorStatus(resultInput);
+ status = StatusUtils
+ .errorStatus(
+ JBossWSCreationCoreMessages.Error_Message_Failed_To_Generate_Code,
+ new CoreException(errorStatus));
+ } else {
+ JBossWSCreationCore.getDefault().logInfo(resultInput);
+ }
+ }
+
} catch (IOException e) {
JBossWSCreationCore.getDefault().logError(e);
-
+
} catch (InterruptedException e) {
- // ignore
- } catch (CoreException e) {
+ // ignore
+ } catch (CoreException e) {
JBossWSCreationCore.getDefault().logError(e);
- //unable to get runtime location
+ // unable to get runtime location
return e.getStatus();
}
-
+
refreshProject(model.getWebProjectName(), monitor);
-
-
+
return status;
}
-
- private void convertInputStreamToString(final StringBuffer result, final InputStream input) {
+ private void convertInputStreamToString(final StringBuffer result,
+ final InputStream input) {
+
Thread thread = new Thread() {
public void run() {
@@ -129,25 +145,25 @@
}
};
-
+
thread.start();
}
-
- private void refreshProject(String project, IProgressMonitor monitor){
+
+ private void refreshProject(String project, IProgressMonitor monitor) {
try {
- JBossWSCreationUtils.getProjectByName(project).refreshLocal(2, monitor);
+ JBossWSCreationUtils.getProjectByName(project).refreshLocal(2,
+ monitor);
} catch (CoreException e) {
e.printStackTrace();
JBossWSCreationCore.getDefault().logError(e);
}
}
-
+
abstract protected String getCommandlineArgs();
-
+
abstract protected String getCommandLineFileName_linux();
+
abstract protected String getCommandLineFileName_win();
-
-
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java 2008-11-14 06:49:46 UTC (rev 11780)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java 2008-11-14 07:20:12 UTC (rev 11781)
@@ -62,12 +62,12 @@
seperator = SEPERATOR_LINUX;
}
StringBuffer commandLine = new StringBuffer();
- String project = model.getWebProjectName();
- String projectRoot = JBossWSCreationUtils.getProjectRoot(project)
+ String projectName = model.getWebProjectName();
+ String projectRoot = JBossWSCreationUtils.getProjectRoot(projectName)
.toOSString();
IProject iProject = ResourcesPlugin.getWorkspace().getRoot()
- .getProject(project);
+ .getProject(projectName);
IJavaProject javaProject = JavaCore.create(iProject);
commandLine.append(" -s ").append(projectRoot).append(Path.SEPARATOR)
@@ -80,10 +80,6 @@
javaProject.getOutputLocation().removeFirstSegments(1)
.toOSString()).append(seperator);
commandLine.append(getClasspathEntries(javaProject)).append("\" ");
- commandLine.append(" -o ").append(projectRoot).append(
- Path.SEPARATOR).append(
- javaProject.getOutputLocation().removeFirstSegments(1)
- .toOSString());
} catch (JavaModelException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
17 years, 5 months
JBoss Tools SVN: r11780 - in trunk/ws/plugins/org.jboss.tools.ws.creation.core: src/org/jboss/tools/ws/creation/core/commands and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-11-14 01:49:46 -0500 (Fri, 14 Nov 2008)
New Revision: 11780
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java
Log:
JBIDE-3173:Can not load class when generate Web Service code using JBossWS as web service runtime
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/META-INF/MANIFEST.MF 2008-11-14 06:49:16 UTC (rev 11779)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/META-INF/MANIFEST.MF 2008-11-14 06:49:46 UTC (rev 11780)
@@ -30,7 +30,9 @@
org.eclipse.wst.common.project.facet.core,
org.eclipse.wst.server.core,
org.jboss.tools.common,
- org.jboss.ide.eclipse.as.classpath.core;bundle-version="1.0.0"
+ org.jboss.ide.eclipse.as.classpath.core;bundle-version="1.0.0",
+ org.eclipse.jst.server.core;bundle-version="1.1.0",
+ org.eclipse.jdt;bundle-version="3.4.0"
Bundle-ActivationPolicy: lazy
Export-Package: org.jboss.tools.ws.creation.core,
org.jboss.tools.ws.creation.core.commands,
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java 2008-11-14 06:49:16 UTC (rev 11779)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java 2008-11-14 06:49:46 UTC (rev 11780)
@@ -11,23 +11,39 @@
package org.jboss.tools.ws.creation.core.commands;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.core.JavaProject;
+import org.eclipse.jst.server.core.internal.RuntimeClasspathContainer;
+import org.jboss.tools.ws.core.classpath.JBossWSRuntimeClassPathInitializer.JBossWSRuntimeClasspathContainer;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
/**
* @author Grid Qian
*/
+@SuppressWarnings("restriction")
public class WSProviderInvokeCommand extends AbstractGenerateCodeCommand {
- private static String WSPROVIDER_FILE_NAME_LINUX = "wsprovide.sh";
+ private static String WSPROVIDER_FILE_NAME_LINUX = "wsprovide.sh";
private static String WSPROVIDER_FILE_NAME_WIN = "wsprovide.bat";
-
+ private static String SEPERATOR_WIN = ";";
+ private static String SEPERATOR_LINUX = ":";
+ private String seperator;
+
public WSProviderInvokeCommand(ServiceModel model) {
super(model);
}
-
@Override
protected String getCommandLineFileName_linux() {
return WSPROVIDER_FILE_NAME_LINUX;
@@ -40,28 +56,81 @@
@Override
protected String getCommandlineArgs() {
- String commandLine;
+ if (System.getProperty("os.name").toLowerCase().indexOf("win") >= 0) {
+ seperator = SEPERATOR_WIN;
+ } else {
+ seperator = SEPERATOR_LINUX;
+ }
+ StringBuffer commandLine = new StringBuffer();
String project = model.getWebProjectName();
String projectRoot = JBossWSCreationUtils.getProjectRoot(project)
.toOSString();
- commandLine = "-s " + projectRoot + Path.SEPARATOR + "src";
+ IProject iProject = ResourcesPlugin.getWorkspace().getRoot()
+ .getProject(project);
+ IJavaProject javaProject = JavaCore.create(iProject);
+
+ commandLine.append(" -s ").append(projectRoot).append(Path.SEPARATOR)
+ .append("src");
+
+ try {
+ commandLine.append(" -c ").append("\"");
+
+ commandLine.append(projectRoot).append(Path.SEPARATOR).append(
+ javaProject.getOutputLocation().removeFirstSegments(1)
+ .toOSString()).append(seperator);
+ commandLine.append(getClasspathEntries(javaProject)).append("\" ");
+ commandLine.append(" -o ").append(projectRoot).append(
+ Path.SEPARATOR).append(
+ javaProject.getOutputLocation().removeFirstSegments(1)
+ .toOSString());
+ } catch (JavaModelException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
if (model.isGenWSDL()) {
- commandLine += " -w ";
+ commandLine.append(" -w ");
}
+ commandLine.append(" -r ").append(projectRoot).append(Path.SEPARATOR)
+ .append("WebContent").append(Path.SEPARATOR).append("wsdl ");
+ commandLine.append(model.getServiceClasses().get(0));
- commandLine += " -o " + projectRoot + Path.SEPARATOR
- + "build/classes/ ";
+ return commandLine.toString();
- commandLine += " -r " + projectRoot + Path.SEPARATOR + "WebContent"
- + Path.SEPARATOR + "wsdl ";
+ }
- commandLine += " -c " + projectRoot + Path.SEPARATOR
- + "build/classes/ ";
+ private String getClasspathEntries(IJavaProject javaProject) {
+ IClasspathEntry[] iniEntries = null;
+ List<IClasspathEntry> pathList = new ArrayList<IClasspathEntry>();
+ IClasspathEntry[] resolvedEntries = null;
+ try {
+ iniEntries = javaProject.getRawClasspath();
+ for (IClasspathEntry entry : iniEntries) {
+ IClasspathContainer container = JavaCore.getClasspathContainer(
+ entry.getPath(), javaProject);
+ if (!(container instanceof JBossWSRuntimeClasspathContainer)) {
+ if (!(container instanceof RuntimeClasspathContainer && container
+ .getDescription().contains("JBoss"))) {
+ pathList.add(entry);
+ }
+ }
+ }
+ resolvedEntries = ((JavaProject) javaProject)
+ .resolveClasspath(pathList
+ .toArray(new IClasspathEntry[pathList.size()]));
+ } catch (JavaModelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ StringBuffer path = new StringBuffer();
+ for (IClasspathEntry entry : resolvedEntries) {
+ if (entry.getEntryKind() == 3 || entry.getEntryKind() == 2) {
+ // path.append(workspaceRoot);
+ continue;
+ }
+ path.append(entry.getPath().toOSString()).append(seperator);
+ }
+ return path.toString();
- commandLine += model.getServiceClasses().get(0);
-
- return commandLine;
-
}
}
17 years, 5 months
JBoss Tools SVN: r11779 - trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-11-14 01:49:16 -0500 (Fri, 14 Nov 2008)
New Revision: 11779
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
Log:
JBIDE-3037: ESB project wizard should just warn if server runtime does not contain ESB runtime
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2008-11-14 05:35:58 UTC (rev 11778)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2008-11-14 06:49:16 UTC (rev 11779)
@@ -351,10 +351,10 @@
.findRuntime(runtime.getProperty("id")); //$NON-NLS-1$
if (!JBossRuntimeManager.isValidESBServer(serverRuntime
.getLocation().toOSString())) {
- hasRuntime = false;
- setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime);
+ hasRuntime = true;
+ setMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime, WARNING);
setPageComplete(isPageComplete());
- return false;
+ return true;
}
}
// when the UI loaded from project facet properties page
@@ -375,10 +375,10 @@
.findRuntime(runtime.getProperty("id"));
if (!JBossRuntimeManager.isValidESBServer(serverRuntime
.getLocation().toOSString())) {
- setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime);
- hasRuntime = false;
+ setMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime, WARNING);
+ hasRuntime = true;
setPageComplete(isPageComplete());
- return false;
+ return true;
}
}
}
17 years, 5 months
JBoss Tools SVN: r11778 - trunk/esb/plugins/org.jboss.tools.esb.project.core.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-11-14 00:35:58 -0500 (Fri, 14 Nov 2008)
New Revision: 11778
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
Log:
JBIDE-3041: I should be able to Run/Debug on server for esb projects
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2008-11-14 04:50:46 UTC (rev 11777)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2008-11-14 05:35:58 UTC (rev 11778)
@@ -143,29 +143,36 @@
point="org.eclipse.wst.server.core.moduleArtifactAdapters">
<moduleArtifactAdapter
class="org.jboss.tools.esb.core.module.JBossESBModuleArtifactAdapter"
- id="org.jboss.tools.esb.project.core.moduleArtifactAdapter">
+ id="org.jboss.tools.esb.project.core.moduleArtifactAdapter1">
<enablement>
<with
variable="selection">
- <or>
- <adapt
- type="org.eclipse.core.resources.IProject">
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jst.jboss.esb">
- </test>
- </adapt>
- <adapt
- type="org.eclipse.core.resources.IFile">
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jst.jboss.esb">
- </test>
- </adapt>
- </or>
+ <adapt
+ type="org.eclipse.core.resources.IProject">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="jst.jboss.esb">
+ </test>
+ </adapt>
</with></enablement>
</moduleArtifactAdapter>
+ <moduleArtifactAdapter
+ class="org.jboss.tools.esb.core.module.JBossESBModuleArtifactAdapter"
+ id="org.jboss.tools.esb.project.core.moduleArtifactAdapter2">
+ <enablement>
+ <with
+ variable="selection">
+ <adapt
+ type="org.eclipse.core.resources.IFile">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="jst.jboss.esb">
+ </test>
+ </adapt>
+ </with>
+ </enablement>
+ </moduleArtifactAdapter>
</extension>
</plugin>
17 years, 5 months
JBoss Tools SVN: r11777 - trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-11-13 23:50:46 -0500 (Thu, 13 Nov 2008)
New Revision: 11777
Added:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleFactory.java
Removed:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDeployable.java
Log:
JBIDE-3192: ESB deployment doesn't pick up all classes
Deleted: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDeployable.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDeployable.java 2008-11-14 03:35:58 UTC (rev 11776)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDeployable.java 2008-11-14 04:50:46 UTC (rev 11777)
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.esb.core.module;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.web.internal.deployables.ComponentDeployable;
-import org.jboss.tools.esb.core.ESBProjectConstant;
-
-public class JBossESBModuleDeployable extends ComponentDeployable {
-
- public JBossESBModuleDeployable(IProject project, IVirtualComponent component) {
- super(project);
- }
-
-
- public String getURI(IModule module) {
- IVirtualComponent comp = ComponentCore.createComponent(module.getProject());
- String aURI = null;
- if (comp !=null) {
- if (!comp.isBinary() && isProjectOfType(module.getProject(),ESBProjectConstant.ESB_PROJECT_FACET)) {
- IVirtualReference ref = component.getReference(comp.getName());
- aURI = ref.getRuntimePath().append(comp.getName()+".esb").toString(); //$NON-NLS-1$
- }
- }
-
- if (aURI !=null && aURI.length()>1 && aURI.startsWith("/")) //$NON-NLS-1$
- aURI = aURI.substring(1);
- return aURI;
- }
-
- public String getVersion() {
- IFacetedProject facetedProject = null;
- try {
- facetedProject = ProjectFacetsManager.create(component.getProject());
- if (facetedProject !=null && ProjectFacetsManager.isProjectFacetDefined(ESBProjectConstant.ESB_PROJECT_FACET)) {
- IProjectFacet projectFacet = ProjectFacetsManager.getProjectFacet(ESBProjectConstant.ESB_PROJECT_FACET);
- return facetedProject.getInstalledVersion(projectFacet).getVersionString();
- }
- } catch (Exception e) {
- //Ignore
- }
- return "4.2"; //$NON-NLS-1$
- }
-
-
-}
Added: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleFactory.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleFactory.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleFactory.java 2008-11-14 04:50:46 UTC (rev 11777)
@@ -0,0 +1,48 @@
+package org.jboss.tools.esb.core.module;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.model.ModuleDelegate;
+import org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate;
+import org.jboss.tools.esb.core.ESBProjectConstant;
+import org.jboss.tools.esb.core.ESBProjectCorePlugin;
+
+public class JBossESBModuleFactory extends ProjectModuleFactoryDelegate {
+
+ public JBossESBModuleFactory() {
+ }
+
+ @Override
+ public ModuleDelegate getModuleDelegate(IModule module) {
+ if(module instanceof JBossESBModule){
+ IProject project = module.getProject();
+ return new JBossESBModuleDelegate(project);
+ }
+ return null;
+ }
+
+ protected IModule[] createModules(IProject project) {
+ IFacetedProject facetProject;
+ try {
+ facetProject = ProjectFacetsManager.create(project);
+ if (facetProject == null) {
+ return null;
+ }
+ IProjectFacet esbFacet = ProjectFacetsManager.getProjectFacet(ESBProjectConstant.ESB_PROJECT_FACET);
+
+ if(facetProject.hasProjectFacet(esbFacet)){
+ JBossESBModule module = new JBossESBModule(project, this, this.getId());
+ return new IModule[]{ module };
+ }
+ } catch (CoreException e) {
+ ESBProjectCorePlugin.getDefault().getLog().log(e.getStatus());
+ }
+ return null;
+
+ }
+
+}
17 years, 5 months
JBoss Tools SVN: r11776 - in trunk/esb/plugins/org.jboss.tools.esb.project.core: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-11-13 22:35:58 -0500 (Thu, 13 Nov 2008)
New Revision: 11776
Added:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleArtifactAdapter.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java
Removed:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleFactory.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/META-INF/MANIFEST.MF
trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetInstallationDelegate.java
Log:
JBIDE-3192: ESB deployment doesn't pick up all classes
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/META-INF/MANIFEST.MF 2008-11-14 01:51:23 UTC (rev 11775)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/META-INF/MANIFEST.MF 2008-11-14 03:35:58 UTC (rev 11776)
@@ -28,7 +28,8 @@
org.jboss.ide.eclipse.as.classpath.core,
org.eclipse.wst.web;bundle-version="1.1.204",
org.eclipse.jem.util;bundle-version="2.0.100",
- org.eclipse.wst.common.emfworkbench.integration;bundle-version="1.1.201"
+ org.eclipse.wst.common.emfworkbench.integration;bundle-version="1.1.201",
+ org.eclipse.emf.ecore;bundle-version="2.4.1"
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
Export-Package: org.jboss.tools.esb.core,
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2008-11-14 01:51:23 UTC (rev 11775)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2008-11-14 03:35:58 UTC (rev 11776)
@@ -142,8 +142,30 @@
<extension
point="org.eclipse.wst.server.core.moduleArtifactAdapters">
<moduleArtifactAdapter
- id="org.jboss.tools.esb.project.core.moduleArtifactAdapter1">
- <enablement></enablement>
+ class="org.jboss.tools.esb.core.module.JBossESBModuleArtifactAdapter"
+ id="org.jboss.tools.esb.project.core.moduleArtifactAdapter">
+ <enablement>
+ <with
+ variable="selection">
+ <or>
+ <adapt
+ type="org.eclipse.core.resources.IProject">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="jst.jboss.esb">
+ </test>
+ </adapt>
+ <adapt
+ type="org.eclipse.core.resources.IFile">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="jst.jboss.esb">
+ </test>
+ </adapt>
+ </or>
+ </with></enablement>
</moduleArtifactAdapter>
</extension>
</plugin>
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetInstallationDelegate.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetInstallationDelegate.java 2008-11-14 01:51:23 UTC (rev 11775)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetInstallationDelegate.java 2008-11-14 03:35:58 UTC (rev 11776)
@@ -12,6 +12,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jst.common.project.facet.WtpUtils;
@@ -43,26 +44,34 @@
// Setup the flexible project structure.
final IVirtualComponent c = ComponentCore.createComponent(project);
c.create(0, null);
- String esbContent = model.getStringProperty(IJBossESBFacetDataModelProperties.ESB_CONTENT_FOLDER);
- c.setMetaProperty("java-output-path", "/" + esbContent + "/build/classes/");
+ //String esbContent = model.getStringProperty(IJBossESBFacetDataModelProperties.ESB_CONTENT_FOLDER);
+ c.setMetaProperty("java-output-path", "/build/classes/");
final IVirtualFolder jbiRoot = c.getRootFolder();
// Create directory structure
- String srcFolder = null;
+ /*String srcFolder = null;
srcFolder = model
.getStringProperty(IJBossESBFacetDataModelProperties.ESB_SOURCE_FOLDER);
- jbiRoot.createLink(new Path("/" + srcFolder), 0, null);
+ jbiRoot.createLink(new Path("/" + srcFolder), 0, null);*/
String resourcesFolder = model
.getStringProperty(IJBossESBFacetDataModelProperties.ESB_CONTENT_FOLDER);
jbiRoot.createLink(new Path("/" + resourcesFolder), 0, null);
+ final IVirtualFolder jsrc = c.getRootFolder().getFolder("/esbcontent"); //$NON-NLS-1$
+ final IClasspathEntry[] cp = jproj.getRawClasspath();
+ for (int i = 0; i < cp.length; i++) {
+ final IClasspathEntry cpe = cp[i];
+ if (cpe.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
+ if( cpe.getPath().removeFirstSegments(1).segmentCount() > 0 )
+ jsrc.createLink(cpe.getPath().removeFirstSegments(1), 0, null);
+ }
+ }
//addESBNature(project);
- String runtimeId = model
- .getStringProperty(IJBossESBFacetDataModelProperties.RUNTIME_ID);
+
JBossClassPathCommand command = new JBossClassPathCommand(project,
model);
IStatus status = command.executeOverride(monitor);
Added: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleArtifactAdapter.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleArtifactAdapter.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleArtifactAdapter.java 2008-11-14 03:35:58 UTC (rev 11776)
@@ -0,0 +1,91 @@
+package org.jboss.tools.esb.core.module;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate;
+import org.eclipse.wst.server.core.util.WebResource;
+import org.jboss.tools.esb.core.ESBProjectConstant;
+
+public class JBossESBModuleArtifactAdapter extends
+ ModuleArtifactAdapterDelegate {
+
+ public JBossESBModuleArtifactAdapter() {
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public IModuleArtifact getModuleArtifact(Object obj) {
+
+ IResource resource = null;
+ if (obj instanceof IResource)
+ resource = (IResource) obj;
+ else if (obj instanceof IAdaptable)
+ resource = (IResource) ((IAdaptable) obj).getAdapter(IResource.class);
+
+ if (resource == null)
+ return null;
+
+ if (resource instanceof IProject) {
+ IProject project = (IProject) resource;
+ if (isESBProject(project))
+ return new WebResource(getModule(project), new Path("")); //$NON-NLS-1$
+ return null;
+ }
+ IProject project = ProjectUtilities.getProject(resource);
+ if (project != null && !isESBProject(project))
+ return null;
+
+ IVirtualComponent comp = ComponentCore.createComponent(project);
+ // determine path
+ IPath rootPath = comp.getRootFolder().getProjectRelativePath();
+ IPath resourcePath = resource.getProjectRelativePath();
+
+ // Check to make sure the resource is under the Application directory
+ if (resourcePath.matchingFirstSegments(rootPath) != rootPath.segmentCount())
+ return null;
+
+
+ // return Web resource type
+ return new WebResource(getModule(project), resourcePath);
+
+ }
+
+ protected static IModule getModule(IProject project) {
+ if (isESBProject(project))
+ return ServerUtil.getModule(project);
+ return null;
+ }
+
+ protected static boolean isESBProject(IProject project) {
+ return isProjectOfType(project, ESBProjectConstant.ESB_PROJECT_FACET);
+ }
+
+ protected static boolean isProjectOfType(IProject project, String typeID) {
+ IFacetedProject facetedProject = null;
+ try {
+ facetedProject = ProjectFacetsManager.create(project);
+ } catch (CoreException e) {
+ return false;
+ }
+
+ if (facetedProject != null && ProjectFacetsManager.isProjectFacetDefined(typeID)) {
+ IProjectFacet projectFacet = ProjectFacetsManager.getProjectFacet(typeID);
+ return projectFacet != null && facetedProject.hasProjectFacet(projectFacet);
+ }
+ return false;
+ }
+
+}
Added: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java 2008-11-14 03:35:58 UTC (rev 11776)
@@ -0,0 +1,106 @@
+package org.jboss.tools.esb.core.module;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.util.ModuleFile;
+import org.eclipse.wst.server.core.util.ModuleFolder;
+import org.eclipse.wst.server.core.util.ProjectModule;
+import org.jboss.tools.esb.core.StatusUtils;
+
+public class JBossESBModuleDelegate extends ProjectModule {
+
+ public JBossESBModuleDelegate(IProject project){
+ super(project);
+ }
+ @Override
+ public IModule[] getChildModules() {
+ return null;
+ }
+
+ public IModuleResource[] members() throws CoreException {
+ IProject project = getProject();
+ final IVirtualComponent c = ComponentCore.createComponent(project);
+ IVirtualFolder vf = c.getRootFolder();
+ IContainer[] folders = vf.getUnderlyingFolders();
+ if(folders == null || folders.length == 0){
+ throw new CoreException(StatusUtils.errorStatus("The project is not a valid JBoss ESB project."));
+ }
+
+ //this is because of the beta1 workspace meta data, so try to get esbcontent folder name by this way,
+ //in the JBT CR1, the length of folders will be 1.
+ IContainer contentFolder = folders.length > 1? folders[1] : folders[0];
+
+ IFolder configFolder = project.getFolder(contentFolder.getProjectRelativePath());
+ IJavaProject javaPrj = JavaCore.create(project);
+ IPath output = javaPrj.getOutputLocation();
+ // if the jboss-esb.xml file is not in META-INF folder, try to get it from other folder of the project
+ // block this logic as Max's suggestion
+ //List<IModuleResource> mrs = getConfigModuleFile(project, configFolder);
+
+ List<IModuleResource> mrs = new ArrayList<IModuleResource>();
+
+ IModuleResource[] esbContent = getModuleResources(Path.EMPTY, configFolder);
+ IModuleResource[] classes = getModuleResources(Path.EMPTY, project.getWorkspace().getRoot().getFolder(output));
+ IModuleResource[] allResource = new IModuleResource[esbContent.length + classes.length + mrs.size()];
+ System.arraycopy(esbContent, 0, allResource, 0, esbContent.length);
+ System.arraycopy(classes, 0, allResource, esbContent.length, classes.length);
+ if(mrs.size() > 0){
+ IModuleResource[] mr = mrs.toArray(new IModuleResource[]{});
+ System.arraycopy(mr, 0, allResource, esbContent.length + classes.length, mr.length);
+ }
+ return allResource;
+ }
+
+
+
+ @Override
+ public IStatus validate() {
+ return null;
+ }
+
+ @Override
+ protected IModuleResource[] getModuleResources(IPath path, IContainer container) throws CoreException {
+
+ IResource[] resources = container.members();
+ if (resources != null) {
+ int size = resources.length;
+ List<IModuleResource> list = new ArrayList<IModuleResource>(size);
+ for (int i = 0; i < size; i++) {
+ IResource resource = resources[i];
+ if (resource != null && resource.exists()) {
+ String name = resource.getName();
+ if (resource instanceof IContainer) {
+ IContainer container2 = (IContainer) resource;
+ ModuleFolder mf = new ModuleFolder(container2, name, path);
+ mf.setMembers(getModuleResources(path.append(name), container2));
+ list.add(mf);
+ } else if (resource instanceof IFile) {
+ list.add(new ModuleFile((IFile) resource, name, path));
+ }
+ }
+ }
+ IModuleResource[] moduleResources = new IModuleResource[list.size()];
+ list.toArray(moduleResources);
+ return moduleResources;
+ }
+ return new IModuleResource[0];
+ }
+
+}
Deleted: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleFactory.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleFactory.java 2008-11-14 01:51:23 UTC (rev 11775)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleFactory.java 2008-11-14 03:35:58 UTC (rev 11776)
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.esb.core.module;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.common.componentcore.internal.StructureEdit;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.model.ModuleDelegate;
-import org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate;
-import org.jboss.tools.esb.core.ESBProjectConstant;
-import org.jboss.tools.esb.core.ESBProjectCorePlugin;
-import org.jboss.tools.esb.core.StatusUtils;
-
-public class JBossESBModuleFactory extends ProjectModuleFactoryDelegate {
-
- private static final String ID = "org.jboss.tools.esb.project.core.moduleFactory"; //$NON-NLS-1$
- protected ArrayList moduleDelegates = new ArrayList();
-
- /*
- * @see DeployableProjectFactoryDelegate#getFactoryID()
- */
- public static String getFactoryId() {
- return ID;
- }
- protected IModule[] createModules(ModuleCoreNature nature) {
-
- IProject project = nature.getProject();
- try {
- IVirtualComponent comp = ComponentCore.createComponent(project);
- return createModuleDelegates(comp);
- } catch (Exception e) {
- ESBProjectCorePlugin.getDefault().getLog().log(StatusUtils.errorStatus(e));
- }
- return null;
- }
- /**
- * Returns true if the project represents a deployable project of this type.
- *
- * @param project
- * org.eclipse.core.resources.IProject
- * @return boolean
- */
- protected boolean isValidModule(IProject project) {
- try {
- IFacetedProject facetedProject = ProjectFacetsManager.create(project);
- if (facetedProject == null)
- return false;
- IProjectFacet webFacet = ProjectFacetsManager.getProjectFacet(ESBProjectConstant.ESB_PROJECT_FACET);
- return facetedProject.hasProjectFacet(webFacet);
- } catch (Exception e) {
- return false;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.server.core.model.ModuleFactoryDelegate#getModuleDelegate(org.eclipse.wst.server.core.IModule)
- */
- public ModuleDelegate getModuleDelegate(IModule module) {
- for (Iterator iter = moduleDelegates.iterator(); iter.hasNext();) {
- ModuleDelegate element = (ModuleDelegate) iter.next();
- if (module == element.getModule())
- return element;
- }
- return null;
-
- }
-
- protected IModule[] createModules(IProject project) {
- try {
- if (project.exists()) {
- ModuleCoreNature nature = (ModuleCoreNature) project.getNature(IModuleConstants.MODULE_NATURE_ID);
- if (nature != null)
- return createModules(nature);
- }
- } catch (CoreException e) {
- ESBProjectCorePlugin.getDefault().getLog().log(StatusUtils.errorStatus(e));
- }
- return null;
- }
-
- protected IModule[] createModuleDelegates(IVirtualComponent component) throws CoreException {
- JBossESBModuleDeployable moduleDelegate = null;
- IModule module = null;
- try {
- if(isValidModule(component.getProject())) {
- moduleDelegate = new JBossESBModuleDeployable(component.getProject(),component);
- module = createModule(component.getName(), component.getName(),ESBProjectConstant.ESB_PROJECT_FACET, moduleDelegate.getVersion(), moduleDelegate.getProject());
- moduleDelegate.initialize(module);
- }
- } catch (Exception e) {
- ESBProjectCorePlugin.getDefault().getLog().log(StatusUtils.errorStatus(e));
- } finally {
- if (module != null) {
- if (getModuleDelegate(module) == null)
- moduleDelegates.add(moduleDelegate);
- }
- }
- if (module == null)
- return null;
- return new IModule[] {module};
- }
-
- /**
- * Returns the list of resources that the module should listen to
- * for state changes. The paths should be project relative paths.
- * Subclasses can override this method to provide the paths.
- *
- * @return a possibly empty array of paths
- */
- protected IPath[] getListenerPaths() {
- return new IPath[] {
- new Path(".project"), // nature //$NON-NLS-1$
- new Path(StructureEdit.MODULE_META_FILE_NAME), // component
- new Path(".settings/org.eclipse.wst.common.project.facet.core.xml") // facets //$NON-NLS-1$
- };
- }
-
-}
17 years, 5 months
JBoss Tools SVN: r11775 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-11-13 20:51:23 -0500 (Thu, 13 Nov 2008)
New Revision: 11775
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
Log:
Compilation error in RichFacesDataFilterSliderTemplate was fixed.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-11-13 19:36:31 UTC (rev 11774)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-11-14 01:51:23 UTC (rev 11775)
@@ -112,4 +112,6 @@
public static final String STYLE_PARAMETER_BACKGROUND_IMAGE = "background-image"; //$NON-NLS-1$
public static final String STYLE_PARAMETER_MAX_HEIGHT = "max-height"; //$NON-NLS-1$
public static final String STYLE_PARAMETER_ZINDEX = "z-index"; //$NON-NLS-1$
+ public static final String STYLE_PARAMETER_CLEAR = "clear"; //$NON-NLS-1$
+ public static final Object VALUE_CLEAR_BOTH = "both"; //$NON-NLS-1$
}
\ No newline at end of file
17 years, 5 months
JBoss Tools SVN: r11774 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-11-13 14:36:31 -0500 (Thu, 13 Nov 2008)
New Revision: 11774
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpePreviewDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
JBIDE-3144
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpePreviewDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpePreviewDomBuilder.java 2008-11-13 19:27:52 UTC (rev 11773)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpePreviewDomBuilder.java 2008-11-13 19:36:31 UTC (rev 11774)
@@ -37,8 +37,6 @@
boolean rebuildFlag = false;
-// private static final String YES_STRING = "yes";
-
/**
*
* @param domMapping
@@ -77,8 +75,19 @@
if (ElService.getInstance().isCloneableNode(getPageContext(), sourceNode)) {
final Node sourceNodeClone = VpeProxyUtil.createProxyForELExpressionNode(getPageContext(),
sourceNode);
- creationData = template.create(getPageContext(), sourceNodeClone, getVisualDocument());
- } else {
+ try {
+ creationData = template.create(getPageContext(),
+ sourceNodeClone, getVisualDocument());
+ //Fix for JBIDE-3144, we use proxy and some template can
+ //try to cast for not supported interface
+ } catch(ClassCastException ex) {
+ VpePlugin.reportProblem(ex);
+ //then we create template without using proxy
+ creationData = template.create(getPageContext(), sourceNode,
+ getVisualDocument());
+ }
+
+ } else {
creationData = template.create(getPageContext(), sourceNode, getVisualDocument());
}
}catch (XPCOMException ex) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-11-13 19:27:52 UTC (rev 11773)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-11-13 19:36:31 UTC (rev 11774)
@@ -446,19 +446,19 @@
sourceNodeClone = VpeProxyUtil.createProxyForELExpressionNode(getPageContext(),
sourceNode);
-// if(sourceNodeClone instanceof Element){
-// ((Element)sourceNodeClone).setAttribute(PARENT,""); //$NON-NLS-1$
-// Attr a = ((Element)sourceNodeClone).getAttributeNode(PARENT);
-// a.setUserData(PARENT, sourceNode.getParentNode(),null);
-//
-// //added by estherbin fix https://jira.jboss.org/jira/browse/JBIDE-1605 issue.
-// sourceNodeClone.setUserData(SRC_NODE, sourceNode,null);
-//
-// }
-// template.beforeTemplateCreated(getPageContext(),
-// sourceNodeClone, getVisualDocument());
+ try {
creationData = template.create(getPageContext(),
sourceNodeClone, getVisualDocument());
+ //Fix for JBIDE-3144, we use proxy and some template can
+ //try to cast for not supported interface
+ } catch(ClassCastException ex) {
+ VpePlugin.reportProblem(ex);
+ sourceNodeClone = null;
+ //then we create template without using proxy
+ creationData = template.create(getPageContext(), sourceNode,
+ getVisualDocument());
+ }
+
} else {
creationData = template.create(getPageContext(), sourceNode,
getVisualDocument());
17 years, 5 months
JBoss Tools SVN: r11773 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: izhukov
Date: 2008-11-13 14:27:52 -0500 (Thu, 13 Nov 2008)
New Revision: 11773
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataFilterSliderTemplate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2904 fixed
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataFilterSliderTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataFilterSliderTemplate.java 2008-11-13 18:54:45 UTC (rev 11772)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataFilterSliderTemplate.java 2008-11-13 19:27:52 UTC (rev 11773)
@@ -123,8 +123,12 @@
nsIDOMElement parentDiv = createDIV(visualDocument, styleClass, style);
// create RANGE container DIV tag element
+ String width = ComponentUtil.getAttribute(sourceElement, HTML.STYLE_PARAMETER_WIDTH);
+ if (width == null || width.equals(Constants.EMPTY)) {
+ width = new Integer(DEFAULT_WIDTH).toString();
+ }
style = new StringBuffer(HTML.STYLE_PARAMETER_WIDTH).append(Constants.COLON).
- append(DEFAULT_WIDTH).append(Constants.PIXEL).append(Constants.SEMICOLON).toString();
+ append(width).append(Constants.PIXEL).append(Constants.SEMICOLON).toString();
styleClass = ComponentUtil.getAttribute(sourceElement, RANGE_STYLE_CLASS_ATTR);
styleClass = new StringBuffer(DEFAULT_RANGE_STYLE).append(Constants.WHITE_SPACE).
append(RICH_DFS_RANGE_STYLE).append(Constants.WHITE_SPACE).append(styleClass).toString();
@@ -171,6 +175,12 @@
input.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TYPE_TEXT);
setAttributesToInputElement(input, sourceElement);
+ // create BR tag element
+ nsIDOMElement br = visualDocument.createElement(HTML.TAG_BR);
+ style = new StringBuffer(HTML.STYLE_PARAMETER_CLEAR).append(Constants.COLON).
+ append(HTML.VALUE_CLEAR_BOTH).append(Constants.SEMICOLON).toString();
+ br.setAttribute(HTML.ATTR_STYLE, HTML.VALUE_TYPE_TEXT);
+
// create DOM tree in correspondence order
parentDiv.appendChild(rangeDiv);
rangeDiv.appendChild(rangeDecorDiv);
@@ -180,6 +190,7 @@
handleDiv.appendChild(img);
parentDiv.appendChild(input);
+ parentDiv.appendChild(br);
// Create return variable contains template
VpeCreationData creationData = new VpeCreationData(parentDiv);
17 years, 5 months