1
14
15 package com.liferay.portal.verify;
16
17 import com.liferay.portal.kernel.log.Log;
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
19 import com.liferay.portlet.wiki.model.WikiPage;
20 import com.liferay.portlet.wiki.service.WikiPageLocalServiceUtil;
21
22 import java.util.List;
23
24
29 public class VerifyWiki extends VerifyProcess {
30
31 protected void doVerify() throws Exception {
32 List<WikiPage> pages = WikiPageLocalServiceUtil.getNoAssetPages();
33
34 if (_log.isDebugEnabled()) {
35 _log.debug("Processing " + pages.size() + " pages with no asset");
36 }
37
38 for (WikiPage page : pages) {
39 try {
40 WikiPageLocalServiceUtil.updateAsset(
41 page.getUserId(), page, null, null);
42 }
43 catch (Exception e) {
44 if (_log.isWarnEnabled()) {
45 _log.warn(
46 "Unable to update asset for page " + page.getPageId() +
47 ": " + e.getMessage());
48 }
49 }
50 }
51
52 if (_log.isDebugEnabled()) {
53 _log.debug("Assets verified for pages");
54 }
55 }
56
57 private static Log _log = LogFactoryUtil.getLog(VerifyWiki.class);
58
59 }