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