[Yanel-commits] rev 36356 - public/yanel/trunk/src/core/java/org/wyona/yanel/core/workflow

michi at wyona.com michi at wyona.com
Tue May 6 09:53:06 CEST 2008


Author: michi
Date: 2008-05-06 09:53:05 +0200 (Tue, 06 May 2008)
New Revision: 36356

Modified:
   public/yanel/trunk/src/core/java/org/wyona/yanel/core/workflow/WorkflowHelper.java
Log:
node is in most cases sufficient

Modified: public/yanel/trunk/src/core/java/org/wyona/yanel/core/workflow/WorkflowHelper.java
===================================================================
--- public/yanel/trunk/src/core/java/org/wyona/yanel/core/workflow/WorkflowHelper.java	2008-05-06 07:40:44 UTC (rev 36355)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/core/workflow/WorkflowHelper.java	2008-05-06 07:53:05 UTC (rev 36356)
@@ -315,9 +315,23 @@
         }
     }
 
+    /**
+     *
+     */
     public static String getWorkflowState(Resource resource, String revision) throws WorkflowException {
         try {
-            Node node = resource.getRealm().getRepository().getNode(resource.getPath());
+            return getWorkflowState(resource.getRealm().getRepository().getNode(resource.getPath()), revision);
+        } catch (Exception e) {
+            log.error(e, e);
+            throw new WorkflowException(e.getMessage(), e);
+        }
+    }
+
+    /**
+     *
+     */
+    public static String getWorkflowState(Node node, String revision) throws WorkflowException {
+        try {
             Property stateProp = node.getRevision(revision).getProperty(WORKFLOW_STATE_PROPERTY);
             if (stateProp != null) {
                 return stateProp.getString();
@@ -343,9 +357,23 @@
         }
     }
 
+    /**
+     *
+     */
     public static Date getWorkflowDate(Resource resource, String revision) throws WorkflowException {
         try {
-            Node node = resource.getRealm().getRepository().getNode(resource.getPath());
+            return getWorkflowDate(resource.getRealm().getRepository().getNode(resource.getPath()), revision);
+        } catch (Exception e) {
+            log.error(e, e);
+            throw new WorkflowException(e.getMessage(), e);
+        }
+    }
+
+    /**
+     *
+     */
+    public static Date getWorkflowDate(Node node, String revision) throws WorkflowException {
+        try {
             Property dateProp = node.getRevision(revision).getProperty(WORKFLOW_DATE_PROPERTY);
             if (dateProp != null) {
                 return dateProp.getDate();
@@ -357,5 +385,4 @@
             throw new WorkflowException(e.getMessage(), e);
         }
     }
-
 }



More information about the Yanel-commits mailing list