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.documentlibrary.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.LayoutLocalService;
34  import com.liferay.portal.service.LayoutService;
35  import com.liferay.portal.service.persistence.LayoutFinder;
36  import com.liferay.portal.service.persistence.LayoutPersistence;
37  
38  import com.liferay.portlet.documentlibrary.model.DLFileRank;
39  import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService;
40  import com.liferay.portlet.documentlibrary.service.DLFileEntryService;
41  import com.liferay.portlet.documentlibrary.service.DLFileRankLocalService;
42  import com.liferay.portlet.documentlibrary.service.DLFileShortcutLocalService;
43  import com.liferay.portlet.documentlibrary.service.DLFileShortcutService;
44  import com.liferay.portlet.documentlibrary.service.DLFileVersionLocalService;
45  import com.liferay.portlet.documentlibrary.service.DLFolderLocalService;
46  import com.liferay.portlet.documentlibrary.service.DLFolderService;
47  import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryAndShortcutFinder;
48  import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryFinder;
49  import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryPersistence;
50  import com.liferay.portlet.documentlibrary.service.persistence.DLFileRankFinder;
51  import com.liferay.portlet.documentlibrary.service.persistence.DLFileRankPersistence;
52  import com.liferay.portlet.documentlibrary.service.persistence.DLFileShortcutFinder;
53  import com.liferay.portlet.documentlibrary.service.persistence.DLFileShortcutPersistence;
54  import com.liferay.portlet.documentlibrary.service.persistence.DLFileVersionPersistence;
55  import com.liferay.portlet.documentlibrary.service.persistence.DLFolderPersistence;
56  
57  import java.util.List;
58  
59  /**
60   * <a href="DLFileRankLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
61   *
62   * @author Brian Wing Shun Chan
63   *
64   */
65  public abstract class DLFileRankLocalServiceBaseImpl
66      implements DLFileRankLocalService, InitializingBean {
67      public DLFileRank addDLFileRank(DLFileRank dlFileRank)
68          throws SystemException {
69          dlFileRank.setNew(true);
70  
71          return dlFileRankPersistence.update(dlFileRank, false);
72      }
73  
74      public void deleteDLFileRank(long fileRankId)
75          throws PortalException, SystemException {
76          dlFileRankPersistence.remove(fileRankId);
77      }
78  
79      public void deleteDLFileRank(DLFileRank dlFileRank)
80          throws SystemException {
81          dlFileRankPersistence.remove(dlFileRank);
82      }
83  
84      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
85          throws SystemException {
86          return dlFileRankPersistence.findWithDynamicQuery(dynamicQuery);
87      }
88  
89      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
90          int end) throws SystemException {
91          return dlFileRankPersistence.findWithDynamicQuery(dynamicQuery, start,
92              end);
93      }
94  
95      public DLFileRank getDLFileRank(long fileRankId)
96          throws PortalException, SystemException {
97          return dlFileRankPersistence.findByPrimaryKey(fileRankId);
98      }
99  
100     public List<DLFileRank> getDLFileRanks(int start, int end)
101         throws SystemException {
102         return dlFileRankPersistence.findAll(start, end);
103     }
104 
105     public int getDLFileRanksCount() throws SystemException {
106         return dlFileRankPersistence.countAll();
107     }
108 
109     public DLFileRank updateDLFileRank(DLFileRank dlFileRank)
110         throws SystemException {
111         dlFileRank.setNew(false);
112 
113         return dlFileRankPersistence.update(dlFileRank, true);
114     }
115 
116     public DLFileEntryLocalService getDLFileEntryLocalService() {
117         return dlFileEntryLocalService;
118     }
119 
120     public void setDLFileEntryLocalService(
121         DLFileEntryLocalService dlFileEntryLocalService) {
122         this.dlFileEntryLocalService = dlFileEntryLocalService;
123     }
124 
125     public DLFileEntryService getDLFileEntryService() {
126         return dlFileEntryService;
127     }
128 
129     public void setDLFileEntryService(DLFileEntryService dlFileEntryService) {
130         this.dlFileEntryService = dlFileEntryService;
131     }
132 
133     public DLFileEntryPersistence getDLFileEntryPersistence() {
134         return dlFileEntryPersistence;
135     }
136 
137     public void setDLFileEntryPersistence(
138         DLFileEntryPersistence dlFileEntryPersistence) {
139         this.dlFileEntryPersistence = dlFileEntryPersistence;
140     }
141 
142     public DLFileEntryFinder getDLFileEntryFinder() {
143         return dlFileEntryFinder;
144     }
145 
146     public void setDLFileEntryFinder(DLFileEntryFinder dlFileEntryFinder) {
147         this.dlFileEntryFinder = dlFileEntryFinder;
148     }
149 
150     public DLFileEntryAndShortcutFinder getDLFileEntryAndShortcutFinder() {
151         return dlFileEntryAndShortcutFinder;
152     }
153 
154     public void setDLFileEntryAndShortcutFinder(
155         DLFileEntryAndShortcutFinder dlFileEntryAndShortcutFinder) {
156         this.dlFileEntryAndShortcutFinder = dlFileEntryAndShortcutFinder;
157     }
158 
159     public DLFileRankPersistence getDLFileRankPersistence() {
160         return dlFileRankPersistence;
161     }
162 
163     public void setDLFileRankPersistence(
164         DLFileRankPersistence dlFileRankPersistence) {
165         this.dlFileRankPersistence = dlFileRankPersistence;
166     }
167 
168     public DLFileRankFinder getDLFileRankFinder() {
169         return dlFileRankFinder;
170     }
171 
172     public void setDLFileRankFinder(DLFileRankFinder dlFileRankFinder) {
173         this.dlFileRankFinder = dlFileRankFinder;
174     }
175 
176     public DLFileShortcutLocalService getDLFileShortcutLocalService() {
177         return dlFileShortcutLocalService;
178     }
179 
180     public void setDLFileShortcutLocalService(
181         DLFileShortcutLocalService dlFileShortcutLocalService) {
182         this.dlFileShortcutLocalService = dlFileShortcutLocalService;
183     }
184 
185     public DLFileShortcutService getDLFileShortcutService() {
186         return dlFileShortcutService;
187     }
188 
189     public void setDLFileShortcutService(
190         DLFileShortcutService dlFileShortcutService) {
191         this.dlFileShortcutService = dlFileShortcutService;
192     }
193 
194     public DLFileShortcutPersistence getDLFileShortcutPersistence() {
195         return dlFileShortcutPersistence;
196     }
197 
198     public void setDLFileShortcutPersistence(
199         DLFileShortcutPersistence dlFileShortcutPersistence) {
200         this.dlFileShortcutPersistence = dlFileShortcutPersistence;
201     }
202 
203     public DLFileShortcutFinder getDLFileShortcutFinder() {
204         return dlFileShortcutFinder;
205     }
206 
207     public void setDLFileShortcutFinder(
208         DLFileShortcutFinder dlFileShortcutFinder) {
209         this.dlFileShortcutFinder = dlFileShortcutFinder;
210     }
211 
212     public DLFileVersionLocalService getDLFileVersionLocalService() {
213         return dlFileVersionLocalService;
214     }
215 
216     public void setDLFileVersionLocalService(
217         DLFileVersionLocalService dlFileVersionLocalService) {
218         this.dlFileVersionLocalService = dlFileVersionLocalService;
219     }
220 
221     public DLFileVersionPersistence getDLFileVersionPersistence() {
222         return dlFileVersionPersistence;
223     }
224 
225     public void setDLFileVersionPersistence(
226         DLFileVersionPersistence dlFileVersionPersistence) {
227         this.dlFileVersionPersistence = dlFileVersionPersistence;
228     }
229 
230     public DLFolderLocalService getDLFolderLocalService() {
231         return dlFolderLocalService;
232     }
233 
234     public void setDLFolderLocalService(
235         DLFolderLocalService dlFolderLocalService) {
236         this.dlFolderLocalService = dlFolderLocalService;
237     }
238 
239     public DLFolderService getDLFolderService() {
240         return dlFolderService;
241     }
242 
243     public void setDLFolderService(DLFolderService dlFolderService) {
244         this.dlFolderService = dlFolderService;
245     }
246 
247     public DLFolderPersistence getDLFolderPersistence() {
248         return dlFolderPersistence;
249     }
250 
251     public void setDLFolderPersistence(DLFolderPersistence dlFolderPersistence) {
252         this.dlFolderPersistence = dlFolderPersistence;
253     }
254 
255     public CounterLocalService getCounterLocalService() {
256         return counterLocalService;
257     }
258 
259     public void setCounterLocalService(CounterLocalService counterLocalService) {
260         this.counterLocalService = counterLocalService;
261     }
262 
263     public CounterService getCounterService() {
264         return counterService;
265     }
266 
267     public void setCounterService(CounterService counterService) {
268         this.counterService = counterService;
269     }
270 
271     public LayoutLocalService getLayoutLocalService() {
272         return layoutLocalService;
273     }
274 
275     public void setLayoutLocalService(LayoutLocalService layoutLocalService) {
276         this.layoutLocalService = layoutLocalService;
277     }
278 
279     public LayoutService getLayoutService() {
280         return layoutService;
281     }
282 
283     public void setLayoutService(LayoutService layoutService) {
284         this.layoutService = layoutService;
285     }
286 
287     public LayoutPersistence getLayoutPersistence() {
288         return layoutPersistence;
289     }
290 
291     public void setLayoutPersistence(LayoutPersistence layoutPersistence) {
292         this.layoutPersistence = layoutPersistence;
293     }
294 
295     public LayoutFinder getLayoutFinder() {
296         return layoutFinder;
297     }
298 
299     public void setLayoutFinder(LayoutFinder layoutFinder) {
300         this.layoutFinder = layoutFinder;
301     }
302 
303     public void afterPropertiesSet() {
304         if (dlFileEntryLocalService == null) {
305             dlFileEntryLocalService = (DLFileEntryLocalService)PortalBeanLocatorUtil.locate(DLFileEntryLocalService.class.getName() +
306                     ".impl");
307         }
308 
309         if (dlFileEntryService == null) {
310             dlFileEntryService = (DLFileEntryService)PortalBeanLocatorUtil.locate(DLFileEntryService.class.getName() +
311                     ".impl");
312         }
313 
314         if (dlFileEntryPersistence == null) {
315             dlFileEntryPersistence = (DLFileEntryPersistence)PortalBeanLocatorUtil.locate(DLFileEntryPersistence.class.getName() +
316                     ".impl");
317         }
318 
319         if (dlFileEntryFinder == null) {
320             dlFileEntryFinder = (DLFileEntryFinder)PortalBeanLocatorUtil.locate(DLFileEntryFinder.class.getName() +
321                     ".impl");
322         }
323 
324         if (dlFileEntryAndShortcutFinder == null) {
325             dlFileEntryAndShortcutFinder = (DLFileEntryAndShortcutFinder)PortalBeanLocatorUtil.locate(DLFileEntryAndShortcutFinder.class.getName() +
326                     ".impl");
327         }
328 
329         if (dlFileRankPersistence == null) {
330             dlFileRankPersistence = (DLFileRankPersistence)PortalBeanLocatorUtil.locate(DLFileRankPersistence.class.getName() +
331                     ".impl");
332         }
333 
334         if (dlFileRankFinder == null) {
335             dlFileRankFinder = (DLFileRankFinder)PortalBeanLocatorUtil.locate(DLFileRankFinder.class.getName() +
336                     ".impl");
337         }
338 
339         if (dlFileShortcutLocalService == null) {
340             dlFileShortcutLocalService = (DLFileShortcutLocalService)PortalBeanLocatorUtil.locate(DLFileShortcutLocalService.class.getName() +
341                     ".impl");
342         }
343 
344         if (dlFileShortcutService == null) {
345             dlFileShortcutService = (DLFileShortcutService)PortalBeanLocatorUtil.locate(DLFileShortcutService.class.getName() +
346                     ".impl");
347         }
348 
349         if (dlFileShortcutPersistence == null) {
350             dlFileShortcutPersistence = (DLFileShortcutPersistence)PortalBeanLocatorUtil.locate(DLFileShortcutPersistence.class.getName() +
351                     ".impl");
352         }
353 
354         if (dlFileShortcutFinder == null) {
355             dlFileShortcutFinder = (DLFileShortcutFinder)PortalBeanLocatorUtil.locate(DLFileShortcutFinder.class.getName() +
356                     ".impl");
357         }
358 
359         if (dlFileVersionLocalService == null) {
360             dlFileVersionLocalService = (DLFileVersionLocalService)PortalBeanLocatorUtil.locate(DLFileVersionLocalService.class.getName() +
361                     ".impl");
362         }
363 
364         if (dlFileVersionPersistence == null) {
365             dlFileVersionPersistence = (DLFileVersionPersistence)PortalBeanLocatorUtil.locate(DLFileVersionPersistence.class.getName() +
366                     ".impl");
367         }
368 
369         if (dlFolderLocalService == null) {
370             dlFolderLocalService = (DLFolderLocalService)PortalBeanLocatorUtil.locate(DLFolderLocalService.class.getName() +
371                     ".impl");
372         }
373 
374         if (dlFolderService == null) {
375             dlFolderService = (DLFolderService)PortalBeanLocatorUtil.locate(DLFolderService.class.getName() +
376                     ".impl");
377         }
378 
379         if (dlFolderPersistence == null) {
380             dlFolderPersistence = (DLFolderPersistence)PortalBeanLocatorUtil.locate(DLFolderPersistence.class.getName() +
381                     ".impl");
382         }
383 
384         if (counterLocalService == null) {
385             counterLocalService = (CounterLocalService)PortalBeanLocatorUtil.locate(CounterLocalService.class.getName() +
386                     ".impl");
387         }
388 
389         if (counterService == null) {
390             counterService = (CounterService)PortalBeanLocatorUtil.locate(CounterService.class.getName() +
391                     ".impl");
392         }
393 
394         if (layoutLocalService == null) {
395             layoutLocalService = (LayoutLocalService)PortalBeanLocatorUtil.locate(LayoutLocalService.class.getName() +
396                     ".impl");
397         }
398 
399         if (layoutService == null) {
400             layoutService = (LayoutService)PortalBeanLocatorUtil.locate(LayoutService.class.getName() +
401                     ".impl");
402         }
403 
404         if (layoutPersistence == null) {
405             layoutPersistence = (LayoutPersistence)PortalBeanLocatorUtil.locate(LayoutPersistence.class.getName() +
406                     ".impl");
407         }
408 
409         if (layoutFinder == null) {
410             layoutFinder = (LayoutFinder)PortalBeanLocatorUtil.locate(LayoutFinder.class.getName() +
411                     ".impl");
412         }
413     }
414 
415     protected DLFileEntryLocalService dlFileEntryLocalService;
416     protected DLFileEntryService dlFileEntryService;
417     protected DLFileEntryPersistence dlFileEntryPersistence;
418     protected DLFileEntryFinder dlFileEntryFinder;
419     protected DLFileEntryAndShortcutFinder dlFileEntryAndShortcutFinder;
420     protected DLFileRankPersistence dlFileRankPersistence;
421     protected DLFileRankFinder dlFileRankFinder;
422     protected DLFileShortcutLocalService dlFileShortcutLocalService;
423     protected DLFileShortcutService dlFileShortcutService;
424     protected DLFileShortcutPersistence dlFileShortcutPersistence;
425     protected DLFileShortcutFinder dlFileShortcutFinder;
426     protected DLFileVersionLocalService dlFileVersionLocalService;
427     protected DLFileVersionPersistence dlFileVersionPersistence;
428     protected DLFolderLocalService dlFolderLocalService;
429     protected DLFolderService dlFolderService;
430     protected DLFolderPersistence dlFolderPersistence;
431     protected CounterLocalService counterLocalService;
432     protected CounterService counterService;
433     protected LayoutLocalService layoutLocalService;
434     protected LayoutService layoutService;
435     protected LayoutPersistence layoutPersistence;
436     protected LayoutFinder layoutFinder;
437 }