001
014
015 package com.liferay.portal.verify;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portlet.calendar.model.CalEvent;
020 import com.liferay.portlet.calendar.service.CalEventLocalServiceUtil;
021
022 import java.util.List;
023
024
027 public class VerifyCalendar extends VerifyProcess {
028
029 @Override
030 protected void doVerify() throws Exception {
031 List<CalEvent> events = CalEventLocalServiceUtil.getNoAssetEvents();
032
033 if (_log.isDebugEnabled()) {
034 _log.debug(
035 "Processing " + events.size() + " events with no asset");
036 }
037
038 for (CalEvent event : events) {
039 try {
040 CalEventLocalServiceUtil.updateAsset(
041 event.getUserId(), event, null, null, null);
042 }
043 catch (Exception e) {
044 if (_log.isWarnEnabled()) {
045 _log.warn(
046 "Unable to update asset for event " +
047 event.getEventId() + ": " + e.getMessage());
048 }
049 }
050 }
051
052 if (_log.isDebugEnabled()) {
053 _log.debug("Assets verified for events");
054 }
055
056 }
057
058 private static Log _log = LogFactoryUtil.getLog(VerifyCalendar.class);
059
060 }