You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by ra...@apache.org on 2011/02/20 15:24:03 UTC

svn commit: r1072602 - in /lenya/branches/BRANCH_2_1_X/src: impl/java/org/apache/lenya/cms/publication/ modules-core/sitemanagement/java/test/org/apache/lenya/cms/site/usecases/ modules/notification/usecases/

Author: rainer
Date: Sun Feb 20 14:24:03 2011
New Revision: 1072602

URL: http://svn.apache.org/viewvc?rev=1072602&view=rev
Log:
Merging latest changes from 2.0.4 release. Bug 50722.

Added:
    lenya/branches/BRANCH_2_1_X/src/modules-core/sitemanagement/java/test/org/apache/lenya/cms/site/usecases/DeleteTest.java   (with props)
Modified:
    lenya/branches/BRANCH_2_1_X/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java
    lenya/branches/BRANCH_2_1_X/src/modules/notification/usecases/messageList.jx   (contents, props changed)

Modified: lenya/branches/BRANCH_2_1_X/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java
URL: http://svn.apache.org/viewvc/lenya/branches/BRANCH_2_1_X/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java?rev=1072602&r1=1072601&r2=1072602&view=diff
==============================================================================
--- lenya/branches/BRANCH_2_1_X/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java (original)
+++ lenya/branches/BRANCH_2_1_X/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java Sun Feb 20 14:24:03 2011
@@ -788,7 +788,7 @@ public class DocumentManagerImpl extends
          * @see org.apache.lenya.cms.publication.util.DocumentVisitor#visitDocument(org.apache.lenya.cms.publication.Document)
          */
         public void visitDocument(Document document) throws PublicationException {
-            getDocumentManager().deleteAllLanguageVersions(document);
+            getDocumentManager().delete(document);
         }
 
     }

Added: lenya/branches/BRANCH_2_1_X/src/modules-core/sitemanagement/java/test/org/apache/lenya/cms/site/usecases/DeleteTest.java
URL: http://svn.apache.org/viewvc/lenya/branches/BRANCH_2_1_X/src/modules-core/sitemanagement/java/test/org/apache/lenya/cms/site/usecases/DeleteTest.java?rev=1072602&view=auto
==============================================================================
--- lenya/branches/BRANCH_2_1_X/src/modules-core/sitemanagement/java/test/org/apache/lenya/cms/site/usecases/DeleteTest.java (added)
+++ lenya/branches/BRANCH_2_1_X/src/modules-core/sitemanagement/java/test/org/apache/lenya/cms/site/usecases/DeleteTest.java Sun Feb 20 14:24:03 2011
@@ -0,0 +1,79 @@
+/*
+ * 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.site.usecases;
+
+import java.util.Collections;
+import java.util.Map;
+
+import org.apache.lenya.cms.publication.Area;
+import org.apache.lenya.cms.publication.Document;
+import org.apache.lenya.cms.publication.DocumentLocator;
+import org.apache.lenya.cms.publication.DocumentManager;
+import org.apache.lenya.cms.publication.Publication;
+import org.apache.lenya.cms.site.SiteNode;
+import org.apache.lenya.cms.site.SiteStructure;
+import org.apache.lenya.cms.usecase.AbstractUsecaseTest;
+
+public class DeleteTest extends AbstractUsecaseTest {
+
+    String PATH = "/features";
+    String DELETE_URL = "/test/authoring" + PATH + ".html";
+
+    protected String getUsecaseName() {
+        return "admin.emptyTrash";
+    }
+
+    protected void prepareUsecase() throws Exception {
+        super.prepareUsecase();
+
+	DocumentManager docMgr = null;
+	try {
+	    docMgr = (DocumentManager) getManager().lookup(DocumentManager.ROLE);
+
+	    Publication pub = getPublication("test");
+	    Area area = pub.getArea(Publication.AUTHORING_AREA);
+	    Area trashArea = pub.getArea("trash");
+	    SiteStructure site = area.getSite();
+	    SiteNode node = site.getNode(PATH);
+	    Document doc_en = node.getLink("en").getDocument();
+	    Document doc_de = node.getLink("de").getDocument();
+
+	    DocumentLocator loc = DocumentLocator.getLocator(pub.getId(), "trash", PATH, doc_en.getLanguage());
+
+	    docMgr.copyAll(area, PATH, trashArea, PATH);
+
+	    SiteStructure trashSite = trashArea.getSite();
+	    assertTrue(trashSite.contains(PATH));
+	} finally {
+	    if (docMgr != null) {
+                getManager().release(docMgr);
+            }
+	}
+
+	getFactory().getSession().commit();
+
+    }
+
+    protected void checkPostconditions() throws Exception {
+        super.checkPostconditions();
+        
+        Publication pub = getPublication("test");
+        SiteStructure trashSite = pub.getArea("trash").getSite();
+	assertFalse(trashSite.contains(PATH));
+    }
+}

Propchange: lenya/branches/BRANCH_2_1_X/src/modules-core/sitemanagement/java/test/org/apache/lenya/cms/site/usecases/DeleteTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lenya/branches/BRANCH_2_1_X/src/modules/notification/usecases/messageList.jx
URL: http://svn.apache.org/viewvc/lenya/branches/BRANCH_2_1_X/src/modules/notification/usecases/messageList.jx?rev=1072602&r1=1072601&r2=1072602&view=diff
==============================================================================
--- lenya/branches/BRANCH_2_1_X/src/modules/notification/usecases/messageList.jx (original)
+++ lenya/branches/BRANCH_2_1_X/src/modules/notification/usecases/messageList.jx Sun Feb 20 14:24:03 2011
@@ -72,12 +72,7 @@
               <jx:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${message.getMessage().getTime()}"/>
             </td>
             <td style="text-align: center;">
-              <form method="POST">
-                <input type="hidden" name="lenya.usecase" value="${usecase.getName()}"/>
-                <input type="hidden" name="lenya.continuation" value="${continuation.id}"/>
-                <input type="hidden" name="deleteMessageId" value="${message.getId()}"/>
-                <input type="image" src="/modules/gui/icons/sweetie/base/16-square-red-delete.png" name="submit" value="Delete" i18n:attr="value"/>
-              </form>
+              <a href="?lenya.usecase=notification.deleteMessage&amp;messageId=${message.getId()}"><img src="/modules/gui/icons/sweetie/base/16-square-red-delete.png" alt="Delete"/></a>
             </td>
           </tr>
         </jx:forEach>
@@ -85,4 +80,4 @@
     </table>
   </div>
   
-</jx:template>
\ No newline at end of file
+</jx:template>

Propchange: lenya/branches/BRANCH_2_1_X/src/modules/notification/usecases/messageList.jx
------------------------------------------------------------------------------
    svn:eol-style = native



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