1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.softwarecatalog.service.impl;
16  
17  import com.liferay.portal.kernel.exception.PortalException;
18  import com.liferay.portal.kernel.exception.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  }