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  
34  import com.liferay.portlet.softwarecatalog.model.SCLicense;
35  import com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionLocalService;
36  import com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionService;
37  import com.liferay.portlet.softwarecatalog.service.SCLicenseLocalService;
38  import com.liferay.portlet.softwarecatalog.service.SCProductEntryLocalService;
39  import com.liferay.portlet.softwarecatalog.service.SCProductEntryService;
40  import com.liferay.portlet.softwarecatalog.service.SCProductScreenshotLocalService;
41  import com.liferay.portlet.softwarecatalog.service.SCProductVersionLocalService;
42  import com.liferay.portlet.softwarecatalog.service.SCProductVersionService;
43  import com.liferay.portlet.softwarecatalog.service.persistence.SCFrameworkVersionPersistence;
44  import com.liferay.portlet.softwarecatalog.service.persistence.SCLicensePersistence;
45  import com.liferay.portlet.softwarecatalog.service.persistence.SCProductEntryPersistence;
46  import com.liferay.portlet.softwarecatalog.service.persistence.SCProductScreenshotPersistence;
47  import com.liferay.portlet.softwarecatalog.service.persistence.SCProductVersionPersistence;
48  
49  import java.util.List;
50  
51  /**
52   * <a href="SCLicenseLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
53   *
54   * @author Brian Wing Shun Chan
55   *
56   */
57  public abstract class SCLicenseLocalServiceBaseImpl
58      implements SCLicenseLocalService, InitializingBean {
59      public SCLicense addSCLicense(SCLicense scLicense)
60          throws SystemException {
61          scLicense.setNew(true);
62  
63          return scLicensePersistence.update(scLicense, false);
64      }
65  
66      public void deleteSCLicense(long licenseId)
67          throws PortalException, SystemException {
68          scLicensePersistence.remove(licenseId);
69      }
70  
71      public void deleteSCLicense(SCLicense scLicense) throws SystemException {
72          scLicensePersistence.remove(scLicense);
73      }
74  
75      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
76          throws SystemException {
77          return scLicensePersistence.findWithDynamicQuery(dynamicQuery);
78      }
79  
80      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
81          int end) throws SystemException {
82          return scLicensePersistence.findWithDynamicQuery(dynamicQuery, start,
83              end);
84      }
85  
86      public SCLicense getSCLicense(long licenseId)
87          throws PortalException, SystemException {
88          return scLicensePersistence.findByPrimaryKey(licenseId);
89      }
90  
91      public List<SCLicense> getSCLicenses(int start, int end)
92          throws SystemException {
93          return scLicensePersistence.findAll(start, end);
94      }
95  
96      public int getSCLicensesCount() throws SystemException {
97          return scLicensePersistence.countAll();
98      }
99  
100     public SCLicense updateSCLicense(SCLicense scLicense)
101         throws SystemException {
102         scLicense.setNew(false);
103 
104         return scLicensePersistence.update(scLicense, true);
105     }
106 
107     public SCLicensePersistence getSCLicensePersistence() {
108         return scLicensePersistence;
109     }
110 
111     public void setSCLicensePersistence(
112         SCLicensePersistence scLicensePersistence) {
113         this.scLicensePersistence = scLicensePersistence;
114     }
115 
116     public SCFrameworkVersionLocalService getSCFrameworkVersionLocalService() {
117         return scFrameworkVersionLocalService;
118     }
119 
120     public void setSCFrameworkVersionLocalService(
121         SCFrameworkVersionLocalService scFrameworkVersionLocalService) {
122         this.scFrameworkVersionLocalService = scFrameworkVersionLocalService;
123     }
124 
125     public SCFrameworkVersionService getSCFrameworkVersionService() {
126         return scFrameworkVersionService;
127     }
128 
129     public void setSCFrameworkVersionService(
130         SCFrameworkVersionService scFrameworkVersionService) {
131         this.scFrameworkVersionService = scFrameworkVersionService;
132     }
133 
134     public SCFrameworkVersionPersistence getSCFrameworkVersionPersistence() {
135         return scFrameworkVersionPersistence;
136     }
137 
138     public void setSCFrameworkVersionPersistence(
139         SCFrameworkVersionPersistence scFrameworkVersionPersistence) {
140         this.scFrameworkVersionPersistence = scFrameworkVersionPersistence;
141     }
142 
143     public SCProductEntryLocalService getSCProductEntryLocalService() {
144         return scProductEntryLocalService;
145     }
146 
147     public void setSCProductEntryLocalService(
148         SCProductEntryLocalService scProductEntryLocalService) {
149         this.scProductEntryLocalService = scProductEntryLocalService;
150     }
151 
152     public SCProductEntryService getSCProductEntryService() {
153         return scProductEntryService;
154     }
155 
156     public void setSCProductEntryService(
157         SCProductEntryService scProductEntryService) {
158         this.scProductEntryService = scProductEntryService;
159     }
160 
161     public SCProductEntryPersistence getSCProductEntryPersistence() {
162         return scProductEntryPersistence;
163     }
164 
165     public void setSCProductEntryPersistence(
166         SCProductEntryPersistence scProductEntryPersistence) {
167         this.scProductEntryPersistence = scProductEntryPersistence;
168     }
169 
170     public SCProductScreenshotLocalService getSCProductScreenshotLocalService() {
171         return scProductScreenshotLocalService;
172     }
173 
174     public void setSCProductScreenshotLocalService(
175         SCProductScreenshotLocalService scProductScreenshotLocalService) {
176         this.scProductScreenshotLocalService = scProductScreenshotLocalService;
177     }
178 
179     public SCProductScreenshotPersistence getSCProductScreenshotPersistence() {
180         return scProductScreenshotPersistence;
181     }
182 
183     public void setSCProductScreenshotPersistence(
184         SCProductScreenshotPersistence scProductScreenshotPersistence) {
185         this.scProductScreenshotPersistence = scProductScreenshotPersistence;
186     }
187 
188     public SCProductVersionLocalService getSCProductVersionLocalService() {
189         return scProductVersionLocalService;
190     }
191 
192     public void setSCProductVersionLocalService(
193         SCProductVersionLocalService scProductVersionLocalService) {
194         this.scProductVersionLocalService = scProductVersionLocalService;
195     }
196 
197     public SCProductVersionService getSCProductVersionService() {
198         return scProductVersionService;
199     }
200 
201     public void setSCProductVersionService(
202         SCProductVersionService scProductVersionService) {
203         this.scProductVersionService = scProductVersionService;
204     }
205 
206     public SCProductVersionPersistence getSCProductVersionPersistence() {
207         return scProductVersionPersistence;
208     }
209 
210     public void setSCProductVersionPersistence(
211         SCProductVersionPersistence scProductVersionPersistence) {
212         this.scProductVersionPersistence = scProductVersionPersistence;
213     }
214 
215     public CounterLocalService getCounterLocalService() {
216         return counterLocalService;
217     }
218 
219     public void setCounterLocalService(CounterLocalService counterLocalService) {
220         this.counterLocalService = counterLocalService;
221     }
222 
223     public CounterService getCounterService() {
224         return counterService;
225     }
226 
227     public void setCounterService(CounterService counterService) {
228         this.counterService = counterService;
229     }
230 
231     public void afterPropertiesSet() {
232         if (scLicensePersistence == null) {
233             scLicensePersistence = (SCLicensePersistence)PortalBeanLocatorUtil.locate(SCLicensePersistence.class.getName() +
234                     ".impl");
235         }
236 
237         if (scFrameworkVersionLocalService == null) {
238             scFrameworkVersionLocalService = (SCFrameworkVersionLocalService)PortalBeanLocatorUtil.locate(SCFrameworkVersionLocalService.class.getName() +
239                     ".impl");
240         }
241 
242         if (scFrameworkVersionService == null) {
243             scFrameworkVersionService = (SCFrameworkVersionService)PortalBeanLocatorUtil.locate(SCFrameworkVersionService.class.getName() +
244                     ".impl");
245         }
246 
247         if (scFrameworkVersionPersistence == null) {
248             scFrameworkVersionPersistence = (SCFrameworkVersionPersistence)PortalBeanLocatorUtil.locate(SCFrameworkVersionPersistence.class.getName() +
249                     ".impl");
250         }
251 
252         if (scProductEntryLocalService == null) {
253             scProductEntryLocalService = (SCProductEntryLocalService)PortalBeanLocatorUtil.locate(SCProductEntryLocalService.class.getName() +
254                     ".impl");
255         }
256 
257         if (scProductEntryService == null) {
258             scProductEntryService = (SCProductEntryService)PortalBeanLocatorUtil.locate(SCProductEntryService.class.getName() +
259                     ".impl");
260         }
261 
262         if (scProductEntryPersistence == null) {
263             scProductEntryPersistence = (SCProductEntryPersistence)PortalBeanLocatorUtil.locate(SCProductEntryPersistence.class.getName() +
264                     ".impl");
265         }
266 
267         if (scProductScreenshotLocalService == null) {
268             scProductScreenshotLocalService = (SCProductScreenshotLocalService)PortalBeanLocatorUtil.locate(SCProductScreenshotLocalService.class.getName() +
269                     ".impl");
270         }
271 
272         if (scProductScreenshotPersistence == null) {
273             scProductScreenshotPersistence = (SCProductScreenshotPersistence)PortalBeanLocatorUtil.locate(SCProductScreenshotPersistence.class.getName() +
274                     ".impl");
275         }
276 
277         if (scProductVersionLocalService == null) {
278             scProductVersionLocalService = (SCProductVersionLocalService)PortalBeanLocatorUtil.locate(SCProductVersionLocalService.class.getName() +
279                     ".impl");
280         }
281 
282         if (scProductVersionService == null) {
283             scProductVersionService = (SCProductVersionService)PortalBeanLocatorUtil.locate(SCProductVersionService.class.getName() +
284                     ".impl");
285         }
286 
287         if (scProductVersionPersistence == null) {
288             scProductVersionPersistence = (SCProductVersionPersistence)PortalBeanLocatorUtil.locate(SCProductVersionPersistence.class.getName() +
289                     ".impl");
290         }
291 
292         if (counterLocalService == null) {
293             counterLocalService = (CounterLocalService)PortalBeanLocatorUtil.locate(CounterLocalService.class.getName() +
294                     ".impl");
295         }
296 
297         if (counterService == null) {
298             counterService = (CounterService)PortalBeanLocatorUtil.locate(CounterService.class.getName() +
299                     ".impl");
300         }
301     }
302 
303     protected SCLicensePersistence scLicensePersistence;
304     protected SCFrameworkVersionLocalService scFrameworkVersionLocalService;
305     protected SCFrameworkVersionService scFrameworkVersionService;
306     protected SCFrameworkVersionPersistence scFrameworkVersionPersistence;
307     protected SCProductEntryLocalService scProductEntryLocalService;
308     protected SCProductEntryService scProductEntryService;
309     protected SCProductEntryPersistence scProductEntryPersistence;
310     protected SCProductScreenshotLocalService scProductScreenshotLocalService;
311     protected SCProductScreenshotPersistence scProductScreenshotPersistence;
312     protected SCProductVersionLocalService scProductVersionLocalService;
313     protected SCProductVersionService scProductVersionService;
314     protected SCProductVersionPersistence scProductVersionPersistence;
315     protected CounterLocalService counterLocalService;
316     protected CounterService counterService;
317 }