You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2007/11/16 11:56:40 UTC

svn commit: r595621 - /lenya/trunk/src/modules-core/workflow/java/src/org/apache/lenya/cms/workflow/usecases/Publish.java

Author: andreas
Date: Fri Nov 16 02:56:39 2007
New Revision: 595621

URL: http://svn.apache.org/viewvc?rev=595621&view=rev
Log:
Publish usecase: consider non-UUID site nodes (don't throw exception)

Modified:
    lenya/trunk/src/modules-core/workflow/java/src/org/apache/lenya/cms/workflow/usecases/Publish.java

Modified: lenya/trunk/src/modules-core/workflow/java/src/org/apache/lenya/cms/workflow/usecases/Publish.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/workflow/java/src/org/apache/lenya/cms/workflow/usecases/Publish.java?rev=595621&r1=595620&r2=595621&view=diff
==============================================================================
--- lenya/trunk/src/modules-core/workflow/java/src/org/apache/lenya/cms/workflow/usecases/Publish.java (original)
+++ lenya/trunk/src/modules-core/workflow/java/src/org/apache/lenya/cms/workflow/usecases/Publish.java Fri Nov 16 02:56:39 2007
@@ -188,7 +188,6 @@
                     DocumentLocator[] requiredNodes = siteManager
                             .getRequiredResources(map, liveLoc);
                     for (int i = 0; i < requiredNodes.length; i++) {
-
                         String path = requiredNodes[i].getPath();
                         if (!liveSite.contains(path)) {
                             Link link = getExistingLink(path, document);
@@ -233,7 +232,7 @@
     }
 
     /**
-     * Returns a link of a certain node, preferrably in the document's language,
+     * Returns a link of a certain node, preferably in the document's language,
      * or <code>null</code> if the node has no links.
      * @param path The path of the node.
      * @param document The document.
@@ -243,10 +242,13 @@
     protected Link getExistingLink(String path, Document document) throws SiteException {
         SiteNode node = document.area().getSite().getNode(path);
         Link link = null;
-        if (node.hasLink(document.getLanguage())) {
-            link = node.getLink(document.getLanguage());
-        } else if (node.getLanguages().length > 0) {
-            link = node.getLink(node.getLanguages()[0]);
+        String uuid = node.getUuid();
+        if (uuid != null && uuid.equals(document.getUUID())) {
+            if (node.hasLink(document.getLanguage())) {
+                link = node.getLink(document.getLanguage());
+            } else if (node.getLanguages().length > 0) {
+                link = node.getLink(node.getLanguages()[0]);
+            }
         }
         return link;
     }



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