svn commit: r743041 [8/9] - in /lenya/trunk: org.apache.lenya.core.api/ org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/ org.apache.lenya.core.api/src/test/ org.apache.lenya.core.api/src/test/java/ org.apache.lenya.core.api/src...

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/example-content/tutorial/index_en
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/example-content/tutorial/index_en?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/example-content/tutorial/index_en (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/example-content/tutorial/index_en Tue Feb 10 18:22:23 2009
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" 
+xmlns:xhtml="http://www.w3.org/1999/xhtml" 
+xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0">
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: index_en 542914 2007-05-30 19:13:43Z rfrovarp $ -->
+  <head>
+    <title>Lenya Tutorial</title>
+  </head>
+  <body>
+    <h1>Tutorial</h1>
+
+    <p>This tutorial gives you a short introduction into the Apache
+    Lenya content management system. We'll look at a typical use case
+    where we create a new document, edit and publish it.</p>
+
+    <h2>Creating a new document</h2>
+
+    <p>To create a new document, go to the <code>File -> New
+    XHTML Document</code> menu entry. You'll get a new screen that asks you
+    for an id and a name for this new document. The id will be used
+    internally as an identifier for the document and the name will be
+    used in the navigation. Let's use "helloworld" as id and "Hello World" as the
+    name of the new document. Now press <code>Create</code>. You will
+    be redirected back to the page where you originally invoked the
+    creation and you'll notice that the new document "Hello World" now shows
+    up as a sub-document of the Tutorial document in the
+    navigation.</p>
+
+    <p>This illustrates the fact that a new document is always created
+    as a sub-document of the document you're currently looking at. You
+    also notice how the navigation is built automatically.</p>
+
+    <h2>Editing a document</h2>
+
+    <p>To look at the newly created document click on the "Hello World" entry
+    in the navigation. You'll notice that the "Hello World" document already
+    contains some content. It was created from a sample XML
+    document. To change this sample content you will have to edit the
+    document. You can pick on of the following web-based WYSIWYG
+    editors:</p>
+
+    <ul>
+      <li>Kupu: This is a good choice for users of Internet Explorer.</li>
+      <li>BXE: This is a good choice for users of Mozilla.</li>
+      <li>HTML Forms: This is a good choice for users of Mosaic ;-)</li>
+      <li>One Form: For the power user who needs all the control</li>
+    </ul>
+
+    <p>Pick your choice of editor (based on your platform) and start
+    editing the newly created document by selecting the
+    <code>Edit->Edit with BXE</code> menu button. The Lenya menu will
+    disappear and the Bitflux toolbar will appear instead. You can use
+    the right mouse button to get a context sensitive menu from where
+    you can copy, cut and paste. You're also able to insert new
+    elements into the document from the context sensitive menu. Once
+    you're done with all your changes, press
+    <code>Save&amp;Exit</code> to get back. You'll see your changes in
+    the document.</p>
+    
+    <h2>Lenya Meta Data</h2>
+    
+    <p>The LenyaMetaDataGenerator lets you receive the meta data for any given document. In
+      this pub there is an example in the sitemap.xmap (pattern="meta") it only should
+      demonstrate one possible usage (you would need to edit this match for your own use case).
+      See the meta data from this page with <a href="meta?docid=/tutorial&amp;lang=en">
+      meta?docid=/tutorial&amp;lang=en</a>.</p>
+    
+    <h2>Publishing a document</h2>
+
+    <p>Once you are satisfied with the content of the document you
+    want to publish it to make it visible in the live area.</p> 
+
+    <h3>Workflow</h3>
+
+    <p>The default publication has a simple workflow configured which
+    involves an author and a reviewer. The author creates and edits a
+    new document and submits it for approval. The reviewer (obviously
+    :-)) reviews the document and publishes it so that it will appear
+    on the live site.
+
+    The user lenya (which you are probably currently logged in as) has
+    the role edit, i.e. he can create new documents and submit them
+    for approval (with <code>Workflow->Submit for review</code>). The
+    user alice has the role review which allows her to approve,
+    i.e. publish documents.</p>
+
+    <p>In order to publish your newly created document simply press
+    <code>Workflow->Sumbit</code> (as user lenya) to submit the
+    current document for approval. Now log out
+    (<code>File->Logout</code>), log back in as alice (use the same
+    password as for user lenya) and publish the current document by
+    selecting <code>Workflow->Publish</code>. You will get a
+    confirmation screen where you confirm your intention to publish
+    the document "Hello World" by pressing <code>Publish Now</code>. You might
+    have to publish the parent document ("Tutorial") first, as the
+    "Hello World" document will not be published if the parent document is not
+    in the live area yet.</p> <p>To check how the "Hello World" document looks
+    like in the live site click on the <code>live</code> tab in the
+    Lenya menu. This will open a new browser window showing you the
+    live site.</p>
+    
+    <h2>Scheduling</h2>
+    
+    <p>Apache Lenya allows you to publish a document at a specific
+    date. To do this select the <code>Workflow->Publish</code> menu
+    entry. Now instead of pressing <code>Publish</code> immediately,
+    specify the date and the time at which you wish to publish the
+    document first. Your document will be published at
+    the specified date. Use the <code>Scheduler</code> tab in the site
+    area to see the pending tasks and their status.</p>
+
+    <h2>Revision Control</h2>
+
+    <p>Every time you edit a document and exit the editor a new
+    revision of the document is stored. Old versions of the document
+    are kept and you can go back to an older version if you want to
+    undo some of the changes you applied to it. To see all available
+    versions of the current document press
+    <code>Tools->Rollback</code>. This will give you a list of all
+    previous versions. You can view a specific old version or rollback
+    to a specific old version by clicking on the appropriate links.</p>
+
+  </body>
+</html>

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/example-content/tutorial/index_en.meta
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/example-content/tutorial/index_en.meta?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/example-content/tutorial/index_en.meta (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/example-content/tutorial/index_en.meta Tue Feb 10 18:22:23 2009
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- $Id: index_en.meta 557603 2007-07-19 12:48:31Z andreas $ -->
+<lenya:document xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0">
+<lenya:meta>
+<lenya:internal>
+<lenya:resourceType>xhtml</lenya:resourceType>
+<lenya:contentType>xml</lenya:contentType>
+  <lenya:mimeType>application/xhtml+xml</lenya:mimeType>
+</lenya:internal>
+<lenya:dc>
+        <dc:title xmlns:dc="http://purl.org/dc/elements/1.1/">A short Lenya Tutorial</dc:title>
+        <dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lenya Development Team</dc:creator>
+        <dc:subject xmlns:dc="http://purl.org/dc/elements/1.1/">Lenya Tutorial</dc:subject>
+        <dc:description xmlns:dc="http://purl.org/dc/elements/1.1/">A short tutorial on using Apache Lenya</dc:description>
+        <dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">Apache Software Foundation</dc:publisher>
+        <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/"/>
+        <dc:date xmlns:dc="http://purl.org/dc/elements/1.1/">2005-01-31</dc:date>
+        <dc:type xmlns:dc="http://purl.org/dc/elements/1.1/"/>
+        <dc:format xmlns:dc="http://purl.org/dc/elements/1.1/"/>
+        <dc:identifier xmlns:dc="http://purl.org/dc/elements/1.1/"/>
+        <dc:source xmlns:dc="http://purl.org/dc/elements/1.1/"/>
+        <dc:language xmlns:dc="http://purl.org/dc/elements/1.1/">en</dc:language>
+        <dc:relation xmlns:dc="http://purl.org/dc/elements/1.1/"/>
+        <dc:coverage xmlns:dc="http://purl.org/dc/elements/1.1/"/>
+        <dc:rights xmlns:dc="http://purl.org/dc/elements/1.1/">All rights reserved</dc:rights>
+</lenya:dc>
+</lenya:meta>
+</lenya:document>
\ No newline at end of file

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java Tue Feb 10 18:22:23 2009
@@ -0,0 +1,422 @@
+/*
+ * 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.lenya.defaultpub.cms.publication.templating;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.MutableConfiguration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.configuration.DefaultConfiguration;
+import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
+import org.apache.avalon.framework.configuration.DefaultConfigurationSerializer;
+import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import org.apache.avalon.framework.parameters.ParameterException;
+import org.apache.avalon.framework.parameters.Parameterizable;
+import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
+import org.apache.cocoon.components.search.components.IndexManager;
+import org.apache.cocoon.components.search.components.impl.IndexManagerImpl;
+import org.apache.excalibur.source.ModifiableSource;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.SourceNotFoundException;
+import org.apache.excalibur.source.SourceResolver;
+import org.apache.excalibur.source.impl.FileSource;
+import org.apache.lenya.cms.publication.Publication;
+import org.apache.lenya.cms.publication.PublicationManager; // import org.apache.lenya.cms.publication.PublicationConfiguration;
+import org.apache.lenya.util.Assert;
+import org.apache.lenya.xml.DocumentHelper;
+import org.apache.lenya.xml.NamespaceHelper;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+
+/**
+ * Instantiate the publication.
+ */
+public class Instantiator extends AbstractLogEnabled implements
+        org.apache.lenya.cms.publication.templating.Instantiator, Serviceable, Parameterizable {
+
+    protected static final String[] sourcesToCopy = { "config/publication.xml",
+            "config/access-control/access-control.xml", "config/access-control/policies/",
+            "config/access-control/usecase-policies.xml", "config/workflow/workflow.xml",
+            "config/" + IndexManagerImpl.INDEX_CONF_FILE };
+
+    protected static final String ACCREDITABLES_DIRECTORY = "config/access-control/passwd/";
+
+    // the following stuff should actually come from PublicationConfiguration,
+    // but there's currently no way to get at it.
+    // the correct solution suggested by andreas is not to meddle with config
+    // files here at all, but instead implement
+    // appropriate setter functions in the Publication class. postponed to after
+    // 2.0.
+    // thus, don't waste too much effort on this file, it's all an intermediate
+    // hack.
+    private static final String CONFIGURATION_FILE = "config/publication.xml";
+    private static final String CONFIGURATION_NAMESPACE = "http://apache.org/cocoon/lenya/publication/1.1";
+    private static final String ACCESS_CONTROL_FILE = "config/access-control/access-control.xml";
+    private static final String ELEMENT_NAME = "name";
+    private static final String ELEMENT_TEMPLATE = "template";
+    private static final String ATTRIBUTE_ID = "id";
+    private static final String ELEMENT_RESOURCE_TYPES = "resource-types";// *
+    private static final String ELEMENT_RESOURCE_TYPE = "resource-type";// *
+    private static final String ELEMENT_MODULES = "modules";// *
+    private static final String ELEMENT_MODULE = "module";// *
+
+    private ServiceManager manager;
+    private boolean shareAccreditables;
+
+    /**
+     * @see org.apache.lenya.cms.publication.templating.Instantiator#instantiate(org.apache.lenya.cms.publication.Publication,
+     *      java.lang.String, java.lang.String)
+     */
+    public void instantiate(Publication template, String newPublicationId, String name)
+            throws Exception {
+
+        Assert.notNull("template", template);
+        Assert.notNull("publication ID", newPublicationId);
+        Assert.notNull("name", name);
+
+        if (name.equals("")) {
+            name = newPublicationId;
+        }
+
+        SourceResolver resolver = null;
+        Source publicationsSource = null;
+        PublicationManager pubManager = null;
+        try {
+            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
+
+            publicationsSource = resolver.resolveURI("context://"
+                    + Publication.PUBLICATION_PREFIX_URI);
+            String publicationsUri = publicationsSource.getURI();
+
+            List sources = new ArrayList(Arrays.asList(sourcesToCopy));
+
+            if (!this.shareAccreditables) {
+                sources.add(ACCREDITABLES_DIRECTORY);
+            }
+
+            for (Iterator i = sources.iterator(); i.hasNext();) {
+
+                String source = (String) i.next();
+                if (source.endsWith("/")) {
+                    copyDirSource(template, newPublicationId, resolver, publicationsUri, source);
+                } else {
+                    copySource(template, newPublicationId, resolver, publicationsUri, source);
+                }
+            }
+
+            updateMetaData(resolver, newPublicationId, name, publicationsUri);
+
+            configureSearchIndex(resolver, template, newPublicationId, publicationsUri);
+
+            updateConfiguration(resolver, template, newPublicationId, publicationsUri);
+
+            updateAccessControl(resolver, template, newPublicationId, publicationsUri);
+
+            pubManager = (PublicationManager) this.manager.lookup(PublicationManager.ROLE);
+            pubManager.addPublication(newPublicationId);
+
+        } finally {
+            if (resolver != null) {
+                this.manager.release(resolver);
+                if (publicationsSource != null) {
+                    resolver.release(publicationsSource);
+                }
+            }
+            if (pubManager != null) {
+                this.manager.release(pubManager);
+            }
+        }
+
+    }
+
+    protected void updateMetaData(SourceResolver resolver, String newPublicationId, String name,
+            String publicationsUri) throws MalformedURLException, IOException,
+            ParserConfigurationException, SAXException, SourceNotFoundException,
+            TransformerConfigurationException, TransformerException {
+        ModifiableSource metaSource = null;
+        try {
+            metaSource = (ModifiableSource) resolver.resolveURI(publicationsUri + "/"
+                    + newPublicationId + "/" + CONFIGURATION_FILE);
+            Document metaDoc = DocumentHelper.readDocument(metaSource.getInputStream());
+            NamespaceHelper helper = new NamespaceHelper(CONFIGURATION_NAMESPACE, "", metaDoc);
+            Element nameElement = helper.getFirstChild(metaDoc.getDocumentElement(), ELEMENT_NAME);
+            DocumentHelper.setSimpleElementText(nameElement, name);
+
+            save(metaDoc, metaSource);
+        } finally {
+            if (resolver != null) {
+                if (metaSource != null) {
+                    resolver.release(metaSource);
+                }
+            }
+        }
+    }
+
+    protected void updateConfiguration(SourceResolver resolver, Publication template,
+            String newPublicationId, String publicationsUri) throws MalformedURLException,
+            IOException, SAXException, ConfigurationException, SourceNotFoundException {
+        ModifiableSource configSource = null;
+        try {
+
+            configSource = (ModifiableSource) resolver.resolveURI(publicationsUri + "/"
+                    + newPublicationId + "/" + CONFIGURATION_FILE);
+
+            final boolean ENABLE_XML_NAMESPACES = true;
+            DefaultConfiguration config = (DefaultConfiguration) new DefaultConfigurationBuilder(
+                    ENABLE_XML_NAMESPACES).build(configSource.getInputStream());
+            addTemplateConfiguration(template, config);
+
+            removeChildren(config.getMutableChild(ELEMENT_MODULES), ELEMENT_MODULE);
+            removeChildren(config.getMutableChild(ELEMENT_RESOURCE_TYPES), ELEMENT_RESOURCE_TYPE);
+
+            OutputStream oStream = configSource.getOutputStream();
+            new DefaultConfigurationSerializer().serialize(oStream, config);
+            if (oStream != null) {
+                oStream.flush();
+                try {
+                    oStream.close();
+                } catch (Throwable t) {
+                    if (getLogger().isDebugEnabled()) {
+                        getLogger().debug("Exception closing output stream: ", t);
+                    }
+                    throw new RuntimeException("Could not write document: ", t);
+                }
+            }
+        } finally {
+            if (resolver != null) {
+                if (configSource != null) {
+                    resolver.release(configSource);
+                }
+            }
+        }
+    }
+
+    protected void addTemplateConfiguration(Publication template, DefaultConfiguration config)
+            throws ConfigurationException {
+        Configuration[] templateConfigs = config.getChildren(ELEMENT_TEMPLATE);
+        for (int i = 0; i < templateConfigs.length; i++) {
+            config.removeChild(templateConfigs[i]);
+        }
+        DefaultConfiguration templateConfig = new DefaultConfiguration(ELEMENT_TEMPLATE, null,
+                CONFIGURATION_NAMESPACE, "");
+        templateConfig.setAttribute(ATTRIBUTE_ID, template.getId());
+        config.addChild(templateConfig);
+    }
+
+    protected void removeChildren(MutableConfiguration config, String name)
+            throws ConfigurationException {
+        MutableConfiguration[] moduleConfigs = config.getMutableChildren(name);
+        for (int i = 0; i < moduleConfigs.length; i++) {
+            config.removeChild(moduleConfigs[i]);
+        }
+    }
+
+    protected void configureSearchIndex(SourceResolver resolver, Publication template,
+            String newPublicationId, String publicationsUri) throws MalformedURLException,
+            IOException, ParserConfigurationException, SAXException, SourceNotFoundException,
+            TransformerConfigurationException, TransformerException, ServiceException,
+            ConfigurationException {
+        ModifiableSource indexSource = null;
+        IndexManager indexManager = null;
+        try {
+
+            // RGE: Soc addition
+            // First, patch the xconf patchfile with the new publication name
+
+            String indexDir = "lenya/pubs/" + newPublicationId + "/work/lucene/index";
+
+            indexSource = (ModifiableSource) resolver
+                    .resolveURI(publicationsUri
+                            + "/"
+                            + newPublicationId
+                            + "/config/"
+                            + org.apache.cocoon.components.search.components.impl.IndexManagerImpl.INDEX_CONF_FILE);
+            Document indexDoc = DocumentHelper.readDocument(indexSource.getInputStream());
+            Element[] indexElement = DocumentHelper.getChildren(indexDoc.getDocumentElement(),
+                    null, "index");
+
+            for (int i = 0; i < indexElement.length; i++) {
+                String id = indexElement[i].getAttribute("id");
+                String area = id.split("-")[1];
+                indexElement[i].setAttribute("id", newPublicationId + "-" + area);
+                indexElement[i].setAttribute("directory", indexDir + "/" + area + "/index");
+            }
+
+            save(indexDoc, indexSource);
+
+            // Second, configure the index and add it to the IndexManager
+
+            indexManager = (IndexManager) this.manager.lookup(IndexManager.ROLE);
+
+            indexManager.addIndexes(indexSource);
+
+            // TODO: release all objects!
+
+            // RGE: End Soc addition
+
+        } finally {
+            if (indexManager != null) {
+                this.manager.release(indexManager);
+            }
+            if (resolver != null) {
+                this.manager.release(resolver);
+                if (indexSource != null) {
+                    resolver.release(indexSource);
+                }
+            }
+        }
+    }
+
+    protected void copySource(Publication template, String publicationId, SourceResolver resolver,
+            String publicationsUri, String source) throws MalformedURLException, IOException {
+        Source templateSource = null;
+        ModifiableSource targetSource = null;
+        try {
+            templateSource = resolver.resolveURI(publicationsUri + "/" + template.getId() + "/"
+                    + source);
+            targetSource = (ModifiableSource) resolver.resolveURI(publicationsUri + "/"
+                    + publicationId + "/" + source);
+
+            org.apache.lenya.cms.cocoon.source.SourceUtil.copy(templateSource, targetSource, false);
+        } finally {
+            if (templateSource != null) {
+                resolver.release(templateSource);
+            }
+            if (targetSource != null) {
+                resolver.release(targetSource);
+            }
+        }
+    }
+
+    protected void copyDirSource(Publication template, String publicationId,
+            SourceResolver resolver, String publicationsUri, String source)
+            throws MalformedURLException, IOException {
+        FileSource directory = new FileSource(publicationsUri + "/" + template.getId() + "/"
+                + source);
+        Collection files = directory.getChildren();
+        for (Iterator iter = files.iterator(); iter.hasNext();) {
+            FileSource filesource = (FileSource) iter.next();
+            if (filesource.isCollection()) {
+                copyDirSource(template, publicationId, resolver, publicationsUri, source + "/"
+                        + filesource.getName());
+            } else {
+                copySource(template, publicationId, resolver, publicationsUri, source + "/"
+                        + filesource.getName());
+            }
+        }
+    }
+
+    protected void updateAccessControl(SourceResolver resolver, Publication template,
+            String newPublicationId, String publicationsUri) throws MalformedURLException,
+            IOException, SAXException, ConfigurationException, SourceNotFoundException {
+        ModifiableSource configSource = null;
+        try {
+
+            configSource = (ModifiableSource) resolver.resolveURI(publicationsUri + "/"
+                    + newPublicationId + "/" + ACCESS_CONTROL_FILE);
+
+            final boolean enableXmlNamespaces = true;
+            DefaultConfiguration config = (DefaultConfiguration) new DefaultConfigurationBuilder(
+                    enableXmlNamespaces).build(configSource.getInputStream());
+            DefaultConfiguration acreditableDirectory = (DefaultConfiguration) config.getChild(
+                    "accreditable-manager", false).getChild("parameter", false);
+
+            if (!this.shareAccreditables) {
+                acreditableDirectory.setAttribute("value", "context:///lenya/pubs/"
+                        + newPublicationId + "/config/access-control/passwd");
+            }
+
+            DefaultConfiguration policyDirectory = (DefaultConfiguration) config.getChild(
+                    "policy-manager", false).getChild("policy-manager", false).getChild(
+                    "parameter", false);
+            policyDirectory.setAttribute("value", "context:///lenya/pubs/" + newPublicationId
+                    + "/config/access-control/policies");
+
+            saveConfiguration(config, configSource);
+        } finally {
+            if (resolver != null) {
+                if (configSource != null) {
+                    resolver.release(configSource);
+                }
+            }
+        }
+    }
+
+    protected void saveConfiguration(DefaultConfiguration config, ModifiableSource source)
+            throws IOException, SAXException, ConfigurationException {
+        OutputStream oStream = source.getOutputStream();
+        new DefaultConfigurationSerializer().serialize(oStream, config);
+        if (oStream != null) {
+            oStream.flush();
+            try {
+                oStream.close();
+            } catch (Throwable t) {
+                if (getLogger().isDebugEnabled()) {
+                    getLogger().debug("Exception closing output stream: ", t);
+                }
+                throw new RuntimeException("Could not write document: ", t);
+            }
+        }
+    }
+
+    protected void save(Document metaDoc, ModifiableSource metaSource) throws IOException,
+            TransformerConfigurationException, TransformerException {
+        OutputStream oStream = metaSource.getOutputStream();
+        DocumentHelper.writeDocument(metaDoc, new OutputStreamWriter(oStream));
+        if (oStream != null) {
+            oStream.flush();
+            try {
+                oStream.close();
+            } catch (Throwable t) {
+                if (getLogger().isDebugEnabled()) {
+                    getLogger().debug("Exception closing output stream: ", t);
+                }
+                throw new RuntimeException("Could not write document: ", t);
+            }
+        }
+    }
+
+    /**
+     * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
+     */
+    public void service(ServiceManager manager) throws ServiceException {
+        this.manager = manager;
+    }
+
+    public void parameterize(Parameters params) throws ParameterException {
+        this.shareAccreditables = params.getParameterAsBoolean("shareAccreditables", true);
+    }
+
+}

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya.properties.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya.properties.xml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya.properties.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya.properties.xml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<properties>
+  <!-- Note: You can define and override properties and use them  
+    in your sitemap like {properties:pubs.default.author} -->
+  
+  <!-- http://localhost:8888/default/authoring/index.html will show in the first heading: 
+    "Welcome to the Default Publication from {properties:pubs.default.author}!"-->
+  <!--<property name="pubs.default.author" value="Me"/>-->
+</properties>

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/content/publishing/publish-screen.xsp
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/content/publishing/publish-screen.xsp?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/content/publishing/publish-screen.xsp (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/content/publishing/publish-screen.xsp Tue Feb 10 18:22:23 2009
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: publish-screen.xsp 586495 2007-10-19 15:13:36Z rfrovarp $ -->
+
+<xsp:page
+       language="java"
+       xmlns:xsp="http://apache.org/xsp"
+       xmlns:input="http://apache.org/cocoon/xsp/input/1.0"
+       xmlns:usecase="http://apache.org/cocoon/lenya/usecase/1.0"
+       xmlns:sch="http://apache.org/cocoon/lenya/scheduler/1.0"
+       xmlns:xsp-request="http://apache.org/xsp/request/2.0"
+       >
+
+<usecase:publish>
+
+  <usecase:document-uuid><input:get-attribute module="page-envelope" name="document-uuid" as="string"/></usecase:document-uuid>
+  <usecase:uris><xsp-request:get-uri/></usecase:uris>
+  <usecase:sources><input:get-attribute module="page-envelope" as="string" name="document-path"/></usecase:sources>
+  <usecase:publication-id><input:get-attribute module="page-envelope" name="publication-id" as="string"/></usecase:publication-id>
+  <usecase:context-prefix><input:get-attribute module="page-envelope" name="context-prefix" as="string"/></usecase:context-prefix>
+  <usecase:area><input:get-attribute module="page-envelope" name="area" as="string"/></usecase:area>
+  <usecase:language><input:get-attribute module="page-envelope" name="document-language" as="string"/></usecase:language>
+  
+  <!-- FIXME: this should be defined in the workflow schema -->
+  <usecase:task-id>publish</usecase:task-id>
+
+  <!-- add date for scheduler -->
+  <xsp:logic>
+    java.util.GregorianCalendar calendar = new java.util.GregorianCalendar();
+  </xsp:logic>
+  
+  <sch:current-date>
+    <sch:year><xsp:expr>calendar.get(java.util.Calendar.YEAR)</xsp:expr></sch:year>
+    <sch:month><xsp:expr>calendar.get(java.util.Calendar.MONTH) + 1</xsp:expr></sch:month>
+    <sch:day><xsp:expr>calendar.get(java.util.Calendar.DAY_OF_MONTH)</xsp:expr></sch:day>
+    <sch:hour><xsp:expr>calendar.get(java.util.Calendar.HOUR_OF_DAY)</xsp:expr></sch:hour>
+    <sch:minute><xsp:expr>calendar.get(java.util.Calendar.MINUTE)</xsp:expr></sch:minute>
+    <sch:second><xsp:expr>calendar.get(java.util.Calendar.SECOND)</xsp:expr></sch:second>
+  </sch:current-date>
+  
+</usecase:publish>
+
+</xsp:page>

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/editors/usecases/forms/homepage.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/editors/usecases/forms/homepage.xsl?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/editors/usecases/forms/homepage.xsl (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/editors/usecases/forms/homepage.xsl Tue Feb 10 18:22:23 2009
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: xhtml.xsl 42703 2004-03-13 12:57:53Z gregor $ -->
+
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xhtml="http://www.w3.org/1999/xhtml"
+  xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"
+  xmlns:dc="http://purl.org/dc/elements/1.1/"
+>
+
+<xsl:import href="xhtml.xsl"/>
+
+</xsl:stylesheet>  

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/editors/usecases/forms/links.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/editors/usecases/forms/links.xsl?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/editors/usecases/forms/links.xsl (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/editors/usecases/forms/links.xsl Tue Feb 10 18:22:23 2009
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: links.xsl 473861 2006-11-12 03:51:14Z gregor $ -->
+
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns="http://apache.org/lenya/pubs/default/1.0"
+  xmlns:links="http://apache.org/lenya/pubs/default/1.0"
+>
+
+<xsl:import href="../../../../../../usecases/edit/forms/form.xsl"/>
+
+<xsl:template match="links:links">
+  
+<namespace prefix="" uri="http://apache.org/lenya/pubs/default/1.0"/>
+  
+<node name="Title" select="links/title[@tagID='{title/@tagID}']">
+  <content><input type="text" name="&lt;xupdate:update select=&quot;/links/title[@tagID='{title/@tagID}']&quot;&gt;" size="40"><xsl:attribute name="value"><xsl:value-of select="title"/></xsl:attribute></input></content>
+</node>
+
+<xsl:apply-templates select="link"/>
+
+</xsl:template>
+
+</xsl:stylesheet>  

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/editors/usecases/forms/xhtml-common.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/editors/usecases/forms/xhtml-common.xsl?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/editors/usecases/forms/xhtml-common.xsl (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/editors/usecases/forms/xhtml-common.xsl Tue Feb 10 18:22:23 2009
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: xhtml-common.xsl 153165 2005-02-10 06:01:01Z gregor $ -->
+
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xhtml="http://www.w3.org/1999/xhtml"
+  xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"
+  xmlns:dc="http://purl.org/dc/elements/1.1/"
+>
+
+<xsl:template match="xhtml:body">
+<xsl:apply-templates mode="body"/>
+</xsl:template>
+
+<xsl:template name="insertmenu">
+<xsl:param name="path"/>
+<xsl:variable name="ns">namespace=&quot;http://www.w3.org/1999/xhtml&quot;</xsl:variable>
+<insert-after select="{$path}[@tagID='{@tagID}']">
+  <element name="Paragraph" xupdate="&lt;xupdate:insert-after select=&quot;{$path}[@tagID='{@tagID}']&quot;&gt;&lt;xupdate:element name=&quot;xhtml:p&quot; {$ns}&gt;New Paragraph&lt;/xupdate:element&gt;&lt;/xupdate:insert-after&gt;"/>
+  <element name="Table" xupdate="&lt;xupdate:insert-after select=&quot;{$path}[@tagID='{@tagID}']&quot;&gt;&lt;xupdate:element name=&quot;xhtml:table&quot; {$ns}&gt;&lt;tr&gt;&lt;td&gt;New Table&lt;/td&gt;&lt;/tr&gt;&lt;/xupdate:element&gt;&lt;/xupdate:insert-after&gt;"/>
+  <element name="Unordered List" xupdate="&lt;xupdate:insert-after select=&quot;{$path}[@tagID='{@tagID}']&quot;&gt;&lt;xupdate:element name=&quot;xhtml:ul&quot; {$ns}&gt;&lt;li&gt;New Unordered List&lt;/li&gt;&lt;/xupdate:element&gt;&lt;/xupdate:insert-after&gt;"/>
+  <element name="Ordered List" xupdate="&lt;xupdate:insert-after select=&quot;{$path}[@tagID='{@tagID}']&quot;&gt;&lt;xupdate:element name=&quot;xhtml:ol&quot; {$ns}&gt;&lt;li&gt;New Ordered List&lt;/li&gt;&lt;/xupdate:element&gt;&lt;/xupdate:insert-after&gt;"/>
+  <element name="Headline 1" xupdate="&lt;xupdate:insert-after select=&quot;{$path}[@tagID='{@tagID}']&quot;&gt;&lt;xupdate:element name=&quot;xhtml:h1&quot; {$ns}&gt;New Headline 1&lt;/xupdate:element&gt;&lt;/xupdate:insert-after&gt;"/>
+  <element name="Headline 2" xupdate="&lt;xupdate:insert-after select=&quot;{$path}[@tagID='{@tagID}']&quot;&gt;&lt;xupdate:element name=&quot;xhtml:h2&quot; {$ns}&gt;New Headline 2&lt;/xupdate:element&gt;&lt;/xupdate:insert-after&gt;"/>
+  <element name="Headline 3" xupdate="&lt;xupdate:insert-after select=&quot;{$path}[@tagID='{@tagID}']&quot;&gt;&lt;xupdate:element name=&quot;xhtml:h3&quot; {$ns}&gt;New Headline 3&lt;/xupdate:element&gt;&lt;/xupdate:insert-after&gt;"/>
+  <element name="Headline 4" xupdate="&lt;xupdate:insert-after select=&quot;{$path}[@tagID='{@tagID}']&quot;&gt;&lt;xupdate:element name=&quot;xhtml:h4&quot; {$ns}&gt;New Headline 4&lt;/xupdate:element&gt;&lt;/xupdate:insert-after&gt;"/>
+</insert-after>
+</xsl:template>
+
+  <xsl:template match="xhtml:p" mode="body">
+    <xsl:choose >
+      <xsl:when test="xhtml:object">
+	<xsl:apply-templates select="xhtml:object" mode="body"/>
+      </xsl:when>
+      <xsl:otherwise>
+	<node name="Paragraph" select="/*/xhtml:body/xhtml:p[@tagID='{@tagID}']">
+	  <action><delete name="&lt;xupdate:remove select=&quot;/*/xhtml:body/xhtml:p[@tagID='{@tagID}']&quot;/&gt;"/></action>
+	  <content>
+	    <textarea name="&lt;xupdate:update select=&quot;/*/xhtml:body/xhtml:p[@tagID='{@tagID}']&quot;&gt;" cols="80" rows="30">
+	      <xsl:copy-of select="node()"/>
+	    </textarea>
+	  </content>
+	</node>
+	
+	<xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:p</xsl:with-param></xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+<xsl:template match="xhtml:table" mode="body">
+<node name="Table" select="/*/xhtml:body/xhtml:table[@tagID='{@tagID}']">
+  <action><delete name="&lt;xupdate:remove select=&quot;/*/xhtml:body/xhtml:table[@tagID='{@tagID}']&quot;/&gt;"/></action>
+  <content>
+    <textarea name="&lt;xupdate:update select=&quot;/*/xhtml:body/xhtml:table[@tagID='{@tagID}']&quot;&gt;" cols="80" rows="30">
+      <xsl:copy-of select="node()"/>
+    </textarea>
+  </content>
+</node>
+
+<xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:table</xsl:with-param></xsl:call-template>
+
+</xsl:template>
+
+<xsl:template match="xhtml:ul" mode="body">
+<node name="Unordered List" select="/*/xhtml:body/xhtml:ul[@tagID='{@tagID}']">
+  <action><delete name="&lt;xupdate:remove select=&quot;/*/xhtml:body/xhtml:ul[@tagID='{@tagID}']&quot;/&gt;"/></action>
+  <content>
+    <textarea name="&lt;xupdate:update select=&quot;/*/xhtml:body/xhtml:ul[@tagID='{@tagID}']&quot;&gt;" cols="80" rows="30">
+      <xsl:copy-of select="node()"/>
+    </textarea>
+  </content>
+</node>
+
+<xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:ul</xsl:with-param></xsl:call-template>
+
+</xsl:template>
+
+<xsl:template match="xhtml:ol" mode="body">
+<node name="Ordered List" select="/*/xhtml:body/xhtml:ol[@tagID='{@tagID}']">
+  <action><delete name="&lt;xupdate:remove select=&quot;/*/xhtml:body/xhtml:ol[@tagID='{@tagID}']&quot;/&gt;"/></action>
+  <content>
+    <textarea name="&lt;xupdate:update select=&quot;/*/xhtml:body/xhtml:ol[@tagID='{@tagID}']&quot;&gt;" cols="80" rows="30">
+      <xsl:copy-of select="node()"/>
+    </textarea>
+  </content>
+</node>
+
+<xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:ol</xsl:with-param></xsl:call-template>
+
+</xsl:template>
+
+<xsl:template match="xhtml:h1" mode="body">
+<node name="Headline 1" select="/*/xhtml:body/xhtml:h1[@tagID='{@tagID}']">
+  <action><delete name="&lt;xupdate:remove select=&quot;/*/xhtml:body/xhtml:h1[@tagID='{@tagID}']&quot;/&gt;"/></action>
+  <content>
+    <textarea name="&lt;xupdate:update select=&quot;/*/xhtml:body/xhtml:h1[@tagID='{@tagID}']&quot;&gt;" cols="80" rows="3">
+      <xsl:copy-of select="node()"/>
+    </textarea>
+  </content>
+</node>
+
+<xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:h1</xsl:with-param></xsl:call-template>
+
+</xsl:template>
+    
+<xsl:template match="xhtml:h2" mode="body">
+<node name="Headline 2" select="/*/xhtml:body/xhtml:h2[@tagID='{@tagID}']">
+  <action><delete name="&lt;xupdate:remove select=&quot;/*/xhtml:body/xhtml:h2[@tagID='{@tagID}']&quot;/&gt;"/></action>
+  <content>
+    <textarea name="&lt;xupdate:update select=&quot;/*/xhtml:body/xhtml:h2[@tagID='{@tagID}']&quot;&gt;" cols="80" rows="3">
+      <xsl:copy-of select="node()"/>
+    </textarea>
+  </content>
+</node>
+
+<xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:h2</xsl:with-param></xsl:call-template>
+
+</xsl:template>
+
+<xsl:template match="xhtml:h3" mode="body">
+<node name="Headline 3" select="/*/xhtml:body/xhtml:h3[@tagID='{@tagID}']">
+  <action><delete name="&lt;xupdate:remove select=&quot;/*/xhtml:body/xhtml:h3[@tagID='{@tagID}']&quot;/&gt;"/></action>
+  <content>
+    <textarea name="&lt;xupdate:update select=&quot;/*/xhtml:body/xhtml:h3[@tagID='{@tagID}']&quot;&gt;" cols="80" rows="3">
+      <xsl:copy-of select="node()"/>
+    </textarea>
+  </content>
+</node>
+
+<xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:h3</xsl:with-param></xsl:call-template>
+
+</xsl:template>
+
+<xsl:template match="xhtml:h4" mode="body">
+<node name="Headline 4" select="/*/xhtml:body/xhtml:h4[@tagID='{@tagID}']">
+  <action><delete name="&lt;xupdate:remove select=&quot;/*/xhtml:body/xhtml:h4[@tagID='{@tagID}']&quot;/&gt;"/></action>
+  <content>
+    <textarea name="&lt;xupdate:update select=&quot;/*/xhtml:body/xhtml:h4[@tagID='{@tagID}']&quot;&gt;" cols="80" rows="3">
+      <xsl:copy-of select="node()"/>
+    </textarea>
+  </content>
+</node>
+
+<xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:h4</xsl:with-param></xsl:call-template>
+
+</xsl:template>
+
+<xsl:template match="xhtml:hr" mode="body">
+<node name="Horizontal Rule" select="/*/xhtml:body/xhtml:hr[@tagID='{@tagID}']">
+  <action><delete name="&lt;xupdate:remove select=&quot;/*/xhtml:body/xhtml:hr[@tagID='{@tagID}']&quot;/&gt;"/></action>
+</node>
+
+<xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:hr</xsl:with-param></xsl:call-template>
+
+</xsl:template>
+
+  <xsl:template match="xhtml:object" mode="body">
+    <node name="Object">
+      <action><delete name="&lt;xupdate:remove select=&quot;/*/xhtml:body/xhtml:p/xhtml:object[@tagID='{@tagID}']&quot;/&gt;"/></action>
+      <content>
+	<input type="text" name="&lt;xupdate:update select=&quot;/*/xhtml:body/xhtml:p/xhtml:object[@tagID='{@tagID}']&quot;&gt;" size="80">
+	  <xsl:attribute name="value">
+      <xsl:value-of select="@data"/>
+	  </xsl:attribute>
+	</input>
+      </content>
+    </node>
+    
+    <xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body</xsl:with-param></xsl:call-template>
+    
+  </xsl:template>
+
+  <xsl:template match="lenya:asset" mode="body">
+    <node name="Asset">
+      <action>
+	<delete name="&lt;xupdate:remove select=&quot;/*/xhtml:body/lenya:asset[@tagID='{@tagID}']&quot;/&gt;"/>
+      </action>
+      <content>
+	<input type="text" name="&lt;xupdate:update select=&quot;/*/xhtml:body/lenya:asset[@tagID='{@tagID}']&quot;&gt;" size="80">
+	  <xsl:attribute name="value">
+	    <xsl:value-of select="@src"/>
+	  </xsl:attribute>
+	</input>
+      </content>
+    </node>
+
+    <xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body</xsl:with-param></xsl:call-template>
+    
+  </xsl:template>
+
+</xsl:stylesheet>  

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/editors/usecases/forms/xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/editors/usecases/forms/xhtml.xsl?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/editors/usecases/forms/xhtml.xsl (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/editors/usecases/forms/xhtml.xsl Tue Feb 10 18:22:23 2009
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: xhtml.xsl 42703 2004-03-13 12:57:53Z gregor $ -->
+
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xhtml="http://www.w3.org/1999/xhtml"
+  xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"
+  xmlns:dc="http://purl.org/dc/elements/1.1/"
+>
+
+<xsl:import href="fallback://lenya/modules/editors/usecases/forms/form.xsl"/>
+<xsl:import href="xhtml-common.xsl"/>
+
+<xsl:template match="xhtml:html">
+
+<namespace prefix="xhtml" uri="http://www.w3.org/1999/xhtml"/>
+  
+<xsl:apply-templates select="xhtml:body"/>
+
+</xsl:template>
+
+</xsl:stylesheet>  

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/sitetree/xslt/navigation/search.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/sitetree/xslt/navigation/search.xsl?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/sitetree/xslt/navigation/search.xsl (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/sitetree/xslt/navigation/search.xsl Tue Feb 10 18:22:23 2009
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: search.xsl 76019 2004-11-16 20:13:32Z gregor $ -->
+
+
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:nav="http://apache.org/cocoon/lenya/navigation/1.0"
+  xmlns="http://www.w3.org/1999/xhtml"
+  exclude-result-prefixes="nav"
+  >
+  
+  <xsl:param name="root"/>
+  <xsl:param name="chosenlanguage"/>
+  <xsl:param name="defaultlanguage"/>
+  
+  <xsl:variable name="languageSuffix">
+    <xsl:if test="$chosenlanguage != $defaultlanguage">
+      <xsl:text>_</xsl:text>
+      <xsl:value-of select="$chosenlanguage"/>
+    </xsl:if>
+  </xsl:variable>
+  
+  <xsl:template match="nav:site">
+    <div id="search">
+      <form action="{$root}search{$languageSuffix}.html" id="form-search">
+        <p>
+          <input class="searchfield" type="text" name="queryString" alt="Search field"/>
+          <input type="hidden" value="20" name="pageLength"/>
+          <input class="searchsubmit" type="submit" value="Go" name="input-go"/>
+        </p>
+      </form>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="@*|node()">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()"/>
+    </xsl:copy>
+  </xsl:template>
+  
+</xsl:stylesheet>

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/sitetree/xslt/navigation/tabs.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/sitetree/xslt/navigation/tabs.xsl?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/sitetree/xslt/navigation/tabs.xsl (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/modules/sitetree/xslt/navigation/tabs.xsl Tue Feb 10 18:22:23 2009
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: tabs.xsl 189880 2005-06-10 02:36:09Z gregor $ -->
+
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:nav="http://apache.org/cocoon/lenya/navigation/1.0"
+    xmlns="http://www.w3.org/1999/xhtml"
+    exclude-result-prefixes="nav"
+    >
+    
+<xsl:import href="template-fallback:default://lenya/modules/sitetree/xslt/navigation/tabs.xsl"/>
+
+<xsl:template match="nav:site">
+    
+  <div id="tabs">
+  <table border="0" cellpadding="0" cellspacing="0">
+    <tr>
+    <xsl:call-template name="pre-separator"/>
+    <xsl:for-each select="nav:node">
+      <xsl:if test="position() &gt; 1 and @visibleinnav = 'true'">
+        <xsl:call-template name="separator"/>
+      </xsl:if>
+      
+      <xsl:choose>
+        <xsl:when test="@visibleinnav = 'false'"/>
+        <xsl:when test="descendant-or-self::nav:node[@current = 'true']">
+          <xsl:call-template name="tab-selected"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="tab"/>
+        </xsl:otherwise>
+      </xsl:choose>
+        
+    </xsl:for-each>
+    <xsl:call-template name="post-separator"/>
+    </tr>
+  </table>
+  </div>
+
+</xsl:template>
+
+
+<xsl:template name="tab">
+  <td><div class="tab"><xsl:call-template name="label"/></div></td>
+</xsl:template>
+
+
+<xsl:template name="tab-selected">
+  <td><div class="tab-selected"><xsl:call-template name="label"/></div></td>
+</xsl:template>
+
+
+<xsl:template name="separator">
+    <td><div class="tab-separator">&#160;</div></td>
+</xsl:template>
+
+
+<xsl:template name="pre-separator">
+    <td><div class="tab-pre-separator">&#160;</div></td>
+</xsl:template>
+
+
+<xsl:template name="post-separator">
+    <td class="tab-post-separator"><div class="tab-separator">&#160;</div></td>
+</xsl:template>
+
+
+</xsl:stylesheet> 

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui.xml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui.xml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+   
+   Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+   
+   $Id: cmsui.xml 668103 2008-06-16 10:23:20Z andreas $
+   
+-->
+
+<catalogue xml:lang="en" xmlns="http://apache.org/cocoon/i18n/2.1">
+  
+  <message key="publication-title">Welcome to the {0} Publication from {1}!</message>
+ 
+  <message key="default.createdoc.idtaken">The ID you've entered is already taken. Please choose another one.</message>
+ 
+  <message key="Create new language version">Create new language version</message>
+  <message key="New language for existing Document">New language for existing Document</message>
+  <message key="default.createdoc.info.all-language-versions-exists">There are already versions of this document for all languages.</message>
+
+  <message key="error-generic-comment">Please contact your system administrator.</message>
+  
+</catalogue>

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_de.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_de.xml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_de.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_de.xml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+   
+   Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+  
+ 
+   $Id: cmsui_de.xml 668103 2008-06-16 10:23:20Z andreas $ 
+   
+-->
+
+<catalogue xml:lang="de" xmlns="http://apache.org/cocoon/i18n/2.1">
+
+  <message key="publication-title">Willkommen zur {0}-Publikation von {1}!</message>
+  
+  <message key="default.doc.create.idtaken">Die eingebene ID ist schon vergeben. Bitte wählen Sie eine andere ID.</message>
+
+  <message key="Create new language version">Neue Sprachversion anlegen</message>
+  <message key="New language for existing Document">Neue Sprachversion für existierendes Dokument anlegen</message>
+  <message key="default.createdoc.info.all-language-versions-exists">Das Dokument existiert bereits in allen notwendigen Sprachen.</message>
+  
+  <message key="error-generic-comment">Bitte kontaktieren Sie den Systemadministrator.</message>
+  
+</catalogue>
+

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_es.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_es.xml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_es.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_es.xml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+   
+   Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+   
+   $Id: cmsui_es.xml 619704 2008-02-08 00:22:30Z andreas $
+
+   @translators Salvador Cobrero <salvador_cobrero_jimenez at dmr-consulting dot com>
+   
+-->
+
+<catalogue xml:lang="es" xmlns="http://apache.org/cocoon/i18n/2.1">
+
+  <message key="default.createdoc.idtaken">El ID introducido ya existe. Por favor, escoja otro.</message>
+ 
+  <message key="Create new language version">Crear nueva version de idioma</message>
+  <message key="New language for existing Document">Nuevo idioma para el Documento existente</message>
+  <message key="default.createdoc.info.all-language-versions-exists">Ya existen versiones de este documento para todos los idiomas.</message>
+
+</catalogue>
+

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_fr.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_fr.xml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_fr.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_fr.xml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+   
+   Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+   
+   $Id: cmsui_fr.xml 619704 2008-02-08 00:22:30Z andreas $
+   
+   @translators Olivier Lange <wire at petit-atelier dot ch>
+   
+-->
+
+<catalogue xml:lang="fr" xmlns="http://apache.org/cocoon/i18n/2.1">
+
+  <message key="default.createdoc.idtaken">L'identifiant (ID) que vous avez choisi est déjà utilisé. Veuillez en choisir un autre.</message>
+  <message key="Create new language version">Créer une nouvelle traduction</message>
+  <message key="New language for existing Document">Nouvelle traduction d'un document existant</message>
+  <message key="default.createdoc.info.all-language-versions-exists">Les traductions de ce document existent déjà dans toutes les langues.</message>
+  
+</catalogue>

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_it.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_it.xml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_it.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_it.xml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   
+   Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+   
+   $Id: cmsui_it.xml 619704 2008-02-08 00:22:30Z andreas $
+   @translators Giampaolo Trapasso  <trapo at trapo dot it>
+-->
+<catalogue xml:lang="it" xmlns="http://apache.org/cocoon/i18n/2.1">
+	<message key="default.createdoc.idtaken">L'ID scelto è già utilizzato. Scegliere un altro ID.</message>
+	<message key="Create new language version">Crea nuova lingua</message>
+	<message key="New language for existing Document">Nuova lingua per un Documento esistente</message>
+	<message key="default.createdoc.info.all-language-versions-exists">Esistono già versioni di questo documento per tutte le lingue.</message>
+</catalogue>

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_pt.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_pt.xml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_pt.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_pt.xml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  $Id: cmsui_pt.xml 111676 2005-06-15 23:50:43Z gregor $
+
+   @translators Rolando Isidoro <rli at uninova dot pt>
+
+-->
+
+<catalogue xml:lang="pt" xmlns="http://apache.org/cocoon/i18n/2.1">
+
+  <message key="default.createdoc.idtaken">O ID introduzido já existe. Por favor introduza outro.</message>
+ 
+  <message key="Create new language version">Criar nova versão de idioma</message>
+  <message key="New language for existing Document">Novo idioma para o Documento existente</message>
+  <message key="default.createdoc.info.all-language-versions-exists">Já existem versões deste documento em todos os idiomas.</message>
+
+</catalogue>
+

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_ru.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_ru.xml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_ru.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/resources/i18n/cmsui_ru.xml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+   
+   Copyright 2004 The Apache Software Foundation
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+   
+   $Id: cmsui.xml 153091 2005-02-09 17:27:19Z edith $
+   
+-->
+
+<catalogue xml:lang="ru" xmlns="http://apache.org/cocoon/i18n/2.1">
+ 
+  <message key="default.createdoc.idtaken">Введённый идентификатор занят. Выберете дьругой, пожалуйста.</message>
+  <message key="Create new language version">Создать версию на другом языке</message>
+  <message key="New language for existing Document">Перевести существующий документ</message>
+  <message key="default.createdoc.info.all-language-versions-exists">Версии этого документа уже есть на всех языках.</message>
+
+  <message key="last_published">Последняя публикация</message>
+</catalogue>
\ No newline at end of file

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/usecases/tab/meta.jx
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/usecases/tab/meta.jx?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/usecases/tab/meta.jx (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/usecases/tab/meta.jx Tue Feb 10 18:22:23 2009
@@ -0,0 +1,134 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: meta.jx 497638 2007-01-18 23:30:55Z nettings $ -->
+
+<page:page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0" 
+           xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0" 
+           xmlns="http://www.w3.org/1999/xhtml" 
+           xmlns:i18n="http://apache.org/cocoon/i18n/2.1" >
+  <jx:import uri="fallback://lenya/usecases/tab/head.jx"/>
+  <page:body>
+    <jx:import uri="fallback://lenya/usecases/tab/sitetree.jx"/>
+    <jx:import uri="fallback://lenya/usecases/templates/tabs.jx"/>
+    <div id="contentblock1" class="lenya-tab-sitetree">
+      <form id="form-meta">
+        <table class="lenya-table-noborder">
+          <tr>
+            <td colspan="2">
+              <jx:import uri="fallback://lenya/modules/usecase/templates/messages.jx"/>
+            </td>
+          </tr>
+          <tr>
+            <td class="lenya-entry-caption"><label for="title"><i18n:text>Title</i18n:text>:</label></td>
+            <td>
+              <input type="text" id="title" name="meta.dc.title" class="lenya-form-element" value="${usecase.getParameter('meta.dc.title')}"/>
+            </td>
+          </tr>
+          <tr>
+            <td class="lenya-entry-caption"><label for="subject"><i18n:text>Subject</i18n:text>:</label></td>
+            <td>
+              <input type="text" id="subject" name="meta.dc.subject" class="lenya-form-element" value="${usecase.getParameter('meta.dc.subject')}"/>
+            </td>
+          </tr>
+          <tr>
+            <td class="lenya-entry-caption"><label for="description"><i18n:text>Description</i18n:text>:</label></td>
+            <td>
+              <!-- N.B.: do not put spaces or carriage returns inside the
+                   textarea element - these would be rendered -->
+              <textarea id="description" name="meta.dc.description" rows="3" class="lenya-form-element"><jx:out value="${usecase.getParameter('meta.dc.description')}"/></textarea>
+            </td>
+          </tr>
+          <tr>
+            <td class="lenya-entry-caption"><label for="publisher"><i18n:text>Publisher</i18n:text>:</label></td>
+            <td>
+              <input type="text" id="publisher" name="meta.dc.publisher" class="lenya-form-element" value="${usecase.getParameter('meta.dc.publisher')}"/>
+            </td>
+          </tr>
+          <tr>
+            <td class="lenya-entry-caption"><label for="rights"><i18n:text>Rights</i18n:text>:</label></td>
+            <td>
+              <input type="text" id="rights" name="meta.dc.rights" class="lenya-form-element" value="${usecase.getParameter('meta.dc.rights')}"/>
+            </td>
+          </tr>
+          <tr>
+            <td class="lenya-entry-caption"><i18n:text>Creation Date</i18n:text>:</td>
+            <td>
+              <jx:out value="${usecase.getParameter('meta.dc.date')}"/>
+            </td>
+          </tr>
+          <tr>
+            <td class="lenya-entry-caption"><label for="creator"><i18n:text>Creator</i18n:text>:</label></td>
+            <td>
+              <input type="hidden" id="creator" name="meta.dc.creator" class="lenya-form-element" value="${usecase.getParameter('meta.dc.creator')}"/>
+              <jx:out value="${usecase.getParameter('meta.dc.creator')}"/>
+            </td>
+          </tr>
+          <jx:if test="${usecase.getParameter('showCustom').equals('true')}">
+            <tr>
+              <td colspan="2" class="lenya-entry-caption">
+                <h2><i18n:text>Custom metadata</i18n:text></h2>
+              </td>
+            </tr>
+            <tr>
+              <td class="lenya-entry-caption"><label for="myMeta"><i18n:text>My
+                custom metadata</i18n:text>:</label></td>
+              <td>
+                <input type="text" id="myMeta" name="meta.custom.myMeta"
+                  class="lenya-form-element"
+                  value="${usecase.getParameter('meta.custom.myMeta')}"/>
+              </td>
+            </tr>
+          </jx:if>
+          <tr>
+            <td/>
+            <td>
+              <br/>
+              <jx:if
+                test="${usecase.getParameter('showCustom').equals('false')}">
+                <input i18n:attr="value" name="submit" type="submit"
+                  value="Show custom metadata"
+                  onClick="this.form.showCustom.value='true';"/>
+              </jx:if>
+              <jx:if
+                test="${usecase.getParameter('showCustom').equals('true')}">
+                <input i18n:attr="value" name="submit" type="submit"
+                  value="Hide custom metadata"
+                  onClick="this.form.showCustom.value='false';"/>
+              </jx:if>
+              <jx:choose>
+                <jx:when
+                  test="${usecase.getParameter('document').getArea().equals('authoring') &amp;&amp; ! usecase.hasErrors()}">
+                  <input i18n:attr="value" name="submit" type="submit"
+                    value="Save"/>
+                </jx:when>
+                <jx:otherwise>
+                  <input i18n:attr="value" name="submit" type="submit"
+                    disabled="disabled" value="Save"/>
+                </jx:otherwise>
+              </jx:choose>
+            </td>
+          </tr>
+        </table>
+        <input type="hidden" name="lenya.usecase" value="${request.getParameter('lenya.usecase')}"/>
+        <input type="hidden" id="showCustom" name="showCustom" value="${usecase.getParameter('showCustom')}"/>
+        <input type="hidden" name="lenya.continuation" value="${continuation.id}"/>
+      </form>
+    </div>
+  </page:body>
+</page:page>
\ No newline at end of file

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/xslt/exception/generic.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/xslt/exception/generic.xsl?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/xslt/exception/generic.xsl (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/lenya/xslt/exception/generic.xsl Tue Feb 10 18:22:23 2009
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: generic.xsl 589872 2007-10-29 21:47:39Z andreas $ -->
+
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:error="http://apache.org/cocoon/error/2.1"
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
+  
+  <xsl:param name="root"/>
+  
+  <xsl:template match="error:notify">
+    <html>
+      <head>
+        <title><i18n:text i18n:key="error-generic" /></title>
+        <link rel="stylesheet" href="{$root}/css/page.css" type="text/css"/>
+      </head>
+      <body>
+        
+        <div id="page">
+          <table width="100%" cellpadding="0" cellspacing="0" border="0">
+            <tr>
+              <td/>
+              <td id="project-logo"><img src="{$root}/images/project-logo.png" alt="project logo"/></td>
+            </tr>
+          </table>
+          <table width="100%" border="0" cellpadding="0" cellspacing="0">
+            <tr>
+              <td valign="top" style="width: 230px"/>
+              <td valign="top">
+                <div id="main">
+                  <div id="body">
+                    <h1>
+                      <i18n:text i18n:key="error-generic" />
+                    </h1>
+                    <p>
+                      <i18n:text i18n:key="error-generic-comment"/>
+                    </p>
+                    <xsl:comment>
+                      <xsl:value-of select="error:message"/>
+                      <xsl:value-of select="error:description"/>
+                      <xsl:apply-templates select="error:extra"/>
+                    </xsl:comment>
+                  </div>
+                </div>
+              </td>
+            </tr>
+          </table>
+        </div>
+      </body>
+    </html>
+  </xsl:template>
+  
+  
+  <xsl:template match="error:extra">
+    <xsl:choose>
+      <xsl:when test="contains(@error:description,'stacktrace')">
+        <xsl:value-of select="@error:description"/>
+        <xsl:value-of select="translate(.,'&#13;','')"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="."/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+</xsl:stylesheet>

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/modules/homepage/config/menu.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/modules/homepage/config/menu.xml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/modules/homepage/config/menu.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/modules/homepage/config/menu.xml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: generic.xsp 155806 2005-03-01 17:55:42Z andreas $ -->
+
+<menu xmlns:i18n="http://apache.org/cocoon/i18n/2.1"    
+  xmlns:uc="http://apache.org/cocoon/lenya/usecase/1.0"
+  xmlns="http://apache.org/cocoon/lenya/menubar/1.0">
+  
+  <menus>
+    <menu i18n:attr="name" name="File">
+      <block areas="site authoring" id="create">
+        <item uc:usecase="sitemanagement.create" href="?doctype=xhtml"><i18n:translate>
+          <i18n:text>New ... Document</i18n:text>
+          <i18n:param><i18n:text>resourceType-xhtml</i18n:text></i18n:param>
+        </i18n:translate>
+        </item>
+      </block>
+    </menu>
+    
+    <menu i18n:attr="name" name="Edit">
+      <block areas="authoring" resourceTypes="homepage">
+        <item uc:usecase="kupu.edit"><i18n:text>With Kupu</i18n:text></item>
+        <item uc:usecase="bxe.edit"><i18n:text>With BXE</i18n:text></item>
+        <item uc:usecase="editors.forms" href="?form=xhtml"><i18n:text>With Forms</i18n:text></item>
+        <item uc:usecase="editors.oneform"><i18n:text>editors.sourceEditor</i18n:text></item>
+      </block>
+    </menu>
+    
+  </menus>
+  
+</menu>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.