JBoss Tools SVN: r18853 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-11-26 09:40:18 -0500 (Thu, 26 Nov 2009)
New Revision: 18853
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
Log:
JBIDE-5119: Refactor PageContextFactory to improve perfomance of context creation
cleanUp() methods are made due to allow the KbBuilder to clean up the cached contexts
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-11-26 14:14:46 UTC (rev 18852)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-11-26 14:40:18 UTC (rev 18853)
@@ -162,6 +162,42 @@
public static ELContext createPageContext(IFile file) {
return getInstance().createPageContext(file, null);
}
+
+ public void cleanUp(IFile file) {
+ if (file == null)
+ return;
+ synchronized (cache) {
+ ELContext removedContext = removeSavedContext(file);
+ if (removedContext == null || removedContext.getResource() == null)
+ return;
+
+ // Remove all the contexts that are parent to the removed context
+ Collection<ELContext> contexts = cache.values();
+ if (contexts != null) {
+ for (ELContext context : contexts) {
+ if (isDependencyContext(context, file)) {
+ removeSavedContext(file);
+ }
+ }
+ }
+ }
+ }
+
+ public void cleanUp(IProject project) {
+ if (project == null)
+ return;
+ synchronized (cache) {
+ // Remove all the contexts that are parent to the removed context
+ Collection<IFile> files = cache.keySet();
+ if (files != null) {
+ for (IFile file : files) {
+ if (project.equals(file.getProject())) {
+ cleanUp(file);
+ }
+ }
+ }
+ }
+ }
// long ctm = 0;
// String getContextType1(IFile file) {
@@ -872,13 +908,13 @@
int kind = delta.getKind();
IResource resource = delta.getResource();
- if(kind == IResourceDelta.CHANGED ||
- kind == IResourceDelta.ADDED ||
- kind == IResourceDelta.REMOVED ||
- kind == IResourceDelta.CONTENT) {
- cleanUpChachedResource(resource);
-// } else {
-// System.out.println("Resource modified [" + kind + "]: " + resource.getFullPath());
+ if( resource instanceof IProject && (
+// kind == IResourceDelta.CHANGED ||
+// kind == IResourceDelta.ADDED ||
+ kind == IResourceDelta.REMOVED // ||
+// kind == IResourceDelta.CONTENT)
+ )) {
+ cleanUp((IProject)resource);
}
IResourceDelta[] cs = delta.getAffectedChildren();
@@ -888,26 +924,6 @@
return;
}
- private void cleanUpChachedResource(IResource resource) {
- if (resource instanceof IFile) {
- synchronized (cache) {
- ELContext removedContext = removeSavedContext((IFile)resource);
- if (removedContext == null || removedContext.getResource() == null)
- return;
-
- // Remove all the contexts that are parent to the removed context
- Collection<ELContext> contexts = cache.values();
- if (contexts != null) {
- for (ELContext context : contexts) {
- if (isDependencyContext(context, (IFile)resource)) {
- removeSavedContext((IFile)resource);
- }
- }
- }
- }
- }
- }
-
private boolean isDependencyContext(ELContext context, IFile resource) {
if (resource.equals(context.getResource())) {
return true;
@@ -964,7 +980,7 @@
for (ELContext context : contexts) {
if (context instanceof XmlContextImpl &&
event.getDocument().equals(((XmlContextImpl)context).getDocument())) {
- cleanUpChachedResource(context.getResource());
+ cleanUp(context.getResource());
return;
}
}
15 years, 1 month
JBoss Tools SVN: r18852 - trunk/ws/docs/reference/en/images/topdown.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2009-11-26 09:14:46 -0500 (Thu, 26 Nov 2009)
New Revision: 18852
Modified:
trunk/ws/docs/reference/en/images/topdown/jbossws_bottomup_3.png
trunk/ws/docs/reference/en/images/topdown/jbossws_bottomup_4.png
trunk/ws/docs/reference/en/images/topdown/jbossws_ws_Impl_code_view.png
trunk/ws/docs/reference/en/images/topdown/jbossws_ws_webxml.png
Log:
JBDS-961 screens scaling - images - fixed
Modified: trunk/ws/docs/reference/en/images/topdown/jbossws_bottomup_3.png
===================================================================
(Binary files differ)
Modified: trunk/ws/docs/reference/en/images/topdown/jbossws_bottomup_4.png
===================================================================
(Binary files differ)
Modified: trunk/ws/docs/reference/en/images/topdown/jbossws_ws_Impl_code_view.png
===================================================================
(Binary files differ)
Modified: trunk/ws/docs/reference/en/images/topdown/jbossws_ws_webxml.png
===================================================================
(Binary files differ)
15 years, 1 month
JBoss Tools SVN: r18851 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-11-26 08:04:27 -0500 (Thu, 26 Nov 2009)
New Revision: 18851
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/ModelObjectStorageEditorInput.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4635
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/ModelObjectStorageEditorInput.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/ModelObjectStorageEditorInput.java 2009-11-26 12:45:12 UTC (rev 18850)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/ModelObjectStorageEditorInput.java 2009-11-26 13:04:27 UTC (rev 18851)
@@ -79,10 +79,10 @@
if(!(o instanceof JarSystemImpl)) return null;
String file = ((JarSystemImpl)o).getLocation();
- IFile[] fs = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(new File(file).toURI());
- if(fs == null || fs.length == 0) return null;
+// IFile[] fs = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(new File(file).toURI());
+// if(fs == null || fs.length == 0) return null;
- IProject p = fs[0].getProject();
+ IProject p = EclipseResourceUtil.getProject(o);
IJavaProject jp = EclipseResourceUtil.getJavaProject(p);
if(jp == null) return null;
15 years, 1 month
JBoss Tools SVN: r18850 - trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-11-26 07:45:12 -0500 (Thu, 26 Nov 2009)
New Revision: 18850
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/FaceletSourceTagHyperlink.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4635
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/FaceletSourceTagHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/FaceletSourceTagHyperlink.java 2009-11-26 12:21:21 UTC (rev 18849)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/FaceletSourceTagHyperlink.java 2009-11-26 12:45:12 UTC (rev 18850)
@@ -19,10 +19,13 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.core.JarEntryDirectory;
import org.eclipse.jdt.internal.core.JarEntryFile;
+import org.eclipse.jdt.internal.core.JarEntryResource;
import org.eclipse.jdt.internal.core.JarPackageFragmentRoot;
import org.eclipse.jdt.internal.ui.javaeditor.JarEntryEditorInput;
import org.eclipse.jface.text.IRegion;
@@ -46,17 +49,52 @@
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IEditorPart editorPart = page.getActiveEditor();
// if we open taglib definition in jar file
- if( editorPart.getEditorInput() instanceof JarEntryEditorInput) {
+ JarEntryFile current = null;
+ try {
+ if(editorPart.getEditorInput() instanceof IStorageEditorInput &&
+ ((IStorageEditorInput)editorPart.getEditorInput()).getStorage() instanceof JarEntryFile) {
+ current = (JarEntryFile)((IStorageEditorInput)editorPart.getEditorInput()).getStorage();
+ }
+ } catch (CoreException e) {
+ ExtensionsPlugin.getDefault().logError(e);
+ }
+ if(current != null) {
String fileToOpenName =getFilePath(region);
if(fileToOpenName!=null) {
- JarEntryEditorInput currentEditorInput = (JarEntryEditorInput) editorPart.getEditorInput();
//remove whitespaces and first '/'
fileToOpenName = fileToOpenName.trim();
if(fileToOpenName.indexOf('/')==0) {
fileToOpenName=fileToOpenName.substring(1);
}
+ int ii = fileToOpenName.lastIndexOf('/');
+ String folder = ii < 0 ? "" : fileToOpenName.substring(0, ii);
+ fileToOpenName = fileToOpenName.substring(ii + 1);
JarEntryFile fileToOpen = new JarEntryFile(fileToOpenName);
- fileToOpen.setParent(((JarEntryFile)currentEditorInput.getStorage()).getPackageFragmentRoot());
+
+ if(folder.length() > 0) {
+ if(folder.startsWith("META-INF")) {
+ JarEntryResource r = null;
+ while (folder.length() >= 0) {
+ int iii = folder.indexOf('/');
+ String name = iii < 0 ? folder : folder.substring(
+ 0, iii);
+ folder = iii < 0 ? "" : folder.substring(iii + 1);
+ fileToOpenName = fileToOpenName
+ .substring(fileToOpenName.indexOf('/') + 1);
+ JarEntryResource r1 = new JarEntryDirectory(name);
+ r1.setParent(r != null ? r : current
+ .getPackageFragmentRoot());
+ r = r1;
+ }
+ fileToOpen.setParent(r);
+ } else {
+ IPackageFragment pf = current.getPackageFragmentRoot().getPackageFragment(folder.replace('/', '.'));
+ fileToOpen.setParent(pf);
+ }
+ } else {
+ fileToOpen.setParent(current.getPackageFragmentRoot());
+ }
+
JarEntryEditorInput editorInputToOpenEditor= new JarEntryEditorInput(fileToOpen);
IEditorPart openedEditor = openFileInEditor(editorInputToOpenEditor,
fileToOpen.getName());
15 years, 1 month
JBoss Tools SVN: r18849 - in trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common: model/ui/editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-11-26 07:21:21 -0500 (Thu, 26 Nov 2009)
New Revision: 18849
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/ModelObjectStorageEditorInput.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4635
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java 2009-11-26 11:08:29 UTC (rev 18848)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java 2009-11-26 12:21:21 UTC (rev 18849)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.core.resources;
+import java.io.File;
import java.lang.reflect.Field;
import java.net.MalformedURLException;
import java.net.URI;
@@ -19,12 +20,17 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.internal.core.JarEntryFile;
+import org.eclipse.jdt.internal.core.JarEntryResource;
+import org.eclipse.jdt.internal.ui.javaeditor.JarEntryEditorInput;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.*;
import org.eclipse.ui.editors.text.ILocationProvider;
import org.eclipse.ui.internal.part.NullEditorInput;
import org.eclipse.ui.part.FileEditorInput;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.filesystems.impl.*;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.*;
@@ -210,6 +216,31 @@
}
private static IEditorInput convertStorageEditorInput(IStorageEditorInput input) {
+ if(input instanceof JarEntryEditorInput) {
+ JarEntryEditorInput j = (JarEntryEditorInput)input;
+ JarEntryFile file = (JarEntryFile)j.getStorage();
+ String jarFile = file.getPackageFragmentRoot().getPath().toString();
+ String entry = file.getName();
+ JarEntryResource r = file;
+ while(r != null && r.getParent() instanceof JarEntryResource) {
+ r = (JarEntryResource)r.getParent();
+ entry = r.getName() + "/" + entry;
+ }
+ if(r != null && r.getParent() instanceof IPackageFragment) {
+ IPackageFragment pf = (IPackageFragment)r.getParent();
+ while(pf != null) {
+ String p = pf.getElementName();
+ entry = p + "/" + entry;
+ if(pf.getParent() instanceof IPackageFragment) {
+ pf = (IPackageFragment)pf.getParent();
+ } else {
+ pf = null;
+ }
+ }
+ }
+ IEditorInput result = createJarEntryEditorInput(jarFile, entry);
+ if(result != null) return result;
+ }
String[] entryInfo = parseJarEntryFileInput(input);
if(entryInfo == null) return input;
String jarFile = entryInfo[0];
@@ -245,6 +276,18 @@
if(f == null) return null;
IProject p = f.getProject();
IModelNature n = EclipseResourceUtil.getModelNature(p);
+ if(n == null) return null;
+ XModelObject[] fs = FileSystemsHelper.getFileSystems(n.getModel()).getChildren();
+ for (XModelObject s: fs) {
+ if(s instanceof JarSystemImpl) {
+ JarSystemImpl j = (JarSystemImpl)s;
+ String loc = j.getLocation();
+ if(new File(loc).equals(new File(jarFile))) {
+ XModelObject result = s.getChildByPath(entry);
+ if(result != null) return result;
+ }
+ }
+ }
return (n == null) ? null : n.getModel().getByPath("/" + entry); //$NON-NLS-1$
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/ModelObjectStorageEditorInput.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/ModelObjectStorageEditorInput.java 2009-11-26 11:08:29 UTC (rev 18848)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/ModelObjectStorageEditorInput.java 2009-11-26 12:21:21 UTC (rev 18849)
@@ -11,14 +11,18 @@
package org.jboss.tools.common.model.ui.editor;
import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.internal.core.JarEntryDirectory;
import org.eclipse.jdt.internal.core.JarEntryFile;
import org.eclipse.jdt.internal.core.JarEntryResource;
+import org.eclipse.jdt.internal.core.PackageFragment;
import org.jboss.tools.common.core.resources.XModelObjectEditorInput;
import org.jboss.tools.common.core.resources.XModelObjectEditorInputFactory;
import org.eclipse.ui.*;
@@ -45,6 +49,7 @@
XModelObject o = object;
JarEntryFile f = null;
JarEntryResource current = null;
+ String packageName = "";
while(o != null && o.getFileType() != XModelObject.SYSTEM) {
String part = o.getFileType() == XModelObject.FILE ? FileAnyImpl.toFileName(o) :
o.getFileType() == XModelObject.FOLDER ? o.getAttributeValue(XModelObjectConstants.ATTR_NAME) : null;
@@ -58,6 +63,11 @@
current = f;
} else {
if(f == null) return null;
+ if(packageName.length() > 0) {
+ packageName = part + "." + packageName;
+ } else {
+ packageName = part;
+ }
JarEntryDirectory d = new JarEntryDirectory(part);
current.setParent(d);
current = d;
@@ -68,13 +78,7 @@
}
if(!(o instanceof JarSystemImpl)) return null;
String file = ((JarSystemImpl)o).getLocation();
-
- try {
- file = new File(file).getCanonicalPath();
- } catch (IOException e) {
-
- }
-
+
IFile[] fs = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(new File(file).toURI());
if(fs == null || fs.length == 0) return null;
@@ -84,7 +88,18 @@
IPackageFragmentRoot root = jp.getPackageFragmentRoot(file);
if(root == null) return null;
- current.setParent(root);
+
+ try {
+ file = new File(file).getCanonicalPath();
+ } catch (IOException e) {
+
+ }
+ if(current != null && !"META-INF".equalsIgnoreCase(current.getName()) && packageName.length() > 0) {
+ IPackageFragment pf = root.getPackageFragment(packageName);
+ f.setParent(pf);
+ } else {
+ current.setParent(root);
+ }
return f;
}
15 years, 1 month
JBoss Tools SVN: r18848 - trunk/common/plugins/org.jboss.tools.common.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-11-26 06:08:29 -0500 (Thu, 26 Nov 2009)
New Revision: 18848
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-4990
Modified: trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF 2009-11-26 10:08:49 UTC (rev 18847)
+++ trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF 2009-11-26 11:08:29 UTC (rev 18848)
@@ -10,4 +10,4 @@
Export-Package: org.jboss.tools.common.ui.widget.editor,
org.jboss.tools.common.ui.widget.field
Bundle-Vendor: %Bundle-Vendor.0
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
\ No newline at end of file
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
15 years, 1 month
JBoss Tools SVN: r18847 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-11-26 05:08:49 -0500 (Thu, 26 Nov 2009)
New Revision: 18847
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultTreeSelectionAdapter.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5191
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultTreeSelectionAdapter.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultTreeSelectionAdapter.java 2009-11-26 09:11:32 UTC (rev 18846)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultTreeSelectionAdapter.java 2009-11-26 10:08:49 UTC (rev 18847)
@@ -20,9 +20,12 @@
import org.jboss.tools.common.model.ui.IAttributeErrorProvider;
import org.jboss.tools.common.model.ui.IValueChangeListener;
import org.jboss.tools.common.model.ui.IValueProvider;
+import org.jboss.tools.common.model.ui.ModelUIMessages;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.attribute.editor.PropertyEditor;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.viewers.ILabelProvider;
@@ -32,6 +35,7 @@
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.widgets.Shell;
import org.jboss.tools.common.meta.XAttribute;
import org.jboss.tools.common.meta.action.XAction;
@@ -173,7 +177,7 @@
public void setXModelObject(XModelObject xmo) {
if (xmo != null && xaction != null) {
- this.setEnabled(xaction.isEnabled(xmo));
+// this.setEnabled(xaction.isEnabled(xmo));
this.setEnabled(Boolean.TRUE.booleanValue());
} else {
this.setEnabled(Boolean.FALSE.booleanValue());
@@ -181,8 +185,13 @@
}
public void run() {
- if (xaction!=null) {
- XActionInvoker.invoke(xaction.getPath(), modelObject, new Properties());
+ if (xaction != null) {
+ if(xaction.isEnabled(getModelObject())) {
+ XActionInvoker.invoke(xaction.getPath(), modelObject, new Properties());
+ } else {
+ Shell shell = ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
+ MessageDialog.openWarning(shell, "Warning", "Resource does not exist.");
+ }
}
}
}
@@ -208,6 +217,13 @@
}
public void update(ISelection selection) {
+// if(actions != null) {
+// for (IAction a: actions.values()) {
+// if(a instanceof XActionWrapper) {
+// ((XActionWrapper)a).setXModelObject(getModelObject());
+// }
+// }
+// }
//not implemented
}
}
@@ -228,8 +244,11 @@
XAction xAction = XActionInvoker.getAction(linkActionName, modelObject);
if (xAction!=null) {
XActionWrapper linkAction = new XActionWrapper(xAction);
- XModelObject object = (XModelObject)getObjectByPath(this.getStringValue(Boolean.TRUE.booleanValue()));
- linkAction.setXModelObject(object);
+//Let it always be enabled, or we need
+//good update not only depending on value but on workspace resources.
+// XModelObject object = (XModelObject)getObjectByPath(this.getStringValue(Boolean.TRUE.booleanValue()));
+// linkAction.setXModelObject(object);
+ linkAction.setEnabled(true);
getActionProvider().putAction(STRING_BUTTON_ACTION, linkAction);
}
}
15 years, 1 month
JBoss Tools SVN: r18846 - in trunk/esb/plugins: org.jboss.tools.esb.project.core/schema and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2009-11-26 04:11:32 -0500 (Thu, 26 Nov 2009)
New Revision: 18846
Added:
trunk/esb/plugins/org.jboss.tools.esb.project.core/schema/
trunk/esb/plugins/org.jboss.tools.esb.project.core/schema/esbRuntimeResolver.xsd
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/AbstractESBRuntimeResolver.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_42.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_47.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/IESBRuntimeResolver.java
Modified:
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/ESBProjectCorePlugin.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
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/JBossESBRuntimeContainerPage.java
Log:
JBIDE-5229:Add support for ESB 4.7 contained in soa-p 5.0 in ESB project wziard
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2009-11-26 01:21:00 UTC (rev 18845)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2009-11-26 09:11:32 UTC (rev 18846)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
+ <extension-point id="esbRuntimeResolver" name="ESB Runtime Resolver" schema="schema/esbRuntimeResolver.xsd"/>
<extension
point="org.eclipse.wst.common.project.facet.core.facets">
<project-facet
@@ -99,6 +100,24 @@
</and>
</constraint>
</project-facet-version>
+ <project-facet-version
+ facet="jst.jboss.esb"
+ version="4.7">
+ <group-member
+ id="modules">
+ </group-member>
+ <constraint>
+ <and>
+ <conflicts
+ group="modules">
+ </conflicts>
+ <requires
+ facet="jst.java"
+ version="[5.0">
+ </requires>
+ </and>
+ </constraint>
+ </project-facet-version>
<action
facet="jst.jboss.esb"
id="jst.jboss.esb.install"
@@ -128,7 +147,7 @@
<supported>
<facet
id="jst.jboss.esb"
- version="4.2,4.3,4.4,4.5,4.6">
+ version="4.2,4.3,4.4,4.5,4.6,4.7">
</facet>
<runtime-component
id="org.jboss.ide.eclipse.as.runtime.component"
@@ -138,7 +157,7 @@
<supported>
<facet
id="jst.jboss.esb"
- version="4.2,4.3,4.4,4.5,4.6">
+ version="4.2,4.3,4.4,4.5,4.6,4.7">
</facet>
<runtime-component
id="org.jboss.ide.eclipse.eap.runtime.component"
@@ -236,5 +255,33 @@
class="org.jboss.tools.esb.core.component.ESBVirtualComponent">
</componentimpl>
</extension>
+ <extension
+ point="org.jboss.tools.esb.project.core.esbRuntimeResolver">
+ <Resolver
+ class="org.jboss.tools.esb.core.runtime.ESBRuntimeResolver_42"
+ esbVersion="4.2,4.3,4.4,4.5,4.6"
+ name="ESB runtime resolver">
+ <supportedRuntimeType
+ id="org.jboss.ide.eclipse.as.runtime.42">
+ </supportedRuntimeType>
+ <supportedRuntimeType
+ id="org.jboss.ide.eclipse.as.runtime.eap.43">
+ </supportedRuntimeType>
+ </Resolver>
+ <Resolver
+ class="org.jboss.tools.esb.core.runtime.ESBRuntimeResolver_47"
+ esbVersion="4.7"
+ name="ESB runtime resolver">
+ <supportedRuntimeType
+ id="org.jboss.ide.eclipse.as.runtime.eap.50">
+ </supportedRuntimeType>
+ <supportedRuntimeType
+ id="org.jboss.ide.eclipse.as.runtime.50">
+ </supportedRuntimeType>
+ <supportedRuntimeType
+ id="org.jboss.ide.eclipse.as.runtime.51">
+ </supportedRuntimeType>
+ </Resolver>
+ </extension>
</plugin>
Added: trunk/esb/plugins/org.jboss.tools.esb.project.core/schema/esbRuntimeResolver.xsd
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/schema/esbRuntimeResolver.xsd (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/schema/esbRuntimeResolver.xsd 2009-11-26 09:11:32 UTC (rev 18846)
@@ -0,0 +1,131 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.esb.project.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.jboss.tools.esb.project.core" id="esbRuntimeParser" name="ESB Runtime Parser"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="Resolver"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="Resolver">
+ <complexType>
+ <sequence>
+ <element ref="supportedRuntimeType" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.tools.esb.core.runtime.IESBRuntimeResolver"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="esbVersion" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="supportedRuntimeType">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ Input supported Server runtime id
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectCorePlugin.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectCorePlugin.java 2009-11-26 01:21:00 UTC (rev 18845)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectCorePlugin.java 2009-11-26 09:11:32 UTC (rev 18846)
@@ -14,6 +14,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
import org.osgi.framework.BundleContext;
/**
@@ -40,6 +41,7 @@
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
+ JBossRuntimeManager.loadParsers();
}
/*
@@ -61,8 +63,12 @@
}
public static void log(String msg,Throwable e) {
+ log(msg, e, Status.ERROR);
+ }
+
+ public static void log(String msg,Throwable e, int serverity) {
ILog log = ESBProjectCorePlugin.getDefault().getLog();
- IStatus status = new Status(Status.ERROR,ESBProjectCorePlugin.PLUGIN_ID,msg,e);
+ IStatus status = new Status(serverity,ESBProjectCorePlugin.PLUGIN_ID,msg,e);
log.log(status);
- }
+ }
}
Added: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/AbstractESBRuntimeResolver.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/AbstractESBRuntimeResolver.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/AbstractESBRuntimeResolver.java 2009-11-26 09:11:32 UTC (rev 18846)
@@ -0,0 +1,90 @@
+package org.jboss.tools.esb.core.runtime;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+
+public abstract class AbstractESBRuntimeResolver implements IESBRuntimeResolver {
+
+ protected final static String JBOSSESB_ESB = "jbossesb.esb"; //$NON-NLS-1$
+ protected final static String JBOSSESB_SAR = "jbossesb.sar"; //$NON-NLS-1$
+ protected final static String SOAP_AS_LOCATION = "jboss-as"; //$NON-NLS-1$
+ protected final static String ROSETTA_JAR = "jbossesb-rosetta.jar"; //$NON-NLS-1$
+
+ public List<IPath> getJarDirectories(String runtimeLocation) {
+ List<IPath> directories = new ArrayList<IPath>();
+
+ IPath rtHome = new Path(runtimeLocation);
+ IPath soapDeployPath = rtHome.append(SOAP_AS_LOCATION).append("server").append("default").append(
+ "deploy");
+ IPath deployPath = rtHome.append("server").append("default").append(
+ "deploy");
+
+ IPath esbPath = deployPath.append(JBOSSESB_ESB);
+ IPath sarPath = deployPath.append(JBOSSESB_SAR);
+
+
+ IPath libPath = rtHome.append("lib");
+
+ directories.add(esbPath);
+ directories.add(sarPath.append("lib"));
+ directories.add(libPath.append(JBOSSESB_ESB));
+ directories.add(libPath.append(JBOSSESB_SAR).append("lib"));
+ directories.add(soapDeployPath.append(JBOSSESB_ESB));
+ directories.add(soapDeployPath.append(JBOSSESB_SAR).append("lib"));
+
+ return directories;
+ }
+
+ public List<File> getAllRuntimeJars(String runtimeLocation) {
+ List<File> jarList = new ArrayList<File>();
+
+ for(IPath dir : getJarDirectories(runtimeLocation)){
+ List<File> tmpJarList = new ArrayList<File>();
+ if(dir.toFile().exists()){
+ tmpJarList = getJarsOfFolder(dir.toFile());
+ jarList = mergeJarList(jarList, tmpJarList);
+ }
+ }
+
+ return jarList;
+ }
+
+
+
+ private List<File> getJarsOfFolder(File folder){
+ List<File> jars = new ArrayList<File>();
+ if(folder.isDirectory()){
+ for(File file: folder.listFiles()){
+ if(file.isFile() && (file.getName().endsWith(".jar") || file.getName().endsWith(".zip"))){
+ jars.add(file);
+ }else if (folder.isDirectory()){
+ jars.addAll(getJarsOfFolder(file));
+ }
+ }
+ }
+
+ return jars;
+ }
+
+ // if two folders have the same jar file, one of them will be ignored.
+ private List<File> mergeJarList(List<File> jarList1, List<File> jarList2){
+ List<File> duplicateList = new ArrayList<File>();
+
+ for(File file : jarList1){
+ for(File file2 : jarList2){
+ if(file.getName().equals(file2.getName())){
+ duplicateList.add(file);
+ }
+ }
+ }
+ jarList1.removeAll(duplicateList);
+ jarList1.addAll(jarList2);
+
+ return jarList1;
+ }
+
+}
Added: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_42.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_42.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_42.java 2009-11-26 09:11:32 UTC (rev 18846)
@@ -0,0 +1,30 @@
+package org.jboss.tools.esb.core.runtime;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+
+public class ESBRuntimeResolver_42 extends AbstractESBRuntimeResolver implements IESBRuntimeResolver {
+
+
+ private final static String CONFIG_MODEL_JAR = "jbossesb-config-model-1.1.0.jar";
+
+
+ public boolean isValidESBRuntime(String location, String version){
+ List<String> jarNames = new ArrayList<String>();
+
+ for(File file : getAllRuntimeJars(location)){
+ jarNames.add(file.getName());
+ }
+
+ if("4.5".equals(version) || "4.6".equals(version)){
+ return jarNames.contains(ROSETTA_JAR) && jarNames.contains(CONFIG_MODEL_JAR);
+ }
+
+ return jarNames.contains(ROSETTA_JAR);
+ }
+
+}
Added: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_47.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_47.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_47.java 2009-11-26 09:11:32 UTC (rev 18846)
@@ -0,0 +1,45 @@
+package org.jboss.tools.esb.core.runtime;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+
+public class ESBRuntimeResolver_47 extends AbstractESBRuntimeResolver implements
+ IESBRuntimeResolver {
+
+ private final static String CONFIG_MODEL_JAR_11 = "jbossesb-config-model-1.1.0.jar";
+ private final static String CONFIG_MODEL_JAR_12 = "jbossesb-config-model-1.2.0.jar";
+
+
+ public boolean isValidESBRuntime(String location, String version){
+ List<String> jarNames = new ArrayList<String>();
+
+ for(File file : getAllRuntimeJars(location)){
+ jarNames.add(file.getName());
+ }
+
+ return jarNames.contains(ROSETTA_JAR)
+ && jarNames.contains(CONFIG_MODEL_JAR_11)
+ && jarNames.contains(CONFIG_MODEL_JAR_12);
+ }
+
+
+ public List<IPath> getJarDirectories(String runtimeLocation) {
+ List<IPath> directories = super.getJarDirectories(runtimeLocation);
+ IPath rtHome = new Path(runtimeLocation);
+ IPath soapDeployPath = rtHome.append(SOAP_AS_LOCATION).append("server").append("default").append(
+ "deployers").append("esb.deployer").append("lib");
+
+ IPath deployPath = rtHome.append("server").append("default").append(
+ "deployers").append("esb.deployer").append("lib");
+ directories.add(soapDeployPath);
+ directories.add(deployPath);
+
+ return directories;
+ }
+
+
+}
Added: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/IESBRuntimeResolver.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/IESBRuntimeResolver.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/IESBRuntimeResolver.java 2009-11-26 09:11:32 UTC (rev 18846)
@@ -0,0 +1,16 @@
+package org.jboss.tools.esb.core.runtime;
+
+import java.io.File;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+
+public interface IESBRuntimeResolver {
+
+
+ public boolean isValidESBRuntime(String location, String version);
+
+ public List<IPath> getJarDirectories(String runtimeLocation);
+
+ public List<File> getAllRuntimeJars(String runtimeLocation);
+}
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java 2009-11-26 01:21:00 UTC (rev 18845)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java 2009-11-26 09:11:32 UTC (rev 18846)
@@ -23,11 +23,17 @@
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
+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.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.ServerCore;
import org.jboss.ide.eclipse.as.classpath.core.jee.AbstractClasspathContainer;
import org.jboss.ide.eclipse.as.classpath.core.jee.AbstractClasspathContainerInitializer;
import org.jboss.ide.eclipse.as.classpath.core.xpl.ClasspathDecorations;
+import org.jboss.tools.esb.core.ESBProjectCorePlugin;
+import org.jboss.tools.esb.core.facet.IJBossESBFacetDataModelProperties;
import org.jboss.tools.esb.core.messages.JBossFacetCoreMessages;
/**
@@ -74,6 +80,23 @@
isServerSupplied).getClasspathEntries();
}
+// private String getVersionNumber(IJavaProject project){
+// try {
+// IFacetedProject fp = ProjectFacetsManager.create(project.getProject());
+// if(fp == null){
+// return "";
+// }
+// IProjectFacet facet = ProjectFacetsManager.getProjectFacet(IJBossESBFacetDataModelProperties.JBOSS_ESB_FACET_ID);
+// IProjectFacetVersion pfVersion = fp.getProjectFacetVersion(facet);
+//
+// return pfVersion.getVersionString();
+//
+// } catch (CoreException e) {
+// ESBProjectCorePlugin.log(e.getLocalizedMessage(), e);
+// }
+// return "";
+// }
+
public class JBossRuntimeClasspathContainer extends
AbstractClasspathContainer {
private IPath path;
@@ -124,7 +147,7 @@
String runtimeLocation = serverRuntime.getLocation()
.toOSString();
jars = JBossRuntimeManager.getInstance().getAllRuntimeJars(
- runtimeLocation);
+ runtimeLocation, serverRuntime.getRuntimeType().getId());
} else {
@@ -132,7 +155,7 @@
.findRuntimeByName(segment);
if (jbws != null) {
jars = JBossRuntimeManager.getInstance().getAllRuntimeJars(
- jbws);
+ jbws, jbws.getVersion());
unbound = false;
}
else{
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2009-11-26 01:21:00 UTC (rev 18845)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2009-11-26 09:11:32 UTC (rev 18846)
@@ -20,11 +20,14 @@
import java.util.Map;
import java.util.Set;
-import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jface.preference.IPersistentPreferenceStore;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
@@ -43,10 +46,16 @@
private Map<String, JBossRuntime> runtimes = new HashMap<String, JBossRuntime>();
- private final static String JBOSSESB_ESB = "jbossesb.esb";
- private final static String JBOSSESB_SAR = "jbossesb.sar";
- private final static String SOAP_AS_LOCATION = "jboss-as";
+ static final String PLUGIN_ID = "org.jboss.tools.esb.project.core"; //$NON-NLS-1$
+ static String ATT_CLASS = "class"; //$NON-NLS-1$
+ static String ATT_VERSION = "esbVersion"; //$NON-NLS-1$
+ static String ATT_ID = "id";
+ static String VERSION_SEPARATOR = ",";
+
+ static Map<String, IESBRuntimeResolver> parserMap = new HashMap<String, IESBRuntimeResolver>();
+
+
/**
* Private constructor
*/
@@ -152,7 +161,7 @@
return rts.toArray(new JBossRuntime[]{});
}
- public List<String> getAllRuntimeJars(JBossRuntime rt){
+ public List<String> getAllRuntimeJars(JBossRuntime rt, String esbVersion){
List<String> jarList = new ArrayList<String>();
if (rt != null) {
if (rt.isUserConfigClasspath()) {
@@ -160,102 +169,33 @@
} else {
- jarList = getAllRuntimeJars(rt.getHomeDir());
+ jarList = getAllRuntimeJars(rt.getHomeDir(), esbVersion);
}
}
return jarList;
}
- public List<String> getAllRuntimeJars(String runtimeLocation) {
+ public List<String> getAllRuntimeJars(String runtimeLocation, String esbVersion) {
List<String> jarList = new ArrayList<String>();
-
- IPath rtHome = new Path(runtimeLocation);
- IPath soapDeployPath = rtHome.append(SOAP_AS_LOCATION).append("server").append("default").append(
- "deploy");
- IPath deployPath = rtHome.append("server").append("default").append(
- "deploy");
-
- IPath esbPath = deployPath.append(JBOSSESB_ESB);
- IPath sarPath = deployPath.append(JBOSSESB_SAR);
-
- IPath libPath = rtHome.append("lib");
-
- //if it's not a normal jboss AS , try to treat it as standalone esb runtme
- if (!esbPath.toFile().exists() || !sarPath.toFile().exists()) {
- esbPath = libPath.append(JBOSSESB_ESB);
- sarPath = libPath.append(JBOSSESB_SAR);
+ IESBRuntimeResolver resolver = null;
+ if(parserMap.get(esbVersion) != null){
+ resolver = (IESBRuntimeResolver)parserMap.get(esbVersion);
}
- if (!esbPath.toFile().exists() || !sarPath.toFile().exists()) {
- esbPath = soapDeployPath.append(JBOSSESB_ESB);
- sarPath = soapDeployPath.append(JBOSSESB_SAR);
- }
-
- List<File> esblibs = getJarsOfFolder(esbPath.toFile());
- IPath sarLibPath = sarPath.append("lib");
- List<File> sarJars = getJarsOfFolder(sarLibPath.toFile());
- // /List<File> commonLibs = getJarsOfFolder(libPath.toFile());
- // List<File> tmpLibs = mergeTwoFileList(esblibs, sarJars);
- // libs.addAll(commonLibs);
-
- jarList = mergeTwoList(esblibs, sarJars);
-
- return jarList;
- }
-
- private List<File> getJarsOfFolder(File folder){
- List<File> jars = new ArrayList<File>();
- if(folder.isDirectory()){
- for(File file: folder.listFiles()){
- if(file.isFile() && (file.getName().endsWith(".jar") || file.getName().endsWith(".zip"))){
- jars.add(file);
- }else if (folder.isDirectory()){
- jars.addAll(getJarsOfFolder(file));
- }
+ if( resolver != null){
+ List<File> jars = resolver.getAllRuntimeJars(runtimeLocation);
+ for(File file : jars){
+ jarList.add(file.getAbsolutePath());
}
}
-
- return jars;
- }
-
- // if two folders have the same jar file, one of them will be ignored.
- private List<String> mergeTwoList(List<File> jarList1, List<File> jarList2){
- List<String> rtList = new ArrayList<String>();
- List<String> distinctFileNames = new ArrayList<String>();
-
- for(File jarFile: jarList1){
- distinctFileNames.add(jarFile.getName());
- rtList.add(jarFile.getAbsolutePath());
+ else{
+ ESBProjectCorePlugin.log("No ESB runtime resolver defined for ESB "+ esbVersion, null, Status.WARNING);
}
- for(File jarFile: jarList2){
- if(!distinctFileNames.contains(jarFile.getName())){
- rtList.add(jarFile.getAbsolutePath());
- }
- }
- return rtList;
-
+ return jarList;
}
- private List<File> mergeTwoFileList(List<File> jarList1, List<File> jarList2){
- List<File> rtList = new ArrayList<File>();
- List<String> distinctFileNames = new ArrayList<String>();
-
- for(File jarFile: jarList1){
- distinctFileNames.add(jarFile.getName());
- rtList.add(jarFile);
- }
- for(File jarFile: jarList2){
- if(!distinctFileNames.contains(jarFile.getName())){
- rtList.add(jarFile);
- }
- }
-
- return rtList;
-
- }
-
/**
* Remove given JBossWSRuntime from manager
*
@@ -418,53 +358,56 @@
}
public static boolean isValidESBServer(String path, String version){
- return getResttaJar(path, "" , version) || isValidSoapContainedESBRuntime(path, version);
+
+ return isValidESBStandaloneRuntimeDir(path, version);
}
- private static boolean isValidSoapContainedESBRuntime(String path, String version){
- return getResttaJar(path, SOAP_AS_LOCATION, version);
- }
+// private static boolean isValidSoapContainedESBRuntime(String path, String version){
+// return isValidESBStandaloneRuntimeDir(path, version);
+// }
+ @Deprecated
public static boolean getResttaJar(String path, String asFoldername, String version){
- IPath serverLocation = new Path(path);
- if(asFoldername != null && !"".equals(asFoldername)){
- serverLocation = serverLocation.append(asFoldername);
- }
- IPath sarLocation = serverLocation.append( "server" + File.separator + "default"
- + File.separator + "deploy" + File.separator
- + "jbossesb.sar");
- IPath rosettaJar = sarLocation.append("lib" + File.separator + "jbossesb-rosetta.jar");
-
- try{
- double versionNumber = Double.valueOf(version);
- if(versionNumber >= 4.5){
- return isVersion45(sarLocation);
- }
- }catch(NumberFormatException e){
- }
- return rosettaJar.toFile().exists();
+ return isValidESBStandaloneRuntimeDir(path, version);
}
+
+
+
public static boolean isValidESBStandaloneRuntimeDir(String path, String version) {
- IPath location = new Path(path);
- IPath esblocation = location.append("lib").append("jbossesb.esb");
- IPath sarLocation = location.append("lib").append("jbossesb.sar");
- if (!esblocation.toFile().isDirectory()) {
- return false;
+ IESBRuntimeResolver resolver = null;
+ if( parserMap.get(version) != null){
+ resolver = (IESBRuntimeResolver)parserMap.get(version);
}
- if (!sarLocation.toFile().isDirectory()) {
- return false;
- }
- try{
- double versionNumber = Double.valueOf(version);
- if(versionNumber >= 4.5){
- return isVersion45(sarLocation);
- }
- }catch(NumberFormatException e){
+ if(resolver != null){
+ return resolver.isValidESBRuntime(path, version);
}
-
- return true;
+ else{
+ ESBProjectCorePlugin.log("No ESB runtime resolver defined for ESB "+ version, null, Status.WARNING);
+ }
+
+ return false;
+
+// IPath location = new Path(path);
+// IPath esblocation = location.append("lib").append("jbossesb.esb");
+// IPath sarLocation = location.append("lib").append("jbossesb.sar");
+// if (!esblocation.toFile().isDirectory()) {
+// return false;
+// }
+// if (!sarLocation.toFile().isDirectory()) {
+// return false;
+// }
+//
+// try{
+// double versionNumber = Double.valueOf(version);
+// if(versionNumber >= 4.5){
+// return isVersion45(sarLocation);
+// }
+// }catch(NumberFormatException e){
+// }
+//
+// return true;
}
private static boolean isVersion45(IPath sarLocation){
@@ -479,4 +422,45 @@
}
+ public static void loadParsers() {
+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
+ .getExtensionPoint(PLUGIN_ID, "esbRuntimeResolver");
+ for (IConfigurationElement element : extensionPoint
+ .getConfigurationElements()) {
+ String clazz = element.getAttribute(ATT_CLASS);
+ String esbVersion = element.getAttribute(ATT_VERSION);
+
+ IConfigurationElement[] supportedRTs = element.getChildren("supportedRuntimeType");
+ List<String> runtimeTypeIds = new ArrayList<String>();
+ for(IConfigurationElement supportedRT : supportedRTs){
+ runtimeTypeIds.add(supportedRT.getAttribute(ATT_ID));
+ }
+
+ if (clazz == null || (esbVersion == null && runtimeTypeIds.size() == 0)) {
+ continue;
+ }
+
+
+ IESBRuntimeResolver parser = null;
+ try {
+ parser = (IESBRuntimeResolver) element
+ .createExecutableExtension(ATT_CLASS);
+
+ if (esbVersion != null && !"".equals(esbVersion.trim())) {
+ String[] versions = esbVersion.split(VERSION_SEPARATOR);
+ for (String version : versions) {
+ parserMap.put(version, parser);
+ }
+ }
+
+ for(String typeId : runtimeTypeIds){
+ parserMap.put(typeId, parser);
+ }
+
+ } catch (CoreException e) {
+ ESBProjectCorePlugin.log(e.getLocalizedMessage(), e);
+ }
+ }
+ }
+
}
\ No newline at end of file
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 2009-11-26 01:21:00 UTC (rev 18845)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2009-11-26 09:11:32 UTC (rev 18846)
@@ -654,6 +654,9 @@
if(versionNumber >= 4.5) { //$NON-NLS-1$
cmVersions.add("1.1.0"); //$NON-NLS-1$
}
+ if(versionNumber >= 4.7){
+ cmVersions.add("1.2.0"); //$NON-NLS-1$
+ }
int index = cmVersions.getItemCount() - 1;
String convigVersionName = cmVersions.getItem(index);
cmVersions.select(index);
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java 2009-11-26 01:21:00 UTC (rev 18845)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java 2009-11-26 09:11:32 UTC (rev 18846)
@@ -165,10 +165,10 @@
Object element) {
if(element instanceof IRuntime){
IPath location = ((IRuntime)element).getLocation();
-
+ String runtimeType = ((IRuntime)element).getRuntimeType().getId();
if(location == null) return false;
- return JBossRuntimeManager.isValidESBServer(location.toOSString(), "");
+ return JBossRuntimeManager.isValidESBServer(location.toOSString(), runtimeType);
}
return true;
}
15 years, 1 month
JBoss Tools SVN: r18845 - trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/META-INF.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-11-25 20:21:00 -0500 (Wed, 25 Nov 2009)
New Revision: 18845
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-5129 - JBoss SSH Server Plugin has no provider name
Bundle-Localization: plugin
was added to manifest to fix this issue
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/META-INF/MANIFEST.MF 2009-11-26 00:31:54 UTC (rev 18844)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/META-INF/MANIFEST.MF 2009-11-26 01:21:00 UTC (rev 18845)
@@ -5,6 +5,7 @@
Bundle-SymbolicName: org.jboss.ide.eclipse.as.ssh;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.jboss.ide.eclipse.as.ssh.SSHDeploymentPlugin
+Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
com.jcraft.jsch,
@@ -26,3 +27,6 @@
org.jboss.ide.eclipse.archives.core
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.jboss.ide.eclipse.as.ssh,
+ org.jboss.ide.eclipse.as.ssh.server,
+ org.jboss.ide.eclipse.as.ssh.ui.editor
15 years, 1 month
JBoss Tools SVN: r18844 - trunk/as/plugins/org.jboss.ide.eclipse.as.ssh.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-11-25 19:31:54 -0500 (Wed, 25 Nov 2009)
New Revision: 18844
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-5129 - JBoss SSH Server Plugin has no provider name
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.properties 2009-11-26 00:11:21 UTC (rev 18843)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.properties 2009-11-26 00:31:54 UTC (rev 18844)
@@ -1,2 +1,2 @@
-Bundle-Vendor.0 = JBoss by Red Hat
-Bundle-Name.0 = JBoss SSH Server Plugin
\ No newline at end of file
+Bundle-Vendor.0=JBoss by Red Hat
+Bundle-Name.0=JBoss SSH Server Plugin
\ No newline at end of file
15 years, 1 month