1 Aug 2007 16:33
[jbpm-cvs] jbpm.3/designer/jpdl/org.jbpm.gd.jpdl/src/org/jbpm/gd/common/xml ...
Koen Aers <kaers <at> jboss.com>
2007-08-01 14:33:26 GMT
2007-08-01 14:33:26 GMT
User: kaers
Date: 07/08/01 10:33:26
Modified: designer/jpdl/org.jbpm.gd.jpdl/src/org/jbpm/gd/common/xml
XmlAdapter.java XmlAdapterFactory.java
Added: designer/jpdl/org.jbpm.gd.jpdl/src/org/jbpm/gd/common/xml
XmlElementMapper.java
Log:
Add ability to forward and reverse map Semantic Elements to/from Dom Node/Xml Adapters jpdl: GPD-111
Revision Changes Path
1.5 +1 -2 jbpm.3/designer/jpdl/org.jbpm.gd.jpdl/src/org/jbpm/gd/common/xml/XmlAdapter.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: XmlAdapter.java
===================================================================
RCS file: /cvsroot/jbpm/jbpm.3/designer/jpdl/org.jbpm.gd.jpdl/src/org/jbpm/gd/common/xml/XmlAdapter.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- XmlAdapter.java 13 Jul 2007 09:27:52 -0000 1.4
+++ XmlAdapter.java 1 Aug 2007 14:33:26 -0000 1.5
<at> <at> -466,9 +466,8 <at> <at>
}
protected SemanticElement createSemanticElementFor(XmlAdapter child) {
- String type = child.getElementType();
IConfigurationElement configurationElement =
- getXmlAdapterRegistry().getConfigurationElementByXmlElementName(type);
+ getXmlAdapterRegistry().getconfigurationElementByXmlNode(child.getNode());
if (configurationElement == null) return null;
String id = configurationElement.getAttribute("semanticElement");
return getSemanticElementFactory().createById(id);
1.4 +1 -2 jbpm.3/designer/jpdl/org.jbpm.gd.jpdl/src/org/jbpm/gd/common/xml/XmlAdapterFactory.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: XmlAdapterFactory.java
===================================================================
RCS file: /cvsroot/jbpm/jbpm.3/designer/jpdl/org.jbpm.gd.jpdl/src/org/jbpm/gd/common/xml/XmlAdapterFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- XmlAdapterFactory.java 13 Jul 2007 09:27:52 -0000 1.3
+++ XmlAdapterFactory.java 1 Aug 2007 14:33:26 -0000 1.4
<at> <at> -34,7 +34,6 <at> <at>
import org.jbpm.gd.common.registry.RegistryRegistry;
import org.jbpm.gd.common.registry.XmlAdapterRegistry;
import org.jbpm.gd.jpdl.Logger;
-import org.jbpm.gd.jpdl.model.ConfigInfoElement;
import org.jbpm.gd.jpdl.xml.ConfigInfoElementDomAdapter;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
<at> <at> -63,7 +62,7 <at> <at>
if (document == null) throw new RuntimeException("The document property of the
JpdlElementDomAdapterFactory is not initialized");
XmlAdapter result = null;
try {
- IConfigurationElement element = xmlAdapterRegistry.getConfigurationElementByXmlElementName(((Node)target).getNodeName());
+ IConfigurationElement element = xmlAdapterRegistry.getconfigurationElementByXmlNode((Node)target);
if (element != null) {
result = (XmlAdapter)element.createExecutableExtension("adapterClass");
} else if (((Node)target).getNodeType() != Node.TEXT_NODE){
1.1 date: 2007/08/01 14:33:26; author: kaers; state: Exp;jbpm.3/designer/jpdl/org.jbpm.gd.jpdl/src/org/jbpm/gd/common/xml/XmlElementMapper.java
Index: XmlElementMapper.java
===================================================================
/*
* JBoss, Home of Professional Open Source
* Copyright 2005, JBoss Inc., and individual contributors as indicated
* by the <at> authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY 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 along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jbpm.gd.common.xml;
import org.w3c.dom.Node;
/**
* Interface for acceptance filters to determine if a given Dom node can map to
* a mapper's associated Semantic Element.
*
* <at> author Matthew Sandoz
*/
public interface XmlElementMapper {
/**
* Checks whether a given Dom Node conforms to the requirements for a
* specific Semantic Element type.
*
* <at> param node Dom Node to check
* <at> return whether or not the mapper instance accepts the current node
*/
public boolean accept(Node node);
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
RSS Feed