Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
karthik N
Hooks and Ext Plugins Liferay 6.1
December 15, 2011 2:17 AM
Answer

karthik N

Rank: Regular Member

Posts: 106

Join Date: June 30, 2011

Recent Posts

Hi Guys,
I want to customize the liferay portal..I need to know when we use Hooks ?and when we use Ext plugins? in order to customize the functionality of the liferay portal.
How do we identify to customize the particular class weather we have to use hook or Ext.


Can some one explain this?



Thanks & Regards,
Karthik
Ravi Kumar Gupta
RE: Hooks and Ext Plugins Liferay 6.1
December 15, 2011 2:25 AM
Answer

Ravi Kumar Gupta

Rank: Liferay Legend

Posts: 1242

Join Date: June 23, 2009

Recent Posts

From LR Dev Guide : Hooks can fill a wide variety of the common needs for overriding Liferay core functionality. Whenever possible, hooks should be used in place of Ext plugins, as they are hot-deployable and more forward compatible. Some common scenarios which require the use of a hook are the need to perform custom actions on portal startup or user login, overwrite or extend portal JSPs, modify portal properties, or replace a portal service with your own implementation.

See this for more http://www.liferay.com/documentation/liferay-portal/6.0/development/-/ai/hooks
Kaleem Mohammed
RE: Hooks and Ext Plugins Liferay 6.1
September 26, 2012 1:09 AM
Answer

Kaleem Mohammed

Rank: New Member

Posts: 7

Join Date: April 4, 2012

Recent Posts

Ravi Kumar Gupta:
From LR Dev Guide : Hooks can fill a wide variety of the common needs for overriding Liferay core functionality. Whenever possible, hooks should be used in place of Ext plugins, as they are hot-deployable and more forward compatible. Some common scenarios which require the use of a hook are the need to perform custom actions on portal startup or user login, overwrite or extend portal JSPs, modify portal properties, or replace a portal service with your own implementation.

See this for more http://www.liferay.com/documentation/liferay-portal/6.0/development/-/ai/hooks


Hi Ravi,

I am looking to import/map Phone and Address from LDAP to Liferay (existing phone and address fields ).

For your information, I am using Liferay 6.1 CE edition.

I am successful in mapping some basic fields such as firstName, lastName, email screenName, jobTitle etc.,

But I am facing issue in import/mapping Phone and Address fields from LDAP.

Can I develop a hook to acheive this (override LDAPImport and LDAPExport ) ? or I need to go with EXT

Any help is highly appreciated...


Regards
Kaleem
Mauro Mariuzzo
RE: Hooks and Ext Plugins Liferay 6.1
September 26, 2012 3:20 AM
Answer

Mauro Mariuzzo

Rank: Regular Member

Posts: 140

Join Date: July 23, 2007

Recent Posts

I've have resolved a similar requirement (only Phone) for a customer using Ext.

I've explored hook possibilities but, mainly for performance reason, I've found the ext way more powerfull.

In the file attached you'll find the relevant part of my implementation:
  • field mapping is managed by properties (se portal-ext.properties)
  • PortalLDAPUtilExt extend PortalLDAPUtil and is used to merge new mappings with the standard ones
  • CustomPortalLDAPImporterImpl extend PortalLDAPImporterImpl (via spring) and is used to update Liferay from LDAP
  • service override is made by spring (se META-INF/ext-spring.xml)


I know, Ext need more attention than hook. But in some situation it lets you to write a more manageable code.
Attachments: ext.tar.gz (4.2k)