Author: dennyxu
Date: 2009-08-21 05:58:17 -0400 (Fri, 21 Aug 2009)
New Revision: 17208
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetInstallationDelegate.java
Log:
JBIDE-4654: roll back this patch for now, once the jira JBIDE-4807 get fixed, the patch
can be applied again
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 2009-08-21
09:46:00 UTC (rev 17207)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetInstallationDelegate.java 2009-08-21
09:58:17 UTC (rev 17208)
@@ -11,6 +11,7 @@
package org.jboss.tools.esb.core.facet;
import java.io.ByteArrayInputStream;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.eclipse.core.resources.IFile;
@@ -19,7 +20,6 @@
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
@@ -27,7 +27,6 @@
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.common.frameworks.CommonFrameworksPlugin;
import org.eclipse.jst.common.project.facet.WtpUtils;
import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
import org.eclipse.wst.common.componentcore.ComponentCore;
@@ -46,11 +45,12 @@
public void execute(IProject project, IProjectFacetVersion fv,
Object config, IProgressMonitor monitor) throws CoreException {
model = (IDataModel) config;
- final IJavaProject jproj = JavaCore.create(project);
createProjectStructure(project);
+
+
+ final IJavaProject jproj = JavaCore.create(project);
-
// Add WTP natures.
WtpUtils.addNatures(project);
@@ -62,26 +62,31 @@
} catch (Exception e) {
c = ComponentCore.createComponent(project);
}
-
- String outputLoc = jproj.readOutputLocation().removeFirstSegments(1).toString();
+
+
c.create(0, null);
- c.setMetaProperty("java-output-path", outputLoc);
+ //String esbContent =
model.getStringProperty(IJBossESBFacetDataModelProperties.ESB_CONTENT_FOLDER);
+ c.setMetaProperty("java-output-path", "/build/classes/");
final IVirtualFolder jbiRoot = c.getRootFolder();
- // Map the esbcontent to root for deploy
- String resourcesFolder = model.getStringProperty(
- IJBossESBFacetDataModelProperties.ESB_CONTENT_FOLDER);
+ // Create directory structure
+ /*String srcFolder = null;
+ srcFolder = model
+ .getStringProperty(IJBossESBFacetDataModelProperties.ESB_SOURCE_FOLDER);
+ 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("/"); //$NON-NLS-1$
- final IClasspathEntry[] cp2 = jproj.getRawClasspath();
- for (int i = 0; i < cp2.length; i++) {
- final IClasspathEntry cpe = cp2[i];
+ 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(new Path(outputLoc), 0, null);
+ jsrc.createLink(cpe.getPath().removeFirstSegments(1), 0, null);
}
}
@@ -97,6 +102,11 @@
ClasspathHelper.removeClasspathEntries(project, fv);
ClasspathHelper.addClasspathEntries(project, fv);
+
+ //String prjName =
model.getStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME);
+ //IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(prjName);
+
+
}
private IFile createJBossESBXML(IFolder folder) throws CoreException{
Show replies by date