1

I am trying to upgrade our companys Ext-Plugin from version 6.2.5 CE to 7.2 CE.

We used to override the following classes in the old version: PortalImpl, CASFilter, AutoLoginFilter and several CMIS classes.

For PortalImpl I simply did another EXT (using the blade 'war-core-ext' template) and it works fine. But for the other classes there is no indication that the overridden classes get called. For example I tried overrwriting AutoLoginFilter (which also resides in Portal-Impl.jar and in my extImpl Folders in the Ext-Plugin), but does not seem to be calling getLoginRemoteUser() as evident by the lack of logs being called)

public class AutoLoginFilterExt extends AutoLoginFilter {

@Override
protected String getLoginRemoteUser(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, HttpSession session, String[] credentials) throws Exception {
   _log.info("getLoginRemoteUser");

I also added this definition for my classes in ext-spring.xml

<bean class="com.liferay.portal.util.PortalImplExt"
      id="com.liferay.portal.util.Portal"/>
<bean class="com.liferay.portal.servlet.filters.sso.cas.CASFilterExt"
      id="com.liferay.portal.servlet.filters.sso.cas.CASFilterExt"/>
<bean class="com.liferay.portal.servlet.filters.autologin.AutoLoginFilterExt"
      id="com.liferay.portal.servlet.filters.autologin.AutoLoginFilterExt"/>

Do i need to use a different approach, like a Service-Wrapper or a different template? If so, which one should i use? Would someone be so kind as to shove me in the right direction please?

Kind regards, Christopher

Victor
  • 3,520
  • 3
  • 38
  • 58

1 Answers1

0

Just because you implemented a customization in ext in 6.2 doesn't mean that it'll have to stay there in later versions. In fact, I'd recommend to work hard to get along without any core modification, as it tends to be hard to maintain (as you see).

Instead, my recommendation is to let us know what modifications you need (and have implemented - show code) and check what other alternatives are available.

If this goes beyond the level of "this code exposes the following problem", such questions might be out-of-focus for stackoverflow, but the Liferay Forums might be able to help. An AutoLoginFilter sounds like something that I wouldn't waste any ext thoughts about. And even for the change to PortalImpl I'd look for alternatives to achieve the same functionality through a different implementation.

Further more: ext plugins are destined to go away, or to shrink further and further as ext only modifies the (shrinking) core. If you truly have something that should be extensible through a plugin, please file an issue on https://issues.liferay.com (project LPS) with your exact usecase, rationale for the change, so that there's a chance for a proper extension point once ext goes away for good. Liferay relies on such feedback in order to introduce the proper extension points.

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90