You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2006/11/26 09:24:37 UTC

svn commit: r479309 - in /lenya/trunk/src: java/org/apache/lenya/workflow/ modules-core/administration/usecases/ modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/ modules-core/sitemanagement/resources/i18n/ modules-core/workflow-...

Author: andreas
Date: Sun Nov 26 00:24:35 2006
New Revision: 479309

URL: http://svn.apache.org/viewvc?view=rev&rev=479309
Log:
Adding workflow overview usecase

Added:
    lenya/trunk/src/modules-core/workflow-impl/config/cocoon-xconf/usecase-workflow-multiWorkflow.xconf
    lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/cms/workflow/usecases/MultiWorkflow.java
    lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/cms/workflow/usecases/WorkflowableWrapper.java
    lenya/trunk/src/modules-core/workflow-impl/resources/
    lenya/trunk/src/modules-core/workflow-impl/resources/i18n/
    lenya/trunk/src/modules-core/workflow-impl/resources/i18n/cmsui.xml
    lenya/trunk/src/modules-core/workflow-impl/resources/i18n/cmsui_de.xml
    lenya/trunk/src/modules-core/workflow-impl/usecases/
    lenya/trunk/src/modules-core/workflow-impl/usecases/multiWorkflow.jx
Modified:
    lenya/trunk/src/java/org/apache/lenya/workflow/Workflow.java
    lenya/trunk/src/modules-core/administration/usecases/siteOverview.jx
    lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/SiteOverview.java
    lenya/trunk/src/modules-core/sitemanagement/resources/i18n/cmsui.xml
    lenya/trunk/src/modules-core/sitemanagement/resources/i18n/cmsui_de.xml
    lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/workflow/impl/WorkflowImpl.java
    lenya/trunk/src/pubs/default/config/menus/generic.xsp
    lenya/trunk/src/pubs/default/config/publication.xconf
    lenya/trunk/src/webapp/lenya/resources/i18n/cmsui.xml
    lenya/trunk/src/webapp/lenya/resources/i18n/cmsui_de.xml
    lenya/trunk/src/webapp/lenya/resources/i18n/cmsui_es.xml
    lenya/trunk/src/webapp/lenya/resources/i18n/cmsui_fr.xml

Modified: lenya/trunk/src/java/org/apache/lenya/workflow/Workflow.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/workflow/Workflow.java?view=diff&rev=479309&r1=479308&r2=479309
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/workflow/Workflow.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/workflow/Workflow.java Sun Nov 26 00:24:35 2006
@@ -78,4 +78,9 @@
      * @return The events.
      */
     String[] getEvents();
+
+    /**
+     * @return The states.
+     */
+    String[] getStates();
 }

Modified: lenya/trunk/src/modules-core/administration/usecases/siteOverview.jx
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/administration/usecases/siteOverview.jx?view=diff&rev=479309&r1=479308&r2=479309
==============================================================================
--- lenya/trunk/src/modules-core/administration/usecases/siteOverview.jx (original)
+++ lenya/trunk/src/modules-core/administration/usecases/siteOverview.jx Sun Nov 26 00:24:35 2006
@@ -90,7 +90,7 @@
             <jx:forEach var="key" items="${usecase.getParameter('keys')}">
               <td>
                 <jx:choose>
-                  <jx:when test="${key.equals('keyDocumentId')}">
+                  <jx:when test="${key.equals('keyPath')}">
                     <a href="${request.getContextPath()}${entry.getValue('keyUrl')}">
                       <i18n:text><jx:out value="${entry.getValue(key)}"/></i18n:text>
                     </a>

Modified: lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/SiteOverview.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/SiteOverview.java?view=diff&rev=479309&r1=479308&r2=479309
==============================================================================
--- lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/SiteOverview.java (original)
+++ lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/SiteOverview.java Sun Nov 26 00:24:35 2006
@@ -60,7 +60,7 @@
     protected static final String FILTER_WORKFLOW_STATE_VALUES = "filterWorkflowStateValues";
     protected static final String FILTER_RESOURCE_TYPE_VALUES = "filterResourceTypeValues";
 
