how to get the admin's home nodeRef in alfresco

641 views Asked by At

I want to add a space in admins home with java in alfresco so i'm trying to use this code:

serviceRegistry.getFileFolderService().create(adminhomeRef,"Some space name",ContentModel.TYPE_FOLDER);

The problem is that i don't khow how to get the reference of admin's home so how do i do it or is there any service who provides this.

1

There are 1 answers

1
Yon Santos On BEST ANSWER

I have checked the PersonServiceImpl class of Alfresco API, and I saw these lines that can be useful for you:

NodeRef person = personService.getPerson("your_username");

NodeRef homeFolder = (NodeRef)DefaultTypeConverter.INSTANCE.convert(NodeRef.
this.nodeService.getProperty(person, ContentModel.PROP_HOMEFOLDER));

Can you test if this is what you need?