Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Liferay Liferay
Create User-Group on Portal startup
January 8, 2013 3:17 PM
Answer

Liferay Liferay

Rank: Junior Member

Posts: 50

Join Date: May 18, 2010

Recent Posts

Hello Liferay Experts,
Please help me to create a User Group on portal startup.

I was able to create a role , group ( site or community ) by using the following property , but I could not find a similar property for user group.

system.roles = testRole
system.groups = testCommunity

Please help.

thanks
-H
Dhrutika Vyas
RE: Create User-Group on Portal startup
January 9, 2013 12:54 AM
Answer

Dhrutika Vyas

Rank: Expert

Posts: 438

Join Date: February 9, 2009

Recent Posts

Hi ,

There is no such property exists. You need to create user group manually.

Regards,
Dhrutika
Tom Mahy
RE: Create User-Group on Portal startup
January 9, 2013 2:02 AM
Answer

Tom Mahy

Rank: Junior Member

Posts: 38

Join Date: May 2, 2012

Recent Posts

You cant by changing but you can with a hook.

Create a scheduler that runs your class. You can then do anything with the API.

http://liferayazam.wordpress.com/2012/06/10/create-a-scheduler-in-liferay-6/
Bart Simpson
RE: Create User-Group on Portal startup
January 9, 2013 3:02 AM
Answer

Bart Simpson

Rank: Liferay Master

Posts: 524

Join Date: August 29, 2011

Recent Posts

You can check the seven-cogs hook to check some sample code to begin with.
Jitendra Rajput
RE: Create User-Group on Portal startup
January 9, 2013 3:31 AM
Answer

Jitendra Rajput

Rank: Liferay Master

Posts: 858

Join Date: January 7, 2011

Recent Posts

Create a hook and override global.startup.events .
This start up event will called when your portal initialized . It mean it will be called every time when you start your application server.

You can write code to perform check if user group is already exist then skip the code other wise create a new user group if its not exist.

http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/startup-events
http://www.liferay.com/community/wiki/-/wiki/Main/Portal+Hook+Plugins#section-Portal+Hook+Plugins-Event+Handlers