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