cancel
Showing results for 
Search instead for 
Did you mean: 

Inherit folder metadata

dleeuwen
Champ in-the-making
Champ in-the-making
Hi,

I have another question. Is it possible when I add custom metadata to a space that when I create another space in that space to inherit the metadate from the space above?

Example:

- space1
  metadata: id, name, adress, tel, fax, email

     |- subspace 2
     inherit : id, name from space1

Thanks,
Danny
3 REPLIES 3

rivetlogic
Champ on-the-rise
Champ on-the-rise
Hi,

You should be able to do this using the Javascript API.

Execute the script in an inherited rule and you should get the described behavior.

Hope this helps,

–Aladdin

evdgeest
Champ in-the-making
Champ in-the-making
Hi,

I am a noob, concerning java scripting. I made the code below, hoping to realize that the space inherits the description of his parent (in this case called 'Zaken'). It's partly copied from the example test script.js from Data dictionary/scripts .


var folders = companyhome.childrenByXPath("*[@cm:name='Zaken']");
var zakenFolder = folders[0];

var parentDescription = zakenFolder.properties["cm:Description"];


space.properties["cm:Description"] = parentDescription;
space.save();

What am I doing wrong, does someone have an idea?

Thanks,

Edwin

kevinr
Star Contributor
Star Contributor
The property names are case sensitive: 'cmSmiley Very Happyescription' is not correct, use 'cm:description'.

Thanks,

Kevin