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