0

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 Answers1

4

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?

Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332
Yon Santos
  • 121
  • 1
  • 4
  • Please don't post answers to ask for clarification of the question, instead post a comment. If you cannot post comments yet, then wait until you have 50 rep to do so. – Luiggi Mendoza Jul 25 '14 at 16:27