[jboss-jira] [JBoss JIRA] Commented: (GPD-111) Add ability to forward and reverse map Semantic Elements to/from Dom Node/Xml Adapters jpdl
Matthew Sandoz (JIRA)
jira-events at lists.jboss.org
Wed Aug 8 16:19:54 EDT 2007
[ http://jira.jboss.com/jira/browse/GPD-111?page=comments#action_12371540 ]
Matthew Sandoz commented on GPD-111:
------------------------------------
ok this appears to be working now - heres a patch from eclipse from the eclipse "Create Patch" - is that the best way to provide these? if not i can attach the entire file...
### Eclipse Workspace Patch 1.0
#P org.jbpm.gd.jpdl
Index: src/org/jbpm/gd/common/xml/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.8
diff -u -r1.8 XmlAdapterFactory.java
--- src/org/jbpm/gd/common/xml/XmlAdapterFactory.java 7 Aug 2007 13:02:45 -0000 1.8
+++ src/org/jbpm/gd/common/xml/XmlAdapterFactory.java 8 Aug 2007 20:16:40 -0000
@@ -99,6 +99,17 @@
Logger.logError("Neither xmlElement nor nameProvider are present on mapping configuration element for " + jpdlElement.getElementId(), e);
}
}
+ } else {
+ try {
+ XmlAdapter adapter = (XmlAdapter) configurationElement.createExecutableExtension("adapterClass");
+ INodeNotifier element = (INodeNotifier)document.createElement(elementName);
+ element.addAdapter(adapter);
+ adapter.setNode((Node)element);
+ adapter.setFactory(this);
+ return adapter;
+ } catch (CoreException e) {
+ Logger.logError("Unable to create XML Adapter for " + jpdlElement.getElementId(), e);
+ }
}
return elementName == null ? null : createAdapterFromElementName(elementName);
}
> Add ability to forward and reverse map Semantic Elements to/from Dom Node/Xml Adapters jpdl
> -------------------------------------------------------------------------------------------
>
> Key: GPD-111
> URL: http://jira.jboss.com/jira/browse/GPD-111
> Project: JBoss jBPM GPD
> Issue Type: Feature Request
> Components: jpdl
> Environment: all? :)
> Reporter: Matthew Sandoz
> Assigned To: Koen Aers
> Fix For: jBPM JPDL Designer 3.1.0.CR
>
> Attachments: solution.zip, solution.zip, solution.zip
>
>
> Addresses need to add new semantic elements without adding new xml types. Current mapping forces 1-1 mapping between them.
> this change allows one-to-many mapping between elements by introducing a mapping object for each semantic element.
> this mapping object's responsibility is to determine if a chunk of xml should map to a semantic element and xml adapter or not.
> the xml adapter registry holds a set of these mappers and loops through them all, giving each a chance to accept the xml chunk. all accepting
> mappers are then sorted by priority and the lowest priority number is selected. mappings with no priority are given Integer.MAX priority. Mappings with
> no mapperClass are given a default mapper class of ConfiguredSemanticElementDomMapper so that existing plugin.xml should continue to function
> normally.
> The priority property allows the maintainer of the plugin.xml to change priorities for different circumstances, giving different potentially conflicting mappers
> a specific preference order.
> Details of change:
> Added two elements to xmlMappings.exsd: mapperClass and mapperClassPriority
> Created interface SemanticElementDomMapper to determine if a given Dom Node can be assigned to a semantic element
> Created class ConfiguredSemanticElementDomMapper as a base implementation of the SemanticElementDomMapper. This
> default implementation checks the current configured xml node name against the node name of the passed Dom Node. This should
> duplicate the existing functionality for existing standard jpdl xml node types.
> JythonNodeDomMapper is included as an example but should not be committed to the project as it is for specialized use.
> XmlAdapterRegistry constructs a HashMap of Mappers and has a new getConfigurationElementByNode method.
> XmlAdapter has 2 lines modified in the createSemanticElementFor method to use the new registry method.
> XmlAdapterFactory has modifications in createAdapter and createAdapterFromModel
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list