JBoss JBPM SVN: r3284 - in jbpm4/trunk/modules: jpdl/src/test/java/org/jbpm/test/xml and 2 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-09 06:36:55 -0500 (Tue, 09 Dec 2008)
New Revision: 3284
Added:
jbpm4/trunk/modules/jpdl/src/test/resources/org/jbpm/test/xml/nonamespace.jpdl.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/DomBuilder.java
Modified:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/xml/JpdlXmlTest.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java
Log:
schema validation
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java 2008-12-09 11:18:02 UTC (rev 3283)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java 2008-12-09 11:36:55 UTC (rev 3284)
@@ -26,6 +26,9 @@
import java.util.Enumeration;
import java.util.List;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.SAXParser;
+
import org.jbpm.activity.Activity;
import org.jbpm.jpdl.JpdlProcessDefinition;
import org.jbpm.log.Log;
@@ -34,9 +37,13 @@
import org.jbpm.pvm.internal.model.TransitionImpl;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.xml.DomBuilder;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
/**
* @author Tom Baeyens
@@ -53,9 +60,11 @@
static ActivitiesParser activityParser = new ActivitiesParser();
public JpdlParser() {
+ initialize();
+
Activities activitiesConfiguration = parseActivitiesConfiguration();
setBindings(activitiesConfiguration.bindings);
- // setSchemaResources(activitiesConfiguration.schemaResources);
+ setSchemaResources(activitiesConfiguration.schemaResources);
}
protected Activities parseActivitiesConfiguration() {
@@ -81,7 +90,6 @@
return activities;
}
-
public Object parseDocumentElement(Element documentElement, Parse parse) {
ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) parse.getDocumentObject();
if (processDefinition==null) {
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/xml/JpdlXmlTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/xml/JpdlXmlTest.java 2008-12-09 11:18:02 UTC (rev 3283)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/xml/JpdlXmlTest.java 2008-12-09 11:36:55 UTC (rev 3284)
@@ -41,7 +41,7 @@
assertEquals(problems.toString(), 0, problems.size());
}
-
+
public void testInvalidXml() {
List<Problem> problems = new JpdlParser()
.createParse()
@@ -51,4 +51,14 @@
assertEquals(problems.toString(), 1, problems.size());
}
+
+ public void testNoNamespace() {
+ List<Problem> problems = new JpdlParser()
+ .createParse()
+ .setResource("org/jbpm/test/xml/nonamespace.jpdl.xml")
+ .execute()
+ .getProblems();
+
+ assertEquals(problems.toString(), 0, problems.size());
+ }
}
Added: jbpm4/trunk/modules/jpdl/src/test/resources/org/jbpm/test/xml/nonamespace.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/org/jbpm/test/xml/nonamespace.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/org/jbpm/test/xml/nonamespace.jpdl.xml 2008-12-09 11:36:55 UTC (rev 3284)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="Purchase order">
+
+ <start />
+
+ <buzzz>
+
+ </buzzz>
+
+</process>
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/DomBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/DomBuilder.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/DomBuilder.java 2008-12-09 11:36:55 UTC (rev 3284)
@@ -0,0 +1,851 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * $Id: DebugDomBuilder.java 1434 2008-07-01 10:32:10Z heiko.braun(a)jboss.com $
+ */
+package org.jbpm.pvm.internal.xml;
+
+import java.util.Stack;
+import java.util.Vector;
+
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.Text;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.ext.LexicalHandler;
+import org.xml.sax.helpers.DefaultHandler;
+
+/** builds the dom model from SAX events, optionally adding the line and
+ * column number as attributes to every element. */
+public class DomBuilder extends DefaultHandler implements ContentHandler, LexicalHandler { /** Root document */
+
+ public Document document;
+
+ protected String debugNamespace = null;
+ protected String lineAttributeName = "line";
+ protected String columnAttributeName = null;
+
+ /** Current node */
+ protected Node currentNode = null;
+
+ /** The root node */
+ protected Node root = null;
+
+ /** The next sibling node */
+ protected Node nextSibling = null;
+
+ /** First node of document fragment or null if not a DocumentFragment */
+ public DocumentFragment docFrag = null;
+
+ /** Vector of element nodes */
+ protected Stack elemStack = new Stack();
+
+ /** Namespace support */
+ protected Vector prefixMappings = new Vector();
+
+ /** to obtain the line number information */
+ protected Locator locator = null;
+
+ /**
+ * Get the root document or DocumentFragment of the DOM being created.
+ *
+ * @return The root document or document fragment if not null
+ */
+ public Node getRootDocument() {
+ return (null != this.docFrag) ? (Node) this.docFrag : (Node) this.document;
+ }
+
+ /**
+ * Get the root node of the DOM tree.
+ */
+ public Node getRootNode() {
+ return this.root;
+ }
+
+ /**
+ * Get the node currently being processed.
+ *
+ * @return the current node being processed
+ */
+ public Node getCurrentNode() {
+ return this.currentNode;
+ }
+
+ /**
+ * Set the next sibling node, which is where the result nodes should be
+ * inserted before.
+ *
+ * @param nextSibling
+ * the next sibling node.
+ */
+ public void setNextSibling(Node nextSibling) {
+ this.nextSibling = nextSibling;
+ }
+
+ /**
+ * Return the next sibling node.
+ *
+ * @return the next sibling node.
+ */
+ public Node getNextSibling() {
+ return this.nextSibling;
+ }
+
+ /**
+ * Return null since there is no Writer for this class.
+ *
+ * @return null
+ */
+ public java.io.Writer getWriter() {
+ return null;
+ }
+
+ /**
+ * Append a node to the current container.
+ *
+ * @param newNode
+ * New node to append
+ */
+ protected void append(Node newNode) throws org.xml.sax.SAXException {
+
+ Node currentNode = this.currentNode;
+
+ if (null != currentNode) {
+ if (currentNode == this.root && this.nextSibling != null)
+ currentNode.insertBefore(newNode, this.nextSibling);
+ else
+ currentNode.appendChild(newNode);
+
+ // System.out.println(newNode.getNodeName());
+ } else if (null != this.docFrag) {
+ if (this.nextSibling != null)
+ this.docFrag.insertBefore(newNode, this.nextSibling);
+ else
+ this.docFrag.appendChild(newNode);
+ } else {
+ boolean ok = true;
+ short type = newNode.getNodeType();
+
+ if (type == Node.TEXT_NODE) {
+ String data = newNode.getNodeValue();
+
+ if ((null != data) && (data.trim().length() > 0)) {
+ throw new org.xml.sax.SAXException("Warning: can't output text before document element! Ignoring...");
+ }
+
+ ok = false;
+ } else if (type == Node.ELEMENT_NODE) {
+ if (this.document.getDocumentElement() != null) {
+ ok = false;
+
+ throw new org.xml.sax.SAXException("Can't have more than one root on a DOM!");
+ }
+ }
+
+ if (ok) {
+ if (this.nextSibling != null)
+ this.document.insertBefore(newNode, this.nextSibling);
+ else
+ this.document.appendChild(newNode);
+ }
+ }
+ }
+
+ /**
+ * Receive an object for locating the origin of SAX document events.
+ *
+ * <p>
+ * SAX parsers are strongly encouraged (though not absolutely required) to
+ * supply a locator: if it does so, it must supply the locator to the
+ * application by invoking this method before invoking any of the other
+ * methods in the ContentHandler interface.
+ * </p>
+ *
+ * <p>
+ * The locator allows the application to determine the end position of any
+ * document-related event, even if the parser is not reporting an error.
+ * Typically, the application will use this information for reporting its own
+ * errors (such as character content that does not match an application's
+ * business rules). The information returned by the locator is probably not
+ * sufficient for use with a search engine.
+ * </p>
+ *
+ * <p>
+ * Note that the locator will return correct information only during the
+ * invocation of the events in this interface. The application should not
+ * attempt to use it at any other time.
+ * </p>
+ *
+ * @param locator
+ * An object that can return the location of any SAX document event.
+ * @see org.xml.sax.Locator
+ */
+ public void setDocumentLocator(Locator locator) {
+ this.locator = locator;
+ // No action for the moment.
+ }
+
+ /**
+ * Receive notification of the beginning of a document.
+ *
+ * <p>
+ * The SAX parser will invoke this method only once, before any other methods
+ * in this interface or in DTDHandler (except for setDocumentLocator).
+ * </p>
+ */
+ public void startDocument() throws org.xml.sax.SAXException {
+
+ // No action for the moment.
+ }
+
+ /**
+ * Receive notification of the end of a document.
+ *
+ * <p>
+ * The SAX parser will invoke this method only once, and it will be the last
+ * method invoked during the parse. The parser shall not invoke this method
+ * until it has either abandoned parsing (because of an unrecoverable error)
+ * or reached the end of input.
+ * </p>
+ */
+ public void endDocument() throws org.xml.sax.SAXException {
+
+ // No action for the moment.
+ }
+
+ /**
+ * Receive notification of the beginning of an element.
+ *
+ * <p>
+ * The Parser will invoke this method at the beginning of every element in the
+ * XML document; there will be a corresponding endElement() event for every
+ * startElement() event (even when the element is empty). All of the element's
+ * content will be reported, in order, before the corresponding endElement()
+ * event.
+ * </p>
+ *
+ * <p>
+ * If the element name has a namespace prefix, the prefix will still be
+ * attached. Note that the attribute list provided will contain only
+ * attributes with explicit values (specified or defaulted): #IMPLIED
+ * attributes will be omitted.
+ * </p>
+ *
+ *
+ * @param ns
+ * The namespace of the node
+ * @param localName
+ * The local part of the qualified name
+ * @param name
+ * The element name.
+ * @param atts
+ * The attributes attached to the element, if any.
+ * @see #endElement
+ * @see org.xml.sax.Attributes
+ */
+ public void startElement(String ns, String localName, String name, Attributes atts) throws org.xml.sax.SAXException {
+
+ Element elem;
+
+ // Note that the namespace-aware call must be used to correctly
+ // construct a Level 2 DOM, even for non-namespaced nodes.
+ if ((null == ns) || (ns.length() == 0))
+ elem = this.document.createElementNS(null, name);
+ else
+ elem = this.document.createElementNS(ns, name);
+
+ append(elem);
+
+ try {
+ int nAtts = atts.getLength();
+
+ if (0 != nAtts) {
+ for (int i = 0; i < nAtts; i++) {
+
+ // System.out.println("type " + atts.getType(i) + " name " +
+ // atts.getLocalName(i) );
+ // First handle a possible ID attribute
+ if (atts.getType(i).equalsIgnoreCase("ID"))
+ setIDAttribute(atts.getValue(i), elem);
+
+ String attrNS = atts.getURI(i);
+
+ if ("".equals(attrNS))
+ attrNS = null; // DOM represents no-namespace as null
+
+ // System.out.println("attrNS: "+attrNS+", localName:
+ // "+atts.getQName(i)
+ // +", qname: "+atts.getQName(i)+", value: "+atts.getValue(i));
+ // Crimson won't let us set an xmlns: attribute on the DOM.
+ String attrQName = atts.getQName(i);
+
+ // In SAX, xmlns[:] attributes have an empty namespace, while in DOM
+ // they
+ // should have the xmlns namespace
+ if (attrQName.startsWith("xmlns:") || attrQName.equals("xmlns")) {
+ attrNS = "http://www.w3.org/2000/xmlns/";
+ }
+
+ // ALWAYS use the DOM Level 2 call!
+ elem.setAttributeNS(attrNS, attrQName, atts.getValue(i));
+ }
+ }
+
+ if (locator!=null) {
+ int lineNumber = locator.getLineNumber();
+ int columnNumber = locator.getColumnNumber();
+
+ if (debugNamespace==null) {
+ if (lineAttributeName!=null) {
+ elem.setAttribute(lineAttributeName, Integer.toString(lineNumber));
+ }
+ if (columnAttributeName!=null) {
+ elem.setAttribute(columnAttributeName, Integer.toString(columnNumber));
+ }
+
+ } else {
+ if (lineAttributeName!=null) {
+ elem.setAttributeNS(debugNamespace, lineAttributeName, Integer.toString(lineNumber));
+ }
+ if (columnAttributeName!=null) {
+ elem.setAttributeNS(debugNamespace, columnAttributeName, Integer.toString(columnNumber));
+ }
+
+ }
+ }
+
+
+ /*
+ * Adding namespace nodes to the DOM tree;
+ */
+ int nDecls = this.prefixMappings.size();
+
+ String prefix, declURL;
+
+ for (int i = 0; i < nDecls; i += 2) {
+ prefix = (String) this.prefixMappings.elementAt(i);
+
+ if (prefix == null)
+ continue;
+
+ declURL = (String) this.prefixMappings.elementAt(i + 1);
+
+ elem.setAttributeNS("http://www.w3.org/2000/xmlns/", prefix, declURL);
+ }
+
+ this.prefixMappings.clear();
+
+ // append(elem);
+
+ this.elemStack.push(elem);
+
+ this.currentNode = elem;
+
+ // append(elem);
+ } catch (java.lang.Exception de) {
+ // de.printStackTrace();
+ throw new org.xml.sax.SAXException(de);
+ }
+
+ }
+
+ /**
+ *
+ *
+ *
+ * Receive notification of the end of an element.
+ *
+ * <p>
+ * The SAX parser will invoke this method at the end of every element in the
+ * XML document; there will be a corresponding startElement() event for every
+ * endElement() event (even when the element is empty).
+ * </p>
+ *
+ * <p>
+ * If the element name has a namespace prefix, the prefix will still be
+ * attached to the name.
+ * </p>
+ *
+ *
+ * @param ns
+ * the namespace of the element
+ * @param localName
+ * The local part of the qualified name of the element
+ * @param name
+ * The element name
+ */
+ public void endElement(String ns, String localName, String name) throws org.xml.sax.SAXException {
+ this.elemStack.pop();
+ this.currentNode = this.elemStack.isEmpty() ? null : (Node) this.elemStack.peek();
+ }
+
+ /**
+ * Set an ID string to node association in the ID table.
+ *
+ * @param id
+ * The ID string.
+ * @param elem
+ * The associated ID.
+ */
+ public void setIDAttribute(String id, Element elem) {
+
+ // Do nothing. This method is meant to be overiden.
+ }
+
+ /**
+ * Receive notification of character data.
+ *
+ * <p>
+ * The Parser will call this method to report each chunk of character data.
+ * SAX parsers may return all contiguous character data in a single chunk, or
+ * they may split it into several chunks; however, all of the characters in
+ * any single event must come from the same external entity, so that the
+ * Locator provides useful information.
+ * </p>
+ *
+ * <p>
+ * The application must not attempt to read from the array outside of the
+ * specified range.
+ * </p>
+ *
+ * <p>
+ * Note that some parsers will report whitespace using the
+ * ignorableWhitespace() method rather than this one (validating parsers must
+ * do so).
+ * </p>
+ *
+ * @param ch
+ * The characters from the XML document.
+ * @param start
+ * The start position in the array.
+ * @param length
+ * The number of characters to read from the array.
+ * @see #ignorableWhitespace
+ * @see org.xml.sax.Locator
+ */
+ public void characters(char ch[], int start, int length) throws org.xml.sax.SAXException {
+ if (isOutsideDocElem() && isWhiteSpace(ch, start, length))
+ return; // avoid DOM006 Hierarchy request error
+
+ if (this.inCData) {
+ cdata(ch, start, length);
+
+ return;
+ }
+
+ String s = new String(ch, start, length);
+ Node childNode;
+ childNode = this.currentNode != null ? this.currentNode.getLastChild() : null;
+ if (childNode != null && childNode.getNodeType() == Node.TEXT_NODE) {
+ ((Text) childNode).appendData(s);
+ } else {
+ Text text = this.document.createTextNode(s);
+ append(text);
+ }
+ }
+
+ /**
+ * If available, when the disable-output-escaping attribute is used, output
+ * raw text without escaping. A PI will be inserted in front of the node with
+ * the name "lotusxsl-next-is-raw" and a value of "formatter-to-dom".
+ *
+ * @param ch
+ * Array containing the characters
+ * @param start
+ * Index to start of characters in the array
+ * @param length
+ * Number of characters in the array
+ */
+ public void charactersRaw(char ch[], int start, int length) throws org.xml.sax.SAXException {
+ if (isOutsideDocElem() && isWhiteSpace(ch, start, length))
+ return; // avoid DOM006 Hierarchy request error
+
+ String s = new String(ch, start, length);
+
+ append(this.document.createProcessingInstruction("xslt-next-is-raw", "formatter-to-dom"));
+ append(this.document.createTextNode(s));
+ }
+
+ /**
+ * Report the beginning of an entity.
+ *
+ * The start and end of the document entity are not reported. The start and
+ * end of the external DTD subset are reported using the pseudo-name "[dtd]".
+ * All other events must be properly nested within start/end entity events.
+ *
+ * @param name
+ * The name of the entity. If it is a parameter entity, the name will
+ * begin with '%'.
+ * @see #endEntity
+ * @see org.xml.sax.ext.DeclHandler#internalEntityDecl
+ * @see org.xml.sax.ext.DeclHandler#externalEntityDecl
+ */
+ public void startEntity(String name) throws org.xml.sax.SAXException {
+
+ // Almost certainly the wrong behavior...
+ // entityReference(name);
+ }
+
+ /**
+ * Report the end of an entity.
+ *
+ * @param name
+ * The name of the entity that is ending.
+ * @see #startEntity
+ */
+ public void endEntity(String name) throws org.xml.sax.SAXException {
+ }
+
+ /**
+ * Receive notivication of a entityReference.
+ *
+ * @param name
+ * name of the entity reference
+ */
+ public void entityReference(String name) throws org.xml.sax.SAXException {
+ append(this.document.createEntityReference(name));
+ }
+
+ /**
+ * Receive notification of ignorable whitespace in element content.
+ *
+ * <p>
+ * Validating Parsers must use this method to report each chunk of ignorable
+ * whitespace (see the W3C XML 1.0 recommendation, section 2.10):
+ * non-validating parsers may also use this method if they are capable of
+ * parsing and using content models.
+ * </p>
+ *
+ * <p>
+ * SAX parsers may return all contiguous whitespace in a single chunk, or they
+ * may split it into several chunks; however, all of the characters in any
+ * single event must come from the same external entity, so that the Locator
+ * provides useful information.
+ * </p>
+ *
+ * <p>
+ * The application must not attempt to read from the array outside of the
+ * specified range.
+ * </p>
+ *
+ * @param ch
+ * The characters from the XML document.
+ * @param start
+ * The start position in the array.
+ * @param length
+ * The number of characters to read from the array.
+ * @see #characters
+ */
+ public void ignorableWhitespace(char ch[], int start, int length) throws org.xml.sax.SAXException {
+ if (isOutsideDocElem())
+ return; // avoid DOM006 Hierarchy request error
+
+ String s = new String(ch, start, length);
+
+ append(this.document.createTextNode(s));
+ }
+
+ /**
+ * Tell if the current node is outside the document element.
+ *
+ * @return true if the current node is outside the document element.
+ */
+ private boolean isOutsideDocElem() {
+ return (null == this.docFrag) && this.elemStack.size() == 0 && (null == this.currentNode || this.currentNode.getNodeType() == Node.DOCUMENT_NODE);
+ }
+
+ /**
+ * Receive notification of a processing instruction.
+ *
+ * <p>
+ * The Parser will invoke this method once for each processing instruction
+ * found: note that processing instructions may occur before or after the main
+ * document element.
+ * </p>
+ *
+ * <p>
+ * A SAX parser should never report an XML declaration (XML 1.0, section 2.8)
+ * or a text declaration (XML 1.0, section 4.3.1) using this method.
+ * </p>
+ *
+ * @param target
+ * The processing instruction target.
+ * @param data
+ * The processing instruction data, or null if none was supplied.
+ */
+ public void processingInstruction(String target, String data) throws org.xml.sax.SAXException {
+ append(this.document.createProcessingInstruction(target, data));
+ }
+
+ /**
+ * Report an XML comment anywhere in the document.
+ *
+ * This callback will be used for comments inside or outside the document
+ * element, including comments in the external DTD subset (if read).
+ *
+ * @param ch
+ * An array holding the characters in the comment.
+ * @param start
+ * The starting position in the array.
+ * @param length
+ * The number of characters to use from the array.
+ */
+ public void comment(char ch[], int start, int length) throws org.xml.sax.SAXException {
+ append(this.document.createComment(new String(ch, start, length)));
+ }
+
+ /** Flag indicating that we are processing a CData section */
+ protected boolean inCData = false;
+
+ /**
+ * Report the start of a CDATA section.
+ *
+ * @see #endCDATA
+ */
+ public void startCDATA() throws org.xml.sax.SAXException {
+ this.inCData = true;
+ append(this.document.createCDATASection(""));
+ }
+
+ /**
+ * Report the end of a CDATA section.
+ *
+ * @see #startCDATA
+ */
+ public void endCDATA() throws org.xml.sax.SAXException {
+ this.inCData = false;
+ }
+
+ /**
+ * Receive notification of cdata.
+ *
+ * <p>
+ * The Parser will call this method to report each chunk of character data.
+ * SAX parsers may return all contiguous character data in a single chunk, or
+ * they may split it into several chunks; however, all of the characters in
+ * any single event must come from the same external entity, so that the
+ * Locator provides useful information.
+ * </p>
+ *
+ * <p>
+ * The application must not attempt to read from the array outside of the
+ * specified range.
+ * </p>
+ *
+ * <p>
+ * Note that some parsers will report whitespace using the
+ * ignorableWhitespace() method rather than this one (validating parsers must
+ * do so).
+ * </p>
+ *
+ * @param ch
+ * The characters from the XML document.
+ * @param start
+ * The start position in the array.
+ * @param length
+ * The number of characters to read from the array.
+ * @see #ignorableWhitespace
+ * @see org.xml.sax.Locator
+ */
+ public void cdata(char ch[], int start, int length) throws org.xml.sax.SAXException {
+ if (isOutsideDocElem() && isWhiteSpace(ch, start, length))
+ return; // avoid DOM006 Hierarchy request error
+
+ String s = new String(ch, start, length);
+
+ CDATASection section = (CDATASection) this.currentNode.getLastChild();
+ section.appendData(s);
+ }
+
+ /**
+ * Report the start of DTD declarations, if any.
+ *
+ * Any declarations are assumed to be in the internal subset unless otherwise
+ * indicated.
+ *
+ * @param name
+ * The document type name.
+ * @param publicId
+ * The declared public identifier for the external DTD subset, or
+ * null if none was declared.
+ * @param systemId
+ * The declared system identifier for the external DTD subset, or
+ * null if none was declared.
+ * @see #endDTD
+ * @see #startEntity
+ */
+ public void startDTD(String name, String publicId, String systemId) throws org.xml.sax.SAXException {
+
+ // Do nothing for now.
+ }
+
+ /**
+ * Report the end of DTD declarations.
+ *
+ * @see #startDTD
+ */
+ public void endDTD() throws org.xml.sax.SAXException {
+
+ // Do nothing for now.
+ }
+
+ /**
+ * Begin the scope of a prefix-URI Namespace mapping.
+ *
+ * <p>
+ * The information from this event is not necessary for normal Namespace
+ * processing: the SAX XML reader will automatically replace prefixes for
+ * element and attribute names when the http://xml.org/sax/features/namespaces
+ * feature is true (the default).
+ * </p>
+ *
+ * <p>
+ * There are cases, however, when applications need to use prefixes in
+ * character data or in attribute values, where they cannot safely be expanded
+ * automatically; the start/endPrefixMapping event supplies the information to
+ * the application to expand prefixes in those contexts itself, if necessary.
+ * </p>
+ *
+ * <p>
+ * Note that start/endPrefixMapping events are not guaranteed to be properly
+ * nested relative to each-other: all startPrefixMapping events will occur
+ * before the corresponding startElement event, and all endPrefixMapping
+ * events will occur after the corresponding endElement event, but their order
+ * is not guaranteed.
+ * </p>
+ *
+ * @param prefix
+ * The Namespace prefix being declared.
+ * @param uri
+ * The Namespace URI the prefix is mapped to.
+ * @see #endPrefixMapping
+ * @see #startElement
+ */
+ public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException {
+ if (null == prefix || prefix.equals(""))
+ prefix = "xmlns";
+ else
+ prefix = "xmlns:" + prefix;
+ this.prefixMappings.addElement(prefix);
+ this.prefixMappings.addElement(uri);
+ }
+
+ /**
+ * End the scope of a prefix-URI mapping.
+ *
+ * <p>
+ * See startPrefixMapping for details. This event will always occur after the
+ * corresponding endElement event, but the order of endPrefixMapping events is
+ * not otherwise guaranteed.
+ * </p>
+ *
+ * @param prefix
+ * The prefix that was being mapping.
+ * @see #startPrefixMapping
+ * @see #endElement
+ */
+ public void endPrefixMapping(String prefix) throws org.xml.sax.SAXException {
+ }
+
+ /**
+ * Receive notification of a skipped entity.
+ *
+ * <p>
+ * The Parser will invoke this method once for each entity skipped.
+ * Non-validating processors may skip entities if they have not seen the
+ * declarations (because, for example, the entity was declared in an external
+ * DTD subset). All processors may skip external entities, depending on the
+ * values of the http://xml.org/sax/features/external-general-entities and the
+ * http://xml.org/sax/features/external-parameter-entities properties.
+ * </p>
+ *
+ * @param name
+ * The name of the skipped entity. If it is a parameter entity, the
+ * name will begin with '%'.
+ */
+ public void skippedEntity(String name) throws org.xml.sax.SAXException {
+ }
+
+ /**
+ * Returns whether the specified <var>ch</var> conforms to the XML 1.0
+ * definition of whitespace. Refer to <A
+ * href="http://www.w3.org/TR/1998/REC-xml-19980210#NT-S"> the definition of
+ * <CODE>S</CODE></A> for details.
+ *
+ * @param ch
+ * Character to check as XML whitespace.
+ * @return =true if <var>ch</var> is XML whitespace; otherwise =false.
+ */
+ public static boolean isWhiteSpace(char ch) {
+ return (ch == 0x20) || (ch == 0x09) || (ch == 0xD) || (ch == 0xA);
+ }
+
+ /**
+ * Tell if the string is whitespace.
+ *
+ * @param ch
+ * Character array to check as XML whitespace.
+ * @param start
+ * Start index of characters in the array
+ * @param length
+ * Number of characters in the array
+ * @return True if the characters in the array are XML whitespace; otherwise,
+ * false.
+ */
+ public static boolean isWhiteSpace(char ch[], int start, int length) {
+
+ int end = start + length;
+
+ for (int s = start; s < end; s++) {
+ if (!isWhiteSpace(ch[s]))
+ return false;
+ }
+
+ return true;
+ }
+
+ public void setDebugNamespace(String debugNamespace) {
+ this.debugNamespace = debugNamespace;
+ }
+ public void setLineAttributeName(String lineAttributeName) {
+ this.lineAttributeName = lineAttributeName;
+ }
+ public void setColumnAttributeName(String columnAttributeName) {
+ this.columnAttributeName = columnAttributeName;
+ }
+ public String getDebugNamespace() {
+ return debugNamespace;
+ }
+ public String getLineAttributeName() {
+ return lineAttributeName;
+ }
+ public String getColumnAttributeName() {
+ return columnAttributeName;
+ }
+ public Document getDocument() {
+ return document;
+ }
+ public void setDocument(Document document) {
+ this.document = document;
+ }
+}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java 2008-12-09 11:18:02 UTC (rev 3283)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java 2008-12-09 11:36:55 UTC (rev 3284)
@@ -57,7 +57,7 @@
protected Parser parser;
protected ClassLoader classLoader;
- protected StreamInput streamSource;
+ protected StreamInput streamInput;
protected InputStream inputStream;
protected InputSource inputSource;
@@ -70,22 +70,24 @@
protected Parse(Parser parser) {
this.parser = parser;
}
+
+ // specifying the input source //////////////////////////////////////////////
/** specify an input stream as the source for this parse */
public Parse setInputStream(InputStream inputStream) {
- this.streamSource = new InputStreamInput(inputStream);
+ this.streamInput = new InputStreamInput(inputStream);
return this;
}
/** specify a URL as the source for this parse */
public Parse setUrl(URL url) {
- this.streamSource = new UrlStreamInput(url);
+ this.streamInput = new UrlStreamInput(url);
return this;
}
/** specify a file as the source for this parse */
public Parse setFile(File file) {
- this.streamSource = new FileStreamInput(file);
+ this.streamInput = new FileStreamInput(file);
return this;
}
@@ -98,19 +100,19 @@
/** specify a resource as the source for this parse */
public Parse setResource(String resource) {
- this.streamSource = new ResourceStreamInput(resource, classLoader);
+ this.streamInput = new ResourceStreamInput(resource, classLoader);
return this;
}
/** specify an XML string as the source for this parse */
public Parse setString(String xmlString) {
- this.streamSource = new StringStreamInput(xmlString);
+ this.streamInput = new StringStreamInput(xmlString);
return this;
}
/** specify a {@link StreamInput} as the source for this parse */
- public Parse setStreamSource(StreamInput streamSource) {
- this.streamSource = streamSource;
+ public Parse setStreamSource(StreamInput streamInput) {
+ this.streamInput = streamInput;
return this;
}
@@ -136,6 +138,24 @@
return this;
}
+ // retrieving input source //////////////////////////////////////////////////
+
+ protected InputSource getInputSource() {
+ if (inputSource!=null) {
+ return inputSource;
+ }
+
+ if (streamInput!=null) {
+ inputStream = streamInput.openStream();
+ return new InputSource(inputStream);
+ }
+
+ addProblem("no source specified to parse");
+ return null;
+ }
+
+ // parse execution //////////////////////////////////////////////////////////
+
/** perform the actual parse operation with the specified input source. */
public Parse execute() {
parser.execute(this);
@@ -165,6 +185,20 @@
addProblem(problem);
}
+ /** throws an exception with appropriate message in case the parse contains
+ * errors or fatal errors. This method also logs the problems with severity
+ * 'warning'. */
+ public Parse checkProblems(String description) {
+ if (hasProblems()) {
+ String errorMsg = "problems during parse of "+description+":"+getProblemsText();
+ log.info(errorMsg);
+ if (errorMsg!=null) {
+ throw new JbpmException(errorMsg);
+ }
+ }
+ return this;
+ }
+
// contextual objects ///////////////////////////////////////////////////////
/** push a contextual object on the stack of this parse. */
@@ -211,22 +245,8 @@
return null;
}
- /** throws an exception with appropriate message in case the parse contains
- * errors or fatal errors. This method also logs the problems with severity
- * 'warning'. */
- public Parse checkProblems(String description) {
- if (hasProblems()) {
- String errorMsg = "problems during parse of "+description+":"+getProblemsText();
- log.info(errorMsg);
- if (errorMsg!=null) {
- throw new JbpmException(errorMsg);
- }
- }
- return this;
- }
+ // getters //////////////////////////////////////////////////////////////////
- // getters and setters //////////////////////////////////////////////////////
-
/** the result of this parse operation. */
public Object getDocumentObject() {
return documentObject;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java 2008-12-09 11:18:02 UTC (rev 3283)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java 2008-12-09 11:36:55 UTC (rev 3284)
@@ -21,20 +21,16 @@
*/
package org.jbpm.pvm.internal.xml;
-import java.io.InputStream;
+import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
-import org.jbpm.JbpmException;
import org.jbpm.log.Log;
import org.jbpm.pvm.internal.stream.StreamInput;
import org.jbpm.pvm.internal.util.UrlEntity;
@@ -43,6 +39,7 @@
import org.w3c.dom.Element;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
/** makes typical usage of JAXP more convenient, adds a binding framework,
* entity resolution and error handling.
@@ -248,6 +245,9 @@
public class Parser {
private static Log log = Log.getLog(Parser.class.getName());
+
+ protected SAXParserFactory saxParserFactory;
+ protected String[] schemaResources;
protected DocumentBuilderFactory documentBuilderFactory = null;
@@ -256,75 +256,73 @@
/** the default parser */
public Parser() {
+ initialize();
}
/** creates a new Parser with bindings that can be maintained statically in
* specialized subclasses of Parser. */
public Parser(Bindings bindings) {
+ initialize();
this.bindings = bindings;
}
/** creates a new Parser with bindings and entities that can be maintained statically
- * in specialized subclasses of Parser. */
+ * in specialized subclasses of Parser.
+ * @deprecated entities should be replaced by {@link #setSchemaResources(List)} */
public Parser(Bindings bindings, Map<String, Entity> entities) {
+ initialize();
this.bindings = bindings;
}
+
+ // initialization ///////////////////////////////////////////////////////////
- // document builder methods /////////////////////////////////////////////////
+ public void initialize() {
+ initializeSaxParserFactory();
+ initializeDocumentBuilderFactory();
+ }
- /** getter with lazy initialization of the document builder factory.
- * If no document builder factory was set previously with the {@link #setDocumentBuilderFactory(DocumentBuilderFactory)}
- * method, {@link #newDocumentBuilderFactory()} will be called to create one.
- */
- public synchronized DocumentBuilderFactory getDocumentBuilderFactory() {
- if (documentBuilderFactory==null) {
- documentBuilderFactory = newDocumentBuilderFactory();
- }
- return documentBuilderFactory;
+ public void initializeDocumentBuilderFactory() {
+ documentBuilderFactory = DocumentBuilderFactory.newInstance();
}
- /** setter for the document builder factory */
- public void setDocumentBuilderFactory(DocumentBuilderFactory documentBuilderFactory) {
- this.documentBuilderFactory = documentBuilderFactory;
+ public void initializeSaxParserFactory() {
+ saxParserFactory = SAXParserFactory.newInstance();
}
- /** factory method for {@link DocumentBuilderFactory} during lazy initialization
- * of the documentBuilderFactory. Can be overridden by subclasses to change
- * the DocumentBuilderFactory implementation or to apply specific configurations. */
- protected DocumentBuilderFactory newDocumentBuilderFactory() {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- return factory;
+ // document builder methods /////////////////////////////////////////////////
+
+ /** customizable creation of a new document builder. Used by
+ * {@link #buildDom(Parse)}. */
+ protected DocumentBuilder createDocumentBuilder(Parse parse) {
+ try {
+ parse.documentBuilder = documentBuilderFactory.newDocumentBuilder();
+ } catch (Exception e) {
+ parse.addProblem("couldn't get new document builder", e);
+ return null;
+ }
+ parse.documentBuilder.setErrorHandler(parse);
+ return parse.documentBuilder;
}
// schema validation ////////////////////////////////////////////////////////
- protected void setSchemaResources(List<String> resources) {
- if ( (resources==null)
- || (resources.isEmpty())
- ) {
- throw new JbpmException("no schema resoures");
- }
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ public void setSchemaResources(List<String> resources) {
+ saxParserFactory.setValidating(true);
+ saxParserFactory.setNamespaceAware(true);
- List<Source> schemaSources = new ArrayList<Source>();
- for (String resource: resources) {
- InputStream schemaStream = classLoader.getResourceAsStream(resource);
- if (schemaStream==null) {
- throw new JbpmException("schema resource "+resource+" unavailable");
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ List<String> schemaLocations = new ArrayList<String>(resources.size());
+ for (String schemaResource: resources) {
+ URL schemaUrl = classLoader.getResource(schemaResource);
+ if (schemaUrl!=null) {
+ String schemaLocation = schemaUrl.toString();
+ log.debug("schema resource found: " + schemaResource);
+ schemaLocations.add(schemaLocation);
+ } else {
+ log.debug("skipping unavailble schema resource: " + schemaResource);
}
- StreamSource schemaSource = new StreamSource(schemaStream);
- schemaSources.add(schemaSource);
}
- try {
- Source[] schemaSourceArray = schemaSources.toArray(new Source[schemaSources.size()]);
- Schema schema = schemaFactory.newSchema(schemaSourceArray);
- DocumentBuilderFactory factory = getDocumentBuilderFactory();
- factory.setSchema(schema);
- factory.setNamespaceAware(true);
- } catch (Exception e) {
- log.error("couldn't install schema's for validation: "+e.toString());
- }
+ schemaResources = schemaLocations.toArray(new String[schemaLocations.size()]);
}
// bindings /////////////////////////////////////////////////////////////////
@@ -360,11 +358,11 @@
/** builds a dom from the importedStreamSource and appends the child elements
* of the document element to the destination element. Problems are reported
* in the importingParse. */
- public void importStream(StreamInput importedStreamSource, Element destination, Parse importingParse) {
+ public void importStream(StreamInput importedStreamInput, Element destination, Parse importingParse) {
try {
// build the dom of the imported document
Parse importedParse = createParse();
- importedParse.setStreamSource(importedStreamSource);
+ importedParse.setStreamSource(importedStreamInput);
Document importedDocument = buildDom(importedParse);
// loop over all the imported document elements
@@ -375,7 +373,7 @@
}
} catch (Exception e) {
- importingParse.addProblem("couldn't import "+importedStreamSource, e);
+ importingParse.addProblem("couldn't import "+importedStreamInput, e);
}
}
@@ -408,62 +406,54 @@
}
}
- /** customizable DOM building. Parses {@link #getInputSource(Parse) the
- * input specified in the parse} with a
- * {@link #createDocumentBuilder(parse) DocumentBuilder}.
- *
- * @return a Document or null in case an exception occurs during XML
- * parsing. */
protected Document buildDom(Parse parse) {
- DocumentBuilder documentBuilder = createDocumentBuilder(parse);
- InputSource inputSource = getInputSource(parse);
+ Document document = null;
try {
- // create the dom tree
- parse.document = documentBuilder.parse(inputSource);
+ SAXParser saxParser = saxParserFactory.newSAXParser();
+ XMLReader xmlReader = saxParser.getXMLReader();
+
+ try {
+ saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
+ } catch (Exception e){
+ log.info("couldn't set schema language property", e);
+ }
- } catch (Exception e) {
- parse.addProblem("couldn't parse xml document", e);
- }
+ if (schemaResources!=null) {
+ try {
+ saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", schemaResources);
+ } catch (Exception e){
+ log.info("couldn't set schema source property", e);
+ }
+ }
- return parse.document;
- }
+ try {
+ xmlReader.setFeature("http://apache.org/xml/features/validation/dynamic", true);
+ } catch (Exception e){
+ log.info("couldn't set dynamic validation feature", e);
+ }
- /** customizable creation of a new document builder. Used by
- * {@link #buildDom(Parse)}. */
- protected DocumentBuilder createDocumentBuilder(Parse parse) {
- DocumentBuilderFactory documentBuilderFactory = getDocumentBuilderFactory();
- try {
- parse.documentBuilder = documentBuilderFactory.newDocumentBuilder();
- } catch (Exception e) {
- parse.addProblem("couldn't get new document builder", e);
- return null;
- }
- parse.documentBuilder.setErrorHandler(parse);
- return parse.documentBuilder;
- }
+ DocumentBuilder documentBuilder = createDocumentBuilder(parse);
+ document = documentBuilder.newDocument();
+ parse.setDocument(document);
- /** customizable extraction of the inputSource from the given parse.
- *
- * Returns null in case
- * the parse doesn't have an inputSource or a streamSource specified.
- *
- * If an inputStream is created in this method, it is set in the parse
- * so that it can be closed at the end of the {@link #execute(Parse)}. */
- protected InputSource getInputSource(Parse parse) {
- if (parse.inputSource!=null) {
- return parse.inputSource;
- }
+ DomBuilder domBuilder = new DomBuilder();
+ domBuilder.setDocument(document);
- if (parse.streamSource!=null) {
- parse.inputStream = parse.streamSource.openStream();
- return new InputSource(parse.inputStream);
+ xmlReader.setContentHandler(domBuilder);
+ xmlReader.setErrorHandler(parse);
+
+ InputSource inputSource = parse.getInputSource();
+ xmlReader.parse(inputSource);
+
+ } catch (Exception e) {
+ parse.addProblem("couldn't parse xml document", e);
}
-
- parse.addProblem("no source specified to parse");
- return null;
+
+ return document;
}
+
// Document Object Model walking ////////////////////////////////////////////
/** start of the DOM walk.
17 years, 4 months
JBoss JBPM SVN: r3283 - projects/gwt-console/trunk/server/src/main/resources.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-12-09 06:18:02 -0500 (Tue, 09 Dec 2008)
New Revision: 3283
Modified:
projects/gwt-console/trunk/server/src/main/resources/definition_report.rptdesign
Log:
Added default DS to definition_report.rptdesign
Modified: projects/gwt-console/trunk/server/src/main/resources/definition_report.rptdesign
===================================================================
--- projects/gwt-console/trunk/server/src/main/resources/definition_report.rptdesign 2008-12-09 11:03:26 UTC (rev 3282)
+++ projects/gwt-console/trunk/server/src/main/resources/definition_report.rptdesign 2008-12-09 11:18:02 UTC (rev 3283)
@@ -28,6 +28,7 @@
<property name="odaDriverClass">com.mysql.jdbc.Driver</property>
<property name="odaURL">jdbc:mysql://localhost:3306/jbpmtest</property>
<property name="odaUser">jbpmtest</property>
+ <property name="odaJndiName">java:/JbpmDS</property>
</oda-data-source>
</data-sources>
<data-sets>
17 years, 4 months
JBoss JBPM SVN: r3282 - projects/report-server/trunk.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-12-09 06:03:26 -0500 (Tue, 09 Dec 2008)
New Revision: 3282
Removed:
projects/report-server/trunk/Balalaika.ipr
projects/report-server/trunk/Balalaika.iws
Log:
Remove legacy project files
Deleted: projects/report-server/trunk/Balalaika.ipr
===================================================================
--- projects/report-server/trunk/Balalaika.ipr 2008-12-09 11:02:03 UTC (rev 3281)
+++ projects/report-server/trunk/Balalaika.ipr 2008-12-09 11:03:26 UTC (rev 3282)
@@ -1,316 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4" relativePaths="false">
- <component name="AntConfiguration">
- <defaultAnt bundledAnt="true" />
- </component>
- <component name="BuildJarProjectSettings">
- <option name="BUILD_JARS_ON_MAKE" value="false" />
- </component>
- <component name="CodeStyleProjectProfileManger">
- <option name="PROJECT_PROFILE" />
- <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
- </component>
- <component name="CodeStyleSettingsManager">
- <option name="PER_PROJECT_SETTINGS" />
- <option name="USE_PER_PROJECT_SETTINGS" value="false" />
- </component>
- <component name="CompilerConfiguration">
- <option name="DEFAULT_COMPILER" value="Javac" />
- <option name="DEPLOY_AFTER_MAKE" value="0" />
- <resourceExtensions>
- <entry name=".+\.(properties|xml|html|dtd|tld)" />
- <entry name=".+\.(gif|png|jpeg|jpg)" />
- </resourceExtensions>
- <wildcardResourcePatterns>
- <entry name="?*.properties" />
- <entry name="?*.xml" />
- <entry name="?*.gif" />
- <entry name="?*.png" />
- <entry name="?*.jpeg" />
- <entry name="?*.jpg" />
- <entry name="?*.html" />
- <entry name="?*.dtd" />
- <entry name="?*.tld" />
- </wildcardResourcePatterns>
- </component>
- <component name="DataSourceManagerImpl" />
- <component name="DependenciesAnalyzeManager">
- <option name="myForwardDirection" value="false" />
- </component>
- <component name="DependencyValidationManager" />
- <component name="EclipseCompilerSettings">
- <option name="DEBUGGING_INFO" value="true" />
- <option name="GENERATE_NO_WARNINGS" value="true" />
- <option name="DEPRECATION" value="false" />
- <option name="ADDITIONAL_OPTIONS_STRING" value="" />
- <option name="MAXIMUM_HEAP_SIZE" value="128" />
- </component>
- <component name="EclipseEmbeddedCompilerSettings">
- <option name="DEBUGGING_INFO" value="true" />
- <option name="GENERATE_NO_WARNINGS" value="true" />
- <option name="DEPRECATION" value="false" />
- <option name="ADDITIONAL_OPTIONS_STRING" value="" />
- <option name="MAXIMUM_HEAP_SIZE" value="128" />
- </component>
- <component name="EntryPointsManager">
- <entry_points />
- </component>
- <component name="ExportToHTMLSettings">
- <option name="PRINT_LINE_NUMBERS" value="false" />
- <option name="OPEN_IN_BROWSER" value="false" />
- <option name="OUTPUT_DIRECTORY" />
- </component>
- <component name="GUI Designer component loader factory" />
- <component name="IdProvider" IDEtalkID="1E46A79AE09FDDA36C7AA36A15233C1A" />
- <component name="InspectionProjectProfileManager">
- <option name="PROJECT_PROFILE" value="Project Default" />
- <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
- <scopes />
- <profiles>
- <profile version="1.0" is_locked="false">
- <option name="myName" value="Project Default" />
- <option name="myLocal" value="false" />
- <used_levels>
- <error>
- <option name="myName" value="ERROR" />
- <option name="myVal" value="400" />
- </error>
- <warning>
- <option name="myName" value="WARNING" />
- <option name="myVal" value="300" />
- </warning>
- <information>
- <option name="myName" value="INFO" />
- <option name="myVal" value="200" />
- </information>
- <server>
- <option name="myName" value="SERVER PROBLEM" />
- <option name="myVal" value="100" />
- </server>
- </used_levels>
- </profile>
- </profiles>
- </component>
- <component name="JavacSettings">
- <option name="DEBUGGING_INFO" value="true" />
- <option name="GENERATE_NO_WARNINGS" value="false" />
- <option name="DEPRECATION" value="true" />
- <option name="ADDITIONAL_OPTIONS_STRING" value="" />
- <option name="MAXIMUM_HEAP_SIZE" value="128" />
- </component>
- <component name="JavadocGenerationManager">
- <option name="OUTPUT_DIRECTORY" />
- <option name="OPTION_SCOPE" value="protected" />
- <option name="OPTION_HIERARCHY" value="true" />
- <option name="OPTION_NAVIGATOR" value="true" />
- <option name="OPTION_INDEX" value="true" />
- <option name="OPTION_SEPARATE_INDEX" value="true" />
- <option name="OPTION_DOCUMENT_TAG_USE" value="false" />
- <option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
- <option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
- <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
- <option name="OPTION_DEPRECATED_LIST" value="true" />
- <option name="OTHER_OPTIONS" value="" />
- <option name="HEAP_SIZE" />
- <option name="LOCALE" />
- <option name="OPEN_IN_BROWSER" value="true" />
- </component>
- <component name="JikesSettings">
- <option name="JIKES_PATH" value="" />
- <option name="DEBUGGING_INFO" value="true" />
- <option name="DEPRECATION" value="true" />
- <option name="GENERATE_NO_WARNINGS" value="false" />
- <option name="IS_EMACS_ERRORS_MODE" value="true" />
- <option name="ADDITIONAL_OPTIONS_STRING" value="" />
- </component>
- <component name="LogConsolePreferences">
- <option name="FILTER_ERRORS" value="false" />
- <option name="FILTER_WARNINGS" value="false" />
- <option name="FILTER_INFO" value="true" />
- <option name="CUSTOM_FILTER" />
- </component>
- <component name="Maven Reloaded">
- <option name="config">
- <value>
- <option name="pluginEnabled" value="false" />
- <option name="offlineModeEnabled" value="false" />
- <option name="updateClasspathsEnabled" value="true" />
- <option name="sortDependenciesEnabled" value="false" />
- <option name="removeDuplicateDependenciesEnabled" value="false" />
- <option name="respondToPomChangesEnabled" value="true" />
- <option name="manageSourceRootsEnabled" value="true" />
- <option name="manageModuleInterdependenciesEnabled" value="true" />
- <option name="downloadSourcesEnabled" value="false" />
- <option name="downloadJavadocEnabled" value="false" />
- <option name="generateSourcesEnabled" value="false" />
- <option name="settingsPath" value="/Users/hbraun/.m2/settings.xml" />
- <option name="searchFilter" value="" />
- <option name="disabledPoms">
- <value>
- <collection type="java.util.TreeSet" />
- </value>
- </option>
- <option name="moduleInterDependencies">
- <value>
- <map type="java.util.TreeMap" />
- </value>
- </option>
- <option name="logLevel" value="1" />
- </value>
- </option>
- </component>
- <component name="Palette2">
- <group name="Swing">
- <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
- </item>
- <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
- </item>
- <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
- </item>
- <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
- <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
- </item>
- <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
- <initial-values>
- <property name="text" value="Button" />
- </initial-values>
- </item>
- <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
- <initial-values>
- <property name="text" value="RadioButton" />
- </initial-values>
- </item>
- <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
- <initial-values>
- <property name="text" value="CheckBox" />
- </initial-values>
- </item>
- <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
- <initial-values>
- <property name="text" value="Label" />
- </initial-values>
- </item>
- <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
- <preferred-size width="150" height="-1" />
- </default-constraints>
- </item>
- <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
- <preferred-size width="150" height="-1" />
- </default-constraints>
- </item>
- <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
- <preferred-size width="150" height="-1" />
- </default-constraints>
- </item>
- <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
- </item>
- <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
- <preferred-size width="200" height="200" />
- </default-constraints>
- </item>
- <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
- <preferred-size width="200" height="200" />
- </default-constraints>
- </item>
- <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
- </item>
- <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
- </item>
- <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
- </item>
- <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
- </item>
- <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
- <preferred-size width="-1" height="20" />
- </default-constraints>
- </item>
- <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
- </item>
- <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
- </item>
- </group>
- </component>
- <component name="ProjectModuleManager">
- <modules>
- <module fileurl="file://$PROJECT_DIR$/parent.iml" filepath="$PROJECT_DIR$/parent.iml" />
- </modules>
- </component>
- <component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="true" project-jdk-name="1.5" project-jdk-type="JavaSDK">
- <output url="file://$PROJECT_DIR$/target/classes" />
- </component>
- <component name="ProjectRunConfigurationManager" />
- <component name="RmicSettings">
- <option name="IS_EANABLED" value="false" />
- <option name="DEBUGGING_INFO" value="true" />
- <option name="GENERATE_NO_WARNINGS" value="false" />
- <option name="GENERATE_IIOP_STUBS" value="false" />
- <option name="ADDITIONAL_OPTIONS_STRING" value="" />
- </component>
- <component name="StarteamVcsAdapter" />
- <component name="VssVcs" />
- <component name="com.intellij.jsf.UserDefinedFacesConfigs">
- <option name="USER_DEFINED_CONFIGS">
- <value>
- <list size="0" />
- </value>
- </option>
- </component>
- <component name="libraryTable" />
- <component name="uidesigner-configuration">
- <option name="INSTRUMENT_CLASSES" value="true" />
- <option name="COPY_FORMS_RUNTIME_TO_OUTPUT" value="true" />
- <option name="DEFAULT_LAYOUT_MANAGER" value="GridLayoutManager" />
- </component>
- <UsedPathMacros />
-</project>
-
Deleted: projects/report-server/trunk/Balalaika.iws
===================================================================
--- projects/report-server/trunk/Balalaika.iws 2008-12-09 11:02:03 UTC (rev 3281)
+++ projects/report-server/trunk/Balalaika.iws 2008-12-09 11:03:26 UTC (rev 3282)
@@ -1,761 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4" relativePaths="false">
- <component name="BookmarkManager" />
- <component name="ChangeBrowserSettings">
- <option name="MAIN_SPLITTER_PROPORTION" value="0.3" />
- <option name="MESSAGES_SPLITTER_PROPORTION" value="0.8" />
- <option name="USE_DATE_BEFORE_FILTER" value="false" />
- <option name="USE_DATE_AFTER_FILTER" value="false" />
- <option name="USE_CHANGE_BEFORE_FILTER" value="false" />
- <option name="USE_CHANGE_AFTER_FILTER" value="false" />
- <option name="DATE_BEFORE" value="" />
- <option name="DATE_AFTER" value="" />
- <option name="CHANGE_BEFORE" value="" />
- <option name="CHANGE_AFTER" value="" />
- <option name="USE_USER_FILTER" value="false" />
- <option name="USER" value="" />
- </component>
- <component name="ChangeListManager">
- <list default="true" name="Default" comment="">
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Balalaika.iws" afterPath="$PROJECT_DIR$/Balalaika.iws" />
- </list>
- </component>
- <component name="ChangeListSynchronizer" />
- <component name="ChangesViewManager" flattened_view="true" />
- <component name="CheckinPanelState" />
- <component name="Commander">
- <leftPanel />
- <rightPanel />
- <splitter proportion="0.5" />
- </component>
- <component name="CompilerWorkspaceConfiguration">
- <option name="COMPILE_IN_BACKGROUND" value="false" />
- <option name="AUTO_SHOW_ERRORS_IN_EDITOR" value="true" />
- <option name="CLOSE_MESSAGE_VIEW_IF_SUCCESS" value="true" />
- <option name="COMPILE_DEPENDENT_FILES" value="false" />
- <option name="CLEAR_OUTPUT_DIRECTORY" value="false" />
- <option name="ASSERT_NOT_NULL" value="true" />
- </component>
- <component name="CoverageDataManager" />
- <component name="Cvs2Configuration">
- <option name="PRUNE_EMPTY_DIRECTORIES" value="true" />
- <option name="MERGING_MODE" value="0" />
- <option name="MERGE_WITH_BRANCH1_NAME" value="HEAD" />
- <option name="MERGE_WITH_BRANCH2_NAME" value="HEAD" />
- <option name="RESET_STICKY" value="false" />
- <option name="CREATE_NEW_DIRECTORIES" value="true" />
- <option name="DEFAULT_TEXT_FILE_SUBSTITUTION" value="kv" />
- <option name="PROCESS_UNKNOWN_FILES" value="false" />
- <option name="PROCESS_DELETED_FILES" value="false" />
- <option name="PROCESS_IGNORED_FILES" value="false" />
- <option name="RESERVED_EDIT" value="false" />
- <option name="CHECKOUT_DATE_OR_REVISION_SETTINGS">
- <value>
- <option name="BRANCH" value="" />
- <option name="DATE" value="" />
- <option name="USE_BRANCH" value="false" />
- <option name="USE_DATE" value="false" />
- </value>
- </option>
- <option name="UPDATE_DATE_OR_REVISION_SETTINGS">
- <value>
- <option name="BRANCH" value="" />
- <option name="DATE" value="" />
- <option name="USE_BRANCH" value="false" />
- <option name="USE_DATE" value="false" />
- </value>
- </option>
- <option name="SHOW_CHANGES_REVISION_SETTINGS">
- <value>
- <option name="BRANCH" value="" />
- <option name="DATE" value="" />
- <option name="USE_BRANCH" value="false" />
- <option name="USE_DATE" value="false" />
- </value>
- </option>
- <option name="SHOW_OUTPUT" value="false" />
- <option name="ADD_WATCH_INDEX" value="0" />
- <option name="REMOVE_WATCH_INDEX" value="0" />
- <option name="UPDATE_KEYWORD_SUBSTITUTION" />
- <option name="MAKE_NEW_FILES_READONLY" value="false" />
- <option name="SHOW_CORRUPTED_PROJECT_FILES" value="0" />
- <option name="TAG_AFTER_PROJECT_COMMIT" value="false" />
- <option name="OVERRIDE_EXISTING_TAG_FOR_PROJECT" value="true" />
- <option name="TAG_AFTER_PROJECT_COMMIT_NAME" value="" />
- <option name="CLEAN_COPY" value="false" />
- </component>
- <component name="DaemonCodeAnalyzer">
- <disable_hints />
- </component>
- <component name="DebuggerManager">
- <breakpoint_any>
- <breakpoint>
- <option name="NOTIFY_CAUGHT" value="true" />
- <option name="NOTIFY_UNCAUGHT" value="true" />
- <option name="ENABLED" value="false" />
- <option name="SUSPEND_POLICY" value="SuspendAll" />
- <option name="LOG_ENABLED" value="false" />
- <option name="LOG_EXPRESSION_ENABLED" value="false" />
- <option name="COUNT_FILTER_ENABLED" value="false" />
- <option name="COUNT_FILTER" value="0" />
- <option name="CONDITION_ENABLED" value="false" />
- <option name="CLASS_FILTERS_ENABLED" value="false" />
- <option name="INSTANCE_FILTERS_ENABLED" value="false" />
- <option name="CONDITION" value="" />
- <option name="LOG_MESSAGE" value="" />
- </breakpoint>
- <breakpoint>
- <option name="NOTIFY_CAUGHT" value="true" />
- <option name="NOTIFY_UNCAUGHT" value="true" />
- <option name="ENABLED" value="false" />
- <option name="SUSPEND_POLICY" value="SuspendAll" />
- <option name="LOG_ENABLED" value="false" />
- <option name="LOG_EXPRESSION_ENABLED" value="false" />
- <option name="COUNT_FILTER_ENABLED" value="false" />
- <option name="COUNT_FILTER" value="0" />
- <option name="CONDITION_ENABLED" value="false" />
- <option name="CLASS_FILTERS_ENABLED" value="false" />
- <option name="INSTANCE_FILTERS_ENABLED" value="false" />
- <option name="CONDITION" value="" />
- <option name="LOG_MESSAGE" value="" />
- </breakpoint>
- </breakpoint_any>
- <breakpoint_rules />
- <ui_properties />
- </component>
- <component name="ErrorTreeViewConfiguration">
- <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
- <option name="HIDE_WARNINGS" value="false" />
- </component>
- <component name="FavoritesManager">
- <favorites_list name="Balalaika" />
- </component>
- <component name="FavoritesProjectViewPane">
- <subPane subId="Balalaika">
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" />
- <option name="myItemType" value="com.intellij.ide.favoritesTreeView.FavoritesTreeNodeDescriptor" />
- </PATH_ELEMENT>
- </PATH>
- </subPane>
- </component>
- <component name="FileEditorManager">
- <leaf>
- <file leaf-file-name="BirtService.java" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/core/src/main/java/org/jboss/balalaika/BirtService.java">
- <provider selected="true" editor-type-id="text-editor">
- <state line="31" column="13" selection-start="1255" selection-end="1255" vertical-scroll-proportion="0.2875817">
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="BirtEngineFactory.java" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/core/src/main/java/org/jboss/balalaika/BirtEngineFactory.java">
- <provider selected="true" editor-type-id="text-editor">
- <state line="42" column="22" selection-start="1688" selection-end="1688" vertical-scroll-proportion="0.54066986">
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="pom.xml" pinned="false" current="true" current-in-tab="true">
- <entry file="file://$PROJECT_DIR$/core/pom.xml">
- <provider selected="true" editor-type-id="text-editor">
- <state line="5" column="29" selection-start="340" selection-end="354" vertical-scroll-proportion="0.13071896">
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- </leaf>
- </component>
- <component name="FindManager">
- <FindUsagesManager>
- <setting name="OPEN_NEW_TAB" value="false" />
- </FindUsagesManager>
- </component>
- <component name="HierarchyBrowserManager">
- <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
- <option name="SORT_ALPHABETICALLY" value="false" />
- <option name="HIDE_CLASSES_WHERE_METHOD_NOT_IMPLEMENTED" value="false" />
- </component>
- <component name="InspectionManager">
- <option name="AUTOSCROLL_TO_SOURCE" value="false" />
- <option name="SPLITTER_PROPORTION" value="0.5" />
- <option name="GROUP_BY_SEVERITY" value="false" />
- <option name="FILTER_RESOLVED_ITEMS" value="true" />
- <option name="ANALYZE_TEST_SOURCES" value="true" />
- <option name="SHOW_DIFF_WITH_PREVIOUS_RUN" value="false" />
- <option name="SCOPE_TYPE" value="1" />
- <option name="CUSTOM_SCOPE_NAME" value="" />
- <option name="SHOW_ONLY_DIFF" value="false" />
- <option name="myCurrentProfileName" value="Default" />
- </component>
- <component name="J2EEProjectPane" />
- <component name="JspContextManager" />
- <component name="ModuleEditorState">
- <option name="LAST_EDITED_MODULE_NAME" />
- <option name="LAST_EDITED_TAB_NAME" />
- </component>
- <component name="NamedScopeManager" />
- <component name="PackagesPane">
- <subPane>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="Balalaika.ipr" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewProjectNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="core" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewModuleNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="Libraries" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewLibrariesNode" />
- </PATH_ELEMENT>
- </PATH>
- </subPane>
- </component>
- <component name="PerforceChangeBrowserSettings">
- <option name="USE_CLIENT_FILTER" value="true" />
- <option name="CLIENT" value="" />
- </component>
- <component name="PerforceDirect.Settings">
- <option name="useP4CONFIG" value="true" />
- <option name="port" value="<perforce_server>:1666" />
- <option name="client" value="" />
- <option name="user" value="" />
- <option name="passwd" value="" />
- <option name="showCmds" value="false" />
- <option name="useNativeApi" value="false" />
- <option name="pathToExec" value="p4" />
- <option name="useCustomPathToExec" value="false" />
- <option name="SYNC_FORCE" value="false" />
- <option name="SYNC_RUN_RESOLVE" value="true" />
- <option name="REVERT_UNCHANGED_FILES" value="true" />
- <option name="CHARSET" value="none" />
- <option name="SHOW_BRANCHES_HISTORY" value="true" />
- <option name="ENABLED" value="true" />
- <option name="USE_LOGIN" value="false" />
- <option name="LOGIN_SILENTLY" value="false" />
- <option name="INTEGRATE_RUN_RESOLVE" value="true" />
- <option name="INTEGRATE_REVERT_UNCHANGED" value="true" />
- <option name="SERVER_TIMEOUT" value="20000" />
- </component>
- <component name="ProjectLevelVcsManager">
- <OptionsSetting value="true" id="Add" />
- <OptionsSetting value="true" id="Remove" />
- <OptionsSetting value="true" id="Checkin" />
- <OptionsSetting value="true" id="Checkout" />
- <OptionsSetting value="true" id="Update" />
- <OptionsSetting value="true" id="Status" />
- <OptionsSetting value="true" id="Edit" />
- <OptionsSetting value="true" id="Undo Check Out" />
- <OptionsSetting value="true" id="Compare with SourceSafe Version" />
- <OptionsSetting value="true" id="Get Latest Version" />
- <ConfirmationsSetting value="0" id="Add" />
- <ConfirmationsSetting value="0" id="Remove" />
- </component>
- <component name="ProjectPane">
- <subPane>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="Balalaika.ipr" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="parent" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
- </PATH_ELEMENT>
- </PATH>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="Balalaika.ipr" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="parent" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- </PATH>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="Balalaika.ipr" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="parent" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/core" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- </PATH>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="Balalaika.ipr" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="parent" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/core" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/core/src" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/core/src/main" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- </PATH>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="Balalaika.ipr" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="parent" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/core" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/core/src" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/core/src/main" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/core/src/main/java" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/core/src/main/java/org/jboss/balalaika" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- </PATH>
- </subPane>
- </component>
- <component name="ProjectReloadState">
- <option name="STATE" value="0" />
- </component>
- <component name="ProjectView">
- <navigator currentView="ProjectPane" proportions="0.11111111" version="1" splitterProportion="0.5">
- <flattenPackages ProjectPane="false" />
- <showMembers />
- <showModules />
- <showLibraryContents />
- <hideEmptyPackages ProjectPane="true" />
- <abbreviatePackageNames />
- <showStructure Favorites="false" PackagesPane="false" Scope="false" ProjectPane="false" />
- <autoscrollToSource />
- <autoscrollFromSource />
- <sortByType />
- </navigator>
- </component>
- <component name="PropertiesComponent">
- <property name="MemberChooser.copyJavadoc" value="false" />
- <property name="GoToClass.includeLibraries" value="false" />
- <property name="MemberChooser.showClasses" value="true" />
- <property name="MemberChooser.sorted" value="false" />
- <property name="RunManagerConfig.compileBeforeRunning" value="false" />
- <property name="GoToFile.includeJavaFiles" value="false" />
- <property name="GoToClass.toSaveIncludeLibraries" value="false" />
- <property name="RunManagerConfig.showSettingsBeforeRunnig" value="false" />
- </component>
- <component name="ReadonlyStatusHandler">
- <option name="SHOW_DIALOG" value="true" />
- </component>
- <component name="RecentsManager">
- <key name="MoveClassesOrPackagesDialog.RECENTS_KEY">
- <recent name="org.eclipse.birt.report.data.oda.subjdbc" />
- </key>
- </component>
- <component name="RestoreUpdateTree" />
- <component name="RunManager" selected="Application.Main">
- <tempConfiguration default="false" name="Main" type="Application" factoryName="Application" enabled="false" merge="false">
- <option name="MAIN_CLASS_NAME" value="org.jboss.balalaika.Main" />
- <option name="VM_PARAMETERS" value="" />
- <option name="PROGRAM_PARAMETERS" value="" />
- <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
- <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
- <option name="ALTERNATIVE_JRE_PATH" value="" />
- <option name="ENABLE_SWING_INSPECTOR" value="false" />
- <module name="parent" />
- <RunnerSettings RunnerId="Debug">
- <option name="DEBUG_PORT" value="55613" />
- <option name="TRANSPORT" value="0" />
- <option name="LOCAL" value="true" />
- </RunnerSettings>
- <RunnerSettings RunnerId="Run" />
- <ConfigurationWrapper RunnerId="Debug" />
- <ConfigurationWrapper RunnerId="Run" />
- <method>
- <option name="Make" value="true" />
- </method>
- </tempConfiguration>
- <configuration default="true" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
- <module name="" />
- <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
- <option name="ALTERNATIVE_JRE_PATH" />
- <option name="PACKAGE_NAME" />
- <option name="MAIN_CLASS_NAME" />
- <option name="METHOD_NAME" />
- <option name="TEST_OBJECT" value="class" />
- <option name="VM_PARAMETERS" />
- <option name="PARAMETERS" />
- <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
- <option name="ADDITIONAL_CLASS_PATH" />
- <option name="TEST_SEARCH_SCOPE">
- <value defaultName="wholeProject" />
- </option>
- <method>
- <option name="Make" value="true" />
- </method>
- </configuration>
- <configuration default="true" type="Remote" factoryName="Remote">
- <option name="USE_SOCKET_TRANSPORT" value="true" />
- <option name="SERVER_MODE" value="false" />
- <option name="SHMEM_ADDRESS" value="javadebug" />
- <option name="HOST" value="localhost" />
- <option name="PORT" value="5005" />
- </configuration>
- <configuration default="true" type="Application" factoryName="Application" enabled="false" merge="false">
- <option name="MAIN_CLASS_NAME" />
- <option name="VM_PARAMETERS" />
- <option name="PROGRAM_PARAMETERS" />
- <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
- <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
- <option name="ALTERNATIVE_JRE_PATH" />
- <option name="ENABLE_SWING_INSPECTOR" value="false" />
- <module name="" />
- <method>
- <option name="Make" value="true" />
- </method>
- </configuration>
- <configuration default="true" type="Applet" factoryName="Applet">
- <module name="" />
- <option name="MAIN_CLASS_NAME" />
- <option name="HTML_FILE_NAME" />
- <option name="HTML_USED" value="false" />
- <option name="WIDTH" value="400" />
- <option name="HEIGHT" value="300" />
- <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
- <option name="VM_PARAMETERS" />
- <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
- <option name="ALTERNATIVE_JRE_PATH" />
- </configuration>
- <configuration name="<template>" type="WebApp" default="true" selected="false">
- <Host>localhost</Host>
- <Port>5050</Port>
- </configuration>
- </component>
- <component name="ScopeViewComponent">
- <subPane subId="Project">
- <PATH>
- <PATH_ELEMENT USER_OBJECT="Root">
- <option name="myItemId" value="" />
- <option name="myItemType" value="" />
- </PATH_ELEMENT>
- </PATH>
- </subPane>
- </component>
- <component name="SelectInManager" />
- <component name="StarteamConfiguration">
- <option name="SERVER" value="" />
- <option name="PORT" value="49201" />
- <option name="USER" value="" />
- <option name="PASSWORD" value="" />
- <option name="PROJECT" value="" />
- <option name="VIEW" value="" />
- <option name="ALTERNATIVE_WORKING_PATH" value="" />
- <option name="LOCK_ON_CHECKOUT" value="false" />
- <option name="UNLOCK_ON_CHECKIN" value="false" />
- </component>
- <component name="StructuralSearchPlugin" />
- <component name="StructureViewFactory">
- <option name="AUTOSCROLL_MODE" value="true" />
- <option name="AUTOSCROLL_FROM_SOURCE" value="false" />
- <option name="ACTIVE_ACTIONS" value="" />
- </component>
- <component name="Struts Assistant">
- <option name="showInputs" value="true" />
- <option name="resources">
- <value>
- <option name="strutsPath" />
- <option name="strutsHelp" />
- </value>
- </option>
- <option name="selectedTaglibs" />
- <option name="selectedTaglibs" />
- <option name="myStrutsValidationEnabled" value="true" />
- <option name="myTilesValidationEnabled" value="true" />
- <option name="myValidatorValidationEnabled" value="true" />
- <option name="myReportErrorsAsWarnings" value="true" />
- </component>
- <component name="SvnChangesBrowserSettings">
- <option name="USE_AUTHOR_FIELD" value="true" />
- <option name="AUTHOR" value="" />
- <option name="LOCATION" value="" />
- <option name="USE_PROJECT_SETTINGS" value="true" />
- <option name="USE_ALTERNATE_LOCATION" value="false" />
- </component>
- <component name="SvnConfiguration">
- <option name="USER" value="" />
- <option name="PASSWORD" value="" />
- <option name="PROCESS_UNRESOLVED" value="false" />
- <option name="LAST_MERGED_REVISION" />
- <option name="UPDATE_RUN_STATUS" value="false" />
- <option name="UPDATE_RECURSIVELY" value="true" />
- <option name="MERGE_DRY_RUN" value="false" />
- <configuration useDefault="true">/Users/hbraun/.subversion</configuration>
- </component>
- <component name="TodoView" selected-index="0">
- <todo-panel id="selected-file">
- <are-packages-shown value="false" />
- <are-modules-shown value="false" />
- <flatten-packages value="false" />
- <is-autoscroll-to-source value="true" />
- </todo-panel>
- <todo-panel id="all">
- <are-packages-shown value="true" />
- <are-modules-shown value="false" />
- <flatten-packages value="false" />
- <is-autoscroll-to-source value="true" />
- </todo-panel>
- </component>
- <component name="ToolWindowManager">
- <frame x="0" y="22" width="1278" height="774" extended-state="6" />
- <editor active="true" />
- <layout>
- <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
- <window_info id="CVS" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
- <window_info id="IDEtalk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
- <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="7" />
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24979658" order="0" />
- <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3293944" order="1" />
- <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24979658" order="1" />
- <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3293944" order="8" />
- <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" order="6" />
- <window_info id="Module Dependencies" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
- <window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
- <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
- <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="1" />
- <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3293944" order="8" />
- <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.58197933" order="2" />
- <window_info id="Maven" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
- <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="2" />
- <window_info id="File View" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
- <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3988183" order="4" />
- <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" order="0" />
- <window_info id="IDEtalk Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
- <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
- <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="0" />
- <window_info id="Web" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="2" />
- <window_info id="EJB" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="3" />
- <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="5" />
- </layout>
- </component>
- <component name="VCS.FileViewConfiguration">
- <option name="SELECTED_STATUSES" value="DEFAULT" />
- <option name="SELECTED_COLUMNS" value="DEFAULT" />
- <option name="SHOW_FILTERS" value="true" />
- <option name="CUSTOMIZE_VIEW" value="true" />
- <option name="SHOW_FILE_HISTORY_AS_TREE" value="true" />
- </component>
- <component name="VcsManagerConfiguration">
- <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
- <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
- <option name="PERFORM_UPDATE_IN_BACKGROUND" value="false" />
- <option name="PERFORM_COMMIT_IN_BACKGROUND" value="false" />
- <option name="PUT_FOCUS_INTO_COMMENT" value="false" />
- <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
- <option name="LAST_COMMIT_MESSAGE" />
- <option name="SAVE_LAST_COMMIT_MESSAGE" value="true" />
- <option name="CHECKIN_DIALOG_SPLITTER_PROPORTION" value="0.8" />
- <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
- <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
- <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
- <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
- <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
- <option name="ERROR_OCCURED" value="false" />
- <option name="ACTIVE_VCS_NAME" value="svn" />
- <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
- <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
- <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
- </component>
- <component name="VssConfiguration">
- <option name="CLIENT_PATH" value="" />
- <option name="SRCSAFEINI_PATH" value="" />
- <option name="USER_NAME" value="" />
- <option name="PWD" value="" />
- <option name="VSS_IS_INITIALIZED" value="true" />
- <CheckoutOptions>
- <option name="COMMENT" value="" />
- <option name="DO_NOT_GET_LATEST_VERSION" value="false" />
- <option name="REPLACE_WRITABLE" value="false" />
- <option name="RECURSIVE" value="false" />
- </CheckoutOptions>
- <CheckinOptions>
- <option name="COMMENT" value="" />
- <option name="KEEP_CHECKED_OUT" value="false" />
- <option name="RECURSIVE" value="false" />
- </CheckinOptions>
- <AddOptions>
- <option name="STORE_ONLY_LATEST_VERSION" value="false" />
- <option name="CHECK_OUT_IMMEDIATELY" value="false" />
- <option name="FILE_TYPE" value="0" />
- </AddOptions>
- <UndocheckoutOptions>
- <option name="MAKE_WRITABLE" value="false" />
- <option name="REPLACE_LOCAL_COPY" value="0" />
- <option name="RECURSIVE" value="false" />
- </UndocheckoutOptions>
- <GetOptions>
- <option name="REPLACE_WRITABLE" value="0" />
- <option name="MAKE_WRITABLE" value="false" />
- <option name="ANSWER_NEGATIVELY" value="false" />
- <option name="ANSWER_POSITIVELY" value="false" />
- <option name="RECURSIVE" value="false" />
- <option name="VERSION" />
- </GetOptions>
- <VssConfigurableExcludedFilesTag />
- </component>
- <component name="antWorkspaceConfiguration">
- <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
- <option name="FILTER_TARGETS" value="false" />
- </component>
- <component name="com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable" proportions="" version="1">
- <option name="myLastEditedConfigurable" />
- </component>
- <component name="com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectRootMasterDetailsConfigurable" proportions="0.19857594,0.5" version="1">
- <option name="myPlainMode" value="false" />
- <option name="myLastEditedConfigurable" value="parent" />
- </component>
- <component name="com.intellij.profile.ui.ErrorOptionsConfigurable" proportions="" version="1">
- <option name="myLastEditedConfigurable" />
- </component>
- <component name="editorHistoryManager">
- <entry file="jar:///Users/hbraun/dev/env/birt-runtime-2_3_1/ReportEngine/lib/coreapi.jar!/org/eclipse/birt/core/framework/IPlatformContext.class">
- <provider selected="true" editor-type-id="text-editor">
- <state line="5" column="17" selection-start="173" selection-end="173" vertical-scroll-proportion="0.102073364">
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="jar:///Users/hbraun/dev/env/birt-runtime-2_3_1/ReportEngine/lib/engineapi.jar!/org/eclipse/birt/report/engine/api/EngineConstants.class">
- <provider selected="true" editor-type-id="text-editor">
- <state line="5" column="13" selection-start="172" selection-end="172" vertical-scroll-proportion="0.104575165">
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="jar:///System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/src.jar!/src/java/io/FileInputStream.java">
- <provider selected="true" editor-type-id="text-editor">
- <state line="105" column="0" selection-start="4013" selection-end="4013" vertical-scroll-proportion="0.21052632">
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="jar:///Users/hbraun/dev/env/birt-runtime-2_2_2/ReportEngine/plugins/org.eclipse.birt.report.data.oda.jdbc_2.2.2.r22x_v20071206/oda-jdbc.jar!/org/eclipse/birt/report/data/oda/jdbc/OdaJdbcDriver.class">
- <provider selected="true" editor-type-id="text-editor">
- <state line="5" column="13" selection-start="175" selection-end="175" vertical-scroll-proportion="0.104575165">
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="jar:///Users/hbraun/dev/env/birt-runtime-2_2_2/ReportEngine/plugins/org.eclipse.birt.report.data.oda.jdbc_2.2.2.r22x_v20071206/oda-jdbc.jar!/org/eclipse/birt/report/data/oda/jdbc/Connection.class">
- <provider selected="true" editor-type-id="text-editor">
- <state line="11" column="10" selection-start="512" selection-end="512" vertical-scroll-proportion="0.026143791">
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/core/src/main/java/org/jboss/balalaika/RenderMetaData.java">
- <provider selected="true" editor-type-id="text-editor">
- <state line="33" column="0" selection-start="1275" selection-end="1275" vertical-scroll-proportion="0.33173844">
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/core/src/main/java/org/jboss/balalaika/ConfigAdapter.java">
- <provider selected="true" editor-type-id="text-editor">
- <state line="26" column="13" selection-start="1130" selection-end="1130" vertical-scroll-proportion="0.15686275">
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/pom.xml">
- <provider selected="true" editor-type-id="text-editor">
- <state line="24" column="27" selection-start="796" selection-end="796" vertical-scroll-proportion="0.627451">
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="jar:///Users/hbraun/dev/env/birt-runtime-2_2_2/ReportEngine/lib/engineapi.jar!/org/eclipse/birt/report/engine/api/IReportEngineFactory.class">
- <provider selected="true" editor-type-id="text-editor">
- <state line="5" column="17" selection-start="176" selection-end="176" vertical-scroll-proportion="0.104575165">
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/core/src/main/java/org/jboss/balalaika/BirtEngineFactory.java">
- <provider selected="true" editor-type-id="text-editor">
- <state line="42" column="22" selection-start="1688" selection-end="1688" vertical-scroll-proportion="0.54066986">
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/core/src/main/java/org/jboss/balalaika/BirtService.java">
- <provider selected="true" editor-type-id="text-editor">
- <state line="31" column="13" selection-start="1255" selection-end="1255" vertical-scroll-proportion="0.2875817">
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/core/pom.xml">
- <provider selected="true" editor-type-id="text-editor">
- <state line="5" column="29" selection-start="340" selection-end="354" vertical-scroll-proportion="0.13071896">
- <folding />
- </state>
- </provider>
- </entry>
- </component>
-</project>
-
17 years, 4 months
JBoss JBPM SVN: r3281 - projects.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-12-09 06:02:03 -0500 (Tue, 09 Dec 2008)
New Revision: 3281
Removed:
projects/balalaika/
Log:
Renamed project root
17 years, 4 months
JBoss JBPM SVN: r3280 - projects.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-12-09 06:00:42 -0500 (Tue, 09 Dec 2008)
New Revision: 3280
Added:
projects/report-server/
Log:
Rename balalaika to report-server
Copied: projects/report-server (from rev 3279, projects/balalaika)
17 years, 4 months
JBoss JBPM SVN: r3279 - in projects/balalaika/trunk: core and 1 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-12-09 06:00:00 -0500 (Tue, 09 Dec 2008)
New Revision: 3279
Modified:
projects/balalaika/trunk/core/pom.xml
projects/balalaika/trunk/pom.xml
projects/balalaika/trunk/server/pom.xml
Log:
Rename artifact to report-*
Modified: projects/balalaika/trunk/core/pom.xml
===================================================================
--- projects/balalaika/trunk/core/pom.xml 2008-12-09 09:39:37 UTC (rev 3278)
+++ projects/balalaika/trunk/core/pom.xml 2008-12-09 11:00:00 UTC (rev 3279)
@@ -1,16 +1,16 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <name>JBoss jBPM3 - Balalaika Core</name>
+ <name>JBoss jBPM3 - Report Core</name>
<groupId>org.jbpm</groupId>
- <artifactId>balalaika-core</artifactId>
+ <artifactId>report-core</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<!-- Parent -->
<parent>
<groupId>org.jbpm</groupId>
- <artifactId>balalaika-parent</artifactId>
+ <artifactId>report-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: projects/balalaika/trunk/pom.xml
===================================================================
--- projects/balalaika/trunk/pom.xml 2008-12-09 09:39:37 UTC (rev 3278)
+++ projects/balalaika/trunk/pom.xml 2008-12-09 11:00:00 UTC (rev 3279)
@@ -1,9 +1,9 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <name>JBoss jBPM3 - Balalaika</name>
+ <name>JBoss jBPM3 - Report (BIRT integration)</name>
<groupId>org.jbpm</groupId>
- <artifactId>balalaika-parent</artifactId>
+ <artifactId>report-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
Modified: projects/balalaika/trunk/server/pom.xml
===================================================================
--- projects/balalaika/trunk/server/pom.xml 2008-12-09 09:39:37 UTC (rev 3278)
+++ projects/balalaika/trunk/server/pom.xml 2008-12-09 11:00:00 UTC (rev 3279)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
- <name>JBoss jBPM3 - Balalaika Server</name>
+ <name>JBoss jBPM3 - Report Server</name>
<groupId>org.jbpm</groupId>
- <artifactId>balalaika-server</artifactId>
+ <artifactId>report-server</artifactId>
<packaging>war</packaging>
<!-- Parent -->
@@ -20,7 +20,7 @@
<dependency>
<groupId>org.jbpm</groupId>
- <artifactId>balalaika-core</artifactId>
+ <artifactId>report-core</artifactId>
<version>${version}</version>
</dependency>
<dependency>
@@ -41,6 +41,8 @@
<target>1.5</target>
</configuration>
</plugin>
- </plugins>
+ </plugins>
+
+ <finalName>report-server</finalName>
</build>
</project>
17 years, 4 months
JBoss JBPM SVN: r3278 - in projects/gwt-console/trunk/server: scripts and 1 other directory.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-12-09 04:39:37 -0500 (Tue, 09 Dec 2008)
New Revision: 3278
Added:
projects/gwt-console/trunk/server/scripts/
projects/gwt-console/trunk/server/scripts/assembly-config.xml
Modified:
projects/gwt-console/trunk/server/pom.xml
Log:
Assemble report.zip for distribution
Modified: projects/gwt-console/trunk/server/pom.xml
===================================================================
--- projects/gwt-console/trunk/server/pom.xml 2008-12-09 07:58:33 UTC (rev 3277)
+++ projects/gwt-console/trunk/server/pom.xml 2008-12-09 09:39:37 UTC (rev 3278)
@@ -52,7 +52,7 @@
<artifactId>bpm-spec-api</artifactId>
<version>${jboss.bpm.spec.version}</version>
<scope>provided</scope>
- </dependency>
+ </dependency>
<!-- GWT related -->
<dependency>
@@ -120,6 +120,26 @@
<target>1.5</target>
</configuration>
</plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <finalName>${project.build.finalName}</finalName>
+ <appendAssemblyId>true</appendAssemblyId>
+ <descriptors>
+ <descriptor>scripts/assembly-config.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
</plugins>
<finalName>gwt-console-server</finalName>
</build>
Added: projects/gwt-console/trunk/server/scripts/assembly-config.xml
===================================================================
--- projects/gwt-console/trunk/server/scripts/assembly-config.xml (rev 0)
+++ projects/gwt-console/trunk/server/scripts/assembly-config.xml 2008-12-09 09:39:37 UTC (rev 3278)
@@ -0,0 +1,17 @@
+<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+ <id>report</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>${project.build.outputDirectory}</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>*.rpt*</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</assembly>
\ No newline at end of file
17 years, 4 months
JBoss JBPM SVN: r3277 - in jbpm3/trunk/modules/core/src: test/java/org/jbpm/graph/def and 1 other directory.
by do-not-reply@jboss.org
Author: camunda
Date: 2008-12-09 02:58:33 -0500 (Tue, 09 Dec 2008)
New Revision: 3277
Added:
jbpm3/trunk/modules/core/src/test/java/org/jbpm/graph/def/ExceptionHandlerTest.java
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java
Log:
JBPM-1887: Fixed bug in ExceptionHandler causing infinite loop
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java 2008-12-08 23:03:08 UTC (rev 3276)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java 2008-12-09 07:58:33 UTC (rev 3277)
@@ -268,10 +268,22 @@
// log the action exception
actionLog.setException(exception);
-
- // if an exception handler is available
- raiseException(exception, executionContext);
-
+
+ // If an exception is already set we are in an action of an exception handler
+ // in this case don't give the exception to the handlers but throw it to the client
+ // see https://jira.jboss.org/jira/browse/JBPM-1887
+ if (executionContext.getException()==null) {
+ // if an exception handler is available
+ raiseException(exception, executionContext);
+ }
+ else {
+ // if there is no parent we need to throw an action exception to the client
+ if (exception instanceof JbpmException) {
+ throw (JbpmException) exception;
+ } else {
+ throw new DelegationException(exception, executionContext);
+ }
+ }
} finally {
executionContext.setAction(null);
token.endCompositeLog();
Added: jbpm3/trunk/modules/core/src/test/java/org/jbpm/graph/def/ExceptionHandlerTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/graph/def/ExceptionHandlerTest.java (rev 0)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/graph/def/ExceptionHandlerTest.java 2008-12-09 07:58:33 UTC (rev 3277)
@@ -0,0 +1,135 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @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.graph.def;
+
+import org.jbpm.AbstractJbpmTestCase;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ *
+ * @author bernd.ruecker(a)camunda.com
+ */
+public class ExceptionHandlerTest extends AbstractJbpmTestCase {
+
+ public static class NoExceptionAction implements ActionHandler {
+ public void execute(ExecutionContext executionContext) throws Exception {
+ }
+ }
+ public static class ThrowExceptionAction implements ActionHandler {
+ public void execute(ExecutionContext executionContext) throws Exception {
+ throw new Exception("exception in action handler");
+ }
+ }
+ public static class ThrowInnerExceptionAction implements ActionHandler {
+ public void execute(ExecutionContext executionContext) throws Exception {
+ throw new Exception("exception inside of exception handler");
+ }
+ }
+
+ public void testExceptionHandlerThrowingExcption() {
+
+ String xml =
+ "<?xml version='1.0' encoding='UTF-8'?>"
+ +"<process-definition name='TestException'>"
+ +" <start-state name='start'>"
+ +" <transition name='to_state' to='first'>"
+ +" <action class='org.jbpm.graph.def.ExceptionHandlerTest$ThrowExceptionAction' />"
+ +" </transition>"
+ +" </start-state> "
+ +" <state name='first'>"
+ +" <transition to='end' />"
+ +" </state> "
+ +" <end-state name='end' />"
+ +" <exception-handler>"
+ +" <action class='org.jbpm.graph.def.ExceptionHandlerTest$ThrowInnerExceptionAction' />"
+ +" </exception-handler>"
+ +"</process-definition>";
+
+ ProcessDefinition def = ProcessDefinition.parseXmlString(xml);
+ ProcessInstance pi = def.createProcessInstance();
+
+ try {
+ pi.getRootToken().signal();
+ }
+ catch (DelegationException ex) {
+ ex.printStackTrace();
+ // check that exception is thrown to the client nested in a DelegationException
+ assertEquals("exception inside of exception handler", ex.getCause().getMessage());
+ }
+ }
+
+ public void testMissingExceptionHandlerClass() {
+ String xml =
+ "<?xml version='1.0' encoding='UTF-8'?>"
+ +"<process-definition name='TestException'>"
+ +" <start-state name='start'>"
+ +" <transition name='to_state' to='first'>"
+ +" <action class='org.jbpm.graph.def.ExceptionHandlerTest$ThrowExceptionAction' />"
+ +" </transition>"
+ +" </start-state> "
+ +" <state name='first'>"
+ +" <transition to='end' />"
+ +" </state> "
+ +" <end-state name='end' />"
+ +" <exception-handler>"
+ +" <action class='org.jbpm.graph.def.ExceptionHandlerTest$DOESNTEXIST' />"
+ +" </exception-handler>"
+ +"</process-definition>";
+
+ ProcessDefinition def = ProcessDefinition.parseXmlString(xml);
+ ProcessInstance pi = def.createProcessInstance();
+
+ try {
+ pi.getRootToken().signal();
+ }
+ catch (DelegationException ex) {
+ // check that exception is thrown to the client nested in a DelegationException
+ assertEquals(NullPointerException.class, ex.getCause().getClass());
+ }
+ }
+
+ public void testNoException() {
+ String xml =
+ "<?xml version='1.0' encoding='UTF-8'?>"
+ +"<process-definition name='TestException'>"
+ +" <start-state name='start'>"
+ +" <transition name='to_state' to='first'>"
+ +" <action class='org.jbpm.graph.def.ExceptionHandlerTest$ThrowExceptionAction' />"
+ +" </transition>"
+ +" </start-state> "
+ +" <state name='first'>"
+ +" <transition to='end' />"
+ +" </state> "
+ +" <end-state name='end' />"
+ +" <exception-handler>"
+ +" <action class='org.jbpm.graph.def.ExceptionHandlerTest$NoExceptionAction' />"
+ +" </exception-handler>"
+ +"</process-definition>";
+
+ ProcessDefinition def = ProcessDefinition.parseXmlString(xml);
+ ProcessInstance pi = def.createProcessInstance();
+ pi.getRootToken().signal();
+
+ // exception is handled correctly
+ }
+}
17 years, 4 months
JBoss JBPM SVN: r3276 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/task and 6 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-12-08 18:03:08 -0500 (Mon, 08 Dec 2008)
New Revision: 3276
Added:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskBuilder.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTaskBuilder.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskBuilderImpl.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Task.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/hibernate/HibernateTaskDbSession.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskImpl.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskServiceImpl.java
jbpm4/trunk/modules/task/src/main/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskServiceTest.java
jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskTest.java
Log:
JBPM-1858 new task without parameters, identifier generated upon save
fluent interface for building tasks
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java 2008-12-08 22:35:29 UTC (rev 3275)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java 2008-12-08 23:03:08 UTC (rev 3276)
@@ -25,6 +25,7 @@
import org.jbpm.task.Role;
import org.jbpm.task.Task;
+import org.jbpm.task.TaskBuilder;
/**
* Human task management facility.
@@ -32,8 +33,14 @@
*/
public interface TaskService {
- /** Creates a not-yet-persisted task with the given identifier.
+ /** Creates a task.
+ * The returned task will be transient.
* Use {@link #saveTask(Task)} to persist the task. */
+ Task newTask();
+
+ /** Creates a task with the given identifier.
+ * The returned task will be transient.
+ * Use {@link #saveTask(Task)} to persist the task. */
Task newTask(String taskId);
/** Saves the given task to persistent storage. */
@@ -51,6 +58,15 @@
/** Removes the task with the given identifier from persistent storage. */
void deleteTask(String taskId);
+ /** Provides a fluent interface for task configuration. The usage model is:
+ * <pre>Task task = taskService.buildTask()
+ * .name("expenses")
+ * .dueDate(asap)
+ * .assignedUserId(me)
+ * .priority(HIGH)
+ * .done();</pre> */
+ TaskBuilder buildTask();
+
List<String> getCandidates(String taskId);
List<Role> getRoles(String taskId);
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Task.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Task.java 2008-12-08 22:35:29 UTC (rev 3275)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Task.java 2008-12-08 23:03:08 UTC (rev 3276)
@@ -50,24 +50,23 @@
* reassigned. */
String ROLETYPE_REPLACED_ASSIGNEE = "replaced-assignee";
-
String getId();
String getName();
void setName(String name);
- String getAssignedUserId();
- void setAssignedUserId(String assignedUserId);
-
String getDescription();
void setDescription(String description);
+ String getAssignedUserId();
+ void setAssignedUserId(String assignedUserId);
+
Date getCreate();
- int getPriority();
- void setPriority(int priority);
-
Date getDueDate();
void setDueDate(Date dueDate);
+ int getPriority();
+ void setPriority(int priority);
+
}
\ No newline at end of file
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskBuilder.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskBuilder.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskBuilder.java 2008-12-08 23:03:08 UTC (rev 3276)
@@ -0,0 +1,28 @@
+package org.jbpm.task;
+
+import java.util.Date;
+
+import org.jbpm.TaskService;
+
+/**
+ * Task builders are useful to create and configure human tasks through
+ * a fluent interface. Refer to {@link TaskService#buildTask()} for the
+ * usage model.
+ * @author Alejandro Guizar
+ */
+public interface TaskBuilder {
+
+ TaskBuilder id(String id);
+
+ TaskBuilder name(String name);
+
+ TaskBuilder description(String description);
+
+ TaskBuilder assignedUserId(String assignedUserId);
+
+ TaskBuilder priority(int priority);
+
+ TaskBuilder dueDate(Date dueDate);
+
+ Task done();
+}
\ No newline at end of file
Added: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTaskBuilder.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTaskBuilder.java (rev 0)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTaskBuilder.java 2008-12-08 23:03:08 UTC (rev 3276)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @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.task.internal.cmd;
+
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.task.TaskBuilder;
+import org.jbpm.task.internal.model.TaskBuilderImpl;
+import org.jbpm.task.internal.model.TaskImpl;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class CreateTaskBuilder implements Command<TaskBuilder> {
+
+ private static final long serialVersionUID = 1L;
+
+ public TaskBuilder execute(Environment environment) throws Exception {
+ return new TaskBuilderImpl(TaskImpl.create());
+ }
+
+}
Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/hibernate/HibernateTaskDbSession.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/hibernate/HibernateTaskDbSession.java 2008-12-08 22:35:29 UTC (rev 3275)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/hibernate/HibernateTaskDbSession.java 2008-12-08 23:03:08 UTC (rev 3276)
@@ -21,6 +21,8 @@
*/
package org.jbpm.task.internal.hibernate;
+import java.io.Serializable;
+
import org.hibernate.criterion.Restrictions;
import org.jbpm.pvm.internal.hibernate.HibernateDbSession;
import org.jbpm.task.Task;
@@ -40,6 +42,12 @@
}
public void saveTask(Task task) {
- session.saveOrUpdate(task);
+ if (task.getId() == null) {
+ Serializable dbid = session.save(task);
+ ((TaskImpl) task).setId(dbid.toString());
+ }
+ else {
+ session.saveOrUpdate(task);
+ }
}
}
Added: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskBuilderImpl.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskBuilderImpl.java (rev 0)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskBuilderImpl.java 2008-12-08 23:03:08 UTC (rev 3276)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @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.task.internal.model;
+
+import java.util.Date;
+
+import org.jbpm.task.Task;
+import org.jbpm.task.TaskBuilder;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class TaskBuilderImpl implements TaskBuilder {
+
+ private final TaskImpl task;
+
+ public TaskBuilderImpl(TaskImpl task) {
+ this.task = task;
+ }
+
+ public TaskBuilder id(String id) {
+ task.setId(id);
+ return this;
+ }
+
+ public TaskBuilder name(String name) {
+ task.setName(name);
+ return this;
+ }
+
+ public TaskBuilder description(String description) {
+ task.setDescription(description);
+ return this;
+ }
+
+ public TaskBuilder assignedUserId(String assignedUserId) {
+ task.setAssignedUserId(assignedUserId);
+ return this;
+ }
+
+ public TaskBuilder priority(int priority) {
+ task.setPriority(priority);
+ return this;
+ }
+
+ public TaskBuilder dueDate(Date dueDate) {
+ task.setDueDate(dueDate);
+ return this;
+ }
+
+ public Task done() {
+ return task;
+ }
+}
Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskImpl.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskImpl.java 2008-12-08 22:35:29 UTC (rev 3275)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskImpl.java 2008-12-08 23:03:08 UTC (rev 3276)
@@ -67,7 +67,7 @@
protected String name;
protected String description;
- protected String assignee;
+ protected String assignedUserId;
protected Set<RoleImpl> roles;
protected Date create;
@@ -95,7 +95,11 @@
}
// creating a task
-
+
+ public static TaskImpl create() {
+ return create(null, null, null);
+ }
+
public static TaskImpl create(String taskId) {
return create(taskId, null, null);
}
@@ -106,21 +110,22 @@
public static TaskImpl create(String taskId, TaskDefinitionImpl taskDefinition, ExecutionImpl execution) {
TaskImpl task = null;
+
// if a task class name is configured
Environment environment = Environment.getCurrent();
- String taskClassName = (environment!=null ? (String) environment.get(TaskImpl.CONTEXTKEY_TASK_CLASS_NAME, TaskImpl.SEARCHORDER_TASK_CLASS_NAME) : null);
+ String taskClassName = environment!=null ? (String) environment.get(TaskImpl.CONTEXTKEY_TASK_CLASS_NAME, TaskImpl.SEARCHORDER_TASK_CLASS_NAME) : null;
if (taskClassName!=null) {
// dynamically instantiate it
ClassLoader classLoader = environment.getClassLoader();
Class<?> taskClass = ReflectUtil.loadClass(classLoader, taskClassName);
task = (TaskImpl) ReflectUtil.newInstance(taskClass);
-
+ }
// otherwise just use the default task implementation type
- } else {
+ else {
task = new TaskImpl();
}
- task.create = Clock.getCurrentTime();
+ task.setCreate(Clock.getCurrentTime());
task.setId(taskId);
task.setTaskDefinition(taskDefinition);
@@ -153,22 +158,11 @@
return null;
}
- // assigning a task /////////////////////////////////////////////////////////
-
- public String getAssignee() {
- return assignee;
- }
-
- public void setAssignee(String assignee) {
- this.assignee = assignee;
- // TODO fire the assignment event
- }
-
// roles ////////////////////////////////////////////////////////////////////
public Set<RoleImpl> getRoles() {
if (roles==null) {
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
return roles;
}
@@ -228,7 +222,7 @@
public List<Comment> getComments() {
if (comments==null) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
return (List) comments;
}
@@ -326,95 +320,107 @@
// getters and setters //////////////////////////////////////////////////////
- public String getDescription() {
- return description;
+ public long getDbid() {
+ return dbid;
}
- public void setDescription(String description) {
- this.description = description;
+
+ public String getId() {
+ return id;
}
+ public void setId(String id) {
+ this.id = id;
+ }
+
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
+
+ public String getDescription() {
+ return description;
+ }
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
public boolean isBlocking() {
return isBlocking;
}
public void setBlocking(boolean isBlocking) {
this.isBlocking = isBlocking;
}
+
public boolean isSignalling() {
return isSignalling;
}
public void setSignalling(boolean isSignalling) {
this.isSignalling = isSignalling;
}
+
public int getPriority() {
return priority;
}
public void setPriority(int priority) {
this.priority = priority;
}
+
public void setComments(List<CommentImpl> comments) {
this.comments = comments;
}
+
public Date getCreate() {
return create;
}
public void setCreate(Date create) {
this.create = create;
}
+
public Date getDueDate() {
return dueDate;
}
public void setDueDate(Date dueDate) {
this.dueDate = dueDate;
}
+
public ExecutionImpl getExecution() {
return execution;
}
public void setExecution(Execution execution) {
this.execution = (ExecutionImpl) execution;
}
+
public String getState() {
return state;
}
+
+ public String getAssignedUserId() {
+ return assignedUserId;
+ }
+ public void setAssignedUserId(String assignedUserId) {
+ this.assignedUserId = assignedUserId;
+ }
+
public Swimlane getSwimlane() {
return swimlane;
}
public void setSwimlane(SwimlaneImpl swimlane) {
this.swimlane = swimlane;
}
- public long getDbid() {
- return dbid;
- }
+
public TaskDefinition getTaskDefinition() {
return taskDefinition;
}
+
public TaskImpl getSuperTask() {
return superTask;
}
public void setSuperTask(TaskImpl superTask) {
this.superTask = superTask;
}
+
public Integer getProgress() {
return progress;
}
- public String getId() {
- return id;
- }
- public void setId(String id) {
- this.id = id;
- }
-
- public String getAssignedUserId() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void setAssignedUserId(String assignedUserId) {
- // TODO Auto-generated method stub
-
- }
}
Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskServiceImpl.java 2008-12-08 22:35:29 UTC (rev 3275)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskServiceImpl.java 2008-12-08 23:03:08 UTC (rev 3276)
@@ -27,7 +27,9 @@
import org.jbpm.cmd.CommandService;
import org.jbpm.task.Role;
import org.jbpm.task.Task;
+import org.jbpm.task.TaskBuilder;
import org.jbpm.task.internal.cmd.CreateTask;
+import org.jbpm.task.internal.cmd.CreateTaskBuilder;
import org.jbpm.task.internal.cmd.DeleteTask;
import org.jbpm.task.internal.cmd.GetTask;
import org.jbpm.task.internal.cmd.SaveTask;
@@ -54,7 +56,11 @@
this.commandService = commandService;
}
- public Task newTask(String taskId) {
+ public Task newTask() {
+ return newTask(null);
+ }
+
+ public Task newTask(String taskId) {
return commandService.execute(new CreateTask(taskId));
}
@@ -74,7 +80,11 @@
commandService.execute(new DeleteTask(taskId));
}
- public List<String> getCandidates(String taskId) {
+ public TaskBuilder buildTask() {
+ return commandService.execute(new CreateTaskBuilder());
+ }
+
+ public List<String> getCandidates(String taskId) {
// TODO Auto-generated method stub
return null;
}
Modified: jbpm4/trunk/modules/task/src/main/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/task/src/main/resources/jbpm.task.hbm.xml 2008-12-08 22:35:29 UTC (rev 3275)
+++ jbpm4/trunk/modules/task/src/main/resources/jbpm.task.hbm.xml 2008-12-08 23:03:08 UTC (rev 3276)
@@ -55,7 +55,7 @@
<property name="id" column="ID_" unique="true" />
<property name="name" column="NAME_"/>
<property name="description" column="DESCR_"/>
- <property name="assignee" column="ASSIGNEE_"/>
+ <property name="assignedUserId" column="ASSIGNEE_"/>
<set name="roles" cascade="all-delete-orphan">
<key column="TASK_" foreign-key="FK_ROLE_TASK" />
Modified: jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskServiceTest.java
===================================================================
--- jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskServiceTest.java 2008-12-08 22:35:29 UTC (rev 3275)
+++ jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskServiceTest.java 2008-12-08 23:03:08 UTC (rev 3276)
@@ -23,6 +23,7 @@
import java.util.Date;
+import org.jbpm.pvm.internal.util.Priority;
import org.jbpm.test.DbTestCase;
/**
@@ -39,13 +40,22 @@
assertNull("expected null, but was " + task, task);
}
+ public void testGenerateTaskId() {
+ Task task = taskService.newTask();
+ String taskId = task.getId();
+ assertNull("expected null, but was " + taskId, taskId);
+ // save task to generate identifier
+ saveTask(task);
+ assertNotNull("expected non-null task id", task.getId());
+ }
+
public void testSaveTask() {
String taskId = getName();
Task task = taskService.newTask(taskId);
saveTask(task);
// task was made persistent
task = taskService.getTask(taskId);
- assertNotNull("expected task '" + taskId + "', but was null", task);
+ assertNotNull("expected non-null task", task);
// make some change
Date dueDate = new Date();
task.setDueDate(dueDate);
@@ -63,8 +73,7 @@
// create task and verify it exists
task = taskService.newTask(taskId);
saveTask(task);
- assertNotNull("expected task '" + taskId + "', but was null",
- taskService.getTask(taskId));
+ assertNotNull("expected non-null task", taskService.getTask(taskId));
}
public void testDeleteTask() {
@@ -72,11 +81,25 @@
Task task = taskService.newTask(taskId);
taskService.saveTask(task);
// task was made persistent
- assertNotNull("expected task '" + taskId + "', but was null",
- taskService.getTask(taskId));
+ assertNotNull("expected non-null task", taskService.getTask(taskId));
// delete task and verify it does not exist
taskService.deleteTask(taskId);
task = taskService.getTask(taskId);
assertNull("expected null, but was " + task, task);
}
+
+ public void testBuildTask() {
+ Date asap = new Date();
+ String me = System.getProperty("user.name");
+ Task task = taskService.buildTask()
+ .name("expenses")
+ .dueDate(asap)
+ .assignedUserId(me)
+ .priority(Priority.HIGH)
+ .done();
+ assertEquals("expenses", task.getName());
+ assertEquals(asap, task.getDueDate());
+ assertEquals(me, task.getAssignedUserId());
+ assertEquals(Priority.HIGH, task.getPriority());
+ }
}
Modified: jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskTest.java
===================================================================
--- jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskTest.java 2008-12-08 22:35:29 UTC (rev 3275)
+++ jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskTest.java 2008-12-08 23:03:08 UTC (rev 3276)
@@ -64,16 +64,16 @@
public void testTaskAssignment() {
TaskImpl task = TaskImpl.create(getName());
- task.setAssignee("john doe");
- assertEquals("john doe", task.getAssignee());
+ task.setAssignedUserId("john doe");
+ assertEquals("john doe", task.getAssignedUserId());
}
public void testTaskReassignmentAssignment() {
TaskImpl task = TaskImpl.create(getName());
- task.setAssignee("johndoe");
- assertEquals("johndoe", task.getAssignee());
- task.setAssignee("joesmoe");
- assertEquals("joesmoe", task.getAssignee());
+ task.setAssignedUserId("johndoe");
+ assertEquals("johndoe", task.getAssignedUserId());
+ task.setAssignedUserId("joesmoe");
+ assertEquals("joesmoe", task.getAssignedUserId());
}
public void testTaskRoles() {
17 years, 4 months
JBoss JBPM SVN: r3275 - in jbpm4/trunk/modules: jpdl/src/main/resources and 11 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-08 17:35:29 -0500 (Mon, 08 Dec 2008)
New Revision: 3275
Added:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/Activities.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ActivitiesParser.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartNodes.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ByteArrayStreamInput.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/FileStreamInput.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/InputStreamInput.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ResourceStreamInput.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/StreamInput.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/StringStreamInput.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/UrlStreamInput.java
Removed:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ActivityParser.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartEvents.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ByteArrayStreamSource.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/FileStreamSource.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/InputStreamSource.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ResourceStreamSource.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/StreamSource.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/StringStreamSource.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/UrlStreamSource.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/WireParserTest.java
Modified:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ExclusiveBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlActivityBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartBinding.java
jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/xml/JpdlXmlTest.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/cfg/JbpmConfiguration.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/PvmEnvironmentFactoryParser.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DeploymentImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AbstractCollectionBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AssignFileTypesBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/BusinessCalendarBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/DeployerManagerBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HibernateConfigurationBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HibernateSessionFactoryBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MapBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ObjectBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/PropertiesBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/StandardCommandServiceBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/VariableTypesBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/WireBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/BindingParser.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycleParser.java
Log:
xml validation
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/Activities.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/Activities.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/Activities.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @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.jpdl.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.pvm.internal.xml.Bindings;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class Activities {
+
+ List<String> schemaResources = new ArrayList<String>();
+ Bindings bindings = new Bindings();
+
+}
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ActivitiesParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ActivitiesParser.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ActivitiesParser.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @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.jpdl.xml;
+
+import org.jbpm.log.Log;
+import org.jbpm.pvm.internal.util.ReflectUtil;
+import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.xml.Binding;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Element;
+
+/**
+ * @author Tom Baeyens
+ */
+public class ActivitiesParser extends Parser {
+
+ private static final Log log = Log.getLog(ActivitiesParser.class.getName());
+
+ public Object parseDocumentElement(Element documentElement, Parse parse) {
+ Activities activities = parse.findObject(Activities.class);
+ if (activities==null) {
+ activities = new Activities();
+ }
+ parse.setDocumentObject(activities);
+
+ for (Element bindingElement : XmlUtil.elements(documentElement, "activity")) {
+ Binding binding = instantiateBinding(bindingElement, parse);
+ activities.bindings.addBinding(binding);
+ }
+
+ for (Element schemaElement : XmlUtil.elements(documentElement, "schema")) {
+ String schemaResource = XmlUtil.attribute(schemaElement, "resource", true, parse);
+ activities.schemaResources.add(schemaResource);
+ }
+
+ return activities;
+ }
+
+ protected Binding instantiateBinding(Element bindingElement, Parse parse) {
+ String bindingClassName = XmlUtil.attribute(bindingElement, "binding", true, parse);
+
+ log.trace("adding activity binding "+bindingClassName);
+
+ if (bindingClassName!=null) {
+ try {
+ Class<?> bindingClass = ReflectUtil.loadClass(classLoader, bindingClassName);
+ return (Binding) bindingClass.newInstance();
+ } catch (Exception e) {
+ parse.addProblem("couldn't instantiate activity binding "+bindingClassName, e);
+ }
+ }
+ return null;
+ }
+}
Deleted: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ActivityParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ActivityParser.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ActivityParser.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @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.jpdl.xml;
-
-import java.util.List;
-
-import org.jbpm.log.Log;
-import org.jbpm.pvm.internal.util.ReflectUtil;
-import org.jbpm.pvm.internal.util.XmlUtil;
-import org.jbpm.pvm.internal.xml.Binding;
-import org.jbpm.pvm.internal.xml.Bindings;
-import org.jbpm.pvm.internal.xml.Parse;
-import org.jbpm.pvm.internal.xml.Parser;
-import org.w3c.dom.Element;
-
-/**
- * @author Tom Baeyens
- */
-public class ActivityParser extends Parser {
-
- private static final Log log = Log.getLog(ActivityParser.class.getName());
-
- public Object parseDocumentElement(Element documentElement, Parse parse) {
- List<Element> elements = XmlUtil.elements(documentElement, "activity");
- if (elements!=null) {
- for (Element bindingElement : elements) {
- String bindingClassName = XmlUtil.attribute(bindingElement, "binding", true, parse);
-
- log.trace("adding activity binding "+bindingClassName);
-
- Binding binding = null;
- if (bindingClassName!=null) {
- try {
- Class<?> bindingClass = ReflectUtil.loadClass(classLoader, bindingClassName);
- binding = (Binding) bindingClass.newInstance();
- } catch (Exception e) {
- parse.addProblem("couldn't instantiate activity binding "+bindingClassName, e);
- }
- }
-
- if (binding!=null) {
- Bindings bindings = parse.findObject(Bindings.class);
- bindings.addBinding(binding);
- }
- }
- }
-
- return null;
- }
-}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ExclusiveBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ExclusiveBinding.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ExclusiveBinding.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -74,36 +74,34 @@
boolean hasConditions = false;
List<Element> transitionElements = XmlUtil.elements(element, "transition");
- if (transitionElements!=null) {
- NodeImpl node = parse.findObject(NodeImpl.class);
- List<TransitionImpl> transitions = (List) node.getOutgoingTransitions();
-
- for (int i=0; i<transitionElements.size(); i++) {
- TransitionImpl transition = transitions.get(i);
- Element transitionElement = transitionElements.get(i);
+ NodeImpl node = parse.findObject(NodeImpl.class);
+ List<TransitionImpl> transitions = (List) node.getOutgoingTransitions();
+
+ for (int i=0; i<transitionElements.size(); i++) {
+ TransitionImpl transition = transitions.get(i);
+ Element transitionElement = transitionElements.get(i);
- Element conditionElement = XmlUtil.element(transitionElement, "condition");
- if (conditionElement!=null) {
- hasConditions = true;
- }
+ Element conditionElement = XmlUtil.element(transitionElement, "condition");
+ if (conditionElement!=null) {
+ hasConditions = true;
+ }
+
+ if (conditionElement.hasAttribute("expr")) {
+ String expr = conditionElement.getAttribute("expr");
+ ExpressionDescriptor expressionDescriptor = new ExpressionDescriptor(expr);
+ transition.setConditionDescriptor(expressionDescriptor);
- if (conditionElement.hasAttribute("expr")) {
- String expr = conditionElement.getAttribute("expr");
- ExpressionDescriptor expressionDescriptor = new ExpressionDescriptor(expr);
- transition.setConditionDescriptor(expressionDescriptor);
-
- } else if (conditionElement.hasAttribute("ref")) {
- String expr = conditionElement.getAttribute("ref");
- ReferenceDescriptor refDescriptor = new ReferenceDescriptor(expr);
- transition.setConditionDescriptor(refDescriptor);
-
- } else if (ObjectBinding.isObjectDescriptor(conditionElement)) {
- ObjectDescriptor conditionDescriptor = (ObjectDescriptor) objectBinding.parse(conditionElement, parse, parser);
- transition.setConditionDescriptor(conditionDescriptor);
+ } else if (conditionElement.hasAttribute("ref")) {
+ String expr = conditionElement.getAttribute("ref");
+ ReferenceDescriptor refDescriptor = new ReferenceDescriptor(expr);
+ transition.setConditionDescriptor(refDescriptor);
+
+ } else if (ObjectBinding.isObjectDescriptor(conditionElement)) {
+ ObjectDescriptor conditionDescriptor = (ObjectDescriptor) objectBinding.parse(conditionElement, parse, parser);
+ transition.setConditionDescriptor(conditionDescriptor);
- } else {
- parse.addProblem("decision must have one of {expr attribute, handler-ref attribute, handler element or transition conditions}: "+XmlUtil.toString(element));
- }
+ } else {
+ parse.addProblem("decision must have one of {expr attribute, handler-ref attribute, handler element or transition conditions}: "+XmlUtil.toString(element));
}
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlActivityBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlActivityBinding.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlActivityBinding.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -38,7 +38,7 @@
public abstract class JpdlActivityBinding extends TagBinding {
public JpdlActivityBinding(String tagName) {
- super(tagName, "http://jbpm.org/jpdl4", "activity");
+ super(tagName, "http://jbpm.org/4/jpdl", "activity");
}
public void parseName(Element element, NodeImpl node, Parse parse) {
@@ -61,13 +61,11 @@
public void parseFlows(Element element, NodeImpl node, Parse parse) {
List<Element> transitionElements = XmlUtil.elements(element, "flow");
- if (transitionElements!=null) {
- UnresolvedTransitions unresolvedTransitions = parse.findObject(UnresolvedTransitions.class);
- for (Element transitionElement: transitionElements) {
- String transitionName = XmlUtil.attribute(transitionElement, "name", false, parse);
- TransitionImpl transition = node.createOutgoingTransition(transitionName);
- unresolvedTransitions.add(transition, transitionElement);
- }
+ UnresolvedTransitions unresolvedTransitions = parse.findObject(UnresolvedTransitions.class);
+ for (Element transitionElement: transitionElements) {
+ String transitionName = XmlUtil.attribute(transitionElement, "name", false, parse);
+ TransitionImpl transition = node.createOutgoingTransition(transitionName);
+ unresolvedTransitions.add(transition, transitionElement);
}
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -33,9 +33,7 @@
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.internal.model.TransitionImpl;
import org.jbpm.pvm.internal.util.ReflectUtil;
-import org.jbpm.pvm.internal.util.UrlEntity;
import org.jbpm.pvm.internal.util.XmlUtil;
-import org.jbpm.pvm.internal.xml.Bindings;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.w3c.dom.Element;
@@ -52,24 +50,46 @@
"jbpm.user.activities.xml"
};
-
- private static Bindings defaultBindings; // initialized at the bottom of this file
-
+ static ActivitiesParser activityParser = new ActivitiesParser();
+
public JpdlParser() {
- super(defaultBindings);
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- this.addEntity("http://jbpm.org/jpdl4", new UrlEntity("jpdl.xsd", classLoader));
+ Activities activitiesConfiguration = parseActivitiesConfiguration();
+ setBindings(activitiesConfiguration.bindings);
+ // setSchemaResources(activitiesConfiguration.schemaResources);
}
-
+ protected Activities parseActivitiesConfiguration() {
+ Activities activities = new Activities();
+
+ for (String activityResource: DEFAULT_ACTIVITIES_RESOURCES) {
+ Enumeration<URL> resourceUrls = ReflectUtil.getResources(null, activityResource);
+ if (resourceUrls.hasMoreElements()) {
+ while (resourceUrls.hasMoreElements()) {
+ URL resourceUrl = resourceUrls.nextElement();
+ log.trace("loading jpdl activities from resource: "+resourceUrl);
+ activityParser.createParse()
+ .setUrl(resourceUrl)
+ .pushObject(activities)
+ .execute()
+ .checkProblems("jpdl activities from "+resourceUrl.toString());
+ }
+ } else {
+ log.trace("skipping unavailable jpdl activities resource: "+activityResource);
+ }
+ }
+
+ return activities;
+ }
+
+
public Object parseDocumentElement(Element documentElement, Parse parse) {
ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) parse.getDocumentObject();
if (processDefinition==null) {
processDefinition = new JpdlProcessDefinition();
}
- StartEvents startEvents = new StartEvents();
- parse.pushObject(startEvents);
+ StartNodes startNodes = new StartNodes();
+ parse.pushObject(startNodes);
try {
String name = XmlUtil.attribute(documentElement, "name", true, parse);
processDefinition.setName(name);
@@ -97,21 +117,21 @@
parse.pushObject(unresolvedTransitions);
List<Element> elements = XmlUtil.elements(documentElement);
- if (elements!=null) {
- for (Element element: elements) {
- JpdlActivityBinding activityBinding = (JpdlActivityBinding) getBinding(element, "activity");
- if (activityBinding!=null) {
- NodeImpl node = (NodeImpl) processDefinition.createNode();
- parse.pushObject(node);
- try {
- activityBinding.parseName(element, node, parse);
- activityBinding.parseFlows(element, node, parse);
- Activity activity = (Activity) activityBinding.parse(element, parse, this);
- node.setBehaviour(activity);
- } finally {
- parse.popObject();
- }
+ for (Element element: elements) {
+ JpdlActivityBinding activityBinding = (JpdlActivityBinding) getBinding(element, "activity");
+ if (activityBinding!=null) {
+ NodeImpl node = (NodeImpl) processDefinition.createNode();
+ parse.pushObject(node);
+ try {
+ activityBinding.parseName(element, node, parse);
+ activityBinding.parseFlows(element, node, parse);
+ Activity activity = (Activity) activityBinding.parse(element, parse, this);
+ node.setBehaviour(activity);
+ } finally {
+ parse.popObject();
}
+ } else {
+ log.debug("unrecognized activity: "+XmlUtil.getTagLocalName(element));
}
}
@@ -135,13 +155,13 @@
}
- if (startEvents.size()==0) {
+ if (startNodes.size()==0) {
parse.addProblem("no start event in process");
- } else if (startEvents.size()>1) {
+ } else if (startNodes.size()>1) {
parse.addProblem("multiple start events not yet supported");
// TODO verify that all start events have conditions
} else {
- NodeImpl uniqueStartEvent = startEvents.get(0);
+ NodeImpl uniqueStartEvent = startNodes.get(0);
processDefinition.setInitial(uniqueStartEvent);
}
@@ -174,29 +194,4 @@
}
}
}
-
- static {
- // default descriptor parsers ///////////////////////////////////////////////
- defaultBindings = new Bindings();
-
- ActivityParser activityParser = new ActivityParser();
-
- for (String activityResource: DEFAULT_ACTIVITIES_RESOURCES) {
- Enumeration<URL> resourceUrls = ReflectUtil.getResources(null, activityResource);
- if (resourceUrls.hasMoreElements()) {
- while (resourceUrls.hasMoreElements()) {
- URL resourceUrl = resourceUrls.nextElement();
- log.trace("loading jpdl activities from resource: "+resourceUrl);
- activityParser.createParse()
- .setUrl(resourceUrl)
- .pushObject(defaultBindings)
- .execute()
- .checkProblems("jpdl activities from "+resourceUrl.toString());
- }
- } else {
- log.trace("skipping unavailable jpdl activities resource: "+activityResource);
- }
-
- }
- }
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartBinding.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartBinding.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -38,9 +38,9 @@
}
public Object parse(Element element, Parse parse, Parser parser) {
- NodeImpl startEventNode = parse.findObject(NodeImpl.class);
- StartEvents startEvents = parse.findObject(StartEvents.class);
- startEvents.add(startEventNode);
+ NodeImpl startNode = parse.findObject(NodeImpl.class);
+ StartNodes startNodes = parse.findObject(StartNodes.class);
+ startNodes.add(startNode);
return new StartActivity();
}
Deleted: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartEvents.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartEvents.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartEvents.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @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.jpdl.xml;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jbpm.pvm.internal.model.NodeImpl;
-
-
-/**
- * @author Tom Baeyens
- */
-public class StartEvents {
-
- List<NodeImpl> startEvents = new ArrayList<NodeImpl>();
-
-
- public void add(NodeImpl startEventNode) {
- startEvents.add(startEventNode);
- }
-
- public int size() {
- return startEvents.size();
- }
-
- public NodeImpl get(int i) {
- return startEvents.get(i);
- }
-
-}
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartNodes.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartNodes.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartNodes.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @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.jpdl.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.pvm.internal.model.NodeImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class StartNodes {
+
+ List<NodeImpl> startEvents = new ArrayList<NodeImpl>();
+
+
+ public void add(NodeImpl startEventNode) {
+ startEvents.add(startEventNode);
+ }
+
+ public int size() {
+ return startEvents.size();
+ }
+
+ public NodeImpl get(int i) {
+ return startEvents.get(i);
+ }
+
+}
Modified: jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml 2008-12-08 22:35:29 UTC (rev 3275)
@@ -1,6 +1,7 @@
<activities>
+ <schema resource="jpdl.xsd" />
<activity binding="org.jbpm.jpdl.xml.StartBinding" />
<activity binding="org.jbpm.jpdl.xml.StateBinding" />
<activity binding="org.jbpm.jpdl.xml.ExclusiveBinding" />
<activity binding="org.jbpm.jpdl.xml.EndBinding" />
-</activities>
\ No newline at end of file
+</activities>
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/xml/JpdlXmlTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/xml/JpdlXmlTest.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/xml/JpdlXmlTest.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -31,7 +31,7 @@
* @author Tom Baeyens
*/
public class JpdlXmlTest extends JbpmTestCase {
-
+
public void testValidXml() {
List<Problem> problems = new JpdlParser()
.createParse()
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/cfg/JbpmConfiguration.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/cfg/JbpmConfiguration.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/cfg/JbpmConfiguration.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -39,12 +39,12 @@
import org.jbpm.log.Log;
import org.jbpm.pvm.internal.env.PvmEnvironment;
import org.jbpm.pvm.internal.env.PvmEnvironmentFactoryParser;
-import org.jbpm.pvm.internal.stream.FileStreamSource;
-import org.jbpm.pvm.internal.stream.InputStreamSource;
-import org.jbpm.pvm.internal.stream.ResourceStreamSource;
-import org.jbpm.pvm.internal.stream.StreamSource;
-import org.jbpm.pvm.internal.stream.StringStreamSource;
-import org.jbpm.pvm.internal.stream.UrlStreamSource;
+import org.jbpm.pvm.internal.stream.FileStreamInput;
+import org.jbpm.pvm.internal.stream.InputStreamInput;
+import org.jbpm.pvm.internal.stream.ResourceStreamInput;
+import org.jbpm.pvm.internal.stream.StreamInput;
+import org.jbpm.pvm.internal.stream.StringStreamInput;
+import org.jbpm.pvm.internal.stream.UrlStreamInput;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireDefinition;
@@ -100,31 +100,31 @@
}
public Configuration setInputStream(InputStream inputStream) {
- parse(new InputStreamSource(inputStream));
+ parse(new InputStreamInput(inputStream));
return this;
}
public Configuration setResource(String resource) {
- parse(new ResourceStreamSource(resource, getClassLoader()));
+ parse(new ResourceStreamInput(resource, getClassLoader()));
return this;
}
public Configuration setUrl(URL url) {
- parse(new UrlStreamSource(url));
+ parse(new UrlStreamInput(url));
return this;
}
public Configuration setFile(File file) {
- parse(new FileStreamSource(file));
+ parse(new FileStreamInput(file));
return this;
}
public Configuration setXmlString(String xmlString) {
- parse(new StringStreamSource(xmlString));
+ parse(new StringStreamInput(xmlString));
return this;
}
- protected void parse(StreamSource streamSource) {
+ protected void parse(StreamInput streamSource) {
isConfigured = true;
PvmEnvironmentFactoryParser.getInstance()
.createParse()
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/PvmEnvironmentFactoryParser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/PvmEnvironmentFactoryParser.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/PvmEnvironmentFactoryParser.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -24,7 +24,7 @@
import org.jbpm.cfg.JbpmConfiguration;
import org.jbpm.env.Context;
import org.jbpm.env.EnvironmentFactory;
-import org.jbpm.pvm.internal.stream.StreamSource;
+import org.jbpm.pvm.internal.stream.StreamInput;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireDefinition;
@@ -56,7 +56,7 @@
}
/** parses the given stream source with {@link #getInstance() the current parser}. */
- static EnvironmentFactory parse(StreamSource streamSource) {
+ static EnvironmentFactory parse(StreamInput streamSource) {
EnvironmentFactory environmentFactory = (EnvironmentFactory) getInstance()
.createParse()
.setStreamSource(streamSource)
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ByteArrayStreamInput.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ByteArrayStreamInput.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ByteArrayStreamInput.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @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.pvm.internal.stream;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+import org.jbpm.JbpmException;
+
+/**
+ * @author Tom Baeyens
+ */
+public class ByteArrayStreamInput extends StreamInput {
+
+ protected byte[] bytes;
+
+ /** @throws JbpmException if bytes is null */
+ public ByteArrayStreamInput(byte[] bytes) {
+ if (bytes==null) {
+ throw new JbpmException("bytes is null");
+ }
+ this.name = "byte-array";
+ this.bytes = bytes;
+ }
+
+ public InputStream openStream() {
+ return new ByteArrayInputStream(bytes);
+ }
+
+}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ByteArrayStreamSource.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ByteArrayStreamSource.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ByteArrayStreamSource.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @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.pvm.internal.stream;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-
-import org.jbpm.JbpmException;
-
-/**
- * @author Tom Baeyens
- */
-public class ByteArrayStreamSource extends StreamSource {
-
- protected byte[] bytes;
-
- /** @throws JbpmException if bytes is null */
- public ByteArrayStreamSource(byte[] bytes) {
- if (bytes==null) {
- throw new JbpmException("bytes is null");
- }
- this.name = "byte-array";
- this.bytes = bytes;
- }
-
- public InputStream openStream() {
- return new ByteArrayInputStream(bytes);
- }
-
-}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/FileStreamInput.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/FileStreamInput.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/FileStreamInput.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @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.pvm.internal.stream;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+
+import org.jbpm.JbpmException;
+
+/**
+ * @author Tom Baeyens
+ */
+public class FileStreamInput extends StreamInput {
+
+ protected File file;
+
+ /** @throws JbpmException if file is null */
+ public FileStreamInput(File file) {
+ if (file==null) {
+ throw new JbpmException("file is null");
+ }
+
+ try {
+ this.name = file.toURL().toString();
+ } catch (MalformedURLException e) {
+ this.name = file.toString();
+ }
+
+ this.file = file;
+ }
+
+ public InputStream openStream() {
+ InputStream stream = null;
+
+ try {
+ if (!file.exists()) {
+ throw new JbpmException("file "+file+" doesn't exist");
+ }
+ if (file.isDirectory()) {
+ throw new JbpmException("file "+file+" is a directory");
+ }
+ stream = new FileInputStream(file);
+
+ } catch (Exception e) {
+ throw new JbpmException("couldn't access file "+file+": "+e.getMessage(), e);
+ }
+
+ return stream;
+ }
+
+}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/FileStreamSource.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/FileStreamSource.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/FileStreamSource.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -1,72 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @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.pvm.internal.stream;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-
-import org.jbpm.JbpmException;
-
-/**
- * @author Tom Baeyens
- */
-public class FileStreamSource extends StreamSource {
-
- protected File file;
-
- /** @throws JbpmException if file is null */
- public FileStreamSource(File file) {
- if (file==null) {
- throw new JbpmException("file is null");
- }
-
- try {
- this.name = file.toURL().toString();
- } catch (MalformedURLException e) {
- this.name = file.toString();
- }
-
- this.file = file;
- }
-
- public InputStream openStream() {
- InputStream stream = null;
-
- try {
- if (!file.exists()) {
- throw new JbpmException("file "+file+" doesn't exist");
- }
- if (file.isDirectory()) {
- throw new JbpmException("file "+file+" is a directory");
- }
- stream = new FileInputStream(file);
-
- } catch (Exception e) {
- throw new JbpmException("couldn't access file "+file+": "+e.getMessage(), e);
- }
-
- return stream;
- }
-
-}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/InputStreamInput.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/InputStreamInput.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/InputStreamInput.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @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.pvm.internal.stream;
+
+import java.io.InputStream;
+
+import org.jbpm.JbpmException;
+
+/**
+ * @author Tom Baeyens
+ */
+public class InputStreamInput extends StreamInput {
+
+ protected InputStream inputStream;
+
+ public InputStreamInput(InputStream inputStream) {
+ if (inputStream==null) {
+ throw new JbpmException("inputStream is null");
+ }
+ this.name = "input-stream";
+ this.inputStream = inputStream;
+ }
+
+ public InputStream openStream() {
+ return inputStream;
+ }
+}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/InputStreamSource.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/InputStreamSource.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/InputStreamSource.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @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.pvm.internal.stream;
-
-import java.io.InputStream;
-
-import org.jbpm.JbpmException;
-
-/**
- * @author Tom Baeyens
- */
-public class InputStreamSource extends StreamSource {
-
- protected InputStream inputStream;
-
- public InputStreamSource(InputStream inputStream) {
- if (inputStream==null) {
- throw new JbpmException("inputStream is null");
- }
- this.name = "input-stream";
- this.inputStream = inputStream;
- }
-
- public InputStream openStream() {
- return inputStream;
- }
-}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ResourceStreamInput.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ResourceStreamInput.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ResourceStreamInput.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @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.pvm.internal.stream;
+
+import java.io.InputStream;
+
+import org.jbpm.JbpmException;
+import org.jbpm.pvm.internal.util.ReflectUtil;
+
+/**
+ * @author Tom Baeyens
+ */
+public class ResourceStreamInput extends StreamInput {
+
+ protected ClassLoader classLoader;
+ protected String resource;
+
+ /** @throws JbpmException if resource is null */
+ public ResourceStreamInput(String resource) {
+ this(resource, null);
+ }
+
+ /** @throws JbpmException if resource is null */
+ public ResourceStreamInput(String resource, ClassLoader classLoader) {
+ if (resource==null) {
+ throw new JbpmException("resource is null");
+ }
+ this.name = "resource://"+resource;
+ this.resource = resource;
+ this.classLoader = classLoader;
+ }
+
+ public InputStream openStream() {
+ InputStream stream = ReflectUtil.getResourceAsStream(classLoader, resource);
+ if (stream==null) {
+ throw new JbpmException("resource "+resource+" does not exist");
+ }
+ return stream;
+ }
+}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ResourceStreamSource.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ResourceStreamSource.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ResourceStreamSource.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @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.pvm.internal.stream;
-
-import java.io.InputStream;
-
-import org.jbpm.JbpmException;
-import org.jbpm.pvm.internal.util.ReflectUtil;
-
-/**
- * @author Tom Baeyens
- */
-public class ResourceStreamSource extends StreamSource {
-
- protected ClassLoader classLoader;
- protected String resource;
-
- /** @throws JbpmException if resource is null */
- public ResourceStreamSource(String resource) {
- this(resource, null);
- }
-
- /** @throws JbpmException if resource is null */
- public ResourceStreamSource(String resource, ClassLoader classLoader) {
- if (resource==null) {
- throw new JbpmException("resource is null");
- }
- this.name = "resource://"+resource;
- this.resource = resource;
- this.classLoader = classLoader;
- }
-
- public InputStream openStream() {
- InputStream stream = ReflectUtil.getResourceAsStream(classLoader, resource);
- if (stream==null) {
- throw new JbpmException("resource "+resource+" does not exist");
- }
- return stream;
- }
-}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/StreamInput.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/StreamInput.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/StreamInput.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @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.pvm.internal.stream;
+
+import java.io.InputStream;
+
+/**
+ * @author Tom Baeyens
+ */
+public abstract class StreamInput {
+
+ protected String name;
+
+ public abstract InputStream openStream();
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String toString() {
+ return name;
+ }
+}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/StreamSource.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/StreamSource.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/StreamSource.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @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.pvm.internal.stream;
-
-import java.io.InputStream;
-
-/**
- * @author Tom Baeyens
- */
-public abstract class StreamSource {
-
- protected String name;
-
- public abstract InputStream openStream();
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String toString() {
- return name;
- }
-}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/StringStreamInput.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/StringStreamInput.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/StringStreamInput.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @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.pvm.internal.stream;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class StringStreamInput extends StreamInput {
+
+ String string;
+
+ public StringStreamInput(String string) {
+ this.name = "string";
+ this.string = string;
+ }
+
+ public InputStream openStream() {
+ byte[] bytes = string.getBytes();
+ return new ByteArrayInputStream(bytes);
+ }
+}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/StringStreamSource.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/StringStreamSource.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/StringStreamSource.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @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.pvm.internal.stream;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-
-
-/**
- * @author Tom Baeyens
- */
-public class StringStreamSource extends StreamSource {
-
- String string;
-
- public StringStreamSource(String string) {
- this.name = "string";
- this.string = string;
- }
-
- public InputStream openStream() {
- byte[] bytes = string.getBytes();
- return new ByteArrayInputStream(bytes);
- }
-}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/UrlStreamInput.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/UrlStreamInput.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/UrlStreamInput.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @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.pvm.internal.stream;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import org.jbpm.JbpmException;
+
+/**
+ * @author Tom Baeyens
+ */
+public class UrlStreamInput extends StreamInput {
+
+ protected URL url;
+
+ /** @throws JbpmException if url is null */
+ public UrlStreamInput(URL url) {
+ if (url==null) {
+ throw new JbpmException("url is null");
+ }
+ this.name = url.toString();
+ this.url = url;
+ }
+
+ public InputStream openStream() {
+ InputStream stream = null;
+ try {
+ stream = url.openStream();
+ } catch (IOException e) {
+ throw new JbpmException("couldn't open URL stream", e);
+ }
+ return stream;
+ }
+}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/UrlStreamSource.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/UrlStreamSource.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/UrlStreamSource.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @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.pvm.internal.stream;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import org.jbpm.JbpmException;
-
-/**
- * @author Tom Baeyens
- */
-public class UrlStreamSource extends StreamSource {
-
- protected URL url;
-
- /** @throws JbpmException if url is null */
- public UrlStreamSource(URL url) {
- if (url==null) {
- throw new JbpmException("url is null");
- }
- this.name = url.toString();
- this.url = url;
- }
-
- public InputStream openStream() {
- InputStream stream = null;
- try {
- stream = url.openStream();
- } catch (IOException e) {
- throw new JbpmException("couldn't open URL stream", e);
- }
- return stream;
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DeploymentImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DeploymentImpl.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DeploymentImpl.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -39,13 +39,13 @@
import org.jbpm.JbpmException;
import org.jbpm.ProcessDefinition;
import org.jbpm.log.Log;
-import org.jbpm.pvm.internal.stream.ByteArrayStreamSource;
-import org.jbpm.pvm.internal.stream.FileStreamSource;
-import org.jbpm.pvm.internal.stream.InputStreamSource;
-import org.jbpm.pvm.internal.stream.ResourceStreamSource;
-import org.jbpm.pvm.internal.stream.StreamSource;
-import org.jbpm.pvm.internal.stream.StringStreamSource;
-import org.jbpm.pvm.internal.stream.UrlStreamSource;
+import org.jbpm.pvm.internal.stream.ByteArrayStreamInput;
+import org.jbpm.pvm.internal.stream.FileStreamInput;
+import org.jbpm.pvm.internal.stream.InputStreamInput;
+import org.jbpm.pvm.internal.stream.ResourceStreamInput;
+import org.jbpm.pvm.internal.stream.StreamInput;
+import org.jbpm.pvm.internal.stream.StringStreamInput;
+import org.jbpm.pvm.internal.stream.UrlStreamInput;
import org.jbpm.pvm.internal.util.IoUtil;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
@@ -74,7 +74,7 @@
protected String name;
/** maps file names to stream source */
- protected Map<String, StreamSource> files;
+ protected Map<String, StreamInput> files;
/** maps file names to dom so that duplicate xml parsing can be avoided. */
protected Map<String, Document> fileDocuments;
/** maps file names to file types */
@@ -114,44 +114,44 @@
public Deployment addResource(String resource) {
- addStreamSource(resource, new ResourceStreamSource(resource));
+ addStreamSource(resource, new ResourceStreamInput(resource));
return this;
}
public Deployment addFile(File file) {
- addStreamSource(file.getAbsolutePath(), new FileStreamSource(file));
+ addStreamSource(file.getAbsolutePath(), new FileStreamInput(file));
return this;
}
public Deployment addUrl(URL url) {
- addStreamSource(url.toString(), new UrlStreamSource(url));
+ addStreamSource(url.toString(), new UrlStreamInput(url));
return this;
}
public Deployment addInputStream(String name, InputStream inputStream) {
- addStreamSource(name, new InputStreamSource(inputStream));
+ addStreamSource(name, new InputStreamInput(inputStream));
return this;
}
public Deployment addString(String name, String string) {
- addStreamSource(name, new StringStreamSource(string));
+ addStreamSource(name, new StringStreamInput(string));
return this;
}
public Deployment addArchiveResource(String resource) {
this.name = resource;
- ResourceStreamSource streamSource = new ResourceStreamSource(resource);
+ ResourceStreamInput streamSource = new ResourceStreamInput(resource);
addStreamSource(resource, streamSource);
return this;
}
public Deployment addArchiveFile(File file) {
- addStreamSource(file.getAbsolutePath(), new FileStreamSource(file));
+ addStreamSource(file.getAbsolutePath(), new FileStreamInput(file));
return this;
}
public Deployment addArchiveUrl(URL url) {
- addStreamSource(url.toString(), new UrlStreamSource(url));
+ addStreamSource(url.toString(), new UrlStreamInput(url));
return this;
}
@@ -162,7 +162,7 @@
String entryName = zipEntry.getName();
byte[] bytes = IoUtil.readBytes(zipInputStream);
if (bytes!=null) {
- addStreamSource(entryName, new ByteArrayStreamSource(bytes));
+ addStreamSource(entryName, new ByteArrayStreamInput(bytes));
}
zipEntry = zipInputStream.getNextEntry();
}
@@ -217,12 +217,12 @@
if (file.isFile()) {
if (canonicalPathNames) {
try {
- addStreamSource(file.getCanonicalPath(), new FileStreamSource(file));
+ addStreamSource(file.getCanonicalPath(), new FileStreamInput(file));
} catch (IOException e) {
throw new JbpmException("can't get canonical path name for "+file);
}
} else {
- addStreamSource(relativeFileName, new FileStreamSource(file));
+ addStreamSource(relativeFileName, new FileStreamInput(file));
}
} else if (file.isDirectory()) {
addDirectory(file, relativeFileName, canonicalPathNames);
@@ -232,12 +232,12 @@
return this;
}
- protected Deployment addStreamSource(String name, StreamSource streamSource) {
+ protected Deployment addStreamSource(String name, StreamInput streamSource) {
if (this.name==null) {
this.name = name;
}
if (files==null) {
- files = new HashMap<String, StreamSource>();
+ files = new HashMap<String, StreamInput>();
}
files.put(name, streamSource);
return this;
@@ -247,7 +247,7 @@
if (files==null) {
return null;
}
- StreamSource streamSource = files.get(name);
+ StreamInput streamSource = files.get(name);
return (streamSource!=null ? streamSource.openStream() : null);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -24,6 +24,7 @@
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
@@ -57,20 +58,26 @@
private static Log log = Log.getLog(XmlUtil.class.getName());
public static List<Element> elements(Element element, String tagName) {
- List<Element> elements = null;
+ if (element==null) {
+ return Collections.EMPTY_LIST;
+ }
NodeList nodeList = element.getChildNodes();
- if (nodeList != null) {
- for (int i = 0; i < nodeList.getLength(); i++) {
- Node child = nodeList.item(i);
- if (Element.class.isAssignableFrom(child.getClass())) {
- Element childElement = (Element) child;
- String childTagName = getTagLocalName(childElement);
- if (childTagName.equals(tagName)) {
- if (elements == null) {
- elements = new ArrayList<Element>();
- }
- elements.add(childElement);
+ if ( (nodeList == null)
+ || (nodeList.getLength()==0)
+ ) {
+ return Collections.EMPTY_LIST;
+ }
+ List<Element> elements = new ArrayList<Element>();
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node child = nodeList.item(i);
+ if (Element.class.isAssignableFrom(child.getClass())) {
+ Element childElement = (Element) child;
+ String childTagName = getTagLocalName(childElement);
+ if (childTagName.equals(tagName)) {
+ if (elements == null) {
+ elements = new ArrayList<Element>();
}
+ elements.add(childElement);
}
}
}
@@ -78,20 +85,26 @@
}
public static List<Element> elements(Element element, Set<String> allowedTagNames) {
- List<Element> elements = null;
+ if (element==null) {
+ return Collections.EMPTY_LIST;
+ }
NodeList nodeList = element.getChildNodes();
- if (nodeList != null) {
- for (int i = 0; i < nodeList.getLength(); i++) {
- Node child = nodeList.item(i);
- if (Element.class.isAssignableFrom(child.getClass())) {
- Element childElement = (Element) child;
- String childTagName = getTagLocalName(childElement);
- if (allowedTagNames.contains(childTagName)) {
- if (elements == null) {
- elements = new ArrayList<Element>();
- }
- elements.add(childElement);
+ if ( (nodeList == null)
+ || (nodeList.getLength()==0)
+ ) {
+ return Collections.EMPTY_LIST;
+ }
+ List<Element> elements = new ArrayList<Element>();
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node child = nodeList.item(i);
+ if (Element.class.isAssignableFrom(child.getClass())) {
+ Element childElement = (Element) child;
+ String childTagName = getTagLocalName(childElement);
+ if (allowedTagNames.contains(childTagName)) {
+ if (elements == null) {
+ elements = new ArrayList<Element>();
}
+ elements.add(childElement);
}
}
}
@@ -99,49 +112,74 @@
}
public static Element element(Element element, String tagName) {
- Element childElement = null;
+ if (element==null) {
+ return null;
+ }
NodeList nodeList = element.getChildNodes();
- for (int i = 0; ((i < nodeList.getLength()) && (childElement == null)); i++) {
+ for (int i = 0; (i < nodeList.getLength()); i++) {
Node child = nodeList.item(i);
if ((Element.class.isAssignableFrom(child.getClass())) && (getTagLocalName((Element) child)).equals(tagName)) {
- childElement = (Element) child;
+ return (Element) child;
}
}
- return childElement;
+ return null;
}
public static List<Element> elements(Element element) {
- List<Element> elements = null;
- if (element!=null) {
- NodeList nodeList = element.getChildNodes();
- if ((nodeList != null) && (nodeList.getLength() > 0)) {
- elements = new ArrayList<Element>();
- for (int i = 0; i < nodeList.getLength(); i++) {
- Node node = nodeList.item(i);
- if (node instanceof Element) {
- elements.add((Element) node);
- }
+ if (element==null) {
+ return Collections.EMPTY_LIST;
+ }
+ NodeList nodeList = element.getChildNodes();
+ if ( (nodeList == null)
+ || (nodeList.getLength()==0)
+ ) {
+ return Collections.EMPTY_LIST;
+ }
+ List<Element> elements = new ArrayList<Element>();
+ if ((nodeList != null) && (nodeList.getLength() > 0)) {
+ elements = new ArrayList<Element>();
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
+ if (node instanceof Element) {
+ elements.add((Element) node);
}
}
}
return elements;
}
- public static List<Element> elements(Element father, String ns, String localName) {
- List<Element> matchingElements = new ArrayList<Element>();
- NodeList nl = father.getChildNodes();
- for (int i=0;i<nl.getLength();i++) {
- Node n = nl.item(i);
- if (n instanceof Element && n.getLocalName() != null && n.getLocalName().equals(localName) && n.getNamespaceURI() != null && n.getNamespaceURI().equals(ns)) {
- matchingElements.add((Element)n);
- }
+ public static List<Element> elements(Element element, String ns, String localName) {
+ if (element==null) {
+ return Collections.EMPTY_LIST;
+ }
+ NodeList nodeList = element.getChildNodes();
+ if ( (nodeList == null)
+ || (nodeList.getLength()==0)
+ ) {
+ return Collections.EMPTY_LIST;
+ }
+ List<Element> matchingElements = new ArrayList<Element>();
+ NodeList nl = element.getChildNodes();
+ for (int i=0;i<nl.getLength();i++) {
+ Node n = nl.item(i);
+ if (n instanceof Element && n.getLocalName() != null && n.getLocalName().equals(localName) && n.getNamespaceURI() != null && n.getNamespaceURI().equals(ns)) {
+ matchingElements.add((Element)n);
}
- return matchingElements;
}
+ return matchingElements;
+ }
public static List<Element> elementsQName(Element element, Set<QName> allowedTagNames) {
- List<Element> elements = null;
+ if (element==null) {
+ return Collections.EMPTY_LIST;
+ }
NodeList nodeList = element.getChildNodes();
+ if ( (nodeList == null)
+ || (nodeList.getLength()==0)
+ ) {
+ return Collections.EMPTY_LIST;
+ }
+ List<Element> elements = new ArrayList<Element>();
if (nodeList != null) {
for (int i = 0; i < nodeList.getLength(); i++) {
Node child = nodeList.item(i);
@@ -159,11 +197,12 @@
}
return elements;
}
+
public static Element element(Element element) {
Element onlyChild = null;
- List elements = elements(element);
- if (elements != null) {
- onlyChild = (Element) elements.get(0);
+ List<Element> elements = elements(element);
+ if (!elements.isEmpty()) {
+ onlyChild = elements.get(0);
}
return onlyChild;
}
@@ -220,7 +259,7 @@
public static List<Attr> attributes(Element element) {
NamedNodeMap attributeMap = element.getAttributes();
if ((attributeMap == null) || (attributeMap.getLength() == 0)) {
- return null;
+ return Collections.EMPTY_LIST;
}
List<Attr> attributes = new ArrayList<Attr>();
@@ -234,7 +273,7 @@
public static List<Node> contents(Element element) {
NodeList nodeList = element.getChildNodes();
if ((nodeList == null) && (nodeList.getLength() != 0)) {
- return null;
+ return Collections.EMPTY_LIST;
}
List<Node> contents = new ArrayList<Node>();
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AbstractCollectionBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AbstractCollectionBinding.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AbstractCollectionBinding.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -36,12 +36,10 @@
List<Descriptor> valueDescriptors = new ArrayList<Descriptor>();
List<Element> elements = XmlUtil.elements(element);
- if (elements!=null) {
- for (Element valueElement: elements) {
- Descriptor valueDescriptor = (Descriptor) parser.parseElement(valueElement, parse, WireParser.CATEGORY_DESCRIPTOR);
- if (valueDescriptor!=null) {
- valueDescriptors.add(valueDescriptor);
- }
+ for (Element valueElement: elements) {
+ Descriptor valueDescriptor = (Descriptor) parser.parseElement(valueElement, parse, WireParser.CATEGORY_DESCRIPTOR);
+ if (valueDescriptor!=null) {
+ valueDescriptors.add(valueDescriptor);
}
}
descriptor.setValueDescriptors(valueDescriptors);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AssignFileTypesBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AssignFileTypesBinding.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AssignFileTypesBinding.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -46,7 +46,7 @@
AssignFileTypeDeployer assignFileTypeDeployer = new AssignFileTypeDeployer();
List<Element> fileElements = XmlUtil.elements(element, "file");
- if (fileElements==null) {
+ if (fileElements.isEmpty()) {
parse.addProblem("no files in "+ASSIGN_FILE_TYPE);
} else {
for(Element fileTypeElement : fileElements) {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/BusinessCalendarBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/BusinessCalendarBinding.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/BusinessCalendarBinding.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -87,7 +87,7 @@
Holiday[] holidays = null;
List<Element> holidayElements = XmlUtil.elements(element, "holiday");
- if (holidayElements!=null) {
+ if (!holidayElements.isEmpty()) {
holidays = new Holiday[holidayElements.size()];
for (int i=0; i<holidayElements.size(); i++) {
holidays[i] = parseHoliday(holidayElements.get(i), dayFormat, businessCalendar, parse);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/DeployerManagerBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/DeployerManagerBinding.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/DeployerManagerBinding.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -55,14 +55,12 @@
descriptor.setDeployerDescriptors(deployerDescriptors);
List<Element> deployerElements = XmlUtil.elements(element);
- if (deployerElements!=null) {
- for (Element deployerElement: deployerElements) {
- Descriptor deployerDescriptor = (Descriptor) parser
- .parseElement(deployerElement,
- parse,
- WireParser.CATEGORY_DESCRIPTOR);
- deployerDescriptors.add(deployerDescriptor);
- }
+ for (Element deployerElement: deployerElements) {
+ Descriptor deployerDescriptor = (Descriptor) parser
+ .parseElement(deployerElement,
+ parse,
+ WireParser.CATEGORY_DESCRIPTOR);
+ deployerDescriptors.add(deployerDescriptor);
}
if (deployerDescriptors.isEmpty()) {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HibernateConfigurationBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HibernateConfigurationBinding.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HibernateConfigurationBinding.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -29,10 +29,10 @@
import org.hibernate.cfg.Configuration;
import org.jbpm.log.Log;
-import org.jbpm.pvm.internal.stream.FileStreamSource;
-import org.jbpm.pvm.internal.stream.ResourceStreamSource;
-import org.jbpm.pvm.internal.stream.StreamSource;
-import org.jbpm.pvm.internal.stream.UrlStreamSource;
+import org.jbpm.pvm.internal.stream.FileStreamInput;
+import org.jbpm.pvm.internal.stream.ResourceStreamInput;
+import org.jbpm.pvm.internal.stream.StreamInput;
+import org.jbpm.pvm.internal.stream.UrlStreamInput;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.wire.descriptor.HibernateConfigurationDescriptor;
@@ -65,11 +65,9 @@
static class MappingParser extends Parser {
public Object parseDocumentElement(Element documentElement, Parse parse) {
List<Element> elements = XmlUtil.elements(documentElement, "mapping");
- if (elements!=null) {
- HibernateConfigurationDescriptor descriptor = parse.findObject(HibernateConfigurationDescriptor.class);
- for (Element element: elements) {
- parseMapping(element, descriptor, parse);
- }
+ HibernateConfigurationDescriptor descriptor = parse.findObject(HibernateConfigurationDescriptor.class);
+ for (Element element: elements) {
+ parseMapping(element, descriptor, parse);
}
return null;
}
@@ -124,109 +122,107 @@
}
List<Element> configElements = XmlUtil.elements(element);
- if (configElements!=null) {
- for (Element configElement: configElements) {
+ for (Element configElement: configElements) {
+
+ if ("mappings".equals(XmlUtil.getTagLocalName(configElement))) {
+ if (configElement.hasAttribute("resource")) {
+ String resources = configElement.getAttribute("resource");
+ try {
+ Enumeration<URL> enumeration = ReflectUtil.getResources(parse.getClassLoader(), resources);
+ if (enumeration!=null) {
+ while (enumeration.hasMoreElements()) {
+ URL url = enumeration.nextElement();
+ log.trace("importing mappings from "+url);
+ InputStream inputStream = url.openStream();
+ mappingParser.createParse()
+ .pushObject(descriptor)
+ .setInputStream(inputStream)
+ .execute();
+ }
+ }
+ } catch (Exception e) {
+ parse.addProblem("couldn't parse hibernate mapping resources '"+resources+"'", e);
+ }
+ }
+
+ } else if ("mapping".equals(XmlUtil.getTagLocalName(configElement))) {
- if ("mappings".equals(XmlUtil.getTagLocalName(configElement))) {
+ parseMapping(configElement, descriptor, parse);
+
+ } else if ("properties".equals(XmlUtil.getTagLocalName(configElement))) {
+ PropertiesDescriptor propertiesDescriptor = (PropertiesDescriptor) propertiesBinding.parse(configElement, parse, parser);
+ descriptor.setPropertiesDescriptor(propertiesDescriptor);
+
+ } else if ("cache-configuration".equals(XmlUtil.getTagLocalName(configElement))) {
+ StreamInput streamSource = null;
+
+ String cacheUsage = configElement.getAttribute("usage");
+ if (! ( ("read-only".equals(cacheUsage))
+ || ("nonstrict-read-write".equals(cacheUsage))
+ || ("read-write".equals(cacheUsage))
+ || ("transactional".equals(cacheUsage))
+ )
+ ){
+ parse.addProblem("problem in cache-configuration: no usage attribute or illegal value: "+cacheUsage+" Possible values are {read-only, nonstrict-read-write, read-write, transactional}");
+ } else {
+
+ if (configElement.hasAttribute("file")) {
+ String fileName = configElement.getAttribute("file");
+ File file = new File(fileName);
+ if (file.exists() && file.isFile()) {
+ streamSource = new FileStreamInput(file);
+ } else {
+ parse.addProblem("file "+fileName+" isn't a file");
+ }
+ }
+
if (configElement.hasAttribute("resource")) {
- String resources = configElement.getAttribute("resource");
+ String resource = configElement.getAttribute("resource");
+ streamSource = new ResourceStreamInput(resource, parse.getClassLoader());
+ }
+
+ if (configElement.hasAttribute("url")) {
+ String urlText = configElement.getAttribute("url");
try {
- Enumeration<URL> enumeration = ReflectUtil.getResources(parse.getClassLoader(), resources);
- if (enumeration!=null) {
- while (enumeration.hasMoreElements()) {
- URL url = enumeration.nextElement();
- log.trace("importing mappings from "+url);
- InputStream inputStream = url.openStream();
- mappingParser.createParse()
- .pushObject(descriptor)
- .setInputStream(inputStream)
- .execute();
- }
- }
+ URL url = new URL(urlText);
+ streamSource = new UrlStreamInput(url);
} catch (Exception e) {
- parse.addProblem("couldn't parse hibernate mapping resources '"+resources+"'", e);
+ parse.addProblem("couldn't open url "+urlText, e);
}
}
-
- } else if ("mapping".equals(XmlUtil.getTagLocalName(configElement))) {
- parseMapping(configElement, descriptor, parse);
+ if (streamSource != null) {
+ parser.importStream(streamSource, configElement, parse);
+ }
- } else if ("properties".equals(XmlUtil.getTagLocalName(configElement))) {
- PropertiesDescriptor propertiesDescriptor = (PropertiesDescriptor) propertiesBinding.parse(configElement, parse, parser);
- descriptor.setPropertiesDescriptor(propertiesDescriptor);
-
- } else if ("cache-configuration".equals(XmlUtil.getTagLocalName(configElement))) {
- StreamSource streamSource = null;
-
- String cacheUsage = configElement.getAttribute("usage");
- if (! ( ("read-only".equals(cacheUsage))
- || ("nonstrict-read-write".equals(cacheUsage))
- || ("read-write".equals(cacheUsage))
- || ("transactional".equals(cacheUsage))
- )
- ){
- parse.addProblem("problem in cache-configuration: no usage attribute or illegal value: "+cacheUsage+" Possible values are {read-only, nonstrict-read-write, read-write, transactional}");
- } else {
-
- if (configElement.hasAttribute("file")) {
- String fileName = configElement.getAttribute("file");
- File file = new File(fileName);
- if (file.exists() && file.isFile()) {
- streamSource = new FileStreamSource(file);
- } else {
- parse.addProblem("file "+fileName+" isn't a file");
- }
- }
-
- if (configElement.hasAttribute("resource")) {
- String resource = configElement.getAttribute("resource");
- streamSource = new ResourceStreamSource(resource, parse.getClassLoader());
- }
-
- if (configElement.hasAttribute("url")) {
- String urlText = configElement.getAttribute("url");
- try {
- URL url = new URL(urlText);
- streamSource = new UrlStreamSource(url);
- } catch (Exception e) {
- parse.addProblem("couldn't open url "+urlText, e);
- }
- }
-
- if (streamSource != null) {
- parser.importStream(streamSource, configElement, parse);
- }
-
- // parse the cache configurations in the same way as the hibernate cfg schema
- // translate the contents of the file into invoke operations for methods
- // Configuration.setCacheConcurrencyStrategy(String clazz, String concurrencyStrategy, String region)
- // Configuration.setCollectionCacheConcurrencyStrategy(String collectionRole, String concurrencyStrategy)
- // <class-cache class="org.hibernate.auction.Item" usage="read-write"/>
- // <class-cache class="org.hibernate.auction.Bid" usage="read-only"/>
- // <collection-cache collection="org.hibernate.auction.Item.bids" usage="read-write"/>
- List<Element> cacheElements = XmlUtil.elements(configElement);
- if (cacheElements!=null) {
- for (Element cacheElement : cacheElements) {
-
- if ("class-cache".equals(XmlUtil.getTagLocalName(cacheElement))) {
- String className = cacheElement.getAttribute("class");
- descriptor.addCacheOperation(new HibernateConfigurationDescriptor.SetCacheConcurrencyStrategy(className, cacheUsage));
+ // parse the cache configurations in the same way as the hibernate cfg schema
+ // translate the contents of the file into invoke operations for methods
+ // Configuration.setCacheConcurrencyStrategy(String clazz, String concurrencyStrategy, String region)
+ // Configuration.setCollectionCacheConcurrencyStrategy(String collectionRole, String concurrencyStrategy)
+ // <class-cache class="org.hibernate.auction.Item" usage="read-write"/>
+ // <class-cache class="org.hibernate.auction.Bid" usage="read-only"/>
+ // <collection-cache collection="org.hibernate.auction.Item.bids" usage="read-write"/>
+ List<Element> cacheElements = XmlUtil.elements(configElement);
+ if (cacheElements!=null) {
+ for (Element cacheElement : cacheElements) {
+
+ if ("class-cache".equals(XmlUtil.getTagLocalName(cacheElement))) {
+ String className = cacheElement.getAttribute("class");
+ descriptor.addCacheOperation(new HibernateConfigurationDescriptor.SetCacheConcurrencyStrategy(className, cacheUsage));
- } else if ("collection-cache".equals(XmlUtil.getTagLocalName(cacheElement))) {
- String collection = cacheElement.getAttribute("collection");
- descriptor.addCacheOperation(new HibernateConfigurationDescriptor.SetCollectionCacheConcurrencyStrategy(collection, cacheUsage));
+ } else if ("collection-cache".equals(XmlUtil.getTagLocalName(cacheElement))) {
+ String collection = cacheElement.getAttribute("collection");
+ descriptor.addCacheOperation(new HibernateConfigurationDescriptor.SetCollectionCacheConcurrencyStrategy(collection, cacheUsage));
- } else {
- parse.addProblem("unknown hibernate cache configuration element "+XmlUtil.toString(configElement));
- }
+ } else {
+ parse.addProblem("unknown hibernate cache configuration element "+XmlUtil.toString(configElement));
}
}
}
-
- } else {
- parse.addProblem("unknown hibernate configuration element "+XmlUtil.toString(configElement));
}
+
+ } else {
+ parse.addProblem("unknown hibernate configuration element "+XmlUtil.toString(configElement));
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HibernateSessionFactoryBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HibernateSessionFactoryBinding.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HibernateSessionFactoryBinding.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -48,7 +48,7 @@
// if hibernate session factory binding has sub elements, we assume that
// it is an inline configuration declaration
- } else if (XmlUtil.elements(element)!=null) {
+ } else if (!XmlUtil.elements(element).isEmpty()) {
Descriptor configurationDescriptor = (Descriptor) super.parse(element, parse, parser);
descriptor.setConfigurationDescriptor(configurationDescriptor);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MapBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MapBinding.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MapBinding.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -61,32 +61,30 @@
List<Descriptor> keyDescriptors = new ArrayList<Descriptor>();
List<Descriptor> valueDescriptors = new ArrayList<Descriptor>();
List<Element> elements = XmlUtil.elements(element);
- if (elements!=null) {
- for (Element entryElement: elements) {
- if ("entry".equals(XmlUtil.getTagLocalName(entryElement))) {
- // key
- Element keyElement = XmlUtil.element(entryElement, "key");
- Element keyDescriptorElement = (keyElement!=null ? XmlUtil.element(keyElement) : null);
- Descriptor keyDescriptor = (Descriptor) parser.parseElement(keyDescriptorElement, parse, WireParser.CATEGORY_DESCRIPTOR);
- // value
- Element valueElement = XmlUtil.element(entryElement, "value");
- Element valueDescriptorElement = (valueElement!=null ? XmlUtil.element(valueElement) : null);
- Descriptor valueDescriptor = (Descriptor) parser.parseElement(valueDescriptorElement, parse, WireParser.CATEGORY_DESCRIPTOR);
+ for (Element entryElement: elements) {
+ if ("entry".equals(XmlUtil.getTagLocalName(entryElement))) {
+ // key
+ Element keyElement = XmlUtil.element(entryElement, "key");
+ Element keyDescriptorElement = (keyElement!=null ? XmlUtil.element(keyElement) : null);
+ Descriptor keyDescriptor = (Descriptor) parser.parseElement(keyDescriptorElement, parse, WireParser.CATEGORY_DESCRIPTOR);
+ // value
+ Element valueElement = XmlUtil.element(entryElement, "value");
+ Element valueDescriptorElement = (valueElement!=null ? XmlUtil.element(valueElement) : null);
+ Descriptor valueDescriptor = (Descriptor) parser.parseElement(valueDescriptorElement, parse, WireParser.CATEGORY_DESCRIPTOR);
- if ( (keyDescriptor!=null)
- && (valueDescriptor!=null)
- ) {
- keyDescriptors.add(keyDescriptor);
- valueDescriptors.add(valueDescriptor);
- } else {
- parse.addProblem("entry must have key and value element with a single descriptor as contents: "+XmlUtil.toString(entryElement));
- }
+ if ( (keyDescriptor!=null)
+ && (valueDescriptor!=null)
+ ) {
+ keyDescriptors.add(keyDescriptor);
+ valueDescriptors.add(valueDescriptor);
} else {
- parse.addProblem("map can only contain entry elements: "+XmlUtil.toString(entryElement));
+ parse.addProblem("entry must have key and value element with a single descriptor as contents: "+XmlUtil.toString(entryElement));
}
-
+ } else {
+ parse.addProblem("map can only contain entry elements: "+XmlUtil.toString(entryElement));
}
}
+
descriptor.setKeyDescriptors(keyDescriptors);
descriptor.setValueDescriptors(valueDescriptors);
return descriptor;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ObjectBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ObjectBinding.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ObjectBinding.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -122,22 +122,20 @@
// read the operations elements
List<Operation> operations = null;
List<Element> elements = XmlUtil.elements(element);
- if (elements!=null) {
- for (Element childElement: elements) {
- if(!childElement.getTagName().equals("constructor")
- && !childElement.getTagName().equals("factory")
- && !childElement.getTagName().equals("arg")){
- Operation operation = (Operation) parser.parseElement(childElement, parse, WireParser.CATEGORY_OPERATION);
- if (operation!=null) {
- if (operations==null) {
- operations = new ArrayList<Operation>();
- }
- operations.add(operation);
- }else{
- parse.addProblem("element 'object' can only have 'factory', 'arg', 'constructor' elements or an operation element ("+
- parser.getBindings().getTagNames(WireParser.CATEGORY_OPERATION) +")." +
- " Invalid element '"+childElement.getTagName()+"' in: "+XmlUtil.toString(element));
+ for (Element childElement: elements) {
+ if(!childElement.getTagName().equals("constructor")
+ && !childElement.getTagName().equals("factory")
+ && !childElement.getTagName().equals("arg")){
+ Operation operation = (Operation) parser.parseElement(childElement, parse, WireParser.CATEGORY_OPERATION);
+ if (operation!=null) {
+ if (operations==null) {
+ operations = new ArrayList<Operation>();
}
+ operations.add(operation);
+ }else{
+ parse.addProblem("element 'object' can only have 'factory', 'arg', 'constructor' elements or an operation element ("+
+ parser.getBindings().getTagNames(WireParser.CATEGORY_OPERATION) +")." +
+ " Invalid element '"+childElement.getTagName()+"' in: "+XmlUtil.toString(element));
}
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/PropertiesBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/PropertiesBinding.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/PropertiesBinding.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -68,28 +68,26 @@
List<Descriptor> valueDescriptors = new ArrayList<Descriptor>();
List<Element> elements = XmlUtil.elements(element);
- if (elements!=null) {
- for (Element propertyElement: elements) {
- if ("property".equals(XmlUtil.getTagLocalName(propertyElement))) {
- // key
- String name = XmlUtil.attribute(propertyElement, "name");
- // value
- String value = XmlUtil.attribute(propertyElement, "value");
+ for (Element propertyElement: elements) {
+ if ("property".equals(XmlUtil.getTagLocalName(propertyElement))) {
+ // key
+ String name = XmlUtil.attribute(propertyElement, "name");
+ // value
+ String value = XmlUtil.attribute(propertyElement, "value");
- if ( (name!=null)
- && (value!=null)
- ) {
- keyDescriptors.add(new StringDescriptor(name));
- valueDescriptors.add(new StringDescriptor(value));
- } else {
- parse.addProblem("property must have name and value attributes: "+XmlUtil.toString(propertyElement));
- }
+ if ( (name!=null)
+ && (value!=null)
+ ) {
+ keyDescriptors.add(new StringDescriptor(name));
+ valueDescriptors.add(new StringDescriptor(value));
} else {
- parse.addProblem("properties can only contain property elements: "+XmlUtil.toString(propertyElement));
+ parse.addProblem("property must have name and value attributes: "+XmlUtil.toString(propertyElement));
}
-
+ } else {
+ parse.addProblem("properties can only contain property elements: "+XmlUtil.toString(propertyElement));
}
}
+
descriptor.setKeyDescriptors(keyDescriptors);
descriptor.setValueDescriptors(valueDescriptors);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/StandardCommandServiceBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/StandardCommandServiceBinding.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/StandardCommandServiceBinding.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -56,11 +56,9 @@
commandServiceDescriptor.setCommandService(commandService);
List<Element> interceptorElements = XmlUtil.elements(element);
- if (interceptorElements!=null) {
- for (Element interceptorElement : interceptorElements) {
- Descriptor interceptorDescriptor = (Descriptor) parser.parseElement(interceptorElement, parse, WireParser.CATEGORY_INTERCEPTOR);
- commandServiceDescriptor.addInterceptorDescriptor(interceptorDescriptor);
- }
+ for (Element interceptorElement : interceptorElements) {
+ Descriptor interceptorDescriptor = (Descriptor) parser.parseElement(interceptorElement, parse, WireParser.CATEGORY_INTERCEPTOR);
+ commandServiceDescriptor.addInterceptorDescriptor(interceptorDescriptor);
}
return commandServiceDescriptor;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/VariableTypesBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/VariableTypesBinding.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/VariableTypesBinding.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -25,10 +25,10 @@
import java.net.URL;
import java.util.List;
-import org.jbpm.pvm.internal.stream.FileStreamSource;
-import org.jbpm.pvm.internal.stream.ResourceStreamSource;
-import org.jbpm.pvm.internal.stream.StreamSource;
-import org.jbpm.pvm.internal.stream.UrlStreamSource;
+import org.jbpm.pvm.internal.stream.FileStreamInput;
+import org.jbpm.pvm.internal.stream.ResourceStreamInput;
+import org.jbpm.pvm.internal.stream.StreamInput;
+import org.jbpm.pvm.internal.stream.UrlStreamInput;
import org.jbpm.pvm.internal.type.Converter;
import org.jbpm.pvm.internal.type.Matcher;
import org.jbpm.pvm.internal.type.Type;
@@ -57,12 +57,12 @@
}
public Object parse(Element element, Parse parse, Parser parser) {
- StreamSource streamSource = null;
+ StreamInput streamSource = null;
if (element.hasAttribute("file")) {
String fileName = element.getAttribute("file");
File file = new File(fileName);
if (file.exists() && file.isFile()) {
- streamSource = new FileStreamSource(file);
+ streamSource = new FileStreamInput(file);
parser.importStream(streamSource, element, parse);
} else {
parse.addProblem("file "+fileName+" isn't a file");
@@ -71,7 +71,7 @@
if (element.hasAttribute("resource")) {
String resource = element.getAttribute("resource");
- streamSource = new ResourceStreamSource(resource, parse.getClassLoader());
+ streamSource = new ResourceStreamInput(resource, parse.getClassLoader());
parser.importStream(streamSource, element, parse);
}
@@ -79,7 +79,7 @@
String urlText = element.getAttribute("url");
try {
URL url = new URL(urlText);
- streamSource = new UrlStreamSource(url);
+ streamSource = new UrlStreamInput(url);
parser.importStream(streamSource, element, parse);
} catch (Exception e) {
parse.addProblem("couldn't open url "+urlText, e);
@@ -89,12 +89,10 @@
VariableTypeResolverDescriptor variableTypeResolverDescriptor = new VariableTypeResolverDescriptor();
List<Element> typeElements = XmlUtil.elements(element, "type");
- if (typeElements!=null) {
- for (Element typeElement: typeElements) {
- TypeMapping typeMapping = parseTypeMapping(typeElement, parse, parser);
- variableTypeResolverDescriptor.addTypeMapping(typeMapping);
- }
- }
+ for (Element typeElement: typeElements) {
+ TypeMapping typeMapping = parseTypeMapping(typeElement, parse, parser);
+ variableTypeResolverDescriptor.addTypeMapping(typeMapping);
+ }
return variableTypeResolverDescriptor;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/WireBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/WireBinding.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/WireBinding.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -29,7 +29,7 @@
*/
public abstract class WireBinding extends TagBinding {
- static final String WIRE_NAMESPACE = "http://jbpm.org/wire";
+ static final String WIRE_NAMESPACE = "http://jbpm.org/4/cfg";
public WireBinding(String tagName, String category) {
super(tagName, WIRE_NAMESPACE, category);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/BindingParser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/BindingParser.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/BindingParser.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -30,7 +30,6 @@
import org.jbpm.pvm.internal.xml.Bindings;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
-
import org.w3c.dom.Element;
public class BindingParser extends Parser {
@@ -39,31 +38,29 @@
public Object parseDocumentElement(Element documentElement, Parse parse) {
List<Element> elements = XmlUtil.elements(documentElement, "binding");
- if (elements!=null) {
- for (Element bindingElement : elements) {
- String bindingClassName = XmlUtil.attribute(bindingElement, "class");
-
- log.trace("adding wire binding for "+bindingClassName);
+ for (Element bindingElement : elements) {
+ String bindingClassName = XmlUtil.attribute(bindingElement, "class");
+
+ log.trace("adding wire binding for "+bindingClassName);
- Binding binding = null;
- if (bindingClassName!=null) {
- try {
- Class<?> bindingClass = ReflectUtil.loadClass(classLoader, bindingClassName);
- binding = (Binding) bindingClass.newInstance();
- } catch (Exception e) {
- parse.addProblem("couldn't instantiate binding "+bindingClassName, e);
- }
- } else {
- parse.addProblem("class is a required attribute in a binding "+XmlUtil.toString(bindingElement));
+ Binding binding = null;
+ if (bindingClassName!=null) {
+ try {
+ Class<?> bindingClass = ReflectUtil.loadClass(classLoader, bindingClassName);
+ binding = (Binding) bindingClass.newInstance();
+ } catch (Exception e) {
+ parse.addProblem("couldn't instantiate binding "+bindingClassName, e);
}
-
- if (binding!=null) {
- Bindings bindings = parse.findObject(Bindings.class);
- bindings.addBinding(binding);
- } else {
- log.info("WARNING: binding for "+bindingClassName+" could not be parsed. See parsing problems for more details.");
- }
+ } else {
+ parse.addProblem("class is a required attribute in a binding "+XmlUtil.toString(bindingElement));
}
+
+ if (binding!=null) {
+ Bindings bindings = parse.findObject(Bindings.class);
+ bindings.addBinding(binding);
+ } else {
+ log.info("WARNING: binding for "+bindingClassName+" could not be parsed. See parsing problems for more details.");
+ }
}
return null;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -195,16 +195,15 @@
WireDefinition wireDefinition = new WireDefinition();
wireDefinition.setClassLoader(classLoader);
- if (elements!=null) {
- parse.pushObject(wireDefinition);
- try {
- for (Element descriptorElement: elements) {
- parseElement(descriptorElement, parse, CATEGORY_DESCRIPTOR);
- }
- } finally {
- parse.popObject();
+ parse.pushObject(wireDefinition);
+ try {
+ for (Element descriptorElement: elements) {
+ parseElement(descriptorElement, parse, CATEGORY_DESCRIPTOR);
}
+ } finally {
+ parse.popObject();
}
+
return wireDefinition;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -33,12 +33,12 @@
import org.jbpm.JbpmException;
import org.jbpm.log.Log;
-import org.jbpm.pvm.internal.stream.FileStreamSource;
-import org.jbpm.pvm.internal.stream.InputStreamSource;
-import org.jbpm.pvm.internal.stream.ResourceStreamSource;
-import org.jbpm.pvm.internal.stream.StreamSource;
-import org.jbpm.pvm.internal.stream.StringStreamSource;
-import org.jbpm.pvm.internal.stream.UrlStreamSource;
+import org.jbpm.pvm.internal.stream.FileStreamInput;
+import org.jbpm.pvm.internal.stream.InputStreamInput;
+import org.jbpm.pvm.internal.stream.ResourceStreamInput;
+import org.jbpm.pvm.internal.stream.StreamInput;
+import org.jbpm.pvm.internal.stream.StringStreamInput;
+import org.jbpm.pvm.internal.stream.UrlStreamInput;
import org.w3c.dom.Document;
import org.xml.sax.ErrorHandler;
import org.xml.sax.InputSource;
@@ -57,7 +57,7 @@
protected Parser parser;
protected ClassLoader classLoader;
- protected StreamSource streamSource;
+ protected StreamInput streamSource;
protected InputStream inputStream;
protected InputSource inputSource;
@@ -73,19 +73,19 @@
/** specify an input stream as the source for this parse */
public Parse setInputStream(InputStream inputStream) {
- this.streamSource = new InputStreamSource(inputStream);
+ this.streamSource = new InputStreamInput(inputStream);
return this;
}
/** specify a URL as the source for this parse */
public Parse setUrl(URL url) {
- this.streamSource = new UrlStreamSource(url);
+ this.streamSource = new UrlStreamInput(url);
return this;
}
/** specify a file as the source for this parse */
public Parse setFile(File file) {
- this.streamSource = new FileStreamSource(file);
+ this.streamSource = new FileStreamInput(file);
return this;
}
@@ -98,18 +98,18 @@
/** specify a resource as the source for this parse */
public Parse setResource(String resource) {
- this.streamSource = new ResourceStreamSource(resource, classLoader);
+ this.streamSource = new ResourceStreamInput(resource, classLoader);
return this;
}
/** specify an XML string as the source for this parse */
public Parse setString(String xmlString) {
- this.streamSource = new StringStreamSource(xmlString);
+ this.streamSource = new StringStreamInput(xmlString);
return this;
}
- /** specify a {@link StreamSource} as the source for this parse */
- public Parse setStreamSource(StreamSource streamSource) {
+ /** specify a {@link StreamInput} as the source for this parse */
+ public Parse setStreamSource(StreamInput streamSource) {
this.streamSource = streamSource;
return this;
}
@@ -146,17 +146,25 @@
/** part of {@link ErrorHandler} to capture XML parsing problems. */
public void error(SAXParseException e) {
- addProblem(e.getMessage(), e, ProblemImpl.SEVERITY_ERROR);
+ addXmlValidationProblem(e, ProblemImpl.TYPE_XML_VALIDATION_ERROR);
}
+
/** part of {@link ErrorHandler} to capture XML parsing problems. */
public void fatalError(SAXParseException e) {
- addProblem(e.getMessage(), e, ProblemImpl.SEVERITY_FATALERROR);
+ addXmlValidationProblem(e, ProblemImpl.TYPE_XML_VALIDATION_ERROR);
}
/** part of {@link ErrorHandler} to capture XML parsing problems. */
public void warning(SAXParseException e) {
- addProblem(e.getMessage(), e, ProblemImpl.SEVERITY_WARNING);
+ addXmlValidationProblem(e, ProblemImpl.TYPE_XML_VALIDATION_WARNING);
}
-
+
+ protected void addXmlValidationProblem(SAXParseException e, String type) {
+ ProblemImpl problem = new ProblemImpl(e.getMessage(), e, type);
+ problem.setLine(e.getLineNumber());
+ problem.setColumn(e.getColumnNumber());
+ addProblem(problem);
+ }
+
// contextual objects ///////////////////////////////////////////////////////
/** push a contextual object on the stack of this parse. */
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -21,19 +21,22 @@
*/
package org.jbpm.pvm.internal.xml;
-import java.io.File;
-import java.util.HashMap;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Map;
import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
+import org.jbpm.JbpmException;
import org.jbpm.log.Log;
-import org.jbpm.pvm.internal.stream.StreamSource;
+import org.jbpm.pvm.internal.stream.StreamInput;
import org.jbpm.pvm.internal.util.UrlEntity;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.w3c.dom.Document;
@@ -99,7 +102,7 @@
* {@link Parse#setInputStream(java.io.InputStream)},
* {@link Parse#setInputSource(InputSource)},
* {@link Parse#setUrl(java.net.URL)} and
- * {@link Parse#setStreamSource(StreamSource)}.
+ * {@link Parse#setStreamSource(StreamInput)}.
* </p>
*
* <p><b>line 7</b> shows how the execution of the parse is performed. The
@@ -242,21 +245,12 @@
*
* @author Tom Baeyens
*/
-public class Parser implements EntityResolver {
+public class Parser {
private static Log log = Log.getLog(Parser.class.getName());
protected DocumentBuilderFactory documentBuilderFactory = null;
- /* TODO add schema's
-Source schemaSource = new StreamSource(inputStream);
-SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
-Schema schema = schemaFactory.newSchema(schemaSource);
-// Instead of explicitly validating, assign the Schema to the factory
-factory.setSchema(schema);
- */
-
- protected Map<String, Entity> entities = null;
protected Bindings bindings = null;
protected ClassLoader classLoader = null;
@@ -274,7 +268,6 @@
* in specialized subclasses of Parser. */
public Parser(Bindings bindings, Map<String, Entity> entities) {
this.bindings = bindings;
- this.entities = entities;
}
// document builder methods /////////////////////////////////////////////////
@@ -303,48 +296,37 @@
return factory;
}
- // entities /////////////////////////////////////////////////////////////////
-
- /** adds a resolver to the schema catalog.
- * See also <a href="#entityresolving">section 'Entity resolving'</a>. */
- public void addEntity(String publicId, Entity entity) {
- if (entities==null) {
- entities = new HashMap<String, Entity>();
+ // schema validation ////////////////////////////////////////////////////////
+
+ protected void setSchemaResources(List<String> resources) {
+ if ( (resources==null)
+ || (resources.isEmpty())
+ ) {
+ throw new JbpmException("no schema resoures");
}
- entities.put(publicId, entity);
- }
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
- /** makes sure that an {@link EntityResolver} is created based on the {@link Entity}s in this parser.
- * even when none of the {@link #addEntity(String, Entity)} methods are called.
- * This enables addition of entities on a per-{@link Parse} basis when there are no parser-level entities. */
- public void useParseEntityResolver() {
- if (entities==null) {
- entities = new HashMap<String, Entity>();
- }
- }
-
- /** implementation of {@link EntityResolver} based on a map of {@link Entity}s.
- * See also <a href="entityresolving">section 'Entity resolving'</a>.
- * @see #addEntity(String, Entity) */
- public InputSource resolveEntity(String publicId, String systemId) {
- InputSource inputSource = null;
- if (entities!=null) {
- Entity entity = entities.get(publicId);
- if (entity!=null) {
- inputSource = entity.getInputSource();
+ List<Source> schemaSources = new ArrayList<Source>();
+ for (String resource: resources) {
+ InputStream schemaStream = classLoader.getResourceAsStream(resource);
+ if (schemaStream==null) {
+ throw new JbpmException("schema resource "+resource+" unavailable");
}
+ StreamSource schemaSource = new StreamSource(schemaStream);
+ schemaSources.add(schemaSource);
}
- if (inputSource==null) {
- if (systemId!=null) {
- // plan b: see if we can build an inputsource from the systemId
- inputSource = new InputSource(systemId);
- } else {
- log.error("couldn't resolve entity with publicId "+publicId+" and systemId "+systemId);
- }
+ try {
+ Source[] schemaSourceArray = schemaSources.toArray(new Source[schemaSources.size()]);
+ Schema schema = schemaFactory.newSchema(schemaSourceArray);
+ DocumentBuilderFactory factory = getDocumentBuilderFactory();
+ factory.setSchema(schema);
+ factory.setNamespaceAware(true);
+ } catch (Exception e) {
+ log.error("couldn't install schema's for validation: "+e.toString());
}
- return inputSource;
}
-
+
// bindings /////////////////////////////////////////////////////////////////
/** the handlers for specific element types */
@@ -378,7 +360,7 @@
/** builds a dom from the importedStreamSource and appends the child elements
* of the document element to the destination element. Problems are reported
* in the importingParse. */
- public void importStream(StreamSource importedStreamSource, Element destination, Parse importingParse) {
+ public void importStream(StreamInput importedStreamSource, Element destination, Parse importingParse) {
try {
// build the dom of the imported document
Parse importedParse = createParse();
@@ -411,7 +393,7 @@
parseDocument(parse.document, parse);
} catch (Exception e) {
- parse.addProblem("couldn't interpret the dom model", e);
+ parse.addProblem("couldn't interpret the dom model: "+e.getMessage(), e);
}
}
@@ -458,7 +440,6 @@
return null;
}
parse.documentBuilder.setErrorHandler(parse);
- parse.documentBuilder.setEntityResolver(this);
return parse.documentBuilder;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemImpl.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemImpl.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -36,19 +36,20 @@
private static final long serialVersionUID = 1L;
- public static final String SEVERITY_WARNING = "warning";
- public static final String SEVERITY_ERROR = "error";
- public static final String SEVERITY_FATALERROR = "fatal-error";
+ public static final String TYPE_ERROR = "error";
+ public static final String TYPE_WARNING = "warning";
+ public static final String TYPE_XML_VALIDATION_ERROR = "xml validation error";
+ public static final String TYPE_XML_VALIDATION_WARNING = "xml validation warning";
String resource;
- String severity;
- Integer line = -1;
- Integer column = -1;
+ String type;
+ Integer line;
+ Integer column;
String msg;
Throwable cause;
- public ProblemImpl(String msg, Exception e, String severity) {
- this.severity = severity;
+ public ProblemImpl(String msg, Exception e, String type) {
+ this.type = type;
this.msg = msg;
this.cause = e;
if (e instanceof SAXParseException) {
@@ -90,20 +91,20 @@
this.resource = resource;
}
public String getSeverity() {
- return severity;
+ return type;
}
public void setSeverity(String severity) {
- this.severity = severity;
+ this.type = severity;
}
public String toString() {
StringBuffer text = new StringBuffer();
- text.append(severity);
- text.append(" : ");
+ text.append(type);
+ text.append(": ");
text.append(msg);
text.append(" ");
- if ((line!=-1) || (column!=-1) || (resource!=null)) {
+ if ((line!=null) || (column!=null) || (resource!=null)) {
text.append("[");
if (line!=-1) {
text.append("line="+line+" ");
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -62,26 +62,26 @@
problems.add(problem);
}
- /** add a problem with {@link ProblemImpl#SEVERITY_ERROR the default severity}.*/
+ /** add a problem with {@link ProblemImpl#TYPE_ERROR the default severity}.*/
public void addProblem(String msg) {
addProblem(msg, null);
}
/** add a problem with an exception cause and
- * {@link ProblemImpl#SEVERITY_ERROR the default severity}.*/
+ * {@link ProblemImpl#TYPE_ERROR the default severity}.*/
public void addProblem(String msg, Exception e) {
- addProblem(msg, e, ProblemImpl.SEVERITY_ERROR);
+ addProblem(msg, e, ProblemImpl.TYPE_ERROR);
}
- /** adds a problem with {@link ProblemImpl#SEVERITY_WARNING severity warning}.*/
+ /** adds a problem with {@link ProblemImpl#TYPE_WARNING severity warning}.*/
public void addWarning(String msg) {
addWarning(msg, null);
}
- /** adds a problem with {@link ProblemImpl#SEVERITY_WARNING severity warning}
+ /** adds a problem with {@link ProblemImpl#TYPE_WARNING severity warning}
* and an exception as the cause.*/
public void addWarning(String msg, Exception e) {
- addProblem(msg, e, ProblemImpl.SEVERITY_WARNING);
+ addProblem(msg, e, ProblemImpl.TYPE_WARNING);
}
/** adds a problem given message, exception cause and severity */
@@ -102,28 +102,42 @@
public String getProblemsText() {
- String errorMsg = null;
if (problems!=null) {
- StringBuffer errorMsgBuffer = null;
+ StringBuffer errorBuffer = null;
+ StringBuffer warningBuffer = null;
for (Problem p : getProblems()) {
- if (p.getSeverity().equals(ProblemImpl.SEVERITY_ERROR) || p.getSeverity().equals(ProblemImpl.SEVERITY_FATALERROR)) {
- if (errorMsgBuffer==null) {
- errorMsgBuffer = new StringBuffer();
+ if (p.getSeverity().equals(ProblemImpl.TYPE_ERROR)) {
+ if (errorBuffer==null) {
+ errorBuffer = new StringBuffer();
+ errorBuffer.append("errors:");
+ errorBuffer.append(NEWLINE);
}
- errorMsgBuffer.append(NEWLINE);
- errorMsgBuffer.append(" ");
- errorMsgBuffer.append(p.toString());
- if (p.getCause()!=null) {
- log.error(p.toString(), p.getCause());
- } else {
- log.error(p.toString());
+ errorBuffer.append(NEWLINE);
+ errorBuffer.append(" ");
+ errorBuffer.append(p.toString());
+ } else {
+ if (warningBuffer==null) {
+ warningBuffer = new StringBuffer();
+ warningBuffer.append("warnings:");
+ warningBuffer.append(NEWLINE);
}
- } else {
- log.info("WARNING: "+p.toString());
+ warningBuffer.append(NEWLINE);
+ warningBuffer.append(" ");
+ warningBuffer.append(p.toString());
}
}
- errorMsg = (errorMsgBuffer!=null ? errorMsgBuffer.toString() : null);
+ if (errorBuffer!=null) {
+ if (warningBuffer!=null) {
+ errorBuffer.append(NEWLINE);
+ errorBuffer.append(warningBuffer.toString());
+ }
+ return errorBuffer.toString();
+ }
+ if (warningBuffer!=null) {
+ warningBuffer.append(NEWLINE);
+ return warningBuffer.toString();
+ }
}
- return errorMsg;
+ return null;
}
}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/WireParserTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/WireParserTest.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/WireParserTest.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @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.pvm.internal.xml;
-
-import org.jbpm.test.JbpmTestCase;
-
-/**
- * @author Tom Baeyens
- */
-public class WireParserTest extends JbpmTestCase
-{
-
- public void testOne() {
-
- }
-}
Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycleParser.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycleParser.java 2008-12-08 16:53:26 UTC (rev 3274)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycleParser.java 2008-12-08 22:35:29 UTC (rev 3275)
@@ -39,14 +39,12 @@
ProcessDefinitionImpl lifeCycleProcess = new ProcessDefinitionImpl();
List<Element> stateElements = XmlUtil.elements(element, "state");
- if (stateElements!=null) {
- for (Element stateElement: stateElements) {
- parseState(stateElement, lifeCycleProcess, parse);
- }
- for (Element stateElement: stateElements) {
- parseTransitions(stateElement, lifeCycleProcess, parse);
- }
+ for (Element stateElement: stateElements) {
+ parseState(stateElement, lifeCycleProcess, parse);
}
+ for (Element stateElement: stateElements) {
+ parseTransitions(stateElement, lifeCycleProcess, parse);
+ }
String initialStateName = null;
if (element.hasAttribute("initial")) {
@@ -71,10 +69,8 @@
NodeImpl state = (NodeImpl) lifeCycleProcess.getNode(stateName);
List<Element> transitionElements = XmlUtil.elements(element, "transition");
- if (transitionElements!=null) {
- for (Element transitionElement: transitionElements) {
- parseTransition(transitionElement, state, parse);
- }
+ for (Element transitionElement: transitionElements) {
+ parseTransition(transitionElement, state, parse);
}
}
17 years, 4 months