1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.bookmarks.service.base;
16  
17  import com.liferay.counter.service.CounterLocalService;
18  import com.liferay.counter.service.CounterService;
19  
20  import com.liferay.portal.kernel.annotation.BeanReference;
21  import com.liferay.portal.kernel.dao.db.DB;
22  import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
23  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
24  import com.liferay.portal.kernel.exception.PortalException;
25  import com.liferay.portal.kernel.exception.SystemException;
26  import com.liferay.portal.service.ResourceLocalService;
27  import com.liferay.portal.service.ResourceService;
28  import com.liferay.portal.service.UserLocalService;
29  import com.liferay.portal.service.UserService;
30  import com.liferay.portal.service.persistence.ResourceFinder;
31  import com.liferay.portal.service.persistence.ResourcePersistence;
32  import com.liferay.portal.service.persistence.UserFinder;
33  import com.liferay.portal.service.persistence.UserPersistence;
34  
35  import com.liferay.portlet.asset.service.AssetEntryLocalService;
36  import com.liferay.portlet.asset.service.AssetEntryService;
37  import com.liferay.portlet.asset.service.AssetTagLocalService;
38  import com.liferay.portlet.asset.service.AssetTagService;
39  import com.liferay.portlet.asset.service.persistence.AssetEntryFinder;
40  import com.liferay.portlet.asset.service.persistence.AssetEntryPersistence;
41  import com.liferay.portlet.asset.service.persistence.AssetTagFinder;
42  import com.liferay.portlet.asset.service.persistence.AssetTagPersistence;
43  import com.liferay.portlet.bookmarks.model.BookmarksEntry;
44  import com.liferay.portlet.bookmarks.service.BookmarksEntryLocalService;
45  import com.liferay.portlet.bookmarks.service.BookmarksEntryService;
46  import com.liferay.portlet.bookmarks.service.BookmarksFolderLocalService;
47  import com.liferay.portlet.bookmarks.service.BookmarksFolderService;
48  import com.liferay.portlet.bookmarks.service.persistence.BookmarksEntryFinder;
49  import com.liferay.portlet.bookmarks.service.persistence.BookmarksEntryPersistence;
50  import com.liferay.portlet.bookmarks.service.persistence.BookmarksFolderPersistence;
51  import com.liferay.portlet.expando.service.ExpandoValueLocalService;
52  import com.liferay.portlet.expando.service.ExpandoValueService;
53  import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
54  
55  import java.util.List;
56  
57  /**
58   * <a href="BookmarksEntryLocalServiceBaseImpl.java.html"><b><i>View Source</i>
59   * </b></a>
60   *
61   * @author Brian Wing Shun Chan
62   */
63  public abstract class BookmarksEntryLocalServiceBaseImpl
64      implements BookmarksEntryLocalService {
65      public BookmarksEntry addBookmarksEntry(BookmarksEntry bookmarksEntry)
66          throws SystemException {
67          bookmarksEntry.setNew(true);
68  
69          return bookmarksEntryPersistence.update(bookmarksEntry, false);
70      }
71  
72      public BookmarksEntry createBookmarksEntry(long entryId) {
73          return bookmarksEntryPersistence.create(entryId);
74      }
75  
76      public void deleteBookmarksEntry(long entryId)
77          throws PortalException, SystemException {
78          bookmarksEntryPersistence.remove(entryId);
79      }
80  
81      public void deleteBookmarksEntry(BookmarksEntry bookmarksEntry)
82          throws SystemException {
83          bookmarksEntryPersistence.remove(bookmarksEntry);
84      }
85  
86      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
87          throws SystemException {
88          return bookmarksEntryPersistence.findWithDynamicQuery(dynamicQuery);
89      }
90  
91      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
92          int end) throws SystemException {
93          return bookmarksEntryPersistence.findWithDynamicQuery(dynamicQuery,
94              start, end);
95      }
96  
97      public BookmarksEntry getBookmarksEntry(long entryId)
98          throws PortalException, SystemException {
99          return bookmarksEntryPersistence.findByPrimaryKey(entryId);
100     }
101 
102     public List<BookmarksEntry> getBookmarksEntries(int start, int end)
103         throws SystemException {
104         return bookmarksEntryPersistence.findAll(start, end);
105     }
106 
107     public int getBookmarksEntriesCount() throws SystemException {
108         return bookmarksEntryPersistence.countAll();
109     }
110 
111     public BookmarksEntry updateBookmarksEntry(BookmarksEntry bookmarksEntry)
112         throws SystemException {
113         bookmarksEntry.setNew(false);
114 
115         return bookmarksEntryPersistence.update(bookmarksEntry, true);
116     }
117 
118     public BookmarksEntry updateBookmarksEntry(BookmarksEntry bookmarksEntry,
119         boolean merge) throws SystemException {
120         bookmarksEntry.setNew(false);
121 
122         return bookmarksEntryPersistence.update(bookmarksEntry, merge);
123     }
124 
125     public BookmarksEntryLocalService getBookmarksEntryLocalService() {
126         return bookmarksEntryLocalService;
127     }
128 
129     public void setBookmarksEntryLocalService(
130         BookmarksEntryLocalService bookmarksEntryLocalService) {
131         this.bookmarksEntryLocalService = bookmarksEntryLocalService;
132     }
133 
134     public BookmarksEntryService getBookmarksEntryService() {
135         return bookmarksEntryService;
136     }
137 
138     public void setBookmarksEntryService(
139         BookmarksEntryService bookmarksEntryService) {
140         this.bookmarksEntryService = bookmarksEntryService;
141     }
142 
143     public BookmarksEntryPersistence getBookmarksEntryPersistence() {
144         return bookmarksEntryPersistence;
145     }
146 
147     public void setBookmarksEntryPersistence(
148         BookmarksEntryPersistence bookmarksEntryPersistence) {
149         this.bookmarksEntryPersistence = bookmarksEntryPersistence;
150     }
151 
152     public BookmarksEntryFinder getBookmarksEntryFinder() {
153         return bookmarksEntryFinder;
154     }
155 
156     public void setBookmarksEntryFinder(
157         BookmarksEntryFinder bookmarksEntryFinder) {
158         this.bookmarksEntryFinder = bookmarksEntryFinder;
159     }
160 
161     public BookmarksFolderLocalService getBookmarksFolderLocalService() {
162         return bookmarksFolderLocalService;
163     }
164 
165     public void setBookmarksFolderLocalService(
166         BookmarksFolderLocalService bookmarksFolderLocalService) {
167         this.bookmarksFolderLocalService = bookmarksFolderLocalService;
168     }
169 
170     public BookmarksFolderService getBookmarksFolderService() {
171         return bookmarksFolderService;
172     }
173 
174     public void setBookmarksFolderService(
175         BookmarksFolderService bookmarksFolderService) {
176         this.bookmarksFolderService = bookmarksFolderService;
177     }
178 
179     public BookmarksFolderPersistence getBookmarksFolderPersistence() {
180         return bookmarksFolderPersistence;
181     }
182 
183     public void setBookmarksFolderPersistence(
184         BookmarksFolderPersistence bookmarksFolderPersistence) {
185         this.bookmarksFolderPersistence = bookmarksFolderPersistence;
186     }
187 
188     public CounterLocalService getCounterLocalService() {
189         return counterLocalService;
190     }
191 
192     public void setCounterLocalService(CounterLocalService counterLocalService) {
193         this.counterLocalService = counterLocalService;
194     }
195 
196     public CounterService getCounterService() {
197         return counterService;
198     }
199 
200     public void setCounterService(CounterService counterService) {
201         this.counterService = counterService;
202     }
203 
204     public ResourceLocalService getResourceLocalService() {
205         return resourceLocalService;
206     }
207 
208     public void setResourceLocalService(
209         ResourceLocalService resourceLocalService) {
210         this.resourceLocalService = resourceLocalService;
211     }
212 
213     public ResourceService getResourceService() {
214         return resourceService;
215     }
216 
217     public void setResourceService(ResourceService resourceService) {
218         this.resourceService = resourceService;
219     }
220 
221     public ResourcePersistence getResourcePersistence() {
222         return resourcePersistence;
223     }
224 
225     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
226         this.resourcePersistence = resourcePersistence;
227     }
228 
229     public ResourceFinder getResourceFinder() {
230         return resourceFinder;
231     }
232 
233     public void setResourceFinder(ResourceFinder resourceFinder) {
234         this.resourceFinder = resourceFinder;
235     }
236 
237     public UserLocalService getUserLocalService() {
238         return userLocalService;
239     }
240 
241     public void setUserLocalService(UserLocalService userLocalService) {
242         this.userLocalService = userLocalService;
243     }
244 
245     public UserService getUserService() {
246         return userService;
247     }
248 
249     public void setUserService(UserService userService) {
250         this.userService = userService;
251     }
252 
253     public UserPersistence getUserPersistence() {
254         return userPersistence;
255     }
256 
257     public void setUserPersistence(UserPersistence userPersistence) {
258         this.userPersistence = userPersistence;
259     }
260 
261     public UserFinder getUserFinder() {
262         return userFinder;
263     }
264 
265     public void setUserFinder(UserFinder userFinder) {
266         this.userFinder = userFinder;
267     }
268 
269     public AssetEntryLocalService getAssetEntryLocalService() {
270         return assetEntryLocalService;
271     }
272 
273     public void setAssetEntryLocalService(
274         AssetEntryLocalService assetEntryLocalService) {
275         this.assetEntryLocalService = assetEntryLocalService;
276     }
277 
278     public AssetEntryService getAssetEntryService() {
279         return assetEntryService;
280     }
281 
282     public void setAssetEntryService(AssetEntryService assetEntryService) {
283         this.assetEntryService = assetEntryService;
284     }
285 
286     public AssetEntryPersistence getAssetEntryPersistence() {
287         return assetEntryPersistence;
288     }
289 
290     public void setAssetEntryPersistence(
291         AssetEntryPersistence assetEntryPersistence) {
292         this.assetEntryPersistence = assetEntryPersistence;
293     }
294 
295     public AssetEntryFinder getAssetEntryFinder() {
296         return assetEntryFinder;
297     }
298 
299     public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
300         this.assetEntryFinder = assetEntryFinder;
301     }
302 
303     public AssetTagLocalService getAssetTagLocalService() {
304         return assetTagLocalService;
305     }
306 
307     public void setAssetTagLocalService(
308         AssetTagLocalService assetTagLocalService) {
309         this.assetTagLocalService = assetTagLocalService;
310     }
311 
312     public AssetTagService getAssetTagService() {
313         return assetTagService;
314     }
315 
316     public void setAssetTagService(AssetTagService assetTagService) {
317         this.assetTagService = assetTagService;
318     }
319 
320     public AssetTagPersistence getAssetTagPersistence() {
321         return assetTagPersistence;
322     }
323 
324     public void setAssetTagPersistence(AssetTagPersistence assetTagPersistence) {
325         this.assetTagPersistence = assetTagPersistence;
326     }
327 
328     public AssetTagFinder getAssetTagFinder() {
329         return assetTagFinder;
330     }
331 
332     public void setAssetTagFinder(AssetTagFinder assetTagFinder) {
333         this.assetTagFinder = assetTagFinder;
334     }
335 
336     public ExpandoValueLocalService getExpandoValueLocalService() {
337         return expandoValueLocalService;
338     }
339 
340     public void setExpandoValueLocalService(
341         ExpandoValueLocalService expandoValueLocalService) {
342         this.expandoValueLocalService = expandoValueLocalService;
343     }
344 
345     public ExpandoValueService getExpandoValueService() {
346         return expandoValueService;
347     }
348 
349     public void setExpandoValueService(ExpandoValueService expandoValueService) {
350         this.expandoValueService = expandoValueService;
351     }
352 
353     public ExpandoValuePersistence getExpandoValuePersistence() {
354         return expandoValuePersistence;
355     }
356 
357     public void setExpandoValuePersistence(
358         ExpandoValuePersistence expandoValuePersistence) {
359         this.expandoValuePersistence = expandoValuePersistence;
360     }
361 
362     protected void runSQL(String sql) throws SystemException {
363         try {
364             DB db = DBFactoryUtil.getDB();
365 
366             db.runSQL(sql);
367         }
368         catch (Exception e) {
369             throw new SystemException(e);
370         }
371     }
372 
373     @BeanReference(name = "com.liferay.portlet.bookmarks.service.BookmarksEntryLocalService")
374     protected BookmarksEntryLocalService bookmarksEntryLocalService;
375     @BeanReference(name = "com.liferay.portlet.bookmarks.service.BookmarksEntryService")
376     protected BookmarksEntryService bookmarksEntryService;
377     @BeanReference(name = "com.liferay.portlet.bookmarks.service.persistence.BookmarksEntryPersistence")
378     protected BookmarksEntryPersistence bookmarksEntryPersistence;
379     @BeanReference(name = "com.liferay.portlet.bookmarks.service.persistence.BookmarksEntryFinder")
380     protected BookmarksEntryFinder bookmarksEntryFinder;
381     @BeanReference(name = "com.liferay.portlet.bookmarks.service.BookmarksFolderLocalService")
382     protected BookmarksFolderLocalService bookmarksFolderLocalService;
383     @BeanReference(name = "com.liferay.portlet.bookmarks.service.BookmarksFolderService")
384     protected BookmarksFolderService bookmarksFolderService;
385     @BeanReference(name = "com.liferay.portlet.bookmarks.service.persistence.BookmarksFolderPersistence")
386     protected BookmarksFolderPersistence bookmarksFolderPersistence;
387     @BeanReference(name = "com.liferay.counter.service.CounterLocalService")
388     protected CounterLocalService counterLocalService;
389     @BeanReference(name = "com.liferay.counter.service.CounterService")
390     protected CounterService counterService;
391     @BeanReference(name = "com.liferay.portal.service.ResourceLocalService")
392     protected ResourceLocalService resourceLocalService;
393     @BeanReference(name = "com.liferay.portal.service.ResourceService")
394     protected ResourceService resourceService;
395     @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence")
396     protected ResourcePersistence resourcePersistence;
397     @BeanReference(name = "com.liferay.portal.service.persistence.ResourceFinder")
398     protected ResourceFinder resourceFinder;
399     @BeanReference(name = "com.liferay.portal.service.UserLocalService")
400     protected UserLocalService userLocalService;
401     @BeanReference(name = "com.liferay.portal.service.UserService")
402     protected UserService userService;
403     @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence")
404     protected UserPersistence userPersistence;
405     @BeanReference(name = "com.liferay.portal.service.persistence.UserFinder")
406     protected UserFinder userFinder;
407     @BeanReference(name = "com.liferay.portlet.asset.service.AssetEntryLocalService")
408     protected AssetEntryLocalService assetEntryLocalService;
409     @BeanReference(name = "com.liferay.portlet.asset.service.AssetEntryService")
410     protected AssetEntryService assetEntryService;
411     @BeanReference(name = "com.liferay.portlet.asset.service.persistence.AssetEntryPersistence")
412     protected AssetEntryPersistence assetEntryPersistence;
413     @BeanReference(name = "com.liferay.portlet.asset.service.persistence.AssetEntryFinder")
414     protected AssetEntryFinder assetEntryFinder;
415     @BeanReference(name = "com.liferay.portlet.asset.service.AssetTagLocalService")
416     protected AssetTagLocalService assetTagLocalService;
417     @BeanReference(name = "com.liferay.portlet.asset.service.AssetTagService")
418     protected AssetTagService assetTagService;
419     @BeanReference(name = "com.liferay.portlet.asset.service.persistence.AssetTagPersistence")
420     protected AssetTagPersistence assetTagPersistence;
421     @BeanReference(name = "com.liferay.portlet.asset.service.persistence.AssetTagFinder")
422     protected AssetTagFinder assetTagFinder;
423     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoValueLocalService")
424     protected ExpandoValueLocalService expandoValueLocalService;
425     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoValueService")
426     protected ExpandoValueService expandoValueService;
427     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence")
428     protected ExpandoValuePersistence expandoValuePersistence;
429 }