cancel
Showing results for 
Search instead for 
Did you mean: 

Node - Last Modify Date

cedorfm
Champ in-the-making
Champ in-the-making
Hi,

I have several content nodes that I would like to arrange in order according to the date they were last modified/created. I am using the javascript API http://wiki.alfresco.com/wiki/3.4_JavaScript_API.

Are there any properties I can use along with the node reference to aquire this data? I'm looking at ScriptVersion[] versionHistory, however i'm not certain how exactly to use it. My current node is currently NOT versionable according to isVersionable.

Thanks again.
6 REPLIES 6

mrogers
Star Contributor
Star Contributor
You would order by either cm:modified or cm:created property.

cedorfm
Champ in-the-making
Champ in-the-making
Ok so if I understand you correctly…

container.children[0].properties["cm:modified"];

SHOULD return the last modified date of child node in "container" at index 0?

cedorfm
Champ in-the-making
Champ in-the-making
Works! I just had to cast the result to a string using String().

Thank you.

cedorfm
Champ in-the-making
Champ in-the-making
I found this, which is exactly what I want.

Array luceneSearch(string query, string sortColumn, boolean asc)

How do I/can I specify the container node to perform the search on?

cedorfm
Champ in-the-making
Champ in-the-making
Array luceneSearch(string store, string query, string sortColumn, boolean asc)

Ok so I'm assuming you can specify the store. With that being said how do you aquire a the store from a node reference?

cedorfm
Champ in-the-making
Champ in-the-making
SOLUTION:

I figured it out for those of you, who were wondering…

Provide a space followed by either a PATH or PARENT query.

   var spath = 'PARENT:"workspace://SpacesStore/d74dfee3-5f1d-43f3-bfbf-9a514ba23b7d"';
   var nodes = search.luceneSearch("workspace://SpacesStore", spath , "@cm:modified", false);