001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portlet.calendar.service.base;
022:
023: import com.liferay.counter.service.CounterLocalService;
024: import com.liferay.counter.service.CounterLocalServiceFactory;
025: import com.liferay.counter.service.CounterService;
026: import com.liferay.counter.service.CounterServiceFactory;
027:
028: import com.liferay.mail.service.MailService;
029: import com.liferay.mail.service.MailServiceFactory;
030:
031: import com.liferay.portal.SystemException;
032: import com.liferay.portal.kernel.dao.DynamicQueryInitializer;
033: import com.liferay.portal.service.CompanyLocalService;
034: import com.liferay.portal.service.CompanyLocalServiceFactory;
035: import com.liferay.portal.service.CompanyService;
036: import com.liferay.portal.service.CompanyServiceFactory;
037: import com.liferay.portal.service.PortletPreferencesLocalService;
038: import com.liferay.portal.service.PortletPreferencesLocalServiceFactory;
039: import com.liferay.portal.service.ResourceLocalService;
040: import com.liferay.portal.service.ResourceLocalServiceFactory;
041: import com.liferay.portal.service.ResourceService;
042: import com.liferay.portal.service.ResourceServiceFactory;
043: import com.liferay.portal.service.UserLocalService;
044: import com.liferay.portal.service.UserLocalServiceFactory;
045: import com.liferay.portal.service.UserService;
046: import com.liferay.portal.service.UserServiceFactory;
047: import com.liferay.portal.service.persistence.CompanyPersistence;
048: import com.liferay.portal.service.persistence.CompanyUtil;
049: import com.liferay.portal.service.persistence.PortletPreferencesFinder;
050: import com.liferay.portal.service.persistence.PortletPreferencesFinderUtil;
051: import com.liferay.portal.service.persistence.PortletPreferencesPersistence;
052: import com.liferay.portal.service.persistence.PortletPreferencesUtil;
053: import com.liferay.portal.service.persistence.ResourceFinder;
054: import com.liferay.portal.service.persistence.ResourceFinderUtil;
055: import com.liferay.portal.service.persistence.ResourcePersistence;
056: import com.liferay.portal.service.persistence.ResourceUtil;
057: import com.liferay.portal.service.persistence.UserFinder;
058: import com.liferay.portal.service.persistence.UserFinderUtil;
059: import com.liferay.portal.service.persistence.UserPersistence;
060: import com.liferay.portal.service.persistence.UserUtil;
061:
062: import com.liferay.portlet.calendar.model.CalEvent;
063: import com.liferay.portlet.calendar.model.impl.CalEventImpl;
064: import com.liferay.portlet.calendar.service.CalEventLocalService;
065: import com.liferay.portlet.calendar.service.persistence.CalEventFinder;
066: import com.liferay.portlet.calendar.service.persistence.CalEventFinderUtil;
067: import com.liferay.portlet.calendar.service.persistence.CalEventPersistence;
068: import com.liferay.portlet.calendar.service.persistence.CalEventUtil;
069:
070: import org.springframework.beans.factory.InitializingBean;
071:
072: import java.util.List;
073:
074: /**
075: * <a href="CalEventLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
076: *
077: * @author Brian Wing Shun Chan
078: *
079: */
080: public abstract class CalEventLocalServiceBaseImpl implements
081: CalEventLocalService, InitializingBean {
082: public CalEvent addCalEvent(CalEvent model) throws SystemException {
083: CalEvent calEvent = new CalEventImpl();
084:
085: calEvent.setNew(true);
086:
087: calEvent.setUuid(model.getUuid());
088: calEvent.setEventId(model.getEventId());
089: calEvent.setGroupId(model.getGroupId());
090: calEvent.setCompanyId(model.getCompanyId());
091: calEvent.setUserId(model.getUserId());
092: calEvent.setUserName(model.getUserName());
093: calEvent.setCreateDate(model.getCreateDate());
094: calEvent.setModifiedDate(model.getModifiedDate());
095: calEvent.setTitle(model.getTitle());
096: calEvent.setDescription(model.getDescription());
097: calEvent.setStartDate(model.getStartDate());
098: calEvent.setEndDate(model.getEndDate());
099: calEvent.setDurationHour(model.getDurationHour());
100: calEvent.setDurationMinute(model.getDurationMinute());
101: calEvent.setAllDay(model.getAllDay());
102: calEvent.setTimeZoneSensitive(model.getTimeZoneSensitive());
103: calEvent.setType(model.getType());
104: calEvent.setRepeating(model.getRepeating());
105: calEvent.setRecurrence(model.getRecurrence());
106: calEvent.setRemindBy(model.getRemindBy());
107: calEvent.setFirstReminder(model.getFirstReminder());
108: calEvent.setSecondReminder(model.getSecondReminder());
109:
110: return calEventPersistence.update(calEvent);
111: }
112:
113: public List dynamicQuery(DynamicQueryInitializer queryInitializer)
114: throws SystemException {
115: return calEventPersistence
116: .findWithDynamicQuery(queryInitializer);
117: }
118:
119: public List dynamicQuery(DynamicQueryInitializer queryInitializer,
120: int begin, int end) throws SystemException {
121: return calEventPersistence.findWithDynamicQuery(
122: queryInitializer, begin, end);
123: }
124:
125: public CalEvent updateCalEvent(CalEvent model)
126: throws SystemException {
127: return calEventPersistence.update(model, true);
128: }
129:
130: public CalEventPersistence getCalEventPersistence() {
131: return calEventPersistence;
132: }
133:
134: public void setCalEventPersistence(
135: CalEventPersistence calEventPersistence) {
136: this .calEventPersistence = calEventPersistence;
137: }
138:
139: public CalEventFinder getCalEventFinder() {
140: return calEventFinder;
141: }
142:
143: public void setCalEventFinder(CalEventFinder calEventFinder) {
144: this .calEventFinder = calEventFinder;
145: }
146:
147: public CounterLocalService getCounterLocalService() {
148: return counterLocalService;
149: }
150:
151: public void setCounterLocalService(
152: CounterLocalService counterLocalService) {
153: this .counterLocalService = counterLocalService;
154: }
155:
156: public CounterService getCounterService() {
157: return counterService;
158: }
159:
160: public void setCounterService(CounterService counterService) {
161: this .counterService = counterService;
162: }
163:
164: public MailService getMailService() {
165: return mailService;
166: }
167:
168: public void setMailService(MailService mailService) {
169: this .mailService = mailService;
170: }
171:
172: public CompanyLocalService getCompanyLocalService() {
173: return companyLocalService;
174: }
175:
176: public void setCompanyLocalService(
177: CompanyLocalService companyLocalService) {
178: this .companyLocalService = companyLocalService;
179: }
180:
181: public CompanyService getCompanyService() {
182: return companyService;
183: }
184:
185: public void setCompanyService(CompanyService companyService) {
186: this .companyService = companyService;
187: }
188:
189: public CompanyPersistence getCompanyPersistence() {
190: return companyPersistence;
191: }
192:
193: public void setCompanyPersistence(
194: CompanyPersistence companyPersistence) {
195: this .companyPersistence = companyPersistence;
196: }
197:
198: public PortletPreferencesLocalService getPortletPreferencesLocalService() {
199: return portletPreferencesLocalService;
200: }
201:
202: public void setPortletPreferencesLocalService(
203: PortletPreferencesLocalService portletPreferencesLocalService) {
204: this .portletPreferencesLocalService = portletPreferencesLocalService;
205: }
206:
207: public PortletPreferencesPersistence getPortletPreferencesPersistence() {
208: return portletPreferencesPersistence;
209: }
210:
211: public void setPortletPreferencesPersistence(
212: PortletPreferencesPersistence portletPreferencesPersistence) {
213: this .portletPreferencesPersistence = portletPreferencesPersistence;
214: }
215:
216: public PortletPreferencesFinder getPortletPreferencesFinder() {
217: return portletPreferencesFinder;
218: }
219:
220: public void setPortletPreferencesFinder(
221: PortletPreferencesFinder portletPreferencesFinder) {
222: this .portletPreferencesFinder = portletPreferencesFinder;
223: }
224:
225: public ResourceLocalService getResourceLocalService() {
226: return resourceLocalService;
227: }
228:
229: public void setResourceLocalService(
230: ResourceLocalService resourceLocalService) {
231: this .resourceLocalService = resourceLocalService;
232: }
233:
234: public ResourceService getResourceService() {
235: return resourceService;
236: }
237:
238: public void setResourceService(ResourceService resourceService) {
239: this .resourceService = resourceService;
240: }
241:
242: public ResourcePersistence getResourcePersistence() {
243: return resourcePersistence;
244: }
245:
246: public void setResourcePersistence(
247: ResourcePersistence resourcePersistence) {
248: this .resourcePersistence = resourcePersistence;
249: }
250:
251: public ResourceFinder getResourceFinder() {
252: return resourceFinder;
253: }
254:
255: public void setResourceFinder(ResourceFinder resourceFinder) {
256: this .resourceFinder = resourceFinder;
257: }
258:
259: public UserLocalService getUserLocalService() {
260: return userLocalService;
261: }
262:
263: public void setUserLocalService(UserLocalService userLocalService) {
264: this .userLocalService = userLocalService;
265: }
266:
267: public UserService getUserService() {
268: return userService;
269: }
270:
271: public void setUserService(UserService userService) {
272: this .userService = userService;
273: }
274:
275: public UserPersistence getUserPersistence() {
276: return userPersistence;
277: }
278:
279: public void setUserPersistence(UserPersistence userPersistence) {
280: this .userPersistence = userPersistence;
281: }
282:
283: public UserFinder getUserFinder() {
284: return userFinder;
285: }
286:
287: public void setUserFinder(UserFinder userFinder) {
288: this .userFinder = userFinder;
289: }
290:
291: public void afterPropertiesSet() {
292: if (calEventPersistence == null) {
293: calEventPersistence = CalEventUtil.getPersistence();
294: }
295:
296: if (calEventFinder == null) {
297: calEventFinder = CalEventFinderUtil.getFinder();
298: }
299:
300: if (counterLocalService == null) {
301: counterLocalService = CounterLocalServiceFactory.getImpl();
302: }
303:
304: if (counterService == null) {
305: counterService = CounterServiceFactory.getImpl();
306: }
307:
308: if (mailService == null) {
309: mailService = MailServiceFactory.getImpl();
310: }
311:
312: if (companyLocalService == null) {
313: companyLocalService = CompanyLocalServiceFactory.getImpl();
314: }
315:
316: if (companyService == null) {
317: companyService = CompanyServiceFactory.getImpl();
318: }
319:
320: if (companyPersistence == null) {
321: companyPersistence = CompanyUtil.getPersistence();
322: }
323:
324: if (portletPreferencesLocalService == null) {
325: portletPreferencesLocalService = PortletPreferencesLocalServiceFactory
326: .getImpl();
327: }
328:
329: if (portletPreferencesPersistence == null) {
330: portletPreferencesPersistence = PortletPreferencesUtil
331: .getPersistence();
332: }
333:
334: if (portletPreferencesFinder == null) {
335: portletPreferencesFinder = PortletPreferencesFinderUtil
336: .getFinder();
337: }
338:
339: if (resourceLocalService == null) {
340: resourceLocalService = ResourceLocalServiceFactory
341: .getImpl();
342: }
343:
344: if (resourceService == null) {
345: resourceService = ResourceServiceFactory.getImpl();
346: }
347:
348: if (resourcePersistence == null) {
349: resourcePersistence = ResourceUtil.getPersistence();
350: }
351:
352: if (resourceFinder == null) {
353: resourceFinder = ResourceFinderUtil.getFinder();
354: }
355:
356: if (userLocalService == null) {
357: userLocalService = UserLocalServiceFactory.getImpl();
358: }
359:
360: if (userService == null) {
361: userService = UserServiceFactory.getImpl();
362: }
363:
364: if (userPersistence == null) {
365: userPersistence = UserUtil.getPersistence();
366: }
367:
368: if (userFinder == null) {
369: userFinder = UserFinderUtil.getFinder();
370: }
371: }
372:
373: protected CalEventPersistence calEventPersistence;
374: protected CalEventFinder calEventFinder;
375: protected CounterLocalService counterLocalService;
376: protected CounterService counterService;
377: protected MailService mailService;
378: protected CompanyLocalService companyLocalService;
379: protected CompanyService companyService;
380: protected CompanyPersistence companyPersistence;
381: protected PortletPreferencesLocalService portletPreferencesLocalService;
382: protected PortletPreferencesPersistence portletPreferencesPersistence;
383: protected PortletPreferencesFinder portletPreferencesFinder;
384: protected ResourceLocalService resourceLocalService;
385: protected ResourceService resourceService;
386: protected ResourcePersistence resourcePersistence;
387: protected ResourceFinder resourceFinder;
388: protected UserLocalService userLocalService;
389: protected UserService userService;
390: protected UserPersistence userPersistence;
391: protected UserFinder userFinder;
392: }
|