Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Rochad Tlusty
Replace MailingListMessageListener class
November 6, 2012 11:51 AM
Answer

Rochad Tlusty

Rank: Junior Member

Posts: 42

Join Date: January 18, 2012

Recent Posts

I would like to modify the class com.liferay.portlet.messageboards.messaging.MailingListMessageListener. Is it possible to do this in a hook?
Rishi Dev Gupta
RE: Replace MailingListMessageListener class
November 7, 2012 2:15 AM
Answer

Rishi Dev Gupta

Rank: Expert

Posts: 255

Join Date: November 23, 2008

Recent Posts

I do not think so that can be done through hook.

You will need to have plugin ext for this.
Rochad Tlusty
RE: Replace MailingListMessageListener class
November 7, 2012 9:37 AM
Answer

Rochad Tlusty

Rank: Junior Member

Posts: 42

Join Date: January 18, 2012

Recent Posts

I'm now working on replacing this is the ext environment. I've added the following entry to our ext-spring.xml file for the project:

1
2    <bean id="messageListener.message_boards_mailing_list" class="com.liferay.portal.kernel.scheduler.messaging.SchedulerEventMessageListenerWrapper">
3            <property name="groupName" value="my.custom.MailingListMessageListener" />
4            <property name="jobName" value="my.custom.MailingListMessageListener" />
5            <property name="messageListener">
6                    <bean class="my.custom.MailingListMessageListener" />
7            </property>
8    </bean>


I added a small print statement to the class, however I never see an output, which leads me to believe the class is never loaded. Does anyone know how I can properly replace this class?
Rochad Tlusty
RE: Replace MailingListMessageListener class
November 9, 2012 1:37 PM
Answer

Rochad Tlusty

Rank: Junior Member

Posts: 42

Join Date: January 18, 2012

Recent Posts

I actually get errors when I try to set the groupName or jobName. When I remove those settings, there are no more errors, but the custom class is not loaded. Any help here?
Rochad Tlusty
RE: Replace MailingListMessageListener class
November 14, 2012 6:28 AM
Answer

Rochad Tlusty

Rank: Junior Member

Posts: 42

Join Date: January 18, 2012

Recent Posts

Maybe some help from the liferay devs? Any help would be appreciated.
Rishi Dev Gupta
RE: Replace MailingListMessageListener class
November 16, 2012 4:24 AM
Answer

Rishi Dev Gupta

Rank: Expert

Posts: 255

Join Date: November 23, 2008

Recent Posts

I did this in Liferay 5, at the time most of the changes were done by overriding the class in ext. Thats is only the last resort.

1
2<bean id="messageListener.message_boards_mailing_list" class="com.liferay.portal.kernel.scheduler.messaging.SchedulerEventMessageListenerWrapper">
3        <property name="groupName" value="com.liferay.portlet.messageboards.messaging.MailingListMessageListener" />
4        <property name="jobName" value="com.liferay.portlet.messageboards.messaging.MailingListMessageListener" />
5        <property name="messageListener">
6            <bean class="com.liferay.portlet.messageboards.messaging.MailingListMessageListener" />
7        </property>
8    </bean>


In the ext-spring.xml, just try changing only the bean class, ignoring the change for groupName, jobName.

Also add a debug on SchedulerEventMessageListenerWrapper class and see if the bean is registered properly or were is it broking, so that you can make the changesin configuration accordingly.
Rochad Tlusty
RE: Replace MailingListMessageListener class
December 19, 2012 7:30 AM
Answer

Rochad Tlusty

Rank: Junior Member

Posts: 42

Join Date: January 18, 2012

Recent Posts

Thank you Rishi.