Index: src/java/org/orbeon/oxf/resources/CacheImport.java
===================================================================
RCS file: src/java/org/orbeon/oxf/resources/CacheImport.java
diff -N src/java/org/orbeon/oxf/resources/CacheImport.java
--- src/java/org/orbeon/oxf/resources/CacheImport.java	21 Aug 2004 20:06:20 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,148 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.resources;
-
-
-import com.intersys.objects.CacheDatabase;
-import com.intersys.objects.Database;
-import org.apache.commons.cli.*;
-import org.orbeon.oxf.xml.XMLUtils;
-import org.xml.sax.helpers.DefaultHandler;
-
-import java.io.File;
-import java.io.IOException;
-
-public class CacheImport {
-
-    public static final String DEFAULT_URL = "jdbc:Cache://localhost:1972/OXF";
-    public static final String DEFAULT_USERNAME = "_SYSTEM";
-    public static final String DEFAULT_PASSWORD = "sys";
-
-    private String resourceDir;
-    private String url;
-    private String username;
-    private String password;
-
-
-    private void start() {
-        try {
-            Database db = CacheDatabase.getDatabase(url, username, password);
-            File rootDir = new File(resourceDir);
-            if (!rootDir.exists() || !rootDir.isDirectory())
-                System.out.println(resourceDir + " doesn't exist or is not a directory");
-            else
-                importDir(db, rootDir);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-    }
-
-    private void importDir(Database db, File root) {
-        try {
-            File[] files = root.listFiles();
-            if (files == null)
-                throw new RuntimeException("Can't list directory: " + root.getCanonicalPath());
-            else {
-                for (int i = 0; i < files.length; i++) {
-                    File current = files[i];
-                    if (current.isDirectory()) {
-                        if (!current.getName().equals("CVS"))
-                            importDir(db, current);
-                    } else
-                        importFile(db, current);
-                }
-            }
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    private void importFile(Database db, File file) {
-        try {
-            if (!isXMLFile(file))
-                return;
-
-            eXtc.DOMAPI.openDOM(db);
-
-            String fileName = file.getCanonicalPath();
-            String key = fileName.substring(new File(resourceDir).getCanonicalPath().length()).replace('\\', '/');
-            System.out.print("Importing file: " + fileName + " with key " + key + " ... ");
-
-            eXtc.Document doc = eXtc.DOMAPI.getDocumentNode(db, key);
-            if (doc != null) {
-                if (doc.getcreationDate().getTime() >= file.lastModified()) {
-                    System.out.println("skipping.");
-                    return;
-                }
-                System.out.print(" Removing document first ...");
-                eXtc.DOMAPI.removeDocument(db, key, "0", "0");
-            }
-
-            eXtc.XMLAPI.parseXMLFile(db, fileName, "0", "1", key, "0");
-            System.out.println("Done");
-            eXtc.DOMAPI.closeDOM(db);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-
-    }
-
-    private boolean isXMLFile(File file) {
-        try {
-            XMLUtils.newSAXParser().parse(file, new DefaultHandler());
-            return true;
-        } catch (Exception e) {
-            return false;
-        }
-    }
-
-
-    private void parseArgs(String[] args) {
-        Options options = new Options();
-        options.addOption('r', "root", true, "Resource Root", false);
-        options.addOption('u', "url", true, "Cache URL", false);
-        options.addOption('l', "login", true, "Cache Login", false);
-        options.addOption('p', "password", true, "Cache Password", false);
-        try {
-            CommandLine cmd = options.parse(args, true);
-
-            resourceDir = cmd.getOptionValue('r', ".");
-            url = cmd.getOptionValue('u', DEFAULT_URL);
-            username = cmd.getOptionValue('l', DEFAULT_USERNAME);
-            password = cmd.getOptionValue('p', DEFAULT_PASSWORD);
-
-        } catch (MissingArgumentException e) {
-            new HelpFormatter().printHelp("Missing argument", options);
-            System.exit(1);
-        } catch (UnrecognizedOptionException e) {
-            new HelpFormatter().printHelp("Unrecognized option", options);
-            System.exit(1);
-        } catch (MissingOptionException e) {
-            new HelpFormatter().printHelp("Missing option", options);
-            System.exit(1);
-        } catch (Exception e) {
-            new HelpFormatter().printHelp("Unknown error", options);
-            System.exit(1);
-        }
-
-    }
-
-    public static void main(String[] args) {
-        CacheImport ci = new CacheImport();
-        ci.parseArgs(args);
-        ci.start();
-    }
-
-}
Index: src/java/org/orbeon/oxf/resources/CacheResourceManagerFactory.java
===================================================================
RCS file: src/java/org/orbeon/oxf/resources/CacheResourceManagerFactory.java
diff -N src/java/org/orbeon/oxf/resources/CacheResourceManagerFactory.java
--- src/java/org/orbeon/oxf/resources/CacheResourceManagerFactory.java	21 Aug 2004 20:06:20 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,33 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.resources;
-
-import java.util.Map;
-
-public class CacheResourceManagerFactory implements ResourceManagerFactoryFunctor {
-
-    public static final String CACHE_URL = "oxf.resources.cache.url";
-    public static final String CACHE_USERNAME = "oxf.resources.cache.username";
-    public static final String CACHE_PASSWORD = "oxf.resources.cache.password";
-
-    Map props;
-
-    public CacheResourceManagerFactory(Map props) {
-        this.props = props;
-    }
-
-    public ResourceManager makeInstance() {
-        return new CacheResourceManagerImpl(props);
-    }
-}
Index: src/java/org/orbeon/oxf/resources/XMLDBImport.java
===================================================================
RCS file: src/java/org/orbeon/oxf/resources/XMLDBImport.java
diff -N src/java/org/orbeon/oxf/resources/XMLDBImport.java
--- src/java/org/orbeon/oxf/resources/XMLDBImport.java	21 Aug 2004 20:06:22 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,156 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.resources;
-
-import org.apache.commons.cli.*;
-import org.orbeon.oxf.common.OXFException;
-import org.orbeon.oxf.xml.XMLUtils;
-import org.w3c.dom.Document;
-import org.xmldb.api.DatabaseManager;
-import org.xmldb.api.base.Collection;
-import org.xmldb.api.base.Database;
-import org.xmldb.api.modules.XMLResource;
-
-import java.io.File;
-
-
-public class XMLDBImport {
-
-    public static final String DEFAULT_URL = "xmldb:tamino:/localhost/tamino/oxf/ino:etc";
-    public static final String DEFAULT_USERNAME = "jmercay";
-    public static final String DEFAULT_PASSWORD = "gulliver";
-
-    private String resourceDir;
-    private String url;
-    private String username;
-    private String password;
-
-
-    private void start() {
-        try {
-            Database db = (Database) Class.forName("com.softwareag.tamino.xmldb.api.base.TDatabase").newInstance();
-            DatabaseManager.registerDatabase(db);
-            Collection rootCollection = DatabaseManager.getCollection(url, username, password);
-            File rootDir = new File(resourceDir);
-            if (!rootDir.exists() || !rootDir.isDirectory())
-                System.out.println(resourceDir + " doesn't exist or is not a directory");
-            else
-                importDir(rootCollection, rootDir);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-    }
-
-    private void importDir(Collection collection, File root) {
-        try {
-            File[] files = root.listFiles();
-            if (files == null)
-                throw new RuntimeException("Can't list directory: " + root.getCanonicalPath());
-            else {
-                for (int i = 0; i < files.length; i++) {
-                    File current = files[i];
-                    if (current.isDirectory()) {
-                        if (!current.getName().equals("CVS")) {
-//                            Collection c = collection.getChildCollection(current.getName());
-//                            if (c == null) {
-//                                CollectionManagementService service = new TCollectionManagementService(collection);
-//                                c = service.createCollection(current.getName());
-//                            }
-                            importDir(collection, current);
-                        }
-                    } else
-                        importFile(collection, current);
-                }
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            throw new RuntimeException(e);
-        }
-    }
-
-    private void importFile(Collection collection, File file) {
-        try {
-            String fileName = file.getCanonicalPath();
-            System.out.println("Importing file: " + fileName + " in collection: " + collection.getName());
-            Document doc;
-            try {
-                doc = XMLUtils.fileToDOM(file);
-            } catch (OXFException e) {
-                System.out.println("skipped");
-                return;
-            }
-            System.out.println(" XML ");
-            XMLResource resource = (XMLResource) collection.createResource(fileName, XMLResource.RESOURCE_TYPE);
-
-            resource.setContentAsDOM(doc);
-            collection.storeResource(resource);
-
-
-//                System.out.print(" Binary ");
-//                BinaryResource resource =
-//                        (BinaryResource) collection.createResource(fileName, BinaryResource.RESOURCE_TYPE);
-//
-//                byte[] bytes = new byte[new Long(file.length()).intValue()];
-//                InputStream is = new FileInputStream(file);
-//                is.read(bytes);
-//                resource.setContent(bytes);
-//                collection.storeResource(resource);
-
-            System.out.println(" ... Done");
-        } catch (Exception e) {
-            e.printStackTrace();
-            throw new RuntimeException(e);
-        }
-
-    }
-
-
-    private void parseArgs(String[] args) {
-        Options options = new Options();
-        options.addOption('r', "root", true, "Resource Root", false);
-        options.addOption('u', "url", true, "Cache URL", false);
-        options.addOption('l', "login", true, "Cache Login", false);
-        options.addOption('p', "password", true, "Cache Password", false);
-        try {
-            CommandLine cmd = options.parse(args, true);
-
-            resourceDir = cmd.getOptionValue('r', ".");
-            url = cmd.getOptionValue('u', DEFAULT_URL);
-            username = cmd.getOptionValue('l', DEFAULT_USERNAME);
-            password = cmd.getOptionValue('p', DEFAULT_PASSWORD);
-
-        } catch (MissingArgumentException e) {
-            new HelpFormatter().printHelp("Missing argument", options);
-            System.exit(1);
-        } catch (UnrecognizedOptionException e) {
-            new HelpFormatter().printHelp("Unrecognized option", options);
-            System.exit(1);
-        } catch (MissingOptionException e) {
-            new HelpFormatter().printHelp("Missing option", options);
-            System.exit(1);
-        } catch (Exception e) {
-            new HelpFormatter().printHelp("Unknown error", options);
-            System.exit(1);
-        }
-
-    }
-
-    public static void main(String[] args) {
-        XMLDBImport ci = new XMLDBImport();
-        ci.parseArgs(args);
-        ci.start();
-    }
-
-}
Index: src/java/org/orbeon/oxf/resources/CacheResourceManagerImpl.java
===================================================================
RCS file: src/java/org/orbeon/oxf/resources/CacheResourceManagerImpl.java
diff -N src/java/org/orbeon/oxf/resources/CacheResourceManagerImpl.java
--- src/java/org/orbeon/oxf/resources/CacheResourceManagerImpl.java	7 May 2006 21:15:09 -0000	1.6
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,289 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.resources;
-
-import com.intersys.objects.CacheDatabase;
-import com.intersys.objects.CacheException;
-import com.intersys.objects.Database;
-import org.apache.log4j.Logger;
-import org.dom4j.Document;
-import org.dom4j.io.DocumentSource;
-import org.orbeon.oxf.common.OXFException;
-import org.orbeon.oxf.util.LoggerFactory;
-import org.orbeon.oxf.xml.ForwardingContentHandler;
-import org.orbeon.oxf.xml.TransformerUtils;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.sax.TransformerHandler;
-import javax.xml.transform.stream.StreamResult;
-import java.io.*;
-import java.util.Map;
-
-public class CacheResourceManagerImpl extends ResourceManagerBase {
-
-    private static Logger logger = LoggerFactory.createLogger(CacheResourceManagerImpl.class);
-
-    private String url;
-    private String username;
-    private String password;
-    private Database db;
-
-    public CacheResourceManagerImpl(Map props) throws OXFException {
-        super(props);
-        url = (String) props.get(CacheResourceManagerFactory.CACHE_URL);
-        if (url == null)
-            throw new OXFException("Property " + CacheResourceManagerFactory.CACHE_URL + " is null");
-        username = (String) props.get(CacheResourceManagerFactory.CACHE_USERNAME);
-        if (username == null)
-            throw new OXFException("Property " + CacheResourceManagerFactory.CACHE_USERNAME + " is null");
-        password = (String) props.get(CacheResourceManagerFactory.CACHE_PASSWORD);
-        if (password == null)
-            throw new OXFException("Property " + CacheResourceManagerFactory.CACHE_PASSWORD + " is null");
-
-        try {
-            db = CacheDatabase.getDatabase(url, username, password);
-        } catch (CacheException e) {
-            throw new OXFException(e);
-        }
-    }
-
-
-    /**
-     * Returns a binary input stream for the specified key. The key could point
-     * to any document type (text or binary).
-     * @param key A Resource Manager key
-     * @return a input stream
-     */
-    public InputStream getContentAsStream(String key) {
-        if (logger.isDebugEnabled())
-            logger.debug("getContentAsStream(" + key + ")");
-        try {
-            return new ByteArrayInputStream(getDocumentAsString(key).getBytes("utf-8"));
-        } catch (ResourceNotFoundException rnfe) {
-            throw rnfe;
-        } catch (Exception e) {
-            throw new OXFException("Cannot read from file " + key, e);
-        }
-    }
-
-    /**
-     * Returns a character reader from the resource manager for the specified
-     * key. The key could point to any text document.
-     * @param key A Resource Manager key
-     * @return a character reader
-     */
-    public Reader getContentAsReader(String key) {
-        if (logger.isDebugEnabled())
-            logger.debug("getContentAsReader(" + key + ")");
-        try {
-            return new StringReader(getDocumentAsString(key));
-        } catch (ResourceNotFoundException rnfe) {
-            throw rnfe;
-        } catch (Exception e) {
-            throw new OXFException("Cannot read from file " + key, e);
-        }
-    }
-
-    private String getDocumentAsString(String key) {
-        eXtc.Document doc = null;
-        try {
-            doc = eXtc.DOMAPI.getDocumentNode(db, key);
-            if (doc == null) {
-                if (logger.isDebugEnabled())
-                    logger.debug("DOM not found: " + key);
-                throw new ResourceNotFoundException("Cannot read from file " + key);
-            }
-            DOMSource source = new DOMSource(doc);
-            StringWriter buffer = new StringWriter();
-            StreamResult result = new StreamResult(buffer);
-            TransformerUtils.getIdentityTransformer().transform(source, result);
-            return buffer.toString();
-        } catch (ResourceNotFoundException rnfe) {
-            throw rnfe;
-        } catch (Exception e) {
-            throw new OXFException(e);
-        }
-
-    }
-
-
-    public Node getContentAsDOM(String key) {
-        if (logger.isDebugEnabled())
-            logger.debug("getContentAsDOM(" + key + ")");
-        try {
-            eXtc.Document doc = eXtc.DOMAPI.getDocumentNode(db, key);
-            if (doc == null)
-                throw new ResourceNotFoundException("Cannot read from file " + key);
-            else
-                return doc;
-        } catch (CacheException e) {
-            throw new OXFException(e);
-        }
-    }
-
-
-    public void getContentAsSAX(final String key, ContentHandler handler, boolean validating, boolean handleXInclude) {
-        if (logger.isDebugEnabled())
-            logger.debug("getContentAsSAX(" + key + ")");
-        try {
-            eXtc.DOMAPI.openDOM(db);
-            eXtc.Document doc = eXtc.DOMAPI.getDocumentNode(db, key);
-            if (doc == null)
-                throw new ResourceNotFoundException("Cannot read from file " + key);
-            else {
-                try {
-                    TransformerUtils.getIdentityTransformer().transform(new DOMSource(doc), new SAXResult(new ForwardingContentHandler(handler) {
-
-                        public void startDocument() throws SAXException {
-                            super.startDocument();
-                            super.setDocumentLocator(new Locator() {
-                                public int getColumnNumber() {
-                                    return 0;
-                                }
-
-                                public int getLineNumber() {
-                                    return 0;
-                                }
-
-                                public String getPublicId() {
-                                    return "";
-                                }
-
-                                public String getSystemId() {
-                                    return "oxf:" + key;
-                                }
-                            });
-                        }
-
-                        public void setDocumentLocator(Locator locator) {
-                        }
-
-                    }));
-                } catch (TransformerException e) {
-                    throw new OXFException(e);
-                }
-            }
-            eXtc.DOMAPI.closeDOM(db);
-        } catch (CacheException e) {
-            throw new OXFException(e);
-        }
-    }
-
-    /**
-     * Gets the last modified timestamp for the specofoed resource
-     * @param key A Resource Manager key
-     * @param doNotThrowResourceNotFound
-     * @return a timestamp
-     */
-    public long lastModifiedImpl(String key, boolean doNotThrowResourceNotFound) {
-        try {
-            eXtc.Document doc = eXtc.DOMAPI.getDocumentNode(db, key);
-            if (doc == null)
-                throw new ResourceNotFoundException("Cannot read from file " + key);
-            return doc.getcreationDate().getTime();
-        } catch (CacheException e) {
-            throw new OXFException(e);
-        }
-    }
-
-    /**
-     * Returns the length of the file denoted by this abstract pathname.
-     * @return The length, in bytes, of the file denoted by this abstract pathname, or 0L if the file does not exist
-     */
-    public int length(String key) {
-        if (logger.isDebugEnabled())
-            logger.debug("length(" + key + ")");
-        try {
-            return getDocumentAsString(key).length();
-        } catch (Exception e) {
-            throw new OXFException("Cannot read from file " + key, e);
-        }
-    }
-
-    /**
-     * Indicates if the resource manager implementation suports write operations
-     * @return true if write operations are allowed
-     */
-    public boolean canWrite(String key) {
-        return true;
-    }
-
-    /**
-     * Allows writing to the resource
-     * @param key A Resource Manager key
-     * @return an output stream
-     */
-    public OutputStream getOutputStream(String key) {
-        throw new OXFException("Not supported");
-    }
-
-    /**
-     * Allow writing to the resource
-     * @param key A Resource Manager key
-     * @return  a writer
-     */
-    public Writer getWriter(String key) {
-        throw new OXFException("Not supported");
-    }
-
-    public void writeDOM(String key, Node node) {
-        if (node instanceof Element) {
-            try {
-                Element el = (Element) node;
-                DOMResult result = new DOMResult(eXtc.DOMAPI.createDocument(db, el.getNamespaceURI(), el.getNodeName(), key));
-                TransformerUtils.getIdentityTransformer().transform(new DOMSource(node), result);
-            } catch (Exception e) {
-                throw new OXFException(e);
-            }
-        } else
-            throw new OXFException("Node is not an instance of element");
-
-    }
-
-    public void writeDOM4J(String key, Document document) {
-        try {
-            org.dom4j.Element el = document.getRootElement();
-            DOMResult result = new DOMResult(eXtc.DOMAPI.createDocument(db, el.getNamespaceURI(), el.getName(), key));
-            TransformerUtils.getIdentityTransformer().transform(new DocumentSource(document), result);
-        } catch (Exception e) {
-            throw new OXFException(e);
-        }
-    }
-
-    public ContentHandler getWriteContentHandler(String key) {
-        try {
-            TransformerHandler handler = TransformerUtils.getIdentityTransformerHandler();
-            DOMResult result = new DOMResult(eXtc.DOMAPI.createDocument(db, "", "", key));
-            handler.setResult(result);
-            return handler;
-        } catch (Exception e) {
-            throw new OXFException(e);
-        }
-
-    }
-
-    public String getRealPath(String key) {
-        return null;
-    }
-
-
-}
Index: src/java/org/orbeon/oxf/processor/bpel/BPELProcessor.java
===================================================================
RCS file: src/java/org/orbeon/oxf/processor/bpel/BPELProcessor.java
diff -N src/java/org/orbeon/oxf/processor/bpel/BPELProcessor.java
--- src/java/org/orbeon/oxf/processor/bpel/BPELProcessor.java	31 Mar 2005 01:09:28 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,138 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.processor.bpel;
-
-import org.apache.log4j.Logger;
-import org.dom4j.Element;
-import org.dom4j.QName;
-import org.orbeon.oxf.pipeline.api.PipelineContext;
-import org.orbeon.oxf.processor.CacheableInputReader;
-import org.orbeon.oxf.processor.ProcessorImpl;
-import org.orbeon.oxf.processor.ProcessorInput;
-import org.orbeon.oxf.processor.ProcessorInputOutputInfo;
-import org.orbeon.oxf.processor.bpel.activity.ActivityUtils;
-import org.orbeon.oxf.processor.pipeline.PipelineProcessor;
-import org.orbeon.oxf.processor.pipeline.ast.ASTDocumentHandler;
-import org.orbeon.oxf.processor.pipeline.ast.ASTParam;
-import org.orbeon.oxf.processor.pipeline.ast.ASTPipeline;
-import org.orbeon.oxf.util.LoggerFactory;
-import org.orbeon.oxf.xml.dom4j.Dom4jUtils;
-import org.xml.sax.ContentHandler;
-
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-public class BPELProcessor extends ProcessorImpl {
-
-    static private Logger logger = LoggerFactory.createLogger(BPELProcessor.class);
-
-    public BPELProcessor() {
-        // TODO: support schema
-        addInputInfo(new ProcessorInputOutputInfo(INPUT_CONFIG/*, BPELConstants.BPEL_NAMESPACE_URI*/));
-    }
-
-    public org.orbeon.oxf.processor.ProcessorOutput createOutput(final String name) {
-        org.orbeon.oxf.processor.ProcessorOutput output = new org.orbeon.oxf.processor.ProcessorImpl.CacheableTransformerOutputImpl(getClass(), name) {
-            public void readImpl(org.orbeon.oxf.pipeline.api.PipelineContext context, ContentHandler contentHandler) {
-                State state = initState(context);
-                state.pipelineProcessor.getOutputByName(name).read(context, contentHandler);
-            }
-        };
-        addOutput(name, output);
-        return output;
-    }
-
-    public State initState(PipelineContext context) {
-        State state = (State) getState(context);
-        if (state.pipelineProcessor == null) {
-            state.pipelineProcessor = (PipelineProcessor) readCacheInputAsObject
-                    (context, getInputByName(INPUT_CONFIG), new CacheableInputReader() {
-                public Object read(final org.orbeon.oxf.pipeline.api.PipelineContext context, ProcessorInput input) {
-
-                    // Variables that get modified as we read the BPEL program
-                    Variables variables = new Variables();
-                    ASTPipeline astPipeline = new ASTPipeline();
-                    List statements = astPipeline.getStatements();
-
-                    // Read BPEL program
-                    Element processElement = readInputAsDOM4J(context, INPUT_CONFIG).getRootElement();
-                    ActivityUtils.activitiesToXPL(variables, statements,
-                            Arrays.asList(new Object[] {processElement.element(new QName("variables", BPELConstants.BPEL_NAMESPACE))}));
-                    ActivityUtils.activitiesToXPL(variables, statements,
-                            processElement.element(new QName("sequence", BPELConstants.BPEL_NAMESPACE)).elements());
-
-                    // Add input and output parameters
-                    for (Iterator i = variables.iterateVariablesParts(); i.hasNext();) {
-                        Variables.VariablePart variablePart = (Variables.VariablePart) i.next();
-                        if (variables.getInputVariable() != null
-                                && variables.getInputVariable().equals(variablePart.getVariable()))
-                            astPipeline.addParam(new ASTParam(ASTParam.INPUT, variablePart.getPart()));
-                        if (variables.getOutputVariable() != null
-                                && variables.getOutputVariable().equals(variablePart.getVariable())) {
-                            astPipeline.addParam(new ASTParam(ASTParam.OUTPUT, variablePart.getPart()));
-                        }
-                    }
-
-                    // Log pipeline
-                    if (logger.isDebugEnabled()) {
-                        ASTDocumentHandler astDocumentHandler = new ASTDocumentHandler();
-                        astPipeline.walk(astDocumentHandler);
-                        logger.debug("BPEL pipeline:\n"
-                                + Dom4jUtils.domToString(astDocumentHandler.getDocument()));
-                    }
-
-                    // Connect processor
-                    PipelineProcessor pipelineProcessor = new PipelineProcessor(astPipeline);
-                    for (Iterator i = astPipeline.getParams().iterator(); i.hasNext();) {
-                        ASTParam astParam = (ASTParam) i.next();
-                        if (astParam.getType() == ASTParam.OUTPUT) {
-                            pipelineProcessor.createOutput(astParam.getName());;
-                        }
-                        if (astParam.getType() == ASTParam.INPUT) {
-                            pipelineProcessor.createInput(astParam.getName())
-                                    .setOutput(new ForwardingProcessorOutput(astParam.getName()));
-                        }
-                    }
-                    return pipelineProcessor;
-                }
-            });
-            state.pipelineProcessor.reset(context);
-        }
-        return state;
-    }
-
-    public void start(PipelineContext context) {
-        State state = initState(context);
-        state.pipelineProcessor.start(context);
-    }
-
-    private class ForwardingProcessorOutput extends ProcessorOutputImpl {
-        public ForwardingProcessorOutput(String name) {
-            super(BPELProcessor.class, name);
-        }
-
-        protected void readImpl(PipelineContext context, ContentHandler contentHandler) {
-            readInputAsSAX(context, getName(), contentHandler);
-        }
-    }
-
-    public void reset(PipelineContext context) {
-        setState(context, new State());
-    }
-
-    private static class State {
-        PipelineProcessor pipelineProcessor;
-    }
-}
Index: src/java/org/orbeon/oxf/processor/bpel/JaxenXPathRewrite.java
===================================================================
RCS file: src/java/org/orbeon/oxf/processor/bpel/JaxenXPathRewrite.java
diff -N src/java/org/orbeon/oxf/processor/bpel/JaxenXPathRewrite.java
--- src/java/org/orbeon/oxf/processor/bpel/JaxenXPathRewrite.java	11 May 2006 01:09:12 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,87 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.processor.bpel;
-
-import org.jaxen.JaxenHandler;
-import org.jaxen.expr.Expr;
-import org.jaxen.expr.FunctionCallExpr;
-import org.jaxen.expr.XPathExpr;
-import org.orbeon.oxf.common.OXFException;
-import org.orbeon.oxf.common.ValidationException;
-import org.orbeon.oxf.xml.dom4j.LocationData;
-import org.orbeon.oxf.xml.JaxenSimpleVisitor;
-import org.saxpath.SAXPathException;
-import org.saxpath.XPathReader;
-import org.saxpath.helpers.XPathReaderFactory;
-
-import java.util.Map;
-
-/**
- * Utility class to rewrite XPath expression, in particular to change function
- * calls.
- */
-public class JaxenXPathRewrite {
-
-    public interface Rewriter {
-        public void rewrite(FunctionCallExpr expr);
-    }
-
-    public static String rewrite(String xpath, final Map namespaceContext,
-                          final String functionURI, final String functionName,
-                          final int parametersCount, final LocationData locationData,
-                          final Rewriter rewriter) {
-        try {
-            // Create reader and stuff to parse XPath expression
-            JaxenHandler handler = new JaxenHandler(); {
-                XPathReader reader = XPathReaderFactory.createReader();
-                reader.setXPathHandler(handler);
-                reader.parse(xpath);
-            }
-            XPathExpr xpathExpr = handler.getXPathExpr();
-            Expr expr = xpathExpr.getRootExpr();
-
-            // Visit XPath and change call to bpws:getVariableData()
-            expr.accept(new JaxenSimpleVisitor() {
-                public void visit(FunctionCallExpr expr) {
-
-                    // Check prefix
-                    String prefix = expr.getPrefix();
-                    if (prefix != null && !"".equals(prefix)) {
-                        if (namespaceContext == null)
-                            throw new OXFException("Function in namespace not supported: '" + expr.getPrefix() + ":"
-                                    + expr.getFunctionName() + "'");
-                        String uri = (String) namespaceContext.get(prefix);
-                        if (functionURI == null || !functionURI.equals(uri))
-                            return;
-                    }
-
-                    // Check local name
-                    if (!expr.getFunctionName().equals(functionName)) return;
-
-                    // Check parameter count
-                    if (expr.getParameters().size() != parametersCount)
-                        throw new ValidationException(functionName + " expected " + parametersCount + " arguments",
-                                locationData);
-
-                    // Everything is ok: run rewriter
-                    rewriter.rewrite(expr);
-                }
-            });
-            return expr.getText();
-
-        } catch (SAXPathException e) {
-            throw new OXFException(e.getMessage() + " while parsing XPath expression '" + xpath + "'");
-        }
-    }
-}
Index: src/java/org/orbeon/oxf/processor/bpel/Variables.java
===================================================================
RCS file: src/java/org/orbeon/oxf/processor/bpel/Variables.java
diff -N src/java/org/orbeon/oxf/processor/bpel/Variables.java
--- src/java/org/orbeon/oxf/processor/bpel/Variables.java	21 Aug 2004 20:06:04 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,307 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.processor.bpel;
-
-import org.orbeon.oxf.common.OXFException;
-
-import java.util.*;
-
-public class Variables implements Cloneable {
-
-    private Map variableToParts = new HashMap();
-    private String inputVariable;
-    private String outputVariable;
-
-    public void declareVariable(String variable) {
-        variableToParts.put(variable,  new HashMap());
-    }
-
-    public void setInputVariable(String variable) {
-        this.inputVariable = variable;
-    }
-
-    public String getInputVariable() {
-        return inputVariable;
-    }
-
-    public String getOutputVariable() {
-        return outputVariable;
-    }
-
-    public void setOutputVariable(String outputVariable) {
-        this.outputVariable = outputVariable;
-    }
-
-    public String getCurrentIdForVariablePart(String variable, String part) {
-        int count = getCurrentCountForVariablePart(variable,  part);
-        return variable.equals(inputVariable) && count == 1
-                ? part
-                : buildId(variable, part, getCurrentCountForVariablePart(variable,  part));
-    }
-
-    public String getNewIdForVariablePart(String variable, String part) {
-        Map parts = getParts(variable);
-        Integer count = (Integer) parts.get(part);
-        if (count == null) {
-            count = new Integer(1);
-        } else {
-            count = new Integer(count.intValue() + 1);
-        }
-        parts.put(part, count);
-        return buildId(variable, part, count.intValue());
-    }
-
-    /**
-     * @return The union of this variables declared in the current object with
-     * the variables declared in the other object. When a variable is declared
-     * in both, its id in the returned object is the maximum of the two ids.
-     */
-    public Variables max(Variables other) {
-        Variables result = new Variables();
-        result.inputVariable = other.inputVariable;
-        result.outputVariable = other.outputVariable;
-
-        // Declare all variables from this and other
-        for (Iterator i = this.variableToParts.keySet().iterator(); i.hasNext();)
-            result.declareVariable((String) i.next());
-        for (Iterator i = other.variableToParts.keySet().iterator(); i.hasNext();)
-            result.declareVariable((String) i.next());
-
-        // Create iterators
-        Iterator thisIterator = this.iterateVariablesParts();
-        Iterator otherIterator = other.iterateVariablesParts();
-        VariablePart thisCurrent = thisIterator.hasNext() ? (VariablePart) thisIterator.next() : null;
-        VariablePart otherCurrent = otherIterator.hasNext() ? (VariablePart) otherIterator.next() : null;
-
-        while (thisCurrent != null || otherCurrent != null) {
-            if (thisCurrent != null && otherCurrent != null
-                    && thisCurrent.getVariable().equals(otherCurrent.getVariable())
-                    && thisCurrent.getPart().equals(otherCurrent.getPart())) {
-                // Add the one with the highest count
-                int thisCount = this.getCurrentCountForVariablePart(thisCurrent.getVariable(), thisCurrent.getPart());
-                int otherCount = other.getCurrentCountForVariablePart(otherCurrent.getVariable(), otherCurrent.getPart());
-                result.setVariablePart(thisCurrent.getVariable(), thisCurrent.getPart(),
-                        Math.max(thisCount, otherCount));
-                thisCurrent = thisIterator.hasNext() ? (VariablePart) thisIterator.next() : null;
-                otherCurrent = otherIterator.hasNext() ? (VariablePart) otherIterator.next() : null;
-            } else if (otherCurrent == null || (thisCurrent != null &&
-                    (thisCurrent.getVariable().compareTo(otherCurrent.getVariable()) <= 0
-                    || thisCurrent.getVariable().compareTo(otherCurrent.getVariable()) < 0))) {
-                // Add thisCurrent
-                result.setVariablePart(thisCurrent.getVariable(), thisCurrent.getPart(),
-                        getCurrentCountForVariablePart(thisCurrent.getVariable(), thisCurrent.getPart()));
-                thisCurrent = thisIterator.hasNext() ? (VariablePart) thisIterator.next() : null;
-            } else {
-                // Add otherCurrent
-                result.setVariablePart(otherCurrent.getVariable(), otherCurrent.getPart(),
-                        other.getCurrentCountForVariablePart(otherCurrent.getVariable(), otherCurrent.getPart()));
-                otherCurrent = otherIterator.hasNext() ? (VariablePart) otherIterator.next() : null;
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * @return A new object with all the variables declared in this object that
-     * are not declared in the other object, or that have a higher id in the
-     * this object.
-     *
-     * Other shall not contain any variable/part not contained in this.
-     */
-    public Variables minus(Variables other) {
-        Variables result = new Variables();
-        result.inputVariable = inputVariable;
-        result.outputVariable = outputVariable;
-        Iterator thisIterator = this.iterateVariablesParts();
-        Iterator otherIterator = other.iterateVariablesParts();
-        VariablePart thisCurrent = thisIterator.hasNext() ? (VariablePart) thisIterator.next() : null;
-        VariablePart otherCurrent = otherIterator.hasNext() ? (VariablePart) otherIterator.next() : null;
-
-        while (thisCurrent != null || otherCurrent != null) {
-            if (thisCurrent != null && otherCurrent != null
-                    && thisCurrent.getVariable().equals(otherCurrent.getVariable())
-                    && thisCurrent.getPart().equals(otherCurrent.getPart())) {
-                // Add if this higher than other
-                int thisCount = this.getCurrentCountForVariablePart(thisCurrent.getVariable(), thisCurrent.getPart());
-                int otherCount = other.getCurrentCountForVariablePart(otherCurrent.getVariable(), otherCurrent.getPart());
-                if (thisCount > otherCount)
-                    result.setVariablePart(thisCurrent.getVariable(), thisCurrent.getPart(), thisCount);
-                thisCurrent = thisIterator.hasNext() ? (VariablePart) thisIterator.next() : null;
-                otherCurrent = otherIterator.hasNext() ? (VariablePart) otherIterator.next() : null;
-            } else if (otherCurrent == null || (thisCurrent != null &&
-                    (thisCurrent.getVariable().compareTo(otherCurrent.getVariable()) <= 0
-                    || thisCurrent.getVariable().compareTo(otherCurrent.getVariable()) < 0))) {
-                // Add thisCurrent
-                result.setVariablePart(thisCurrent.getVariable(), thisCurrent.getPart(),
-                        getCurrentCountForVariablePart(thisCurrent.getVariable(), thisCurrent.getPart()));
-                thisCurrent = thisIterator.hasNext() ? (VariablePart) thisIterator.next() : null;
-            } else {
-                throw new OXFException("Current object does not have a variable '" + otherCurrent.getVariable()
-                        + "' part '" + otherCurrent.getPart() + "'");
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * @return An iterator over instance of VariablePart. The VariablePart are
-     * returned ordered by variable/part.
-     */
-    public Iterator iterateVariablesParts() {
-        return new Iterator() {
-
-            private String currentVariable;
-            private Iterator variablesIterator;
-            private Iterator partsIterator;
-
-            {
-                List variablesNames = new ArrayList(variableToParts.keySet());
-                Collections.sort(variablesNames);
-                variablesIterator = variablesNames.iterator();
-                nextVariable();
-            }
-
-            public boolean hasNext() {
-                return partsIterator != null;
-            }
-
-            public Object next() {
-                VariablePart result = new VariablePart(currentVariable, (String) partsIterator.next());
-                if (! partsIterator.hasNext())
-                    nextVariable();
-                return result;
-            }
-
-            public void remove() {
-                throw new UnsupportedOperationException();
-            }
-
-            private void nextVariable() {
-                while (true) {
-                    if (! variablesIterator.hasNext()) {
-                        partsIterator = null;
-                        break;
-                    }
-                    currentVariable = (String) variablesIterator.next();
-                    Map parts = getParts(currentVariable);
-                    if (!parts.isEmpty()) {
-                        List partsNames = new ArrayList(parts.keySet());
-                        Collections.sort(partsNames);
-                        partsIterator = partsNames.iterator();
-                        break;
-                    }
-                }
-            }
-        };
-    }
-
-    /**
-     * Make this object an alias to the <code>variables</code> parameter. Any
-     * modification to <code>variables</code> will impact this object and
-     * vice-versa.
-     */
-    public void alias(Variables variables) {
-        this.variableToParts = variables.variableToParts;
-        this.inputVariable = variables.inputVariable;
-        this.outputVariable = variables.outputVariable;
-    }
-
-    public Object clone() {
-        Map newVariableToParts = new HashMap();
-        for (Iterator i = variableToParts.keySet().iterator(); i.hasNext();) {
-            Object key = i.next();
-            Map parts = (Map) variableToParts.get(key);
-            Map newParts = new HashMap();
-            for (Iterator j = parts.keySet().iterator(); j.hasNext();) {
-                Object part = j.next();
-                newParts.put(part, parts.get(part));
-            }
-            newVariableToParts.put(key, newParts);
-        }
-        Variables newVariables = new Variables();
-        newVariables.variableToParts = newVariableToParts;
-        newVariables.inputVariable = inputVariable;
-        newVariables.outputVariable = outputVariable;
-        return newVariables;
-    }
-
-    private int getCurrentCountForVariablePart(String variable, String part) {
-        Map parts = getParts(variable);
-        Integer count = (Integer) parts.get(part);
-        if (count == null) {
-            if (variable.equals(inputVariable)) {
-                getNewIdForVariablePart(variable, part);
-                return getCurrentCountForVariablePart(variable, part);
-            } else {
-                throw new OXFException("Part '" + part + "' of variable '" + variable + "' not initialized");
-            }
-        }
-        return count.intValue();
-    }
-
-    private Map getParts(String variable) {
-        Map parts = (Map) variableToParts.get(variable);
-        if (parts == null)
-            throw new OXFException("Variable '" + variable + "' not declared");
-        return parts;
-    }
-
-    private void setVariablePart(String variable, String part, int count) {
-        if (! variableToParts.containsKey(variable))
-            variableToParts.put(variable, new HashMap());
-        Map parts = (Map) variableToParts.get(variable);
-        parts.put(part, new Integer(count));
-    }
-
-    public class VariablePart {
-        private String variable;
-        private String part;
-
-        public VariablePart(String variable, String part) {
-            this.variable = variable;
-            this.part = part;
-        }
-
-        public String getVariable() {
-            return variable;
-        }
-
-        public String getPart() {
-            return part;
-        }
-    }
-
-    public String buildId(String variable, String part, int count) {
-        return variable + "$" + part + "$" + count;
-    }
-
-    /**
-     * @return String representation for debugging
-     */
-    public String toString() {
-        StringBuffer result = new StringBuffer();
-        for (Iterator i = iterateVariablesParts(); i.hasNext();) {
-            VariablePart variablePart = (VariablePart) i.next();
-            result.append(variablePart.getVariable());
-            result.append(", ");
-            result.append(variablePart.getPart());
-            result.append(" -> ");
-            result.append(getCurrentIdForVariablePart(variablePart.getVariable(), variablePart.getPart()));
-            result.append("\n");
-        }
-        return result.toString();
-    }
-}
Index: src/java/org/orbeon/oxf/processor/bpel/BPELConstants.java
===================================================================
RCS file: src/java/org/orbeon/oxf/processor/bpel/BPELConstants.java
diff -N src/java/org/orbeon/oxf/processor/bpel/BPELConstants.java
--- src/java/org/orbeon/oxf/processor/bpel/BPELConstants.java	21 Aug 2004 20:06:04 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.processor.bpel;
-
-import org.dom4j.Namespace;
-
-public class BPELConstants {
-
-    public static String BPEL_NAMESPACE_URI = "http://schemas.xmlsoap.org/ws/2003/03/business-process/";
-    public static String BPEL_PREFIX = "bpws";
-    public static Namespace BPEL_NAMESPACE = new Namespace(BPEL_PREFIX, BPEL_NAMESPACE_URI);
-}
Index: src/java/org/orbeon/oxf/processor/bpel/activity/Receive.java
===================================================================
RCS file: src/java/org/orbeon/oxf/processor/bpel/activity/Receive.java
diff -N src/java/org/orbeon/oxf/processor/bpel/activity/Receive.java
--- src/java/org/orbeon/oxf/processor/bpel/activity/Receive.java	21 Aug 2004 20:06:05 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.processor.bpel.activity;
-
-import org.dom4j.Element;
-import org.orbeon.oxf.processor.bpel.Variables;
-
-import java.util.List;
-
-public class Receive implements Activity {
-
-    public String getElementName() {
-        return "receive";
-    }
-
-    public void toXPL(Variables variables, List statements, Element element) {
-        variables.setInputVariable(element.attributeValue("variable"));
-    }
-}
Index: src/java/org/orbeon/oxf/processor/bpel/activity/Invoke.java
===================================================================
RCS file: src/java/org/orbeon/oxf/processor/bpel/activity/Invoke.java
diff -N src/java/org/orbeon/oxf/processor/bpel/activity/Invoke.java
--- src/java/org/orbeon/oxf/processor/bpel/activity/Invoke.java	10 Jan 2008 20:31:55 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,63 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.processor.bpel.activity;
-
-import org.dom4j.Element;
-import org.orbeon.oxf.processor.Processor;
-import org.orbeon.oxf.processor.ProcessorFactoryRegistry;
-import org.orbeon.oxf.processor.ProcessorInputOutputInfo;
-import org.orbeon.oxf.processor.bpel.Variables;
-import org.orbeon.oxf.processor.pipeline.ast.ASTInput;
-import org.orbeon.oxf.processor.pipeline.ast.ASTOutput;
-import org.orbeon.oxf.processor.pipeline.ast.ASTProcessorCall;
-
-import java.util.Iterator;
-import java.util.List;
-
-public class Invoke implements Activity {
-
-    public String getElementName() {
-        return "invoke";
-    }
-
-    public void toXPL(Variables variables, List statements, Element invokeElement) {
-
-        // Get info from element
-        String partnerLink = invokeElement.attributeValue("partnerLink");
-        String inputVariable = invokeElement.attributeValue("inputVariable");
-        String outputVariable = invokeElement.attributeValue("outputVariable");
-
-        // Create a dummy processor so we can get the input and outputs
-        String processorURI = "oxf/processor/" + partnerLink;
-        Processor processor = ProcessorFactoryRegistry.lookup(processorURI).createInstance();
-
-        ASTProcessorCall astProcessorCall = new ASTProcessorCall(processorURI); {
-            // Processor inputs
-            for (Iterator i = processor.getInputsInfo().iterator(); i.hasNext();) {
-                ProcessorInputOutputInfo inputOutputInfo = (ProcessorInputOutputInfo) i.next();
-                astProcessorCall.addInput(new ASTInput(inputOutputInfo.getName(), ActivityUtils.getHref(variables,
-                        inputVariable, inputOutputInfo.getName(), null)));
-            }
-
-            // Processor outputs
-            for (Iterator i = processor.getOutputsInfo().iterator(); i.hasNext();) {
-                ProcessorInputOutputInfo inputOutputInfo = (ProcessorInputOutputInfo) i.next();
-                astProcessorCall.addOutput(new ASTOutput(inputOutputInfo.getName(),
-                        variables.getNewIdForVariablePart(outputVariable, inputOutputInfo.getName())));
-            }
-
-            statements.add(astProcessorCall);
-        }
-    }
-}
Index: src/java/org/orbeon/oxf/processor/bpel/activity/DeclareVariables.java
===================================================================
RCS file: src/java/org/orbeon/oxf/processor/bpel/activity/DeclareVariables.java
diff -N src/java/org/orbeon/oxf/processor/bpel/activity/DeclareVariables.java
--- src/java/org/orbeon/oxf/processor/bpel/activity/DeclareVariables.java	21 Aug 2004 20:06:05 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,33 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.processor.bpel.activity;
-
-import org.dom4j.Element;
-import org.orbeon.oxf.processor.bpel.Variables;
-
-import java.util.Iterator;
-import java.util.List;
-
-public class DeclareVariables implements Activity {
-    public String getElementName() {
-        return "variables";
-    }
-
-    public void toXPL(Variables variables, List statements, Element variablesElement) {
-        for (Iterator i = variablesElement.elements().iterator(); i.hasNext();) {
-            Element variableElement = (Element) i.next();
-            variables.declareVariable(variableElement.attributeValue("name"));
-        }
-    }
-}
Index: src/java/org/orbeon/oxf/processor/bpel/activity/Switch.java
===================================================================
RCS file: src/java/org/orbeon/oxf/processor/bpel/activity/Switch.java
diff -N src/java/org/orbeon/oxf/processor/bpel/activity/Switch.java
--- src/java/org/orbeon/oxf/processor/bpel/activity/Switch.java	26 Sep 2006 21:02:19 -0000	1.5
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,152 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.processor.bpel.activity;
-
-import org.dom4j.Element;
-import org.jaxen.expr.*;
-import org.jaxen.expr.iter.IterableChildAxis;
-import org.orbeon.oxf.common.ValidationException;
-import org.orbeon.oxf.processor.bpel.BPELConstants;
-import org.orbeon.oxf.processor.bpel.Variables;
-import org.orbeon.oxf.processor.bpel.JaxenXPathRewrite;
-import org.orbeon.oxf.processor.pipeline.ast.*;
-import org.orbeon.oxf.xml.XMLConstants;
-import org.orbeon.oxf.xml.dom4j.Dom4jUtils;
-import org.orbeon.oxf.xml.dom4j.LocationData;
-import org.saxpath.Axis;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-public class Switch implements Activity {
-
-    public String getElementName() {
-        return "switch";
-    }
-
-    public void toXPL(Variables variables, List statements, Element switchElement) {
-
-        ASTChoose astChoose = new ASTChoose();
-        statements.add(astChoose);
-
-        // Create <p:when> for every case
-        List caseInputs = new ArrayList();
-        Variables[] caseVariables = new Variables[switchElement.elements().size()];
-        Variables maxVariables = new Variables();
-        Element[] caseElements =  (Element[]) switchElement.elements().toArray(new Element[switchElement.elements().size()]);
-        for (int i = 0; i < caseElements.length; i++) {
-            Element caseElement = caseElements[i];
-
-            // Get condition and rewrite
-            String condition = caseElement.attributeValue("condition");
-            if (condition != null)
-                condition = rewriteCondition(condition, (LocationData) caseElement.getData(),
-                        Dom4jUtils.getNamespaceContextNoDefault(caseElement), caseInputs);
-
-            // Create <p:when>
-            ASTWhen astWhen = new ASTWhen(condition);
-            Variables currentCaseVariables = (Variables) variables.clone();
-            ActivityUtils.activitiesToXPL(currentCaseVariables, astWhen.getStatements(), caseElement.elements());
-            caseVariables[i] = currentCaseVariables;
-            maxVariables = maxVariables.max(currentCaseVariables);
-            astChoose.addWhen(astWhen);
-        }
-
-        // Add identity processors to each <p:when>
-        for (int i = 0; i < caseVariables.length; i++) {
-            Variables currentCaseVariables = caseVariables[i];
-            ASTWhen astWhen = (ASTWhen) astChoose.getWhen().get(i);
-            Variables diff = maxVariables.minus(currentCaseVariables);
-            for (Iterator j = diff.iterateVariablesParts(); j.hasNext();) {
-                Variables.VariablePart variablePart = (Variables.VariablePart) j.next();
-                String currentId = currentCaseVariables.getCurrentIdForVariablePart
-                        (variablePart.getVariable(), variablePart.getPart());
-                String newId = maxVariables.getCurrentIdForVariablePart
-                        (variablePart.getVariable(), variablePart.getPart());
-                ASTProcessorCall identity = new ASTProcessorCall(XMLConstants.IDENTITY_PROCESSOR_QNAME); {
-                    identity.addInput(new ASTInput("data", new ASTHrefId(new ASTOutput(null, currentId))));
-                    identity.addOutput(new ASTOutput("data", newId));
-                }
-                astWhen.getStatements().add(identity);
-            }
-        }
-
-        // Update the variables
-        variables.alias(maxVariables);
-
-        // Connect input of choose
-        ASTHrefAggregate astHrefAggregate = new ASTHrefAggregate(); {
-            astHrefAggregate.setRoot("root");
-            List hrefs = new ArrayList();
-            astHrefAggregate.setHrefs(hrefs);
-            for (Iterator i = caseInputs.iterator(); i.hasNext();) {
-                CaseInput caseInput = (CaseInput) i.next();
-                ASTHref astHref = ActivityUtils.getHref(variables, caseInput.variable, caseInput.part, caseInput.query);
-                hrefs.add(new ASTHrefAggregate(caseInput.elementName, astHref));
-            }
-            astChoose.setHref(astHrefAggregate);
-        }
-    }
-
-    private String rewriteCondition(String condition, final LocationData locationData,
-                                    final Map namespaceContext, final List caseInputs) {
-
-        return JaxenXPathRewrite.rewrite(condition, namespaceContext, BPELConstants.BPEL_NAMESPACE_URI,
-                "getVariableData", 3, locationData, new JaxenXPathRewrite.Rewriter() {
-                    public void rewrite(FunctionCallExpr expr) {
-                        // Save parameters
-                        CaseInput caseInput = new CaseInput();
-                        caseInputs.add(caseInput);
-                        caseInput.elementName = "bpws-" + caseInputs.size();
-                        caseInput.variable = getArgument(expr, 0);
-                        caseInput.part = getArgument(expr, 1);
-                        caseInput.query = getArgument(expr, 2);
-
-                        // Replace by identity(xpath)
-                        expr.setPrefix(null);
-                        expr.setFunctionName("identity");
-                        expr.getParameters().clear();
-                        DefaultAbsoluteLocationPath locationPath = new DefaultAbsoluteLocationPath(); {
-                            locationPath.addStep(new DefaultNameStep(new IterableChildAxis(Axis.CHILD),
-                                    null, "root", new PredicateSet()));
-                            locationPath.addStep(new DefaultNameStep(new IterableChildAxis(Axis.CHILD),
-                                    null, caseInput.elementName, new PredicateSet()));
-                            locationPath.addStep(new DefaultNameStep(new IterableChildAxis(Axis.CHILD),
-                                    null, "node()", new PredicateSet()));
-                            expr.getParameters().add(locationPath);
-                        }
-
-                    }
-
-                    private String getArgument(FunctionCallExpr expr, int position) {
-                        Object argument = expr.getParameters().get(position);
-                        if (argument instanceof LiteralExpr) {
-                            return ((LiteralExpr) argument).getLiteral();
-                        } else {
-                            throw new ValidationException("Parameter number " + position + " is not a string literal",
-                                    locationData);
-                        }
-                    }
-                });
-    }
-
-    private static class CaseInput {
-        public String elementName;
-        public String variable;
-        public String part;
-        public String query;
-    }
-}
Index: src/java/org/orbeon/oxf/processor/bpel/activity/Reply.java
===================================================================
RCS file: src/java/org/orbeon/oxf/processor/bpel/activity/Reply.java
diff -N src/java/org/orbeon/oxf/processor/bpel/activity/Reply.java
--- src/java/org/orbeon/oxf/processor/bpel/activity/Reply.java	31 Mar 2005 00:23:42 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,49 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.processor.bpel.activity;
-
-import org.dom4j.Element;
-import org.orbeon.oxf.processor.bpel.Variables;
-import org.orbeon.oxf.processor.pipeline.ast.ASTInput;
-import org.orbeon.oxf.processor.pipeline.ast.ASTOutput;
-import org.orbeon.oxf.processor.pipeline.ast.ASTParam;
-import org.orbeon.oxf.processor.pipeline.ast.ASTProcessorCall;
-import org.orbeon.oxf.xml.XMLConstants;
-
-import java.util.Iterator;
-import java.util.List;
-
-public class Reply implements Activity {
-
-    public String getElementName() {
-        return "reply";
-    }
-
-    public void toXPL(Variables variables, List statements, Element element) {
-        String variable = element.attributeValue("variable");
-        variables.setOutputVariable(variable);
-        for (Iterator i = variables.iterateVariablesParts(); i.hasNext();) {
-            Variables.VariablePart variablePart = (Variables.VariablePart) i.next();
-            if (variablePart.getVariable().equals(variable)) {
-                ASTProcessorCall astProcessorCall = new ASTProcessorCall(XMLConstants.IDENTITY_PROCESSOR_QNAME); {
-                    statements.add(astProcessorCall);
-                    astProcessorCall.addInput(new ASTInput("data",
-                            ActivityUtils.getHref(variables, variable, variablePart.getPart(), null)));
-                    astProcessorCall.addOutput(new ASTOutput("data",
-                            new ASTParam(ASTParam.OUTPUT, variablePart.getPart())));
-                }
-            }
-        }
-    }
-}
Index: src/java/org/orbeon/oxf/processor/bpel/activity/Activity.java
===================================================================
RCS file: src/java/org/orbeon/oxf/processor/bpel/activity/Activity.java
diff -N src/java/org/orbeon/oxf/processor/bpel/activity/Activity.java
--- src/java/org/orbeon/oxf/processor/bpel/activity/Activity.java	21 Aug 2004 20:06:04 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.processor.bpel.activity;
-
-import org.dom4j.Element;
-import org.orbeon.oxf.processor.bpel.Variables;
-
-import java.util.List;
-
-public interface Activity {
-
-    public String getElementName();
-    public void toXPL(Variables variables, List statements, Element element);
-
-}
Index: src/java/org/orbeon/oxf/processor/bpel/activity/Assign.java
===================================================================
RCS file: src/java/org/orbeon/oxf/processor/bpel/activity/Assign.java
diff -N src/java/org/orbeon/oxf/processor/bpel/activity/Assign.java
--- src/java/org/orbeon/oxf/processor/bpel/activity/Assign.java	8 Apr 2005 08:09:16 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,112 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.processor.bpel.activity;
-
-import org.dom4j.*;
-import org.orbeon.oxf.processor.bpel.BPELConstants;
-import org.orbeon.oxf.processor.bpel.Variables;
-import org.orbeon.oxf.processor.pipeline.ast.ASTInput;
-import org.orbeon.oxf.processor.pipeline.ast.ASTOutput;
-import org.orbeon.oxf.processor.pipeline.ast.ASTProcessorCall;
-import org.orbeon.oxf.xml.XMLConstants;
-import org.orbeon.oxf.xml.dom4j.NonLazyUserDataDocument;
-
-import java.util.List;
-
-public class Assign implements Activity {
-
-    public String getElementName() {
-        return "assign";
-    }
-
-    public void toXPL(Variables variables, List statements, Element assignElement) {
-
-        // Get info from element
-        Element copyElement = assignElement.element(new QName("copy", BPELConstants.BPEL_NAMESPACE));
-        Element fromElement = copyElement.element(new QName("from", BPELConstants.BPEL_NAMESPACE));
-        Element toElement = copyElement.element(new QName("to", BPELConstants.BPEL_NAMESPACE));
-        String toQuery = toElement.attributeValue("query");
-
-        // Are we updating just a section of a variable part?
-        if (toQuery == null) {
-
-            // Handle this with an identity processor
-            ASTProcessorCall astProcessorCall = new ASTProcessorCall(XMLConstants.IDENTITY_PROCESSOR_QNAME); {
-                ASTInput newValueAstInput = newValueASTInput(variables, fromElement); {
-                    newValueAstInput.setName("data");
-                    astProcessorCall.addInput(newValueAstInput);
-                }
-                astProcessorCall.addOutput(new ASTOutput("data", variables.getNewIdForVariablePart
-                        (toElement.attributeValue("variable"),
-                         toElement.attributeValue("part"))));
-                statements.add(astProcessorCall);
-            }
-        } else {
-
-            // Handle this with an XUpdate processor
-            ASTProcessorCall astProcessorCall = new ASTProcessorCall(XMLConstants.XUPDATE_PROCESSOR_QNAME); {
-                ASTInput newValueAstInput = newValueASTInput(variables, fromElement); {
-                    newValueAstInput.setName("update");
-                    astProcessorCall.addInput(newValueAstInput);
-                }
-                astProcessorCall.addInput(new ASTInput("data", ActivityUtils.getHref(variables,
-                        toElement.attributeValue("variable"),
-                        toElement.attributeValue("part"),
-                        null)));
-                astProcessorCall.addInput(new ASTInput("config", createXUpdateConfig(toElement.attributeValue("query"))));
-                astProcessorCall.addOutput(new ASTOutput("data", variables.getNewIdForVariablePart
-                        (toElement.attributeValue("variable"),
-                         toElement.attributeValue("part"))));
-                statements.add(astProcessorCall);
-            }
-        }
-    }
-
-    private ASTInput newValueASTInput(Variables variables, Element fromElement) {
-        if (fromElement.elements().size() == 0) {
-            return new ASTInput(null, ActivityUtils.getHref(variables,
-                            fromElement.attributeValue("variable"),
-                            fromElement.attributeValue("part"),
-                            fromElement.attributeValue("query")));
-        } else {
-            return new ASTInput(null, ((Element) fromElement.elements().get(0)).createCopy());
-        }
-    }
-
-    /**
-     * Creates an XUpdate configuration that looks like:
-     *
-     * <xu:modification>
-     *     <xu:update select="query">
-     *         <xu:copy-of select="doc('#update')/*"/>
-     *     </xu:update>
-     * </xu:modification>
-     */
-    private static Node createXUpdateConfig(String query) {
-        Namespace xupdateNamespace = new Namespace("xu", "http://www.xmldb.org/xupdate");
-        Document document = new NonLazyUserDataDocument(); {
-            Element modificationsElement = document.addElement( new QName("modifications", xupdateNamespace) );
-             {
-                document.setRootElement(modificationsElement);
-                Element updateElement = modificationsElement.addElement(new QName("update", xupdateNamespace)); {
-                    updateElement.addAttribute("select", query);
-                    Element copyOf = updateElement.addElement(new QName("copy-of", xupdateNamespace)); {
-                        copyOf.addAttribute("select", "doc('#update')/*");
-                    }
-                }
-            }
-        }
-        return document;
-    }
-}
Index: src/java/org/orbeon/oxf/processor/bpel/activity/ActivityUtils.java
===================================================================
RCS file: src/java/org/orbeon/oxf/processor/bpel/activity/ActivityUtils.java
diff -N src/java/org/orbeon/oxf/processor/bpel/activity/ActivityUtils.java
--- src/java/org/orbeon/oxf/processor/bpel/activity/ActivityUtils.java	21 Aug 2004 20:06:04 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,77 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.processor.bpel.activity;
-
-import org.dom4j.Element;
-import org.orbeon.oxf.common.ValidationException;
-import org.orbeon.oxf.processor.bpel.Variables;
-import org.orbeon.oxf.processor.pipeline.ast.ASTHref;
-import org.orbeon.oxf.processor.pipeline.ast.ASTHrefId;
-import org.orbeon.oxf.processor.pipeline.ast.ASTHrefXPointer;
-import org.orbeon.oxf.processor.pipeline.ast.ASTOutput;
-import org.orbeon.oxf.xml.dom4j.LocationData;
-
-import java.util.Iterator;
-import java.util.List;
-
-public class ActivityUtils {
-
-    private static final Activity[] activities = {
-        new DeclareVariables(),
-        new Assign(),
-        new Invoke(),
-        new Switch(),
-        new Receive(),
-        new Reply()
-    };
-
-    /**
-     * Handle a list of activities (invoke, assign, ...)
-     */
-    public static void activitiesToXPL(Variables variables, List statements, List elements) {
-
-        // Execute each activity
-        for (Iterator i = elements.iterator(); i.hasNext();) {
-            Element activityElement = (Element) i.next();
-
-            // Find implementation for this activity and execute
-            boolean foundActivity = false;
-            for (int j = 0; j < activities.length; j++) {
-                Activity activity = activities[j];
-                if (activity.getElementName().equals(activityElement.getName())) {
-                    foundActivity = true;
-                    activity.toXPL(variables, statements, activityElement);
-                    break;
-                }
-            }
-
-            // Error if no implementation found
-            if (!foundActivity)
-                throw new ValidationException("Unsupported activity '" + activityElement.getName() + "'",
-                        (LocationData) activityElement.getData());
-        }
-    }
-
-    /**
-     * Creates an input that corresponds to the given query applied on the
-     * given variable/part.
-     */
-    public static ASTHref getHref(Variables variables, String variable, String part, String query) {
-        String id = variables.getCurrentIdForVariablePart(variable, part);
-        ASTHref astHref = new ASTHrefId(new ASTOutput(null, id));
-        if (query != null)
-            astHref = new ASTHrefXPointer(astHref, query);
-        return astHref;
-    }
-}
Index: src/java/org/orbeon/oxf/processor/IMProcessor.java
===================================================================
RCS file: src/java/org/orbeon/oxf/processor/IMProcessor.java
diff -N src/java/org/orbeon/oxf/processor/IMProcessor.java
--- src/java/org/orbeon/oxf/processor/IMProcessor.java	8 Dec 2005 16:02:32 -0000	1.5
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,200 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.processor;
-
-import org.apache.log4j.Logger;
-import org.dom4j.Document;
-import org.dom4j.Element;
-import org.orbeon.oxf.cache.OutputCacheKey;
-import org.orbeon.oxf.common.OXFException;
-import org.orbeon.oxf.pipeline.InitUtils;
-import org.orbeon.oxf.pipeline.api.ExternalContext;
-import org.orbeon.oxf.pipeline.api.PipelineContext;
-import org.orbeon.oxf.processor.generator.DOMGenerator;
-import org.orbeon.oxf.processor.generator.URLGenerator;
-import org.orbeon.oxf.processor.pipeline.PipelineProcessor;
-import org.orbeon.oxf.processor.pipeline.PipelineReader;
-import org.orbeon.oxf.util.LoggerFactory;
-import org.orbeon.oxf.util.PipelineUtils;
-import org.orbeon.oxf.webapp.ServletContextExternalContext;
-import org.orbeon.oxf.xml.dom4j.NonLazyUserDataDocument;
-import org.orbeon.oxf.xml.dom4j.NonLazyUserDataElement;
-import org.xml.sax.ContentHandler;
-import ymsg.network.AccountLockedException;
-import ymsg.network.DirectConnectionHandler;
-import ymsg.network.LoginRefusedException;
-import ymsg.network.Session;
-import ymsg.network.event.SessionAdapter;
-import ymsg.network.event.SessionEvent;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-public class IMProcessor extends ProcessorImpl {
-
-    private static Logger logger = LoggerFactory.createLogger(IMProcessor.class);
-
-    public static final String IM_NAMESPACE_URI = "http://www.orbeon.com/oxf/im";
-    private static final int SEND_MESSAGE_MAX_TRY = 2;
-
-    public IMProcessor() {
-        addInputInfo(new ProcessorInputOutputInfo(INPUT_CONFIG));
-        addInputInfo(new ProcessorInputOutputInfo(INPUT_DATA));
-    }
-
-    public void start(PipelineContext context) {
-        try {
-            // Get ExternalContext
-            ExternalContext externalContext = (ExternalContext) context.getAttribute(PipelineContext.EXTERNAL_CONTEXT);
-
-            // Read config
-            Config config = (Config) readCacheInputAsObject(context, getInputByName(INPUT_CONFIG), new CacheableInputReader() {
-                public Object read(org.orbeon.oxf.pipeline.api.PipelineContext context, ProcessorInput input) {
-                    Config result = new Config();
-                    Element configElement = readInputAsDOM4J(context, input).getRootElement();
-                    result.login = configElement.element("login").getText();
-                    result.password = configElement.element("password").getText();
-                    Element onMessageReceivedElement = configElement.element("on-message-received");
-                    if (onMessageReceivedElement != null)
-                        result.onMessageReceived = onMessageReceivedElement.getText();
-                    return result;
-                }
-            });
-
-            // Get session
-            for (int sendMessageTry = 0;;) {
-                sendMessageTry++;
-                Session session;
-                synchronized (loginToSession) {
-                    session = (Session) loginToSession.get(config.login);
-                    if (session == null) {
-                        // Create session
-                        session = new Session(new DirectConnectionHandler());
-                        if (config.onMessageReceived != null) {
-                            // Create pipeline listening to new messages
-                            PipelineProcessor onMessageReceived;
-                            if (config.onMessageReceived.startsWith("#")) {
-                                String inputName = config.onMessageReceived.substring(1);
-                                final ProcessorInput input = getInputByName(inputName);
-                                PipelineReader reader = new PipelineReader();
-                                reader.createInput("pipeline").setOutput(new ProcessorImpl.ProcessorOutputImpl(getClass(), inputName) {
-                                    protected void readImpl(org.orbeon.oxf.pipeline.api.PipelineContext context, ContentHandler contentHandler) {
-                                        ((ProcessorImpl.ProcessorOutputImpl) input.getOutput()).readImpl(context, contentHandler);
-                                    }
-
-                                    protected Object getValidityImpl(org.orbeon.oxf.pipeline.api.PipelineContext context) {
-                                        return ((ProcessorImpl.ProcessorOutputImpl) input.getOutput()).getValidityImpl(context);
-                                    }
-
-                                    protected OutputCacheKey getKeyImpl(org.orbeon.oxf.pipeline.api.PipelineContext context) {
-                                        return ((ProcessorImpl.ProcessorOutputImpl) input.getOutput()).getKeyImpl(context);
-                                    }
-                                });
-                                reader.start(context);
-                                onMessageReceived = new PipelineProcessor(reader.getPipeline());
-
-                            } else {
-                                onMessageReceived = new PipelineProcessor();
-                                URLGenerator urlGenerator = new URLGenerator(config.onMessageReceived);
-                                PipelineUtils.connect(urlGenerator, "data", onMessageReceived, "config");
-                            }
-                            onMessageReceived.createInput("data");
-                            session.addSessionListener(new SessionListener(onMessageReceived, externalContext));
-                        }
-                        session.login(config.login, config.password);
-                        loginToSession.put(config.login, session);
-                    }
-                }
-
-                // Get message
-                Document dataDocument = readCacheInputAsDOM4J(context, INPUT_DATA);
-                Element messageElement = dataDocument.getRootElement();
-                try {
-                    session.sendMessage(messageElement.element("to").getText(),
-                            messageElement.element("body").getText());
-                } catch (IOException e) {
-                    if (sendMessageTry < SEND_MESSAGE_MAX_TRY) {
-                        // Invalidate session and continue
-                        synchronized (loginToSession) {
-                            loginToSession.remove(config.login);
-                        }
-                        continue;
-                    } else {
-                        throw e;
-                    }
-                }
-
-                // No exception: no need to try again
-                break;
-            }
-
-        } catch (IOException e) {
-            throw new OXFException(e);
-        } catch (AccountLockedException e) {
-            throw new OXFException(e);
-        } catch (LoginRefusedException e) {
-            throw new OXFException(e);
-        }
-    }
-
-    private static class Config {
-        String login;
-        String password;
-        String onMessageReceived;
-    }
-
-    /**
-     * Gets called when we receive a message. When this happens, start a processor.
-     */
-    private static class SessionListener extends SessionAdapter {
-
-        private Processor onMessageReceived;
-        private ExternalContext externalContext;
-
-        public SessionListener(Processor onMessageReceived, ExternalContext externalContext) {
-            this.onMessageReceived = onMessageReceived;
-            this.externalContext = externalContext;
-        }
-
-        public void messageReceived(SessionEvent ev) {
-            synchronized (onMessageReceived) {
-                // Create message
-                final NonLazyUserDataElement msgElt = new NonLazyUserDataElement( "message" );
-                Document messageDocument = new NonLazyUserDataDocument( msgElt );
-                msgElt.addElement("from").addText(ev.getFrom());
-                msgElt.addElement("body").addText(ev.getMessage());
-
-                // Connect to processor
-                final DOMGenerator domGenerator = new DOMGenerator
-                    ( messageDocument, "IM message", DOMGenerator.ZeroValidity
-                      , DOMGenerator.DefaultContext );
-                ProcessorOutput output = domGenerator.createOutput("data");
-                ProcessorInput input = onMessageReceived.getInputByName("data");
-                output.setInput(input);
-                input.setOutput(output);
-
-                // Run processor
-                try {
-                    // The ExternalContext passed has limited visibility on the application context only
-                    InitUtils.runProcessor(onMessageReceived, new ServletContextExternalContext(externalContext), new PipelineContext(), logger);
-                } catch (Exception e) {
-                    throw new OXFException(e);
-                }
-            }
-        }
-    }
-
-    private static Map loginToSession = new HashMap();
-}
Index: src/java/org/orbeon/oxf/struts/mapping/OXFActionMapping.java
===================================================================
RCS file: src/java/org/orbeon/oxf/struts/mapping/OXFActionMapping.java
diff -N src/java/org/orbeon/oxf/struts/mapping/OXFActionMapping.java
--- src/java/org/orbeon/oxf/struts/mapping/OXFActionMapping.java	21 Aug 2004 20:06:23 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,36 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.struts.mapping;
-
-public class OXFActionMapping extends org.apache.struts.action.ActionMapping {
-
-    private String resource;
-    private String pipeline;
-
-    public String getResource() {
-        return resource;
-    }
-
-    public void setResource(String resource) {
-        this.resource = resource;
-    }
-
-    public String getPipeline() {
-        return pipeline;
-    }
-
-    public void setPipeline(String pipeline) {
-        this.pipeline = pipeline;
-    }
-}
Index: src/java/org/orbeon/oxf/util/StrutsUtils.java
===================================================================
RCS file: src/java/org/orbeon/oxf/util/StrutsUtils.java
diff -N src/java/org/orbeon/oxf/util/StrutsUtils.java
--- src/java/org/orbeon/oxf/util/StrutsUtils.java	12 Jan 2007 14:37:27 -0000	1.5
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,482 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.util;
-
-import orbeon.apache.xalan.extensions.XSLProcessorContext;
-import orbeon.apache.xalan.templates.ElemExtensionCall;
-import org.apache.struts.Globals;
-import org.apache.struts.taglib.bean.MessageTag;
-import org.apache.struts.taglib.html.JavascriptValidatorTag;
-import org.orbeon.oxf.common.OXFException;
-import org.orbeon.oxf.pipeline.StaticExternalContext;
-import org.orbeon.oxf.pipeline.api.ExternalContext;
-import org.orbeon.oxf.pipeline.api.PipelineContext;
-import org.orbeon.oxf.servlet.ServletExternalContext;
-
-import javax.servlet.*;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import javax.servlet.jsp.JspWriter;
-import javax.servlet.jsp.PageContext;
-import javax.xml.transform.TransformerException;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-
-public class StrutsUtils {
-
-    private static String nullIfEmpty(String s) {
-        return ("".equals(s)) ? null : s;
-    }
-
-    public static String messageTag(String key) {
-        return messageTag(key, "", "", "" , "", "" , "");
-    }
-
-    public static String messageTag(String key, String bundle) {
-        return messageTag(key, bundle, "", "" , "", "" , "");
-    }
-
-    public static String messageTag(String key, String bundle, String arg0) {
-        return messageTag(key, bundle, arg0, "", "" , "", "" );
-    }
-
-    public static String messageTag(String key, String bundle, String arg0, String arg1) {
-        return messageTag(key, bundle, arg0, arg1, "", "", "" );
-    }
-
-    public static String messageTag(String key, String bundle, String arg0, String arg1, String arg2) {
-        return messageTag(key, bundle, arg0, arg1, arg2, "", "" );
-    }
-
-    public static String messageTag(String key, String bundle, String arg0, String arg1, String arg2, String arg3) {
-        return messageTag(key, bundle, arg0, arg1, arg2, arg3, "");
-    }
-
-    /**
-     * Call the Struts Message tag.
-     */
-    public static String messageTag(String key, String bundle, String arg0, String arg1, String arg2, String arg3, String arg4) {
-
-        // Normalize parameters
-        key = nullIfEmpty(key);
-
-        if (key == null && bundle == null)
-            throw new OXFException("Attribute 'key' is mandatory in struts:message");
-
-        bundle = nullIfEmpty(bundle);
-        arg0 = nullIfEmpty(arg0);
-        arg1 = nullIfEmpty(arg1);
-        arg2 = nullIfEmpty(arg2);
-        arg3 = nullIfEmpty(arg3);
-        arg4 = nullIfEmpty(arg4);
-
-        // Call tag
-        OXFPageContext pageContext = getPageContext();
-        MessageTag messageTag = new MessageTag();
-        try {
-            messageTag.setPageContext(pageContext);
-
-            messageTag.setKey(key);
-            messageTag.setBundle(bundle);
-            messageTag.setArg0(arg0);
-            messageTag.setArg1(arg1);
-            messageTag.setArg2(arg2);
-            messageTag.setArg3(arg3);
-            messageTag.setArg4(arg4);
-
-            messageTag.doStartTag();
-
-            return pageContext.getResult();
-        } catch (Exception e) {
-            throw new OXFException(e);
-        } finally {
-            messageTag.release();
-        }
-    }
-
-    public static String javaScriptTag(String formName, String dynamicJavaScript, String staticJavaScript, String method) {
-        return javaScriptTag(formName, dynamicJavaScript, staticJavaScript, method, "");
-    }
-
-    public static String javaScriptTag(String formName, String dynamicJavaScript, String staticJavaScript) {
-        return javaScriptTag(formName, dynamicJavaScript, staticJavaScript, "", "");
-    }
-
-    public static String javaScriptTag(String formName, String dynamicJavaScript) {
-        return javaScriptTag(formName, dynamicJavaScript, "", "", "");
-    }
-
-    public static String javaScriptTag(String formName) {
-        return javaScriptTag(formName, "", "", "", "");
-    }
-
-    /**
-     * Call the Struts JavaScriptValidator tag.
-     */
-    public static String javaScriptTag(String formName, String dynamicJavaScript, String staticJavaScript, String method, String page) {
-
-        // Normalize parameters
-        formName = nullIfEmpty(formName);
-
-        if (formName == null)
-            throw new OXFException("Attribute 'formName' is mandatory in struts:javascript");
-
-        dynamicJavaScript = nullIfEmpty(dynamicJavaScript);
-        staticJavaScript = nullIfEmpty(staticJavaScript);
-        method = nullIfEmpty(method);
-        page = nullIfEmpty(page);
-
-        // Call tag
-        OXFPageContext pageContext = getPageContext();
-        JavascriptValidatorTag js = new JavascriptValidatorTag();
-        try {
-            js.setCdata("true");
-            js.setFormName(formName);
-            js.setPageContext(pageContext);
-
-            if (dynamicJavaScript != null)
-                js.setDynamicJavascript(dynamicJavaScript );
-            if (staticJavaScript != null)
-                js.setStaticJavascript(staticJavaScript);
-            if (method != null)
-                js.setMethod(method);
-
-            try {
-                if (page != null) {
-                    int i = Integer.parseInt(page);
-                    js.setPage(i);
-                }
-            } catch (NumberFormatException e) {
-                throw new OXFException("struts:javascript page attribute must be an integer", e);
-            }
-
-            js.doStartTag();
-            String result = pageContext.getResult();
-            return result.substring(result.indexOf("<![CDATA[") + 9, result.indexOf("]]>"));
-        } catch (Exception e) {
-            throw new OXFException(e);
-        } finally {
-            js.release();
-        }
-    }
-
-    /**
-     * Xalan extension method. Use the static methods instead for portability.
-     */
-    public String message(XSLProcessorContext xslContext, ElemExtensionCall extElem) {
-        try {
-            String key = extElem.getAttribute("key", xslContext.getContextNode(), xslContext.getTransformer());
-            String bundle = extElem.getAttribute("bundle", xslContext.getContextNode(), xslContext.getTransformer());
-            String arg0 = extElem.getAttribute("arg0", xslContext.getContextNode(), xslContext.getTransformer());
-            String arg1 = extElem.getAttribute("arg1", xslContext.getContextNode(), xslContext.getTransformer());
-            String arg2 = extElem.getAttribute("arg2", xslContext.getContextNode(), xslContext.getTransformer());
-            String arg3 = extElem.getAttribute("arg3", xslContext.getContextNode(), xslContext.getTransformer());
-            String arg4 = extElem.getAttribute("arg4", xslContext.getContextNode(), xslContext.getTransformer());
-
-            return messageTag(key, bundle, arg0, arg1, arg2, arg3, arg4);
-        } catch (TransformerException e) {
-            throw new OXFException(e);
-        }
-    }
-
-    /**
-     * Xalan extension method. Use the static methods instead for portability.
-     */
-    public String javascript(XSLProcessorContext xslContext, ElemExtensionCall extElem) {
-        return javaScript(xslContext, extElem);
-    }
-
-    /**
-     * Xalan extension method. Use the static methods instead for portability.
-     */
-    public String javaScript(XSLProcessorContext xslContext, ElemExtensionCall extElem) {
-        try {
-            String formName = extElem.getAttribute("formName", xslContext.getContextNode(), xslContext.getTransformer());
-            String dynamicJavascript = extElem.getAttribute("dynamicJavascript", xslContext.getContextNode(), xslContext.getTransformer());
-            String staticJavascript = extElem.getAttribute("staticJavascript", xslContext.getContextNode(), xslContext.getTransformer());
-            String method = extElem.getAttribute("method", xslContext.getContextNode(), xslContext.getTransformer());
-            String page = extElem.getAttribute("page", xslContext.getContextNode(), xslContext.getTransformer());
-
-            return javaScriptTag(formName, dynamicJavascript, staticJavascript, method, page);
-        } catch (TransformerException e) {
-            throw new OXFException(e);
-        }
-    }
-
-    private static OXFPageContext getPageContext() {
-
-        StaticExternalContext.StaticContext staticContext = StaticExternalContext.getStaticContext();
-        if (staticContext == null)
-            throw new OXFException("Can't find static context for current thread");
-        PipelineContext context = staticContext.getPipelineContext();
-        if (context == null)
-            throw new OXFException("Can't find pipeline context for current thread");
-
-        ExternalContext external = (ExternalContext) context.getAttribute(PipelineContext.EXTERNAL_CONTEXT);
-        if (!(external instanceof ServletExternalContext))
-            throw new OXFException("Orbeon Forms is not running as a servlet. This is not supported.");
-
-        ServletContext servletContext = (ServletContext) external.getNativeContext();
-        if (servletContext == null)
-            throw new OXFException("Can't find servlet context in pipeline context");
-
-        HttpServletRequest request = (HttpServletRequest) external.getNativeRequest();
-        if (request == null)
-            throw new OXFException("Can't find HTTP Request in pipeline context");
-
-        OXFPageContext pageContext = new OXFPageContext(new StringWriter(), request, servletContext);
-        return pageContext;
-    }
-
-    public static class OXFPageContext extends PageContext {
-        private StringWriter writer;
-        private OXFJspWriter jspWriter;
-        private HttpServletRequest request;
-        private ServletContext context;
-        private Map pageContext = new HashMap();
-
-        public OXFPageContext(StringWriter writer, HttpServletRequest request, ServletContext context) {
-            this.writer = writer;
-            jspWriter = new OXFJspWriter(1024, true);
-            jspWriter.setStringWriter(writer);
-
-            this.request = request;
-            this.context = context;
-
-            pageContext.put(Globals.XHTML_KEY, "true");
-        }
-
-        public String getResult() {
-            return writer.toString();
-        }
-
-        public Object findAttribute(String s) {
-            return null;
-        }
-
-        public void forward(String s) throws ServletException, IOException {
-        }
-
-        public Object getAttribute(String s) {
-            return pageContext.get(s);
-        }
-
-        public Object getAttribute(String s, int i) {
-            switch (i) {
-                case PageContext.APPLICATION_SCOPE:
-                    return context.getAttribute(s);
-                case PageContext.REQUEST_SCOPE:
-                    return request.getAttribute(s);
-                case PageContext.SESSION_SCOPE:
-                    return request.getSession().getAttribute(s);
-                case PageContext.PAGE_SCOPE:
-                    return pageContext.get(s);
-                default:
-                    return null;
-            }
-        }
-
-        public Enumeration getAttributeNamesInScope(int i) {
-            return null;
-        }
-
-        public int getAttributesScope(String s) {
-            return 0;
-        }
-
-        public Exception getException() {
-            return null;
-        }
-
-        public JspWriter getOut() {
-            return jspWriter;
-        }
-
-        public Object getPage() {
-            return null;
-        }
-
-        public ServletRequest getRequest() {
-            return request;
-        }
-
-        public ServletResponse getResponse() {
-            return null;
-        }
-
-        public ServletConfig getServletConfig() {
-            return null;
-        }
-
-        public ServletContext getServletContext() {
-            return context;
-        }
-
-        public HttpSession getSession() {
-            return request.getSession();
-        }
-
-        public void handlePageException(Exception e) throws ServletException, IOException {
-        }
-
-        public void handlePageException(Throwable throwable) throws ServletException, IOException {
-        }
-
-        public void include(String s) throws ServletException, IOException {
-        }
-
-        public void initialize(Servlet servlet, ServletRequest servletRequest, ServletResponse servletResponse, String s, boolean b, int i, boolean b1) throws IOException, IllegalStateException, IllegalArgumentException {
-        }
-
-        public void release() {
-            jspWriter = null;
-            request = null;
-            context = null;
-        }
-
-        public void removeAttribute(String s) {
-        }
-
-        public void removeAttribute(String s, int i) {
-        }
-
-        public void setAttribute(String s, Object o) {
-        }
-
-        public void setAttribute(String s, Object o, int i) {
-        }
-    }
-
-
-    public static class OXFJspWriter extends JspWriter {
-
-        private static String NEWLINE = "\n";
-        private StringWriter writer;
-
-
-        public OXFJspWriter(int bufferSize, boolean autoFlush) {
-            super(bufferSize, autoFlush);
-        }
-
-        public void setStringWriter(StringWriter writer) {
-            this.writer = writer;
-        }
-
-        public void clear() throws IOException {
-        }
-
-        public void clearBuffer() throws IOException {
-        }
-
-        public void close() throws IOException {
-            writer.close();
-        }
-
-        public void flush() throws IOException {
-            writer.flush();
-        }
-
-        public int getRemaining() {
-            return 0;
-        }
-
-        public void newLine() throws IOException {
-            writer.write(NEWLINE);
-        }
-
-        public void print(boolean b) throws IOException {
-            writer.write(Boolean.toString(b));
-        }
-
-        public void print(char c) throws IOException {
-            writer.write(c);
-        }
-
-        public void print(char[] chars) throws IOException {
-            writer.write(chars);
-        }
-
-        public void print(double v) throws IOException {
-            writer.write(Double.toString(v));
-        }
-
-        public void print(float v) throws IOException {
-            writer.write(Float.toString(v));
-        }
-
-        public void print(int i) throws IOException {
-            writer.write(Integer.toString(i));
-        }
-
-        public void print(long l) throws IOException {
-            writer.write(Long.toString(l));
-        }
-
-        public void print(Object o) throws IOException {
-            writer.write(o.toString());
-        }
-
-        public void print(String s) throws IOException {
-            writer.write(s);
-        }
-
-        public void println() throws IOException {
-            writer.write(NEWLINE);
-        }
-
-        public void println(boolean b) throws IOException {
-            writer.write(Boolean.toString(b) + NEWLINE);
-        }
-
-        public void println(char c) throws IOException {
-            writer.write(c + NEWLINE);
-        }
-
-        public void println(char[] chars) throws IOException {
-            final String s = new String( chars );
-            writer.write( s + NEWLINE);
-        }
-
-        public void println(double v) throws IOException {
-            writer.write(Double.toString(v) + NEWLINE);
-        }
-
-        public void println(float v) throws IOException {
-            writer.write(Float.toString(v) + NEWLINE);
-        }
-
-        public void println(int i) throws IOException {
-            writer.write(Integer.toString(i) + NEWLINE);
-        }
-
-        public void println(long l) throws IOException {
-            writer.write(Long.toString(l) + NEWLINE);
-        }
-
-        public void println(Object o) throws IOException {
-            writer.write(o.toString() + NEWLINE);
-        }
-
-        public void println(String s) throws IOException {
-            writer.write(s + NEWLINE);
-        }
-
-        public void write(char cbuf[], int off, int len) throws IOException {
-            writer.write(cbuf, off, len);
-        }
-    }
-}
Index: src/java/org/orbeon/oxf/processor/generator/StrutsActionErrorsGenerator.java
===================================================================
RCS file: src/java/org/orbeon/oxf/processor/generator/StrutsActionErrorsGenerator.java
diff -N src/java/org/orbeon/oxf/processor/generator/StrutsActionErrorsGenerator.java
--- src/java/org/orbeon/oxf/processor/generator/StrutsActionErrorsGenerator.java	12 Jan 2007 14:37:29 -0000	1.7
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,240 +0,0 @@
-/**
- *  Copyright (C) 2004 - 2005 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.processor.generator;
-
-import org.apache.struts.Globals;
-import org.apache.struts.action.ActionError;
-import org.apache.struts.action.ActionErrors;
-import org.apache.struts.util.MessageResources;
-import org.orbeon.oxf.cache.OutputCacheKey;
-import org.orbeon.oxf.cache.SimpleOutputCacheKey;
-import org.orbeon.oxf.common.OXFException;
-import org.orbeon.oxf.pipeline.api.ExternalContext;
-import org.orbeon.oxf.pipeline.api.PipelineContext;
-import org.orbeon.oxf.processor.ProcessorImpl;
-import org.orbeon.oxf.processor.ProcessorInputOutputInfo;
-import org.orbeon.oxf.processor.ProcessorOutput;
-import org.orbeon.oxf.servlet.ServletExternalContext;
-import org.orbeon.oxf.xml.SAXStore;
-import org.orbeon.oxf.xml.TeeContentHandler;
-import org.orbeon.oxf.xml.XMLUtils;
-import org.orbeon.oxf.util.Base64;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.AttributesImpl;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import java.text.MessageFormat;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Locale;
-
-
-public class StrutsActionErrorsGenerator extends org.orbeon.oxf.processor.ProcessorImpl {
-
-    public static final String ACTION_ERRORS_ELEMENT = "errors";
-    public static final String ACTION_ERROR_ELEMENT = "error";
-    public static final String ACTION_ERROR_PROPERTY_ATTRIBUTE = "property";
-
-    public static final String DEFAULT_MESSAGE = "Key {0} not specified in application resources";
-
-    public static final String ERRORS_MESSAGE_BUNDLE = "bundle";
-
-    private static Locale defaultLocale = Locale.getDefault();
-    private static MessageFormat DEFAULT_MESSAGE_FORMAT = new MessageFormat(DEFAULT_MESSAGE);
-    private static Long INITIAL_VALIDITY = new Long(0);
-
-    // Very basic cache; in general, we can assume that this processor doesn't cache
-    private static String latestDigest;
-    private static Long latestValidity = INITIAL_VALIDITY;
-
-    public StrutsActionErrorsGenerator() {
-        addOutputInfo(new ProcessorInputOutputInfo(OUTPUT_DATA));
-    }
-
-    protected void readOutput(PipelineContext pipelineContext, ContentHandler contentHandler) {
-        ExternalContext external = (ExternalContext) pipelineContext.getAttribute(PipelineContext.EXTERNAL_CONTEXT);
-        if (!(external instanceof ServletExternalContext))
-            throw new OXFException("Orbeon Forms is not running as a servlet. This is not supported.");
-
-        HttpServletRequest request = (HttpServletRequest) external.getNativeRequest();
-        if (request == null)
-            throw new OXFException("HTTP Request not found in context");
-
-        ServletContext servletContext = (ServletContext) external.getNativeContext();
-        if (servletContext == null)
-            throw new OXFException("Servlet Context not found in context");
-
-        try {
-            contentHandler.startDocument();
-            contentHandler.startElement("", ACTION_ERRORS_ELEMENT, ACTION_ERRORS_ELEMENT, XMLUtils.EMPTY_ATTRIBUTES);
-
-            ActionErrors errors = (ActionErrors) request.getAttribute(Globals.ERROR_KEY);
-
-            if (errors != null) {
-                Locale locale = (Locale) request.getSession().getAttribute(Globals.LOCALE_KEY);
-
-                if (locale == null)
-                    locale = defaultLocale;
-
-                String bundle = getPropertySet().getString(ERRORS_MESSAGE_BUNDLE);
-                if (bundle == null) {
-                    bundle = Globals.MESSAGES_KEY;
-                }
-
-                MessageResources messages = (MessageResources) request.getAttribute(bundle);
-                if (messages == null) {
-                    messages = (MessageResources) servletContext.getAttribute(bundle);
-                }
-
-                if (messages == null) {
-                    throw new OXFException("Can't load message resource from bundle: " + bundle);
-                }
-
-                String message = null;
-                message = messages.getMessage(locale, "errors.header");
-                if (message != null) {
-                    AttributesImpl atts = new AttributesImpl();
-                    atts.addAttribute("", ACTION_ERROR_PROPERTY_ATTRIBUTE, ACTION_ERROR_PROPERTY_ATTRIBUTE, "CDATA", "errors.header");
-                    contentHandler.startElement("", ACTION_ERROR_ELEMENT, ACTION_ERROR_ELEMENT, atts);
-                    contentHandler.characters(message.toCharArray(), 0, message.length());
-                    contentHandler.endElement("", ACTION_ERROR_ELEMENT, ACTION_ERROR_ELEMENT);
-                }
-
-                for (Iterator i = errors.properties(); i.hasNext();) {
-                    String property = (String) i.next();
-                    for (Iterator j = errors.get(property); j.hasNext();) {
-                        ActionError error = (ActionError) j.next();
-                        AttributesImpl atts = new AttributesImpl();
-                        atts.addAttribute("", ACTION_ERROR_PROPERTY_ATTRIBUTE, ACTION_ERROR_PROPERTY_ATTRIBUTE, "CDATA", property);
-                        contentHandler.startElement("", ACTION_ERROR_ELEMENT, ACTION_ERROR_ELEMENT, atts);
-                        message = messages.getMessage(locale, error.getKey(), error.getValues());
-                        if (message == null) {
-                            Object[] objs = {error.getKey()};
-                            message = DEFAULT_MESSAGE_FORMAT.format(objs);
-                        }
-                        contentHandler.characters(message.toCharArray(), 0, message.length());
-                        contentHandler.endElement("", ACTION_ERROR_ELEMENT, ACTION_ERROR_ELEMENT);
-                    }
-                }
-
-                message = messages.getMessage(locale, "errors.footer");
-                if (message != null) {
-                    AttributesImpl atts = new AttributesImpl();
-                    atts.addAttribute("", ACTION_ERROR_PROPERTY_ATTRIBUTE, ACTION_ERROR_PROPERTY_ATTRIBUTE, "CDATA", "errors.footer");
-                    contentHandler.startElement("", ACTION_ERROR_ELEMENT, ACTION_ERROR_ELEMENT, atts);
-                    contentHandler.characters(message.toCharArray(), 0, message.length());
-                    contentHandler.endElement("", ACTION_ERROR_ELEMENT, ACTION_ERROR_ELEMENT);
-                }
-
-
-            }
-
-            contentHandler.endElement("", ACTION_ERRORS_ELEMENT, ACTION_ERRORS_ELEMENT);
-            contentHandler.endDocument();
-        } catch (Exception e) {
-            throw new OXFException(e);
-        }
-
-    }
-
-    public ProcessorOutput createOutput(String name) {
-        ProcessorOutput output = new ProcessorImpl.ProcessorOutputImpl(getClass(), name) {
-            public void readImpl(PipelineContext context, ContentHandler contentHandler) {
-                try {
-                    State state = (State) getState(context);
-                    if (state.store == null)
-                        computeState(context, state);
-
-                    state.store.replay(contentHandler);
-                } catch (SAXException e) {
-                    throw new OXFException(e);
-                }
-            }
-
-            protected Object getValidityImpl(PipelineContext context) {
-                State state = (State) getState(context);
-                if (state.outputCacheKey == null)
-                    computeState(context, state);
-                return state.validity;
-            }
-
-            protected OutputCacheKey getKeyImpl(PipelineContext context) {
-                State state = (State) getState(context);
-                if (state.outputCacheKey == null)
-                   computeState(context, state);
-
-                return state.outputCacheKey;
-            }
-
-            private void computeState(PipelineContext context, State state) {
-                state.store = new SAXStore();
-                XMLUtils.DigestContentHandler dch = new XMLUtils.DigestContentHandler("MD5");
-                TeeContentHandler tee = new TeeContentHandler(Arrays.asList(new Object[]{state.store, dch}));
-
-                readOutput(context, tee);
-                String digest = Base64.encode(dch.getResult());
-
-                // Make sure that validity extraction is thread-safe
-                synchronized (StrutsActionErrorsGenerator.class) {
-                    if (!digest.equals(latestDigest)) {
-                        latestDigest = digest;
-                        latestValidity = new Long(System.currentTimeMillis());
-                    }
-                    state.validity = latestValidity;
-                }
-
-                state.outputCacheKey = new SimpleOutputCacheKey
-                    ( StrutsActionErrorsGenerator.class, OUTPUT_DATA, "constant" );
-             }
-        };
-
-        addOutput(name, output);
-        return output;
-    }
-
-
-    public void reset(PipelineContext context) {
-        setState(context, new State());
-    }
-
-    /**
-     * We store in the state the request document (output of this processor) and
-     * its key. This information is stored to be reused by readImpl() after a
-     * getKeyImpl() in the same pipeline context, or vice versa.
-     */
-    private static class State {
-        public OutputCacheKey outputCacheKey;
-        public Long validity;
-        public SAXStore store;
-    }
-
-//    private String escape(String string) {
-//
-//        if ((string == null) || (string.indexOf('\'') < 0))
-//            return (string);
-//        int n = string.length();
-//        StringBuffer sb = new StringBuffer(n);
-//        for (int i = 0; i < n; i++) {
-//            char ch = string.charAt(i);
-//            if (ch == '\'')
-//                sb.append('\'');
-//            sb.append(ch);
-//        }
-//        return (sb.toString());
-//
-//    }
-
-}
Index: src/java/org/orbeon/oxf/processor/generator/StrutsActionFormGenerator.java
===================================================================
RCS file: src/java/org/orbeon/oxf/processor/generator/StrutsActionFormGenerator.java
diff -N src/java/org/orbeon/oxf/processor/generator/StrutsActionFormGenerator.java
--- src/java/org/orbeon/oxf/processor/generator/StrutsActionFormGenerator.java	10 Jan 2008 20:31:57 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,92 +0,0 @@
-/**
- *  Copyright (C) 2004 Orbeon, Inc.
- *
- *  This program 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 program 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.
- *
- *  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
- */
-package org.orbeon.oxf.processor.generator;
-
-import org.apache.log4j.Logger;
-import org.apache.struts.action.ActionForm;
-import org.exolab.castor.xml.Marshaller;
-import org.orbeon.oxf.common.OXFException;
-import org.orbeon.oxf.util.LoggerFactory;
-import org.orbeon.oxf.xml.XMLUtils;
-import org.xml.sax.ContentHandler;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.Enumeration;
-
-/**
- */
-public class StrutsActionFormGenerator extends org.orbeon.oxf.processor.ProcessorImpl {
-    static private Logger logger = LoggerFactory.createLogger(StrutsActionFormGenerator.class);
-
-    public StrutsActionFormGenerator() {
-        addOutputInfo(new org.orbeon.oxf.processor.ProcessorInputOutputInfo(OUTPUT_DATA));
-    }
-
-    public org.orbeon.oxf.processor.ProcessorOutput createOutput(String name) {
-        org.orbeon.oxf.processor.ProcessorOutput output = new org.orbeon.oxf.processor.ProcessorImpl.ProcessorOutputImpl(getClass(), name) {
-            public void readImpl(org.orbeon.oxf.pipeline.api.PipelineContext context, ContentHandler contentHandler) {
-                HttpServletRequest request = (HttpServletRequest) context.getAttribute(org.orbeon.oxf.pipeline.api.PipelineContext.STRUTS_REQUEST);
-                if (request == null)
-                    throw new OXFException("Missing request object in StrutsActionFormGenerator");
-                try {
-                    contentHandler.startDocument();
-                    String rootElementName = "struts-beans";
-                    contentHandler.startElement("", rootElementName, rootElementName, XMLUtils.EMPTY_ATTRIBUTES);
-
-//                    HttpSession session = request.getSession();
-//                    for(Enumeration e = session.getAttributeNames(); e.hasMoreElements(); ) {
-//                        String name = (String)e.nextElement();
-//                        Object attribute = session.getAttribute(name);
-//                        if(attribute instanceof ActionForm) {
-//                            if (logger.isDebugEnabled())
-//                                logger.debug("Serializing session Attr: " + name + " = " + attribute);
-//                            addStrutsActionForms(name, attribute, contentHandler);
-//                        }
-//                    }
-
-
-                    for (Enumeration e = request.getAttributeNames(); e.hasMoreElements();) {
-                        String name = (String) e.nextElement();
-                        Object attribute = request.getAttribute(name);
-                        if (attribute instanceof ActionForm) {
-                            if (logger.isDebugEnabled())
-                                logger.debug("Serializing request Attr: " + name + " = " + attribute);
-                            addStrutsActionForms(name, attribute, contentHandler);
-                        }
-                    }
-
-
-                    contentHandler.endElement("", rootElementName, rootElementName);
-                    contentHandler.endDocument();
-                } catch (Exception e) {
-                    throw new OXFException(e);
-                }
-            }
-        };
-        addOutput(name, output);
-        return output;
-    }
-
-    private void addStrutsActionForms(String name, Object bean, ContentHandler ch) {
-        try {
-            Marshaller marshaller = new Marshaller(ch);
-            marshaller.setMarshalAsDocument(false);
-            marshaller.setRootElement(name);
-            marshaller.marshal(bean);
-        } catch (Exception e) {
-            throw new OXFException(e);
-        }
-    }
-
-}
Index: build.xml
===================================================================
RCS file: /cvsroot/ops/orbeon/build.xml,v
retrieving revision 1.249
diff -u -r1.249 build.xml
--- build.xml	9 Jul 2008 17:44:16 -0000	1.249
+++ build.xml	28 Jul 2008 20:39:50 -0000
@@ -194,13 +194,6 @@
             <src path="${build.dir}/src"/>
             <src path="${java-src.dir}"/>
             <exclude name="org/orbeon/oxf/common/Version.java"/>
-            <exclude name="org/orbeon/oxf/resources/XMLDB*"/>
-            <exclude name="org/orbeon/oxf/processor/bpel/**/*.java"/>
-            <exclude name="org/orbeon/oxf/processor/IMProcessor*"/>
-            <exclude name="org/orbeon/oxf/processor/generator/Struts*.java"/>
-            <exclude name="org/orbeon/oxf/struts/**/*.java"/>
-            <exclude name="org/orbeon/oxf/util/Struts*.java"/>
-            <exclude name="org/orbeon/oxf/resources/Cache*"/>
         </javac>
     </target>
 
