Foren

Ext with maven

thumbnail
Andreas Lecerof, geändert vor 7 Jahren.

Ext with maven

Junior Member Beiträge: 36 Beitrittsdatum: 14.02.13 Neueste Beiträge
Since Liferay doesn't want to backport LPS-43579 (solved in 7.0) I'm trying to solve this with an ext plugin (in Liferay 6.2). The issue is about showing the blog entry's title in the outgoing email for subscribers.

I've tried to follow this page and I have extended com.liferay.portlet.blogs.service.impl.BlogsEntryLocalServiceImpl.java with my class com.liferay.portlet.blogs.service.impl.UUBlogsEntryLocalServiceImpl.java

Then I've created a ext-spring.xml according to this page:
<bean id="com.liferay.portlet.blogs.service.BlogsEntryLocalService" class="com.liferay.portlet.blogs.service.impl.UUBlogsEntryLocalServiceImpl" />
Some say the file should be in ext-impl/src/META-INF folder and others say in ext-impl/src/main/resources/META-INF folder.

I'm using maven to creating an ext plugin following the instructions on this page.

From the ext folder (my folder's name is UU-Blogs-ext) I'm running mvn clean package liferay:deploy and then I can read in catalina.out
15:20:14,778 INFO [localhost-startStop-1][ExtHotDeployListener:122] Registering extension environment for UU-Blogs-ext
15:20:14,778 INFO [localhost-startStop-1][ExtHotDeployListener:128] Extension environment for UU-Blogs-ext has been applied.
I restart Liferay - and I can see UU-Blogs is deployed to webapps, but my extended class is not used.

What am I doing wrong here? Any advice how to implement and deploy the ext plugin?
thumbnail
Olaf Kock, geändert vor 7 Jahren.

RE: Ext with maven

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
Andreas Lecerof:
Since Liferay doesn't want to backport LPS-43579 (solved in 7.0) I'm trying to solve this with an ext plugin (in Liferay 6.2). The issue is about showing the blog entry's title in the outgoing email for subscribers.
...
What am I doing wrong here? Any advice how to implement and deploy the ext plugin?

Long Distance Debugging is always hard. However, the commit that you link looks like the change can easily be introduced in a hook. This will make it easier to maintain and debug.
thumbnail
Andreas Lecerof, geändert vor 7 Jahren.

RE: Ext with maven

Junior Member Beiträge: 36 Beitrittsdatum: 14.02.13 Neueste Beiträge
Hi Olaf!
(Thank's for DevCon - it was great!)
Is it really possible to replace the class com.liferay.portlet.blogs.service.impl.BlogsEntryLocalServiceImpl.java
- it's in portal-impl.jar - with my own class by specifying/implementing this in a hook?
If it's possible in a hook I would prefer that of course. Do you have any links to an example?
thumbnail
Olaf Kock, geändert vor 7 Jahren.

RE: Ext with maven (Antwort)

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
Andreas Lecerof:
(Thank's for DevCon - it was great!)

Thanks for making it great

Andreas Lecerof:
Is it really possible to replace the class com.liferay.portlet.blogs.service.impl.BlogsEntryLocalServiceImpl.java
- it's in portal-impl.jar - with my own class by specifying/implementing this in a hook?

You can't replace it from a hook, but you can wrap it. Look up ServiceWrapper: This intercepts all calls to the original service and you can decide for yourself if you call the default implementation (by delegating to super.doSomething()) or if you handle everything yourself. Naturally this has its limits when the original implementation of a method calls non-API methods or classes. Decide for yourself if duplicating this code helps or hinders maintainability.
thumbnail
Andreas Lecerof, geändert vor 7 Jahren.

RE: Ext with maven

Junior Member Beiträge: 36 Beitrittsdatum: 14.02.13 Neueste Beiträge
Thank you Olaf I will try that, I found some documentation also.
Duplicating some code seems necessary but the users really want this feature so
I guess it's worth it.