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 2004/12/27 17:24:41 UTC

svn commit: r123429 - in lenya/trunk/src: confpatch java/org/apache/lenya/cms/ac java/org/apache/lenya/cms/authoring java/org/apache/lenya/cms/site webapp/WEB-INF webapp/lenya webapp/lenya/usecases/ac

Author: gregor
Date: Mon Dec 27 08:24:40 2004
New Revision: 123429

URL: http://svn.apache.org/viewcvs?view=rev&rev=123429
Log:
Added stub usecases for login, create and move. Added well-known usecase names.
Added:
   lenya/trunk/src/java/org/apache/lenya/cms/ac/Logout.java   (contents, props changed)
   lenya/trunk/src/java/org/apache/lenya/cms/authoring/Create.java   (contents, props changed)
   lenya/trunk/src/java/org/apache/lenya/cms/site/Move.java   (contents, props changed)
   lenya/trunk/src/webapp/lenya/usecases/ac/logout.jx   (contents, props changed)
Modified:
   lenya/trunk/src/confpatch/pipelines.xmap
   lenya/trunk/src/webapp/WEB-INF/cocoon-xconf.xsl
   lenya/trunk/src/webapp/lenya/usecase.xmap

Modified: lenya/trunk/src/confpatch/pipelines.xmap
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/confpatch/pipelines.xmap?view=diff&rev=123429&p1=lenya/trunk/src/confpatch/pipelines.xmap&r1=123428&p2=lenya/trunk/src/confpatch/pipelines.xmap&r2=123429
==============================================================================
--- lenya/trunk/src/confpatch/pipelines.xmap	(original)
+++ lenya/trunk/src/confpatch/pipelines.xmap	Mon Dec 27 08:24:40 2004
@@ -69,6 +69,9 @@
       <map:match pattern="ac.login" type="usecase">
         <map:mount src="lenya/usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
       </map:match>
+      <map:match pattern="ac.logout" type="usecase">
+        <map:mount src="lenya/usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
 
     <!-- favicon -->
     <map:match pattern="favicon.ico">

Added: lenya/trunk/src/java/org/apache/lenya/cms/ac/Logout.java
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ac/Logout.java?view=auto&rev=123429
==============================================================================
--- (empty file)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ac/Logout.java	Mon Dec 27 08:24:40 2004
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ *
+ */
+package org.apache.lenya.cms.ac;
+
+import java.util.Map;
+
+import org.apache.lenya.ac.AccessControlException;
+import org.apache.lenya.cms.usecase.UsecaseException;
+import org.apache.lenya.cms.admin.AccessControlUsecase;
+import org.apache.avalon.framework.context.Context;
+import org.apache.avalon.framework.context.ContextException;
+import org.apache.avalon.framework.context.Contextualizable;
+import org.apache.cocoon.components.ContextHelper;
+import org.apache.cocoon.environment.ObjectModelHelper;
+import org.apache.cocoon.environment.Request;
+
+/**
+ * Usecase to log a user out.
+ * 
+ * @version $Id$
+ */
+public class Logout extends AccessControlUsecase {
+
+    /**
+     * Ctor.
+     */
+    public Logout() {
+        super();
+    }
+
+
+    /**
+     * Validates the request parameters.
+     * @throws UsecaseException if an error occurs.
+     */
+    void validate() throws UsecaseException {
+    }
+
+    /**
+     * @see org.apache.lenya.cms.usecase.AbstractUsecase#doCheckExecutionConditions()
+     */
+    protected void doCheckExecutionConditions() throws Exception {
+        validate();
+    }
+
+    /**
+     * @see org.apache.lenya.cms.usecase.AbstractUsecase#doExecute()
+     */
+    protected void doExecute() throws Exception {
+
+   }
+
+}
\ No newline at end of file

