Luckyn
Luckyn

Reputation: 563

Liferay control panel to code

I'm new to Liferay but I have to update (fix bug and add some enhancement) a site made with Liferay 6.1.1

I have a form that create an organization and a blank site for it. The problem is that currently, an admin have to go to the control panel, change the public site template, change the name in the template to organization's name, check an option to merge with the main site public pages, then give admin rights for their site to the user who create it.

This task have no variant so I'm quite sure it can be done automatically when the user create the organization. I find the java files which create the organization from the form, but I have no idea where I should look for to make previous task automatic, or how to add it to the code...

Anybody can help me plz ?

Upvotes: 0

Views: 88

Answers (2)

Luckyn
Luckyn

Reputation: 563

tomic answer's help me well to start the work. I just want to add an other link I just find with some usefull information close to what I try to do :

https://blog.ancud.de/home/-/blogs/creating-sites-and-users-programmatically

Also there is a "definition" part in it wich is very usefull when you are new to Liferay :

To start with we have to know the right terms:

A site in Liferay is a Group with a special site flag set to 'true',

a page is called Layout and

a site template is called LayoutSetPrototype.

Upvotes: 1

tomic
tomic

Reputation: 613

Suggestion I can give you is some tip, how to look for specified classes allowing you to do some work. Each time you want to start to creating, modifying, removing some Liferay objects, just look for this pattern:

${MODEL_NAME}LocalServiceUtil.java

Here are few examples:

and so on with rest. Most of time Liferay serve such classes with plenty useful static methods, which means you can use them immediately in your code.

Your work doesn't seem to be very hard, try to look for such util services and you should be able to achieve your goals easly. Good luck! ;-)

Upvotes: 1

Related Questions