cancel
Showing results for 
Search instead for 
Did you mean: 

By Default Rule apply on directory creation in document library

jakeer
Champ on-the-rise
Champ on-the-rise
I want to assign same rule for all the directories/folders like adding same custom Aspect in document library. Right now I am manually assigning the same rule for all newly created directories/folders. Here my question is it possible to set rule(adding the custom aspect) automatically on directories/folders creation.

Thanks in advance
6 REPLIES 6

art99trash
Star Contributor
Star Contributor
Do you mean that you want to automatically add a rule to each new folder that is created?

If you want to have the same rule added to each folder, then you could add the rule to a higher level folder and have the
lower level folders inherit it.

jakeer
Champ on-the-rise
Champ on-the-rise
Yeah, but only in one particular site. Here all the folder will be higher level folder. What you have explained is I have already gone through while creating the rule for folder. Any how thanks for your reply

muralidharand
Star Contributor
Star Contributor
You can use
 Change Type
option in the folder details page. When the folder is changed into your custom type, you can hook up folder behavior folder rule in the Java side.
Please let me know, if you're not clear.

steven_okennedy
Star Contributor
Star Contributor
Hi Jakeer,

If all the folders are in the same site or in a small number of sites, the easiest way is as art99trash mentioned and create a rule to set the aspect.  A lot of people don't realise, but using the Repository view, you can actually configure rules on the Document Library object itself (in the normal view you're already taken inside this node and can't get at it).  Doing this means that any folder created underneath the Document Library in a site will have the rule run.  You would need to do this on each site you want this done on, and there would still be a manual step for new sites.

The other option, which is probably overkill, would be to create a custom behaviour that will fire on node creation for folders.  This would mean that you would always apply the aspect when a folder gets created, no matter where or when - this could well include folders created by Alfresco in some instances as well, so be aware (as I said, probably overkill but fully automated Smiley Happy )

Regards

Steven

Thank for your reply. In second way you explained, is it possible to apply only for a particular site?

Hi Jakeer,

Yes it's possible but it would be bad practice really, as effectively you'd be hard coding the site name into your behaviour (Java code).  You'd basically have a bif dirty if statement saying "only do the following if site name = "X".

You'd be much better off using a rule based mechanism if you're talking about a single site, or a known set of sites, as you can choose to apply the rule only where you need to.

Generally behaviours are better suited for system-wide actions and rules work better when you want to limit things to differently.

Regards

Steven