Foren

Web Content Review Date?

thumbnail
Adam Spence, geändert vor 11 Jahren.

Web Content Review Date?

New Member Beiträge: 21 Beitrittsdatum: 26.08.11 Neueste Beiträge
Hello all,

For the past week I have been attempting to get email notifications for web content review dates working. I'm talking about the default Liferay review date functionality for web content, under the "Schedule" section, not review notifications for Kaleo Workflow. I've unfortunately been able to find very little documentation on this. I've set several relevant portal properties, and my Liferay instance is successfully able to send email in other cases.

I could use some help with this is anyone has any experience. If you've successfully gotten web content review email notifications working or can point me to some thorough documentation, I'd really appreciate it.

Here is the documentation I've been able to find:

http://issues.liferay.com/browse/LEP-3500?focusedCommentId=29142&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-29142

https://www.liferay.com/documentation/liferay-portal/6.0/administration/-/ai/advanced-liferay-configurati-4

Thanks & Regards,
Adam
thumbnail
Hitoshi Ozawa, geändert vor 11 Jahren.

RE: Web Content Review Date?

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
You haven't specified which version of liferay you are using.

Have you seen the following issue? "WebContent Expiration Date and Review Date don't work"

http://issues.liferay.com/browse/LPS-14683
http://issues.liferay.com/browse/LPS-12119
thumbnail
Adam Spence, geändert vor 11 Jahren.

RE: Web Content Review Date?

New Member Beiträge: 21 Beitrittsdatum: 26.08.11 Neueste Beiträge
Hitoshi,

I'm using 6.1 EE GA1. I was able to figure out that my problem was being caused by improperly-configured timezones. My hook which overrides the default review email functionality works successfully. However, I was trying to get the default Liferay review functionality(without my hook deployed) working, I'm getting this stacktrace:


08:41:30,108 ERROR [ParallelDestination:111] Unable to process message {destinationName=liferay/scheduler_dispatch, response=null, responseDestinationName=null, responseId=null, payload=nul
l, values={principalPassword=null, JOB_NAME=com.liferay.portlet.journal.messaging.CheckArticleMessageListener, EXCEPTIONS_MAX_SIZE=0, CONTEXT_PATH=, principalName=null, GROUP_NAME=com.lifer
ay.portlet.journal.messaging.CheckArticleMessageListener, DESTINATION_NAME=liferay/scheduler_dispatch, JOB_STATE=com.liferay.portal.kernel.scheduler.JobState@c4bb7c, companyId=0, RECEIVER_K
EY=com.liferay.portlet.journal.messaging.CheckArticleMessageListener.com.liferay.portlet.journal.messaging.CheckArticleMessageListener, MESSAGE_LISTENER_UUID=ec97a91d-a340-4331-845d-33b7de6
a3e8c}}
com.liferay.portal.kernel.messaging.MessageListenerException: java.lang.NullPointerException
at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:54)
at $Proxy293.receive(Unknown Source)
at com.liferay.portal.kernel.scheduler.messaging.SchedulerEventMessageListenerWrapper.receive(SchedulerEventMessageListenerWrapper.java:77)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:63)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:108)
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:669)
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:580)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at com.liferay.portal.kernel.util.Tuple.hashCode(Tuple.java:63)
at java.util.HashMap.get(HashMap.java:300)
at com.liferay.portal.util.LocalizationImpl._getCachedValue(LocalizationImpl.java:791)
at com.liferay.portal.util.LocalizationImpl.getLocalization(LocalizationImpl.java:98)
at com.liferay.portal.util.LocalizationImpl.getLocalization(LocalizationImpl.java:92)
at com.liferay.portal.kernel.util.LocalizationUtil.getLocalization(LocalizationUtil.java:58)
at com.liferay.portlet.journal.model.impl.JournalArticleModelImpl.getTitle(JournalArticleModelImpl.java:493)
at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.sendEmail(JournalArticleLocalServiceImpl.java:3210)
at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.checkArticles(JournalArticleLocalServiceImpl.java:458)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:112)
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:59)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:59)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
at $Proxy219.checkArticles(Unknown Source)
at com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil.checkArticles(JournalArticleLocalServiceUtil.java:362)
at com.liferay.portlet.journal.messaging.CheckArticleMessageListener.doReceive(CheckArticleMessageListener.java:30)
at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:25)
... 12 more


It appears that it can't find the localization for the title of the article? Do you have any idea about this?

Thanks,
Adam
thumbnail
Hitoshi Ozawa, geändert vor 11 Jahren.

RE: Web Content Review Date?

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
Please create a new thread for a new question because the forum is also used as a reference.

Anyways, I think your new question has already been answered several time in the forum before.
Sandrine Dullier, geändert vor 11 Jahren.

RE: Web Content Review Date?

New Member Beiträge: 3 Beitrittsdatum: 30.03.12 Neueste Beiträge
Adam Spence:


I'm using 6.1 EE GA1. I was able to figure out that my problem was being caused by improperly-configured timezones. My hook which overrides the default review email functionality works successfully. However, I was trying to get the default Liferay review functionality(without my hook deployed) working, I'm getting this stacktrace:

Adam


Hi Adam,

we are using Liferay 6.1 EE GA2, and we are confronted to the same problem.

We are really curious about your hook, can you give us more details about your solution ?

Regards,
Sandrine
thumbnail
Adam Spence, geändert vor 11 Jahren.

RE: Web Content Review Date?

New Member Beiträge: 21 Beitrittsdatum: 26.08.11 Neueste Beiträge
Sandrine,

Basically, my solution is to override the default Liferay service for journal articles. So in this case, your class will be extending JournalArticleLocalServiceWrapper. You need to override the sendEmail() method(see JournalArticleLocalServiceImpl.java for the default method implementation). Since it is a protected method, you will unfortunately have to duplicate the code and change it to use the non-internal Liferay API in some cases. When you must use the internal API, you can use PortalClassInvoker.invoke(), although it is a bit of a hassle and not very elegant.

Anyway, the problem stems from this method call(beginning at line 3208 in JournalArticleLocalServiceImpl.java):

	subscriptionSender.setContextAttributes(
			"[$ARTICLE_ID$]", article.getArticleId(), "[$ARTICLE_TITLE$]",
			article.getTitle(serviceContext.getLanguageId()), "[$ARTICLE_URL$]",
			articleURL, "[$ARTICLE_USER_NAME$]", article.getUserName(),
			"[$ARTICLE_VERSION$]", article.getVersion());


If you replace article.getTitle(serviceContext.getLanguageId()) with article.getTitleCurrentValue(), it should solve the problem.

So yeah, a bit of a hassle for something that should be working out of the box emoticon

Cheers,
Adam
thumbnail
Adam Spence, geändert vor 11 Jahren.

RE: Web Content Review Date?

New Member Beiträge: 21 Beitrittsdatum: 26.08.11 Neueste Beiträge
Sandrine,

I forgot to mention, you also need to override the checkArticles() method so that it will call your version of sendEmail().

Also, I'm not sure if it's possible to get around the code duplication by putting your class in the same Java package as JournalArticleLocalServiceImpl so you have access to the protected methods. By the time that possibility occurred to me, I was basically done with my implementation.

Let me know if you have any questions.

Cheers,
Adam
Ranjith Narahari, geändert vor 8 Jahren.

RE: Web Content Review Date?

New Member Beiträge: 21 Beitrittsdatum: 23.01.13 Neueste Beiträge
Hi Adam,

I want to customize the sendEmail method of JournalArticleLocalServiceImpl.java
Could you please provide the sample modified code snippet.

Thanks & Regards,
Ranjith Narahari