Fórum

Difference between hook/ext in normal plugin vs Liferay 7 OSGI ?

thumbnail
Sagar A Vyas, modificado 6 Anos atrás.

Difference between hook/ext in normal plugin vs Liferay 7 OSGI ?

Liferay Master Postagens: 679 Data de Entrada: 17/04/09 Postagens Recentes
Hi,

Trying to find answer but not getting neat answer.

What is major difference between develop a hook/ext in normal plugin vs Liferay 7 plugin (OSGI )? Trying to explore Liferay 7 DXP but did not get precise ans.

Anyone ?

Thanks,
Sagar Vyas
thumbnail
Olaf Kock, modificado 6 Anos atrás.

RE: Difference between hook/ext in normal plugin vs Liferay 7 OSGI ? (Resposta)

Liferay Legend Postagens: 6396 Data de Entrada: 23/09/08 Postagens Recentes
Sagar A Vyas:
What is major difference between develop a hook/ext in normal plugin vs Liferay 7 plugin (OSGI )? Trying to explore Liferay 7 DXP but did not get precise ans.


First the nitpicking: There's either Liferay 7 (CE) or Liferay DXP (supported). ;)

hooks are web applications, typically used in 6.2, that targeted very specific extension points in Liferay 6.2's core. As they're deployed as web applications, every use of a hook had to transcend those classloaders and pass control to a different web application. It was limited to extend whatever (core) component checked if there was an extension, then actively called it.

While hooks might still work in Liferay 7 and DXP: They only target the core. Many features have been extracted into individual modules. As they're no longer in core, hooks won't be active any more. However, all those individual modules are individual OSGi bundles and are implemented as declarative services (DS). These are inherently dynamic and can be wired a lot easier than hooks - that's the OSGi style of extending Liferay. Bonus: It's not limited to extending only the core functionality: All plugins are available for your extensions as well.

Ext is the somewhat maintainable version of patching Liferay's core - introducing your own code into Liferay without taking care of the API. It's the equivalent to introducing your own code into Liferay and recompiling without mixing your's and Liferay's code. In other words: Your changes are always separated out into your own ext-plugin. However, the build process then reveals a modified Liferay installation that you then have to deploy. There's no hot-deploy. And as you have access below the API level, even a small and single change in Liferay might break your ext. Thus ext is maintainable, because your changes are separated from Liferay's, but it's also hard to maintain because it might break any time Liferay has some kind of an upgrade.

If you start with Liferay 7 or DXP: Go the OSGi route. Try to get along without ext whenever possible. Ext was discontinued and reintroduced, and it will go away again soon.
thumbnail
Sagar A Vyas, modificado 6 Anos atrás.

RE: Difference between hook/ext in normal plugin vs Liferay 7 OSGI ?

Liferay Master Postagens: 679 Data de Entrada: 17/04/09 Postagens Recentes
Well Olaf , to be honest I was not expecting answer better than this, really nice explanation , thanks for taking time to answer this.

So shall I conclude - Liferay DXP is nothing but Liferay 7 EE version ?

And now Liferay 7 DXP all functionality build in OSGI modules and DS ? and do you have any link or something which tells me what exactly require to create hook in LIferay DXP ( or this is same way we used on have till 6.2 ?)

My client is using 6.2 EE version and I am preparing one documentation for them so that they will understand benefits of moving to Liferay 7 DXP.

Thanks,
Sagar Vyas
thumbnail
Olaf Kock, modificado 6 Anos atrás.

RE: Difference between hook/ext in normal plugin vs Liferay 7 OSGI ? (Resposta)

Liferay Legend Postagens: 6396 Data de Entrada: 23/09/08 Postagens Recentes
Sagar A Vyas:
So shall I conclude - Liferay DXP is nothing but Liferay 7 EE version ?


Exactly, DXP (and "Digital Enterprise") is the "new name" for the enterprise offering parallel to Liferay 7 (CE)

Sagar A Vyas:
And now Liferay 7 DXP all functionality build in OSGI modules and DS ? and do you have any link or something which tells me what exactly require to create hook in LIferay DXP ( or this is same way we used on have till 6.2 ?)


I'd recommend not to create a hook in DXP, rather go with OSGi DS all the way. As you're coming from 6.2, start with what the upgrade wizard leaves you with, strive to go full OSGi asap. It's the most flexible way, truly hot-deployable without jumping through hoops. Documentation is on https://dev.liferay.com, or on https://customer.liferay.com for DXP specifics that are not contained in Liferay7

Sagar A Vyas:
My client is using 6.2 EE version and I am preparing one documentation for them so that they will understand benefits of moving to Liferay 7 DXP.

Liferay Sales probably has material that can help with those arguments.
thumbnail
Sagar A Vyas, modificado 6 Anos atrás.

RE: Difference between hook/ext in normal plugin vs Liferay 7 OSGI ?

Liferay Master Postagens: 679 Data de Entrada: 17/04/09 Postagens Recentes
Thank you Olaf ,

Documentation is on https://dev.liferay.com, or on https://customer.liferay.com for DXP specifics that are not contained in Liferay7


second URL is not working some how (https://customer.liferay.com ) , it is temporary down ?

Thanks,
Sagar V
thumbnail
Olaf Kock, modificado 6 Anos atrás.

RE: Difference between hook/ext in normal plugin vs Liferay 7 OSGI ?

Liferay Legend Postagens: 6396 Data de Entrada: 23/09/08 Postagens Recentes
Works for me (tested just now), requires DXP customer login though. The basic documentation (the one that addresses your question) is available at dev.liferay.com though, the other server only has documentation for DXP-only features in addition to the basic documentation.