1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.calendar.service.base;
24  
25  import com.liferay.counter.service.CounterLocalService;
26  import com.liferay.counter.service.CounterService;
27  
28  import com.liferay.mail.service.MailService;
29  
30  import com.liferay.portal.PortalException;
31  import com.liferay.portal.SystemException;
32  import com.liferay.portal.kernel.annotation.BeanReference;
33  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
34  import com.liferay.portal.service.CompanyLocalService;
35  import com.liferay.portal.service.CompanyService;
36  import com.liferay.portal.service.PortletPreferencesLocalService;
37  import com.liferay.portal.service.PortletPreferencesService;
38  import com.liferay.portal.service.ResourceLocalService;
39  import com.liferay.portal.service.ResourceService;
40  import com.liferay.portal.service.UserLocalService;
41  import com.liferay.portal.service.UserService;
42  import com.liferay.portal.service.persistence.CompanyPersistence;
43  import com.liferay.portal.service.persistence.PortletPreferencesFinder;
44  import com.liferay.portal.service.persistence.PortletPreferencesPersistence;
45  import com.liferay.portal.service.persistence.ResourceFinder;
46  import com.liferay.portal.service.persistence.ResourcePersistence;
47  import com.liferay.portal.service.persistence.UserFinder;
48  import com.liferay.portal.service.persistence.UserPersistence;
49  import com.liferay.portal.util.PortalUtil;
50  
51  import com.liferay.portlet.calendar.model.CalEvent;
52  import com.liferay.portlet.calendar.service.CalEventLocalService;
53  import com.liferay.portlet.calendar.service.CalEventService;
54  import com.liferay.portlet.calendar.service.persistence.CalEventFinder;
55  import com.liferay.portlet.calendar.service.persistence.CalEventPersistence;
56  import com.liferay.portlet.social.service.SocialActivityLocalService;
57  import com.liferay.portlet.social.service.persistence.SocialActivityFinder;
58  import com.liferay.portlet.social.service.persistence.SocialActivityPersistence;
59  
60  import java.util.List;
61  
62  /**
63   * <a href="CalEventLocalServiceBaseImpl.java.html"><b><i>View Source</i></b>
64   * </a>
65   *
66   * @author Brian Wing Shun Chan
67   */
68  public abstract class CalEventLocalServiceBaseImpl
69      implements CalEventLocalService {
70      public CalEvent addCalEvent(CalEvent calEvent) throws SystemException {
71          calEvent.setNew(true);
72  
73          return calEventPersistence.update(calEvent, false);
74      }
75  
76      public CalEvent createCalEvent(long eventId) {
77          return calEventPersistence.create(eventId);
78      }
79  
80      public void deleteCalEvent(long eventId)
81          throws PortalException, SystemException {
82          calEventPersistence.remove(eventId);
83      }
84  
85      public void deleteCalEvent(CalEvent calEvent) throws SystemException {
86          calEventPersistence.remove(calEvent);
87      }
88  
89      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
90          throws SystemException {
91          return calEventPersistence.findWithDynamicQuery(dynamicQuery);
92      }
93  
94      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
95          int end) throws SystemException {
96          return calEventPersistence.findWithDynamicQuery(dynamicQuery, start, end);
97      }
98  
99      public CalEvent getCalEvent(long eventId)
100         throws PortalException, SystemException {
101         return calEventPersistence.findByPrimaryKey(eventId);
102     }
103 
104     public List<CalEvent> getCalEvents(int start, int end)
105         throws SystemException {
106         return calEventPersistence.findAll(start, end);
107     }
108 
109     public int getCalEventsCount() throws SystemException {
110         return calEventPersistence.countAll();
111     }
112 
113     public CalEvent updateCalEvent(CalEvent calEvent) throws SystemException {
114         calEvent.setNew(false);
115 
116         return calEventPersistence.update(calEvent, true);
117     }
118 
119     public CalEvent updateCalEvent(CalEvent calEvent, boolean merge)
120         throws SystemException {
121         calEvent.setNew(false);
122 
123         return calEventPersistence.update(calEvent, merge);
124     }
125 
126     public CalEventLocalService getCalEventLocalService() {
127         return calEventLocalService;
128     }
129 
130     public void setCalEventLocalService(
131         CalEventLocalService calEventLocalService) {
132         this.calEventLocalService = calEventLocalService;
133     }
134 
135     public CalEventService getCalEventService() {
136         return calEventService;
137     }
138 
139     public void setCalEventService(CalEventService calEventService) {
140         this.calEventService = calEventService;
141     }
142 
143     public CalEventPersistence getCalEventPersistence() {
144         return calEventPersistence;
145     }
146 
147     public void setCalEventPersistence(CalEventPersistence calEventPersistence) {
148         this.calEventPersistence = calEventPersistence;
149     }
150 
151     public CalEventFinder getCalEventFinder() {
152         return calEventFinder;
153     }
154 
155     public void setCalEventFinder(CalEventFinder calEventFinder) {
156         this.calEventFinder = calEventFinder;
157     }
158 
159     public CounterLocalService getCounterLocalService() {
160         return counterLocalService;
161     }
162 
163     public void setCounterLocalService(CounterLocalService counterLocalService) {
164         this.counterLocalService = counterLocalService;
165     }
166 
167     public CounterService getCounterService() {
168         return counterService;
169     }
170 
171     public void setCounterService(CounterService counterService) {
172         this.counterService = counterService;
173     }
174 
175     public MailService getMailService() {
176         return mailService;
177     }
178 
179     public void setMailService(MailService mailService) {
180         this.mailService = mailService;
181     }
182 
183     public CompanyLocalService getCompanyLocalService() {
184         return companyLocalService;
185     }
186 
187     public void setCompanyLocalService(CompanyLocalService companyLocalService) {
188         this.companyLocalService = companyLocalService;
189     }
190 
191     public CompanyService getCompanyService() {
192         return companyService;
193     }
194 
195     public void setCompanyService(CompanyService companyService) {
196         this.companyService = companyService;
197     }
198 
199     public CompanyPersistence getCompanyPersistence() {
200         return companyPersistence;
201     }
202 
203     public void setCompanyPersistence(CompanyPersistence companyPersistence) {
204         this.companyPersistence = companyPersistence;
205     }
206 
207     public PortletPreferencesLocalService getPortletPreferencesLocalService() {
208         return portletPreferencesLocalService;
209     }
210 
211     public void setPortletPreferencesLocalService(
212         PortletPreferencesLocalService portletPreferencesLocalService) {
213         this.portletPreferencesLocalService = portletPreferencesLocalService;
214     }
215 
216     public PortletPreferencesService getPortletPreferencesService() {
217         return portletPreferencesService;
218     }
219 
220     public void setPortletPreferencesService(
221         PortletPreferencesService portletPreferencesService) {
222         this.portletPreferencesService = portletPreferencesService;
223     }
224 
225     public PortletPreferencesPersistence getPortletPreferencesPersistence() {
226         return portletPreferencesPersistence;
227     }
228 
229     public void setPortletPreferencesPersistence(
230         PortletPreferencesPersistence portletPreferencesPersistence) {
231         this.portletPreferencesPersistence = portletPreferencesPersistence;
232     }
233 
234     public PortletPreferencesFinder getPortletPreferencesFinder() {
235         return portletPreferencesFinder;
236     }
237 
238     public void setPortletPreferencesFinder(
239         PortletPreferencesFinder portletPreferencesFinder) {
240         this.portletPreferencesFinder = portletPreferencesFinder;
241     }
242 
243     public ResourceLocalService getResourceLocalService() {
244         return resourceLocalService;
245     }
246 
247     public void setResourceLocalService(
248         ResourceLocalService resourceLocalService) {
249         this.resourceLocalService = resourceLocalService;
250     }
251 
252     public ResourceService getResourceService() {
253         return resourceService;
254     }
255 
256     public void setResourceService(ResourceService resourceService) {
257         this.resourceService = resourceService;
258     }
259 
260     public ResourcePersistence getResourcePersistence() {
261         return resourcePersistence;
262     }
263 
264     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
265         this.resourcePersistence = resourcePersistence;
266     }
267 
268     public ResourceFinder getResourceFinder() {
269         return resourceFinder;
270     }
271 
272     public void setResourceFinder(ResourceFinder resourceFinder) {
273         this.resourceFinder = resourceFinder;
274     }
275 
276     public UserLocalService getUserLocalService() {
277         return userLocalService;
278     }
279 
280     public void setUserLocalService(UserLocalService userLocalService) {
281         this.userLocalService = userLocalService;
282     }
283 
284     public UserService getUserService() {
285         return userService;
286     }
287 
288     public void setUserService(UserService userService) {
289         this.userService = userService;
290     }
291 
292     public UserPersistence getUserPersistence() {
293         return userPersistence;
294     }
295 
296     public void setUserPersistence(UserPersistence userPersistence) {
297         this.userPersistence = userPersistence;
298     }
299 
300     public UserFinder getUserFinder() {
301         return userFinder;
302     }
303 
304     public void setUserFinder(UserFinder userFinder) {
305         this.userFinder = userFinder;
306     }
307 
308     public SocialActivityLocalService getSocialActivityLocalService() {
309         return socialActivityLocalService;
310     }
311 
312     public void setSocialActivityLocalService(
313         SocialActivityLocalService socialActivityLocalService) {
314         this.socialActivityLocalService = socialActivityLocalService;
315     }
316 
317     public SocialActivityPersistence getSocialActivityPersistence() {
318         return socialActivityPersistence;
319     }
320 
321     public void setSocialActivityPersistence(
322         SocialActivityPersistence socialActivityPersistence) {
323         this.socialActivityPersistence = socialActivityPersistence;
324     }
325 
326     public SocialActivityFinder getSocialActivityFinder() {
327         return socialActivityFinder;
328     }
329 
330     public void setSocialActivityFinder(
331         SocialActivityFinder socialActivityFinder) {
332         this.socialActivityFinder = socialActivityFinder;
333     }
334 
335     protected void runSQL(String sql) throws SystemException {
336         try {
337             PortalUtil.runSQL(sql);
338         }
339         catch (Exception e) {
340             throw new SystemException(e);
341         }
342     }
343 
344     @BeanReference(name = "com.liferay.portlet.calendar.service.CalEventLocalService.impl")
345     protected CalEventLocalService calEventLocalService;
346     @BeanReference(name = "com.liferay.portlet.calendar.service.CalEventService.impl")
347     protected CalEventService calEventService;
348     @BeanReference(name = "com.liferay.portlet.calendar.service.persistence.CalEventPersistence.impl")
349     protected CalEventPersistence calEventPersistence;
350     @BeanReference(name = "com.liferay.portlet.calendar.service.persistence.CalEventFinder.impl")
351     protected CalEventFinder calEventFinder;
352     @BeanReference(name = "com.liferay.counter.service.CounterLocalService.impl")
353     protected CounterLocalService counterLocalService;
354     @BeanReference(name = "com.liferay.counter.service.CounterService.impl")
355     protected CounterService counterService;
356     @BeanReference(name = "com.liferay.mail.service.MailService.impl")
357     protected MailService mailService;
358     @BeanReference(name = "com.liferay.portal.service.CompanyLocalService.impl")
359     protected CompanyLocalService companyLocalService;
360     @BeanReference(name = "com.liferay.portal.service.CompanyService.impl")
361     protected CompanyService companyService;
362     @BeanReference(name = "com.liferay.portal.service.persistence.CompanyPersistence.impl")
363     protected CompanyPersistence companyPersistence;
364     @BeanReference(name = "com.liferay.portal.service.PortletPreferencesLocalService.impl")
365     protected PortletPreferencesLocalService portletPreferencesLocalService;
366     @BeanReference(name = "com.liferay.portal.service.PortletPreferencesService.impl")
367     protected PortletPreferencesService portletPreferencesService;
368     @BeanReference(name = "com.liferay.portal.service.persistence.PortletPreferencesPersistence.impl")
369     protected PortletPreferencesPersistence portletPreferencesPersistence;
370     @BeanReference(name = "com.liferay.portal.service.persistence.PortletPreferencesFinder.impl")
371     protected PortletPreferencesFinder portletPreferencesFinder;
372     @BeanReference(name = "com.liferay.portal.service.ResourceLocalService.impl")
373     protected ResourceLocalService resourceLocalService;
374     @BeanReference(name = "com.liferay.portal.service.ResourceService.impl")
375     protected ResourceService resourceService;
376     @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence.impl")
377     protected ResourcePersistence resourcePersistence;
378     @BeanReference(name = "com.liferay.portal.service.persistence.ResourceFinder.impl")
379     protected ResourceFinder resourceFinder;
380     @BeanReference(name = "com.liferay.portal.service.UserLocalService.impl")
381     protected UserLocalService userLocalService;
382     @BeanReference(name = "com.liferay.portal.service.UserService.impl")
383     protected UserService userService;
384     @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence.impl")
385     protected UserPersistence userPersistence;
386     @BeanReference(name = "com.liferay.portal.service.persistence.UserFinder.impl")
387     protected UserFinder userFinder;
388     @BeanReference(name = "com.liferay.portlet.social.service.SocialActivityLocalService.impl")
389     protected SocialActivityLocalService socialActivityLocalService;
390     @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialActivityPersistence.impl")
391     protected SocialActivityPersistence socialActivityPersistence;
392     @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialActivityFinder.impl")
393     protected SocialActivityFinder socialActivityFinder;
394 }