[Product-Developers] Content Rules - Create Folder action

6 Messages Forum Options Options
Embed this topic
Permalink
David Bain-5
[Product-Developers] Content Rules - Create Folder action
Reply Threaded MoreMore options
Print post
Permalink
How do I go about creating a folder with a content rule/trigger.
I see actions such as notify, copy to folder etc... but nothing like:
"create folder" or "create object"

Is there an add on for this already? Or does it need to be written?

The use case is the ability to archive events based on month. The
rules would be:

On adding an event
1. Create a folder structure (if it does not exist) based on year and month
2. move the event to the year/month folder

_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
David Bain-5
[Product-Developers] Re: Content Rules - Create Folder action
Reply Threaded MoreMore options
Print post
Permalink
Okay... this http://plone.tv/media/1856753838/view looks like a good
starting point.

On Sat, Jul 5, 2008 at 7:38 AM, David Bain <david.bain@...> wrote:

> How do I go about creating a folder with a content rule/trigger.
> I see actions such as notify, copy to folder etc... but nothing like:
> "create folder" or "create object"
>
> Is there an add on for this already? Or does it need to be written?
>
> The use case is the ability to archive events based on month. The
> rules would be:
>
> On adding an event
> 1. Create a folder structure (if it does not exist) based on year and month
> 2. move the event to the year/month folder
>

_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
Martin Aspeli-2
[Product-Developers] Re: Content Rules - Create Folder action
Reply Threaded MoreMore options
Print post
Permalink
In reply to this post by David Bain-5
David Bain wrote:
> How do I go about creating a folder with a content rule/trigger.
> I see actions such as notify, copy to folder etc... but nothing like:
> "create folder" or "create object"

Take a look at
http://plone.org/documentation/tutorial/creating-content-rule-conditions-and-actions 
- you'll need to create a new content rule action, but that shouldn't be
so hard.

> Is there an add on for this already? Or does it need to be written?
>
> The use case is the ability to archive events based on month. The
> rules would be:
>
> On adding an event
> 1. Create a folder structure (if it does not exist) based on year and month
> 2. move the event to the year/month folder

I would possibly just make a bespoke action type for this use case,
rather than try to generalise too much. You'll need some logic to
determine where to create the folder and what to name it that's probably
not going to be easy to generalise beyond this use case.

Martin

--
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book


_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
David Bain-5
Re: [Product-Developers] Re: Content Rules - Create Folder action
Reply Threaded MoreMore options
Print post
Permalink
On Sat, Jul 5, 2008 at 12:42 PM, Martin Aspeli <optilude@...> wrote:

> David Bain wrote:
>>
>> How do I go about creating a folder with a content rule/trigger.
>> I see actions such as notify, copy to folder etc... but nothing like:
>> "create folder" or "create object"
>
> Take a look at
> http://plone.org/documentation/tutorial/creating-content-rule-conditions-and-actions
> - you'll need to create a new content rule action, but that shouldn't be so
> hard.
>
too hard is relative to what you know already :).
I think I found a nice example in mailtoplone
http://svn.plone.org/svn/collective/mailtoplone/mailtoplone.contentrules/trunk/mailtoplone/contentrules/
I'll go through that code as an example

>> Is there an add on for this already? Or does it need to be written?
>>
>> The use case is the ability to archive events based on month. The
>> rules would be:
>>
>> On adding an event
>> 1. Create a folder structure (if it does not exist) based on year and
>> month
>> 2. move the event to the year/month folder
>
> I would possibly just make a bespoke action type for this use case, rather
> than try to generalise too much. You'll need some logic to determine where
> to create the folder and what to name it that's probably not going to be
> easy to generalise beyond this use case.
>
> Martin
>
> --
> Author of `Professional Plone Development`, a book for developers who
> want to work with Plone. See http://martinaspeli.net/plone-book
>
>
> _______________________________________________
> Product-Developers mailing list
> Product-Developers@...
> http://lists.plone.org/mailman/listinfo/product-developers
>

_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
Martin Aspeli-2
[Product-Developers] Re: Content Rules - Create Folder action
Reply Threaded MoreMore options
Print post
Permalink
David Bain wrote:

> On Sat, Jul 5, 2008 at 12:42 PM, Martin Aspeli <optilude@...> wrote:
>> David Bain wrote:
>>> How do I go about creating a folder with a content rule/trigger.
>>> I see actions such as notify, copy to folder etc... but nothing like:
>>> "create folder" or "create object"
>> Take a look at
>> http://plone.org/documentation/tutorial/creating-content-rule-conditions-and-actions
>> - you'll need to create a new content rule action, but that shouldn't be so
>> hard.
>>
> too hard is relative to what you know already :).
> I think I found a nice example in mailtoplone
> http://svn.plone.org/svn/collective/mailtoplone/mailtoplone.contentrules/trunk/mailtoplone/contentrules/
> I'll go through that code as an example

Sure. :) The tutorial above explains things pretty well, I hope, and has
an example too. I'm sure you'll figure it out.

Martin

--
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book


_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
Roberto Allende
Re: Content Rules - Create Folder action
Reply Threaded MoreMore options
Print post
Permalink
In reply to this post by David Bain-5
David Bain wrote:

> How do I go about creating a folder with a content rule/trigger.
> I see actions such as notify, copy to folder etc... but nothing like:
> "create folder" or "create object"
>
> Is there an add on for this already? Or does it need to be written?
>
> The use case is the ability to archive events based on month. The
> rules would be:
>
> On adding an event
> 1. Create a folder structure (if it does not exist) based on year and month
> 2. move the event to the year/month folder

I've created a package wich adds an action to create a folder. It's
called menttes.action.createfolder and it should work adding it to
buildout.cfg.

The package is published in pypi:
http://pypi.python.org/pypi/menttes.action.createfolder/0.1dev-r68295

and sourcecode in collective:
http://dev.plone.org/collective/browser/menttes.action.createfolder/trunk

Right now you can define just the foldername but i'm adding an option to
choose the default view in few days. Also you could modify it to get the
foldername you want.

Kind Regards
r.

--
http://menttes.com


_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers