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.SystemException;
31  import com.liferay.portal.kernel.dao.DynamicQueryInitializer;
32  
33  import com.liferay.portlet.softwarecatalog.model.SCLicense;
34  import com.liferay.portlet.softwarecatalog.model.impl.SCLicenseImpl;
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 model) throws SystemException {
74          SCLicense scLicense = new SCLicenseImpl();
75  
76          scLicense.setNew(true);
77  
78          scLicense.setLicenseId(model.getLicenseId());
79          scLicense.setName(model.getName());
80          scLicense.setUrl(model.getUrl());
81          scLicense.setOpenSource(model.getOpenSource());
82          scLicense.setActive(model.getActive());
83          scLicense.setRecommended(model.getRecommended());
84  
85          return scLicensePersistence.update(scLicense);
86      }
87  
88      public List dynamicQuery(DynamicQueryInitializer queryInitializer)
89          throws SystemException {
90          return scLicensePersistence.findWithDynamicQuery(queryInitializer);
91      }
92  
93      public List dynamicQuery(DynamicQueryInitializer queryInitializer,
94          int begin, int end) throws SystemException {
95          return scLicensePersistence.findWithDynamicQuery(queryInitializer,
96              begin, end);
97      }
98  
99      public SCLicense updateSCLicense(SCLicense model) throws SystemException {
100         SCLicense scLicense = new SCLicenseImpl();
101 
102         scLicense.setNew(false);
103 
104         scLicense.setLicenseId(model.getLicenseId());
105         scLicense.setName(model.getName());
106         scLicense.setUrl(model.getUrl());
107         scLicense.setOpenSource(model.getOpenSource());
108         scLicense.setActive(model.getActive());
109         scLicense.setRecommended(model.getRecommended());
110 
111         return scLicensePersistence.update(scLicense);
112     }
113 
114     public SCLicensePersistence getSCLicensePersistence() {
115         return scLicensePersistence;
116     }
117 
118     public void setSCLicensePersistence(
119         SCLicensePersistence scLicensePersistence) {
120         this.scLicensePersistence = scLicensePersistence;
121     }
122 
123     public SCFrameworkVersionLocalService getSCFrameworkVersionLocalService() {
124         return scFrameworkVersionLocalService;
125     }
126 
127     public void setSCFrameworkVersionLocalService(
128         SCFrameworkVersionLocalService scFrameworkVersionLocalService) {
129         this.scFrameworkVersionLocalService = scFrameworkVersionLocalService;
130     }
131 
132     public SCFrameworkVersionService getSCFrameworkVersionService() {
133         return scFrameworkVersionService;
134     }
135 
136     public void setSCFrameworkVersionService(
137         SCFrameworkVersionService scFrameworkVersionService) {
138         this.scFrameworkVersionService = scFrameworkVersionService;
139     }
140 
141     public SCFrameworkVersionPersistence getSCFrameworkVersionPersistence() {
142         return scFrameworkVersionPersistence;
143     }
144 
145     public void setSCFrameworkVersionPersistence(
146         SCFrameworkVersionPersistence scFrameworkVersionPersistence) {
147         this.scFrameworkVersionPersistence = scFrameworkVersionPersistence;
148     }
149 
150     public SCProductEntryLocalService getSCProductEntryLocalService() {
151         return scProductEntryLocalService;
152     }
153 
154     public void setSCProductEntryLocalService(
155         SCProductEntryLocalService scProductEntryLocalService) {
156         this.scProductEntryLocalService = scProductEntryLocalService;
157     }
158 
159     public SCProductEntryService getSCProductEntryService() {
160         return scProductEntryService;
161     }
162 
163     public void setSCProductEntryService(
164         SCProductEntryService scProductEntryService) {
165         this.scProductEntryService = scProductEntryService;
166     }
167 
168     public SCProductEntryPersistence getSCProductEntryPersistence() {
169         return scProductEntryPersistence;
170     }
171 
172     public void setSCProductEntryPersistence(
173         SCProductEntryPersistence scProductEntryPersistence) {
174         this.scProductEntryPersistence = scProductEntryPersistence;
175     }
176 
177     public SCProductScreenshotLocalService getSCProductScreenshotLocalService() {
178         return scProductScreenshotLocalService;
179     }
180 
181     public void setSCProductScreenshotLocalService(
182         SCProductScreenshotLocalService scProductScreenshotLocalService) {
183         this.scProductScreenshotLocalService = scProductScreenshotLocalService;
184     }
185 
186     public SCProductScreenshotPersistence getSCProductScreenshotPersistence() {
187         return scProductScreenshotPersistence;
188     }
189 
190     public void setSCProductScreenshotPersistence(
191         SCProductScreenshotPersistence scProductScreenshotPersistence) {
192         this.scProductScreenshotPersistence = scProductScreenshotPersistence;
193     }
194 
195     public SCProductVersionLocalService getSCProductVersionLocalService() {
196         return scProductVersionLocalService;
197     }
198 
199     public void setSCProductVersionLocalService(
200         SCProductVersionLocalService scProductVersionLocalService) {
201         this.scProductVersionLocalService = scProductVersionLocalService;
202     }
203 
204     public SCProductVersionService getSCProductVersionService() {
205         return scProductVersionService;
206     }
207 
208     public void setSCProductVersionService(
209         SCProductVersionService scProductVersionService) {
210         this.scProductVersionService = scProductVersionService;
211     }
212 
213     public SCProductVersionPersistence getSCProductVersionPersistence() {
214         return scProductVersionPersistence;
215     }
216 
217     public void setSCProductVersionPersistence(
218         SCProductVersionPersistence scProductVersionPersistence) {
219         this.scProductVersionPersistence = scProductVersionPersistence;
220     }
221 
222     public CounterLocalService getCounterLocalService() {
223         return counterLocalService;
224     }
225 
226     public void setCounterLocalService(CounterLocalService counterLocalService) {
227         this.counterLocalService = counterLocalService;
228     }
229 
230     public CounterService getCounterService() {
231         return counterService;
232     }
233 
234     public void setCounterService(CounterService counterService) {
235         this.counterService = counterService;
236     }
237 
238     public void afterPropertiesSet() {
239         if (scLicensePersistence == null) {
240             scLicensePersistence = SCLicenseUtil.getPersistence();
241         }
242 
243         if (scFrameworkVersionLocalService == null) {
244             scFrameworkVersionLocalService = SCFrameworkVersionLocalServiceFactory.getImpl();
245         }
246 
247         if (scFrameworkVersionService == null) {
248             scFrameworkVersionService = SCFrameworkVersionServiceFactory.getImpl();
249         }
250 
251         if (scFrameworkVersionPersistence == null) {
252             scFrameworkVersionPersistence = SCFrameworkVersionUtil.getPersistence();
253         }
254 
255         if (scProductEntryLocalService == null) {
256             scProductEntryLocalService = SCProductEntryLocalServiceFactory.getImpl();
257         }
258 
259         if (scProductEntryService == null) {
260             scProductEntryService = SCProductEntryServiceFactory.getImpl();
261         }
262 
263         if (scProductEntryPersistence == null) {
264             scProductEntryPersistence = SCProductEntryUtil.getPersistence();
265         }
266 
267         if (scProductScreenshotLocalService == null) {
268             scProductScreenshotLocalService = SCProductScreenshotLocalServiceFactory.getImpl();
269         }
270 
271         if (scProductScreenshotPersistence == null) {
272             scProductScreenshotPersistence = SCProductScreenshotUtil.getPersistence();
273         }
274 
275         if (scProductVersionLocalService == null) {
276             scProductVersionLocalService = SCProductVersionLocalServiceFactory.getImpl();
277         }
278 
279         if (scProductVersionService == null) {
280             scProductVersionService = SCProductVersionServiceFactory.getImpl();
281         }
282 
283         if (scProductVersionPersistence == null) {
284             scProductVersionPersistence = SCProductVersionUtil.getPersistence();
285         }
286 
287         if (counterLocalService == null) {
288             counterLocalService = CounterLocalServiceFactory.getImpl();
289         }
290 
291         if (counterService == null) {
292             counterService = CounterServiceFactory.getImpl();
293         }
294     }
295 
296     protected SCLicensePersistence scLicensePersistence;
297     protected SCFrameworkVersionLocalService scFrameworkVersionLocalService;
298     protected SCFrameworkVersionService scFrameworkVersionService;
299     protected SCFrameworkVersionPersistence scFrameworkVersionPersistence;
300     protected SCProductEntryLocalService scProductEntryLocalService;
301     protected SCProductEntryService scProductEntryService;
302     protected SCProductEntryPersistence scProductEntryPersistence;
303     protected SCProductScreenshotLocalService scProductScreenshotLocalService;
304     protected SCProductScreenshotPersistence scProductScreenshotPersistence;
305     protected SCProductVersionLocalService scProductVersionLocalService;
306     protected SCProductVersionService scProductVersionService;
307     protected SCProductVersionPersistence scProductVersionPersistence;
308     protected CounterLocalService counterLocalService;
309     protected CounterService counterService;
310 }