JBoss Tools SVN: r18934 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2009-11-30 18:40:37 -0500 (Mon, 30 Nov 2009)
New Revision: 18934
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeDependency.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5323
Only open the Smooks Configuration if the editor can support the configurations therein
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeDependency.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeDependency.java 2009-11-30 23:20:03 UTC (rev 18933)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeDependency.java 2009-11-30 23:40:37 UTC (rev 18934)
@@ -111,15 +111,25 @@
metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-edi", ProcessNodeType.INPUT_EDI, "smooks/edi-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/reader");
metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-json", ProcessNodeType.INPUT_JSON, "smooks/json-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/reader");
metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-fixed-length", ProcessNodeType.FIXED_LENGTH, "smooks/fixed-length-1.3.xsd", false, SmooksVersion.v1_3), "/smooks-resource-list/reader");
- metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-core", ProcessNodeType.DATASOURCE, "smooks/datasource-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/direct,/smooks-resource-list/JNDI");
- metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-core", ProcessNodeType.DATASOURCE, "smooks/datasource-1.3.xsd", false, SmooksVersion.v1_3), "/smooks-resource-list/direct,/smooks-resource-list/JNDI");
- metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-core", ProcessNodeType.CORE, "smooks/core-1.3.xsd", false, SmooksVersion.v1_3), "/smooks-resource-list/filterSettings,/smooks-resource-list/namespaces,/smooks-resource-list/terminate");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-core", ProcessNodeType.DATASOURCE, "smooks/datasource-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/direct");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-core", ProcessNodeType.DATASOURCE, "smooks/datasource-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/JNDI");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-core", ProcessNodeType.DATASOURCE, "smooks/datasource-1.3.xsd", false, SmooksVersion.v1_3), "/smooks-resource-list/direct");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-core", ProcessNodeType.DATASOURCE, "smooks/datasource-1.3.xsd", false, SmooksVersion.v1_3), "/smooks-resource-list/JNDI");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-core", ProcessNodeType.CORE, "smooks/core-1.3.xsd", false, SmooksVersion.v1_3), "/smooks-resource-list/filterSettings");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-core", ProcessNodeType.CORE, "smooks/core-1.3.xsd", false, SmooksVersion.v1_3), "/smooks-resource-list/namespaces");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-core", ProcessNodeType.CORE, "smooks/core-1.3.xsd", false, SmooksVersion.v1_3), "/smooks-resource-list/terminate");
metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-templating", ProcessNodeType.TEMPLATING, "smooks/xsl-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/xsl");
metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-javabean", ProcessNodeType.JAVA_BINDING, "smooks/javabean-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/binding");
metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-javabean", ProcessNodeType.JAVA_BINDING, "smooks/javabean-1.3.xsd", false, SmooksVersion.v1_3), "/smooks-resource-list/bean");
metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-calc", ProcessNodeType.CALC, "smooks/calc-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/counter");
- metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-persistence", ProcessNodeType.PERSISTENCE, "smooks/persistence-1.2.xsd", false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/inserter,/smooks-resource-list/updater,/smooks-resource-list/deleter,/smooks-resource-list/flusher,/smooks-resource-list/locator");
- metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-routing", ProcessNodeType.ROUTING, "smooks/db-routing-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/executor,/smooks-resource-list/resultSetRowSelector");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-persistence", ProcessNodeType.PERSISTENCE, "smooks/persistence-1.2.xsd", false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/inserter");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-persistence", ProcessNodeType.PERSISTENCE, "smooks/persistence-1.2.xsd", false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/updater");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-persistence", ProcessNodeType.PERSISTENCE, "smooks/persistence-1.2.xsd", false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/deleter");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-persistence", ProcessNodeType.PERSISTENCE, "smooks/persistence-1.2.xsd", false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/deleter");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-persistence", ProcessNodeType.PERSISTENCE, "smooks/persistence-1.2.xsd", false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/flusher");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-persistence", ProcessNodeType.PERSISTENCE, "smooks/persistence-1.2.xsd", false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/locator");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-routing", ProcessNodeType.ROUTING, "smooks/db-routing-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/executor");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-routing", ProcessNodeType.ROUTING, "smooks/db-routing-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/resultSetRowSelector");
metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-routing", ProcessNodeType.ROUTING, "smooks/file-routing-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/outputStream");
metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-routing", ProcessNodeType.ROUTING, "smooks/io-routing-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/router");
metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-routing", ProcessNodeType.ROUTING, "smooks/jms-routing-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/router");
15 years
JBoss Tools SVN: r18933 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks: editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2009-11-30 18:20:03 -0500 (Mon, 30 Nov 2009)
New Revision: 18933
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeMetadata.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5323
Only open the Smooks Configuration if the editor can support the configurations therein
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeMetadata.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeMetadata.java 2009-11-30 22:22:22 UTC (rev 18932)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeMetadata.java 2009-11-30 23:20:03 UTC (rev 18933)
@@ -135,7 +135,15 @@
reset();
if(smooksConfig != null) {
- configFile = new File(smooksConfig.getRawLocation().toOSString().trim());
+ setSmooksConfig(new File(smooksConfig.getRawLocation().toOSString().trim()));
+ }
+ }
+
+ public void setSmooksConfig(File file) {
+ reset();
+
+ if(file != null) {
+ configFile = file;
if(configFile.exists() && configFile.isFile()) {
ExecutionContext execContext = metadataExtractor.createExecutionContext();
Properties inputParams = new Properties();
@@ -172,7 +180,7 @@
}
}
}
-
+
private void reset() {
isSmooksConfig = false;
isValidSmooksConfig = false;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java 2009-11-30 22:22:22 UTC (rev 18932)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java 2009-11-30 23:20:03 UTC (rev 18933)
@@ -2,6 +2,7 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
+import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
@@ -59,6 +60,8 @@
import org.eclipse.ui.ide.FileStoreEditorInput;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.jboss.tools.smooks.configuration.RuntimeDependency;
+import org.jboss.tools.smooks.configuration.RuntimeMetadata;
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
import org.jboss.tools.smooks.configuration.SmooksConstants;
import org.jboss.tools.smooks.configuration.editors.SmooksXMLEditor;
@@ -610,21 +613,27 @@
String filePath = null;
String partName = "smooks editor";
IFile file = null;
+ RuntimeMetadata runtimeMetadata = new RuntimeMetadata();
+
if (input instanceof FileStoreEditorInput) {
try {
filePath = ((FileStoreEditorInput) input).getURI().toURL().getFile();
+ runtimeMetadata.setSmooksConfig(new File(filePath));
} catch (MalformedURLException e) {
throw new PartInitException("Transform URL to URL error.", e);
}
}
if (input instanceof IFileEditorInput) {
file = ((IFileEditorInput) input).getFile();
+ runtimeMetadata.setSmooksConfig(file);
filePath = file.getFullPath().toPortableString();
partName = file.getName();
}
if (filePath == null)
throw new PartInitException("Can't get the input file");
+
+ assertConfigSupported(runtimeMetadata);
Resource smooksResource = null;
@@ -658,6 +667,16 @@
judgeInputReader();
}
+ private void assertConfigSupported(RuntimeMetadata runtimeMetadata) throws PartInitException {
+ List<RuntimeDependency> dependencies = runtimeMetadata.getDependencies();
+
+ for(RuntimeDependency dependency : dependencies) {
+ if(!dependency.isSupportedByEditor()) {
+ throw new PartInitException("\n\nSorry, this configuration is not yet supported by the Smooks Editor because it contains configurations from the '" + dependency.getNamespaceURI() + "' configuration namespace.\n\nPlease open this configuration using the XML Editor.");
+ }
+ }
+ }
+
protected void judgeInputReader() {
SmooksResourceListType resourceList = SmooksUIUtils.getSmooks11ResourceListType(smooksModel);
if (resourceList == null)
15 years
JBoss Tools SVN: r18932 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2009-11-30 17:22:22 -0500 (Mon, 30 Nov 2009)
New Revision: 18932
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchConfigurationDelegate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5302
Perform project dependency checks before launching a Run Configuration
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchConfigurationDelegate.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchConfigurationDelegate.java 2009-11-30 22:08:53 UTC (rev 18931)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchConfigurationDelegate.java 2009-11-30 22:22:22 UTC (rev 18932)
@@ -74,6 +74,7 @@
if(!launchMetadata.isValidSmooksConfig()) {
displayError(smooksConfigName, launchMetadata.getErrorMessage());
+ return;
} else {
List<RuntimeDependency> dependencies = launchMetadata.getDependencies();
ProjectClassLoader projectClassLoader = new ProjectClassLoader(javaProject);
15 years
JBoss Tools SVN: r18931 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2009-11-30 17:08:53 -0500 (Mon, 30 Nov 2009)
New Revision: 18931
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchConfigurationDelegate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5302
Perform project dependency checks before launching a Run Configuration
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchConfigurationDelegate.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchConfigurationDelegate.java 2009-11-30 20:55:50 UTC (rev 18930)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchConfigurationDelegate.java 2009-11-30 22:08:53 UTC (rev 18931)
@@ -80,7 +80,7 @@
for(RuntimeDependency dependency : dependencies) {
if(!dependency.isOnProjectClasspath(projectClassLoader)) {
- displayError(smooksConfigName, "This configuration depends on the '" + dependency.getGroupId() + ":" + dependency.getArtifactId() + "' Smooks artifact. Download Smooks and add the Smooks jars to the Project classpath, or update your Maven POM to include the missing artifact!!");
+ displayError(smooksConfigName, "This configuration depends on the '" + dependency.getGroupId() + ":" + dependency.getArtifactId() + "' Smooks artifact. Download Smooks and add the Smooks jars to the Project classpath, or update your Maven POM to include the missing artifact.");
return;
}
}
15 years
JBoss Tools SVN: r18930 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks: launch and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2009-11-30 15:55:50 -0500 (Mon, 30 Nov 2009)
New Revision: 18930
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/ProcessNodeType.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeDependency.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeMetadata.java
Removed:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ProcessNodeType.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchMetadata.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchConfigurationDelegate.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLauncher.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5302
Perform project dependency checks before launching a Run Configuration
Copied: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/ProcessNodeType.java (from rev 18918, trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ProcessNodeType.java)
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/ProcessNodeType.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/ProcessNodeType.java 2009-11-30 20:55:50 UTC (rev 18930)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.tools.smooks.configuration;
+
+/**
+ * Configuration process node type enumeration.
+ *
+ * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
+ */
+public enum ProcessNodeType {
+ INPUT_CSV,
+ INPUT_EDI,
+ INPUT_JSON,
+
+ BASE,
+ CORE,
+ CALC,
+ DATASOURCE,
+ FIXED_LENGTH,
+ JAVA_BINDING,
+ PERSISTENCE,
+ ROUTING,
+ RULES,
+ SCRIPTING,
+ TEMPLATING,
+ VALIDATION,
+}
\ No newline at end of file
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeDependency.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeDependency.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeDependency.java 2009-11-30 20:55:50 UTC (rev 18930)
@@ -0,0 +1,177 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.tools.smooks.configuration;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.milyn.Smooks;
+import org.milyn.SmooksException;
+import org.milyn.container.ExecutionContext;
+import org.milyn.delivery.sax.SAXElement;
+import org.milyn.delivery.sax.SAXVisitBefore;
+
+/**
+ * Smooks runtime dependency.
+ *
+ * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
+ */
+public class RuntimeDependency {
+
+ /**
+ * Smooks runtime versions.
+ */
+ public static enum SmooksVersion {
+ v1_0,
+ v1_1,
+ v1_2,
+ v1_3,
+ }
+
+ /**
+ * The Maven Artfact ID of the Smooks dependency.
+ */
+ private String artifactId;
+ /**
+ * The configuration namespace URI for the config..
+ */
+ private URI namespaceURI;
+ /**
+ * Whether or not the configuration is supported by the Editor. Note that this property being 'false' is not the
+ * same as saying the config is not supported by the Smooks Runtime (see the 'runtimeVersions' property).
+ */
+ private boolean supportedByEditor;
+ /**
+ * The list of Smooks Runtimes that can support this configuration. Note this does not mean
+ * the editor can support the configuration (see the 'supportedByEditor' property).
+ */
+ private List<SmooksVersion> runtimeVersions;
+
+ private RuntimeDependency(String artifactId, URI namespaceURI, boolean supportedByEditor, List<SmooksVersion> runtimeVersions) {
+ this.artifactId = artifactId;
+ this.namespaceURI = namespaceURI;
+ this.supportedByEditor = supportedByEditor;
+ }
+
+ public String getGroupId() {
+ return "org.milyn";
+ }
+ public String getArtifactId() {
+ return artifactId;
+ }
+ public URI getNamespaceURI() {
+ return namespaceURI;
+ }
+ public boolean isSupportedByEditor() {
+ return supportedByEditor;
+ }
+ public boolean isSupportedBySmooksVersion(SmooksVersion smooksVersion) {
+ return runtimeVersions.contains(smooksVersion);
+ }
+ public boolean isOnProjectClasspath(ClassLoader projectClassloader) {
+ String resourcePath = "META-INF" + namespaceURI.getPath();
+ return (projectClassloader.getResource(resourcePath) != null);
+ }
+
+ public static void addDependencyChecklist(Smooks metadataExtractor) {
+ // Add the supported feature dependency details...
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-core", ProcessNodeType.BASE, "smooks-1.1.xsd", true, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-csv", ProcessNodeType.INPUT_CSV, "smooks/csv-1.2.xsd", true, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/reader");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-edi", ProcessNodeType.INPUT_EDI, "smooks/edi-1.2.xsd", true, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/reader");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-json", ProcessNodeType.INPUT_JSON, "smooks/json-1.2.xsd", true, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/reader");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-templating", ProcessNodeType.TEMPLATING, "smooks/freemarker-1.1.xsd", true, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/freemarker");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-javabean", ProcessNodeType.JAVA_BINDING, "smooks/javabean-1.2.xsd", true, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/bean");
+
+ // Add the unsupported feature dependency details...
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-core", ProcessNodeType.BASE, "smooks-1.0.xsd", false, SmooksVersion.v1_0, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-csv", ProcessNodeType.INPUT_CSV, "smooks/csv-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/reader");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-csv", ProcessNodeType.INPUT_CSV, "smooks/csv-1.3.xsd", false, SmooksVersion.v1_3), "/smooks-resource-list/reader");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-edi", ProcessNodeType.INPUT_EDI, "smooks/edi-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/reader");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-json", ProcessNodeType.INPUT_JSON, "smooks/json-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/reader");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-fixed-length", ProcessNodeType.FIXED_LENGTH, "smooks/fixed-length-1.3.xsd", false, SmooksVersion.v1_3), "/smooks-resource-list/reader");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-core", ProcessNodeType.DATASOURCE, "smooks/datasource-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/direct,/smooks-resource-list/JNDI");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-core", ProcessNodeType.DATASOURCE, "smooks/datasource-1.3.xsd", false, SmooksVersion.v1_3), "/smooks-resource-list/direct,/smooks-resource-list/JNDI");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-core", ProcessNodeType.CORE, "smooks/core-1.3.xsd", false, SmooksVersion.v1_3), "/smooks-resource-list/filterSettings,/smooks-resource-list/namespaces,/smooks-resource-list/terminate");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-templating", ProcessNodeType.TEMPLATING, "smooks/xsl-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/xsl");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-javabean", ProcessNodeType.JAVA_BINDING, "smooks/javabean-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/binding");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-javabean", ProcessNodeType.JAVA_BINDING, "smooks/javabean-1.3.xsd", false, SmooksVersion.v1_3), "/smooks-resource-list/bean");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-calc", ProcessNodeType.CALC, "smooks/calc-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/counter");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-persistence", ProcessNodeType.PERSISTENCE, "smooks/persistence-1.2.xsd", false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/inserter,/smooks-resource-list/updater,/smooks-resource-list/deleter,/smooks-resource-list/flusher,/smooks-resource-list/locator");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-routing", ProcessNodeType.ROUTING, "smooks/db-routing-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/executor,/smooks-resource-list/resultSetRowSelector");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-routing", ProcessNodeType.ROUTING, "smooks/file-routing-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/outputStream");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-routing", ProcessNodeType.ROUTING, "smooks/io-routing-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/router");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-routing", ProcessNodeType.ROUTING, "smooks/jms-routing-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/router");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-routing", ProcessNodeType.ROUTING, "smooks/jms-routing-1.2.xsd", false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/router");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-rules", ProcessNodeType.RULES, "smooks/rules-1.0.xsd", false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/ruleBases");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-scripting", ProcessNodeType.SCRIPTING, "smooks/groovy-1.1.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/groovy");
+ metadataExtractor.addVisitor(new RuntimeDependencyTracker("milyn-smooks-validation", ProcessNodeType.VALIDATION, "smooks/validation-1.0.xsd", false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/rule");
+ }
+
+ private static class RuntimeDependencyTracker implements SAXVisitBefore {
+
+ private String artifactId;
+ private ProcessNodeType nodeType;
+ private URI namespaceURI;
+ /**
+ * Whether or not the configuration is supported by the Editor. Note that this property being 'false' is not the
+ * same as saying the config is not supported by the Smooks Runtime (see the 'runtimeVersions' property).
+ */
+ private boolean supportedByEditor;
+ /**
+ * The list of Smooks Runtimes that can support this configuration. Note this does not mean
+ * the editor can support the configuration (see the 'supportedByEditor' property).
+ */
+ private List<SmooksVersion> runtimeVersions = new ArrayList<SmooksVersion>();
+
+ public RuntimeDependencyTracker(String artifactId, ProcessNodeType nodeType, String xsd, boolean supportedByEditor, SmooksVersion... runtimeVersions) {
+ this.artifactId = artifactId;
+ this.nodeType = nodeType;
+ this.namespaceURI = URI.create("http://www.milyn.org/xsd/" + xsd);
+ this.supportedByEditor = supportedByEditor;
+ if(runtimeVersions != null) {
+ this.runtimeVersions.addAll(Arrays.asList(runtimeVersions));
+ }
+ }
+
+ public void visitBefore(SAXElement configElement, ExecutionContext execContext) throws SmooksException, IOException {
+ RuntimeMetadata metadata = (RuntimeMetadata) execContext.getAttribute(RuntimeMetadata.class);
+ Set<URI> alreadyProcessed = (Set<URI>) execContext.getAttribute(RuntimeDependencyTracker.class);
+
+ metadata.getNodeTypes().add(nodeType);
+
+ if(alreadyProcessed == null) {
+ alreadyProcessed = new HashSet<URI>();
+ execContext.setAttribute(RuntimeDependencyTracker.class, alreadyProcessed);
+ }
+
+ // If the config namespace hasn't already been added, we need to add it...
+ String configNS = configElement.getName().getNamespaceURI();
+ if(configNS.equals(namespaceURI.toString()) && !alreadyProcessed.contains(namespaceURI)) {
+ metadata.getDependencies().add(new RuntimeDependency(artifactId, namespaceURI, supportedByEditor, runtimeVersions));
+ alreadyProcessed.add(namespaceURI);
+ }
+ }
+ }
+}
Copied: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeMetadata.java (from rev 18918, trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchMetadata.java)
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeMetadata.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeMetadata.java 2009-11-30 20:55:50 UTC (rev 18930)
@@ -0,0 +1,217 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.tools.smooks.configuration;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.xml.transform.stream.StreamSource;
+
+import org.eclipse.core.resources.IResource;
+import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
+import org.jboss.tools.smooks10.model.smooks.util.SmooksModelUtils;
+import org.milyn.Smooks;
+import org.milyn.SmooksException;
+import org.milyn.container.ExecutionContext;
+import org.milyn.delivery.sax.SAXElement;
+import org.milyn.delivery.sax.SAXVisitAfter;
+import org.milyn.delivery.sax.SAXVisitBefore;
+
+/**
+ * Smooks configuration runtime metadata.
+ * <p/>
+ * Verifies the specified config is a Smooks configuration and extracts metadata from the
+ * config e.g. input file, dependencies.
+ *
+ * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
+ */
+public class RuntimeMetadata {
+
+ private Smooks metadataExtractor;
+ private boolean isSmooksConfig;
+ private boolean isValidSmooksConfig;
+ private File configFile;
+ private String inputType;
+ private File inputFile;
+ private Set<ProcessNodeType> processNodeTypes = new HashSet<ProcessNodeType>();
+ private List<RuntimeDependency> dependencies = new ArrayList<RuntimeDependency>();
+
+ public RuntimeMetadata() {
+ metadataExtractor = new Smooks();
+ metadataExtractor.addVisitor(new SmooksConfigAsserter(), "/smooks-resource-list", "http://www.milyn.org/xsd/smooks-1.1.xsd");
+ metadataExtractor.addVisitor(new InputParamExtractor(), "/smooks-resource-list/params/param", "http://www.milyn.org/xsd/smooks-1.1.xsd");
+
+ // Build dependency map...
+ RuntimeDependency.addDependencyChecklist(metadataExtractor);
+ }
+
+ public boolean isSmooksConfig() {
+ return isSmooksConfig;
+ }
+
+ public boolean isValidSmooksConfig() {
+ return isValidSmooksConfig;
+ }
+
+ public String getErrorMessage() {
+ if(isValidSmooksConfig) {
+ throw new IllegalStateException("Invalid call to 'getErrorMessage()'. Smooks configuration is NOT invalid.");
+ }
+
+ if(configFile == null) {
+ return "Smooks configuration file not configured, or does not exist.";
+ } else if(!configFile.exists()) {
+ return "Specified Smooks configuration file not found.";
+ } else if(!configFile.isFile()) {
+ return "Specified Smooks configuration file is not a readable file.";
+ } else if(!isSmooksConfig) {
+ return "Specified Smooks configuration file is not a valid Smooks Configuration.";
+ } else if(inputFile == null) {
+ return "Specified Smooks configuration 'Input' task is not configured with a sample input file. Please configure the 'Input' task in the Process flow.";
+ } else if(!inputFile.exists()) {
+ return "Specified Smooks configuration 'Input' task is configured with a sample input file, but the file cannot be found. Please reconfigure the 'Input' task in the Process flow.";
+ } else if(!inputFile.isFile()) {
+ return "Specified Smooks configuration 'Input' task is configured with a sample input file, but the file cannot be read. Please reconfigure the 'Input' task in the Process flow.";
+ }
+
+ return "";
+ }
+
+ public File getConfigFile() {
+ return configFile;
+ }
+
+ public String getInputType() {
+ return inputType;
+ }
+
+ public File getInputFile() {
+ return inputFile;
+ }
+
+ public List<RuntimeDependency> getDependencies() {
+ return dependencies;
+ }
+
+ public Set<ProcessNodeType> getNodeTypes() {
+ return processNodeTypes;
+ }
+
+ public String getNodeTypesString() {
+ StringBuilder builder = new StringBuilder();
+ for(ProcessNodeType nodeType : processNodeTypes) {
+ if(builder.length() > 0) {
+ builder.append(',');
+ }
+ builder.append(nodeType.toString());
+ }
+ return builder.toString();
+ }
+
+ public void setSmooksConfig(IResource smooksConfig) {
+ reset();
+
+ if(smooksConfig != null) {
+ configFile = new File(smooksConfig.getRawLocation().toOSString().trim());
+ if(configFile.exists() && configFile.isFile()) {
+ ExecutionContext execContext = metadataExtractor.createExecutionContext();
+ Properties inputParams = new Properties();
+
+ try {
+ // Filter the config and capture the input params...
+ execContext.setAttribute(InputParamExtractor.class, inputParams);
+ execContext.setAttribute(RuntimeMetadata.class, this);
+
+ metadataExtractor.filterSource(execContext, new StreamSource(new FileInputStream(configFile)));
+
+ inputType = inputParams.getProperty(SmooksModelUtils.INPUT_TYPE);
+ if(inputType != null) {
+ String inputPath = inputParams.getProperty(inputType);
+ if(inputPath != null) {
+ String resolvedFilePath;
+ try {
+ resolvedFilePath = SmooksUIUtils.parseFilePath(inputPath.trim());
+ } catch(Exception e) {
+ // It's not a valid config...
+ inputFile = new File(inputPath.trim());
+ return;
+ }
+
+ inputFile = new File(resolvedFilePath);
+ if(inputFile.exists() && inputFile.isFile()) {
+ isValidSmooksConfig = true;
+ }
+ }
+ }
+ } catch (Exception e) {
+ // Not a valid Smooks config file
+ }
+ }
+ }
+ }
+
+ private void reset() {
+ isSmooksConfig = false;
+ isValidSmooksConfig = false;
+ configFile = null;
+ inputType = null;
+ inputFile = null;
+ processNodeTypes.clear();
+ }
+
+ private static class SmooksConfigAsserter implements SAXVisitBefore {
+ public void visitBefore(SAXElement paramElement, ExecutionContext execContext) throws SmooksException, IOException {
+ RuntimeMetadata metadata = (RuntimeMetadata) execContext.getAttribute(RuntimeMetadata.class);
+ metadata.isSmooksConfig = true;
+ }
+ }
+
+ private static class InputParamExtractor implements SAXVisitBefore, SAXVisitAfter {
+
+ public void visitBefore(SAXElement paramElement, ExecutionContext execContext) throws SmooksException, IOException {
+ paramElement.accumulateText();
+ }
+
+ public void visitAfter(SAXElement paramElement, ExecutionContext execContext) throws SmooksException, IOException {
+ Properties inputParams = (Properties) execContext.getAttribute(InputParamExtractor.class);
+
+ if(inputParams != null) {
+ String paramName = paramElement.getAttribute("name");
+
+ if(paramName != null) {
+ if(paramName.equals(SmooksModelUtils.INPUT_TYPE)) {
+ inputParams.setProperty(SmooksModelUtils.INPUT_TYPE, paramElement.getTextContent());
+ } else {
+ String paramType = paramElement.getAttribute("type");
+ if(paramType != null && paramType.equals(SmooksModelUtils.INPUT_ACTIVE_TYPE)) {
+ inputParams.setProperty(paramName, paramElement.getTextContent());
+ }
+ }
+ }
+ }
+ }
+ }
+}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ProcessNodeType.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ProcessNodeType.java 2009-11-30 20:12:24 UTC (rev 18929)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ProcessNodeType.java 2009-11-30 20:55:50 UTC (rev 18930)
@@ -1,30 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.tools.smooks.launch;
-
-/**
- * Configuration process node type enumeration.
- *
- * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
- */
-public enum ProcessNodeType {
- TEMPLATING,
- JAVA_BINDING
-}
\ No newline at end of file
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchConfigurationDelegate.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchConfigurationDelegate.java 2009-11-30 20:12:24 UTC (rev 18929)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchConfigurationDelegate.java 2009-11-30 20:55:50 UTC (rev 18930)
@@ -36,6 +36,7 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate;
import org.eclipse.jdt.launching.ExecutionArguments;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
@@ -45,6 +46,10 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.smooks.configuration.ProcessNodeType;
+import org.jboss.tools.smooks.configuration.RuntimeDependency;
+import org.jboss.tools.smooks.configuration.RuntimeMetadata;
+import org.jboss.tools.smooks.configuration.editors.uitls.ProjectClassLoader;
import org.jboss.tools.smooks.core.SmooksInputType;
/**
@@ -60,39 +65,54 @@
* @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor)
*/
public void launch(ILaunchConfiguration launchConfig, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- IProject project = getJavaProject(launchConfig).getProject();
+ IJavaProject javaProject = getJavaProject(launchConfig);
+ IProject project = javaProject.getProject();
final String smooksConfigName = launchConfig.getAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "");
- final SmooksLaunchMetadata launchMetadata = new SmooksLaunchMetadata();
+ final RuntimeMetadata launchMetadata = new RuntimeMetadata();
launchMetadata.setSmooksConfig(project.findMember(smooksConfigName));
- if(launchMetadata.isValidSmooksConfig()) {
- IVMRunner runner= getVMRunner(launchConfig, mode);
- VMRunnerConfiguration runConfig = buildRunnerConfig(launchConfig);
+ if(!launchMetadata.isValidSmooksConfig()) {
+ displayError(smooksConfigName, launchMetadata.getErrorMessage());
+ } else {
+ List<RuntimeDependency> dependencies = launchMetadata.getDependencies();
+ ProjectClassLoader projectClassLoader = new ProjectClassLoader(javaProject);
- // check for cancellation
- if (monitor.isCanceled()) {
- return;
- }
-
- String inputType = launchMetadata.getInputType();
- String inputPath = launchMetadata.getInputFile().getAbsolutePath();
- String nodeTypes = launchMetadata.getNodeTypesString();
-
- runConfig.setProgramArguments(new String[] {launchMetadata.getConfigFile().getAbsolutePath(), inputType, inputPath, nodeTypes});
-
- runner.run(runConfig, launch, monitor);
- } else {
- final Display display = PlatformUI.getWorkbench().getDisplay();
- display.syncExec(new Runnable() {
- public void run(){
- Shell shell = display.getActiveShell();
- ErrorDialog.openError(shell, "Error", "Error Launching Smooks Configuration '" + smooksConfigName + "'.", new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, launchMetadata.getErrorMessage(), new Exception()));
- }
- });
+ for(RuntimeDependency dependency : dependencies) {
+ if(!dependency.isOnProjectClasspath(projectClassLoader)) {
+ displayError(smooksConfigName, "This configuration depends on the '" + dependency.getGroupId() + ":" + dependency.getArtifactId() + "' Smooks artifact. Download Smooks and add the Smooks jars to the Project classpath, or update your Maven POM to include the missing artifact!!");
+ return;
+ }
+ }
}
+
+ IVMRunner runner= getVMRunner(launchConfig, mode);
+ VMRunnerConfiguration runConfig = buildRunnerConfig(launchConfig);
+
+ // check for cancellation
+ if (monitor.isCanceled()) {
+ return;
+ }
+
+ String inputType = launchMetadata.getInputType();
+ String inputPath = launchMetadata.getInputFile().getAbsolutePath();
+ String nodeTypes = launchMetadata.getNodeTypesString();
+
+ runConfig.setProgramArguments(new String[] {launchMetadata.getConfigFile().getAbsolutePath(), inputType, inputPath, nodeTypes});
+
+ runner.run(runConfig, launch, monitor);
}
+ private void displayError(final String smooksConfigName, final String errorMessage) {
+ final Display display = PlatformUI.getWorkbench().getDisplay();
+ display.syncExec(new Runnable() {
+ public void run(){
+ Shell shell = display.getActiveShell();
+ ErrorDialog.openError(shell, "Error", "Error Launching Smooks Configuration '" + smooksConfigName + "'.", new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, errorMessage, new Exception()));
+ }
+ });
+ }
+
private VMRunnerConfiguration buildRunnerConfig(ILaunchConfiguration launchConfig) throws CoreException {
List<String> classpath = new ArrayList<String>(Arrays.asList(getClasspath(launchConfig)));
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchMetadata.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchMetadata.java 2009-11-30 20:12:24 UTC (rev 18929)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchMetadata.java 2009-11-30 20:55:50 UTC (rev 18930)
@@ -1,224 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.tools.smooks.launch;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.xml.transform.stream.StreamSource;
-
-import org.eclipse.core.resources.IResource;
-import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
-import org.jboss.tools.smooks10.model.smooks.util.SmooksModelUtils;
-import org.milyn.Smooks;
-import org.milyn.SmooksException;
-import org.milyn.container.ExecutionContext;
-import org.milyn.delivery.sax.SAXElement;
-import org.milyn.delivery.sax.SAXVisitAfter;
-import org.milyn.delivery.sax.SAXVisitBefore;
-
-/**
- * Smooks configuration launch metadata.
- * <p/>
- * Verifies the specified config is a Smooks configuration and extracts launch
- * metadata from the config (input file etc).
- *
- * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
- */
-public class SmooksLaunchMetadata {
-
- private Smooks inputParamExtractor;
- private boolean isSmooksConfig;
- private boolean isValidSmooksConfig;
- private File configFile;
- private String inputType;
- private File inputFile;
- private Set<ProcessNodeType> processNodeTypes = new HashSet<ProcessNodeType>();
-
- public SmooksLaunchMetadata() {
- inputParamExtractor = new Smooks();
- inputParamExtractor.addVisitor(new SmooksConfigAsserter(), "/smooks-resource-list", "http://www.milyn.org/xsd/smooks-1.1.xsd");
- inputParamExtractor.addVisitor(new InputParamExtractor(), "/smooks-resource-list/params/param", "http://www.milyn.org/xsd/smooks-1.1.xsd");
- inputParamExtractor.addVisitor(new ConfigTypeTracker().setNodeType(ProcessNodeType.TEMPLATING), "/smooks-resource-list/freemarker");
- inputParamExtractor.addVisitor(new ConfigTypeTracker().setNodeType(ProcessNodeType.JAVA_BINDING), "/smooks-resource-list/bean");
- }
-
- public boolean isSmooksConfig() {
- return isSmooksConfig;
- }
-
- public boolean isValidSmooksConfig() {
- return isValidSmooksConfig;
- }
-
- public String getErrorMessage() {
- if(isValidSmooksConfig) {
- throw new IllegalStateException("Invalid call to 'getErrorMessage()'. Smooks configuration is NOT invalid.");
- }
-
- if(configFile == null) {
- return "Smooks configuration file not configured, or does not exist.";
- } else if(!configFile.exists()) {
- return "Specified Smooks configuration file not found.";
- } else if(!configFile.isFile()) {
- return "Specified Smooks configuration file is not a readable file.";
- } else if(!isSmooksConfig) {
- return "Specified Smooks configuration file is not a valid Smooks Configuration.";
- } else if(inputFile == null) {
- return "Specified Smooks configuration 'Input' task is not configured with a sample input file. Please configure the 'Input' task in the Process flow.";
- } else if(!inputFile.exists()) {
- return "Specified Smooks configuration 'Input' task is configured with a sample input file, but the file cannot be found. Please reconfigure the 'Input' task in the Process flow.";
- } else if(!inputFile.isFile()) {
- return "Specified Smooks configuration 'Input' task is configured with a sample input file, but the file cannot be read. Please reconfigure the 'Input' task in the Process flow.";
- }
-
- return "";
- }
-
- public File getConfigFile() {
- return configFile;
- }
-
- public String getInputType() {
- return inputType;
- }
-
- public File getInputFile() {
- return inputFile;
- }
-
- public Set<ProcessNodeType> getNodeTypes() {
- return processNodeTypes;
- }
-
- public String getNodeTypesString() {
- StringBuilder builder = new StringBuilder();
- for(ProcessNodeType nodeType : processNodeTypes) {
- if(builder.length() > 0) {
- builder.append(',');
- }
- builder.append(nodeType.toString());
- }
- return builder.toString();
- }
-
- public void setSmooksConfig(IResource smooksConfig) {
- reset();
-
- if(smooksConfig != null) {
- configFile = new File(smooksConfig.getRawLocation().toOSString().trim());
- if(configFile.exists() && configFile.isFile()) {
- ExecutionContext execContext = inputParamExtractor.createExecutionContext();
- Properties inputParams = new Properties();
-
- try {
- // Filter the config and capture the input params...
- execContext.setAttribute(InputParamExtractor.class, inputParams);
- execContext.setAttribute(SmooksLaunchMetadata.class, this);
-
- inputParamExtractor.filterSource(execContext, new StreamSource(new FileInputStream(configFile)));
-
- inputType = inputParams.getProperty(SmooksModelUtils.INPUT_TYPE);
- if(inputType != null) {
- String inputPath = inputParams.getProperty(inputType);
- if(inputPath != null) {
- String resolvedFilePath;
- try {
- resolvedFilePath = SmooksUIUtils.parseFilePath(inputPath.trim());
- } catch(Exception e) {
- // It's not a valid config...
- inputFile = new File(inputPath.trim());
- return;
- }
-
- inputFile = new File(resolvedFilePath);
- if(inputFile.exists() && inputFile.isFile()) {
- isValidSmooksConfig = true;
- }
- }
- }
- } catch (Exception e) {
- // Not a valid Smooks config file
- }
- }
- }
- }
-
- private void reset() {
- isSmooksConfig = false;
- isValidSmooksConfig = false;
- configFile = null;
- inputType = null;
- inputFile = null;
- processNodeTypes.clear();
- }
-
- private static class SmooksConfigAsserter implements SAXVisitBefore {
- public void visitBefore(SAXElement paramElement, ExecutionContext execContext) throws SmooksException, IOException {
- SmooksLaunchMetadata metadata = (SmooksLaunchMetadata) execContext.getAttribute(SmooksLaunchMetadata.class);
- metadata.isSmooksConfig = true;
- }
- }
-
- private static class InputParamExtractor implements SAXVisitBefore, SAXVisitAfter {
-
- public void visitBefore(SAXElement paramElement, ExecutionContext execContext) throws SmooksException, IOException {
- paramElement.accumulateText();
- }
-
- public void visitAfter(SAXElement paramElement, ExecutionContext execContext) throws SmooksException, IOException {
- Properties inputParams = (Properties) execContext.getAttribute(InputParamExtractor.class);
-
- if(inputParams != null) {
- String paramName = paramElement.getAttribute("name");
-
- if(paramName != null) {
- if(paramName.equals(SmooksModelUtils.INPUT_TYPE)) {
- inputParams.setProperty(SmooksModelUtils.INPUT_TYPE, paramElement.getTextContent());
- } else {
- String paramType = paramElement.getAttribute("type");
- if(paramType != null && paramType.equals(SmooksModelUtils.INPUT_ACTIVE_TYPE)) {
- inputParams.setProperty(paramName, paramElement.getTextContent());
- }
- }
- }
- }
- }
- }
-
- private static class ConfigTypeTracker implements SAXVisitBefore {
-
- private ProcessNodeType nodeType;
-
- public ConfigTypeTracker setNodeType(ProcessNodeType nodeType) {
- this.nodeType = nodeType;
- return this;
- }
-
- public void visitBefore(SAXElement paramElement, ExecutionContext execContext) throws SmooksException, IOException {
- SmooksLaunchMetadata metadata = (SmooksLaunchMetadata) execContext.getAttribute(SmooksLaunchMetadata.class);
- metadata.getNodeTypes().add(nodeType);
- }
- }
-}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLauncher.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLauncher.java 2009-11-30 20:12:24 UTC (rev 18929)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLauncher.java 2009-11-30 20:55:50 UTC (rev 18930)
@@ -32,6 +32,7 @@
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
+import org.jboss.tools.smooks.configuration.ProcessNodeType;
import org.jboss.tools.smooks.core.SmooksInputType;
import org.milyn.Smooks;
import org.milyn.payload.JavaResult;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java 2009-11-30 20:12:24 UTC (rev 18929)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java 2009-11-30 20:55:50 UTC (rev 18930)
@@ -69,6 +69,7 @@
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jdt.ui.JavaElementLabelProvider;
+import org.jboss.tools.smooks.configuration.RuntimeMetadata;
import org.jboss.tools.smooks.editor.AbstractSmooksFormEditor;
/**
@@ -82,7 +83,7 @@
private Button fProjButton;
private Text fConfigurationText;
private Button fSearchButton;
- private SmooksLaunchMetadata launchMetaData = new SmooksLaunchMetadata();
+ private RuntimeMetadata launchMetaData = new RuntimeMetadata();
private ILaunchConfiguration fLaunchConfiguration;
15 years
JBoss Tools SVN: r18929 - trunk/jst/plugins/org.jboss.tools.jst.text.ext.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-11-30 15:12:24 -0500 (Mon, 30 Nov 2009)
New Revision: 18929
Modified:
trunk/jst/plugins/org.jboss.tools.jst.text.ext/plugin.xml
Log:
JBIDE-5002: OpenOn doesn't work for html tags <link href="|"/> and <a href="|" /> inside <f:view>
Modified: trunk/jst/plugins/org.jboss.tools.jst.text.ext/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.text.ext/plugin.xml 2009-11-30 19:57:42 UTC (rev 18928)
+++ trunk/jst/plugins/org.jboss.tools.jst.text.ext/plugin.xml 2009-11-30 20:12:24 UTC (rev 18929)
@@ -205,6 +205,7 @@
<contentType id="org.eclipse.jst.jsp.core.jspsource">
<partitionType id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
<axis path="*/a/href/" ignoreCase="true"/>
+ <axis path="*/link/href/" ignoreCase="true"/>
<axis path="*/jsp:directive.include/file/" />
<axis path="*/[http://java.sun.com/JSP/Page]:directive.include/file/" />
<axis path="*/jsp:directive.page/errorPage/" />
@@ -222,6 +223,7 @@
<contentType id="org.eclipse.wst.html.core.htmlsource">
<partitionType id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
<axis path="*/a/href/" ignoreCase="true"/>
+ <axis path="*/link/href/" ignoreCase="true"/>
</partitionType>
</contentType>
</hyperlinkPartitioner>
15 years
JBoss Tools SVN: r18928 - trunk/as/plugins/org.jboss.ide.eclipse.as.core.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-11-30 14:57:42 -0500 (Mon, 30 Nov 2009)
New Revision: 18928
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
Log:
JBIDE-5229
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2009-11-30 17:40:03 UTC (rev 18927)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2009-11-30 19:57:42 UTC (rev 18928)
@@ -197,7 +197,7 @@
versions="1.0"/>
<moduleType
types="jst.jboss.esb"
- versions="4.2,4.3,4.4,5.0">
+ versions="4.2,4.3,4.4">
</moduleType>
</runtimeType>
<runtimeType
@@ -230,7 +230,7 @@
versions="1.0"/>
<moduleType
types="jst.jboss.esb"
- versions="4.2,4.3,4.4,4.5,4.6,5.0">
+ versions="4.2,4.3,4.4,4.5,4,6,4.7">
</moduleType>
</runtimeType>
<runtimeType
@@ -263,7 +263,7 @@
versions="1.0"/>
<moduleType
types="jst.jboss.esb"
- versions="4.2,4.3,4.4,4.5,4,6,5.0">
+ versions="4.2,4.3,4.4,4.5,4,6,4.7">
</moduleType>
<moduleType
types="jbt.bpel.module"
@@ -300,7 +300,7 @@
versions="1.0"/>
<moduleType
types="jst.jboss.esb"
- versions="4.2,4.3,4.4,4.5,4.6,5.0">
+ versions="4.2,4.3,4.4,4.5,4.6,4.7">
</moduleType>
<moduleType
types="jbt.bpel.module"
@@ -339,7 +339,7 @@
versions="1.0"/>
<moduleType
types="jst.jboss.esb"
- versions="4.2,4.3,4.4,4.5,4.6,5.0">
+ versions="4.2,4.3,4.4,4.5,4.6,4.7">
</moduleType>
</runtimeType>
@@ -373,7 +373,7 @@
versions="1.0"/>
<moduleType
types="jst.jboss.esb"
- versions="4.2,4.3,4.4,4.5,4.6,5.0">
+ versions="4.2,4.3,4.4,4.5,4.6,4.7">
</moduleType>
<moduleType
types="jbt.bpel.module"
@@ -413,7 +413,7 @@
versions="1.0"/>
<moduleType
types="jst.jboss.esb"
- versions="4.2,4.3,4.4,4.5,4.6,5.0">
+ versions="4.2,4.3,4.4,4.5,4.6,4.7">
</moduleType>
<moduleType
types="jbt.bpel.module"
15 years
JBoss Tools SVN: r18927 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2009-11-30 12:40:03 -0500 (Mon, 30 Nov 2009)
New Revision: 18927
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
Log:
Check for minimal library version has been removed for jsf2 tags, becouse in jsf libraries tld version isn't specified correctly
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2009-11-30 16:33:31 UTC (rev 18926)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2009-11-30 17:40:03 UTC (rev 18927)
@@ -863,7 +863,9 @@
<!-- JSF 2.0 Tags -->
<vpe:tag name="h:body" case-sensitive="yes">
<!-- The tag cannot have any attribute. -->
- <vpe:if test="tld_version('min=2.0')">
+ <!-- Checks for min tld version has been comented,
+ becouse it's not specified correctly in jsf lib, mareshkau -->
+ <!-- <vpe:if test="tld_version('min=2.0')"> -->
<vpe:template children="yes" modify="yes"
class="org.jboss.tools.jsf.vpe.jsf.template.JsfBodyTemplate">
<vpe:dnd>
@@ -871,19 +873,21 @@
<vpe:drop container="no"></vpe:drop>
</vpe:dnd>
</vpe:template>
- </vpe:if>
+ <!-- </vpe:if> -->
</vpe:tag>
<vpe:tag name="h:head" case-sensitive="yes">
<!-- The tag cannot have any attribute. -->
- <vpe:if test="tld_version('min=2.0')">
+ <!-- Checks for min tld version has been comented,
+ becouse it's not specified correctly in jsf lib, mareshkau -->
+ <!-- <vpe:if test="tld_version('min=2.0')"> -->
<vpe:template children="yes" modify="no">
<div style="display:none;" />
<vpe:dnd>
<vpe:drop container="yes" />
</vpe:dnd>
</vpe:template>
- </vpe:if>
+<!-- </vpe:if> -->
</vpe:tag>
<!--
@@ -893,9 +897,12 @@
src="{facesContext.getApplication().getResourceHandler().createResource(name, library).getRequestPath()}"/>
-->
<vpe:tag name="h:outputScript" case-sensitive="yes">
- <vpe:if test="tld_version('min=2.0')">
+ <!-- Checks for min tld version has been comented,
+ becouse it's not specified correctly in jsf lib, mareshkau -->
+ <!-- <vpe:if test="tld_version('min=2.0')"> -->
+
<vpe:template children="no" modify="no"/>
- </vpe:if>
+<!-- </vpe:if> -->
</vpe:tag>
<!--
@@ -906,40 +913,50 @@
href="{facesContext.getApplication().getResourceHandler().createResource(name, library).getRequestPath()}"/>
-->
<vpe:tag name="h:outputStylesheet" case-sensitive="yes">
- <vpe:if test="tld_version('min=2.0')">
+ <!-- Checks for min tld version has been comented,
+ becouse it's not specified correctly in jsf lib, mareshkau -->
+ <!-- <vpe:if test="tld_version('min=2.0')"> -->
<vpe:template children="no" modify="no">
<vpe:link rel="stylesheet" href="{href(@name)}" />
</vpe:template>
- </vpe:if>
+<!-- </vpe:if> -->
</vpe:tag>
<!-- End of JSF 2.0 Tags -->
<!-- Jsf 2.0 composite tags -->
<vpe:tag name="composite:implementation" case-sensitive="yes">
- <vpe:if test="tld_version('min=2.0')">
+ <!-- Checks for min tld version has been comented,
+ becouse it's not specified correctly in jsf lib, mareshkau -->
+ <!-- <vpe:if test="tld_version('min=2.0')"> -->
<vpe:template children="yes" modify="yes"
class="org.jboss.tools.jsf.vpe.facelets.template.VpeCompositionTemplate"
namespaceIdentifier="org.jboss.tools.jsf.vpe.facelets">
</vpe:template>
- </vpe:if>
+<!-- </vpe:if>-->
</vpe:tag>
<vpe:tag name="composite:interface" case-sensitive="yes">
- <vpe:if test="tld_version('min=2.0')">
+ <!-- Checks for min tld version has been comented,
+ becouse it's not specified correctly in jsf lib, mareshkau -->
+ <!-- <vpe:if test="tld_version('min=2.0')"> -->
<vpe:template children="yes" modify="no"/>
- </vpe:if>
+<!-- </vpe:if> -->
</vpe:tag>
<vpe:tag name="composite:attribute" case-sensitive="yes">
- <vpe:if test="tld_version('min=2.0')">
+ <!-- Checks for min tld version has been comented,
+ becouse it's not specified correctly in jsf lib, mareshkau -->
+ <!-- <vpe:if test="tld_version('min=2.0')"> -->
<vpe:template children="no" modify="no" class="org.jboss.tools.jsf.vpe.jsf.template.JSF2CompositeAttributeTemplate" />
- </vpe:if>
+<!-- </vpe:if> -->
</vpe:tag>
<vpe:tag name="composite:actionSource" case-sensitive="yes">
- <vpe:if test="tld_version('min=2.0')">
+ <!-- Checks for min tld version has been comented,
+ becouse it's not specified correctly in jsf lib, mareshkau -->
+ <!-- <vpe:if test="tld_version('min=2.0')"> -->
<vpe:template children="no" modify="no"/>
- </vpe:if>
+<!-- </vpe:if>-->
</vpe:tag>
<vpe:tag name="vpejsf2customTemplate" case-sensitive="yes">
15 years
JBoss Tools SVN: r18926 - in documentation/trunk/movies: rename_context_variables_java and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-11-30 11:33:31 -0500 (Mon, 30 Nov 2009)
New Revision: 18926
Added:
documentation/trunk/movies/rename_context_variables_java/
documentation/trunk/movies/rename_context_variables_java/readme.txt
documentation/trunk/movies/rename_context_variables_java/rename_context_variables_java.wnk
Log:
https://jira.jboss.org/jira/browse/JBDS-957 - adding the demo "Renaming a Seam Context Variable in EL in the Java Editor" created with the Wink tool;
Added: documentation/trunk/movies/rename_context_variables_java/readme.txt
===================================================================
--- documentation/trunk/movies/rename_context_variables_java/readme.txt (rev 0)
+++ documentation/trunk/movies/rename_context_variables_java/readme.txt 2009-11-30 16:33:31 UTC (rev 18926)
@@ -0,0 +1,25 @@
+To apply Jboss org styles to the generated HTML file, you should do next:
+
+
+- first, add the HEAD of the HTML document to attach a style sheet, a tab icon and a title of the page:
+
+ <head>
+ <title>Renaming a Seam Context Variable in EL in the Java Editor</title>
+ <link rel="stylesheet" href="../resources/tools.css"
+ type="text/css"/>
+ <link xmlns="" rel="shortcut icon" type="image/vnd.microsoft.icon" href="../resources/images/favicon.ico"/>
+ </head>
+
+
+- place the generated by Wink OBJECT inside this block element:
+
+ <div class="book">
+ <p id="title"><a href="http://www.jboss.org" class="site_href">
+ <strong>JBoss.org</strong></a><a href="http://docs.jboss.org/" class="doc_href">
+ <strong>Community Demos</strong></a></p>
+
+ <--! Place the OBJECT generated by Wink here. -->
+
+ </div>
+
+
\ No newline at end of file
Added: documentation/trunk/movies/rename_context_variables_java/rename_context_variables_java.wnk
===================================================================
(Binary files differ)
Property changes on: documentation/trunk/movies/rename_context_variables_java/rename_context_variables_java.wnk
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years
JBoss Tools SVN: r18925 - in trunk/cdi/plugins/org.jboss.tools.cdi.core: META-INF and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-11-30 11:23:33 -0500 (Mon, 30 Nov 2009)
New Revision: 18925
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.properties
trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ICDIBuilderDelegate.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF
trunk/cdi/plugins/org.jboss.tools.cdi.core/build.properties
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICorePlugin.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5244
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF 2009-11-30 16:21:05 UTC (rev 18924)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF 2009-11-30 16:23:33 UTC (rev 18925)
@@ -4,6 +4,7 @@
Bundle-SymbolicName: org.jboss.tools.cdi.core;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: org.jboss.tools.cdi.core.CDICorePlugin
+Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.jboss.tools.common,
@@ -13,4 +14,5 @@
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: JBoss by Red Hat
-Export-Package: org.jboss.tools.cdi.core
+Export-Package: org.jboss.tools.cdi.core,
+ org.jboss.tools.cdi.internal.core.scanner.lib
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/build.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/build.properties 2009-11-30 16:21:05 UTC (rev 18924)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/build.properties 2009-11-30 16:23:33 UTC (rev 18925)
@@ -3,4 +3,5 @@
bin.includes = plugin.xml,\
META-INF/,\
.
-src.includes = src/
+src.includes = src/,\
+ plugin.xml
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.properties
===================================================================
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml 2009-11-30 16:23:33 UTC (rev 18925)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+ <extension
+ id="cdibuilder"
+ name="CDI Builder"
+ point="org.eclipse.core.resources.builders">
+ <builder
+ hasNature="false">
+ <run
+ class="org.jboss.tools.cdi.core.CDICoreBuilder">
+ </run>
+ </builder>
+ </extension>
+ <extension
+ id="cdinature"
+ name="CDI Project Nature"
+ point="org.eclipse.core.resources.natures">
+ <runtime>
+ <run
+ class="org.jboss.tools.cdi.core.CDICoreNature">
+ </run>
+ </runtime>
+ <builder
+ id="org.jboss.tools.cdi.core.cdibuilder">
+ </builder>
+ </extension>
+
+</plugin>
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java 2009-11-30 16:23:33 UTC (rev 18925)
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.cdi.core;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+public class CDICoreBuilder extends IncrementalProjectBuilder {
+ public static String BUILDER_ID = "org.jboss.tools.cdi.core.cdibuilder";
+
+ static Set<ICDIBuilderDelegate> delegates = null;
+
+ static Set<ICDIBuilderDelegate> getDelegates() {
+ if(delegates == null) {
+ delegates = new HashSet<ICDIBuilderDelegate>();
+ //TODO populate
+ }
+ return delegates;
+ }
+
+ ICDIBuilderDelegate builderDelegate;
+
+ CDIResourceVisitor resourceVisitor = null;
+
+ public CDICoreBuilder() {}
+
+ CDICoreNature getCDICoreNature() {
+ IProject p = getProject();
+ if(p == null) return null;
+ return CDICorePlugin.getCDI(p, false);
+ }
+
+ CDIResourceVisitor getResourceVisitor() {
+ if(resourceVisitor == null) {
+ resourceVisitor = new CDIResourceVisitor();
+ }
+ return resourceVisitor;
+ }
+
+ private void findDelegate() {
+ Set<ICDIBuilderDelegate> ds = getDelegates();
+ int relevance = 0;
+ for (ICDIBuilderDelegate d: ds) {
+ int r = d.computeRelevance(getProject());
+ if(r > relevance) {
+ builderDelegate = d;
+ relevance = r;
+ }
+ }
+ }
+
+ public ICDIBuilderDelegate getDelegate() {
+ return builderDelegate;
+ }
+
+ protected IProject[] build(int kind, Map args, IProgressMonitor monitor)
+ throws CoreException {
+ findDelegate();
+ if(getDelegate() == null) {
+ return null;
+ }
+ CDICoreNature n = getCDICoreNature();
+ if(n == null) {
+ return null;
+ }
+ if(n.hasNoStorage()) {
+ kind = FULL_BUILD;
+ }
+
+ n.postponeFiring();
+
+ long begin = System.currentTimeMillis();
+
+ try {
+ n.resolveStorage(kind != FULL_BUILD);
+
+ if(n.getDelegate() == null || n.getDelegate().getClass() != getDelegate().getProjectImplementationClass()) {
+ if(n.getDelegate() != null) {
+ n.clean();
+ n.postponeFiring();
+ }
+ kind = FULL_BUILD;
+ try {
+ ICDIProject delegate = (ICDIProject)getDelegate().getProjectImplementationClass().newInstance();
+ n.setCDIProject(delegate);
+ } catch (IllegalAccessException e1) {
+ CDICorePlugin.getDefault().logError(e1);
+ } catch (InstantiationException e2) {
+ CDICorePlugin.getDefault().logError(e2);
+ }
+ }
+
+ if(n.getClassPath().update()) {
+ n.getClassPath().process();
+ } else if(n.getClassPath().hasToUpdateProjectDependencies()) {
+ n.getClassPath().validateProjectDependencies();
+ }
+
+ if (kind == FULL_BUILD) {
+ fullBuild(monitor);
+ } else {
+ IResourceDelta delta = getDelta(getProject());
+ if (delta == null) {
+ fullBuild(monitor);
+ } else {
+ incrementalBuild(delta, monitor);
+ }
+ }
+ long end = System.currentTimeMillis();
+ n.fullBuildTime += end - begin;
+ try {
+ n.store();
+ } catch (IOException e) {
+ CDICorePlugin.getDefault().logError(e); //$NON-NLS-1$
+ }
+
+// n.postBuild();
+
+ } finally {
+ n.fireChanges();
+ }
+
+ return null;
+ }
+
+ protected void fullBuild(final IProgressMonitor monitor)
+ throws CoreException {
+ try {
+ getProject().accept(getResourceVisitor());
+ } catch (CoreException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
+ }
+
+ protected void incrementalBuild(IResourceDelta delta,
+ IProgressMonitor monitor) throws CoreException {
+ delta.accept(new SampleDeltaVisitor());
+ }
+
+ protected void clean(IProgressMonitor monitor) throws CoreException {
+ CDICoreNature n = getCDICoreNature();
+ if(n != null) n.clean();
+ }
+
+ class SampleDeltaVisitor implements IResourceDeltaVisitor {
+ /*
+ * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
+ */
+ public boolean visit(IResourceDelta delta) throws CoreException {
+ IResource resource = delta.getResource();
+ switch (delta.getKind()) {
+ case IResourceDelta.ADDED:
+ return getResourceVisitor().visit(resource);
+ case IResourceDelta.REMOVED:
+ CDICoreNature p = getCDICoreNature();
+ if(p != null) p.pathRemoved(resource.getFullPath());
+ break;
+ case IResourceDelta.CHANGED:
+ return getResourceVisitor().visit(resource);
+ }
+ //return true to continue visiting children.
+ return true;
+ }
+ }
+
+ class CDIResourceVisitor implements IResourceVisitor {
+
+ public boolean visit(IResource resource) throws CoreException {
+ // TODO
+ return false;
+ }
+
+ }
+
+}
+
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java 2009-11-30 16:23:33 UTC (rev 18925)
@@ -0,0 +1,237 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.cdi.core;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.jboss.tools.cdi.internal.core.scanner.lib.ClassPathMonitor;
+import org.jboss.tools.common.util.FileUtil;
+
+public class CDICoreNature implements IProjectNature {
+ public static String NATURE_ID = "org.jboss.tools.cdi.core.cdinature";
+
+ IProject project = null;
+ ICDIProject cdiProjectDelegate;
+
+ ClassPathMonitor classPath = new ClassPathMonitor(this);
+
+ Map<IPath, Object> sourcePaths2 = new HashMap<IPath, Object>(); //TODO
+
+ private boolean isStorageResolved = false;
+
+ public CDICoreNature() {}
+
+ public void configure() throws CoreException {
+ addToBuildSpec(CDICoreBuilder.BUILDER_ID);
+ }
+
+ public void deconfigure() throws CoreException {
+ removeFromBuildSpec(CDICoreBuilder.BUILDER_ID);
+ }
+
+ public IProject getProject() {
+ return project;
+ }
+
+ public void setProject(IProject project) {
+ this.project = project;
+ }
+
+ public void setCDIProject(ICDIProject cdiProject) {
+ this.cdiProjectDelegate = cdiProject;
+ }
+
+ public ICDIProject getDelegate() {
+ return cdiProjectDelegate;
+ }
+
+ public ClassPathMonitor getClassPath() {
+ return classPath;
+ }
+ /**
+ *
+ * @param load
+ */
+ public void resolveStorage(boolean load) {
+ if(isStorageResolved) return;
+ if(load) {
+ load();
+ } else {
+ isStorageResolved = true;
+ }
+ }
+
+ /**
+ *
+ */
+ public void resolve() {
+ resolveStorage(true);
+ }
+
+ /**
+ * Loads results of last build, which are considered
+ * actual until next build.
+ */
+ public void load() {
+ if(isStorageResolved) return;
+ isStorageResolved = true;
+
+ postponeFiring();
+
+ try {
+ boolean b = getClassPath().update();
+ if(b) {
+ getClassPath().validateProjectDependencies();
+ }
+ File file = getStorageFile();
+
+ //TODO
+
+ if(b) {
+ getClassPath().process();
+ }
+
+ } finally {
+ fireChanges();
+ }
+ }
+
+ public void clean() {
+ File file = getStorageFile();
+ if(file != null && file.isFile()) {
+ file.delete();
+ }
+ classPath.clean();
+ postponeFiring();
+ IPath[] ps = sourcePaths2.keySet().toArray(new IPath[0]);
+ for (int i = 0; i < ps.length; i++) {
+ pathRemoved(ps[i]);
+ }
+ fireChanges();
+ }
+
+ /**
+ * Stores results of last build, so that on exit/enter Eclipse
+ * load them without rebuilding project
+ * @throws IOException
+ */
+ public void store() throws IOException {
+ File file = getStorageFile();
+ file.getParentFile().mkdirs();
+
+ //TODO
+ }
+ /**
+ *
+ * @param builderID
+ * @throws CoreException
+ */
+ protected void addToBuildSpec(String builderID) throws CoreException {
+ IProjectDescription description = getProject().getDescription();
+ ICommand command = null;
+ ICommand commands[] = description.getBuildSpec();
+ for (int i = 0; i < commands.length && command == null; ++i) {
+ if (commands[i].getBuilderName().equals(builderID))
+ command = commands[i];
+ }
+ if (command == null) {
+ command = description.newCommand();
+ command.setBuilderName(builderID);
+ ICommand[] oldCommands = description.getBuildSpec();
+ ICommand[] newCommands = new ICommand[oldCommands.length + 1];
+ System.arraycopy(oldCommands, 0, newCommands, 0, oldCommands.length);
+ newCommands[oldCommands.length] = command;
+ description.setBuildSpec(newCommands);
+ getProject().setDescription(description, null);
+ }
+ }
+
+ /**
+ *
+ */
+ static String EXTERNAL_TOOL_BUILDER = "org.eclipse.ui.externaltools.ExternalToolBuilder"; //$NON-NLS-1$
+
+ /**
+ *
+ */
+ static final String LAUNCH_CONFIG_HANDLE = "LaunchConfigHandle"; //$NON-NLS-1$
+
+ /**
+ *
+ * @param builderID
+ * @throws CoreException
+ */
+ protected void removeFromBuildSpec(String builderID) throws CoreException {
+ IProjectDescription description = getProject().getDescription();
+ ICommand[] commands = description.getBuildSpec();
+ for (int i = 0; i < commands.length; ++i) {
+ String builderName = commands[i].getBuilderName();
+ if (!builderName.equals(builderID)) {
+ if(!builderName.equals(EXTERNAL_TOOL_BUILDER)) continue;
+ Object handle = commands[i].getArguments().get(LAUNCH_CONFIG_HANDLE);
+ if(handle == null || handle.toString().indexOf(builderID) < 0) continue;
+ }
+ ICommand[] newCommands = new ICommand[commands.length - 1];
+ System.arraycopy(commands, 0, newCommands, 0, i);
+ System.arraycopy(commands, i + 1, newCommands, i, commands.length - i - 1);
+ description.setBuildSpec(newCommands);
+ getProject().setDescription(description, null);
+ return;
+ }
+ }
+
+ /*
+ *
+ */
+ private File getStorageFile() {
+ IPath path = CDICorePlugin.getDefault().getStateLocation();
+ File file = new File(path.toFile(), "projects/" + project.getName()); //$NON-NLS-1$
+ return file;
+ }
+
+ public void clearStorage() {
+ File f = getStorageFile();
+ if(f == null || !f.exists()) return;
+ FileUtil.clear(f);
+ f.delete();
+ }
+
+ public boolean hasNoStorage() {
+ File f = getStorageFile();
+ return f == null || !f.exists();
+ }
+
+ public void postponeFiring() {
+ //TODO
+ }
+
+ public void fireChanges() {
+ //TODO
+ }
+
+ public long fullBuildTime;
+ public List<Long> statistics;
+
+ public void pathRemoved(IPath source) {
+ //TODO
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICorePlugin.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICorePlugin.java 2009-11-30 16:21:05 UTC (rev 18924)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICorePlugin.java 2009-11-30 16:23:33 UTC (rev 18925)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.cdi.core;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.resource.ImageDescriptor;
import org.jboss.tools.common.log.BaseUIPlugin;
import org.osgi.framework.BundleContext;
@@ -68,4 +71,23 @@
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
-}
\ No newline at end of file
+
+ public static CDICoreNature getCDI(IProject project, boolean resolve) {
+ if(project == null || !project.exists() || !project.isOpen()) return null;
+ try {
+ if(!project.hasNature(CDICoreNature.NATURE_ID)) return null;
+ } catch (CoreException e) {
+ //ignore - all checks are done above
+ return null;
+ }
+ CDICoreNature n = null;
+ try {
+ n = (CDICoreNature)project.getNature(CDICoreNature.NATURE_ID);
+ if(resolve) n.resolve();
+ } catch (CoreException e) {
+ getDefault().logError(e);
+ }
+ return n;
+ }
+
+}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ICDIBuilderDelegate.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ICDIBuilderDelegate.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ICDIBuilderDelegate.java 2009-11-30 16:23:33 UTC (rev 18925)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.cdi.core;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+
+/**
+ * Builder delegate performs build for specific kind of cdi project.
+ * CDICoreBuilder collects builder delegates registered by extension point
+ * and resolves which of them is best suited for the project instance.
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public interface ICDIBuilderDelegate {
+
+ public String getID();
+
+ public int computeRelevance(IProject project);
+
+ public Class<? extends ICDIProject> getProjectImplementationClass();
+
+ public void build(IFile file, CDICoreNature projectNature);
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ICDIBuilderDelegate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java 2009-11-30 16:23:33 UTC (rev 18925)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.cdi.internal.core.scanner.lib;
+
+import org.jboss.tools.cdi.core.CDICoreNature;
+
+//TODO implement
+public class ClassPathMonitor {
+
+ public ClassPathMonitor(CDICoreNature project) {
+
+ }
+
+ public boolean update() {
+ //TODO
+ return true;
+ }
+
+ public void validateProjectDependencies() {
+ //TODO
+ }
+
+ public void process() {
+ //TODO
+ }
+
+ public boolean hasToUpdateProjectDependencies() {
+ //TODO
+ return false;
+ }
+
+ public void clean() {
+ //TODO
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years