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