Overriding component's provided service in Liferay DXP - liferay

I'm new to developing for Liferay DXP and for OSGi.
When we were using Liferay 6.2, we used Spring to configure com.liferay.portal.security.ldap.PortalLDAPExporterUtil to use our class that implemented com.liferay.portal.security.ldap.PortalLDAPExporter, com.liferay.portal.security.ldap.PortalLDAPImporterUtil to use our class that implemented com.liferay.portal.security.ldap.PortalLDAPExporter, and implement our own com.liferay.portal.security.auth.Authenticator.
Now that we're using Liferay DXP, I've been able to change one of the services a module's component uses, but what do I do if I want to change the service a component provides? I notice that com.liferay.portal.security.ldap.internal.authenticator.LDAPAuth, com.liferay.portal.security.ldap.internal.exportimport.LDAPUserExporterImpl, and com.liferay.portal.security.ldap.internal.exportimport.LDAPUserImporterImpl are all components of the LDAP application's "Liferay Portal Security LDAP" module. I want to make sure my version of these things are used, instead of the LDAP's version. Is it possible to replace a module's component or the implementation of the service that component provides? Or do I need to replace the entire LDAP application with my own version?

Related

Hybris how to cache components?

Currently in my project we are caching methods using ehcache and Spring cache system, however I don't know which mechanism we should use to cache components like header, footer, banners etc...
Does Hybris provides a mechanism via XML to cache these components?
By default Hybris already caches CMS components using an EhCache region called cmsCacheRegion. You can find configuration for this bean in acceleratorcms-cache-spring.xml
This can be enabled/disabled with the property cms.cache.enabled. If using Cloud Commerce, this property will be enabled by default on storefront nodes.
If you would like to extend the CMS component types being cached, see bean defaultCacheKeyProviders in acceleratorcms-spring.xml. You should mostly be covered though as there's an entry for AbstractCMSComponent
Some more information here: https://help.sap.com/viewer/4c33bf189ab9409e84e589295c36d96e/2105/en-US/8abd87cc866910149aa5e52e716d568e.html?q=acceleratorcms

Websphere 8.0/MyFaces2.0 and PrimeFaces 6 not compatible?

I'm currently trying to use PrimeFaces (not mobile) for my WebSphere 8.0 application. The basic stuff like p:dataTable seems to work. But if I want to use the fancy stuff of PrimeFaces, like filter columns or pagination, there is either a NullPointerException or the additional function is not rendered at all.
The Nullpointer occurred when entering something in the generated filtering field in the table. The setter method that is called is given null as parameter.
The pagination on the other hand is not even being rendered. (I used the templates of the PrimeFace showcase)
Weird thing is, the sorting by column function is working fine.
I haven't done any big adjustments, just put the .jar file to my classpath and disabled all themes of PrimeFaces in my web.xml. That's it.
When I inspect the network and stuff in chrome there is no exception thrown in the console when loading the page.
Now I'm thinking that this version of PrimeFaces is not compatible with MyFaces2.0 that is used by WAS8.0.
Is that the case? If so, what version of PF would be compatible? Or would it be possible to load a newer Version of MyFaces and dependencies and put it in WAS to use this version instead of the current used version?
Or maybe I have to make some adjustments to my application?
If everything is not possible, do you know an alternative to PF to easily create tables?
Using a third-party JSF provider with WebSphere is documented here (the doc is for 8.5.5, but it's the same procedure in 8.0): https://www.ibm.com/support/knowledgecenter/en/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/tweb_jsf.html
Basically, the answer is to put your provider (along with the corresponding API) into a shared library, set that library to use an isolated class loader, and associate that shared library with your web app. That will tell the web module's class loader to search your shared library before it delegates to server class loaders, and it'll find your JSF provider first when your app attempts to use JSF.

extend liferay plugin functionality with hooks

Fairly new to Liferay. I learned it is possible to create plugins UI with different frameworks including JSF. Also I learned I can extend functionality of an existing plugin with hooks. Now I am curious if it is possible to add new JSF pages to an existing plugin which interface is build with JSP using hooks?
Suppose I want to extend dynamic data list portlet, add some new functionality and for this I need to add new pages.
Is it possible to add new pages in general?
Can I create a new plugin with JSF as a front end framework, implement the logic I want to add within JSF pages, would it be possible to redirect a user from an original JSP to those JSF pages, let user do something there and then return the user back to original dynamic_data_list JPSs?
If it is possible, how can I do this with Liferay 6.2?
Thanks
The mechanics are documented in the developer guide or the Wiki. It's not exactly a hook that you deploy to the running system, rather a development option to inject custom changes into existing plugins, and you deploy the modified version instead of the original one.
With this, you can do everything that you can add as extra feature this way (see the build process). Technically the answer to the first two bulletpoints is "yes". If the linked documentation doesn't help answering your third bulletpoint, please ask more specifically what actually doesn't work. But keep in mind that only core liferay is customizable with hooks, plugins are customizable at compile time - and not with hooks.

Does Liferay supports IPC for portlets on different pages?

In IBM Websphere for IPC, we have something called as Wiring which allows us to switch to the receiving portlet page in case you have your event receiving portlet to be on different page than that of source portlet.
I am wondering if there is any way to achieve this in Liferay.
I have also followed the link: Using JSR-268 IPC for portlets on different pages in Liferay but not clear about application-context.xml as I have created a simple Liferay plugin-portlet-project from Eclipse.
Yes it is possible. You just need to pass the Layout id, portlet id along with your parameters.
<liferay-renderURL var="varLink" plId="layout-id" portletName="portletName_WAR_WarName"/>
Wiring is Websphere Portal's concept.
Liferay is not supporting Wiring, but you can do Inter-portlet communication using public render parameters & portlet events ( in case of ACTION->View IPC).
In case when you need (VIEW->VIEW) IPC, you can use liferay's session sharing mechanism.
More details on my blog https://rutvijshah.wordpress.com/2009/12/13/liferay-session-sharing-made-easy/

Migrating from Java Page Flow to JSF

I am currently working on a project that uses WebLogic Portal and Apache Beehive Page Flow Controller.
The team would like to remove WebLogic Portal and the Page Flow Controllers with JSF. Currently we have not found a way to manage the workflow with JSF as with PFC.
With Spring MVC it would be easy because we only remove Beehive annotations using Spring MVC Annotations but we would like to go directly with JSF so later we can start using icefaces.
Any suggestions of where I can find information about what we want to do?
Thank you very much in advance.

Resources