cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r639645 [2/7] - in /cocoon/whiteboard/corona/trunk: ./ corona-core/ corona-core/src/ corona-core/src/main/ corona-core/src/main/java/ corona-core/src/main/java/org/ corona-core/src/main/java/org/apache/ corona-core/src/main/java/org/apache/...
Date Fri, 21 Mar 2008 13:55:20 GMT
Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/PrototypePipelineComponentFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/PrototypePipelineComponentFactory.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/PrototypePipelineComponentFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/RedirectorComponent.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/RedirectorComponent.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/RedirectorComponent.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/RedirectorComponent.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.pipeline.component;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.cocoon.corona.sitemap.Invocation;
+import org.apache.cocoon.corona.sitemap.util.HttpContextHelper;
+
+public class RedirectorComponent implements Starter, Finisher {
+
+    private String uri;
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.pipeline.component.Starter#execute(org.apache.cocoon.corona.sitemap.Invocation)
+     */
+    public void execute(final Invocation invocation) {
+        HttpServletResponse response = HttpContextHelper.getResponse(invocation);
+
+        try {
+            String location = response.encodeRedirectURL(this.uri);
+            response.sendRedirect(location);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.pipeline.component.Finisher#setOutputStream(java.io.OutputStream)
+     */
+    public void setOutputStream(OutputStream outputStream) {
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.pipeline.component.PipelineComponent#setParameters(java.util.Map)
+     */
+    public void setParameters(Map<String, ? extends Object> parameters) {
+        this.uri = (String) parameters.get("uri");
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        return "RedirectorComponent(" + this.uri + ")";
+    }
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/RedirectorComponent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/RedirectorComponent.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/RedirectorComponent.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/ReflectionPipelineComponentFactory.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/ReflectionPipelineComponentFactory.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/ReflectionPipelineComponentFactory.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/ReflectionPipelineComponentFactory.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.pipeline.component;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+public class ReflectionPipelineComponentFactory implements PipelineComponentFactory {
+
+    private Map<String, Class<? extends PipelineComponent>> types = new HashMap<String, Class<? extends PipelineComponent>>();
+
+    /**
+     * @param types
+     */
+    @SuppressWarnings("unchecked")
+    public void setTypes(Map<String, String> types) {
+        for (Entry<String, String> entry : types.entrySet()) {
+            try {
+                Class<? extends PipelineComponent> nodeClass = (Class<? extends PipelineComponent>) Class.forName(entry
+                        .getValue());
+                this.types.put(entry.getKey(), nodeClass);
+            } catch (ClassCastException ccex) {
+                throw new IllegalArgumentException("Could not register class " + entry.getValue()
+                        + " as component type " + entry.getKey(), ccex);
+            } catch (ClassNotFoundException cnfex) {
+                throw new IllegalArgumentException("Could not register class " + entry.getValue()
+                        + " as component type " + entry.getKey(), cnfex);
+            }
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.pipeline.component.PipelineComponentFactory#createComponent(java.lang.String)
+     */
+    public PipelineComponent createComponent(String type) {
+        Class<? extends PipelineComponent> componentClass = this.types.get(type);
+
+        if (componentClass == null) {
+            throw new IllegalArgumentException("Pipeline component type '" + type + "' is not supported.");
+        }
+
+        try {
+            return componentClass.newInstance();
+        } catch (Exception e) {
+            throw new IllegalArgumentException("A component of type '" + type + "' could not be created.", e);
+        }
+    }
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/ReflectionPipelineComponentFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/ReflectionPipelineComponentFactory.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/ReflectionPipelineComponentFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/RequestParametersGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/RequestParametersGenerator.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/RequestParametersGenerator.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/RequestParametersGenerator.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.pipeline.component;
+
+import java.util.Enumeration;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.cocoon.corona.sitemap.Invocation;
+import org.apache.cocoon.corona.sitemap.InvocationException;
+import org.apache.cocoon.corona.sitemap.util.HttpContextHelper;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+
+public class RequestParametersGenerator extends AbstractXMLProducer implements Starter {
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.pipeline.component.Starter#execute(org.apache.cocoon.corona.sitemap.Invocation)
+     */
+    @SuppressWarnings("unchecked")
+    public void execute(Invocation invocation) {
+        HttpServletRequest request = HttpContextHelper.getRequest(invocation);
+        Enumeration<String> parameterNames = request.getParameterNames();
+
+        try {
+            this.getXMLConsumer().startDocument();
+            this.getXMLConsumer().startElement("", "request-paramters", "request-paramters", new AttributesImpl());
+
+            while (parameterNames.hasMoreElements()) {
+                String name = parameterNames.nextElement();
+                String value = request.getParameter(name);
+                this.getXMLConsumer().startElement("", name, name, new AttributesImpl());
+                this.getXMLConsumer().characters(value.toCharArray(), 0, value.length());
+                this.getXMLConsumer().endElement("", name, name);
+            }
+
+            this.getXMLConsumer().endElement("", "request-paramters", "request-paramters");
+            this.getXMLConsumer().endDocument();
+        } catch (SAXException e) {
+            throw new InvocationException(e);
+        }
+    }
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/RequestParametersGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/RequestParametersGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/RequestParametersGenerator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/Starter.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/Starter.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/Starter.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/Starter.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.pipeline.component;
+
+import org.apache.cocoon.corona.sitemap.Invocation;
+
+public interface Starter extends PipelineComponent {
+
+    void execute(Invocation invocation);
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/Starter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/Starter.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/Starter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLConsumer.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLConsumer.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLConsumer.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLConsumer.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.pipeline.component;
+
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ext.LexicalHandler;
+
+public interface XMLConsumer extends ContentHandler, LexicalHandler, Consumer {
+
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLConsumer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLConsumer.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLConsumer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLProducer.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLProducer.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLProducer.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLProducer.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.pipeline.component;
+
+public interface XMLProducer extends Producer {
+
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLProducer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLProducer.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLProducer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLSerializer.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLSerializer.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLSerializer.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLSerializer.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.pipeline.component;
+
+import java.io.OutputStream;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TransformerHandler;
+import javax.xml.transform.stream.StreamResult;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+
+public class XMLSerializer implements XMLConsumer, Finisher {
+
+    private static final SAXTransformerFactory SAX_TRANSFORMER_FACTORY = (SAXTransformerFactory) TransformerFactory
+            .newInstance();
+
+    private Properties format = new Properties();
+
+    private TransformerHandler transformerHandler;
+
+    public void characters(char[] ch, int start, int length) throws SAXException {
+        this.transformerHandler.characters(ch, start, length);
+    }
+
+    public void comment(char[] ch, int start, int length) throws SAXException {
+        this.transformerHandler.comment(ch, start, length);
+    }
+
+    public void endCDATA() throws SAXException {
+        this.transformerHandler.endCDATA();
+    }
+
+    public void endDocument() throws SAXException {
+        this.transformerHandler.endDocument();
+    }
+
+    public void endDTD() throws SAXException {
+        this.transformerHandler.endDTD();
+    }
+
+    public void endElement(String uri, String localName, String name) throws SAXException {
+        this.transformerHandler.endElement(uri, localName, name);
+    }
+
+    public void endEntity(String name) throws SAXException {
+        this.transformerHandler.endEntity(name);
+    }
+
+    public void endPrefixMapping(String prefix) throws SAXException {
+        this.transformerHandler.endPrefixMapping(prefix);
+    }
+
+    public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
+        this.transformerHandler.ignorableWhitespace(ch, start, length);
+    }
+
+    public void processingInstruction(String target, String data) throws SAXException {
+        this.transformerHandler.processingInstruction(target, data);
+    }
+
+    public void setDocumentLocator(Locator locator) {
+        this.transformerHandler.setDocumentLocator(locator);
+    }
+
+    public void setFormat(Properties format) {
+        this.format = format;
+    }
+
+    public void setOutputStream(OutputStream outputStream) {
+        try {
+            this.transformerHandler = SAX_TRANSFORMER_FACTORY.newTransformerHandler();
+            this.format.put(OutputKeys.METHOD, "xml");
+            this.transformerHandler.getTransformer().setOutputProperties(this.format);
+            this.transformerHandler.setResult(new StreamResult(outputStream));
+        } catch (TransformerConfigurationException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public void setParameters(Map<String, ? extends Object> parameters) {
+        // currently no parameters...
+    }
+
+    public void skippedEntity(String name) throws SAXException {
+        this.transformerHandler.skippedEntity(name);
+    }
+
+    public void startCDATA() throws SAXException {
+        this.transformerHandler.startCDATA();
+    }
+
+    public void startDocument() throws SAXException {
+        this.transformerHandler.startDocument();
+    }
+
+    public void startDTD(String name, String publicId, String systemId) throws SAXException {
+        this.transformerHandler.startDTD(name, publicId, systemId);
+    }
+
+    public void startElement(String uri, String localName, String name, Attributes atts) throws SAXException {
+        this.transformerHandler.startElement(uri, localName, name, atts);
+    }
+
+    public void startEntity(String name) throws SAXException {
+        this.transformerHandler.startEntity(name);
+    }
+
+    public void startPrefixMapping(String prefix, String uri) throws SAXException {
+        this.transformerHandler.startPrefixMapping(prefix, uri);
+    }
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLSerializer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLSerializer.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/pipeline/component/XMLSerializer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/ComponentProvider.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/ComponentProvider.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/ComponentProvider.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/ComponentProvider.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.sitemap;
+
+import java.net.URL;
+
+import org.apache.cocoon.corona.pipeline.Pipeline;
+import org.apache.cocoon.corona.pipeline.action.Action;
+import org.apache.cocoon.corona.pipeline.component.PipelineComponent;
+import org.apache.cocoon.corona.sitemap.expression.LanguageInterpreter;
+
+public interface ComponentProvider {
+
+    Action createAction(String type);
+
+    PipelineComponent createComponent(String type);
+
+    Pipeline createPipeline(String type);
+
+    LanguageInterpreter getLanguageInterpreter(String language);
+
+    URL resolve(String resource);
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/ComponentProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/ComponentProvider.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/ComponentProvider.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/ComponentProviderImpl.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/ComponentProviderImpl.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/ComponentProviderImpl.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/ComponentProviderImpl.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.sitemap;
+
+import java.net.URL;
+
+import org.apache.cocoon.corona.pipeline.Pipeline;
+import org.apache.cocoon.corona.pipeline.PipelineFactory;
+import org.apache.cocoon.corona.pipeline.action.Action;
+import org.apache.cocoon.corona.pipeline.action.ActionFactory;
+import org.apache.cocoon.corona.pipeline.component.PipelineComponent;
+import org.apache.cocoon.corona.pipeline.component.PipelineComponentFactory;
+import org.apache.cocoon.corona.sitemap.expression.LanguageInterpreter;
+import org.apache.cocoon.corona.sitemap.expression.LanguageInterpreterFactory;
+import org.apache.cocoon.corona.sitemap.resource.ResourceResolver;
+
+public class ComponentProviderImpl implements ComponentProvider {
+
+    private ActionFactory actionFactory;
+
+    private PipelineComponentFactory pipelineComponentFactory;
+
+    private PipelineFactory pipelineFactory;
+
+    private ResourceResolver resourceResolver;
+
+    private LanguageInterpreterFactory languageInterpreterFactory;
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.ComponentProvider#createAction(java.lang.String)
+     */
+    public Action createAction(String type) {
+        return this.actionFactory.createAction(type);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.ComponentProvider#createComponent(java.lang.String)
+     */
+    public PipelineComponent createComponent(String type) {
+        return this.pipelineComponentFactory.createComponent(type);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.ComponentProvider#createPipeline(java.lang.String)
+     */
+    public Pipeline createPipeline(String type) {
+        return this.pipelineFactory.createPipeline(type);
+    }
+
+    public LanguageInterpreter getLanguageInterpreter(String language) {
+        return this.languageInterpreterFactory.getLanguageInterpreter(language);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.ComponentProvider#resolve(java.lang.String)
+     */
+    public URL resolve(String resource) {
+        return this.resourceResolver.resolve(resource);
+    }
+
+    public void setActionFactory(ActionFactory actionFactory) {
+        this.actionFactory = actionFactory;
+    }
+
+    public void setLanguageInterpreterFactory(LanguageInterpreterFactory languageInterpreterFactory) {
+        this.languageInterpreterFactory = languageInterpreterFactory;
+    }
+
+    public void setPipelineComponentFactory(PipelineComponentFactory pipelineComponentFactory) {
+        this.pipelineComponentFactory = pipelineComponentFactory;
+    }
+
+    public void setPipelineFactory(PipelineFactory pipelineFactory) {
+        this.pipelineFactory = pipelineFactory;
+    }
+
+    public void setResourceResolver(ResourceResolver resourceResolver) {
+        this.resourceResolver = resourceResolver;
+    }
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/ComponentProviderImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/ComponentProviderImpl.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/ComponentProviderImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/CustomException.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/CustomException.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/CustomException.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/CustomException.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.sitemap;
+
+public class CustomException extends Exception {
+
+    private static final long serialVersionUID = 1L;
+
+    public CustomException() {
+        super();
+    }
+
+    public CustomException(String message) {
+        super(message);
+    }
+
+    public CustomException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public CustomException(Throwable cause) {
+        super(cause);
+    }
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/CustomException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/CustomException.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/CustomException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/Invocation.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/Invocation.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/Invocation.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/Invocation.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.sitemap;
+
+import java.io.OutputStream;
+import java.net.URL;
+import java.util.Map;
+
+public interface Invocation {
+
+    void addParameter(String key, Object value);
+
+    void execute() throws Exception;
+
+    OutputStream getOutputStream();
+
+    Object getParameter(String name);
+
+    Map<String, Object> getParameters();
+
+    String getRequest();
+
+    Throwable getThrowable();
+
+    void installAction(String type);
+
+    void installComponent(String type, Map<String, ? extends Object> parameters);
+
+    void installPipeline(String type);
+
+    boolean isErrorInvocation();
+
+    URL resolve(String resource);
+
+    void setOutputStream(OutputStream outputStream);
+
+    void setParameters(Map<String, Object> parameters);
+
+    void setThrowable(Throwable throwable);
+
+    void pushSitemapParameters(String nodeName, Map<String, ? extends Object> sitemapParameters);
+
+    void popSitemapParameters();
+
+    String getSitemapParameter(String parameterName);
+
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/Invocation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/Invocation.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/Invocation.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/InvocationException.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/InvocationException.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/InvocationException.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/InvocationException.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.sitemap;
+
+public class InvocationException extends RuntimeException {
+
+    private static final long serialVersionUID = 1L;
+
+    public InvocationException() {
+        super();
+    }
+
+    public InvocationException(String message) {
+        super(message);
+    }
+
+    public InvocationException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public InvocationException(Throwable cause) {
+        super(cause);
+    }
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/InvocationException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/InvocationException.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/InvocationException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/InvocationImpl.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/InvocationImpl.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/InvocationImpl.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/InvocationImpl.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,289 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.sitemap;
+
+import java.io.OutputStream;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.cocoon.corona.pipeline.Pipeline;
+import org.apache.cocoon.corona.pipeline.action.Action;
+import org.apache.cocoon.corona.pipeline.component.PipelineComponent;
+import org.apache.cocoon.corona.sitemap.expression.LanguageInterpreter;
+
+public class InvocationImpl implements Invocation {
+
+    private static final Pattern PARAMETER_PATTERN = Pattern.compile("\\{([a-zA-Z\\-]+):([^\\{]*)\\}");
+
+    private ComponentProvider componentProvider;
+
+    private OutputStream outputStream;
+
+    private Map<String, Object> parameters;
+
+    private Pipeline pipeline;
+
+    private String request;
+
+    private SitemapParameters sitemapParameters = new SitemapParameters();
+
+    private Throwable throwable;
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.Invocation#addParameter(java.lang.String,
+     *      java.lang.Object)
+     */
+    public void addParameter(String key, Object value) {
+        if (this.parameters == null) {
+            this.parameters = new HashMap<String, Object>();
+        }
+
+        this.parameters.put(key, value);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.Invocation#execute()
+     */
+    public void execute() throws Exception {
+        if (this.pipeline == null) {
+            throw new IllegalStateException("InvocationImpl has been executed without having a pipeline.");
+        }
+
+        this.pipeline.execute(this);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.Invocation#getOutputStream()
+     */
+    public OutputStream getOutputStream() {
+        return this.outputStream;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.Invocation#getParameter(java.lang.String)
+     */
+    public Object getParameter(String name) {
+        if (this.parameters == null) {
+            return null;
+        }
+        return this.parameters.get(name);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.Invocation#getParameters()
+     */
+    public Map<String, Object> getParameters() {
+        return this.parameters;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.Invocation#getRequest()
+     */
+    public String getRequest() {
+        return this.request;
+    }
+
+    public String getSitemapParameter(String parameterName) {
+        return this.sitemapParameters.getParameter(parameterName);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.Invocation#getThrowable()
+     */
+    public Throwable getThrowable() {
+        return this.throwable;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.Invocation#installAction(java.lang.String)
+     */
+    public void installAction(String type) {
+        if (this.pipeline == null) {
+            throw new IllegalStateException("Action cannot be installed without having a pipeline.");
+        }
+
+        Action action = this.componentProvider.createAction(type);
+        this.pipeline.addAction(action);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.Invocation#installComponent(java.lang.String,
+     *      java.util.Map)
+     */
+    public void installComponent(String type, Map<String, ? extends Object> componentParameters) {
+        if (this.pipeline == null) {
+            throw new IllegalStateException("Pipeline component cannot be installed without having a pipeline.");
+        }
+
+        PipelineComponent component = this.componentProvider.createComponent(type);
+        Map<String, ? extends Object> resolvedParameters = this.resolveParameters(componentParameters);
+        component.setParameters(resolvedParameters);
+        this.pipeline.addComponent(component);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.Invocation#installPipeline(java.lang.String)
+     */
+    public void installPipeline(String type) {
+        this.pipeline = this.componentProvider.createPipeline(type);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.Invocation#isErrorInvocation()
+     */
+    public boolean isErrorInvocation() {
+        return this.throwable != null;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.Invocation#popSitemapParameters()
+     */
+    public void popSitemapParameters() {
+        this.sitemapParameters.popParameters();
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.Invocation#pushSitemapParameters(java.lang.String,
+     *      java.util.Map)
+     */
+    public void pushSitemapParameters(String nodeName, Map<String, ? extends Object> sitemapParameters) {
+        this.sitemapParameters.pushParameters(nodeName, sitemapParameters);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.Invocation#resolve(java.lang.String)
+     */
+    public URL resolve(String resource) {
+        return this.componentProvider.resolve(resource);
+    }
+
+    public void setComponentProvider(ComponentProvider componentProvider) {
+        this.componentProvider = componentProvider;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.Invocation#setOutputStream(java.io.OutputStream)
+     */
+    public void setOutputStream(OutputStream outputStream) {
+        this.outputStream = outputStream;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.Invocation#setParameters(java.util.Map)
+     */
+    public void setParameters(Map<String, Object> parameters) {
+        this.parameters = parameters;
+    }
+
+    public void setRequest(String request) {
+        this.request = request;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.sitemap.Invocation#setThrowable(java.lang.Throwable)
+     */
+    public void setThrowable(Throwable throwable) {
+        this.throwable = throwable;
+    }
+
+    private LanguageInterpreter getLanguageInterpreter(final String language) {
+        return this.componentProvider.getLanguageInterpreter(language);
+    }
+
+    private String resolveParameter(final String parameter) {
+        final StringBuilder result = new StringBuilder(parameter);
+        final Matcher matcher = PARAMETER_PATTERN.matcher(result);
+
+        while (matcher.find()) {
+            final String language = matcher.group(1);
+            final LanguageInterpreter languageInterpreter = this.getLanguageInterpreter(language);
+            if (languageInterpreter == null) {
+                throw new IllegalArgumentException("Could not resolve parameter '" + parameter + "'. The language '"
+                        + language + "' is not supported.");
+            }
+
+            final String variable = matcher.group(2);
+
+            // FIXME Passing 'this' (InvocationContext) introduces a cyclic
+            // dependency. Could be solved by having an explicit object model.
+            final String replacement = languageInterpreter.resolve(variable, this);
+
+            result.replace(matcher.start(), matcher.end(), replacement);
+            matcher.reset();
+        }
+
+        return result.toString();
+    }
+
+    private Map<String, ? extends Object> resolveParameters(final Map<String, ? extends Object> componentParameters) {
+        final Map<String, Object> resolvedParameters = new HashMap<String, Object>();
+
+        for (String key : componentParameters.keySet()) {
+            final Object parameter = componentParameters.get(key);
+
+            if (!(parameter instanceof String)) {
+                // can only resolve strings
+                resolvedParameters.put(key, parameter);
+                continue;
+            }
+
+            final String resolvedParameter = this.resolveParameter((String) parameter);
+            resolvedParameters.put(key, resolvedParameter);
+        }
+
+        return resolvedParameters;
+    }
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/InvocationImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/InvocationImpl.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/InvocationImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/NoMatchingPipelineException.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/NoMatchingPipelineException.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/NoMatchingPipelineException.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/NoMatchingPipelineException.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.sitemap;
+
+public class NoMatchingPipelineException extends InvocationException {
+
+    private static final long serialVersionUID = 1L;
+
+    public NoMatchingPipelineException() {
+        super();
+    }
+
+    public NoMatchingPipelineException(String message) {
+        super(message);
+    }
+
+    public NoMatchingPipelineException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public NoMatchingPipelineException(Throwable cause) {
+        super(cause);
+    }
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/NoMatchingPipelineException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/NoMatchingPipelineException.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/NoMatchingPipelineException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/SitemapBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/SitemapBuilder.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/SitemapBuilder.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/SitemapBuilder.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.sitemap;
+
+import java.io.InputStream;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.apache.cocoon.corona.sitemap.node.Sitemap;
+import org.apache.cocoon.corona.sitemap.node.SitemapNode;
+import org.apache.cocoon.corona.sitemap.node.SitemapNodeFactory;
+import org.xml.sax.Attributes;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class SitemapBuilder {
+
+    private SitemapNodeFactory sitemapNodeFactory;
+
+    public Sitemap build(URL sitemap) throws Exception {
+        SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
+        saxParserFactory.setNamespaceAware(true);
+        SAXParser saxParser = saxParserFactory.newSAXParser();
+
+        InputStream inputStream = sitemap.openStream();
+        SitemapHandler sitemapHandler = new SitemapHandler();
+        saxParser.parse(inputStream, sitemapHandler);
+        inputStream.close();
+
+        return sitemapHandler.getSitemap();
+    }
+
+    public void setSitemapNodeFactory(SitemapNodeFactory sitemapNodeFactory) {
+        this.sitemapNodeFactory = sitemapNodeFactory;
+    }
+
+    protected SitemapNode createSitemapNode(String localName, Map<String, String> parameters) {
+        return SitemapBuilder.this.sitemapNodeFactory.createNode(localName, parameters);
+    }
+
+    class SitemapHandler extends DefaultHandler {
+
+        private SitemapNode currentNode;
+
+        private Sitemap sitemap;
+
+        @Override
+        public void endElement(String uri, String localName, String name) {
+            if (this.currentNode == null) {
+                throw new IllegalStateException("Received closing '" + localName + "' but there was no node to close.");
+            }
+
+            this.currentNode = this.currentNode.getParent();
+        }
+
+        public Sitemap getSitemap() {
+            return this.sitemap;
+        }
+
+        @Override
+        public void startElement(String uri, String localName, String name, Attributes attributes) {
+            if (this.currentNode == null) {
+                if (localName.equals("sitemap")) {
+                    this.sitemap = (Sitemap) SitemapBuilder.this.createSitemapNode(localName, null);
+                    this.currentNode = this.sitemap;
+                    return;
+                }
+                throw new IllegalStateException("Expected 'sitemap' as first element, but received '" + localName + "'");
+            }
+
+            Map<String, String> parameters = new HashMap<String, String>();
+            int length = attributes.getLength();
+            for (int i = 0; i < length; i++) {
+                parameters.put(attributes.getQName(i), attributes.getValue(i));
+            }
+
+            SitemapNode node = SitemapBuilder.this.createSitemapNode(localName, parameters);
+            this.currentNode.addChild(node);
+            this.currentNode = node;
+        }
+    }
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/SitemapBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/SitemapBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/SitemapBuilder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/SitemapParameters.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/SitemapParameters.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/SitemapParameters.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/SitemapParameters.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.sitemap;
+
+import java.util.Map;
+import java.util.Stack;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class SitemapParameters {
+
+    private static final Pattern ABSOLUTE_PARAMETER_PATTERN = Pattern.compile("([a-zA-z0-9]+)/(.+)");
+    private static final String RELATIVE_LOCATION_PREFIX = "../";
+    private static final Pattern RELATIVE_PARAMETER_PATTERN = Pattern.compile("((" + Pattern.quote(RELATIVE_LOCATION_PREFIX)
+            + ")*)(.+)");
+
+    private Stack<Entry> entries = new Stack<Entry>();
+
+    public String getParameter(String parameterName) {
+
+        Matcher absoluteParameterMatcher = ABSOLUTE_PARAMETER_PATTERN.matcher(parameterName);
+        if (absoluteParameterMatcher.matches()) {
+            return this.resolveAbsoluteParameter(parameterName, absoluteParameterMatcher);
+        }
+
+        Matcher relativeParameterMatcher = RELATIVE_PARAMETER_PATTERN.matcher(parameterName);
+        if (relativeParameterMatcher.matches()) {
+            return this.resolveRelativeParameter(relativeParameterMatcher);
+        }
+
+        throw new IllegalArgumentException("Sitemap parameter '" + parameterName + "' is invalid. Valid formats are: '"
+                + ABSOLUTE_PARAMETER_PATTERN.pattern() + "' or '" + RELATIVE_PARAMETER_PATTERN.pattern() + "'");
+    }
+
+    public void popParameters() {
+        this.entries.pop();
+    }
+
+    public void pushParameters(String name, Map<String, ? extends Object> parameters) {
+        this.entries.push(new Entry(name, parameters));
+    }
+
+    private String resolveAbsoluteParameter(String parameterName, Matcher absoluteParameterMatcher) {
+        final String entryName = absoluteParameterMatcher.group(1);
+        final String name = absoluteParameterMatcher.group(2);
+
+        for (Entry entry : this.entries) {
+            if (entryName.equals(entry.getName())) {
+                Object result = entry.getParameter(name);
+                if (result == null) {
+                    return null;
+                }
+
+                return result.toString();
+            }
+        }
+
+        throw new IllegalArgumentException("Sitemap parameter '" + parameterName
+                + "' could not be resolved. There was no entry for the name '" + entryName + "'");
+    }
+
+    private String resolveRelativeParameter(Matcher relativeParameterMatcher) {
+        final String levelPrefix = relativeParameterMatcher.group(2);
+        final String name = relativeParameterMatcher.group(3);
+        final int level;
+        if (levelPrefix == null) {
+            level = 0;
+        } else {
+            level = levelPrefix.length() / RELATIVE_LOCATION_PREFIX.length();
+        }
+
+        final int index = this.entries.size() - level - 1;
+        if (index < 0) {
+            throw new IllegalArgumentException("Sitemap parameter '" + relativeParameterMatcher.group()
+                    + "' could not be resolved. There are only " + this.entries.size() + " entries available, but " + level
+                    + " entries were requested.");
+        }
+
+        Entry entry = this.entries.get(index);
+        Object result = entry.getParameter(name);
+        if (result == null) {
+            return null;
+        }
+
+        return result.toString();
+    }
+
+    private class Entry {
+
+        private String name;
+        private Map<String, ? extends Object> parameters;
+
+        public Entry(String name, Map<String, ? extends Object> parameters) {
+            super();
+            this.name = name;
+            this.parameters = parameters;
+        }
+
+        public String getName() {
+            return this.name;
+        }
+
+        public Object getParameter(String parameterName) {
+            return this.parameters.get(parameterName);
+        }
+    }
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/SitemapParameters.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/SitemapParameters.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/SitemapParameters.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/LanguageInterpreter.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/LanguageInterpreter.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/LanguageInterpreter.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/LanguageInterpreter.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,9 @@
+package org.apache.cocoon.corona.sitemap.expression;
+
+import org.apache.cocoon.corona.sitemap.Invocation;
+
+public interface LanguageInterpreter {
+
+    String resolve(String variable, Invocation invocation);
+
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/LanguageInterpreter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/LanguageInterpreter.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/LanguageInterpreter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/LanguageInterpreterFactory.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/LanguageInterpreterFactory.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/LanguageInterpreterFactory.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/LanguageInterpreterFactory.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.sitemap.expression;
+
+
+public interface LanguageInterpreterFactory {
+
+    LanguageInterpreter getLanguageInterpreter(String language);
+
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/LanguageInterpreterFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/LanguageInterpreterFactory.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/LanguageInterpreterFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/PrototypeLanguageInterpreterFactory.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/PrototypeLanguageInterpreterFactory.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/PrototypeLanguageInterpreterFactory.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/PrototypeLanguageInterpreterFactory.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.sitemap.expression;
+
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+
+public class PrototypeLanguageInterpreterFactory implements LanguageInterpreterFactory, ApplicationContextAware {
+
+    private ApplicationContext applicationContext;
+
+    public LanguageInterpreter getLanguageInterpreter(String language) {
+        return (LanguageInterpreter) this.applicationContext.getBean("expression-language:" + language,
+                LanguageInterpreter.class);
+    }
+
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+        this.applicationContext = applicationContext;
+    }
+
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/PrototypeLanguageInterpreterFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/PrototypeLanguageInterpreterFactory.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/PrototypeLanguageInterpreterFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/SitemapLanguageInterpreter.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/SitemapLanguageInterpreter.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/SitemapLanguageInterpreter.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/SitemapLanguageInterpreter.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.sitemap.expression;
+
+import org.apache.cocoon.corona.sitemap.Invocation;
+
+public class SitemapLanguageInterpreter implements LanguageInterpreter {
+
+    public SitemapLanguageInterpreter() {
+    }
+
+    public String resolve(String variable, Invocation invocation) {
+        return invocation.getSitemapParameter(variable);
+    }
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/SitemapLanguageInterpreter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/SitemapLanguageInterpreter.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/expression/SitemapLanguageInterpreter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/node/AbstractSitemapNode.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/node/AbstractSitemapNode.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/node/AbstractSitemapNode.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/node/AbstractSitemapNode.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,193 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.sitemap.node;
+
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.cocoon.corona.sitemap.Invocation;
+import org.apache.cocoon.corona.sitemap.node.annotations.NodeChild;
+import org.apache.cocoon.corona.sitemap.node.annotations.Parameter;
+
+public abstract class AbstractSitemapNode implements SitemapNode {
+
+    private final List<SitemapNode> children = new LinkedList<SitemapNode>();
+    private final Map<String, String> parameters = new HashMap<String, String>();
+    private SitemapNode parent;
+
+    public void addChild(SitemapNode child) {
+        if (child == null) {
+            throw new IllegalArgumentException("Node of class " + this.getClass().getName() + " received null child");
+        }
+
+        if (child instanceof ParameterNode) {
+            // ParameterNode are to be translated into parameters...
+            ParameterNode parameterNode = (ParameterNode) child;
+            this.processParameter(parameterNode.getName(), parameterNode.getValue());
+        } else {
+            // check whether there is a special field for this child
+            Field childField = this.getChildField(child);
+            if (childField != null) {
+                childField.setAccessible(true);
+                try {
+                    childField.set(this, child);
+                } catch (IllegalArgumentException e) {
+                    System.out.println("Failed to set child field for child class '" + child.getClass().getName() + "': " + e);
+                } catch (IllegalAccessException e) {
+                    System.out.println("Failed to set child field for child class '" + child.getClass().getName() + "': " + e);
+                }
+            } else {
+                this.children.add(child);
+            }
+        }
+
+        child.setParent(this);
+    }
+
+    public Map<String, String> getParameters() {
+        return this.parameters;
+    }
+
+    public SitemapNode getParent() {
+        return this.parent;
+    }
+
+    public InvocationResult invoke(Invocation invocation) {
+        InvocationResult result = InvocationResult.NONE;
+
+        for (SitemapNode child : this.children) {
+            System.out.println(child + ".invoke(" + invocation.getRequest() + ")");
+            InvocationResult currentResult = child.invoke(invocation);
+            if (currentResult.compareTo(result) > 0) {
+                result = currentResult;
+            }
+
+            if (result.isCompleted()) {
+                break;
+            }
+        }
+
+        return result;
+    }
+
+    public void setParameters(Map<String, String> parameters) {
+        if (parameters == null || parameters.isEmpty()) {
+            // nothing to do
+            return;
+        }
+
+        // check whether for special parameter fields
+        Map<String, Field> parameterFields = this.getParameterFields();
+        for (Entry<String, String> entry : parameters.entrySet()) {
+            String key = entry.getKey();
+            String value = entry.getValue();
+
+            Field parameterField = parameterFields.get(key);
+            if (parameterField != null) {
+                parameterField.setAccessible(true);
+                try {
+                    parameterField.set(this, value);
+                } catch (IllegalArgumentException e) {
+                    System.out.println("Failed to set parameter field " + key + ": " + e);
+                } catch (IllegalAccessException e) {
+                    System.out.println("Failed to set parameter field " + key + ": " + e);
+                }
+                continue;
+            }
+
+            // default parameter processing
+            this.processParameter(key, value);
+        }
+    }
+
+    public void setParent(SitemapNode parent) {
+        this.parent = parent;
+    }
+
+    @Override
+    public String toString() {
+        return this.getClass().getSimpleName();
+    }
+
+    protected void processParameter(String key, String value) {
+        this.parameters.put(key, value);
+    }
+
+    private Field getChildField(SitemapNode child) {
+        Class<?> currentClass = this.getClass();
+
+        while (currentClass != null) {
+            Field[] declaredFields = currentClass.getDeclaredFields();
+            for (Field declaredField : declaredFields) {
+                if (declaredField.isAnnotationPresent(NodeChild.class) && declaredField.getType().isAssignableFrom(child.getClass())) {
+                    return declaredField;
+                }
+            }
+
+            currentClass = currentClass.getSuperclass();
+        }
+
+        return null;
+    }
+
+    private Map<String, Field> getParameterFields() {
+        Map<String, Field> parameterFields = new HashMap<String, Field>();
+
+        Class<?> currentClass = this.getClass();
+        while (currentClass != null) {
+            Field[] declaredFields = currentClass.getDeclaredFields();
+            for (Field declaredField : declaredFields) {
+                if (declaredField.isAnnotationPresent(Parameter.class)) {
+                    String fieldName = this.convertCamelCase(declaredField.getName());
+                    parameterFields.put(fieldName, declaredField);
+                }
+            }
+
+            currentClass = currentClass.getSuperclass();
+        }
+
+        return parameterFields;
+    }
+
+    private String convertCamelCase(String name) {
+        Pattern camelCasePattern = Pattern.compile("(.)([A-Z])");
+        Matcher matcher = camelCasePattern.matcher(name);
+
+        int lastMatch = 0;
+        StringBuilder result = new StringBuilder();
+        while (matcher.find()) {
+            result.append(name.substring(lastMatch, matcher.start()));
+            result.append(matcher.group(1));
+            result.append("-");
+            result.append(matcher.group(2).toLowerCase());
+            lastMatch = matcher.end();
+        }
+
+        result.append(name.substring(lastMatch, name.length()));
+
+        return result.toString();
+    }
+
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/node/AbstractSitemapNode.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/node/AbstractSitemapNode.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/node/AbstractSitemapNode.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/node/ActNode.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/node/ActNode.java?rev=639645&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/node/ActNode.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/node/ActNode.java Fri Mar 21 06:54:32 2008
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.corona.sitemap.node;
+
+import org.apache.cocoon.corona.sitemap.Invocation;
+import org.apache.cocoon.corona.sitemap.node.annotations.Parameter;
+
+public class ActNode extends AbstractSitemapNode {
+
+    private static final String ACTION_CATEGORY = "action:";
+
+    @Parameter
+    private String type;
+
+    @Override
+    public InvocationResult invoke(Invocation invocation) {
+        invocation.installAction(ACTION_CATEGORY + this.type);
+
+        // signal that we did some processing
+        return InvocationResult.PROCESSED;
+    }
+
+    @Override
+    public String toString() {
+        return "ActNode(" + this.type + ")";
+    }
+}

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/node/ActNode.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/node/ActNode.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/corona/trunk/corona-core/src/main/java/org/apache/cocoon/corona/sitemap/node/ActNode.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message