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 }
54 catch (Exception e) {
55 if (_log.isWarnEnabled()) {
56 _log.warn(
57 "Unable to update tags asset for file entry " +
58 fileEntry.getFileEntryId() + ": " + e.getMessage());
59 }
60 }
61 }
62
63 if (_log.isDebugEnabled()) {
64 _log.debug("Tags assets verified for file entries");
65 }
66 }
67
68 private static Log _log =
69 LogFactoryUtil.getLog(VerifyDocumentLibrary.class);
70
71 }