1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions 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.bookmarks.service.base;
24  
25  import com.liferay.counter.service.CounterLocalService;
26  import com.liferay.counter.service.CounterService;
27  
28  import com.liferay.portal.PortalException;
29  import com.liferay.portal.SystemException;
30  import com.liferay.portal.kernel.bean.InitializingBean;
31  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
32  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
33  import com.liferay.portal.service.ResourceLocalService;
34  import com.liferay.portal.service.ResourceService;
35  import com.liferay.portal.service.UserLocalService;
36  import com.liferay.portal.service.UserService;
37  import com.liferay.portal.service.persistence.ResourceFinder;
38  import com.liferay.portal.service.persistence.ResourcePersistence;
39  import com.liferay.portal.service.persistence.UserFinder;
40  import com.liferay.portal.service.persistence.UserPersistence;
41  
42  import com.liferay.portlet.bookmarks.model.BookmarksEntry;
43  import com.liferay.portlet.bookmarks.service.BookmarksEntryLocalService;
44  import com.liferay.portlet.bookmarks.service.BookmarksFolderLocalService;
45  import com.liferay.portlet.bookmarks.service.BookmarksFolderService;
46  import com.liferay.portlet.bookmarks.service.persistence.BookmarksEntryFinder;
47  import com.liferay.portlet.bookmarks.service.persistence.BookmarksEntryPersistence;
48  import com.liferay.portlet.bookmarks.service.persistence.BookmarksFolderPersistence;
49  import com.liferay.portlet.tags.service.TagsAssetLocalService;
50  import com.liferay.portlet.tags.service.TagsAssetService;
51  import com.liferay.portlet.tags.service.persistence.TagsAssetFinder;
52  import com.liferay.portlet.tags.service.persistence.TagsAssetPersistence;
53  
54  import java.util.List;
55  
56  /**
57   * <a href="BookmarksEntryLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
58   *
59   * @author Brian Wing Shun Chan
60   *
61   */
62  public abstract class BookmarksEntryLocalServiceBaseImpl
63      implements BookmarksEntryLocalService, InitializingBean {
64      public BookmarksEntry addBookmarksEntry(BookmarksEntry bookmarksEntry)
65          throws SystemException {
66          bookmarksEntry.setNew(true);
67  
68          return bookmarksEntryPersistence.update(bookmarksEntry, false);
69      }
70  
71      public void deleteBookmarksEntry(long entryId)
72          throws PortalException, SystemException {
73          bookmarksEntryPersistence.remove(entryId);
74      }
75  
76      public void deleteBookmarksEntry(BookmarksEntry bookmarksEntry)
77          throws SystemException {
78          bookmarksEntryPersistence.remove(bookmarksEntry);
79      }
80  
81      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
82          throws SystemException {
83          return bookmarksEntryPersistence.findWithDynamicQuery(dynamicQuery);
84      }
85  
86      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
87          int end) throws SystemException {
88          return bookmarksEntryPersistence.findWithDynamicQuery(dynamicQuery,
89              start, end);
90      }
91  
92      public BookmarksEntry getBookmarksEntry(long entryId)
93          throws PortalException, SystemException {
94          return bookmarksEntryPersistence.findByPrimaryKey(entryId);
95      }
96  
97      public List<BookmarksEntry> getBookmarksEntries(int start, int end)
98          throws SystemException {
99          return bookmarksEntryPersistence.findAll(start, end);
100     }
101 
102     public int getBookmarksEntriesCount() throws SystemException {
103         return bookmarksEntryPersistence.countAll();
104     }
105 
106     public BookmarksEntry updateBookmarksEntry(BookmarksEntry bookmarksEntry)
107         throws SystemException {
108         bookmarksEntry.setNew(false);
109 
110         return bookmarksEntryPersistence.update(bookmarksEntry, true);
111     }
112 
113     public BookmarksEntryPersistence getBookmarksEntryPersistence() {
114         return bookmarksEntryPersistence;
115     }
116 
117     public void setBookmarksEntryPersistence(
118         BookmarksEntryPersistence bookmarksEntryPersistence) {
119         this.bookmarksEntryPersistence = bookmarksEntryPersistence;
120     }
121 
122     public BookmarksEntryFinder getBookmarksEntryFinder() {
123         return bookmarksEntryFinder;
124     }
125 
126     public void setBookmarksEntryFinder(
127         BookmarksEntryFinder bookmarksEntryFinder) {
128         this.bookmarksEntryFinder = bookmarksEntryFinder;
129     }
130 
131     public BookmarksFolderLocalService getBookmarksFolderLocalService() {
132         return bookmarksFolderLocalService;
133     }
134 
135     public void setBookmarksFolderLocalService(
136         BookmarksFolderLocalService bookmarksFolderLocalService) {
137         this.bookmarksFolderLocalService = bookmarksFolderLocalService;
138     }
139 
140     public BookmarksFolderService getBookmarksFolderService() {
141         return bookmarksFolderService;
142     }
143 
144     public void setBookmarksFolderService(
145         BookmarksFolderService bookmarksFolderService) {
146         this.bookmarksFolderService = bookmarksFolderService;
147     }
148 
149     public BookmarksFolderPersistence getBookmarksFolderPersistence() {
150         return bookmarksFolderPersistence;
151     }
152 
153     public void setBookmarksFolderPersistence(
154         BookmarksFolderPersistence bookmarksFolderPersistence) {
155         this.bookmarksFolderPersistence = bookmarksFolderPersistence;
156     }
157 
158     public CounterLocalService getCounterLocalService() {
159         return counterLocalService;
160     }
161 
162     public void setCounterLocalService(CounterLocalService counterLocalService) {
163         this.counterLocalService = counterLocalService;
164     }
165 
166     public CounterService getCounterService() {
167         return counterService;
168     }
169 
170     public void setCounterService(CounterService counterService) {
171         this.counterService = counterService;
172     }
173 
174     public ResourceLocalService getResourceLocalService() {
175         return resourceLocalService;
176     }
177 
178     public void setResourceLocalService(
179         ResourceLocalService resourceLocalService) {
180         this.resourceLocalService = resourceLocalService;
181     }
182 
183     public ResourceService getResourceService() {
184         return resourceService;
185     }
186 
187     public void setResourceService(ResourceService resourceService) {
188         this.resourceService = resourceService;
189     }
190 
191     public ResourcePersistence getResourcePersistence() {
192         return resourcePersistence;
193     }
194 
195     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
196         this.resourcePersistence = resourcePersistence;
197     }
198 
199     public ResourceFinder getResourceFinder() {
200         return resourceFinder;
201     }
202 
203     public void setResourceFinder(ResourceFinder resourceFinder) {
204         this.resourceFinder = resourceFinder;
205     }
206 
207     public UserLocalService getUserLocalService() {
208         return userLocalService;
209     }
210 
211     public void setUserLocalService(UserLocalService userLocalService) {
212         this.userLocalService = userLocalService;
213     }
214 
215     public UserService getUserService() {
216         return userService;
217     }
218 
219     public void setUserService(UserService userService) {
220         this.userService = userService;
221     }
222 
223     public UserPersistence getUserPersistence() {
224         return userPersistence;
225     }
226 
227     public void setUserPersistence(UserPersistence userPersistence) {
228         this.userPersistence = userPersistence;
229     }
230 
231     public UserFinder getUserFinder() {
232         return userFinder;
233     }
234 
235     public void setUserFinder(UserFinder userFinder) {
236         this.userFinder = userFinder;
237     }
238 
239     public TagsAssetLocalService getTagsAssetLocalService() {
240         return tagsAssetLocalService;
241     }
242 
243     public void setTagsAssetLocalService(
244         TagsAssetLocalService tagsAssetLocalService) {
245         this.tagsAssetLocalService = tagsAssetLocalService;
246     }
247 
248     public TagsAssetService getTagsAssetService() {
249         return tagsAssetService;
250     }
251 
252     public void setTagsAssetService(TagsAssetService tagsAssetService) {
253         this.tagsAssetService = tagsAssetService;
254     }
255 
256     public TagsAssetPersistence getTagsAssetPersistence() {
257         return tagsAssetPersistence;
258     }
259 
260     public void setTagsAssetPersistence(
261         TagsAssetPersistence tagsAssetPersistence) {
262         this.tagsAssetPersistence = tagsAssetPersistence;
263     }
264 
265     public TagsAssetFinder getTagsAssetFinder() {
266         return tagsAssetFinder;
267     }
268 
269     public void setTagsAssetFinder(TagsAssetFinder tagsAssetFinder) {
270         this.tagsAssetFinder = tagsAssetFinder;
271     }
272 
273     public void afterPropertiesSet() {
274         if (bookmarksEntryPersistence == null) {
275             bookmarksEntryPersistence = (BookmarksEntryPersistence)PortalBeanLocatorUtil.locate(BookmarksEntryPersistence.class.getName() +
276                     ".impl");
277         }
278 
279         if (bookmarksEntryFinder == null) {
280             bookmarksEntryFinder = (BookmarksEntryFinder)PortalBeanLocatorUtil.locate(BookmarksEntryFinder.class.getName() +
281                     ".impl");
282         }
283 
284         if (bookmarksFolderLocalService == null) {
285             bookmarksFolderLocalService = (BookmarksFolderLocalService)PortalBeanLocatorUtil.locate(BookmarksFolderLocalService.class.getName() +
286                     ".impl");
287         }
288 
289         if (bookmarksFolderService == null) {
290             bookmarksFolderService = (BookmarksFolderService)PortalBeanLocatorUtil.locate(BookmarksFolderService.class.getName() +
291                     ".impl");
292         }
293 
294         if (bookmarksFolderPersistence == null) {
295             bookmarksFolderPersistence = (BookmarksFolderPersistence)PortalBeanLocatorUtil.locate(BookmarksFolderPersistence.class.getName() +
296                     ".impl");
297         }
298 
299         if (counterLocalService == null) {
300             counterLocalService = (CounterLocalService)PortalBeanLocatorUtil.locate(CounterLocalService.class.getName() +
301                     ".impl");
302         }
303 
304         if (counterService == null) {
305             counterService = (CounterService)PortalBeanLocatorUtil.locate(CounterService.class.getName() +
306                     ".impl");
307         }
308 
309         if (resourceLocalService == null) {
310             resourceLocalService = (ResourceLocalService)PortalBeanLocatorUtil.locate(ResourceLocalService.class.getName() +
311                     ".impl");
312         }
313 
314         if (resourceService == null) {
315             resourceService = (ResourceService)PortalBeanLocatorUtil.locate(ResourceService.class.getName() +
316                     ".impl");
317         }
318 
319         if (resourcePersistence == null) {
320             resourcePersistence = (ResourcePersistence)PortalBeanLocatorUtil.locate(ResourcePersistence.class.getName() +
321                     ".impl");
322         }
323 
324         if (resourceFinder == null) {
325             resourceFinder = (ResourceFinder)PortalBeanLocatorUtil.locate(ResourceFinder.class.getName() +
326                     ".impl");
327         }
328 
329         if (userLocalService == null) {
330             userLocalService = (UserLocalService)PortalBeanLocatorUtil.locate(UserLocalService.class.getName() +
331                     ".impl");
332         }
333 
334         if (userService == null) {
335             userService = (UserService)PortalBeanLocatorUtil.locate(UserService.class.getName() +
336                     ".impl");
337         }
338 
339         if (userPersistence == null) {
340             userPersistence = (UserPersistence)PortalBeanLocatorUtil.locate(UserPersistence.class.getName() +
341                     ".impl");
342         }
343 
344         if (userFinder == null) {
345             userFinder = (UserFinder)PortalBeanLocatorUtil.locate(UserFinder.class.getName() +
346                     ".impl");
347         }
348 
349         if (tagsAssetLocalService == null) {
350             tagsAssetLocalService = (TagsAssetLocalService)PortalBeanLocatorUtil.locate(TagsAssetLocalService.class.getName() +
351                     ".impl");
352         }
353 
354         if (tagsAssetService == null) {
355             tagsAssetService = (TagsAssetService)PortalBeanLocatorUtil.locate(TagsAssetService.class.getName() +
356                     ".impl");
357         }
358 
359         if (tagsAssetPersistence == null) {
360             tagsAssetPersistence = (TagsAssetPersistence)PortalBeanLocatorUtil.locate(TagsAssetPersistence.class.getName() +
361                     ".impl");
362         }
363 
364         if (tagsAssetFinder == null) {
365             tagsAssetFinder = (TagsAssetFinder)PortalBeanLocatorUtil.locate(TagsAssetFinder.class.getName() +
366                     ".impl");
367         }
368     }
369 
370     protected BookmarksEntryPersistence bookmarksEntryPersistence;
371     protected BookmarksEntryFinder bookmarksEntryFinder;
372     protected BookmarksFolderLocalService bookmarksFolderLocalService;
373     protected BookmarksFolderService bookmarksFolderService;
374     protected BookmarksFolderPersistence bookmarksFolderPersistence;
375     protected CounterLocalService counterLocalService;
376     protected CounterService counterService;
377     protected ResourceLocalService resourceLocalService;
378     protected ResourceService resourceService;
379     protected ResourcePersistence resourcePersistence;
380     protected ResourceFinder resourceFinder;
381     protected UserLocalService userLocalService;
382     protected UserService userService;
383     protected UserPersistence userPersistence;
384     protected UserFinder userFinder;
385     protected TagsAssetLocalService tagsAssetLocalService;
386     protected TagsAssetService tagsAssetService;
387     protected TagsAssetPersistence tagsAssetPersistence;
388     protected TagsAssetFinder tagsAssetFinder;
389 }