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