You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by gr...@apache.org on 2005/02/12 21:13:56 UTC

svn commit: r153533 - in lenya/trunk/src/webapp/lenya/pubs/blog: config/ac/usecase-policies.xml config/doctypes/doctypes.xconf config/menus/entry.xsp config/menus/feed.xsp config/workflow/workflow.xml java/src/org/apache/lenya/cms/authoring/NewBlogEntryCreator.java parameter-doctype.xmap

Author: gregor
Date: Sat Feb 12 12:13:54 2005
New Revision: 153533

URL: http://svn.apache.org/viewcvs?view=rev&rev=153533
Log:
Added a single-step workflow definition to the blog publication

Added:
    lenya/trunk/src/webapp/lenya/pubs/blog/config/workflow/workflow.xml   (with props)
Modified:
    lenya/trunk/src/webapp/lenya/pubs/blog/config/ac/usecase-policies.xml
    lenya/trunk/src/webapp/lenya/pubs/blog/config/doctypes/doctypes.xconf
    lenya/trunk/src/webapp/lenya/pubs/blog/config/menus/entry.xsp
    lenya/trunk/src/webapp/lenya/pubs/blog/config/menus/feed.xsp
    lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/authoring/NewBlogEntryCreator.java
    lenya/trunk/src/webapp/lenya/pubs/blog/parameter-doctype.xmap

Modified: lenya/trunk/src/webapp/lenya/pubs/blog/config/ac/usecase-policies.xml
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/blog/config/ac/usecase-policies.xml?view=diff&r1=153532&r2=153533
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/blog/config/ac/usecase-policies.xml (original)
+++ lenya/trunk/src/webapp/lenya/pubs/blog/config/ac/usecase-policies.xml Sat Feb 12 12:13:54 2005
@@ -15,7 +15,25 @@
   limitations under the License.
 -->
 
-<!-- $Id: usecase-policies.xml,v 1.5 2004/03/13 12:31:32 gregor Exp $ -->
+<!-- $Id$ -->
 
 <usecases xmlns="http://apache.org/cocoon/lenya/ac/1.0">
-</usecases>
+	<usecase id="create">
+		<role id="edit"/>
+	</usecase>
+    <usecase id="archive">
+        <role id="edit"/>
+    </usecase>
+    <usecase id="delete">
+        <role id="edit"/>
+    </usecase>
+    <usecase id="restore">
+        <role id="edit"/>
+    </usecase>
+
+	<usecase id="userChangeProfile"><role id="edit"/><role id="admin"/></usecase>
+	<usecase id="userChangePasswordUser"><role id="edit"/></usecase>
+	<usecase id="userChangePasswordAdmin"><role id="admin"/></usecase>
+	<usecase id="userChangeGroups"><role id="admin"/></usecase>
+
+</usecases>
\ No newline at end of file

Modified: lenya/trunk/src/webapp/lenya/pubs/blog/config/doctypes/doctypes.xconf
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/blog/config/doctypes/doctypes.xconf?view=diff&r1=153532&r2=153533
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/blog/config/doctypes/doctypes.xconf (original)
+++ lenya/trunk/src/webapp/lenya/pubs/blog/config/doctypes/doctypes.xconf Sat Feb 12 12:13:54 2005
@@ -15,12 +15,13 @@
   limitations under the License.
 -->
 
-<!-- $Id: doctypes.xconf,v 1.2 2004/03/13 12:31:34 gregor Exp $ -->
+<!-- $Id$ -->
 
 <doctypes>
   <doc type="entry">
     <creator src="org.apache.lenya.cms.authoring.NewBlogEntryCreator">
       <sample-name>entry.xml</sample-name>
     </creator>
+    <workflow src="workflow.xml"/>
   </doc>
 </doctypes>

Modified: lenya/trunk/src/webapp/lenya/pubs/blog/config/menus/entry.xsp
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/blog/config/menus/entry.xsp?view=diff&r1=153532&r2=153533
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/blog/config/menus/entry.xsp (original)
+++ lenya/trunk/src/webapp/lenya/pubs/blog/config/menus/entry.xsp Sat Feb 12 12:13:54 2005
@@ -24,6 +24,7 @@
   xmlns:xsp-request="http://apache.org/xsp/request/2.0"
   xmlns:input="http://apache.org/cocoon/xsp/input/1.0"
   xmlns:uc="http://apache.org/cocoon/lenya/usecase/1.0"
+  xmlns:wf="http://apache.org/cocoon/lenya/workflow/1.0"
   xmlns:i18n="http://apache.org/cocoon/i18n/2.1"    
 >
 
@@ -51,12 +52,12 @@
   <menus>
     <menu i18n:attr="name" name="File">
       <block>
