1
22
23 package com.liferay.portal.verify;
24
25 import com.liferay.portal.kernel.log.Log;
26 import com.liferay.portal.kernel.log.LogFactoryUtil;
27 import com.liferay.portlet.documentlibrary.model.DLFileEntry;
28 import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil;
29
30 import java.util.List;
31
32
37 public class VerifyDocumentLibrary extends VerifyProcess {
38
39 protected void doVerify() throws Exception {
40 List<DLFileEntry> fileEntries =
41 DLFileEntryLocalServiceUtil.getNoAssetFileEntries();
42
43 if (_log.isDebugEnabled()) {
44 _log.debug(
45 "Processing " + fileEntries.size() +
46 " file entries with no tags assets");
47 }
48
49 for (DLFileEntry fileEntry : fileEntries) {
50 try {
51 DLFileEntryLocalServiceUtil.updateTagsAsset(
52 fileEntry.getUserId(), fileEntry, new String[0],
53 new String[0]);
54 }
55 catch (Exception e) {
56 if (_log.isWarnEnabled()) {
57 _log.warn(
58 "Unable to update tags asset for file entry " +
59 fileEntry.getFileEntryId() + ": " + e.getMessage());
60 }
61 }
62 }
63
64 if (_log.isDebugEnabled()) {
65 _log.debug("Tags assets verified for file entries");
66 }
67 }
68
69 private static Log _log =
70 LogFactoryUtil.getLog(VerifyDocumentLibrary.class);
71
72 }