Added: lenya/trunk/src/java/org/apache/lenya/cms/authoring/Create.java
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/authoring/Create.java?view=auto&rev=123429
==============================================================================
--- (empty file)
+++ lenya/trunk/src/java/org/apache/lenya/cms/authoring/Create.java	Mon Dec 27 08:24:40 2004
@@ -0,0 +1,76 @@
+/*
+ * 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.
+ *
+ */
+package org.apache.lenya.cms.authoring;
+
+import org.apache.lenya.cms.publication.Document;
+import org.apache.lenya.cms.publication.DocumentBuildException;
+import org.apache.lenya.cms.metadata.dublincore.DublinCore;
+import org.apache.lenya.cms.usecase.DocumentUsecase;
+import org.apache.lenya.cms.usecase.UsecaseException;
+
+/**
+ * Usecase to create a resource.
+ * 
+ * @version $Id$
+ */
+public class Create extends DocumentUsecase {
+
+	/**
+     * Ctor.
+     */
+    public Create() {
+        super();
+    }
+
+    /**
+     * @see org.apache.lenya.cms.usecase.AbstractUsecase#doInitialize()
+     */
+    protected void doInitialize() throws Exception {
+        super.doInitialize();
+
+    }
+            
+     /**
+     * Validates the request parameters.
+     * @throws UsecaseException if an error occurs.
+     */
+    void validate() throws UsecaseException {
+    }
+
+    /**
+     * @see org.apache.lenya.cms.usecase.AbstractUsecase#doCheckExecutionConditions()
+     */
+    protected void doCheckExecutionConditions() throws Exception {
+        validate();
+    }
+
+    /**
+     * @see org.apache.lenya.cms.usecase.AbstractUsecase#doExecute()
+     */
+    protected void doExecute() throws Exception {
+        super.doExecute();
+
+    }
+
+    /**
+     * @see org.apache.lenya.cms.usecase.Usecase#setParameter(java.lang.String, java.lang.Object)
+     */
+    public void setParameter(String name, Object value) {
+        super.setParameter(name, value);
+
+    }
+}
\ No newline at end of file

Added: lenya/trunk/src/java/org/apache/lenya/cms/site/Move.java
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/site/Move.java?view=auto&rev=123429
==============================================================================
--- (empty file)
+++ lenya/trunk/src/java/org/apache/lenya/cms/site/Move.java	Mon Dec 27 08:24:40 2004
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ *
+ */
+package org.apache.lenya.cms.site;
+
+import org.apache.lenya.cms.publication.Document;
+import org.apache.lenya.cms.publication.DocumentBuildException;
+import org.apache.lenya.cms.site.SiteUsecase;
+import org.apache.lenya.cms.usecase.UsecaseException;
+
+/**
+ * Usecase to move a resource.
+ * 
+ * @version $Id$
+ */
+public class Move extends SiteUsecase {
+
+	/**
+     * Ctor.
+     */
+    public Move() {
+        super();
+    }
+
+    /**
+     * @see org.apache.lenya.cms.usecase.AbstractUsecase#doInitialize()
+     */
+    protected void doInitialize() throws Exception {
+        super.doInitialize();
+    }
+            
+     /**
+     * Validates the request parameters.
+     * @throws UsecaseException if an error occurs.
+     */
+    void validate() throws UsecaseException {
+    }
+
+    /**
+     * @see org.apache.lenya.cms.usecase.AbstractUsecase#doCheckExecutionConditions()
+     */
+    protected void doCheckExecutionConditions() throws Exception {
+        validate();
+    }
+
+    /**
+     * @see org.apache.lenya.cms.usecase.AbstractUsecase#doExecute()
+     */
+    protected void doExecute() throws Exception {
+        super.doExecute();
+    }
+
+    /**
+     * @see org.apache.lenya.cms.usecase.Usecase#setParameter(java.lang.String, java.lang.Object)
+     */
+    public void setParameter(String name, Object value) {
+        super.setParameter(name, value);
+    }
+}
\ No newline at end of file

Modified: lenya/trunk/src/webapp/WEB-INF/cocoon-xconf.xsl
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/WEB-INF/cocoon-xconf.xsl?view=diff&rev=123429&p1=lenya/trunk/src/webapp/WEB-INF/cocoon-xconf.xsl&r1=123428&p2=lenya/trunk/src/webapp/WEB-INF/cocoon-xconf.xsl&r2=123429
==============================================================================
--- lenya/trunk/src/webapp/WEB-INF/cocoon-xconf.xsl	(original)
+++ lenya/trunk/src/webapp/WEB-INF/cocoon-xconf.xsl	Mon Dec 27 08:24:40 2004
@@ -241,6 +241,9 @@
     <component-instance name="admin.changePassword" logger="lenya.admin" class="org.apache.lenya.cms.admin.UserPassword"/>
     <component-instance name="admin.userGroups" logger="lenya.admin" class="org.apache.lenya.cms.admin.UserGroups"/>
     <component-instance name="ac.login" logger="lenya.ac" class="org.apache.lenya.cms.ac.Login"/>
