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.blogs.model.BlogsEntry;
20 import com.liferay.portlet.blogs.service.BlogsEntryLocalServiceUtil;
21
22 import java.util.List;
23
24
29 public class VerifyBlogs extends VerifyProcess {
30
31 protected void doVerify() throws Exception {
32 List<BlogsEntry> entries =
33 BlogsEntryLocalServiceUtil.getNoAssetEntries();
34
35 if (_log.isDebugEnabled()) {
36 _log.debug(
37 "Processing " + entries.size() + " entries with no asset");
38 }
39
40 for (BlogsEntry entry : entries) {
41 try {
42 BlogsEntryLocalServiceUtil.updateAsset(
43 entry.getUserId(), entry, null, null);
44 }
45 catch (Exception e) {
46 if (_log.isWarnEnabled()) {
47 _log.warn(
48 "Unable to update asset for entry " +
49 entry.getEntryId() + ": " + e.getMessage());
50 }
51 }
52 }
53
54 if (_log.isDebugEnabled()) {
55 _log.debug("Assets verified for entries");
56 }
57 }
58
59 private static Log _log = LogFactoryUtil.getLog(VerifyBlogs.class);
60
61 }