0

i'm working on a small project to get the current user spaces in alfresco. i searched in the few days buts no result.

can any one help me to get the current user spaces using webscript in alfresco.

thanks you

Smartoop
  • 715
  • 6
  • 13

1 Answers1

3

Do you mean the user's home folder? In java you can do it like this:

NodeRef personNode = personService.getPerson(userName);
NodeRef homeFolderNode = nodeService.getProperty(personNode, ContentModel.PROP_HOMEFOLDER);

In javascript you could get it like this:

var userhome = companyhome.childByNamePath("User Homes/" + userName);

If you're looking for something other than that, please comment.

marsbard
  • 2,168
  • 1
  • 15
  • 16
  • thnak you for your answer,but i wanna get all the spaces and content ( like left menu in alfresco) – Smartoop Dec 21 '13 at 10:23
  • the username is not always the corresponding name of the user home. The safest way would be: var user = people.getPerson(userName); var user_home = user.properties["cm:homeFolder"]; – sysoutkoula Oct 18 '18 at 14:13