Fórum

New Action for Plugin that Extends Notification Plugin

Vasilios Kaloidis, modificado 7 Anos atrás.

New Action for Plugin that Extends Notification Plugin

New Member Postagens: 11 Data de Entrada: 18/07/16 Postagens Recentes
Hello,

So my goal here is to add a new button to our liferay Notifications CE Plugin - a Delete All button.

My issue is this - I can succesfully modify the view.jsp to and main.js file to add the frontend code for my new feature, but I need to add an extra method to the NotificationsPortlet.java file - a deleteAll(). After some review, I beleive that the only way to do this is with an EXT plugin, which I wanted to avoid.

Before going down the EXT-Plugin route - I tried getting this to work with my regular plugin-extension. I tried adding the NotificationsPortlet.java that I want to override, in the same folder-structure as the target that I want to override, and I have added the extra method in my copy, but when I run "ant war", I get dependency errors ofcourse.

How should I go about proceeding? Can I avoid having to create an EXT Plugin, because I think that would be "overkill" in my situation. Thanks in advance!

Vas
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: New Action for Plugin that Extends Notification Plugin

Liferay Legend Postagens: 14918 Data de Entrada: 02/09/06 Postagens Recentes
The NotificationsPortlet.java file is not part of the core so EXT will never get you there.

Plugin extending a plugin concept is still the way to go. In your plugin, though, you're going to copy the NotificationsPortlet.java file from the plugin source into the same package in your project. In that class, you're going to add your deleteAll() method.

When you build your plugin, your NoficationsPortlet class will replace the one from the original and you get your deleteAll() method without any sort of EXT nonsense.






Come meet me at the NAS!
Vasilios Kaloidis, modificado 7 Anos atrás.

RE: New Action for Plugin that Extends Notification Plugin

New Member Postagens: 11 Data de Entrada: 18/07/16 Postagens Recentes
Hey David,

I actually tried that - but an error happens when I run the “ant war” command and it attempts to compile my original plugin project before combining my plugin-override files with the notifications-plugin JAR. So a dependency error occurs.

My source code is on GH - https://github.com/vaskaloidis/liferay-notifications-extension-portlet

Thanks in advance for your help.
Vas
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: New Action for Plugin that Extends Notification Plugin

Liferay Legend Postagens: 14918 Data de Entrada: 02/09/06 Postagens Recentes
Hey, Vasilios, what version of Liferay and the SDK are you using?

I just dropped your project into my local 6.2 CE GA6 SDK and did "ant war" and it worked just fine. Checked the dist war file and the changed java file is in there along with the changed class.






Come meet me at the NAS!
Vasilios Kaloidis, modificado 7 Anos atrás.

RE: New Action for Plugin that Extends Notification Plugin

New Member Postagens: 11 Data de Entrada: 18/07/16 Postagens Recentes
I am using 6.2 CE GA5 SDK - I will give it a shot with GA6
Vasilios Kaloidis, modificado 7 Anos atrás.

RE: New Action for Plugin that Extends Notification Plugin

New Member Postagens: 11 Data de Entrada: 18/07/16 Postagens Recentes
FYI the SourceForge link for Liferay 6.2 Portal GA6 actually downloads Liferay 7 ga2 instead. The LR 6.2 GA6 SDK Download is correct though.
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: New Action for Plugin that Extends Notification Plugin

Liferay Legend Postagens: 14918 Data de Entrada: 02/09/06 Postagens Recentes
Geez, I don't even know who to contact about that, but I'll see what I can do...

Which link are you referring to?





Come meet me at the NAS!