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