Michiel Rop pushed to branch feature/projectdocs at cms-community / 
hippo-repository


Commits:
61647c47 by Michiel Rop at 2017-10-12T21:20:52+02:00
REPO-1859 Add overloaded method of hints to supply payload

- - - - -


2 changed files:

- 
builtin/src/main/java/org/onehippo/repository/documentworkflow/DocumentWorkflow.java
- 
workflow/src/main/java/org/onehippo/repository/documentworkflow/DocumentWorkflowImpl.java


Changes:

=====================================
builtin/src/main/java/org/onehippo/repository/documentworkflow/DocumentWorkflow.java
=====================================
--- 
a/builtin/src/main/java/org/onehippo/repository/documentworkflow/DocumentWorkflow.java
+++ 
b/builtin/src/main/java/org/onehippo/repository/documentworkflow/DocumentWorkflow.java
@@ -83,6 +83,40 @@ public interface DocumentWorkflow extends Workflow, 
EditableWorkflow, CopyWorkfl
     @Override
     Map<String, Serializable> hints() throws WorkflowException, 
RemoteException, RepositoryException;
 
+
+    /**
+     * <p>
+     * The DocumentWorkflow hints method provides all the operational hints 
corresponding with the DocumentWorkflow
+     * operational method names which are available to the current user to be 
invoked. However, only when the returned
+     * value is Boolean.TRUE are they <em>allowed</em> to be invoked. They 
might have a value of Boolean.FALSE though
+     * when the current document <em>state</em> does not allow executing the 
specific operation.
+     * </p>
+     * <p>
+     * The returned hints map may also provide additional information, like 
the current editable "status", if the
+     * document "isLive", or if currently there is a "previewAvailable".
+     * </p>
+     * <p>
+     * Separately, the hints map also returns status information about 
existing workflow or scheduled requests.
+     * This request status data is returned under key "requests" with as value 
a nested 'hints'
+     * Map&lt;String,Map&lt;String, Boolean&gt;&gt; per request node 
identifier,
+     * defining the allowable request operations ({@link 
#acceptRequest(String)}, {@link #cancelRequest(String)},
+     * {@link #rejectRequest(String, String)}) for each request node.
+     * </p>
+     *
+     * @param initialPayload supplies information that is not available on the 
document
+     *
+     * @return a map containing hints given by the workflow, the data in this 
map may be considered valid until the
+     * document itself changes
+     *
+     * @throws WorkflowException   indicates that the work-flow call failed 
due work-flow specific conditions
+     * @throws RepositoryException indicates that the work-flow call failed 
because of storage problems internal to the
+     *                             repository
+     * @throws RemoteException     indicates that the work-flow call failed 
because of a connection problem with the
+     *                             repository
+     */
+    @WorkflowAction(loggable = false, mutates = false)
+    Map<String, Serializable> hints(Map<String, Serializable> initialPayload) 
throws WorkflowException, RemoteException, RepositoryException;
+
     // Operations previously provided through BasicReviewedActionsWorkflow, 
now provided on Document handle level
 
     /**


=====================================
workflow/src/main/java/org/onehippo/repository/documentworkflow/DocumentWorkflowImpl.java
=====================================
--- 
a/workflow/src/main/java/org/onehippo/repository/documentworkflow/DocumentWorkflowImpl.java
+++ 
b/workflow/src/main/java/org/onehippo/repository/documentworkflow/DocumentWorkflowImpl.java
@@ -193,6 +193,13 @@ public class DocumentWorkflowImpl extends WorkflowImpl 
implements DocumentWorkfl
         return Collections.unmodifiableMap(hints);
     }
 
+    @Override
+    public Map<String, Serializable> hints(final Map<String, Serializable> 
initializationPayload) throws WorkflowException {
+        return hints();
+    }
+
+
+
     // EditableWorkflow implementation
 
     @Override



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-repository/commit/61647c471ae85c47fc3d93a63723bdf09f6b7af1

---
View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-repository/commit/61647c471ae85c47fc3d93a63723bdf09f6b7af1
You're receiving this email because of your account on code.onehippo.org.
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to