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>
+
|