cancel
Showing results for 
Search instead for 
Did you mean: 

MySpaces webscript - show FirstName of documents creator

robertoroberto
Champ in-the-making
Champ in-the-making
Hi, I would modify MySpace web script.
I would to show firstame of document crator and name of document modifier instead its userid.
How can I do it? Where is the code that shows docs info(description, title, creator etc.)?

Please help me
sorry for my english
5 REPLIES 5

mikeh
Star Contributor
Star Contributor
Have a look into myspacespanel.get.html.ftl

Thanks,
Mike

robertoroberto
Champ in-the-making
Champ in-the-making
I don't understand how get firstname from document.properties.modifier  in ftl file…
please help me

mikeh
Star Contributor
Star Contributor
Sorry - I forgot the People API (to look-up a person object from a username) isn't available to Freemarker, only JavaScript.

You'd have to modify the web script so that the docs collection was populated in JavaScript. The script would also use the People API to look up the firstName from the username and store it as a string in the docs collection.

The template would render this generated docs collection (rather than the one it currently generates), where the firstName would now become available.


I guess at some point we'll make the People API available from Freemarker templates directly.

Mike

robertoroberto
Champ in-the-making
Champ in-the-making
Hi, I can't integrate javascipt API and ftl? Smiley Sad
Where is the script that popoulate the infos of docs collection for myspacespanels?Can you help me?

sotty for my english?

mikeh
Star Contributor
Star Contributor
At the moment the script logic is all held within the Freemarker template - the .ftl file.

The list of documents is created from
<#list companyhome.nodeByReference[args.h].children?sort_by('name') as d>

You need to create a new Javascript file (called myspacespanel.get.js) into which you move this query. Next, the Javascript walks through the collection of documents populating the firstName as described above.

These references should be useful if you're unfamiliar with webscripts:
http://wiki.alfresco.com/wiki/Web_Scripts
http://wiki.alfresco.com/wiki/Template_Guide
http://wiki.alfresco.com/wiki/JavaScript_API

Thanks,
Mike