Hi Samuel,
It's a great question!
Actually, your requirement can be easily solved by adding a custom SCXML
action since Hippo CMS 7.9 innovated its document processing engine with
SCXML [1].
If you want to control the publishability of a document based on
specific business rules, then I think you can add your own custom action
like the following:
---
a) Add a custom action and replace the following line in the default
document workflow [2] SCXML definition with your own custom action:
[Before]
<hippo:action action="publish" enabledExpr="true"/>
[After]
<mycustom1:setPublishAction documentVariantExpr="unpublished" />
You might want to take a look at how the default hippo:action custom
action [3] was implemented. Basically, you can control the allowed
actions such as 'publish' in your custom action. You can define any tag
attributes that are automatically mapped Java POJO properties. If you
have your custom action extend AbstractDocumentTaskAction [4], then you
will be able to retrieve documentHandle and documentVariants easily to
read the underlying document node(s) like the following example:
Node node =
getVariant().getNode(getWorkflowContext().getInternalWorkflowSession());
// Please see [5] for a real example usage.)
b) Register your custom action:
You need to add a child element under
/hippo:configuration/hippo:modules/scxmlregistry/hippo:moduleconfig/hipposcxml:definitions/documentworkflow/.
For example,
/setPublishAction (hipposcxml:action)
- hipposcxml:classname: "org.example.repository.scxml.SetPublishAction"
- hipposcxml:namespace: "
http://www.example.com/cms7/repository/scxml"
You also need to define the namespace in the default document workflow
scxml definition by adding something like this:
<scxml version="1.0"
xmlns="
http://www.w3.org/2005/07/scxml"
xmlns:hippo="
http://www.onehippo.org/cms7/repository/scxml"
xmlns:cs="
http://commons.apache.org/scxml"
xmlns:mycustom1="
http://www.example.com/cms7/repository/scxml">
---
If you have any further questions, let us know.
Hope it helps,
Woonsan
[1]
http://www.onehippo.org/library/concepts/workflow/scxml-workflow-engine.html
[2]
http://www.onehippo.org/library/concepts/workflow/document-workflow.html
[3]
http://svn.onehippo.org/repos/hippo/hippo-cms7/repository/branches/hippo-repository-2.26.xx/workflow/src/main/java/org/onehippo/repository/scxml/ActionAction.java
[4]
http://svn.onehippo.org/repos/hippo/hippo-cms7/repository/branches/hippo-repository-2.26.xx/workflow/src/main/java/org/onehippo/repository/documentworkflow/action/AbstractDocumentTaskAction.java
[5]
http://svn.onehippo.org/repos/hippo/hippo-cms7/repository/branches/hippo-repository-2.26.xx/workflow/src/main/java/org/onehippo/repository/documentworkflow/action/VersionVariantAction.java
> --
> Hippo Community Group: The place for all discussions and announcements
> about Hippo CMS (and HST, repository etc. etc.)
>
> To post to this group, send email to
hippo-c...@googlegroups.com
> RSS:
>
https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
> ---
> You received this message because you are subscribed to the Google
> Groups "Hippo Community" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
hippo-communi...@googlegroups.com
> <mailto:
hippo-communi...@googlegroups.com>.
> Visit this group at
http://groups.google.com/group/hippo-community.
> For more options, visit
https://groups.google.com/d/optout.
--
w....@onehippo.com www.onehippo.com
Boston - 101 Main Street, Cambridge, MA 02142
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US
+1 877 414 4776 (toll free)
Europe
+31(0)20 522 4466