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.softwarecatalog.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.UserLocalService;
34  import com.liferay.portal.service.UserService;
35  import com.liferay.portal.service.persistence.UserFinder;
36  import com.liferay.portal.service.persistence.UserPersistence;
37  
38  import com.liferay.portlet.softwarecatalog.model.SCProductVersion;
39  import com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionLocalService;
40  import com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionService;
41  import com.liferay.portlet.softwarecatalog.service.SCLicenseLocalService;
42  import com.liferay.portlet.softwarecatalog.service.SCLicenseService;
43  import com.liferay.portlet.softwarecatalog.service.SCProductEntryLocalService;
44  import com.liferay.portlet.softwarecatalog.service.SCProductEntryService;
45  import com.liferay.portlet.softwarecatalog.service.SCProductScreenshotLocalService;
46  import com.liferay.portlet.softwarecatalog.service.SCProductVersionLocalService;
47  import com.liferay.portlet.softwarecatalog.service.persistence.SCFrameworkVersionPersistence;
48  import com.liferay.portlet.softwarecatalog.service.persistence.SCLicensePersistence;
49  import com.liferay.portlet.softwarecatalog.service.persistence.SCProductEntryPersistence;
50  import com.liferay.portlet.softwarecatalog.service.persistence.SCProductScreenshotPersistence;
51  import com.liferay.portlet.softwarecatalog.service.persistence.SCProductVersionPersistence;
52  
53  import java.util.List;
54  
55  /**
56   * <a href="SCProductVersionLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
57   *
58   * @author Brian Wing Shun Chan
59   *
60   */
61  public abstract class SCProductVersionLocalServiceBaseImpl
62      implements SCProductVersionLocalService, InitializingBean {
63      public SCProductVersion addSCProductVersion(
64          SCProductVersion scProductVersion) throws SystemException {
65          scProductVersion.setNew(true);
66  
67          return scProductVersionPersistence.update(scProductVersion, false);
68      }
69  
70      public void deleteSCProductVersion(long productVersionId)
71          throws PortalException, SystemException {
72          scProductVersionPersistence.remove(productVersionId);
73      }
74  
75      public void deleteSCProductVersion(SCProductVersion scProductVersion)
76          throws SystemException {
77          scProductVersionPersistence.remove(scProductVersion);
78      }
79  
80      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
81          throws SystemException {
82          return scProductVersionPersistence.findWithDynamicQuery(dynamicQuery);
83      }
84  
85      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
86          int end) throws SystemException {
87          return scProductVersionPersistence.findWithDynamicQuery(dynamicQuery,
88              start, end);
89      }
90  
91      public SCProductVersion getSCProductVersion(long productVersionId)
92          throws PortalException, SystemException {
93          return scProductVersionPersistence.findByPrimaryKey(productVersionId);
94      }
95  
96      public List<SCProductVersion> getSCProductVersions(int start, int end)
97          throws SystemException {
98          return scProductVersionPersistence.findAll(start, end);
99      }
100 
101     public int getSCProductVersionsCount() throws SystemException {
102         return scProductVersionPersistence.countAll();
103     }
104 
105     public SCProductVersion updateSCProductVersion(
106         SCProductVersion scProductVersion) throws SystemException {
107         scProductVersion.setNew(false);
108 
109         return scProductVersionPersistence.update(scProductVersion, true);
110     }
111 
112     public SCLicenseLocalService getSCLicenseLocalService() {
113         return scLicenseLocalService;
114     }
115 
116     public void setSCLicenseLocalService(
117         SCLicenseLocalService scLicenseLocalService) {
118         this.scLicenseLocalService = scLicenseLocalService;
119     }
120 
121     public SCLicenseService getSCLicenseService() {
122         return scLicenseService;
123     }
124 
125     public void setSCLicenseService(SCLicenseService scLicenseService) {
126         this.scLicenseService = scLicenseService;
127     }
128 
129     public SCLicensePersistence getSCLicensePersistence() {
130         return scLicensePersistence;
131     }
132 
133     public void setSCLicensePersistence(
134         SCLicensePersistence scLicensePersistence) {
135         this.scLicensePersistence = scLicensePersistence;
136     }
137 
138     public SCFrameworkVersionLocalService getSCFrameworkVersionLocalService() {
139         return scFrameworkVersionLocalService;
140     }
141 
142     public void setSCFrameworkVersionLocalService(
143         SCFrameworkVersionLocalService scFrameworkVersionLocalService) {
144         this.scFrameworkVersionLocalService = scFrameworkVersionLocalService;
145     }
146 
147     public SCFrameworkVersionService getSCFrameworkVersionService() {
148         return scFrameworkVersionService;
149     }
150 
151     public void setSCFrameworkVersionService(
152         SCFrameworkVersionService scFrameworkVersionService) {
153         this.scFrameworkVersionService = scFrameworkVersionService;
154     }
155 
156     public SCFrameworkVersionPersistence getSCFrameworkVersionPersistence() {
157         return scFrameworkVersionPersistence;
158     }
159 
160     public void setSCFrameworkVersionPersistence(
161         SCFrameworkVersionPersistence scFrameworkVersionPersistence) {
162         this.scFrameworkVersionPersistence = scFrameworkVersionPersistence;
163     }
164 
165     public SCProductEntryLocalService getSCProductEntryLocalService() {
166         return scProductEntryLocalService;
167     }
168 
169     public void setSCProductEntryLocalService(
170         SCProductEntryLocalService scProductEntryLocalService) {
171         this.scProductEntryLocalService = scProductEntryLocalService;
172     }
173 
174     public SCProductEntryService getSCProductEntryService() {
175         return scProductEntryService;
176     }
177 
178     public void setSCProductEntryService(
179         SCProductEntryService scProductEntryService) {
180         this.scProductEntryService = scProductEntryService;
181     }
182 
183     public SCProductEntryPersistence getSCProductEntryPersistence() {
184         return scProductEntryPersistence;
185     }
186 
187     public void setSCProductEntryPersistence(
188         SCProductEntryPersistence scProductEntryPersistence) {
189         this.scProductEntryPersistence = scProductEntryPersistence;
190     }
191 
192     public SCProductScreenshotLocalService getSCProductScreenshotLocalService() {
193         return scProductScreenshotLocalService;
194     }
195 
196     public void setSCProductScreenshotLocalService(
197         SCProductScreenshotLocalService scProductScreenshotLocalService) {
198         this.scProductScreenshotLocalService = scProductScreenshotLocalService;
199     }
200 
201     public SCProductScreenshotPersistence getSCProductScreenshotPersistence() {
202         return scProductScreenshotPersistence;
203     }
204 
205     public void setSCProductScreenshotPersistence(
206         SCProductScreenshotPersistence scProductScreenshotPersistence) {
207         this.scProductScreenshotPersistence = scProductScreenshotPersistence;
208     }
209 
210     public SCProductVersionPersistence getSCProductVersionPersistence() {
211         return scProductVersionPersistence;
212     }
213 
214     public void setSCProductVersionPersistence(
215         SCProductVersionPersistence scProductVersionPersistence) {
216         this.scProductVersionPersistence = scProductVersionPersistence;
217     }
218 
219     public CounterLocalService getCounterLocalService() {
220         return counterLocalService;
221     }
222 
223     public void setCounterLocalService(CounterLocalService counterLocalService) {
224         this.counterLocalService = counterLocalService;
225     }
226 
227     public CounterService getCounterService() {
228         return counterService;
229     }
230 
231     public void setCounterService(CounterService counterService) {
232         this.counterService = counterService;
233     }
234 
235     public UserLocalService getUserLocalService() {
236         return userLocalService;
237     }
238 
239     public void setUserLocalService(UserLocalService userLocalService) {
240         this.userLocalService = userLocalService;
241     }
242 
243     public UserService getUserService() {
244         return userService;
245     }
246 
247     public void setUserService(UserService userService) {
248         this.userService = userService;
249     }
250 
251     public UserPersistence getUserPersistence() {
252         return userPersistence;
253     }
254 
255     public void setUserPersistence(UserPersistence userPersistence) {
256         this.userPersistence = userPersistence;
257     }
258 
259     public UserFinder getUserFinder() {
260         return userFinder;
261     }
262 
263     public void setUserFinder(UserFinder userFinder) {
264         this.userFinder = userFinder;
265     }
266 
267     public void afterPropertiesSet() {
268         if (scLicenseLocalService == null) {
269             scLicenseLocalService = (SCLicenseLocalService)PortalBeanLocatorUtil.locate(SCLicenseLocalService.class.getName() +
270                     ".impl");
271         }
272 
273         if (scLicenseService == null) {
274             scLicenseService = (SCLicenseService)PortalBeanLocatorUtil.locate(SCLicenseService.class.getName() +
275                     ".impl");
276         }
277 
278         if (scLicensePersistence == null) {
279             scLicensePersistence = (SCLicensePersistence)PortalBeanLocatorUtil.locate(SCLicensePersistence.class.getName() +
280                     ".impl");
281         }
282 
283         if (scFrameworkVersionLocalService == null) {
284             scFrameworkVersionLocalService = (SCFrameworkVersionLocalService)PortalBeanLocatorUtil.locate(SCFrameworkVersionLocalService.class.getName() +
285                     ".impl");
286         }
287 
288         if (scFrameworkVersionService == null) {
289             scFrameworkVersionService = (SCFrameworkVersionService)PortalBeanLocatorUtil.locate(SCFrameworkVersionService.class.getName() +
290                     ".impl");
291         }
292 
293         if (scFrameworkVersionPersistence == null) {
294             scFrameworkVersionPersistence = (SCFrameworkVersionPersistence)PortalBeanLocatorUtil.locate(SCFrameworkVersionPersistence.class.getName() +
295                     ".impl");
296         }
297 
298         if (scProductEntryLocalService == null) {
299             scProductEntryLocalService = (SCProductEntryLocalService)PortalBeanLocatorUtil.locate(SCProductEntryLocalService.class.getName() +
300                     ".impl");
301         }
302 
303         if (scProductEntryService == null) {
304             scProductEntryService = (SCProductEntryService)PortalBeanLocatorUtil.locate(SCProductEntryService.class.getName() +
305                     ".impl");
306         }
307 
308         if (scProductEntryPersistence == null) {
309             scProductEntryPersistence = (SCProductEntryPersistence)PortalBeanLocatorUtil.locate(SCProductEntryPersistence.class.getName() +
310                     ".impl");
311         }
312 
313         if (scProductScreenshotLocalService == null) {
314             scProductScreenshotLocalService = (SCProductScreenshotLocalService)PortalBeanLocatorUtil.locate(SCProductScreenshotLocalService.class.getName() +
315                     ".impl");
316         }
317 
318         if (scProductScreenshotPersistence == null) {
319             scProductScreenshotPersistence = (SCProductScreenshotPersistence)PortalBeanLocatorUtil.locate(SCProductScreenshotPersistence.class.getName() +
320                     ".impl");
321         }
322 
323         if (scProductVersionPersistence == null) {
324             scProductVersionPersistence = (SCProductVersionPersistence)PortalBeanLocatorUtil.locate(SCProductVersionPersistence.class.getName() +
325                     ".impl");
326         }
327 
328         if (counterLocalService == null) {
329             counterLocalService = (CounterLocalService)PortalBeanLocatorUtil.locate(CounterLocalService.class.getName() +
330                     ".impl");
331         }
332 
333         if (counterService == null) {
334             counterService = (CounterService)PortalBeanLocatorUtil.locate(CounterService.class.getName() +
335                     ".impl");
336         }
337 
338         if (userLocalService == null) {
339             userLocalService = (UserLocalService)PortalBeanLocatorUtil.locate(UserLocalService.class.getName() +
340                     ".impl");
341         }
342 
343         if (userService == null) {
344             userService = (UserService)PortalBeanLocatorUtil.locate(UserService.class.getName() +
345                     ".impl");
346         }
347 
348         if (userPersistence == null) {
349             userPersistence = (UserPersistence)PortalBeanLocatorUtil.locate(UserPersistence.class.getName() +
350                     ".impl");
351         }
352 
353         if (userFinder == null) {
354             userFinder = (UserFinder)PortalBeanLocatorUtil.locate(UserFinder.class.getName() +
355                     ".impl");
356         }
357     }
358 
359     protected SCLicenseLocalService scLicenseLocalService;
360     protected SCLicenseService scLicenseService;
361     protected SCLicensePersistence scLicensePersistence;
362     protected SCFrameworkVersionLocalService scFrameworkVersionLocalService;
363     protected SCFrameworkVersionService scFrameworkVersionService;
364     protected SCFrameworkVersionPersistence scFrameworkVersionPersistence;
365     protected SCProductEntryLocalService scProductEntryLocalService;
366     protected SCProductEntryService scProductEntryService;
367     protected SCProductEntryPersistence scProductEntryPersistence;
368     protected SCProductScreenshotLocalService scProductScreenshotLocalService;
369     protected SCProductScreenshotPersistence scProductScreenshotPersistence;
370     protected SCProductVersionPersistence scProductVersionPersistence;
371     protected CounterLocalService counterLocalService;
372     protected CounterService counterService;
373     protected UserLocalService userLocalService;
374     protected UserService userService;
375     protected UserPersistence userPersistence;
376     protected UserFinder userFinder;
377 }