Plone 4 - History for second workflow won't show in @@historyview -
i have dexterity content type in plone 4.2.4. versioning works fine default workflow
content type, although not workflow shipped plone, custom made.
however, when enable second workflow same type, versioning works fine.
- additional permissions managed second workflow working
- the state changes working
the difference:
- i used different
state_variable
names workflows, seems make sense, have catalogable field state of second workflow.
i've tried use same state variable name, didn't help. have workflow variable review_history
set in 2nd workflow , sufficient permissions in context. (mostly) shure, got permission concept, have no clou, how permissions calculated, when multiple workflows involved.
any idea, why second workflow not leave trace in content types history?
thanks in advance.
udate
i've reordered workflows ida ebkes suggested , did see, transitions 2nd workflow stored properly. seems issue historyview.
since these workflows indeed describe concurrent behaviors of content type, stick separate workflows , ideally different workflow state variables , catalog indexes.
what think needs done, tweak historyview.
here how did it. works plone 4.2.4 @ least.
since problem display problem, had tweak historyviewlet. therefore, created folder named viewlets
in product root , created __init__.py
, configure.zcml
file. copied content_history.pt
, history_view.pt
, review_history.pt
, content.py
plone/app/layout/viewlets/
(omelette) newly created folder.
the configure.zcml
contains 2 view registrations:
<browser:view for="*" name="my-contenthistory" class=".content.contenthistoryview" permission="zope2.view" /> <browser:page for="*" name="my-historyview" template="history_view.pt" permission="zope2.view" />
furthermore, copied whole workflowhistoryviewlet
class content.py
different class name. transferhistory
in case. changed part corresponds workflow state variable, not review_state
, transfer_state
. further found initial usage of 2nd workflow creates created
entry in history of 2nd workflow, filtered .
transfer_history = [x x in transfer_history if x['action'] != none]
the corrected view name in history_view.pt
new view name.
<div tal:replace="structure here/@@my-contenthistory">content history</div>
finally, added class parent contenthistoryviewlet
class in content.py
class contenthistoryviewlet(workflowhistoryviewlet, transferhistoryviewlet): index = viewpagetemplatefile("content_history.pt") @memoize def getuserinfo(self, userid): [...] def fullhistory(self): history = self.workflowhistory() + self.revisionhistory() + self.transferhistory() if len(history) == 0: return none history.sort(key=lambda x: x["time"], reverse=true) return history
and registered .zcml in products configure.zcml
<include package=".viewlets" />
then modified content_history.pt
, changed definition of action_id
in upper part of file.
[...] action_id python:item['action'] or item.get('review_state', false) or item.get('transfer_state', false); [...]
after rebooting monster , product reinstall, state changes both workflows shown in my-historyview.
Comments
Post a Comment