JBoss Tools SVN: r2542 - in trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts: webprj/model/helpers/sync and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-20 09:10:16 -0400 (Fri, 20 Jul 2007)
New Revision: 2542
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/webprj/model/helpers/sync/SyncProjectContext.java
Log:
EXIN-86
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-20 13:09:26 UTC (rev 2541)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/StrutsConfigLoader.java 2007-07-20 13:10:16 UTC (rev 2542)
@@ -18,7 +18,10 @@
import org.jboss.tools.common.model.filesystems.impl.*;
import org.jboss.tools.common.model.loaders.impl.SimpleWebFileLoader;
import org.jboss.tools.common.model.util.*;
+
import java.io.*;
+import java.util.Set;
+
import org.w3c.dom.*;
public class StrutsConfigLoader implements WebProcessLoader, StrutsConstants {
@@ -45,8 +48,11 @@
// String encoding = XModelObjectLoaderUtil.getEncoding(body);
// body = FileUtil.encode(body, encoding);
- String[] errors = XMLUtil.getXMLErrors(new StringReader(body));
- if(errors != null && errors.length > 0) {
+ String[] errors =
+ //XMLUtil.getXMLErrors(new StringReader(body));
+ XMLUtil.getXMLErrors(new StringReader(body), false, false);
+ boolean hasErrors = (errors != null && errors.length > 0);
+ if(hasErrors) {
object.setAttributeValue("isIncorrect", "yes");
object.setAttributeValue("incorrectBody", body);
object.set("actualBodyTimeStamp", "-1");
@@ -76,11 +82,19 @@
}
if (version != 10) {
- util.load(element, object.getChildren(ENT_MSGRES_FOLDER + VER_SUFFIX_11)[0]);
- util.load(element, object.getChildren(ENT_PLUGIN_FOLDER + VER_SUFFIX_11)[0]);
+ util.loadChildren(element, object.getChildren(ENT_MSGRES_FOLDER + VER_SUFFIX_11)[0]);
+ util.loadChildren(element, object.getChildren(ENT_PLUGIN_FOLDER + VER_SUFFIX_11)[0]);
}
+ String loadingError = util.getError();
reloadProcess(object);
object.set("actualBodyTimeStamp", "" + object.getTimeStamp());
+
+ ((AbstractXMLFileImpl)object).setLoaderError(loadingError);
+ if(!hasErrors && loadingError != null) {
+ object.setAttributeValue("isIncorrect", "yes");
+ object.setAttributeValue("incorrectBody", body);
+ object.set("actualBodyTimeStamp", "" + object.getTimeStamp());
+ }
}
protected void setEncoding(XModelObject object, String body) {
@@ -209,8 +223,9 @@
}
-class SPUtil extends XModelObjectLoaderUtil {
+class SPUtil extends XModelObjectLoaderUtil implements StrutsConstants {
static String CODE = "UTF-8";
+
public void loadAttributes(Element element, XModelObject o) {
super.loadAttributes(element, o);
if(o.getModelEntity().getName().equals("StrutsProcessComment")) {
@@ -256,7 +271,12 @@
}
-class SCUtil extends XModelObjectLoaderUtil {
+class SCUtil extends XModelObjectLoaderUtil implements StrutsConstants {
+ protected Set<String> getAllowedChildren(XModelEntity entity) {
+ Set<String> children = super.getAllowedChildren(entity);
+ return children;
+ }
+
protected boolean isSaveable(XModelEntity entity, String n, String v, String dv) {
if(v == null) return false;
if(v.length() == 0 || v.equals(dv)) {
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/sync/SyncProjectContext.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/sync/SyncProjectContext.java 2007-07-20 13:09:26 UTC (rev 2541)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/sync/SyncProjectContext.java 2007-07-20 13:10:16 UTC (rev 2542)
@@ -337,7 +337,7 @@
boolean is12 = s.indexOf(StrutsConstants.DOC_PUBLICID_12) >= 0;
if(!is11 && !is12)
throw new Exception("File is not Struts Configuration 1.1 or 1.2."); //$NON-NLS-1$
- String[] es = XMLUtil.getXMLErrors(new StringReader(s));
+ String[] es = XMLUtil.getXMLErrors(new StringReader(s), false); //never validate dtd
if(es != null && es.length > 0) {
String version = (is11) ? "1.1" : "1.2"; //$NON-NLS-1$ //$NON-NLS-2$
throw new Exception("Struts Configuration " + version + " file is not correct:\n" + es[0]); //$NON-NLS-1$ //$NON-NLS-2$
17 years, 5 months
JBoss Tools SVN: r2541 - trunk/shale/plugins/org.jboss.tools.shale/src/org/jboss/tools/shale/model/clay.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-20 09:09:26 -0400 (Fri, 20 Jul 2007)
New Revision: 2541
Modified:
trunk/shale/plugins/org.jboss.tools.shale/src/org/jboss/tools/shale/model/clay/ClayConfigLoader.java
Log:
EXIN-86
Modified: trunk/shale/plugins/org.jboss.tools.shale/src/org/jboss/tools/shale/model/clay/ClayConfigLoader.java
===================================================================
--- trunk/shale/plugins/org.jboss.tools.shale/src/org/jboss/tools/shale/model/clay/ClayConfigLoader.java 2007-07-20 13:08:50 UTC (rev 2540)
+++ trunk/shale/plugins/org.jboss.tools.shale/src/org/jboss/tools/shale/model/clay/ClayConfigLoader.java 2007-07-20 13:09:26 UTC (rev 2541)
@@ -26,8 +26,9 @@
public void load(XModelObject object) {
String body = XModelObjectLoaderUtil.getTempBody(object);
- String[] errors = XMLUtil.getXMLErrors(new StringReader(body));
- if(errors != null && errors.length > 0) {
+ String[] errors = XMLUtil.getXMLErrors(new StringReader(body), false);
+ boolean hasErrors = (errors != null && errors.length > 0);
+ if(hasErrors) {
object.setAttributeValue("isIncorrect", "yes");
object.setAttributeValue("incorrectBody", body);
object.set("actualBodyTimeStamp", "-1");
@@ -46,6 +47,8 @@
}
Element element = doc.getDocumentElement();
util.load(element, object);
+ String loadingError = util.getError();
+
setEncoding(object, body);
NodeList nl = doc.getChildNodes();
@@ -58,6 +61,13 @@
}
reloadProcess(object);
object.set("actualBodyTimeStamp", "" + object.getTimeStamp());
+
+ ((AbstractXMLFileImpl)object).setLoaderError(loadingError);
+ if(!hasErrors && loadingError != null) {
+ object.setAttributeValue("isIncorrect", "yes");
+ object.setAttributeValue("incorrectBody", body);
+ object.set("actualBodyTimeStamp", "" + object.getTimeStamp());
+ }
}
public void reloadProcess(XModelObject object) {
17 years, 5 months
JBoss Tools SVN: r2540 - 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-20 09:08:50 -0400 (Fri, 20 Jul 2007)
New Revision: 2540
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesLoader.java
Log:
EXIN-86
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-20 13:07:24 UTC (rev 2539)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesLoader.java 2007-07-20 13:08:50 UTC (rev 2540)
@@ -29,8 +29,11 @@
public void load(XModelObject object) {
String body = XModelObjectLoaderUtil.getTempBody(object);
- String[] errors = XMLUtil.getXMLErrors(new StringReader(body));
- if(errors != null && errors.length > 0) {
+ String[] errors =
+// XMLUtil.getXMLErrors(new StringReader(body));
+ XMLUtil.getXMLErrors(new StringReader(body), false, false);
+ boolean hasErrors = (errors != null && errors.length > 0);
+ if(hasErrors) {
object.setAttributeValue("isIncorrect", "yes");
object.setAttributeValue("incorrectBody", body);
object.set("actualBodyTimeStamp", "-1");
@@ -49,6 +52,7 @@
}
Element element = doc.getDocumentElement();
util.load(element, object);
+ String loadingError = util.getError();
setEncoding(object, body);
NodeList nl = doc.getChildNodes();
@@ -61,6 +65,13 @@
}
reloadProcess(object);
object.set("actualBodyTimeStamp", "" + object.getTimeStamp());
+
+ ((AbstractXMLFileImpl)object).setLoaderError(loadingError);
+ if(!hasErrors && loadingError != null) {
+ object.setAttributeValue("isIncorrect", "yes");
+ object.setAttributeValue("incorrectBody", body);
+ object.set("actualBodyTimeStamp", "" + object.getTimeStamp());
+ }
}
protected void setEncoding(XModelObject object, String body) {
17 years, 5 months
JBoss Tools SVN: r2539 - in trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model: loaders/impl and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-20 09:07:24 -0400 (Fri, 20 Jul 2007)
New Revision: 2539
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/AbstractXMLFileImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsLoader.java
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/util/XMLUtil.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java
Log:
EXIN-86
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-20 12:26:52 UTC (rev 2538)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java 2007-07-20 13:07:24 UTC (rev 2539)
@@ -129,7 +129,8 @@
super.set(name, value);
if("incorrectBody".equals(name) && value.length() > 0) {
set("isIncorrect", "yes");
- setErrors(value, hasDTD(), !hasDTD()); //schema!
+// setErrors(value, hasDTD(), !hasDTD()); //never validate dtd
+ setErrors(value, false, false);
}
}
@@ -163,6 +164,7 @@
boolean errors1 = ("yes".equals(get("_hasErrors_")));
AbstractExtendedXMLFileImpl f = getUpdatedFile(body, true);
if(f == null) return;
+ f.getChildren();
XModelObjectImpl p = (XModelObjectImpl)getParent();
XModelImpl m = (XModelImpl)getModel();
@@ -170,11 +172,13 @@
if(!isOverlapped) getResourceMarkers().clear();
if(f.isIncorrect()) {
getChildren();
+ boolean fire = this.loaderError == null && f.loaderError != null;
+ this.loaderError = f.loaderError;
super.set("incorrectBody", f.get("incorrectBody"));
super.set("isIncorrect", "yes");
if(f.get("errors") != null) super.set("errors", f.get("errors"));
- f.getChildren();
+ if(fire) changeTimeStamp();
if(f.get("actualBodyTimeStamp") != null && !"-1".equals(f.get("actualBodyTimeStamp"))) {
mergeAll(f, update);
}
@@ -219,7 +223,9 @@
private AbstractExtendedXMLFileImpl getUpdatedFile(String body, boolean fire) {
boolean errors1 = ("yes".equals(get("_hasErrors_")));
- setErrors(body, hasDTD(), !hasDTD()); ///schema!
+ loaderError = null;
+// setErrors(body, hasDTD(), !hasDTD()); //never validate dtd
+ setErrors(body, false, false);
boolean errors2 = (get("errors") != null && get("errors").length() > 0);
if(errors1 && errors2) {
super.set("incorrectBody".intern(), body);
@@ -245,7 +251,11 @@
super.set("incorrectBody", "");
super.set("isIncorrect","no");
super.set("errors", "");
+ loaderError = null;
}
+ if(update instanceof AbstractExtendedXMLFileImpl) {
+ loaderError = ((AbstractExtendedXMLFileImpl)update).loaderError;
+ }
Map<String,XModelObject> map = getChildrenForSaveAsMap();
Set<String> set = null;
XModelObject[] cs = update.getChildren();
@@ -270,7 +280,7 @@
}
map.remove(c.getPathPart());
}
- Iterator it = map.values().iterator();
+ Iterator<XModelObject> it = map.values().iterator();
while(it.hasNext()) {
((XModelObject)it.next()).removeFromParent();
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractXMLFileImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractXMLFileImpl.java 2007-07-20 12:26:52 UTC (rev 2538)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractXMLFileImpl.java 2007-07-20 13:07:24 UTC (rev 2539)
@@ -17,7 +17,6 @@
import org.jboss.tools.common.model.filesystems.impl.RecognizedFileImpl;
import org.jboss.tools.common.model.util.FindObjectHelper;
import org.jboss.tools.common.model.util.XMLUtil;
-import org.jboss.tools.common.xml.SAXValidator;
public class AbstractXMLFileImpl extends RecognizedFileImpl {
private static final long serialVersionUID = 3794621010387468744L;
@@ -25,6 +24,8 @@
protected String[] _errors = new String[0];
protected String[] errors = new String[0];
+ protected String loaderError = null;
+
/**
* Licence does not allows for distributing copies of dtds.
*/
@@ -41,11 +42,20 @@
public String[] getErrors() {
return _errors;
}
+
+ public void setLoaderError(String loaderError) {
+ this.loaderError = loaderError;
+ }
+
+ public String getLoaderError() {
+ return loaderError;
+ }
protected final void setErrors(String body, boolean checkDTD, boolean checkSchema) {
- String[] errors = (body.length() == 0) ? null
- : (checkSchema) ? new SAXValidator().getXMLErrors(new java.io.StringReader(body))
- : XMLUtil.getXMLErrors(new java.io.StringReader(body), checkDTD);
+ String[] errors = (body.length() == 0) ? null : XMLUtil.getXMLErrors(new java.io.StringReader(body), checkDTD, checkSchema);
+ if(errors == null || errors.length == 0) {
+ if(loaderError != null) errors = new String[]{loaderError};
+ }
setErrors(body, errors);
}
@@ -81,7 +91,7 @@
if(s.equals(get("errors"))) return;
super.set("incorrectBody", body);
set("errors", s);
- setAttributeValue("isIncorrect", (errors.length == 0) ? "no" : "yes");
+ setAttributeValue("isIncorrect", (errors.length == 0 && loaderError == null) ? "no" : "yes");
if(!isOverlapped()) markers.update();
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsLoader.java 2007-07-20 12:26:52 UTC (rev 2538)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsLoader.java 2007-07-20 13:07:24 UTC (rev 2539)
@@ -12,9 +12,11 @@
import java.io.File;
import java.util.*;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.w3c.dom.*;
+import org.jboss.tools.common.meta.XModelEntity;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.loaders.*;
import org.jboss.tools.common.model.loaders.impl.*;
@@ -129,7 +131,7 @@
}
XModelObject[] js = lib.getChildren();
String loc = lib.getAttributeValue("location");
- List paths = null;
+ List<String> paths = null;
try {
paths = EclipseResourceUtil.getClassPath(project);
} catch (Exception e) {
@@ -191,7 +193,24 @@
}
class FileSystemsLoaderUtil extends XModelObjectLoaderUtil {
- public boolean saveChildren(Element element, XModelObject o) {
+
+ protected Set<String> getAllowedChildren(XModelEntity entity) {
+ Set<String> children = super.getAllowedChildren(entity);
+ if("FILESYSTEMS".equals(entity.getXMLSubPath())) {
+ children.add("WEB");
+ }
+ return children;
+ }
+
+ protected Set<String> getAllowedAttributes(XModelEntity entity) {
+ Set<String> attributes = super.getAllowedAttributes(entity);
+ if("FILESYSTEMS".equals(entity.getXMLSubPath())) {
+ attributes.add("WORKSPACE_HOME");
+ }
+ return attributes;
+ }
+
+ public boolean saveChildren(Element element, XModelObject o) {
boolean b = super.saveChildren(element, o);
if(b && "FILESYSTEMS".equals(element.getNodeName())) {
saveWorkspaceHomeAttr(element, o);
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-20 12:26:52 UTC (rev 2538)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/SimpleWebFileLoader.java 2007-07-20 13:07:24 UTC (rev 2539)
@@ -62,18 +62,25 @@
element.setAttribute("EXTENSION" + postfix, object.getAttributeValue("extension"));
util.load(element, object);
+ String loadingError = util.getError();
setEncoding(object, body);
loadPublicId(object, doc);
object.set("actualBodyTimeStamp", "" + object.getTimeStamp());
+
+ ((AbstractXMLFileImpl)object).setLoaderError(loadingError);
+ if(!((AbstractXMLFileImpl)object).isIncorrect() && loadingError != null) {
+ object.setAttributeValue("isIncorrect", "yes");
+ object.setAttributeValue("incorrectBody", body);
+ object.set("actualBodyTimeStamp", "" + object.getTimeStamp());
+ }
}
protected Document loadDocument(XModelObject object, String body) {
- String[] errors = XMLUtil.getXMLErrors(new StringReader(body), isCheckingDTD());
- if(isCheckingSchema()) {
- errors = new SAXValidator().getXMLErrors(new StringReader(body));
- }
+ String[] errors =
+// XMLUtil.getXMLErrors(new StringReader(body), isCheckingDTD(), isCheckingSchema());
+ XMLUtil.getXMLErrors(new StringReader(body), false, false);
if(errors != null && errors.length > 0) {
object.setAttributeValue("isIncorrect", "yes");
object.set("correctBody", "");
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XMLUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XMLUtil.java 2007-07-20 12:26:52 UTC (rev 2538)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XMLUtil.java 2007-07-20 13:07:24 UTC (rev 2539)
@@ -14,6 +14,7 @@
import org.w3c.dom.*;
import org.xml.sax.*;
+import org.jboss.tools.common.xml.SAXValidator;
import org.jboss.tools.common.xml.XMLEntityResolver;
import org.jboss.tools.common.xml.XMLUtilities;
import javax.xml.parsers.*;
@@ -103,5 +104,10 @@
public static String[] getXMLErrors(org.xml.sax.InputSource is, boolean checkDTD) {
return XMLUtilities.getXMLErrors(is, checkDTD, XMLEntityResolver.getInstance());
}
+
+ public static String[] getXMLErrors(Reader reader, boolean checkDTD, boolean checkSchema) {
+ return (checkSchema) ? new SAXValidator().getXMLErrors(reader)
+ : getXMLErrors(reader, checkDTD);
+ }
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java 2007-07-20 12:26:52 UTC (rev 2538)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java 2007-07-20 13:07:24 UTC (rev 2539)
@@ -17,9 +17,12 @@
import java.io.Reader;
import java.io.StringWriter;
import java.io.Writer;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
+import java.util.Map;
import java.util.Properties;
+import java.util.Set;
import java.util.StringTokenizer;
import org.apache.xml.serialize.OutputFormat;
@@ -49,18 +52,25 @@
public class XModelObjectLoaderUtil {
public static String ATTR_ID_NAME = "_id_";
- private Hashtable singular = null;
+ private Hashtable<String,String> singular = null;
private boolean saveentity = true;
private String namespace = null;
private NamespaceMapping namespaceMapping = null;
+
+ protected String error = null;
public XModelObjectLoaderUtil() {}
- public void setup(Hashtable singular, boolean saveentity) {
+ public void setup(Hashtable<String,String> singular, boolean saveentity) {
this.singular = singular;
this.saveentity = saveentity;
+ error = null;
}
+ public String getError() {
+ return error;
+ }
+
public void setNamespace(String namespace) {
this.namespace = namespace;
}
@@ -79,9 +89,98 @@
} else {
loadAttributes(element, o);
loadChildren(element, o);
+
+ if(error == null) {
+ Set<String> allowed = getAllowedChildren(o.getModelEntity());
+ if(allowed != null && hasUnallowedChildren(element, allowed));
+ }
+ if(error == null) {
+ Set<String> allowed = getAllowedAttributes(o.getModelEntity());
+ if(allowed != null && hasUnallowedAttributes(element, allowed));
+ }
+
}
}
+
+ static Map<XModelEntity, Set<String>> allowedChildren = new HashMap<XModelEntity, Set<String>>();
+
+ protected Set<String> getAllowedChildren(XModelEntity entity) {
+ if(entity.getChild("AnyElement") != null) return null;
+ Set<String> x = allowedChildren.get(entity);
+ if(x != null) return x;
+ Set<String> children = new HashSet<String>();
+ XAttribute[] as = entity.getAttributes();
+ for (int i = 0; i < as.length; i++) {
+ String xml = as[i].getXMLName();
+ if(xml == null) continue;
+ int k = xml.indexOf('.');
+ if(k < 0) continue;
+ children.add(xml.substring(0, k));
+ }
+ XChild[] cs = entity.getChildren();
+ for (int i = 0; i < cs.length; i++) {
+ XModelEntity c = entity.getMetaModel().getEntity(cs[i].getName());
+ if(c == null) continue;
+ String xml = c.getXMLSubPath();
+ if(xml == null || xml.length() == 0) {
+ if(cs[i].isRequired()) {
+ Set<String> a1 = getAllowedChildren(c);
+ if(a1 == null) return null;
+ children.addAll(a1);
+ }
+ }
+ int k = xml.indexOf('.');
+ if(k >= 0) xml = xml.substring(0, k);
+ children.add(xml);
+ }
+ if(children != null) allowedChildren.put(entity, children);
+ return children;
+ }
+ protected Set<String> getAllowedAttributes(XModelEntity entity) {
+ if(entity.getChild("AnyElement") != null) return null;
+ Set<String> attributes = new HashSet<String>();
+ if(saveentity) attributes.add("ENTITY");
+ XAttribute[] as = entity.getAttributes();
+ for (int i = 0; i < as.length; i++) {
+ String xml = as[i].getXMLName();
+ if(xml == null) continue;
+ int k = xml.indexOf('.');
+ if(k >= 0) continue;
+ attributes.add(xml);
+ }
+ return attributes;
+ }
+
+ private boolean hasUnallowedChildren(Element element, Set<String> allowed) {
+ NodeList nl = element.getChildNodes();
+ for (int i = 0; i < nl.getLength(); i++) {
+ Node n = nl.item(i);
+ if(n.getNodeType() == Node.ELEMENT_NODE) {
+ String name = n.getNodeName();
+ if(allowed.contains(name)) continue;
+ error = "Unallowed child " + name + " of " + element.getNodeName() + ":0:0";
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean hasUnallowedAttributes(Element element, Set<String> allowed) {
+ NamedNodeMap nl = element.getAttributes();
+ for (int i = 0; i < nl.getLength(); i++) {
+ Node n = nl.item(i);
+ if(n.getNodeType() == Node.ATTRIBUTE_NODE) {
+ String name = n.getNodeName();
+ if(allowed.contains(name)) continue;
+ if(name.startsWith("xmlns")) continue;
+ error = "Unallowed attribute " + name + " of " + element.getNodeName() + ":0:0";;
+ return true;
+ }
+ }
+ return false;
+ }
+
public void loadAttributes(Element element, XModelObject o) {
XModelEntity entity = o.getModelEntity();
XAttribute[] as = entity.getAttributes();
@@ -606,7 +705,7 @@
public static XObjectLoader getObjectLoader(XModelObject object) {
try {
- Class c = object.getModelEntity().getLoadingClass();
+ Class<?> c = object.getModelEntity().getLoadingClass();
if (c != null) {
return (XObjectLoader)c.newInstance();
}
17 years, 5 months
JBoss Tools SVN: r2538 - trunk/documentation/GettingStartedGuide/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: afedosik
Date: 2007-07-20 08:26:52 -0400 (Fri, 20 Jul 2007)
New Revision: 2538
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml
Log:
http://jira.jboss.com/jira/browse/EXIN-104 "How to setup and install a proper JDK on RHEL" section added.
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml 2007-07-20 12:16:42 UTC (rev 2537)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml 2007-07-20 12:26:52 UTC (rev 2538)
@@ -10,9 +10,100 @@
</keywordset>
</chapterinfo>
<title>Getting Started with Red Hat Developer Studio</title>
- <section id="Installing">
+ <section id="Installing">
<?dbhtml filename="Installing.html"?>
-<title>Installation</title>
+ <title>Installation</title>
+ <section id="HowToInstallJDK">
+ <title>How to setup and install a proper JDK on RHEL</title>
+ <section id="RHEL_JDK_support"><title>What Java Development Kits (JDKs) are provided with Red Hat Enterprise Linux and what support does Red Hat offer for them?</title>
+ <para>To make it as easy as possible for customers to install and run Java applications on Red Hat Enterprise Linux, third-party Java Development Kits
+ (JDKs) from IBM and BEA are provided through the Red Hat Enterprise Linux Extras channel on Red Hat Network (RHN) and on the Red Hat Enterprise
+ Linux Extras CD. Red Hat's current and planned availability of the IBM JDK is as follows:</para>
+
+ <itemizedlist>
+ <listitem><para>IBM JDK 1.4.2.3. (currently shipped with Red Hat Enterprise Linux 3 Update 8 and Red Hat Enterprise Linux 4 Update 4)</para></listitem>
+ <listitem><para>IBM JDK 1.5.0 (currently shipped with Red Hat Enterprise Linux 4 Update 4)</para></listitem>
+ <listitem><para>IBM JDK 1.4.2.6 (planned for Red Hat Enterprise Linux 4 Update 5 and Red Hat Enterprise Linux 5)</para></listitem>
+ <listitem><para>IBM JDK 1.5.3 (planned for Red Hat Enterprise Linux 4 Update 5 and Red Hat Enterprise Linux 5)</para></listitem>
+ </itemizedlist>
+
+ <para>Red Hat does not provide the special version "IBM JDK 1.4.2 for SAP"; this software is available directly from IBM.</para>
+ <para>The IBM and BEA JDKs, along with the other packages on the Extras CD, are licensed separately (see http://www.redhat.com/licenses/thirdparty/eula.html)
+ and are not included under the Red Hat Enterprise Linux production-level Service Level Agreement (SLA).</para>
+ <para>Customers who require enterprise-level support for either JDK package must purchase it directly from the Java vendor. Red Hat's support of the
+ IBM and BEA JDKs included on the Red Hat Enteprise Linux Extra CD/RHN channel is limited to:</para>
+ <itemizedlist>
+ <listitem><para>Assistance with installation and configuration of the Red Hat provided Java Runtime environment.</para></listitem>
+ <listitem><para>Verification of proper operation through the use of a Red Hat provided test program written in Java.</para></listitem>
+ </itemizedlist>
+ <para>Note that this support does not include assistance with the development of Java applications, which is available with Red Hat's Development
+ Support Services. In addition, the JDKs are not eligible for a "hotfix" through the Red Hat Hotfix process.</para>
+ <para>If the customer problem lies in the Red Hat Enterprise Linux operating system, Red Hat provides full production-level support for problem resolution.
+ If the problem lies in the JDK, Red Hat will escalate the problem to the appropriate Java vendor via bugzilla, but cannot guarantee response or problem
+ resolution by that vendor.</para>
+ </section>
+
+ <section id="Java-1.5.0-sun packages"><title>Java-1.5.0-sun packages</title>
+
+ <para><emphasis role="bold">Details:</emphasis></para>
+ <para>The following packages comprise Sun's 1.5.0 Java release: </para>
+ <para>java-1.5.0-sun</para>
+ <para>java-1.5.0-sun-demo</para>
+ <para>java-1.5.0-sun-devel</para>
+ <para>java-1.5.0-sun-jdbc</para>
+ <para>java-1.5.0-sun-plugin</para>
+ <para>java-1.5.0-sun-src </para>
+
+ <para>These packages include the Sun Java 5 Runtime Environment, Sun Java
+ 5 Software Development Kit, and Sun's 1.5.0_11-b03 SDK release.</para>
+ <para>The Java 5 Runtime Environment (JRE) consists of the Java virtual machine,
+ the Java platform core classes and supporting files, and includes a Web
+ browser plug-in for running Java applets. It is the runtime section of the
+ Java 5 SDK, but without the development tools such as compilers and debuggers.</para>
+ <para>The Java 5 Software Development Kit (SDK) is a development environment for
+ building applications, applets, and components that can be deployed on the
+ Java platform. The Java 5 SDK software includes tools useful for
+ developing and testing programs written in the Java programming language.
+ The Java 5 SDK software also includes a JDBC/ODBC bridge for Java
+ applications that need to communicate with a database. </para>
+ <para>Java users are advised to install these packages.</para>
+
+ <para><emphasis role="bold">Solution:</emphasis></para>
+ <para>Before applying this update, make sure all previously released errata
+ relevant to your system have been applied.</para>
+ <para>To update all RPMs for your particular architecture, run: </para>
+ <programlisting><![CDATA[rpm -Fvh [filenames]]]></programlisting>
+ <para>where [filenames] is a list of the RPMs you wish to upgrade. Only those
+ RPMs which are currently installed will be updated. Those RPMs which are
+ not installed but included in the list will not be updated. Note that you
+ can also use wildcards (*.rpm) if your current directory *only* contains the
+ desired RPMs.
+ </para>
+ <para>
+ Please note that this update is also available via Red Hat Network. Many
+ people find this an easier way to apply updates. To use Red Hat Network,
+ launch the Red Hat Update Agent with the following command: </para>
+ <programlisting><![CDATA[up2date]]></programlisting>
+ <para>This will start an interactive process that will result in the appropriate
+ RPMs being upgraded on your system.</para></section>
+
+ <section id="RHEL 5"><title>RHEL 5</title>
+ <para>The instructions for RHEL 5 are similar to RHEL 4, except that RHEL 5 uses "yum" instead of "up2date",
+ and they are in the supplementary channel rather than the extras channel.</para>
+
+ <para>Install the 32-bit Java plugin as shown below:</para>
+
+ <programlisting><![CDATA[$ yum install java-1.4.2-ibm-plugin java-1.4.2-ibm.i386 libXp.i386 gtk+.i386]]></programlisting>
+<para>or</para>
+ <programlisting><![CDATA[$ yum install java-1.5.0-ibm-plugin java-1.5.0-ibm.i386 libXp.i386 gtk +.i386]]></programlisting>
+
+ <para>Alternatively, download Java6 ( jdk-6u1-linux-i586-rpm.bin ) from http://java.sun.com, and install it. Once done, install the Java plugin as shown:</para>
+
+ <programlisting><![CDATA[$ ln -s /usr/java/latest/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/]]></programlisting>
+
+ </section>
+
+ </section>
<section id="Inst from down ver">
<title>Installing from the downloaded version</title>
<itemizedlist>
17 years, 5 months
JBoss Tools SVN: r2537 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2007-07-20 08:16:42 -0400 (Fri, 20 Jul 2007)
New Revision: 2537
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
Log:
http://jira.jboss.com/jira/browse/EXIN-365
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-07-20 12:15:18 UTC (rev 2536)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-07-20 12:16:42 UTC (rev 2537)
@@ -220,7 +220,7 @@
if (persistentClass.getIdentifier() instanceof Component) {
Component identifier = (Component)persistentClass.getIdentifier();
- if (!identifier.getComponentClassName().equals(identifier.getOwner().getEntityName())) {
+ if (identifier.getComponentClassName() != null && !identifier.getComponentClassName().equals(identifier.getOwner().getEntityName())) {
OrmShape componentClassShape = elements.get(identifier.getComponentClassName());
if (componentClassShape == null && persistentClass instanceof RootClass) {
componentClassShape = getOrCreateComponentClass(((RootClass)persistentClass).getIdentifierProperty());
17 years, 5 months
JBoss Tools SVN: r2536 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-07-20 08:15:18 -0400 (Fri, 20 Jul 2007)
New Revision: 2536
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELCompletionEngine.java
Log:
http://jira.jboss.com/jira/browse/EXIN-330
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELCompletionEngine.java 2007-07-20 08:32:48 UTC (rev 2535)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELCompletionEngine.java 2007-07-20 12:15:18 UTC (rev 2536)
@@ -178,7 +178,12 @@
Set<String> proposalsToFilter = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
for (IMember mbr : members) {
try {
- IType type = EclipseJavaUtil.findType(mbr.getJavaProject(), EclipseJavaUtil.getMemberTypeAsString(mbr));
+ IType type = null;
+ if(mbr instanceof IType) {
+ type = (IType)mbr;
+ } else {
+ type = EclipseJavaUtil.findType(mbr.getJavaProject(), EclipseJavaUtil.getMemberTypeAsString(mbr));
+ }
proposalsToFilter.addAll(SeamExpressionResolver.getMethodPresentations(type));
proposalsToFilter.addAll(SeamExpressionResolver.getPropertyPresentations(type));
} catch (JavaModelException ex) {
17 years, 5 months
JBoss Tools SVN: r2535 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core: scanner/xml and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-20 04:32:48 -0400 (Fri, 20 Jul 2007)
New Revision: 2535
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueString.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
Log:
EXIN-217 XMLScanner: loading of properties improved
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java 2007-07-20 07:21:21 UTC (rev 2534)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java 2007-07-20 08:32:48 UTC (rev 2535)
@@ -65,8 +65,13 @@
changes = Change.addChange(changes, new Change(this, null, p1, null));
properties.remove(names[i]);
} else {
+ String oldName = p1.getName();
List<Change> cc = p1.merge(p2);
if(cc != null && cc.size() > 0) children.addChildren(cc);
+ if(oldName != null && !oldName.equals(p1.getName())) {
+ properties.remove(oldName);
+ addProperty(p1);
+ }
}
}
names = pd.properties.keySet().toArray(new String[0]);
@@ -75,10 +80,9 @@
SeamProperty p2 = (SeamProperty)pd.properties.get(names[i]);
if(p1 == null) {
changes = Change.addChange(changes, new Change(this, null, null, p2));
- properties.put(names[i], p2);
+ addProperty(p2);
}
}
- properties = pd.properties;
changes = Change.addChange(changes, children);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueString.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueString.java 2007-07-20 07:21:21 UTC (rev 2534)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueString.java 2007-07-20 08:32:48 UTC (rev 2535)
@@ -21,6 +21,7 @@
*/
public class SeamValueString extends SeamObject implements ISeamValueString {
IValueInfo value;
+ String currentValue;
public SeamValueString() {}
@@ -30,18 +31,18 @@
public void setValue(IValueInfo value) {
this.value = value;
+ if(value != null) currentValue = value.getValue();
}
public List<Change> merge(SeamObject s) {
List<Change> changes = super.merge(s);
SeamValueString v = (SeamValueString)s;
- String v1 = value.getValue();
+ String v1 = currentValue;
String v2 = v.value.getValue();
if(v1 == null || !v1.equals(v2)) {
changes = Change.addChange(changes, new Change(this, "value", v1, v2));
- value = v.value;
- adopt((SeamObject)value);
- }
+ }
+ setValue(v.value);
return changes;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2007-07-20 07:21:21 UTC (rev 2534)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2007-07-20 08:32:48 UTC (rev 2535)
@@ -211,8 +211,8 @@
vm.addEntry(e);
}
}
- component.addProperty(p);
}
+ component.addProperty(p);
}
ds.getComponents().add(component);
17 years, 5 months
JBoss Tools SVN: r2534 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-07-20 03:21:21 -0400 (Fri, 20 Jul 2007)
New Revision: 2534
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/TaglibMapping.java
Log:
Fixing NullPointerException
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/TaglibMapping.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/TaglibMapping.java 2007-07-20 07:17:25 UTC (rev 2533)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/TaglibMapping.java 2007-07-20 07:21:21 UTC (rev 2534)
@@ -213,6 +213,7 @@
private void findTldsInFolder(XModelObject folder, String base) {
XModelObject[] cs = folder.getChildren();
+ if(cs==null) return;
for (int i = 0; i < cs.length; i++) {
if(cs[i].getFileType() == XModelObject.FOLDER) {
findTldsInFolder(cs[i], base + cs[i].getAttributeValue("name") + "/");
17 years, 5 months
JBoss Tools SVN: r2533 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-07-20 03:17:25 -0400 (Fri, 20 Jul 2007)
New Revision: 2533
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
Log:
Fixing NullPointerException
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2007-07-19 18:13:34 UTC (rev 2532)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2007-07-20 07:17:25 UTC (rev 2533)
@@ -480,8 +480,8 @@
IResource r = project.getWorkspace().getRoot().findMember(p);
String s = r.getLocation().toString();
l.add(new java.io.File(s).getCanonicalPath());
- } catch (Exception e) {
- throw new Exception("Cannot find output for project " + project);
+ } catch (JavaModelException e) {
+ throw new Exception("Cannot find output for project " + project,e);
}
IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
for (int i = 0; i < es.length; i++) {
17 years, 5 months