Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hiran Chaudhuri
Clarification on Liferay ext...
August 5, 2011 10:35 AM
Answer

Hiran Chaudhuri

Rank: Regular Member

Posts: 172

Join Date: September 1, 2010

Recent Posts

Hi there.

Looking at the Liferay SDK I know when to create a portlet or theme plugin.
But what id actually the difference between portlets and hooks and ext?

1) My idea is that portlet plugins may carry custom applications. What if this application requires some hooks?

2) What is the recommended way to implement some data model (ServiceBuilder classes) that can be used in portlets and hooks likewise? Somehow I'm getting unsure about the classpath.
David H Nebinger
RE: Clarification on Liferay ext...
August 5, 2011 11:47 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 4496

Join Date: September 1, 2006

Recent Posts

Ext plugin is a way to override all Liferay functionality, even functionality that is currently not-hookable.

Hooks are the preferred method of overriding Liferay functionality (i.e. replacing JSPs or using available hook points).

Portlets are specific apps, such as the chat portlet or the mail portlet. Think of them along the lines of unix command line utilities - each performs a small, specific task (sometimes in conjunction with others) and does it well, and the portal is used to consolidate all of the info into a single cohesive view.

Purists will argue that separating the plugin projects will minimize the coupling between them, but in practice there are times where there are dependencies (i.e. the only way the portlet works is when the hook is in place). In this case it is fine to put them into a single deployment artifact.

A shared dependency between two projects (i.e. service code dependency for a portlet and a hook) can be solved numerous ways:

1. Create the service code, put into a jar, then include as library in both projects.
2. Create the service code, put into a jar, then make it a global lib for the app container.
3. Merge all of this dependent code into a single deployment artifact (no external dependencies).

It's really up to you. Personally I'd lean towards #3 as it is the path of least resistance, but it's totally up to you...
Jeffrey Handa
RE: Clarification on Liferay ext...
August 5, 2011 11:52 AM
Answer

Jeffrey Handa

LIFERAY STAFF

Rank: Expert

Posts: 345

Join Date: December 1, 2008

Recent Posts

Hi Hiran,

The EXT Plugin is used to extend or modify Liferay's core and not to create new applications or functionality.

Hiran Chaudhuri:
1) My idea is that portlet plugins may carry custom applications. What if this application requires some hooks?


Yes, portlet plugins can contain multiple portlet applications. A portlet plugin may also contain hooks. To see an example of this, take a look at the Social Networking Portlet.

Hiran Chaudhuri:
2) What is the recommended way to implement some data model (ServiceBuilder classes) that can be used in portlets and hooks likewise? Somehow I'm getting unsure about the classpath.


Services can be created in Portlet Plugins or Hook Plugins. If you are creating a Service that will be used by several different plugins (different .wars) there are two options.
1) Copy the service.jar that is created by Service Builder to each of the other plugin's lib directory.

2) Copy the service.jar to the app server's global classpath. If you do this, be sure to remove it form its original location in the plugin.

Hope this helps to clear things up for you.
Hiran Chaudhuri
RE: Clarification on Liferay ext...
August 19, 2011 4:00 PM
Answer

Hiran Chaudhuri

Rank: Regular Member

Posts: 172

Join Date: September 1, 2010

Recent Posts

Thank you all for those explanations. Seems like there are less problems about the plugins than I thought.
And I'm getting curious what can be done with ext.
;-)
Chris Jurado
RE: Clarification on Liferay ext...
August 25, 2011 11:34 AM
Answer

Chris Jurado

Rank: Junior Member

Posts: 37

Join Date: July 15, 2010

Recent Posts

Is it possible/practical to mix a hook plugin into an Ext plugin?

Here's what I'm trying to accomplish:

I have an Ext plugin that add Shibboleth auto login functionality to our Liferay 6 portal. I also have a Hook plugin that modifies the Authentication Setup page to allow the user to choose and Enable Shibboleth as well as specify the login attribute. The two plugins work great together but I'd like to be able to bundle and deploy them as a single artifact, since they're useless unless both are installed.

I also tried to just include the updated authentication.jsp file in the Ext plugin but I haven't had any success so far.