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.portal.PortalException;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.bean.InitializingBean;
28  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
29  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
30  import com.liferay.portal.service.ImageLocalService;
31  import com.liferay.portal.service.persistence.ImagePersistence;
32  
33  import com.liferay.portlet.softwarecatalog.model.SCProductScreenshot;
34  import com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionLocalService;
35  import com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionService;
36  import com.liferay.portlet.softwarecatalog.service.SCLicenseLocalService;
37  import com.liferay.portlet.softwarecatalog.service.SCLicenseService;
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="SCProductScreenshotLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
53   *
54   * @author Brian Wing Shun Chan
55   *
56   */
57  public abstract class SCProductScreenshotLocalServiceBaseImpl
58      implements SCProductScreenshotLocalService, InitializingBean {
59      public SCProductScreenshot addSCProductScreenshot(
60          SCProductScreenshot scProductScreenshot) throws SystemException {
61          scProductScreenshot.setNew(true);
62  
63          return scProductScreenshotPersistence.update(scProductScreenshot, false);
64      }
65  
66      public void deleteSCProductScreenshot(long productScreenshotId)
67          throws PortalException, SystemException {
68          scProductScreenshotPersistence.remove(productScreenshotId);
69      }
70  
71      public void deleteSCProductScreenshot(
72          SCProductScreenshot scProductScreenshot) throws SystemException {
73          scProductScreenshotPersistence.remove(scProductScreenshot);
74      }
75  
76      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
77          throws SystemException {
78          return scProductScreenshotPersistence.findWithDynamicQuery(dynamicQuery);
79      }
80  
81      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
82          int end) throws SystemException {
83          return scProductScreenshotPersistence.findWithDynamicQuery(dynamicQuery,
84              start, end);
85      }
86  
87      public SCProductScreenshot getSCProductScreenshot(long productScreenshotId)
88          throws PortalException, SystemException {
89          return scProductScreenshotPersistence.findByPrimaryKey(productScreenshotId);
90      }
91  
92      public List<SCProductScreenshot> getSCProductScreenshots(int start, int end)
93          throws SystemException {
94          return scProductScreenshotPersistence.findAll(start, end);
95      }
96  
97      public int getSCProductScreenshotsCount() throws SystemException {
98          return scProductScreenshotPersistence.countAll();
99      }
100 
101     public SCProductScreenshot updateSCProductScreenshot(
102         SCProductScreenshot scProductScreenshot) throws SystemException {
103         scProductScreenshot.setNew(false);
104 
105         return scProductScreenshotPersistence.update(scProductScreenshot, true);
106     }
107 
108     public SCLicenseLocalService getSCLicenseLocalService() {
109         return scLicenseLocalService;
110     }
111 
112     public void setSCLicenseLocalService(
113         SCLicenseLocalService scLicenseLocalService) {
114         this.scLicenseLocalService = scLicenseLocalService;
115     }
116 
117     public SCLicenseService getSCLicenseService() {
118         return scLicenseService;
119     }
120 
121     public void setSCLicenseService(SCLicenseService scLicenseService) {
122         this.scLicenseService = scLicenseService;
123     }
124 
125     public SCLicensePersistence getSCLicensePersistence() {
126         return scLicensePersistence;
127     }
128 
129     public void setSCLicensePersistence(
130         SCLicensePersistence scLicensePersistence) {
131         this.scLicensePersistence = scLicensePersistence;
132     }
133 
134     public SCFrameworkVersionLocalService getSCFrameworkVersionLocalService() {
135         return scFrameworkVersionLocalService;
136     }
137 
138     public void setSCFrameworkVersionLocalService(
139         SCFrameworkVersionLocalService scFrameworkVersionLocalService) {
140         this.scFrameworkVersionLocalService = scFrameworkVersionLocalService;
141     }
142 
143     public SCFrameworkVersionService getSCFrameworkVersionService() {
144         return scFrameworkVersionService;
145     }
146 
147     public void setSCFrameworkVersionService(
148         SCFrameworkVersionService scFrameworkVersionService) {
149         this.scFrameworkVersionService = scFrameworkVersionService;
150     }
151 
152     public SCFrameworkVersionPersistence getSCFrameworkVersionPersistence() {
153         return scFrameworkVersionPersistence;
154     }
155 
156     public void setSCFrameworkVersionPersistence(
157         SCFrameworkVersionPersistence scFrameworkVersionPersistence) {
158         this.scFrameworkVersionPersistence = scFrameworkVersionPersistence;
159     }
160 
161     public SCProductEntryLocalService getSCProductEntryLocalService() {
162         return scProductEntryLocalService;
163     }
164 
165     public void setSCProductEntryLocalService(
166         SCProductEntryLocalService scProductEntryLocalService) {
167         this.scProductEntryLocalService = scProductEntryLocalService;
168     }
169 
170     public SCProductEntryService getSCProductEntryService() {
171         return scProductEntryService;
172     }
173 
174     public void setSCProductEntryService(
175         SCProductEntryService scProductEntryService) {
176         this.scProductEntryService = scProductEntryService;
177     }
178 
179     public SCProductEntryPersistence getSCProductEntryPersistence() {
180         return scProductEntryPersistence;
181     }
182 
183     public void setSCProductEntryPersistence(
184         SCProductEntryPersistence scProductEntryPersistence) {
185         this.scProductEntryPersistence = scProductEntryPersistence;
186     }
187 
188     public SCProductScreenshotPersistence getSCProductScreenshotPersistence() {
189         return scProductScreenshotPersistence;
190     }
191 
192     public void setSCProductScreenshotPersistence(
193         SCProductScreenshotPersistence scProductScreenshotPersistence) {
194         this.scProductScreenshotPersistence = scProductScreenshotPersistence;
195     }
196 
197     public SCProductVersionLocalService getSCProductVersionLocalService() {
198         return scProductVersionLocalService;
199     }
200 
201     public void setSCProductVersionLocalService(
202         SCProductVersionLocalService scProductVersionLocalService) {
203         this.scProductVersionLocalService = scProductVersionLocalService;
204     }
205 
206     public SCProductVersionService getSCProductVersionService() {
207         return scProductVersionService;
208     }
209 
210     public void setSCProductVersionService(
211         SCProductVersionService scProductVersionService) {
212         this.scProductVersionService = scProductVersionService;
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 ImageLocalService getImageLocalService() {
225         return imageLocalService;
226     }
227 
228     public void setImageLocalService(ImageLocalService imageLocalService) {
229         this.imageLocalService = imageLocalService;
230     }
231 
232     public ImagePersistence getImagePersistence() {
233         return imagePersistence;
234     }
235 
236     public void setImagePersistence(ImagePersistence imagePersistence) {
237         this.imagePersistence = imagePersistence;
238     }
239 
240     public void afterPropertiesSet() {
241         if (scLicenseLocalService == null) {
242             scLicenseLocalService = (SCLicenseLocalService)PortalBeanLocatorUtil.locate(SCLicenseLocalService.class.getName() +
243                     ".impl");
244         }
245 
246         if (scLicenseService == null) {
247             scLicenseService = (SCLicenseService)PortalBeanLocatorUtil.locate(SCLicenseService.class.getName() +
248                     ".impl");
249         }
250 
251         if (scLicensePersistence == null) {
252             scLicensePersistence = (SCLicensePersistence)PortalBeanLocatorUtil.locate(SCLicensePersistence.class.getName() +
253                     ".impl");
254         }
255 
256         if (scFrameworkVersionLocalService == null) {
257             scFrameworkVersionLocalService = (SCFrameworkVersionLocalService)PortalBeanLocatorUtil.locate(SCFrameworkVersionLocalService.class.getName() +
258                     ".impl");
259         }
260 
261         if (scFrameworkVersionService == null) {
262             scFrameworkVersionService = (SCFrameworkVersionService)PortalBeanLocatorUtil.locate(SCFrameworkVersionService.class.getName() +
263                     ".impl");
264         }
265 
266         if (scFrameworkVersionPersistence == null) {
267             scFrameworkVersionPersistence = (SCFrameworkVersionPersistence)PortalBeanLocatorUtil.locate(SCFrameworkVersionPersistence.class.getName() +
268                     ".impl");
269         }
270 
271         if (scProductEntryLocalService == null) {
272             scProductEntryLocalService = (SCProductEntryLocalService)PortalBeanLocatorUtil.locate(SCProductEntryLocalService.class.getName() +
273                     ".impl");
274         }
275 
276         if (scProductEntryService == null) {
277             scProductEntryService = (SCProductEntryService)PortalBeanLocatorUtil.locate(SCProductEntryService.class.getName() +
278                     ".impl");
279         }
280 
281         if (scProductEntryPersistence == null) {
282             scProductEntryPersistence = (SCProductEntryPersistence)PortalBeanLocatorUtil.locate(SCProductEntryPersistence.class.getName() +
283                     ".impl");
284         }
285 
286         if (scProductScreenshotPersistence == null) {
287             scProductScreenshotPersistence = (SCProductScreenshotPersistence)PortalBeanLocatorUtil.locate(SCProductScreenshotPersistence.class.getName() +
288                     ".impl");
289         }
290 
291         if (scProductVersionLocalService == null) {
292             scProductVersionLocalService = (SCProductVersionLocalService)PortalBeanLocatorUtil.locate(SCProductVersionLocalService.class.getName() +
293                     ".impl");
294         }
295 
296         if (scProductVersionService == null) {
297             scProductVersionService = (SCProductVersionService)PortalBeanLocatorUtil.locate(SCProductVersionService.class.getName() +
298                     ".impl");
299         }
300 
301         if (scProductVersionPersistence == null) {
302             scProductVersionPersistence = (SCProductVersionPersistence)PortalBeanLocatorUtil.locate(SCProductVersionPersistence.class.getName() +
303                     ".impl");
304         }
305 
306         if (imageLocalService == null) {
307             imageLocalService = (ImageLocalService)PortalBeanLocatorUtil.locate(ImageLocalService.class.getName() +
308                     ".impl");
309         }
310 
311         if (imagePersistence == null) {
312             imagePersistence = (ImagePersistence)PortalBeanLocatorUtil.locate(ImagePersistence.class.getName() +
313                     ".impl");
314         }
315     }
316 
317     protected SCLicenseLocalService scLicenseLocalService;
318     protected SCLicenseService scLicenseService;
319     protected SCLicensePersistence scLicensePersistence;
320     protected SCFrameworkVersionLocalService scFrameworkVersionLocalService;
321     protected SCFrameworkVersionService scFrameworkVersionService;
322     protected SCFrameworkVersionPersistence scFrameworkVersionPersistence;
323     protected SCProductEntryLocalService scProductEntryLocalService;
324     protected SCProductEntryService scProductEntryService;
325     protected SCProductEntryPersistence scProductEntryPersistence;
326     protected SCProductScreenshotPersistence scProductScreenshotPersistence;
327     protected SCProductVersionLocalService scProductVersionLocalService;
328     protected SCProductVersionService scProductVersionService;
329     protected SCProductVersionPersistence scProductVersionPersistence;
330     protected ImageLocalService imageLocalService;
331     protected ImagePersistence imagePersistence;
332 }