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.CounterLocalServiceFactory;
27  import com.liferay.counter.service.CounterService;
28  import com.liferay.counter.service.CounterServiceFactory;
29  
30  import com.liferay.portal.PortalException;
31  import com.liferay.portal.SystemException;
32  import com.liferay.portal.kernel.bean.InitializingBean;
33  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
34  import com.liferay.portal.service.ResourceLocalService;
35  import com.liferay.portal.service.ResourceLocalServiceFactory;
36  import com.liferay.portal.service.ResourceService;
37  import com.liferay.portal.service.ResourceServiceFactory;
38  import com.liferay.portal.service.UserLocalService;
39  import com.liferay.portal.service.UserLocalServiceFactory;
40  import com.liferay.portal.service.UserService;
41  import com.liferay.portal.service.UserServiceFactory;
42  import com.liferay.portal.service.persistence.ResourceFinder;
43  import com.liferay.portal.service.persistence.ResourceFinderUtil;
44  import com.liferay.portal.service.persistence.ResourcePersistence;
45  import com.liferay.portal.service.persistence.ResourceUtil;
46  import com.liferay.portal.service.persistence.UserFinder;
47  import com.liferay.portal.service.persistence.UserFinderUtil;
48  import com.liferay.portal.service.persistence.UserPersistence;
49  import com.liferay.portal.service.persistence.UserUtil;
50  
51  import com.liferay.portlet.bookmarks.model.BookmarksFolder;
52  import com.liferay.portlet.bookmarks.service.BookmarksEntryLocalService;
53  import com.liferay.portlet.bookmarks.service.BookmarksEntryLocalServiceFactory;
54  import com.liferay.portlet.bookmarks.service.BookmarksEntryService;
55  import com.liferay.portlet.bookmarks.service.BookmarksEntryServiceFactory;
56  import com.liferay.portlet.bookmarks.service.BookmarksFolderLocalService;
57  import com.liferay.portlet.bookmarks.service.persistence.BookmarksEntryFinder;
58  import com.liferay.portlet.bookmarks.service.persistence.BookmarksEntryFinderUtil;
59  import com.liferay.portlet.bookmarks.service.persistence.BookmarksEntryPersistence;
60  import com.liferay.portlet.bookmarks.service.persistence.BookmarksEntryUtil;
61  import com.liferay.portlet.bookmarks.service.persistence.BookmarksFolderPersistence;
62  import com.liferay.portlet.bookmarks.service.persistence.BookmarksFolderUtil;
63  import com.liferay.portlet.tags.service.TagsEntryLocalService;
64  import com.liferay.portlet.tags.service.TagsEntryLocalServiceFactory;
65  import com.liferay.portlet.tags.service.TagsEntryService;
66  import com.liferay.portlet.tags.service.TagsEntryServiceFactory;
67  import com.liferay.portlet.tags.service.persistence.TagsEntryFinder;
68  import com.liferay.portlet.tags.service.persistence.TagsEntryFinderUtil;
69  import com.liferay.portlet.tags.service.persistence.TagsEntryPersistence;
70  import com.liferay.portlet.tags.service.persistence.TagsEntryUtil;
71  
72  import java.util.List;
73  
74  /**
75   * <a href="BookmarksFolderLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
76   *
77   * @author Brian Wing Shun Chan
78   *
79   */
80  public abstract class BookmarksFolderLocalServiceBaseImpl
81      implements BookmarksFolderLocalService, InitializingBean {
82      public BookmarksFolder addBookmarksFolder(BookmarksFolder bookmarksFolder)
83          throws SystemException {
84          bookmarksFolder.setNew(true);
85  
86          return bookmarksFolderPersistence.update(bookmarksFolder, false);
87      }
88  
89      public void deleteBookmarksFolder(long folderId)
90          throws PortalException, SystemException {
91          bookmarksFolderPersistence.remove(folderId);
92      }
93  
94      public void deleteBookmarksFolder(BookmarksFolder bookmarksFolder)
95          throws SystemException {
96          bookmarksFolderPersistence.remove(bookmarksFolder);
97      }
98  
99      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
100         throws SystemException {
101         return bookmarksFolderPersistence.findWithDynamicQuery(dynamicQuery);
102     }
103 
104     public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
105         int end) throws SystemException {
106         return bookmarksFolderPersistence.findWithDynamicQuery(dynamicQuery,
107             start, end);
108     }
109 
110     public BookmarksFolder getBookmarksFolder(long folderId)
111         throws PortalException, SystemException {
112         return bookmarksFolderPersistence.findByPrimaryKey(folderId);
113     }
114 
115     public BookmarksFolder updateBookmarksFolder(
116         BookmarksFolder bookmarksFolder) throws SystemException {
117         bookmarksFolder.setNew(false);
118 
119         return bookmarksFolderPersistence.update(bookmarksFolder, true);
120     }
121 
122     public BookmarksEntryLocalService getBookmarksEntryLocalService() {
123         return bookmarksEntryLocalService;
124     }
125 
126     public void setBookmarksEntryLocalService(
127         BookmarksEntryLocalService bookmarksEntryLocalService) {
128         this.bookmarksEntryLocalService = bookmarksEntryLocalService;
129     }
130 
131     public BookmarksEntryService getBookmarksEntryService() {
132         return bookmarksEntryService;
133     }
134 
135     public void setBookmarksEntryService(
136         BookmarksEntryService bookmarksEntryService) {
137         this.bookmarksEntryService = bookmarksEntryService;
138     }
139 
140     public BookmarksEntryPersistence getBookmarksEntryPersistence() {
141         return bookmarksEntryPersistence;
142     }
143 
144     public void setBookmarksEntryPersistence(
145         BookmarksEntryPersistence bookmarksEntryPersistence) {
146         this.bookmarksEntryPersistence = bookmarksEntryPersistence;
147     }
148 
149     public BookmarksEntryFinder getBookmarksEntryFinder() {
150         return bookmarksEntryFinder;
151     }
152 
153     public void setBookmarksEntryFinder(
154         BookmarksEntryFinder bookmarksEntryFinder) {
155         this.bookmarksEntryFinder = bookmarksEntryFinder;
156     }
157 
158     public BookmarksFolderPersistence getBookmarksFolderPersistence() {
159         return bookmarksFolderPersistence;
160     }
161 
162     public void setBookmarksFolderPersistence(
163         BookmarksFolderPersistence bookmarksFolderPersistence) {
164         this.bookmarksFolderPersistence = bookmarksFolderPersistence;
165     }
166 
167     public CounterLocalService getCounterLocalService() {
168         return counterLocalService;
169     }
170 
171     public void setCounterLocalService(CounterLocalService counterLocalService) {
172         this.counterLocalService = counterLocalService;
173     }
174 
175     public CounterService getCounterService() {
176         return counterService;
177     }
178 
179     public void setCounterService(CounterService counterService) {
180         this.counterService = counterService;
181     }
182 
183     public ResourceLocalService getResourceLocalService() {
184         return resourceLocalService;
185     }
186 
187     public void setResourceLocalService(
188         ResourceLocalService resourceLocalService) {
189         this.resourceLocalService = resourceLocalService;
190     }
191 
192     public ResourceService getResourceService() {
193         return resourceService;
194     }
195 
196     public void setResourceService(ResourceService resourceService) {
197         this.resourceService = resourceService;
198     }
199 
200     public ResourcePersistence getResourcePersistence() {
201         return resourcePersistence;
202     }
203 
204     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
205         this.resourcePersistence = resourcePersistence;
206     }
207 
208     public ResourceFinder getResourceFinder() {
209         return resourceFinder;
210     }
211 
212     public void setResourceFinder(ResourceFinder resourceFinder) {
213         this.resourceFinder = resourceFinder;
214     }
215 
216     public UserLocalService getUserLocalService() {
217         return userLocalService;
218     }
219 
220     public void setUserLocalService(UserLocalService userLocalService) {
221         this.userLocalService = userLocalService;
222     }
223 
224     public UserService getUserService() {
225         return userService;
226     }
227 
228     public void setUserService(UserService userService) {
229         this.userService = userService;
230     }
231 
232     public UserPersistence getUserPersistence() {
233         return userPersistence;
234     }
235 
236     public void setUserPersistence(UserPersistence userPersistence) {
237         this.userPersistence = userPersistence;
238     }
239 
240     public UserFinder getUserFinder() {
241         return userFinder;
242     }
243 
244     public void setUserFinder(UserFinder userFinder) {
245         this.userFinder = userFinder;
246     }
247 
248     public TagsEntryLocalService getTagsEntryLocalService() {
249         return tagsEntryLocalService;
250     }
251 
252     public void setTagsEntryLocalService(
253         TagsEntryLocalService tagsEntryLocalService) {
254         this.tagsEntryLocalService = tagsEntryLocalService;
255     }
256 
257     public TagsEntryService getTagsEntryService() {
258         return tagsEntryService;
259     }
260 
261     public void setTagsEntryService(TagsEntryService tagsEntryService) {
262         this.tagsEntryService = tagsEntryService;
263     }
264 
265     public TagsEntryPersistence getTagsEntryPersistence() {
266         return tagsEntryPersistence;
267     }
268 
269     public void setTagsEntryPersistence(
270         TagsEntryPersistence tagsEntryPersistence) {
271         this.tagsEntryPersistence = tagsEntryPersistence;
272     }
273 
274     public TagsEntryFinder getTagsEntryFinder() {
275         return tagsEntryFinder;
276     }
277 
278     public void setTagsEntryFinder(TagsEntryFinder tagsEntryFinder) {
279         this.tagsEntryFinder = tagsEntryFinder;
280     }
281 
282     public void afterPropertiesSet() {
283         if (bookmarksEntryLocalService == null) {
284             bookmarksEntryLocalService = BookmarksEntryLocalServiceFactory.getImpl();
285         }
286 
287         if (bookmarksEntryService == null) {
288             bookmarksEntryService = BookmarksEntryServiceFactory.getImpl();
289         }
290 
291         if (bookmarksEntryPersistence == null) {
292             bookmarksEntryPersistence = BookmarksEntryUtil.getPersistence();
293         }
294 
295         if (bookmarksEntryFinder == null) {
296             bookmarksEntryFinder = BookmarksEntryFinderUtil.getFinder();
297         }
298 
299         if (bookmarksFolderPersistence == null) {
300             bookmarksFolderPersistence = BookmarksFolderUtil.getPersistence();
301         }
302 
303         if (counterLocalService == null) {
304             counterLocalService = CounterLocalServiceFactory.getImpl();
305         }
306 
307         if (counterService == null) {
308             counterService = CounterServiceFactory.getImpl();
309         }
310 
311         if (resourceLocalService == null) {
312             resourceLocalService = ResourceLocalServiceFactory.getImpl();
313         }
314 
315         if (resourceService == null) {
316             resourceService = ResourceServiceFactory.getImpl();
317         }
318 
319         if (resourcePersistence == null) {
320             resourcePersistence = ResourceUtil.getPersistence();
321         }
322 
323         if (resourceFinder == null) {
324             resourceFinder = ResourceFinderUtil.getFinder();
325         }
326 
327         if (userLocalService == null) {
328             userLocalService = UserLocalServiceFactory.getImpl();
329         }
330 
331         if (userService == null) {
332             userService = UserServiceFactory.getImpl();
333         }
334 
335         if (userPersistence == null) {
336             userPersistence = UserUtil.getPersistence();
337         }
338 
339         if (userFinder == null) {
340             userFinder = UserFinderUtil.getFinder();
341         }
342 
343         if (tagsEntryLocalService == null) {
344             tagsEntryLocalService = TagsEntryLocalServiceFactory.getImpl();
345         }
346 
347         if (tagsEntryService == null) {
348             tagsEntryService = TagsEntryServiceFactory.getImpl();
349         }
350 
351         if (tagsEntryPersistence == null) {
352             tagsEntryPersistence = TagsEntryUtil.getPersistence();
353         }
354 
355         if (tagsEntryFinder == null) {
356             tagsEntryFinder = TagsEntryFinderUtil.getFinder();
357         }
358     }
359 
360     protected BookmarksEntryLocalService bookmarksEntryLocalService;
361     protected BookmarksEntryService bookmarksEntryService;
362     protected BookmarksEntryPersistence bookmarksEntryPersistence;
363     protected BookmarksEntryFinder bookmarksEntryFinder;
364     protected BookmarksFolderPersistence bookmarksFolderPersistence;
365     protected CounterLocalService counterLocalService;
366     protected CounterService counterService;
367     protected ResourceLocalService resourceLocalService;
368     protected ResourceService resourceService;
369     protected ResourcePersistence resourcePersistence;
370     protected ResourceFinder resourceFinder;
371     protected UserLocalService userLocalService;
372     protected UserService userService;
373     protected UserPersistence userPersistence;
374     protected UserFinder userFinder;
375     protected TagsEntryLocalService tagsEntryLocalService;
376     protected TagsEntryService tagsEntryService;
377     protected TagsEntryPersistence tagsEntryPersistence;
378     protected TagsEntryFinder tagsEntryFinder;
379 }