-    protected static final String KEY_DOCUMENT_ID = "keyDocumentId";
+    protected static final String KEY_PATH = "keyPath";
     protected static final String KEY_RESOURCE_TYPE = "keyResourceType";
     protected static final String KEY_WORKFLOW_STATE = "keyWorkflowState";
     protected static final String KEY_LANGUAGE = "keyLanguage";
@@ -69,7 +69,7 @@
     protected static final String KEY_CHECKED_OUT = "keyCheckedOut";
     protected static final String PARAMETER_KEYS = "keys";
 
-    protected static final String[] KEYS = { KEY_DOCUMENT_ID, KEY_LANGUAGE, KEY_RESOURCE_TYPE,
+    protected static final String[] KEYS = { KEY_PATH, KEY_LANGUAGE, KEY_RESOURCE_TYPE,
             KEY_WORKFLOW_STATE, KEY_LAST_MODIFIED, KEY_CHECKED_OUT };
 
     protected static final String FILTER_RESOURCE_TYPE = "filterResourceType";
@@ -96,7 +96,12 @@
             for (int i = 0; i < documents.length; i++) {
 
                 Entry entry = new Entry();
-                entry.setValue(KEY_DOCUMENT_ID, documents[i].getUUID());
+                if (documents[i].hasLink()) {
+                    entry.setValue(KEY_PATH, documents[i].getPath());
+                }
+                else {
+                    entry.setValue(KEY_PATH, "not in site structure");
+                }
                 entry.setValue(KEY_RESOURCE_TYPE, documents[i].getResourceType().getName());
                 entry.setValue(KEY_LANGUAGE, documents[i].getLanguage());
                 entry.setValue(KEY_URL, documents[i].getCanonicalWebappURL());

Modified: lenya/trunk/src/modules-core/sitemanagement/resources/i18n/cmsui.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/sitemanagement/resources/i18n/cmsui.xml?view=diff&rev=479309&r1=479308&r2=479309
==============================================================================
--- lenya/trunk/src/modules-core/sitemanagement/resources/i18n/cmsui.xml (original)
+++ lenya/trunk/src/modules-core/sitemanagement/resources/i18n/cmsui.xml Sun Nov 26 00:24:35 2006
@@ -20,6 +20,9 @@
 
 <catalogue xml:lang="en" xmlns:xhtml="http://www.w3.org/1999/xhtml">
 
+  <message key="sitemanagement.delete">Delete</message>
+  <message key="sitemanagement.archive">Archive</message>
+  <message key="sitemanagement.restore">Restore</message>
   <message key="cut-error-islive">The node cannot be cut when a language version is published.</message>
 
 </catalogue>

Modified: lenya/trunk/src/modules-core/sitemanagement/resources/i18n/cmsui_de.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/sitemanagement/resources/i18n/cmsui_de.xml?view=diff&rev=479309&r1=479308&r2=479309
==============================================================================
--- lenya/trunk/src/modules-core/sitemanagement/resources/i18n/cmsui_de.xml (original)
+++ lenya/trunk/src/modules-core/sitemanagement/resources/i18n/cmsui_de.xml Sun Nov 26 00:24:35 2006
@@ -20,6 +20,9 @@
 
 <catalogue xml:lang="de" xmlns:xhtml="http://www.w3.org/1999/xhtml">
 
+  <message key="sitemanagement.delete">Löschen</message>
+  <message key="sitemanagement.archive">Archivieren</message>
+  <message key="sitemanagement.restore">Wiederherstellen</message>
   <message key="cut-error-islive">Der Knoten kann nicht ausgeschnitten werden wenn eine Sprachversion publiziert ist.</message>
 
 </catalogue>

Added: lenya/trunk/src/modules-core/workflow-impl/config/cocoon-xconf/usecase-workflow-multiWorkflow.xconf
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/workflow-impl/config/cocoon-xconf/usecase-workflow-multiWorkflow.xconf?view=auto&rev=479309
==============================================================================
--- lenya/trunk/src/modules-core/workflow-impl/config/cocoon-xconf/usecase-workflow-multiWorkflow.xconf (added)
+++ lenya/trunk/src/modules-core/workflow-impl/config/cocoon-xconf/usecase-workflow-multiWorkflow.xconf Sun Nov 26 00:24:35 2006
@@ -0,0 +1,36 @@
+<?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: usecases-workflow-deactivate.xconf 348547 2005-11-23 20:13:01Z chestnut $ -->
+<!--
+    This file defines the publication specific use-cases
+-->
+
+  <xconf xpath="/cocoon/usecases" unless="/cocoon/usecases/component-instance[@name = 'workflow.multiWorkflow']">
+    <component-instance name="workflow.multiWorkflow" logger="lenya.workflow" class="org.apache.lenya.cms.workflow.usecases.MultiWorkflow">
+      <view template="modules/workflow-impl/usecases/multiWorkflow.jx" menu="false"/>
+      <exit usecase="workflow.multiWorkflow"/>
+      <usecase name="workflow.submit" event="submit"/>
+      <usecase name="workflow.publish" event="publish"/>
+      <usecase name="workflow.reject" event="reject"/>
+      <usecase name="workflow.deactivate" event="deactivate"/>
+      <usecase name="sitemanagement.delete" event="delete"/>
+      <usecase name="sitemanagement.archive" event="archive"/>
+      <usecase name="sitemanagement.restore" event="restore"/>
+    </component-instance>
+  </xconf>

Added: lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/cms/workflow/usecases/MultiWorkflow.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/cms/workflow/usecases/MultiWorkflow.java?view=auto&rev=479309
==============================================================================
--- lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/cms/workflow/usecases/MultiWorkflow.java (added)
+++ lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/cms/workflow/usecases/MultiWorkflow.java Sun Nov 26 00:24:35 2006
@@ -0,0 +1,136 @@
+/*
+ * 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.cms.workflow.usecases;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.lenya.cms.publication.Document;
+import org.apache.lenya.cms.site.SiteException;
+import org.apache.lenya.cms.site.SiteNode;
+import org.apache.lenya.cms.usecase.DocumentUsecase;
+import org.apache.lenya.cms.usecase.UsecaseInvoker;
+import org.apache.lenya.cms.usecase.UsecaseMessage;
+import org.apache.lenya.util.Assert;
+
+/**
+ * Manage the workflow of multiple documents.
+ */
+public class MultiWorkflow extends DocumentUsecase {
+
+    protected void initParameters() {
+        super.initParameters();
+
+        try {
+            List preOrder = getPreOrder(getSourceDocument().getLink().getNode());
+            List wrappers = new ArrayList();
+            SortedSet states = new TreeSet();
+            for (Iterator i = preOrder.iterator(); i.hasNext();) {
+                Document doc = (Document) i.next();
+                WorkflowableWrapper wrapper = new WorkflowableWrapper(this, this.manager,
+                        getDocumentFactory().getSession(), doc, getLogger());
+                wrappers.add(wrapper);
+                states.addAll(Arrays.asList(wrapper.getStates()));
+            }
+            setParameter("documents", wrappers);
+            setParameter("states", states);
+
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    protected List getPreOrder(SiteNode node) throws SiteException {
+        List preOrder = new ArrayList();
+        String[] langs = node.getLanguages();
+        Arrays.sort(langs);
+        for (int i = 0; i < langs.length; i++) {
+            preOrder.add(node.getLink(langs[i]).getDocument());
+        }
+        SiteNode[] children = node.getChildren();
+        for (int i = 0; i < children.length; i++) {
+            preOrder.addAll(getPreOrder(children[i]));
+        }
+        return preOrder;
+    }
+
+    protected void doExecute() throws Exception {
+        super.doExecute();
+        
+        String usecase = getParameterAsString("usecaseName");
+        Assert.notNull("usecase", usecase);
+        String url = getParameterAsString("url");
+        Assert.notNull("url", url);
+        
+        UsecaseInvoker invoker = null;
+        try {
+            invoker = (UsecaseInvoker) this.manager.lookup(UsecaseInvoker.ROLE);
+            invoker.invoke(url, usecase, new HashMap());
+            
+            if (invoker.getResult() != UsecaseInvoker.SUCCESS) {
+                List messages = invoker.getErrorMessages();
+                for (Iterator i = messages.iterator(); i.hasNext(); ) {
+                    UsecaseMessage message = (UsecaseMessage) i.next();
+                    addErrorMessage(message.getMessage(), message.getParameters());
+                }
+            }
+        }
+        finally {
+            if (invoker == null) {
+                this.manager.release(invoker);
+            }
+        }
+    }
+    
+    private Map usecase2event = new HashMap();
+
+    public void configure(Configuration config) throws ConfigurationException {
+        super.configure(config);
+        
+        Configuration[] usecaseConfigs = config.getChildren("usecase");
+        for (int i = 0; i < usecaseConfigs.length; i++) {
+            String usecase = usecaseConfigs[i].getAttribute("name");
+            String event = usecaseConfigs[i].getAttribute("event");
+            this.usecase2event.put(usecase, event);
+        }
+    }
+    
+    /**
+     * @param event An event.
+     * @return All usecases associated with this event.
+     */
+    public String[] getUsecases(String event) {
+        SortedSet usecases = new TreeSet();
+        for (Iterator i = this.usecase2event.keySet().iterator(); i.hasNext(); ) {
+            String usecase = (String) i.next();
+            if (this.usecase2event.get(usecase).equals(event)) {
+                usecases.add(usecase);
+            }
+        }
+        return (String[]) usecases.toArray(new String[usecases.size()]);
+    }
+
+}

Added: lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/cms/workflow/usecases/WorkflowableWrapper.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/cms/workflow/usecases/WorkflowableWrapper.java?view=auto&rev=479309
==============================================================================
--- lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/cms/workflow/usecases/WorkflowableWrapper.java (added)
+++ lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/cms/workflow/usecases/WorkflowableWrapper.java Sun Nov 26 00:24:35 2006
@@ -0,0 +1,141 @@
+/*
+ * 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.cms.workflow.usecases;
+
+import java.util.Arrays;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import org.apache.avalon.framework.container.ContainerUtil;
+import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import org.apache.avalon.framework.logger.Logger;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.lenya.cms.publication.Document;
+import org.apache.lenya.cms.publication.DocumentException;
+import org.apache.lenya.cms.repository.Session;
+import org.apache.lenya.cms.workflow.WorkflowUtil;
+import org.apache.lenya.workflow.Workflow;
+import org.apache.lenya.workflow.WorkflowException;
+import org.apache.lenya.workflow.Workflowable;
+
+/**
+ * Wrap a workflowable for easy evaluation in JX template.
+ */
+public class WorkflowableWrapper extends AbstractLogEnabled {
+
+    private MultiWorkflow usecase;
+    private Workflowable workflowable;
+    private ServiceManager manager;
+    private Document document;
+    private Session session;
+
+    /**
+     * Ctor.
+     * @param workflow
+     * @param manager The service manager.
+     * @param session The session.
+     * @param document The document to wrap.
+     * @param logger The logger.
+     */
+    public WorkflowableWrapper(MultiWorkflow usecase, ServiceManager manager, Session session,
+            Document document, Logger logger) {
+        this.usecase = usecase;
+        this.document = document;
+        this.manager = manager;
+        this.session = session;
+        ContainerUtil.enableLogging(this, logger);
+    }
+
+    protected Workflowable getWorkflowable() {
+        if (this.workflowable == null) {
+            this.workflowable = WorkflowUtil.getWorkflowable(this.manager, this.session,
+                    getLogger(), this.document);
+        }
+        return this.workflowable;
+    }
+
+    /**
+     * @return The state of the latest version.
+     * @throws WorkflowException
+     */
+    public String getState() throws WorkflowException {
+        String state;
+        if (getWorkflowable().getVersions().length > 0) {
+            state = getWorkflowable().getLatestVersion().getState();
+        } else {
+            Workflow workflow = getWorkflowSchema();
+            state = workflow.getInitialState();
+        }
+        return state;
+    }
+
+    /**
+     * @return All states supported by the workflow schema.
+     * @throws WorkflowException
+     */
+    public String[] getStates() throws WorkflowException {
+        return getWorkflowSchema().getStates();
+    }
+
+    protected Workflow getWorkflowSchema() throws WorkflowException {
+        Workflow workflow = WorkflowUtil.getWorkflowSchema(this.manager, this.session, getLogger(),
+                this.document);
+        return workflow;
+    }
+
+    /**
+     * @return The path of the document.
+     * @throws DocumentException If the document is not referenced in the site
+     *         structure.
+     */
+    public String getPath() throws DocumentException {
+        return this.document.getPath();
+    }
+
+    /**
+     * @return The language of the document.
+     */
+    public String getLanguage() {
+        return this.document.getLanguage();
+    }
+
+    /**
+     * @return The web application URL of the document.
+     */
+    public String getUrl() {
+        return this.document.getCanonicalWebappURL();
+    }
+
+    /**
+     * @return All executable events in alphabetical order.
+     * @throws WorkflowException if an error occurs.
+     */
+    public String[] getUsecases() throws WorkflowException {
+        SortedSet usecases = new TreeSet();
+        String[] events = getWorkflowSchema().getEvents();
+        for (int i = 0; i < events.length; i++) {
+            if (WorkflowUtil.canInvoke(this.manager, this.session, getLogger(), this.document,
+                    events[i])) {
+                String[] eventUsecases = this.usecase.getUsecases(events[i]);
+                usecases.addAll(Arrays.asList(eventUsecases));
+            }
+        }
+
+        return (String[]) usecases.toArray(new String[usecases.size()]);
+    }
+}

Modified: lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/workflow/impl/WorkflowImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/workflow/impl/WorkflowImpl.java?view=diff&rev=479309&r1=479308&r2=479309
==============================================================================
--- lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/workflow/impl/WorkflowImpl.java (original)
+++ lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/workflow/impl/WorkflowImpl.java Sun Nov 26 00:24:35 2006
@@ -111,11 +111,7 @@
         return this.states.contains(state);
     }
 
-    /**
-     * Returns the states.
-     * @return An array of states.
-     */
-    protected String[] getStates() {
+    public String[] getStates() {
         return (String[]) this.states.toArray(new String[this.states.size()]);
     }
 

Added: lenya/trunk/src/modules-core/workflow-impl/resources/i18n/cmsui.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/workflow-impl/resources/i18n/cmsui.xml?view=auto&rev=479309
==============================================================================
--- lenya/trunk/src/modules-core/workflow-impl/resources/i18n/cmsui.xml (added)
+++ lenya/trunk/src/modules-core/workflow-impl/resources/i18n/cmsui.xml Sun Nov 26 00:24:35 2006
@@ -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.xml 446564 2006-09-15 10:13:16Z andreas $ -->
+
+<catalogue xml:lang="en" xmlns:xhtml="http://www.w3.org/1999/xhtml">
+
+  <message key="workflow.multiWorkflow">Workflow-Übersicht</message>
+  <message key="back-to-document">Back to document</message>
+  <message key="workflow.submit">Submit</message>
+  <message key="workflow.reject">Reject</message>
+  <message key="workflow.publish">Publish</message>
+  <message key="workflow.deactivate">Deactivate</message>
+  <message key="Path">Path</message>
+  <message key="Actions">Actions</message>
+  <message key="state-as-text">State as text</message>
+  <message key="state-as-columns">State as columns</message>
+  
+</catalogue>

Added: lenya/trunk/src/modules-core/workflow-impl/resources/i18n/cmsui_de.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/workflow-impl/resources/i18n/cmsui_de.xml?view=auto&rev=479309
==============================================================================
--- lenya/trunk/src/modules-core/workflow-impl/resources/i18n/cmsui_de.xml (added)
+++ lenya/trunk/src/modules-core/workflow-impl/resources/i18n/cmsui_de.xml Sun Nov 26 00:24:35 2006
@@ -0,0 +1,35 @@
+<?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 446564 2006-09-15 10:13:16Z andreas $ -->
+
+<catalogue xml:lang="de" xmlns:xhtml="http://www.w3.org/1999/xhtml">
+
+  <message key="workflow.multiWorkflow">Workflow-Übersicht</message>
+  <message key="back-to-document">Zurück zum Dokument</message>
+  <message key="workflow.submit">Einreichen</message>
+  <message key="workflow.reject">Zurückweisen</message>
+  <message key="workflow.publish">Publizieren</message>
+  <message key="workflow.deactivate">Deaktivieren</message>
+  <message key="Path">Pfad</message>
+  <message key="Actions">Aktionen</message>
+  <message key="state-as-text">Zustand als Text</message>
+  <message key="state-as-columns">Zustand als Spalten</message>
+  
+</catalogue>
+

Added: lenya/trunk/src/modules-core/workflow-impl/usecases/multiWorkflow.jx
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/workflow-impl/usecases/multiWorkflow.jx?view=auto&rev=479309
==============================================================================
--- lenya/trunk/src/modules-core/workflow-impl/usecases/multiWorkflow.jx (added)
+++ lenya/trunk/src/modules-core/workflow-impl/usecases/multiWorkflow.jx Sun Nov 26 00:24:35 2006
@@ -0,0 +1,113 @@
+<?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: emptyTrash.jx 164233 2005-04-22 13:01:45Z jwkaltz $ -->
+
+<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"    
+  >
+  
+  <page:title><i18n:text><jx:out value="${usecase.getName()}"/></i18n:text></page:title>
+  <page:body>
+    
+    <jx:set var="style" value="${usecase.getParameter('style')}"/>
+    
+    <form style="display: inline;">
+      <input type="submit" value="back-to-document" i18n:attr="value"/>
+    </form>
+    
+    <form style="display: inline;">
+      <input type="hidden" name="lenya.usecase" value="${usecase.getName()}"/>
+      <jx:choose>
+        <jx:when test="${style.equals('text')}">
+          <input type="hidden" name="style" value="columns"/>
+          <input type="submit" name="submit" value="state-as-columns" i18n:attr="value"/>
+        </jx:when>
+        <jx:otherwise>
+          <input type="hidden" name="style" value="text"/>
+          <input type="submit" name="submit" value="state-as-text" i18n:attr="value"/>
+        </jx:otherwise>
+      </jx:choose>
+    </form>
+    
+    <br/><br/>
+    
+    <jx:import uri="fallback://lenya/usecases/templates/messages.jx"/>
+    
+    <table class="lenya-table">
+      
+      <tr>
+        <th><i18n:text>Path</i18n:text></th>
+        <th><i18n:text>Language</i18n:text></th>
+        <jx:choose>
+          <jx:when test="${style.equals('text')}">
+            <th><i18n:text>State</i18n:text></th>
+          </jx:when>
+          <jx:otherwise>
+            <jx:forEach var="state" items="${usecase.getParameter('states')}">
+              <th><i18n:text><jx:out value="${state}"/></i18n:text></th>
+            </jx:forEach>
+          </jx:otherwise>
+        </jx:choose>
+        <th><i18n:text>Actions</i18n:text></th>
+      </tr>
+      
+      <jx:forEach var="doc" items="${usecase.getParameter('documents')}">
+        <tr>
+          <td><a href="${request.contextPath}${doc.getUrl()}"><jx:out value="${doc.getPath()}"/></a></td>
+          <td><jx:out value="${doc.getLanguage()}"/></td>
+          <jx:choose>
+            <jx:when test="${style.equals('text')}">
+              <td>
+                <i18n:text><jx:out value="${doc.getState()}"/></i18n:text>
+              </td>
+            </jx:when>
+            <jx:otherwise>
+              <jx:forEach var="state" items="${usecase.getParameter('states')}">
+                <jx:choose>
+                  <jx:when test="${state.equals(doc.getState())}">
+                    <td style="text-align: center">x</td>
+                  </jx:when>
+                  <jx:otherwise>
+                    <td/>
+                  </jx:otherwise>
+                </jx:choose>
+              </jx:forEach>
+            </jx:otherwise>
+          </jx:choose>
+          <td>
+            <jx:forEach var="usecaseName" items="${doc.getUsecases()}">
+              <form method="POST" id="form-overview" style="display: inline;">
+                <input type="hidden" name="lenya.continuation" value="${continuation.id}"/>
+                <input type="hidden" name="lenya.usecase" value="${usecase.getName()}"/>
+                <input type="hidden" name="style" value="${style}"/>
+                <input type="hidden" name="usecaseName" value="${usecaseName}"/>
+                <input type="hidden" name="url" value="${doc.getUrl()}"/>
+                <input type="submit" name="submit" value="${usecaseName}" i18n:attr="value"/>
+              </form>
+            </jx:forEach>
+          </td>
+        </tr>
+      </jx:forEach>
+      
+    </table>
+    
+  </page:body>
+</page:page>
\ No newline at end of file

Modified: lenya/trunk/src/pubs/default/config/menus/generic.xsp
URL: http://svn.apache.org/viewvc/lenya/trunk/src/pubs/default/config/menus/generic.xsp?view=diff&rev=479309&r1=479308&r2=479309
==============================================================================
--- lenya/trunk/src/pubs/default/config/menus/generic.xsp (original)
+++ lenya/trunk/src/pubs/default/config/menus/generic.xsp Sun Nov 26 00:24:35 2006
@@ -112,10 +112,13 @@
       
       <menu i18n:attr="name" name="Workflow">
         <block areas="authoring site">
-          <item uc:usecase="workflow.submit" wf:event="submit" href="?"><i18n:text>Submit</i18n:text></item>
-          <item uc:usecase="workflow.reject" wf:event="reject" href="?"><i18n:text>Reject</i18n:text></item>
-          <item uc:usecase="workflow.publish" wf:event="publish" href="?"><i18n:text>Publish</i18n:text></item>
-          <item uc:usecase="workflow.deactivate" wf:event="deactivate" href="?"><i18n:text>Deactivate</i18n:text></item>
+          <item uc:usecase="workflow.submit" wf:event="submit" href="?"><i18n:text>workflow.submit</i18n:text></item>
+          <item uc:usecase="workflow.reject" wf:event="reject" href="?"><i18n:text>workflow.reject</i18n:text></item>
+          <item uc:usecase="workflow.publish" wf:event="publish" href="?"><i18n:text>workflow.publish</i18n:text></item>
+          <item uc:usecase="workflow.deactivate" wf:event="deactivate" href="?"><i18n:text>workflow.deactivate</i18n:text></item>
+       </block>
+        <block areas="authoring site">
+          <item uc:usecase="workflow.multiWorkflow" href="?"><i18n:text>workflow.multiWorkflow</i18n:text></item>
        </block>
       </menu>
 

Modified: lenya/trunk/src/pubs/default/config/publication.xconf
URL: http://svn.apache.org/viewvc/lenya/trunk/src/pubs/default/config/publication.xconf?view=diff&rev=479309&r1=479308&r2=479309
==============================================================================
--- lenya/trunk/src/pubs/default/config/publication.xconf (original)
+++ lenya/trunk/src/pubs/default/config/publication.xconf Sun Nov 26 00:24:35 2006
@@ -51,6 +51,7 @@
   <module name="sitemanagement"/>
   <module name="sitetree"/>
   <module name="export"/>
+  <module name="workflow-impl"/>
   <!-- TODO: The goal is to have a blog module ;-) -->
   <!--
   <module name="blog"/>

Modified: lenya/trunk/src/webapp/lenya/resources/i18n/cmsui.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/webapp/lenya/resources/i18n/cmsui.xml?view=diff&rev=479309&r1=479308&r2=479309
==============================================================================
--- lenya/trunk/src/webapp/lenya/resources/i18n/cmsui.xml (original)
+++ lenya/trunk/src/webapp/lenya/resources/i18n/cmsui.xml Sun Nov 26 00:24:35 2006
@@ -229,7 +229,7 @@
   <message key="keyWorkflowState">Workflow State</message>
   <message key="keyLanguage">Language</message>
   <message key="keyLastModified">Last Modified</message>
-  <message key="keyDocumentId">Document ID</message>
+  <message key="keyPath">Path</message>
   <message key="keyCheckedOut">Checked Out By</message>
   <message key="Update">Update</message>
   
@@ -313,6 +313,9 @@
   <message key="submit">submit</message>
   <message key="reject">reject</message>
   <message key="publish">publish</message>
+  <message key="delete">delete</message>
+  <message key="archive">archive</message>
+  <message key="restore">restore</message>
   <message key="error-workflow-document">The event {0} is not executable on
   document {1}</message>
   

Modified: lenya/trunk/src/webapp/lenya/resources/i18n/cmsui_de.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/webapp/lenya/resources/i18n/cmsui_de.xml?view=diff&rev=479309&r1=479308&r2=479309
==============================================================================
--- lenya/trunk/src/webapp/lenya/resources/i18n/cmsui_de.xml (original)
+++ lenya/trunk/src/webapp/lenya/resources/i18n/cmsui_de.xml Sun Nov 26 00:24:35 2006
@@ -229,7 +229,7 @@
   <message key="keyWorkflowState">Workflow-Status</message>
   <message key="keyLanguage">Sprache</message>
   <message key="keyLastModified">Letzte Änderung</message>
-  <message key="keyDocumentId">Dokument-ID</message>
+  <message key="keyDocumentId">Pfad</message>
   <message key="keyCheckedOut">Ausgecheckt von</message>
   <message key="Update">Aktualisieren</message>
     

Modified: lenya/trunk/src/webapp/lenya/resources/i18n/cmsui_es.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/webapp/lenya/resources/i18n/cmsui_es.xml?view=diff&rev=479309&r1=479308&r2=479309
==============================================================================
--- lenya/trunk/src/webapp/lenya/resources/i18n/cmsui_es.xml (original)
+++ lenya/trunk/src/webapp/lenya/resources/i18n/cmsui_es.xml Sun Nov 26 00:24:35 2006
@@ -239,7 +239,7 @@
   <message key="Live">En producción</message>
   <message key="keyLanguage">Idioma</message>
   <message key="keyLastModified">Ultima modificación</message>
-  <message key="keyDocumentId">Identificativo de documento</message>
+  <message key="keyPath">Identificativo de documento</message>
   <message key="keyCheckedOut">Revisado por</message>
   <message key="Update">Actualiza</message>
 

Modified: lenya/trunk/src/webapp/lenya/resources/i18n/cmsui_fr.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/webapp/lenya/resources/i18n/cmsui_fr.xml?view=diff&rev=479309&r1=479308&r2=479309
==============================================================================
--- lenya/trunk/src/webapp/lenya/resources/i18n/cmsui_fr.xml (original)
+++ lenya/trunk/src/webapp/lenya/resources/i18n/cmsui_fr.xml Sun Nov 26 00:24:35 2006
@@ -216,7 +216,7 @@
   <message key="keyWorkflowState">Statut</message>
   <message key="keyLanguage">Langue</message>
   <message key="keyLastModified">Dernière&#160;mise&#160;à&#160;jour</message>
-  <message key="keyDocumentId">ID du document</message>
+  <message key="keyPath">ID du document</message>
   <message key="keyCheckedOut">Extrait par</message>
   <message key="Update">Actualisation</message>
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org