cancel
Showing results for 
Search instead for 
Did you mean: 

How to call people root object in java-backend like javascript

thinhnk
Champ on-the-rise
Champ on-the-rise
Hi friends,
I have following code in my java-backend webscript

org.alfresco.repo.jscript.People.People people = new org.alfresco.repo.jscript.People.People();
ScriptNode user = people.createPerson(username, firstname, lastname, email, password, true);

But NullPointerException happens. Can anyone tell me how to solve it?
4 REPLIES 4

mitpatoliya
Star Collaborator
Star Collaborator
So you mean to say you have this code in you java class right?In that case you need to inject PersonService in your class through bean definition and then you can use API's of that service to create person.

Hi mitpatoliya,
Actually I want to set quota for users, so I know the only way that using people object to do it.

people.setQuota(user, "1024000");

I know how to create users with PersonService but I don't know how to setQuota via this. Do you have any idea?

thinhnk
Champ on-the-rise
Champ on-the-rise
I call this service ContentUsageService and now I can set quota for users. Thank you verymuch mitpatoliya. I have just begun with Alfresco, so there are so much thing to learn.

mitpatoliya
Star Collaborator
Star Collaborator
Grt
by using ContentUsageService.setUserQuota(String userName, long newQuota) right?