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(
36 "Processing " + pages.size() + " pages with no tags assets");
37 }
38
39 for (WikiPage page : pages) {
40 try {
41 WikiPageLocalServiceUtil.updateTagsAsset(
42 page.getUserId(), page, new String[0], new String[0]);
43 }
44 catch (Exception e) {
45 if (_log.isWarnEnabled()) {
46 _log.warn(
47 "Unable to update tags asset for page " +
48 page.getPageId() + ": " + e.getMessage());
49 }
50 }
51 }
52
53 if (_log.isDebugEnabled()) {
54 _log.debug("Tags assets verified for pages");
55 }
56 }
57
58 private static Log _log = LogFactoryUtil.getLog(VerifyWiki.class);
59
60 }