cancel
Showing results for 
Search instead for 
Did you mean: 

Inherit metadata (properties)

fx3000se
Champ in-the-making
Champ in-the-making
I would like to build up a (more or less static) hierarchy where on each level metadata is added/defined. At a certain point in the hierarchy I would like to add content/documents. Upon the creation of a document the "metadata of the hierarchy" should be coiped into the documents metadata(properties?).
This implies two things:
1) only at run-time (depending on where the content is added) I know what properties/metadata to copy -> "dynamic properties"?
2) the copied metadata should be modifyable

Is this "setup" possible in Alfresco?
3 REPLIES 3

fx3000se
Champ in-the-making
Champ in-the-making
I have found a solution to this issue making use of a custom Javascript in an inbound rule.
The script creates the inherited aspects (which act as metadata holders) on the content and then copies the properties from its parent space. Walking down the hierarchy…

To make the script more "generic/flexible" I now have the follwing questions
http://forums.alfresco.com/en/viewtopic.php?f=9&t=17026
and
http://forums.alfresco.com/en/viewtopic.php?f=9&t=17032

dacedos
Champ in-the-making
Champ in-the-making
Hi!

Can you please help me? I have the same problem, I want to inherit some properties from the parent folder to the document I try to add.

I also use Javascript + rules but I don't know how to access to the parent folder custom properties. I defined my own content type and properties are defined like:

               <property name="custom:nombreFolderEspecialidad">
                  <title>Nombre</title>
                  <type>d:text</type>
               </property>

thanks!

fx3000se
Champ in-the-making
Champ in-the-making
var parent = space.parent;

document.properties["custom:nombreFolderEspecialidad"] = parent.properties["custom:nombreFolderEspecialidad"];

document.save();
hope this helps?