-        <item uc:usecase="edit" uc:step="open" href="?&amp;form=entry">Edit&#160;with&#160;Forms</item>
-        <item href="index-bxe.html">Edit&#160;with&#160;BXE</item>
-        <item uc:usecase="1formedit" uc:step="open">Edit&#160;with&#160;one&#160;Form</item>
+        <item wf:event="edit" uc:usecase="edit" uc:step="open" href="?&amp;form=entry">Edit&#160;with&#160;Forms</item>
+        <item wf:event="edit" href="index-bxe.html">Edit&#160;with&#160;BXE</item>
+        <item wf:event="edit" uc:usecase="1formedit" uc:step="open">Edit&#160;with&#160;one&#160;Form</item>
       </block>
       <block>
-        <item uc:usecase="publish" uc:step="showscreen"><xsp:attribute name="href">?sources=<xsp:expr>source</xsp:expr>&amp;uris=<xsp:expr>uri</xsp:expr>,feeds/all/index.html</xsp:attribute><i18n:text>Publish</i18n:text></item>
+        <item wf:event="publish" uc:usecase="publish" uc:step="showscreen"><xsp:attribute name="href">?sources=<xsp:expr>source</xsp:expr>&amp;uris=<xsp:expr>uri</xsp:expr>,feeds/all/index.html</xsp:attribute><i18n:text>Publish</i18n:text></item>
       </block>
       <!--
       <block>
@@ -64,7 +65,7 @@
       </block>
       -->
       <block>
-        <item uc:usecase="ac.logout"><i18n:text>Logout</i18n:text></item>
+        <item uc:usecase="ac.logout" href="?"><i18n:text>Logout</i18n:text></item>
       </block>
     </menu>
 

Modified: lenya/trunk/src/webapp/lenya/pubs/blog/config/menus/feed.xsp
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/blog/config/menus/feed.xsp?view=diff&r1=153532&r2=153533
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/blog/config/menus/feed.xsp (original)
+++ lenya/trunk/src/webapp/lenya/pubs/blog/config/menus/feed.xsp Sat Feb 12 12:13:54 2005
@@ -25,6 +25,7 @@
   xmlns:i18n="http://apache.org/cocoon/i18n/2.1"    
   xmlns:input="http://apache.org/cocoon/xsp/input/1.0"
   xmlns:uc="http://apache.org/cocoon/lenya/usecase/1.0"
+  xmlns:wf="http://apache.org/cocoon/lenya/workflow/1.0"
 >
  
 <menu>
@@ -47,11 +48,11 @@
         <item uc:usecase="site.create">Add&#160;new&#160;Entry</item>
       </block>
       <block>
-        <item uc:usecase="edit" uc:step="open" href="../../sidebar.html?form=sidebar">Edit&#160;Sidebar&#160;with&#160;Forms</item>
-        <item uc:usecase="publish" uc:step="showscreen" href="../../sidebar.html?sources=sidebar.xml&amp;uris=feeds/all/index.html"><i18n:text>Publish Sidebar</i18n:text></item>
+        <item wf:event="edit" uc:usecase="edit" uc:step="open" href="../../sidebar.html?form=sidebar">Edit&#160;Sidebar&#160;with&#160;Forms</item>
+        <item wf:event="publish" uc:usecase="publish" uc:step="showscreen" href="../../sidebar.html?sources=sidebar.xml&amp;uris=feeds/all/index.html"><i18n:text>Publish Sidebar</i18n:text></item>
       </block>
       <block>
-        <item uc:usecase="ac.logout"><i18n:text>Logout</i18n:text></item>
+          <item uc:usecase="ac.logout" href="?"><i18n:text>Logout</i18n:text></item>
       </block>
     </menu>
  

