Fórum

Proper SQL To Mass Expire Web Content...

Philip Barta, modificado 12 Anos atrás.

Proper SQL To Mass Expire Web Content...

Junior Member Postagens: 57 Data de Entrada: 21/01/10 Postagens Recentes
We have 70+ pieces of web content that we need to expire. We were hoping to avoid expiring each piece of web content one by one using the control panel expire button. We tried the following query (basically setting the JournalArticle status to 3) but it causes exceptions within the Asset Publisher that is pulling the associated web content to display:

UPDATE JournalArticle
SET expirationDate = '2011-09-01 00:00:00.000'
,status = 3
,statusbyUserId = '10418'
,statusbyUserName = 'testuser'
WHERE articleId IN
(10533,10642,10698,10707,10998,11622,12211,12226,12295,12313,13133,13414,13449,13494,13511,
13521,13725,13739,13999,14272,14627,14885,14923,15198,15406,17014,17657,17689,17699,17864,17922,
18719,18728,19128,22549,22562,22575,23015,23028,23041,23074,23087,23100,23613,24856,25275,
25286,25298,25416,25425,25434,25443,25452,25461,25472,25481,25490,25503,25544,25555,25564,
25575,25584,26348,26362,26381,26397,26416,26426,26435,26451,26471,26480,26862)


2011-09-06 20:14:46,728 ERROR [com.liferay.taglib.util.IncludeTag] (http-0.0.0.0-8080-13) Current URL /home generates exception: An exception occurred processing JSP page /html/portlet/asset_publisher/view_dynamic_list_asset.jspf at line 30

27: continue;
28: }
29:
30: AssetRenderer assetRenderer = assetRendererFactory.getAssetRenderer(classPK);
31:
32: String title = assetEntry.getTitle();
33:


Stacktrace:
2011-09-06 20:14:46,728 ERROR [com.liferay.taglib.util.IncludeTag] (http-0.0.0.0-8080-13) com.liferay.portlet.journal.NoSuchArticleException: No JournalArticle with the key {groupId=10157, articleId=25564, status=0}
at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.getLatestArticle(JournalArticleLocalServiceImpl.java:1255)
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:86)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)........
thumbnail
Hitoshi Ozawa, modificado 12 Anos atrás.

RE: Proper SQL To Mass Expire Web Content...

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
Doing a manual update on Liferay database seems to be asking for trouble. I'm using web service to update.

Just tested your situation. It's erroring at getLatestArticle() because there's not row with status=0.
When you revert back your data, be sure to stop liferay application server and delete application server cache or the error may persist.