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