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