cancel
Showing results for 
Search instead for 
Did you mean: 

Iterating over node properties

theirish81
Champ in-the-making
Champ in-the-making
Hello everyone,
this will sound dumb to most of you… but since one day passed and still can't figure out… here I am asking for your help.
I have this webscript where the javascript part fetches some nodes.
In the template, I can iterate the nodes easily. What puzzles me is… once I have the node, is there a way to iterate over properties (ex. child.properties) ?

Thanks in advance
2 REPLIES 2

dc_noze
Champ in-the-making
Champ in-the-making
Hi,
here you can find some good examples http://wiki.alfresco.com/wiki/FreeMarker_Template_Cookbook#Document_Properties_Example, and here there is a macro that dump all properties http://forums.alfresco.com/en/viewtopic.php?f=12&t=24607.

bengrah
Champ on-the-rise
Champ on-the-rise
Generally if you have the node reference already, then you can make a direct reference to the property, so say if you have in your javascript:

var nodeList = space.getChildren();

"Ben"= nodeList[0].property["cm:name"]

nodeList.save();

That syntax isn't correct at all, but basically when you have the ScriptNode object (that can be a document, or a folder etc.) generally you already have access to its metadata.