+    <component-instance name="ac.logout" logger="lenya.ac" class="org.apache.lenya.cms.ac.Logout"/>
+    <component-instance name="site.meta" logger="lenya.site" class="org.apache.lenya.cms.metadata.Metadata"/>
+    <component-instance name="authoring.create" logger="lenya.authoring" class="org.apache.lenya.cms.authoring.Create"/>
   </usecases>
       
 

Modified: lenya/trunk/src/webapp/lenya/usecase.xmap
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/usecase.xmap?view=diff&rev=123429&p1=lenya/trunk/src/webapp/lenya/usecase.xmap&r1=123428&p2=lenya/trunk/src/webapp/lenya/usecase.xmap&r2=123429
==============================================================================
--- lenya/trunk/src/webapp/lenya/usecase.xmap	(original)
+++ lenya/trunk/src/webapp/lenya/usecase.xmap	Mon Dec 27 08:24:40 2004
@@ -68,7 +68,70 @@
   <!-- FIXME: Reorder the pipelines in here neatly. Maybe alphabetically? -->
   <map:pipelines>
   
+    <!-- =================================================================== -->
+    <!-- Usecases that use the Usecase Framework -->
+    <!-- =================================================================== -->
     
+     <map:pipeline>
+      <map:match pattern="authoring.create" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+      <map:match pattern="site.acArchive" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+      <map:match pattern="site.acAuthoring" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+      <map:match pattern="site.acLive" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+      <map:match pattern="site.acTrash" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+      <map:match pattern="site.archive" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+      <map:match pattern="site.assets" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+      <map:match pattern="site.copy" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+      <map:match pattern="site.cut" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+      <map:match pattern="site.deactivate" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+      <map:match pattern="site.delete" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+      <map:match pattern="site.meta" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+      <map:match pattern="site.overview" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+      <map:match pattern="site.paste" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+      <map:match pattern="site.renameLabel" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+      <map:match pattern="site.renameURL" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+      <map:match pattern="site.restore" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+      <map:match pattern="site.scheduler" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+      <map:match pattern="site.workflow" type="usecase">
+        <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+      </map:match>
+    </map:pipeline>
+ 
     <!-- =================================================================== -->
     <!-- Notification Pipelines -->
     <!-- =================================================================== -->

Added: lenya/trunk/src/webapp/lenya/usecases/ac/logout.jx
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/usecases/ac/logout.jx?view=auto&rev=123429
==============================================================================
--- (empty file)
+++ lenya/trunk/src/webapp/lenya/usecases/ac/logout.jx	Mon Dec 27 08:24:40 2004
@@ -0,0 +1,66 @@
+<?xml version="1.0"?>
+<!--
+  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: login.jx 123362 2004-12-26 15:57:57Z gregor $ -->
+
+<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:translate>
+      <i18n:text i18n:key="logout-from-pub"/>
+      <i18n:param></i18n:param>
+    </i18n:translate>
+  </page:title>
+  <page:body>
+    <div class="lenya-box">
+      <div class="lenya-box-title">
+        <i18n:text>Logout</i18n:text>
+      </div>
+      <div class="lenya-box-body">
+        <form>
+          <input type="hidden" name="lenya.continuation" value="${continuation.id}"/>
+          <input type="hidden" name="lenya.usecase" value="${request.getParameter('lenya.usecase')}"/>
+          <table class="lenya-table-noborder">
+            <tr>
+              <td colspan="2">
+                <ul>
+                  <jx:forEach var="message" items="${usecase.getErrorMessages()}">
+                    <li>
+                      <i18n:text>
+                        <jx:out value="${message}"/>
+                      </i18n:text>
+                    </li>
+                  </jx:forEach>
+                  <jx:forEach var="message" items="${usecase.getInfoMessages()}">
+                    <li>
+                      <i18n:text>
+                        <jx:out value="${message}"/>
+                      </i18n:text>
+                    </li>
+                  </jx:forEach>
+                </ul>
+              </td>
+            </tr>
+          </table>
+        </form>
+      </div>
+    </div>
+  </page:body>
+</page:page>

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