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.SCProductEntry;
029: import com.liferay.portlet.softwarecatalog.service.base.SCProductEntryServiceBaseImpl;
030: import com.liferay.portlet.softwarecatalog.service.permission.SCProductEntryPermission;
031:
032: import java.util.List;
033:
034: /**
035: * <a href="SCProductEntryServiceImpl.java.html"><b><i>View Source</i></b></a>
036: *
037: * @author Jorge Ferrer
038: * @author Brian Wing Shun Chan
039: *
040: */
041: public class SCProductEntryServiceImpl extends
042: SCProductEntryServiceBaseImpl {
043:
044: public SCProductEntry addProductEntry(long plid, String name,
045: String type, String tags, String shortDescription,
046: String longDescription, String pageURL, String author,
047: String repoGroupId, String repoArtifactId,
048: long[] licenseIds, List thumbnails, List fullImages,
049: boolean addCommunityPermissions, boolean addGuestPermissions)
050: throws PortalException, SystemException {
051:
052: PortletPermissionUtil.check(getPermissionChecker(), plid,
053: PortletKeys.SOFTWARE_CATALOG,
054: ActionKeys.ADD_PRODUCT_ENTRY);
055:
056: return scProductEntryLocalService.addProductEntry(getUserId(),
057: plid, name, type, tags, shortDescription,
058: longDescription, pageURL, author, repoGroupId,
059: repoArtifactId, licenseIds, thumbnails, fullImages,
060: addCommunityPermissions, addGuestPermissions);
061: }
062:
063: public SCProductEntry addProductEntry(long plid, String name,
064: String type, String tags, String shortDescription,
065: String longDescription, String pageURL, String author,
066: String repoGroupId, String repoArtifactId,
067: long[] licenseIds, List thumbnails, List fullImages,
068: String[] communityPermissions, String[] guestPermissions)
069: throws PortalException, SystemException {
070:
071: PortletPermissionUtil.check(getPermissionChecker(), plid,
072: PortletKeys.SOFTWARE_CATALOG,
073: ActionKeys.ADD_PRODUCT_ENTRY);
074:
075: return scProductEntryLocalService.addProductEntry(getUserId(),
076: plid, name, type, tags, shortDescription,
077: longDescription, pageURL, author, repoGroupId,
078: repoArtifactId, licenseIds, thumbnails, fullImages,
079: communityPermissions, guestPermissions);
080: }
081:
082: public void deleteProductEntry(long productEntryId)
083: throws PortalException, SystemException {
084:
085: SCProductEntryPermission.check(getPermissionChecker(),
086: productEntryId, ActionKeys.DELETE);
087:
088: scProductEntryLocalService.deleteProductEntry(productEntryId);
089: }
090:
091: public SCProductEntry getProductEntry(long productEntryId)
092: throws PortalException, SystemException {
093:
094: SCProductEntryPermission.check(getPermissionChecker(),
095: productEntryId, ActionKeys.VIEW);
096:
097: return scProductEntryLocalService
098: .getProductEntry(productEntryId);
099: }
100:
101: public SCProductEntry updateProductEntry(long productEntryId,
102: String name, String type, String tags,
103: String shortDescription, String longDescription,
104: String pageURL, String author, String repoGroupId,
105: String repoArtifactId, long[] licenseIds, List thumbnails,
106: List fullImages) throws PortalException, SystemException {
107:
108: SCProductEntryPermission.check(getPermissionChecker(),
109: productEntryId, ActionKeys.UPDATE);
110:
111: return scProductEntryLocalService.updateProductEntry(
112: productEntryId, name, type, tags, shortDescription,
113: longDescription, pageURL, author, repoGroupId,
114: repoArtifactId, licenseIds, thumbnails, fullImages);
115: }
116:
117: }
|