logo       

svn commit: r447394 - in /lenya/trunk/src/modules-core/sitemanagement: java: msg#00082

Subject: svn commit: r447394 - in /lenya/trunk/src/modules-core/sitemanagement: java/src/org/apache/lenya/cms/site/usecases/Cut.java resources/ resources/i18n/ resources/i18n/cmsui.xml resources/i18n/cmsui_de.xml
Author: andreas
Date: Mon Sep 18 06:00:41 2006
New Revision: 447394

URL: http://svn.apache.org/viewvc?view=rev&rev=447394
Log:
Don't allow to cut a node if a live version exists.

Added:
    lenya/trunk/src/modules-core/sitemanagement/resources/
    lenya/trunk/src/modules-core/sitemanagement/resources/i18n/
    lenya/trunk/src/modules-core/sitemanagement/resources/i18n/cmsui.xml
    lenya/trunk/src/modules-core/sitemanagement/resources/i18n/cmsui_de.xml
Modified:
    
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Cut.java

Modified: 
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Cut.java
URL: 
http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Cut.java?view=diff&rev=447394&r1=447393&r2=447394
==============================================================================
--- 
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Cut.java
 (original)
+++ 
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Cut.java
 Mon Sep 18 06:00:41 2006
@@ -16,14 +16,29 @@
  */
 package org.apache.lenya.cms.site.usecases;
 
+import org.apache.lenya.cms.publication.Document;
+import org.apache.lenya.cms.publication.Publication;
+import org.apache.lenya.cms.site.SiteStructure;
 import org.apache.lenya.cms.usecase.DocumentUsecase;
 
 /**
  * Cut a document into the clipboard.
  * 
- * @version $Id:$
+ * @version $Id$
  */
 public class Cut extends DocumentUsecase {
+
+    protected static final String MESSAGE_ISLIVE = "cut-error-islive";
+
+    protected void doCheckPreconditions() throws Exception {
+        super.doCheckPreconditions();
+        
+        Document doc = getSourceDocument();
+        SiteStructure liveSite = 
doc.getPublication().getArea(Publication.LIVE_AREA).getSite();
+        if (liveSite.contains(doc.getPath())) {
+            addErrorMessage(MESSAGE_ISLIVE);
+        }
+    }
 
     /**
      * @see org.apache.lenya.cms.usecase.AbstractUsecase#doExecute()

Added: 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=auto&rev=447394
==============================================================================
--- lenya/trunk/src/modules-core/sitemanagement/resources/i18n/cmsui.xml (added)
+++ lenya/trunk/src/modules-core/sitemanagement/resources/i18n/cmsui.xml Mon 
Sep 18 06:00:41 2006
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>

+<!--

+  Copyright 1999-2005 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 446564 2006-09-15 10:13:16Z andreas $ -->

+

+<catalogue xml:lang="en" xmlns:xhtml="http://www.w3.org/1999/xhtml";>

+

+  <message key="cut-error-islive">The node cannot be cut when a language 
version is published.</message>

+

+</catalogue>


Added: 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=auto&rev=447394
==============================================================================
--- lenya/trunk/src/modules-core/sitemanagement/resources/i18n/cmsui_de.xml 
(added)
+++ lenya/trunk/src/modules-core/sitemanagement/resources/i18n/cmsui_de.xml Mon 
Sep 18 06:00:41 2006
@@ -0,0 +1,25 @@
+<?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: 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="cut-error-islive">Der Knoten kann nicht ausgeschnitten werden 
wenn eine Sprachversion publiziert ist.</message>

+

+</catalogue>

+


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qnx.openqnx.dev...    politics.lenini...    audio.emagic.ex...    tex.texinfo.gen...    handhelds.linux...    ietf.sipping/20...    lang.erlang.gen...    cygwin.talk/200...    yellowdog.gener...    mozilla.devel.l...    xfree86.newbie/...    openbsd.ports/2...    db.oracle.devel...    kde.kalyxo.deve...    user-groups.lin...    bbc.cvs/2003-04...    gnu.libtool.bug...    redhat.k12osn/2...    emulators.wine....    freebsd.devel.d...    search.xapian.g...    java.izpack.use...    network.mrtg.us...    windows.total-c...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe