Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Nicolas Tamayo
How Instantiating a User clas
March 30, 2013 2:11 PM
Answer

Nicolas Tamayo

Rank: Junior Member

Posts: 29

Join Date: October 3, 2012

Recent Posts

Hi Developers

I want make a instantiation of com.liferay.portal.model.User class, but i don't know how. because the UserImpl is in the portal-impl.jar or in another class loader that is not portal-service.jar, regard i not have access to that class.

how i can make the instantiation of User class??

regards
Victor Zorin
RE: How Instantiating a User clas
March 30, 2013 3:29 PM
Answer

Victor Zorin

Rank: Liferay Legend

Posts: 1173

Join Date: April 14, 2008

Recent Posts

Instead of having a direct access to object you have access to it via the API.
If you need to create user object try:
UserLocalServiceUtil.createUser(...)
or
UserLocalServiceUtil.addUser(...)

Both methods return interface to your User instance/object.
Nicolas Tamayo
RE: How Instantiating a User clas
March 30, 2013 4:01 PM
Answer

Nicolas Tamayo

Rank: Junior Member

Posts: 29

Join Date: October 3, 2012

Recent Posts

Thanks for your reply.

Yes, it is in the case in that i want create the user in the moment of the instantiation of interface, but, i want only make the User instantiation in order to handle the data through session until that the user execute an action that create the user. with this in mind,i need only instantiating the interface.

Thanks a lot for your reply.

regards.