001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portlet.softwarecatalog.service.impl;
022:
023: import com.liferay.portal.PortalException;
024: import com.liferay.portal.SystemException;
025: import com.liferay.portal.kernel.security.permission.ActionKeys;
026: import com.liferay.portal.service.permission.PortletPermissionUtil;
027: import com.liferay.portal.util.PortletKeys;
028: import com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion;
029: import com.liferay.portlet.softwarecatalog.service.base.SCFrameworkVersionServiceBaseImpl;
030: import com.liferay.portlet.softwarecatalog.service.permission.SCFrameworkVersionPermission;
031:
032: import java.util.List;
033:
034: /**
035: * <a href="SCFrameworkVersionServiceImpl.java.html"><b><i>View Source</i></b>
036: * </a>
037: *
038: * @author Jorge Ferrer
039: * @author Brian Wing Shun Chan
040: *
041: */
042: public class SCFrameworkVersionServiceImpl extends
043: SCFrameworkVersionServiceBaseImpl {
044:
045: public SCFrameworkVersion addFrameworkVersion(long plid,
046: String name, String url, boolean active, int priority,
047: boolean addCommunityPermissions, boolean addGuestPermissions)
048: throws PortalException, SystemException {
049:
050: PortletPermissionUtil.check(getPermissionChecker(), plid,
051: PortletKeys.SOFTWARE_CATALOG,
052: ActionKeys.ADD_FRAMEWORK_VERSION);
053:
054: return scFrameworkVersionLocalService.addFrameworkVersion(
055: getUserId(), plid, name, url, active, priority,
056: addCommunityPermissions, addGuestPermissions);
057: }
058:
059: public SCFrameworkVersion addFrameworkVersion(long plid,
060: String name, String url, boolean active, int priority,
061: String[] communityPermissions, String[] guestPermissions)
062: throws PortalException, SystemException {
063:
064: PortletPermissionUtil.check(getPermissionChecker(), plid,
065: PortletKeys.SOFTWARE_CATALOG,
066: ActionKeys.ADD_FRAMEWORK_VERSION);
067:
068: return scFrameworkVersionLocalService.addFrameworkVersion(
069: getUserId(), plid, name, url, active, priority,
070: communityPermissions, guestPermissions);
071: }
072:
073: public void deleteFrameworkVersion(long frameworkVersionId)
074: throws PortalException, SystemException {
075:
076: SCFrameworkVersionPermission.check(getPermissionChecker(),
077: frameworkVersionId, ActionKeys.DELETE);
078:
079: scFrameworkVersionLocalService
080: .deleteFrameworkVersion(frameworkVersionId);
081: }
082:
083: public SCFrameworkVersion getFrameworkVersion(
084: long frameworkVersionId) throws PortalException,
085: SystemException {
086:
087: return scFrameworkVersionLocalService
088: .getFrameworkVersion(frameworkVersionId);
089: }
090:
091: public List getFrameworkVersions(long groupId, boolean active)
092: throws SystemException {
093:
094: return scFrameworkVersionLocalService.getFrameworkVersions(
095: groupId, active);
096: }
097:
098: public List getFrameworkVersions(long groupId, boolean active,
099: int begin, int end) throws SystemException {
100:
101: return scFrameworkVersionLocalService.getFrameworkVersions(
102: groupId, active, begin, end);
103: }
104:
105: public SCFrameworkVersion updateFrameworkVersion(
106: long frameworkVersionId, String name, String url,
107: boolean active, int priority) throws PortalException,
108: SystemException {
109:
110: SCFrameworkVersionPermission.check(getPermissionChecker(),
111: frameworkVersionId, ActionKeys.UPDATE);
112:
113: return scFrameworkVersionLocalService.updateFrameworkVersion(
114: frameworkVersionId, name, url, active, priority);
115: }
116:
117: }
|