Monday, July 16, 2012

My Account Portlet Customization By Hook


Liferay Hook to customize My Account Portlet:

Login to liferay Go to control Panel
Click on My Account Tab.

This is My Account Portlet, it manages user Information.
User Information is divided into three sections as shown in Figure.

Details : Personal details, password , Organization , sites ,User groups ,Roles , 
Categorization

 
Identifications: Addresses, Phone Numbers , Additional Email Address , Web sites , Instant Messengers , Social Networks, SMS , Open ID

Miscellaneous: Announcement ,Display Setting ,Comments , Custom Fields.

This entire user Information can be customized by Hooks.

Steps :.
We are going to use our same myfirst-hook.
Edit liferay-hook.xml

xml version="1.0"?>
DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.1.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_1_0.dtd">

<hook>
    <portal-properties>portal.propertiesportal-properties>
hook>
Create portal.properties file in myfirst-hook\docroot\WEB-INF\src folder.
Edit portal.properties file..
#
# Input a list of sections that will be included as part of the user form
# when updating a user in the My Account portlet.
#
users.form.my.account.main=details,password    users.form.my.account.identification=addresses,phone-numbers
users.form.my.account.miscellaneous= comments         
This way details, password, addresses,phone-numbers,comments will only be shown in
My account portlet.
Deploy Hook. Go to My Account Portlet.
Now it will look like as shown in Fig:



User Information section customization is done.

      My Account Hook Test case







Junit 5 Architecture

Modules in JUnit 5 : •         junit-jupiter-api: This module defines the API that you need to write your tests. •         ...