1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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.annotation.BeanReference;
31  import com.liferay.portal.kernel.dao.db.DB;
32  import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
33  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
34  import com.liferay.portal.service.ResourceLocalService;
35  import com.liferay.portal.service.ResourceService;
36  import com.liferay.portal.service.UserLocalService;
37  import com.liferay.portal.service.UserService;
38  import com.liferay.portal.service.persistence.ResourceFinder;
39  import com.liferay.portal.service.persistence.ResourcePersistence;
40  import com.liferay.portal.service.persistence.UserFinder;
41  import com.liferay.portal.service.persistence.UserPersistence;
42  
43  import com.liferay.portlet.softwarecatalog.model.SCLicense;
44  import com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionLocalService;
45  import com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionService;
46  import com.liferay.portlet.softwarecatalog.service.SCLicenseLocalService;
47  import com.liferay.portlet.softwarecatalog.service.SCLicenseService;
48  import com.liferay.portlet.softwarecatalog.service.SCProductEntryLocalService;
49  import com.liferay.portlet.softwarecatalog.service.SCProductEntryService;
50  import com.liferay.portlet.softwarecatalog.service.SCProductScreenshotLocalService;
51  import com.liferay.portlet.softwarecatalog.service.SCProductVersionLocalService;
52  import com.liferay.portlet.softwarecatalog.service.SCProductVersionService;
53  import com.liferay.portlet.softwarecatalog.service.persistence.SCFrameworkVersionPersistence;
54  import com.liferay.portlet.softwarecatalog.service.persistence.SCLicensePersistence;
55  import com.liferay.portlet.softwarecatalog.service.persistence.SCProductEntryPersistence;
56  import com.liferay.portlet.softwarecatalog.service.persistence.SCProductScreenshotPersistence;
57  import com.liferay.portlet.softwarecatalog.service.persistence.SCProductVersionPersistence;
58  
59  import java.util.List;
60  
61  /**
62   * <a href="SCLicenseLocalServiceBaseImpl.java.html"><b><i>View Source</i></b>
63   * </a>
64   *
65   * @author Brian Wing Shun Chan
66   */
67  public abstract class SCLicenseLocalServiceBaseImpl
68      implements SCLicenseLocalService {
69      public SCLicense addSCLicense(SCLicense scLicense)
70          throws SystemException {
71          scLicense.setNew(true);
72  
73          return scLicensePersistence.update(scLicense, false);
74      }
75  
76      public SCLicense createSCLicense(long licenseId) {
77          return scLicensePersistence.create(licenseId);
78      }
79  
80      public void deleteSCLicense(long licenseId)
81          throws PortalException, SystemException {
82          scLicensePersistence.remove(licenseId);
83      }
84  
85      public void deleteSCLicense(SCLicense scLicense) throws SystemException {
86          scLicensePersistence.remove(scLicense);
87      }
88  
89      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
90          throws SystemException {
91          return scLicensePersistence.findWithDynamicQuery(dynamicQuery);
92      }
93  
94      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
95          int end) throws SystemException {
96          return scLicensePersistence.findWithDynamicQuery(dynamicQuery, start,
97              end);
98      }
99  
100     public SCLicense getSCLicense(long licenseId)
101         throws PortalException, SystemException {
102         return scLicensePersistence.findByPrimaryKey(licenseId);
103     }
104 
105     public List<SCLicense> getSCLicenses(int start, int end)
106         throws SystemException {
107         return scLicensePersistence.findAll(start, end);
108     }
109 
110     public int getSCLicensesCount() throws SystemException {
111         return scLicensePersistence.countAll();
112     }
113 
114     public SCLicense updateSCLicense(SCLicense scLicense)
115         throws SystemException {
116         scLicense.setNew(false);
117 
118         return scLicensePersistence.update(scLicense, true);
119     }
120 
121     public SCLicense updateSCLicense(SCLicense scLicense, boolean merge)
122         throws SystemException {
123         scLicense.setNew(false);
124 
125         return scLicensePersistence.update(scLicense, merge);
126     }
127 
128     public SCLicenseLocalService getSCLicenseLocalService() {
129         return scLicenseLocalService;
130     }
131 
132     public void setSCLicenseLocalService(
133         SCLicenseLocalService scLicenseLocalService) {
134         this.scLicenseLocalService = scLicenseLocalService;
135     }
136 
137     public SCLicenseService getSCLicenseService() {
138         return scLicenseService;
139     }
140 
141     public void setSCLicenseService(SCLicenseService scLicenseService) {
142         this.scLicenseService = scLicenseService;
143     }
144 
145     public SCLicensePersistence getSCLicensePersistence() {
146         return scLicensePersistence;
147     }
148 
149     public void setSCLicensePersistence(
150         SCLicensePersistence scLicensePersistence) {
151         this.scLicensePersistence = scLicensePersistence;
152     }
153 
154     public SCFrameworkVersionLocalService getSCFrameworkVersionLocalService() {
155         return scFrameworkVersionLocalService;
156     }
157 
158     public void setSCFrameworkVersionLocalService(
159         SCFrameworkVersionLocalService scFrameworkVersionLocalService) {
160         this.scFrameworkVersionLocalService = scFrameworkVersionLocalService;
161     }
162 
163     public SCFrameworkVersionService getSCFrameworkVersionService() {
164         return scFrameworkVersionService;
165     }
166 
167     public void setSCFrameworkVersionService(
168         SCFrameworkVersionService scFrameworkVersionService) {
169         this.scFrameworkVersionService = scFrameworkVersionService;
170     }
171 
172     public SCFrameworkVersionPersistence getSCFrameworkVersionPersistence() {
173         return scFrameworkVersionPersistence;
174     }
175 
176     public void setSCFrameworkVersionPersistence(
177         SCFrameworkVersionPersistence scFrameworkVersionPersistence) {
178         this.scFrameworkVersionPersistence = scFrameworkVersionPersistence;
179     }
180 
181     public SCProductEntryLocalService getSCProductEntryLocalService() {
182         return scProductEntryLocalService;
183     }
184 
185     public void setSCProductEntryLocalService(
186         SCProductEntryLocalService scProductEntryLocalService) {
187         this.scProductEntryLocalService = scProductEntryLocalService;
188     }
189 
190     public SCProductEntryService getSCProductEntryService() {
191         return scProductEntryService;
192     }
193 
194     public void setSCProductEntryService(
195         SCProductEntryService scProductEntryService) {
196         this.scProductEntryService = scProductEntryService;
197     }
198 
199     public SCProductEntryPersistence getSCProductEntryPersistence() {
200         return scProductEntryPersistence;
201     }
202 
203     public void setSCProductEntryPersistence(
204         SCProductEntryPersistence scProductEntryPersistence) {
205         this.scProductEntryPersistence = scProductEntryPersistence;
206     }
207 
208     public SCProductScreenshotLocalService getSCProductScreenshotLocalService() {
209         return scProductScreenshotLocalService;
210     }
211 
212     public void setSCProductScreenshotLocalService(
213         SCProductScreenshotLocalService scProductScreenshotLocalService) {
214         this.scProductScreenshotLocalService = scProductScreenshotLocalService;
215     }
216 
217     public SCProductScreenshotPersistence getSCProductScreenshotPersistence() {
218         return scProductScreenshotPersistence;
219     }
220 
221     public void setSCProductScreenshotPersistence(
222         SCProductScreenshotPersistence scProductScreenshotPersistence) {
223         this.scProductScreenshotPersistence = scProductScreenshotPersistence;
224     }
225 
226     public SCProductVersionLocalService getSCProductVersionLocalService() {
227         return scProductVersionLocalService;
228     }
229 
230     public void setSCProductVersionLocalService(
231         SCProductVersionLocalService scProductVersionLocalService) {
232         this.scProductVersionLocalService = scProductVersionLocalService;
233     }
234 
235     public SCProductVersionService getSCProductVersionService() {
236         return scProductVersionService;
237     }
238 
239     public void setSCProductVersionService(
240         SCProductVersionService scProductVersionService) {
241         this.scProductVersionService = scProductVersionService;
242     }
243 
244     public SCProductVersionPersistence getSCProductVersionPersistence() {
245         return scProductVersionPersistence;
246     }
247 
248     public void setSCProductVersionPersistence(
249         SCProductVersionPersistence scProductVersionPersistence) {
250         this.scProductVersionPersistence = scProductVersionPersistence;
251     }
252 
253     public CounterLocalService getCounterLocalService() {
254         return counterLocalService;
255     }
256 
257     public void setCounterLocalService(CounterLocalService counterLocalService) {
258         this.counterLocalService = counterLocalService;
259     }
260 
261     public CounterService getCounterService() {
262         return counterService;
263     }
264 
265     public void setCounterService(CounterService counterService) {
266         this.counterService = counterService;
267     }
268 
269     public ResourceLocalService getResourceLocalService() {
270         return resourceLocalService;
271     }
272 
273     public void setResourceLocalService(
274         ResourceLocalService resourceLocalService) {
275         this.resourceLocalService = resourceLocalService;
276     }
277 
278     public ResourceService getResourceService() {
279         return resourceService;
280     }
281 
282     public void setResourceService(ResourceService resourceService) {
283         this.resourceService = resourceService;
284     }
285 
286     public ResourcePersistence getResourcePersistence() {
287         return resourcePersistence;
288     }
289 
290     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
291         this.resourcePersistence = resourcePersistence;
292     }
293 
294     public ResourceFinder getResourceFinder() {
295         return resourceFinder;
296     }
297 
298     public void setResourceFinder(ResourceFinder resourceFinder) {
299         this.resourceFinder = resourceFinder;
300     }
301 
302     public UserLocalService getUserLocalService() {
303         return userLocalService;
304     }
305 
306     public void setUserLocalService(UserLocalService userLocalService) {
307         this.userLocalService = userLocalService;
308     }
309 
310     public UserService getUserService() {
311         return userService;
312     }
313 
314     public void setUserService(UserService userService) {
315         this.userService = userService;
316     }
317 
318     public UserPersistence getUserPersistence() {
319         return userPersistence;
320     }
321 
322     public void setUserPersistence(UserPersistence userPersistence) {
323         this.userPersistence = userPersistence;
324     }
325 
326     public UserFinder getUserFinder() {
327         return userFinder;
328     }
329 
330     public void setUserFinder(UserFinder userFinder) {
331         this.userFinder = userFinder;
332     }
333 
334     protected void runSQL(String sql) throws SystemException {
335         try {
336             DB db = DBFactoryUtil.getDB();
337 
338             db.runSQL(sql);
339         }
340         catch (Exception e) {
341             throw new SystemException(e);
342         }
343     }
344 
345     @BeanReference(name = "com.liferay.portlet.softwarecatalog.service.SCLicenseLocalService")
346     protected SCLicenseLocalService scLicenseLocalService;
347     @BeanReference(name = "com.liferay.portlet.softwarecatalog.service.SCLicenseService")
348     protected SCLicenseService scLicenseService;
349     @BeanReference(name = "com.liferay.portlet.softwarecatalog.service.persistence.SCLicensePersistence")
350     protected SCLicensePersistence scLicensePersistence;
351     @BeanReference(name = "com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionLocalService")
352     protected SCFrameworkVersionLocalService scFrameworkVersionLocalService;
353     @BeanReference(name = "com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionService")
354     protected SCFrameworkVersionService scFrameworkVersionService;
355     @BeanReference(name = "com.liferay.portlet.softwarecatalog.service.persistence.SCFrameworkVersionPersistence")
356     protected SCFrameworkVersionPersistence scFrameworkVersionPersistence;
357     @BeanReference(name = "com.liferay.portlet.softwarecatalog.service.SCProductEntryLocalService")
358     protected SCProductEntryLocalService scProductEntryLocalService;
359     @BeanReference(name = "com.liferay.portlet.softwarecatalog.service.SCProductEntryService")
360     protected SCProductEntryService scProductEntryService;
361     @BeanReference(name = "com.liferay.portlet.softwarecatalog.service.persistence.SCProductEntryPersistence")
362     protected SCProductEntryPersistence scProductEntryPersistence;
363     @BeanReference(name = "com.liferay.portlet.softwarecatalog.service.SCProductScreenshotLocalService")
364     protected SCProductScreenshotLocalService scProductScreenshotLocalService;
365     @BeanReference(name = "com.liferay.portlet.softwarecatalog.service.persistence.SCProductScreenshotPersistence")
366     protected SCProductScreenshotPersistence scProductScreenshotPersistence;
367     @BeanReference(name = "com.liferay.portlet.softwarecatalog.service.SCProductVersionLocalService")
368     protected SCProductVersionLocalService scProductVersionLocalService;
369     @BeanReference(name = "com.liferay.portlet.softwarecatalog.service.SCProductVersionService")
370     protected SCProductVersionService scProductVersionService;
371     @BeanReference(name = "com.liferay.portlet.softwarecatalog.service.persistence.SCProductVersionPersistence")
372     protected SCProductVersionPersistence scProductVersionPersistence;
373     @BeanReference(name = "com.liferay.counter.service.CounterLocalService")
374     protected CounterLocalService counterLocalService;
375     @BeanReference(name = "com.liferay.counter.service.CounterService")
376     protected CounterService counterService;
377     @BeanReference(name = "com.liferay.portal.service.ResourceLocalService")
378     protected ResourceLocalService resourceLocalService;
379     @BeanReference(name = "com.liferay.portal.service.ResourceService")
380     protected ResourceService resourceService;
381     @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence")
382     protected ResourcePersistence resourcePersistence;
383     @BeanReference(name = "com.liferay.portal.service.persistence.ResourceFinder")
384     protected ResourceFinder resourceFinder;
385     @BeanReference(name = "com.liferay.portal.service.UserLocalService")
386     protected UserLocalService userLocalService;
387     @BeanReference(name = "com.liferay.portal.service.UserService")
388     protected UserService userService;
389     @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence")
390     protected UserPersistence userPersistence;
391     @BeanReference(name = "com.liferay.portal.service.persistence.UserFinder")
392     protected UserFinder userFinder;
393 }