001
014
015 package com.liferay.portal.verify;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portlet.wiki.model.WikiPage;
020 import com.liferay.portlet.wiki.service.WikiPageLocalServiceUtil;
021
022 import java.util.List;
023
024
027 public class VerifyWiki extends VerifyProcess {
028
029 @Override
030 protected void doVerify() throws Exception {
031 List<WikiPage> pages = WikiPageLocalServiceUtil.getNoAssetPages();
032
033 if (_log.isDebugEnabled()) {
034 _log.debug("Processing " + pages.size() + " pages with no asset");
035 }
036
037 for (WikiPage page : pages) {
038 try {
039 WikiPageLocalServiceUtil.updateAsset(
040 page.getUserId(), page, null, null, null);
041 }
042 catch (Exception e) {
043 if (_log.isWarnEnabled()) {
044 _log.warn(
045 "Unable to update asset for page " + page.getPageId() +
046 ": " + e.getMessage());
047 }
048 }
049 }
050
051 if (_log.isDebugEnabled()) {
052 _log.debug("Assets verified for pages");
053 }
054 }
055
056 private static Log _log = LogFactoryUtil.getLog(VerifyWiki.class);
057
058 }