Fórum

liferay flow

Suji Laxmi, modificado 12 Anos atrás.

liferay flow

New Member Postagens: 19 Data de Entrada: 18/10/11 Postagens Recentes
Hi,
In liferay there is a sign in portlet where we have create account page.
and the feilds are stored in user_ table in database.
now i want to customize createaccount,.jsp
I have liferay source code.
i want to know the flow how the details are stored in databse,what all java classes are involved etc.

Thanks
Suji.
thumbnail
Ravi Kumar Gupta, modificado 12 Anos atrás.

RE: liferay flow

Liferay Legend Postagens: 1302 Data de Entrada: 24/06/09 Postagens Recentes
First of all.. to modify any jsp file, use JSP hook. http://www.liferay.com/documentation/liferay-portal/6.0/development/-/ai/creating-a-hook
I would recommend to use Liferay IDE or Netbeans to create a hook.

Second, if you want to be familiar with flow of a request in portal..
check these posts http://www.liferay.com/community/forums/-/message_boards/message/11286969

HTH
Suji Laxmi, modificado 12 Anos atrás.

RE: liferay flow

New Member Postagens: 19 Data de Entrada: 18/10/11 Postagens Recentes
Hi
thanks for ur reply..
iam customizing the create_account.jsp using hook only.
i want to know from which java class,adduser function is called.
i want to see flow of code(from create_account.jsp to how values are stored in database).

thanks,
suji
thumbnail
Ravi Kumar Gupta, modificado 12 Anos atrás.

RE: liferay flow

Liferay Legend Postagens: 1302 Data de Entrada: 24/06/09 Postagens Recentes
See create account jsp has a form with action containing struts_path like this
<portlet:param name="struts_action" value="/login/create_account" />


which is mapped in struts-config.xml like this

<action path="/login/create_account" type="com.liferay.portlet.login.action.CreateAccountAction">
			<forward name="portlet.login.create_account" path="portlet.login.create_account" />
		</action>


Which leads to com.liferay.portlet.login.action.CreateAccountAction class in source.. which has a processAction method to handle the actions. Which based on other inputs conditionally calls addUser() method in the same file..

Have a look at the file and you will get to know more..

HTH
Venkat Koppavolu, modificado 12 Anos atrás.

RE: liferay flow

Junior Member Postagens: 85 Data de Entrada: 26/07/10 Postagens Recentes
Here is the flow

create_account.jsp -> CreateAccountAction -> Redirect with status message.

Step-1 Once we sumbit the form with createAccoutURL action URL

<portlet:actionURL var="createAccoutURL">
<portlet:param name="saveLastPath" value="0" />
<portlet:param name="struts_action" value="/login/create_account" />
</portlet:actionURL>


Step-2 com.liferay.portlet.login.action.CreateAccountAction's processAction method is getting called.

public void processAction(
ActionMapping mapping, ActionForm form, PortletConfig portletConfig,
ActionRequest actionRequest, ActionResponse actionResponse)
throws Exception {

String cmd = ParamUtil.getString(actionRequest, Constants.CMD);

try {
if (cmd.equals(Constants.ADD)) {
addUser(actionRequest, actionResponse);
}
}
..
}

Step-3 In addUser method liferay API
User user = UserServiceUtil.addUser(...) will be called and inserting/creating user details into USER_ table in LR DB and send redirect URL with
success message

Hope this will help

Thanks,
Venkat
Suji Laxmi, modificado 12 Anos atrás.

RE: liferay flow

New Member Postagens: 19 Data de Entrada: 18/10/11 Postagens Recentes
HI All,
Thanks for ur reply emoticon