cancel
Showing results for 
Search instead for 
Did you mean: 

Rule for renaming docs

davidcc
Champ in-the-making
Champ in-the-making
I want to have my docs renamed when they are saved in a space. The name of the doc depends on the space where i'm saving the doc.

Does anybody know how can i do this?

I was looking for some information about in forums and i can't find anything, any help will be welcome.

Thanks,

David.
3 REPLIES 3

jbarmash
Champ in-the-making
Champ in-the-making
You need to hook up a behavior to addition of Node.  An example of exactly what you are trying to do is in the Records Management module.  Basically, when you add a new record, it automatically renames it by prepending a generated Record ID, which seems very similar to what you want. 

I don't remember exactly which one does it, but follow the behaviors defined in this file to see how they did it:
  SRC\modules\records-mgmt\config\alfresco\module\org.alfresco.module.RecordsManagement\context\behaviour-context.xml

This is a really good tutorial on Behaviors. 
http://ecmarchitect.com/archives/2007/09/26/770

jbarmash
Champ in-the-making
Champ in-the-making
You need to hook up a behavior to addition of Node.  An example of exactly what you are trying to do is in the Records Management module.  Basically, when you add a new record, it automatically renames it by prepending a generated Record ID, which seems very similar to what you want. 

I don't remember exactly which one does it, but follow the behaviors defined in this file to see how they did it:
  SRC\modules\records-mgmt\config\alfresco\module\org.alfresco.module.RecordsManagement\context\behaviour-context.xml

This is a really good tutorial on Behaviors. 
http://ecmarchitect.com/archives/2007/09/26/770

xerox
Champ in-the-making
Champ in-the-making
You could create a rule that execute a javascript when a document is saved in a space.
You're javascript could look like:

document.name = document.parent.name + "_" + document.name;

reference : http://wiki.alfresco.com/wiki/JavaScript_API