diff --git a/lib/idcanet-x4o-bin.jar b/lib/idcanet-x4o-bin.jar index 6acdeb1..c016f1c 100644 Binary files a/lib/idcanet-x4o-bin.jar and b/lib/idcanet-x4o-bin.jar differ diff --git a/src/com/idcanet/foei/core/impl/X2OExecutorImpl.java b/src/com/idcanet/foei/core/impl/X2OExecutorImpl.java index 9499610..179278d 100644 --- a/src/com/idcanet/foei/core/impl/X2OExecutorImpl.java +++ b/src/com/idcanet/foei/core/impl/X2OExecutorImpl.java @@ -67,7 +67,7 @@ public class X2OExecutorImpl implements X2OExecutor { // config parser FoeiProcess foeiProcess = FoeiProcessFactory.getFoeiProcess(); X4OParser parser = new X4OParser("foei"); - parser.getParsingContext().getProperties().putAll(foeiProcess.getFoeiContext().getStartProperties()); + parser.getElementContext().getProperties().putAll(foeiProcess.getFoeiContext().getStartProperties()); logger.info("Executing X2O Parsing."); diff --git a/src/com/idcanet/foei/core/x4o/BindAttributeHandler.java b/src/com/idcanet/foei/core/x4o/BindAttributeHandler.java index 8045374..b2baff5 100644 --- a/src/com/idcanet/foei/core/x4o/BindAttributeHandler.java +++ b/src/com/idcanet/foei/core/x4o/BindAttributeHandler.java @@ -47,7 +47,8 @@ public class BindAttributeHandler extends AbstractElementParameterHandler { * @see com.idca.foei.xml.x2o.eld.GlobalParameterHandler#doParameter(java.lang.Object, java.lang.String) */ @Override - public void doParameterStartTag(Element element,String parameterValue) throws Exception { + public void doParameterStartTag(Element element) throws Exception { + String parameterValue = element.getAttributes().get(getParameterName()); String[] port = parameterValue.split(":"); if(port.length!=2) { return; diff --git a/src/com/idcanet/foei/core/x4o/IdAttributeHandler.java b/src/com/idcanet/foei/core/x4o/IdAttributeHandler.java index d876b7c..454d3cf 100644 --- a/src/com/idcanet/foei/core/x4o/IdAttributeHandler.java +++ b/src/com/idcanet/foei/core/x4o/IdAttributeHandler.java @@ -43,8 +43,9 @@ public class IdAttributeHandler extends AbstractElementParameterHandler { * @see com.idca.foei.xml.x2o.eld.GlobalParameterHandler#doParameter(java.lang.Object, java.lang.String) */ @Override - public void doParameterStartTag(Element element,String parameterValue) throws Exception { + public void doParameterStartTag(Element element) throws Exception { // add to objext context + String parameterValue = element.getAttributes().get(getParameterName()); if(element.getElementObject()==null | "".equals(parameterValue)) { parameterValue= "auto."+Integer.toHexString(element.getElementObject().hashCode()); //logger.finest("Generated auto id: "+parameterValue); diff --git a/src/com/idcanet/foei/core/x4o/ObjectBindingElement.java b/src/com/idcanet/foei/core/x4o/ObjectBindingElement.java index f34757b..660c9f3 100644 --- a/src/com/idcanet/foei/core/x4o/ObjectBindingElement.java +++ b/src/com/idcanet/foei/core/x4o/ObjectBindingElement.java @@ -43,11 +43,7 @@ import org.xml.sax.Attributes; * @version 1.0 Mar 2, 2006 */ public class ObjectBindingElement extends AbstractElement { - - /** The Object which is configed */ - //private Object parentObject = null; - //private Object childObject = null; - + private String outputID = null; private String outputPort = null; private String inputID = null; @@ -82,69 +78,5 @@ public class ObjectBindingElement extends AbstractElement { throw new ElementException("Could not find EventPort from outputPort"); } foei.addBinding(outputEventPort,inputEventPort); - - - /* - if(outputID==null) { - //outputID = foei.getObjectConfigurator().getParameter(parentObject,"id").toString(); - } - if(outputPort==null) { - if(parentObject instanceof EventOutput) { - EventOutput eventOutput = (EventOutput)parentObject; - if(eventOutput.getOutputPorts().size()>0) { - EventPort port = (EventPort)eventOutput.getOutputPorts().get(0); - outputPort = port.getName(); - } else { - // no output ports - throw new ElementException("parentObject(EventOutput) is no output ports defined"); - } - } else { - // np EventOutput .. - throw new ElementException("parentObject: "+parentObject+" is not an EventOutput"); - } - } - */ } - - // HACK routines - /* - public String getOutputID() { - return outputID; - } - public String getOutputPort() { - return outputPort; - } - */ - - public void doElementEnd() { - /* - FoeiProcess foei = FoeiProcessFactory.getFoeiProcess(); - if(inputID!=null & inputPort!=null & outputID!=null & outputPort!=null) { - // Add binding - foei.addBinding() - foeiInstance.getObjectBindingsManager().addBinding(outputID,outputPort,inputID,inputPort); - } else { - System.err.println("Coudn't addbinding: inID="+inputID+" inPort="+inputPort+" outID="+outputID+" outPort="+outputPort); - } - */ - } - - - //------------------ ElementObject - - /** - * Get the object this elements configs. - * @return The object this Element controlles - */ - /* - public Object getElementObject() { - return parentObject; - //return object; - } - - public void setElementObject(Object object) { - // TODO: this is an quich hack see FoeiTagHandler - //this.object=object; - } - */ } \ No newline at end of file diff --git a/src/com/idcanet/foei/core/x4o/SetParameterElement.java b/src/com/idcanet/foei/core/x4o/SetParameterElement.java deleted file mode 100644 index c9d976c..0000000 --- a/src/com/idcanet/foei/core/x4o/SetParameterElement.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2004-2006 IDCA. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the - * following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and - * the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions - * and the following disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY IDCA AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IDCA OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the authors and - * should not be interpreted as representing official policies, either expressed or implied, of IDCA. - */ - -package com.idcanet.foei.core.x4o; - - -import org.xml.sax.Attributes; - -import com.idcanet.x4o.element.AbstractElement; -import com.idcanet.x4o.element.ElementException; - -/** - * - * - * @author Willem Cazander - * @version 1.0 Mar 2, 2006 - */ -public class SetParameterElement extends AbstractElement { - /** The Object which is configed */ - private Object object = null; - - private Object eventObject = null; - private String parameterName = null; - private Object parameterValue = null; - - public SetParameterElement() { - } - - /** - * Do the element - */ - public void doElementStart(Attributes attributes) throws ElementException - { - // the EventObject for the parent element is also this its elementObject. - Object o = getParent().getElementObject(); - /* - if(!(o instanceof EventObject)) { - throw new ElementException("parent ElementObject is not EventObject"); - } - eventObject = (EventObject)o; - */ - parameterName = attributes.getValue("name"); - parameterValue = attributes.getValue("value"); - } - - public void doElementEnd() - { - - } - - - //------------------ ElementObject - - /** - * Get the object this elements configs. - * @return The object this Element controlles - */ - public Object getElementObject() { - return object; - } - - public void setElementObject(Object object) { - this.object=object; - } -} \ No newline at end of file diff --git a/src/com/idcanet/foei/server/config/FoeiConfigParser.java b/src/com/idcanet/foei/server/config/FoeiConfigParser.java deleted file mode 100644 index 9dcda09..0000000 --- a/src/com/idcanet/foei/server/config/FoeiConfigParser.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2004-2006 IDCA. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the - * following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and - * the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions - * and the following disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY IDCA AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IDCA OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the authors and - * should not be interpreted as representing official policies, either expressed or implied, of IDCA. - */ - -package com.idcanet.foei.server.config; - - -import java.io.IOException; -import java.io.InputStream; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - -import org.xml.sax.SAXException; - -import com.idcanet.x4o.xml.AbstractXMLParser; -import com.idcanet.x4o.xml.XMLHandler; - -/** - * Parses the foei-config.xml file - * - * - * @author Willem Cazander - * @version 1.0 Jun 23, 2006 - */ -public class FoeiConfigParser extends AbstractXMLParser { - - /** - * Parsesn the input stream as a X2O document - */ - public void parse(InputStream inputStream) throws ParserConfigurationException,SAXException,IOException { - XMLHandler handler = new XMLHandler(); - - /* - X2OTagHandler xth = new X2OTagHandler(rootTag,parsingContext); - xth.setDebug(debug); - handler.addXMLTagHandler(xth); - */ - - SAXParserFactory factory = SAXParserFactory.newInstance(); - factory.setNamespaceAware(true); - SAXParser saxParser = factory.newSAXParser(); - saxParser.parse(inputStream,handler); - } -} \ No newline at end of file diff --git a/src/com/idcanet/foei/server/config/FoeiContextXMLTagHandler.java b/src/com/idcanet/foei/server/config/FoeiContextXMLTagHandler.java deleted file mode 100644 index 09179ea..0000000 --- a/src/com/idcanet/foei/server/config/FoeiContextXMLTagHandler.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2004-2006 IDCA. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the - * following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and - * the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions - * and the following disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY IDCA AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IDCA OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the authors and - * should not be interpreted as representing official policies, either expressed or implied, of IDCA. - */ - -package com.idcanet.foei.server.config; - - -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -import com.idcanet.x4o.xml.AbstractXMLTagHandler; - -/** - * - * - * - * @author Willem Cazander - * @version 1.0 Jun 23, 2006 - */ -public class FoeiContextXMLTagHandler extends AbstractXMLTagHandler { - - - @Override - public void startElement(String nameSpace,String tag,String qName,Attributes attributes) throws SAXException { - - } - - @Override - public void endElement(String nameSpace,String tag,String qName) throws SAXException { - - } - - /** - * @see AbstractXMLTagHandler#characters(String) - */ - @Override - public void characters(String text) {/* - if(this.text==null) { - this.text=text; - } else { - this.text+=text; - } */ - } -} \ No newline at end of file