[Zope3-Users] hurry.workflow - retrieve item's history with timestamps of states transitions

2007-07-31 Thread Alek Kowalczyk
Hello,
I would like to have an ability to get 'workflow history' for my object. History
should contain a list of transitions with from and to states and with
timestamps.

Have anyone tried to implement such a simple functionality in hurry.workflow,
similar to what ClearQuest does? I would be grateful for suggestions how to deal
with this. Maybe I've missed something while reading hurry.workflow docs, and it
is already available?



___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] catalog of objects' states (hurry.workflow)

2007-07-31 Thread Alek Kowalczyk
Hello again,
I have a rather big tree of MyObjects. MyObjects are adaptable to
hurry.workflow's IWorklowState. Now I'd like to create a catalog to index all
MyObjects by their current states. How to do that? 

An option might be(?) to add to MyObject property like that:
@property
def currentState(self): return IWorkflowState(self).getState()
and index this property. 
But I'm not sure whether it is elegant solution, as it requires the object to
know that it has workflow and (too) strong link between object and adapter.

I'll appreciate any suggestions how to index workflow states cleanly and not in
too complictated way...
Regards!

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] hurry.workflow - retrieve item's history with timestamps of states transitions

2007-07-31 Thread Thierry Florac
Le mardi 31 juillet 2007 à 11:25 +, Alek Kowalczyk a écrit :
 Hello,
 I would like to have an ability to get 'workflow history' for my object. 
 History
 should contain a list of transitions with from and to states and with
 timestamps.
 
 Have anyone tried to implement such a simple functionality in hurry.workflow,
 similar to what ClearQuest does? I would be grateful for suggestions how to 
 deal
 with this. Maybe I've missed something while reading hurry.workflow docs, and 
 it
 is already available?


Hi,

I implemented such a functionality by adding a listener on
IWorkflowTransitionEvent, which with the help of zc.comment package add
comments with source and destination states labels, as well as a few
user comments ; these comments are prefixed by special characters so
that I can (when needed) filter them easilly, but implementing another
cleaner adapter to handle this should be very easy.

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: catalog of objects' states (hurry.workflow)

2007-07-31 Thread Philipp von Weitershausen

Alek Kowalczyk wrote:

Hello again,
I have a rather big tree of MyObjects. MyObjects are adaptable to
hurry.workflow's IWorklowState. Now I'd like to create a catalog to index all
MyObjects by their current states. How to do that? 


An option might be(?) to add to MyObject property like that:
@property
def currentState(self): return IWorkflowState(self).getState()
and index this property. 
But I'm not sure whether it is elegant solution, as it requires the object to

know that it has workflow and (too) strong link between object and adapter.


Right. Fortunately, indexes know how to adapt. So, in order to index the 
workflow state of your objects, configure a FieldIndex (or ValueIndex 
from zc.catalog) to the IWorkflowState interface. Specify the 'getState' 
 attribute and check the 'callable' option (because it's a method).


When encountering an object to be indexed, the FieldIndex (or 
ValueIndex) will then try to adapt it to IWorkflowState. If that 
succeeds (and it will for your MyObjects), it will call the getState() 
method on that adapter and index the return value.


This and more is described in my book, btw: http://worldcookery.com


--
http://worldcookery.com -- Professional Zope documentation and training

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: catalog of objects' states (hurry.workflow)

2007-07-31 Thread Tobias Rodäbel


Philipp von Weitershausen wrote:


Alek Kowalczyk wrote:

Hello again,
I have a rather big tree of MyObjects. MyObjects are adaptable to
hurry.workflow's IWorklowState. Now I'd like to create a catalog  
to index all
MyObjects by their current states. How to do that? An option might  
be(?) to add to MyObject property like that:

@property
def currentState(self): return IWorkflowState(self).getState()
and index this property. But I'm not sure whether it is elegant  
solution, as it requires the object to
know that it has workflow and (too) strong link between object and  
adapter.


Right. Fortunately, indexes know how to adapt. So, in order to  
index the workflow state of your objects, configure a FieldIndex  
(or ValueIndex from zc.catalog) to the IWorkflowState interface.  
Specify the 'getState'  attribute and check the 'callable' option  
(because it's a method).


When encountering an object to be indexed, the FieldIndex (or  
ValueIndex) will then try to adapt it to IWorkflowState. If that  
succeeds (and it will for your MyObjects), it will call the getState 
() method on that adapter and index the return value.


That worked for me with zope.app.catalog:

catalog = Catalog()
catalog[u'workflow_state'] =  FieldIndex(interface=IWorkflowState,  
field_name='getState', field_callable=True)

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Fwd: Zope 3 training in Oslo with Philipp von Weitershausen

2007-07-31 Thread Philipp von Weitershausen

In case anybody who's interested is not subscribed to zope-announce...


 Original Message 
Subject: Zope 3 training in Oslo with Philipp von Weitershausen
Date: Tue, 31 Jul 2007 15:15:04 +0200
From: Andreas Johnsen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]

Bouvet is happy to announce Zope 3 training in Oslo with Philipp von 
Weitershausen, author of the best selling book «Web Component 
Development with Zope 3». The training is targeted at Zope 2 and Plone 
developers who want to step into the world of modern Zope development.


- When: Monday 1. October - Thursday 4. October 2007

- Where: Oslo, Norway

For agenda and more information, please visit 
http://www.bouvet.no/BouvetWEB/KursSeksjon.aspx?PageID=e1.



--

Best regards,

Andreas Rübner Johnsen
www.bouvet.no



--
http://worldcookery.com -- Professional Zope documentation and training
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users