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