Added: lenya/trunk/src/webapp/lenya/pubs/blog/config/workflow/workflow.xml
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/blog/config/workflow/workflow.xml?view=auto&rev=153533
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/blog/config/workflow/workflow.xml (added)
+++ lenya/trunk/src/webapp/lenya/pubs/blog/config/workflow/workflow.xml Sat Feb 12 12:13:54 2005
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-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$ -->
+
+<workflow xmlns="http://apache.org/cocoon/lenya/workflow/1.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://apache.org/cocoon/lenya/workflow/1.0
+        ../../../resources/entities/workflow/workflow.xsd">
+
+  <state id="authoring" initial="true"/>
+  <state id="live"/>
+  <state id="trash"/>
+  <state id="archive"/>
+  
+  <variable name="is_live" value="false"/>
+  
+  <!-- AUTHORING -->
+
+  <!-- edit: authoring -> authoring -->  
+  <transition source="authoring" destination="authoring">
+    <event id="edit"/>
+    <condition class="org.apache.lenya.cms.workflow.RoleCondition">edit, review, organize</condition>
+  </transition>
+  
+  <!-- publish: authoring -> live -->  
+  <transition source="authoring" destination="live">
+    <event id="publish"/>
+    <condition class="org.apache.lenya.cms.workflow.RoleCondition">review, organize</condition>
+    <assign variable="is_live" value="true"/>
+  </transition>
+  
+  <!-- deactivate: authoring -> authoring -->  
+  <transition source="authoring" destination="authoring">
+    <event id="deactivate"/>
+    <condition class="org.apache.lenya.workflow.impl.BooleanVariableCondition">is_live = true</condition>
+    <condition class="org.apache.lenya.cms.workflow.RoleCondition">review, organize</condition>
+    <assign variable="is_live" value="false"/>
+  </transition>
+        
+  <!-- delete: authoring -> trash -->  
+  <transition source="authoring" destination="trash" synchronized="true">
+    <event id="delete"/>
+    <condition class="org.apache.lenya.workflow.impl.BooleanVariableCondition">is_live = false</condition>
+    <condition class="org.apache.lenya.cms.workflow.RoleCondition">edit, review, organize</condition>
+  </transition>
+        
+  <!-- archive: authoring -> archive -->  
+  <transition source="authoring" destination="archive" synchronized="true">
+    <event id="archive"/>
+    <condition class="org.apache.lenya.workflow.impl.BooleanVariableCondition">is_live = false</condition>
+    <condition class="org.apache.lenya.cms.workflow.RoleCondition">edit, review, organize</condition>
+  </transition>
+        
+  <!-- LIVE -->
+        
+  <!-- edit: live -> authoring -->
+  <transition source="live" destination="authoring">
+    <event id="edit"/>
+    <condition class="org.apache.lenya.cms.workflow.RoleCondition">edit, review, organize</condition>
+  </transition>
+        
+  <!-- deactivate: live -> authoring -->  
+  <transition source="live" destination="authoring">
+    <event id="deactivate"/>
+    <condition class="org.apache.lenya.workflow.impl.BooleanVariableCondition">is_live = true</condition>
+    <condition class="org.apache.lenya.cms.workflow.RoleCondition">review, organize</condition>
+    <assign variable="is_live" value="false"/>
+  </transition>
+        
+  <!-- TRASH -->
+        
+  <!-- restore: trash -> authoring -->
+  <transition source="trash" destination="authoring" synchronized="true">
+    <event id="restore"/>
+    <condition class="org.apache.lenya.cms.workflow.RoleCondition">edit, review, organize</condition>
+  </transition>
+  
+  <!-- ARCHIVE -->
+        
+  <!-- restore: archive -> authoring -->
+  <transition source="archive" destination="authoring" synchronized="true">
+    <event id="restore"/>
+    <condition class="org.apache.lenya.cms.workflow.RoleCondition">edit, review, organize</condition>
+  </transition>
+  
+</workflow>

Propchange: lenya/trunk/src/webapp/lenya/pubs/blog/config/workflow/workflow.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lenya/trunk/src/webapp/lenya/pubs/blog/config/workflow/workflow.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/authoring/NewBlogEntryCreator.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/authoring/NewBlogEntryCreator.java?view=diff&r1=153532&r2=153533
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/authoring/NewBlogEntryCreator.java (original)
+++ lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/authoring/NewBlogEntryCreator.java Sat Feb 12 12:13:54 2005
@@ -19,7 +19,7 @@
 
 package org.apache.lenya.cms.authoring;
 
-import org.apache.log4j.Category;
+import org.apache.log4j.Logger;
 
 import org.apache.avalon.framework.configuration.Configuration;
 
@@ -37,7 +37,7 @@
 import java.util.Date;
 
 public class NewBlogEntryCreator extends DefaultBranchCreator {
-    private static Category log = Category.getInstance(NewBlogEntryCreator.class);
+    private static Logger log = Logger.getLogger(NewBlogEntryCreator.class);
 
     private String year;
     private String month;

Modified: lenya/trunk/src/webapp/lenya/pubs/blog/parameter-doctype.xmap
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/blog/parameter-doctype.xmap?view=diff&r1=153532&r2=153533
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/blog/parameter-doctype.xmap (original)
+++ lenya/trunk/src/webapp/lenya/pubs/blog/parameter-doctype.xmap Sat Feb 12 12:13:54 2005
@@ -36,17 +36,17 @@
 
     <map:pipeline>
       <map:match pattern="*/**.html">
-	<map:act type="sourcetype" src="content/{1}/{page-envelope:document-path}">
-	  <map:generate type="serverpages" src="../../config/parameters/default.xsp">
-	    <map:parameter name="value" value="{sourcetype}"/>
-	  </map:generate>
-	  <map:serialize type="xml"/>
-	</map:act>
-
-	<map:generate type="serverpages" src="../../config/parameters/default.xsp">
-	  <map:parameter name="value" value="unknown"/>
-	</map:generate>
-	<map:serialize type="xml"/>
+        <map:act type="sourcetype" src="content/{1}/{page-envelope:document-path}">
+          <map:generate type="serverpages" src="../../config/parameters/default.xsp">
+            <map:parameter name="value" value="{sourcetype}"/>
+          </map:generate>
+          <map:serialize type="xml"/>
+        </map:act>
+      
+        <map:generate type="serverpages" src="../../config/parameters/default.xsp">
+          <map:parameter name="value" value="entry"/>
+        </map:generate>
+        <map:serialize type="xml"/>
       </map:match>
     </map:pipeline>
 



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