[Zope-CMF] Workflow to share documents

John Morton jwm@plain.co.nz
Thu, 4 Jul 2002 12:28:58 +1200


On Thu, 04 Jul 2002 04:52, mcolli@SyscomCipher.com.ar wrote:
> Hi,
>
> I have to make a workflow in Plone that has the following functionality:
>
> - When a person creates a document ,he/she can select from a list of
> members who (one or more) to share the document to.

Possible in principle. Some sort of query to the member tool should get you a
list of users.

> - This means that when this person press a button: "Share", an e-mail will
> be sent to all the members selected from the list.

If you make this 'share' action a transition, then you can set up a script to 
be called at the end of the transtion that does the emailing. 

> Besides, when pressing
> "Share" the document will be copied to a private folder of each member
> selected.

You could do it this way (and I think either Tres or Shane discussed some code
to copy/move an object when it reaches a state; it should be in the list 
archive somewhere), or you could consider setting up a role called 'Share 
Group' (for want of a better name), and assign it as a local role on the 
object to the list of users you want to share with. This way, they can all 
access the master object with what ever permissions are appropriate, and you 
don't have to worry about updating multiple copies on every change.

Bare in mind that if you set this up as a transtion that remains in state, 
then it will be a repeatable action - you'll want to code in some 
intelligence so that a person only get's emailed when they've been added or 
droped from the share list, and they have there local role removed if they 
are droped from the list. I'd store the list as a worklist variable, too.

> - The e-mail will contain a link to access the document that the members
> who received it are going to be able to see , after entering user and
> password.

Just use an absolute link from the object, if you use the local role 
assignment method.

HTH,
John