Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is how I did it. It works for plone 4.2.4 at least.</p> <p>Since the problem was a display problem, I just had to tweak my historyviewlet. Therefore, I created a folder named <code>viewlets</code> in my product root and created a <code>__init__.py</code> and a <code>configure.zcml</code> file. Then i copied <code>content_history.pt</code>, <code>history_view.pt</code>, <code>review_history.pt</code> and <code>content.py</code> from <code>plone/app/layout/viewlets/</code> (omelette) to the newly created folder. </p> <p>The <code>configure.zcml</code> contains two view registrations:</p> <pre><code>&lt;browser:view for="*" name="my-contenthistory" class=".content.ContentHistoryView" permission="zope2.View" /&gt; &lt;browser:page for="*" name="my-historyview" template="history_view.pt" permission="zope2.View" /&gt; </code></pre> <p>Furthermore, I copied the whole <code>WorkflowHistoryViewlet</code> class from <code>content.py</code> to a different class name. <code>TransferHistory</code> in this case. Then I changed mostly the part that corresponds to the workflow state variable, which was not <code>review_state</code>, but <code>transfer_state</code>. I further found that the initial usage of the 2nd workflow creates also a <code>created</code> entry in the history of the 2nd workflow, that I just filtered .</p> <pre><code>transfer_history = [x for x in transfer_history if x['action'] != None] </code></pre> <p>The I corrected the view name in <code>history_view.pt</code> to my new view name.</p> <pre><code>&lt;div tal:replace="structure here/@@my-contenthistory"&gt;Content History&lt;/div&gt; </code></pre> <p>Finally, I added my class as parent to the <code>ContentHistoryViewlet</code> class in <code>content.py</code></p> <pre><code>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 </code></pre> <p>and registered the .zcml in the products <code>configure.zcml</code></p> <pre><code> &lt;include package=".viewlets" /&gt; </code></pre> <p>Then I modified <code>content_history.pt</code> and also changed the definition of <code>action_id</code> in the upper part of the file. </p> <pre><code>[...] action_id python:item['action'] or item.get('review_state', False) or item.get('transfer_state', False); [...] </code></pre> <p>After rebooting the monster and a product reinstall, all state changes from both workflows are shown in the my-historyview.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload