1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portlet.softwarecatalog.service.impl;
16  
17  import com.liferay.portal.PortalException;
18  import com.liferay.portal.SystemException;
19  import com.liferay.portal.security.permission.ActionKeys;
20  import com.liferay.portal.service.ServiceContext;
21  import com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion;
22  import com.liferay.portlet.softwarecatalog.service.base.SCFrameworkVersionServiceBaseImpl;
23  import com.liferay.portlet.softwarecatalog.service.permission.SCFrameworkVersionPermission;
24  import com.liferay.portlet.softwarecatalog.service.permission.SCPermission;
25  
26  import java.util.List;
27  
28  /**
29   * <a href="SCFrameworkVersionServiceImpl.java.html"><b><i>View Source</i></b>
30   * </a>
31   *
32   * @author Jorge Ferrer
33   * @author Brian Wing Shun Chan
34   */
35  public class SCFrameworkVersionServiceImpl
36      extends SCFrameworkVersionServiceBaseImpl {
37  
38      public SCFrameworkVersion addFrameworkVersion(
39              String name, String url, boolean active, int priority,
40              ServiceContext serviceContext)
41          throws PortalException, SystemException {
42  
43          SCPermission.check(
44              getPermissionChecker(), serviceContext.getScopeGroupId(),
45              ActionKeys.ADD_FRAMEWORK_VERSION);
46  
47          return scFrameworkVersionLocalService.addFrameworkVersion(
48              getUserId(), name, url, active, priority, serviceContext);
49      }
50  
51      public void deleteFrameworkVersion(long frameworkVersionId)
52          throws PortalException, SystemException {
53  
54          SCFrameworkVersionPermission.check(
55              getPermissionChecker(), frameworkVersionId, ActionKeys.DELETE);
56  
57          scFrameworkVersionLocalService.deleteFrameworkVersion(
58              frameworkVersionId);
59      }
60  
61      public SCFrameworkVersion getFrameworkVersion(long frameworkVersionId)
62          throws PortalException, SystemException {
63  
64          return scFrameworkVersionLocalService.getFrameworkVersion(
65              frameworkVersionId);
66      }
67  
68      public List<SCFrameworkVersion> getFrameworkVersions(
69              long groupId, boolean active)
70          throws SystemException {
71  
72          return scFrameworkVersionLocalService.getFrameworkVersions(
73              groupId, active);
74      }
75  
76      public List<SCFrameworkVersion> getFrameworkVersions(
77              long groupId, boolean active, int start, int end)
78          throws SystemException {
79  
80          return scFrameworkVersionLocalService.getFrameworkVersions(
81              groupId, active, start, end);
82      }
83  
84      public SCFrameworkVersion updateFrameworkVersion(
85              long frameworkVersionId, String name, String url, boolean active,
86              int priority)
87          throws PortalException, SystemException {
88  
89          SCFrameworkVersionPermission.check(
90              getPermissionChecker(), frameworkVersionId, ActionKeys.UPDATE);
91  
92          return scFrameworkVersionLocalService.updateFrameworkVersion(
93              frameworkVersionId, name, url, active, priority);
94      }
95  
96  }