JBoss Tools SVN: r2625 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-07-24 08:57:31 -0400 (Tue, 24 Jul 2007)
New Revision: 2625
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/WebModelPlugin.java
Log:
http://jira.jboss.com/jira/browse/EXIN-302
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/WebModelPlugin.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/WebModelPlugin.java 2007-07-24 12:56:44 UTC (rev 2624)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/WebModelPlugin.java 2007-07-24 12:57:31 UTC (rev 2625)
@@ -14,23 +14,18 @@
import java.util.Iterator;
import java.util.Properties;
-import org.eclipse.ant.internal.ui.IAntUIConstants;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IRuntimeType;
import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
@@ -40,6 +35,7 @@
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
+import org.jboss.ide.seam.gen.actions.SeamGenAction;
import org.jboss.tools.common.log.BaseUIPlugin;
import org.jboss.tools.common.log.IPluginLog;
import org.jboss.tools.common.model.XModel;
@@ -53,7 +49,7 @@
public static final String JBOSS_AS_HOME = "../../../../jbossas"; // JBoss AS home directory (relative to plugin)- <RHDS_HOME>/jbossas.
// TODO agreement about actual seam-gen location is needed
- public static final String SEAM_GEN_HOME = "";
+ public static final String SEAM_GEN_HOME = "../../../../jbosseam/seam-gen";
public static final String JBOSS_AS_RUNTIME_TYPE_ID = "org.jboss.ide.eclipse.as.runtime.42";
public static final String JBOSS_AS_TYPE_ID = "org.jboss.ide.eclipse.as.42";
@@ -123,24 +119,13 @@
} catch (CoreException e1) {
getPluginLog().logError("Exception occured during search in Launch Configuration list.", e1);
}
- ILaunchConfigurationWorkingCopy wc;
+ String buildXmlPath = null;
if(config==null) {
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType( "org.eclipse.ant.AntLaunchConfigurationType" );
try {
- wc = launchConfigurationType.newInstance( null, "seamgen" );
- wc.setAttribute( "process_factory_id", "org.eclipse.ant.ui.remoteAntProcessFactory" );
- wc.setAttribute(IAntUIConstants.ATTR_DEFAULT_VM_INSTALL, true);
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "org.eclipse.ant.internal.ui.antsupport.InternalAntRunner");
- wc.setAttribute("org.eclipse.debug.core.appendEnvironmentVariables", true);
- wc.setAttribute( "org.eclipse.jdt.launching.CLASSPATH_PROVIDER", "org.eclipse.ant.ui.AntClasspathProvider" );
- wc.setAttribute( "org.eclipse.jdt.launching.SOURCEPATH_PROVIDER", "org.eclipse.ant.ui.AntClasspathProvider" );
- wc.setAttribute( "org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID", "org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType");
-
- wc.setAttribute( IExternalToolConstants.ATTR_LOCATION, getSeamGenBuildPath());
- wc.doSave();
+ buildXmlPath = getSeamGenBuildPath();
+ SeamGenAction.createSeamgenLaunchConfig(buildXmlPath);
} catch (CoreException e) {
- getPluginLog().logError("Cannot create configuration for Seam-Gen tool", e);
+ getPluginLog().logError("Cannot create configuration for Seam-Gen tool. Seamgen build.xml file: " + buildXmlPath, e);
return;
}
}
@@ -149,20 +134,19 @@
public String getSeamGenBuildPath() {
String pluginLocation = EclipseResourceUtil.getInstallPath(this.getBundle());
File seamGenDir = new File(pluginLocation, SEAM_GEN_HOME);
- File seamGenBuildXml = null;
- if(seamGenDir.isDirectory()) {
- seamGenBuildXml = new File(seamGenDir,"build.xml");
+ File seamGenBuildXml = new File(seamGenDir,"build.xml");
+ if(seamGenBuildXml.isFile()) {
return seamGenBuildXml.getAbsolutePath();
} else {
return "";
}
}
-
+
static public ILaunchConfiguration findLaunchConfig(String name) throws CoreException {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType( "org.eclipse.ant.AntLaunchConfigurationType" );
ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations( launchConfigurationType );
-
+
for (int i = 0; i < launchConfigurations.length; i++) { // can't believe there is no look up by name API
ILaunchConfiguration launchConfiguration = launchConfigurations[i];
if(launchConfiguration.getName().equals(name)) {
17 years, 5 months
JBoss Tools SVN: r2624 - trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-07-24 08:56:44 -0400 (Tue, 24 Jul 2007)
New Revision: 2624
Modified:
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SeamGenAction.java
Log:
http://jira.jboss.com/jira/browse/EXIN-302 Added public method to create launch config.
Modified: trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SeamGenAction.java
===================================================================
--- trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SeamGenAction.java 2007-07-24 12:32:44 UTC (rev 2623)
+++ trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SeamGenAction.java 2007-07-24 12:56:44 UTC (rev 2624)
@@ -239,6 +239,29 @@
super();
}
+ public static ILaunchConfigurationWorkingCopy createSeamgenLaunchConfig(String pathToSeamgenBuildXml) throws CoreException {
+ SeamGenPlugin.logInfo( "User selected: " + pathToSeamgenBuildXml + " as build.xml" );
+ ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType( "org.eclipse.ant.AntLaunchConfigurationType" );
+ ILaunchConfigurationWorkingCopy wc = launchConfigurationType.newInstance( null, "seamgen" );
+ wc.setAttribute( "process_factory_id", "org.eclipse.ant.ui.remoteAntProcessFactory" );
+ wc.setAttribute(IAntUIConstants.ATTR_DEFAULT_VM_INSTALL, true);
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "org.eclipse.ant.internal.ui.antsupport.InternalAntRunner");
+
+ wc.setAttribute("org.eclipse.debug.core.appendEnvironmentVariables", true);
+
+ wc.setAttribute( "org.eclipse.jdt.launching.CLASSPATH_PROVIDER", "org.eclipse.ant.ui.AntClasspathProvider" );
+ wc.setAttribute( "org.eclipse.jdt.launching.SOURCEPATH_PROVIDER", "org.eclipse.ant.ui.AntClasspathProvider" );
+
+ wc.setAttribute( "org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID", "org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType");
+
+ wc.setAttribute( IExternalToolConstants.ATTR_LOCATION, pathToSeamgenBuildXml );
+
+ wc.doSave();
+ SeamGenPlugin.logInfo( "seamgen launch config saved" );
+ return wc;
+ }
+
public void run(IAction action) {
try {
@@ -253,25 +276,7 @@
fileDialog.setFileName("build.xml");
String text=fileDialog.open();
if (text != null) {
- SeamGenPlugin.logInfo( "User selected: " + text + " as build.xml" );
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType( "org.eclipse.ant.AntLaunchConfigurationType" );
- wc = launchConfigurationType.newInstance( null, "seamgen" );
- wc.setAttribute( "process_factory_id", "org.eclipse.ant.ui.remoteAntProcessFactory" );
- wc.setAttribute(IAntUIConstants.ATTR_DEFAULT_VM_INSTALL, true);
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "org.eclipse.ant.internal.ui.antsupport.InternalAntRunner");
-
- wc.setAttribute("org.eclipse.debug.core.appendEnvironmentVariables", true);
-
- wc.setAttribute( "org.eclipse.jdt.launching.CLASSPATH_PROVIDER", "org.eclipse.ant.ui.AntClasspathProvider" );
- wc.setAttribute( "org.eclipse.jdt.launching.SOURCEPATH_PROVIDER", "org.eclipse.ant.ui.AntClasspathProvider" );
-
- wc.setAttribute( "org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID", "org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType");
-
- wc.setAttribute( IExternalToolConstants.ATTR_LOCATION, text );
-
- wc.doSave();
- SeamGenPlugin.logInfo( "seamgen launch config saved" );
+ wc = createSeamgenLaunchConfig(text);
} else {
MessageDialog.openError( window.getShell(), "No build.xml selected", "You have to select the build.xml to be used by Seam Gen." );
return;
17 years, 5 months
JBoss Tools SVN: r2623 - trunk/documentation/GettingStartedGuide/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: afedosik
Date: 2007-07-24 08:32:44 -0400 (Tue, 24 Jul 2007)
New Revision: 2623
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml
Log:
http://jira.jboss.com/jira/browse/EXIN-354 minor correction
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml 2007-07-24 11:51:15 UTC (rev 2622)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml 2007-07-24 12:32:44 UTC (rev 2623)
@@ -18,21 +18,12 @@
<listitem>JDK 1.5</listitem>
<listitem>JDK 1.6</listitem>
</itemizedlist>
- <section id="JDKInstallingOnWindows">
- <?dbhtml filename="JDKInstallingOnWindows.html"?>
- <title>JDK Installation on Windows</title>
- <para>To install JDK on Windows you should download an appropriate JDK package from Sun site. After launching an executable file of this JDK you will see the first window of wizard:</para>
-<figure>
-<title>First Wizard Dialog</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/installjdkwindows1.png"/>
- </imageobject>
-</mediaobject>
-</figure>
- <para>After accepting the license agreement just follow the intuitive installation wizard's steps.</para>
- </section>
- <section id="HowToInstallJDKOnLinux">
+ <note>
+ <title>Note:</title>
+ <para>Eclipse can use JDK 6 but the JBoss AS it manages needs to start under JDK 5 (i.e., select a JDK 5 JRE from the Server Runtime wizard).</para>
+ </note>
+
+ <section id="HowToInstallJDKOnLinux">
<?dbhtml filename="JDKInstalling.html"?>
<title>How to setup and install JDK on RHEL</title>
<para>For proper installation the java from Sun there is need to install the java from .rpm file or after installing it from .bin it is necessary to tune the java with command "alternative".</para>
@@ -52,11 +43,24 @@
<listitem><para>Install the rpm file by executing 'rpm -i filename.rpm', where filename is the name of your .rpm file. (Such as jdk-6-linux-i586.rpm).</para></listitem>
<listitem><para>Now, if you want to be able to execute this version of Java interpretor or compiler from any directory on your Linux system you will have to create a few symbolic links:</para></listitem></orderedlist>
<programlisting role="JAVA"><![CDATA[ln -s /usr/java/jdk1.6.0/bin/java /usr/bin/java]]></programlisting>
-
- <programlisting role="JAVA"><![CDATA[ln -s /usr/java/jdk1.6.0/bin/javac /usr/bin/javac]]></programlisting>
+<programlisting role="JAVA"><![CDATA[ln -s /usr/java/jdk1.6.0/bin/javac /usr/bin/javac]]></programlisting>
- </section>
</section>
+ <section id="JDKInstallingOnWindows">
+ <?dbhtml filename="JDKInstallingOnWindows.html"?>
+ <title>JDK Installation on Windows</title>
+ <para>To install JDK on Windows you should download an appropriate JDK package from Sun site. After launching an executable file of this JDK you will see the first window of wizard:</para>
+ <figure>
+ <title>First JDK Wizard Dialog</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/installjdkwindows1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>After accepting the license agreement just follow the intuitive installation wizard's steps.</para>
+ </section>
+ </section>
<section id="InstallingRHDS">
<?dbhtml filename="InstallingRHDS.html"?>
<title>Red Hat Developer Studio Installation</title>
@@ -95,8 +99,11 @@
<imagedata fileref="images/install2.png"/>
</imageobject>
</figure>
- <note>The installer will install JBoss J2EE Application Server for running your applications if you select this option during the installation process.
- If you want to use a different server than ours, you can change the setting in Red Hat Developer Studio.</note>
+ <note>
+ <title>Note:</title>
+ <para>The installer will install JBoss J2EE Application Server for running your applications if you select this option during the installation process.
+ If you want to use a different server than ours, you can change the setting in Red Hat Developer Studio.</para>
+ </note>
</section>
<section id="InstallingthroughTheUpdateSite">
17 years, 5 months
JBoss Tools SVN: r2622 - trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-24 07:51:15 -0400 (Tue, 24 Jul 2007)
New Revision: 2622
Modified:
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/StrutsConfigLoader.java
Log:
EXIN-86 model gets access to dtds from wtp
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/StrutsConfigLoader.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/StrutsConfigLoader.java 2007-07-24 11:50:50 UTC (rev 2621)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/StrutsConfigLoader.java 2007-07-24 11:51:15 UTC (rev 2622)
@@ -48,9 +48,10 @@
// String encoding = XModelObjectLoaderUtil.getEncoding(body);
// body = FileUtil.encode(body, encoding);
+ int resolution = EntityXMLRegistration.getInstance().resolve(object.getModelEntity());
String[] errors =
//XMLUtil.getXMLErrors(new StringReader(body));
- XMLUtil.getXMLErrors(new StringReader(body), false, false);
+ XMLUtil.getXMLErrors(new StringReader(body), resolution == EntityXMLRegistration.DTD, resolution == EntityXMLRegistration.SCHEMA);
boolean hasErrors = (errors != null && errors.length > 0);
if(hasErrors) {
object.setAttributeValue("isIncorrect", "yes");
17 years, 5 months
JBoss Tools SVN: r2621 - trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-24 07:50:50 -0400 (Tue, 24 Jul 2007)
New Revision: 2621
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesLoader.java
Log:
EXIN-86 model gets access to dtds from wtp
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesLoader.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesLoader.java 2007-07-24 11:50:09 UTC (rev 2620)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesLoader.java 2007-07-24 11:50:50 UTC (rev 2621)
@@ -29,9 +29,10 @@
public void load(XModelObject object) {
String body = XModelObjectLoaderUtil.getTempBody(object);
+ int resolution = EntityXMLRegistration.getInstance().resolve(object.getModelEntity());
String[] errors =
// XMLUtil.getXMLErrors(new StringReader(body));
- XMLUtil.getXMLErrors(new StringReader(body), false, false);
+ XMLUtil.getXMLErrors(new StringReader(body), resolution == EntityXMLRegistration.DTD, resolution == EntityXMLRegistration.SCHEMA);
boolean hasErrors = (errors != null && errors.length > 0);
if(hasErrors) {
object.setAttributeValue("isIncorrect", "yes");
17 years, 5 months
JBoss Tools SVN: r2620 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-24 07:50:09 -0400 (Tue, 24 Jul 2007)
New Revision: 2620
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/FacesConfigLoader.java
Log:
EXIN-86 model gets access to dtds from wtp
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/FacesConfigLoader.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/FacesConfigLoader.java 2007-07-24 11:49:12 UTC (rev 2619)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/FacesConfigLoader.java 2007-07-24 11:50:09 UTC (rev 2620)
@@ -37,11 +37,12 @@
String body = XModelObjectLoaderUtil.getTempBody(object);
+ int resolution = EntityXMLRegistration.getInstance().resolve(object.getModelEntity());
String[] errors =
// (entity.equals(ENT_FACESCONFIG_12))
// ? new SAXValidator().getXMLErrors(new StringReader(body))
// : XMLUtil.getXMLErrors(new StringReader(body));
- XMLUtil.getXMLErrors(new StringReader(body), false, false);
+ XMLUtil.getXMLErrors(new StringReader(body), resolution == EntityXMLRegistration.DTD, resolution == EntityXMLRegistration.SCHEMA);
boolean hasErrors = (errors != null && errors.length > 0);
if(hasErrors) {
object.setAttributeValue("isIncorrect", "yes");
17 years, 5 months
JBoss Tools SVN: r2619 - in trunk/common/plugins/org.jboss.tools.common.model: src/org/jboss/tools/common/model/filesystems/impl and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-24 07:49:12 -0400 (Tue, 24 Jul 2007)
New Revision: 2619
Added:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EntityXMLRegistration.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/SimpleWebFileLoader.java
Log:
EXIN-86 model gets access to dtds from wtp
Modified: trunk/common/plugins/org.jboss.tools.common.model/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/META-INF/MANIFEST.MF 2007-07-24 11:24:59 UTC (rev 2618)
+++ trunk/common/plugins/org.jboss.tools.common.model/META-INF/MANIFEST.MF 2007-07-24 11:49:12 UTC (rev 2619)
@@ -78,6 +78,7 @@
org.eclipse.ant.ui,
org.eclipse.ltk.core.refactoring,
org.eclipse.ltk.ui.refactoring,
+ org.eclipse.wst.common.uriresolver,
org.eclipse.core.resources;visibility:=reexport,
org.eclipse.core.runtime;visibility:=reexport
Bundle-Version: 2.0.0
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java 2007-07-24 11:24:59 UTC (rev 2618)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java 2007-07-24 11:49:12 UTC (rev 2619)
@@ -130,7 +130,8 @@
if("incorrectBody".equals(name) && value.length() > 0) {
set("isIncorrect", "yes");
// setErrors(value, hasDTD(), !hasDTD()); //never validate dtd
- setErrors(value, false, false);
+ int resolution = EntityXMLRegistration.getInstance().resolve(getModelEntity());
+ setErrors(value, resolution == EntityXMLRegistration.DTD, resolution == EntityXMLRegistration.SCHEMA);
}
}
@@ -225,7 +226,8 @@
boolean errors1 = ("yes".equals(get("_hasErrors_")));
loaderError = null;
// setErrors(body, hasDTD(), !hasDTD()); //never validate dtd
- setErrors(body, false, false);
+ int resolution = EntityXMLRegistration.getInstance().resolve(getModelEntity());
+ setErrors(body, resolution == EntityXMLRegistration.DTD, resolution == EntityXMLRegistration.SCHEMA);
boolean errors2 = (get("errors") != null && get("errors").length() > 0);
if(errors1 && errors2) {
super.set("incorrectBody".intern(), body);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/SimpleWebFileLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/SimpleWebFileLoader.java 2007-07-24 11:24:59 UTC (rev 2618)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/SimpleWebFileLoader.java 2007-07-24 11:49:12 UTC (rev 2619)
@@ -78,9 +78,10 @@
}
protected Document loadDocument(XModelObject object, String body) {
+ int resolution = EntityXMLRegistration.getInstance().resolve(object.getModelEntity());
String[] errors =
// XMLUtil.getXMLErrors(new StringReader(body), isCheckingDTD(), isCheckingSchema());
- XMLUtil.getXMLErrors(new StringReader(body), false, false);
+ XMLUtil.getXMLErrors(new StringReader(body), resolution == EntityXMLRegistration.DTD, resolution == EntityXMLRegistration.SCHEMA);
if(errors != null && errors.length > 0) {
object.setAttributeValue("isIncorrect", "yes");
object.set("correctBody", "");
Added: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EntityXMLRegistration.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EntityXMLRegistration.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EntityXMLRegistration.java 2007-07-24 11:49:12 UTC (rev 2619)
@@ -0,0 +1,76 @@
+package org.jboss.tools.common.model.util;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.wst.common.uriresolver.internal.ExtensibleURIResolver;
+import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.meta.XModelEntity;
+import org.jboss.tools.common.xml.XMLEntityResolver;
+
+public class EntityXMLRegistration {
+ private static EntityXMLRegistration instance = new EntityXMLRegistration();
+
+ public static int UNRESOLVED = -1;
+ public static int DTD = 0;
+ public static int SCHEMA = 1;
+ public static int MISSING = 2;
+
+ private EntityXMLRegistration() {}
+
+ public static EntityXMLRegistration getInstance() {
+ return instance;
+ }
+
+ private Map<XModelEntity, Integer> resolved = new HashMap<XModelEntity, Integer>();
+
+ public int resolve(XModelEntity entity) {
+ Integer i = resolved.get(entity);
+ if(i != null) return i.intValue();
+
+ XAttribute a = entity.getAttribute("publicId");
+ if(a != null) {
+ return resolveDTD(entity, a);
+ }
+ a = entity.getAttribute("xsi:schemaLocation");
+ if(a != null) {
+// return resolveSchema(entity, a);
+ }
+ resolved.put(entity, new Integer(UNRESOLVED));
+ return UNRESOLVED;
+ }
+
+ private int resolveDTD(XModelEntity entity, XAttribute a) {
+ String v = a.getDefaultValue();
+ if(XMLEntityResolver.getInstance().isResolved(v, null)) {
+ resolved.put(entity, new Integer(DTD));
+ return DTD;
+ }
+ ExtensibleURIResolver r = new ExtensibleURIResolver();
+ String s = r.resolve(null, v, null);
+ if(s != null && s.length() > 0) {
+ resolved.put(entity, new Integer(DTD));
+ XMLEntityResolver.registerPublicEntity(v, s);
+ return DTD;
+ }
+ resolved.put(entity, new Integer(MISSING));
+ return MISSING;
+ }
+
+ private int resolveSchema(XModelEntity entity, XAttribute a) {
+ String v = a.getDefaultValue();
+ String[] vs = v.split(" ");
+ if(vs == null || vs.length < 2) {
+ resolved.put(entity, new Integer(MISSING));
+ return MISSING;
+ }
+ ExtensibleURIResolver r = new ExtensibleURIResolver();
+ String s = r.resolve(null, vs[0], vs[1]);
+ if(s != null && s.length() > 0) {
+ resolved.put(entity, new Integer(SCHEMA));
+ return SCHEMA;
+ }
+ return SCHEMA;
+ }
+
+}
17 years, 5 months
JBoss Tools SVN: r2618 - in trunk/common/plugins/org.jboss.tools.common: src/org/jboss/tools/common/xml and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-24 07:24:59 -0400 (Tue, 24 Jul 2007)
New Revision: 2618
Modified:
trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/DtdResolver.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLEntityResolver.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLEntityResolverImpl.java
Log:
EXIN-26 org.eclipse.jst.standard.schemas schema storage accessed from DtdResolver
Modified: trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF 2007-07-24 11:06:29 UTC (rev 2617)
+++ trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF 2007-07-24 11:24:59 UTC (rev 2618)
@@ -134,6 +134,7 @@
org.eclipse.jface,
org.eclipse.core.resources,
org.eclipse.ui,
+ org.eclipse.wst.common.uriresolver,
org.eclipse.core.net
Bundle-Version: 2.0.0
Eclipse-LazyStart: true
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/DtdResolver.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/DtdResolver.java 2007-07-24 11:06:29 UTC (rev 2617)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/DtdResolver.java 2007-07-24 11:24:59 UTC (rev 2618)
@@ -18,6 +18,8 @@
import java.util.HashSet;
import java.util.Set;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
@@ -25,6 +27,7 @@
import org.jboss.tools.common.CommonPlugin;
import org.jboss.tools.common.util.HttpUtil;
+import org.osgi.framework.Bundle;
/**
* @author igels
@@ -44,6 +47,20 @@
}
}
+ if((location == null || location.startsWith("http:")) && systemId != null) {
+ Bundle b = Platform.getBundle("org.eclipse.jst.standard.schemas");
+ if(b != null) {
+ int q = systemId.lastIndexOf("/");
+ String s = systemId.substring(q + 1);
+ URL u = b.getEntry("/dtdsAndSchemas/" + s);
+ try {
+ if(u != null) u = FileLocator.resolve(u);
+ } catch (IOException ee) {
+ u = null;
+ }
+ if(u != null) location = u.toString();
+ }
+ }
if(location == null) {
if(systemId != null && !unfound.contains(systemId)) {
unfound.add(systemId);
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLEntityResolver.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLEntityResolver.java 2007-07-24 11:06:29 UTC (rev 2617)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLEntityResolver.java 2007-07-24 11:24:59 UTC (rev 2618)
@@ -54,6 +54,21 @@
public void setDeactivate(boolean b) {
deactivate = b;
}
+
+ public boolean isResolved(String publicId, String systemId) {
+ if (publicId != null) {
+ String url = publicEntities.getProperty(publicId);
+ if (url != null) {
+ return true;
+ }
+ } else if (systemId != null) {
+ String url = systemEntities.getProperty(systemId);
+ if (url != null) {
+ return true;
+ }
+ }
+ return false;
+ }
public InputSource resolveEntity(String publicId, String systemId)
throws SAXException, java.io.IOException {
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLEntityResolverImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLEntityResolverImpl.java 2007-07-24 11:06:29 UTC (rev 2617)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLEntityResolverImpl.java 2007-07-24 11:24:59 UTC (rev 2618)
@@ -45,8 +45,8 @@
publicId = rid.getPublicId();
if(systemId != null && systemId.indexOf("www.ibm.com") >= 0) {
- CommonPlugin.getPluginLog().logError( "ignore");
- return null;
+// CommonPlugin.getPluginLog().logError( "ignore");
+// return null;
}
InputStream is = resolver.getInputStream(rid.getPublicId(), systemId);
17 years, 5 months
JBoss Tools SVN: r2617 - in trunk/seam/plugins/org.jboss.tools.seam.ui: icons/view and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-24 07:06:29 -0400 (Tue, 24 Jul 2007)
New Revision: 2617
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/component.gif
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/component_new.gif
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/java.gif
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/java_binary.gif
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/java_binary_new.gif
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/java_new.gif
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/role.gif
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/role_new.gif
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/scope.gif
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/scope_new.gif
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/seam_project.gif
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/seam_project_new.gif
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUiImages.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamLabelProvider.java
Log:
EXIN-218 Icons added to seam components view
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/component.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/component.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/component_new.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/component_new.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/java.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/java.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/java_binary.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/java_binary.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/java_binary_new.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/java_binary_new.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/java_new.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/java_new.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/role.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/role.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/role_new.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/role_new.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/scope.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/scope.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/scope_new.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/scope_new.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/seam_project.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/seam_project.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/seam_project_new.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/view/seam_project_new.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUiImages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUiImages.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUiImages.java 2007-07-24 11:06:29 UTC (rev 2617)
@@ -0,0 +1,81 @@
+package org.jboss.tools.seam.ui;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+
+public class SeamUiImages {
+
+ private static SeamUiImages INSTANCE;
+
+ static {
+ try {
+ INSTANCE = new SeamUiImages(new URL(SeamGuiPlugin.getDefault().getBundle().getEntry("/"), "icons/"));
+ } catch (MalformedURLException e) {
+ SeamGuiPlugin.getPluginLog().logError(e);
+ }
+ }
+
+ public static Image SCOPE_IMAGE = getImage("view/scope.gif");
+ public static Image PROJECT_IMAGE = getImage("view/seam_project.gif");
+ public static Image COMPONENT_IMAGE = getImage("view/component.gif");
+ public static Image ROLE_IMAGE = getImage("view/role.gif");
+ public static Image JAVA_IMAGE = getImage("view/java.gif");
+ public static Image JAVA_BINARY_IMAGE = getImage("view/java_binary.gif");
+
+ public static Image getImage(String key) {
+ return INSTANCE.createImageDescriptor(key).createImage();
+ }
+
+ public static ImageDescriptor getImageDescriptor(String key) {
+ return INSTANCE.createImageDescriptor(key);
+ }
+
+ public static void setImageDescriptors(IAction action, String iconName) {
+ action.setImageDescriptor(INSTANCE.createImageDescriptor(iconName));
+ }
+
+ public static SeamUiImages getInstance() {
+ return INSTANCE;
+ }
+
+ private URL baseUrl;
+ private SeamUiImages parentRegistry;
+
+ protected SeamUiImages(URL registryUrl, SeamUiImages parent){
+
+ if(registryUrl == null) throw new NullPointerException("Base url for image registry cannot be null.");
+ baseUrl = registryUrl;
+ parentRegistry = parent;
+ }
+
+ protected SeamUiImages(URL url){
+ this(url,null);
+ }
+
+ public Image getImageByFileName(String key) {
+ return createImageDescriptor(key).createImage();
+ }
+
+ public ImageDescriptor createImageDescriptor(String key) {
+ try {
+ return ImageDescriptor.createFromURL(makeIconFileURL(key));
+ } catch (MalformedURLException e) {
+ if(parentRegistry == null) {
+ return ImageDescriptor.getMissingImageDescriptor();
+ } else {
+ return parentRegistry.createImageDescriptor(key);
+ }
+
+ }
+ }
+
+ private URL makeIconFileURL(String name) throws MalformedURLException {
+ if (name == null) throw new MalformedURLException("Image name cannot be null.");
+ return new URL(baseUrl, name);
+ }
+
+}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamLabelProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamLabelProvider.java 2007-07-24 10:40:52 UTC (rev 2616)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamLabelProvider.java 2007-07-24 11:06:29 UTC (rev 2617)
@@ -33,6 +33,7 @@
import org.jboss.tools.seam.core.ISeamScope;
import org.jboss.tools.seam.internal.core.SeamComponentDeclaration;
import org.jboss.tools.seam.internal.core.SeamProject;
+import org.jboss.tools.seam.ui.SeamUiImages;
/**
* @author Viacheslav Kabanovich
@@ -71,37 +72,31 @@
}
public Image getImage(Object obj) {
- String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
if (obj instanceof ISeamProject) {
- SeamProject p = (SeamProject)obj;
- return jip.getImageLabel(p.getProject(), 3);
-// imageKey = org.eclipse.ui.ide.IDE.SharedImages.IMG_OBJ_PROJECT;
+ return SeamUiImages.PROJECT_IMAGE;
} else if(obj instanceof ISeamScope) {
- imageKey = ISharedImages.IMG_OBJ_FOLDER;
+ return SeamUiImages.SCOPE_IMAGE;
} else if(obj instanceof ISeamComponent) {
- imageKey = ISharedImages.IMG_OBJ_ELEMENT;
+ return SeamUiImages.COMPONENT_IMAGE;
} else if(obj instanceof IRole) {
- //
+ return SeamUiImages.ROLE_IMAGE;
} else if(obj instanceof ISeamJavaComponentDeclaration) {
ISeamJavaComponentDeclaration d = (ISeamJavaComponentDeclaration)obj;
IType type = (IType)d.getSourceMember();
if(type != null) {
if(type.isBinary()) {
- return new org.eclipse.jdt.internal.ui.SharedImages().getImage(JavaPluginImages.IMG_OBJS_CFILE);
+ return SeamUiImages.JAVA_BINARY_IMAGE;
}
- IResource r = d.getResource();
- if(r != null) return jip.getImageLabel(r, 3);
- ICompilationUnit f = type.getCompilationUnit();
- return(f != null) ? jip.getImageLabel(f, 0) : jip.getImageLabel(type, 3);
+ return SeamUiImages.JAVA_IMAGE;
}
- return new org.eclipse.jdt.internal.ui.SharedImages().getImage(JavaPluginImages.IMG_OBJS_CFILECLASS);
+ return SeamUiImages.JAVA_IMAGE;
} else if(obj instanceof ISeamComponentDeclaration) {
SeamComponentDeclaration d = (SeamComponentDeclaration)obj;
IResource r = d.getResource();
if(r != null) return jip.getImageLabel(r, 3);
- imageKey = ISharedImages.IMG_OBJ_FILE;
+ return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE);
}
- return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
+ return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
}
}
17 years, 5 months
JBoss Tools SVN: r2616 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/META-INF.
by jbosstools-commits@lists.jboss.org
Author: mdryakhlenkov
Date: 2007-07-24 06:40:52 -0400 (Tue, 24 Jul 2007)
New Revision: 2616
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/META-INF/MANIFEST.MF
Log:
JBIDE-605: latest svn has various issues with xmodel ui's
First exception in description fixed
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/META-INF/MANIFEST.MF 2007-07-24 10:31:42 UTC (rev 2615)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/META-INF/MANIFEST.MF 2007-07-24 10:40:52 UTC (rev 2616)
@@ -22,7 +22,5 @@
org.eclipse.jface.text,
org.jboss.tools.common,
org.jboss.tools.common.model,
- org.hibernate.eclipse,
- org.jboss.tools.hibernate.core,
- org.jboss.tools.hibernate.view
+ org.hibernate.eclipse
Eclipse-LazyStart: true
17 years, 5 months