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.journal.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.journal.model.JournalFeed;
029: import com.liferay.portlet.journal.service.base.JournalFeedServiceBaseImpl;
030: import com.liferay.portlet.journal.service.permission.JournalFeedPermission;
031:
032: /**
033: * <a href="JournalFeedServiceImpl.java.html"><b><i>View Source</i></b></a>
034: *
035: * @author Raymond Augé
036: *
037: */
038: public class JournalFeedServiceImpl extends JournalFeedServiceBaseImpl {
039:
040: public JournalFeed addFeed(long plid, String feedId,
041: boolean autoFeedId, String name, String description,
042: String type, String structureId, String templateId,
043: String rendererTemplateId, int delta, String orderByCol,
044: String orderByType, String targetLayoutFriendlyUrl,
045: String targetPortletId, String contentField,
046: String feedType, double feedVersion,
047: boolean addCommunityPermissions, boolean addGuestPermissions)
048: throws PortalException, SystemException {
049:
050: PortletPermissionUtil.check(getPermissionChecker(), plid,
051: PortletKeys.JOURNAL, ActionKeys.ADD_FEED);
052:
053: return journalFeedLocalService.addFeed(getUserId(), plid,
054: feedId, autoFeedId, name, description, type,
055: structureId, templateId, rendererTemplateId, delta,
056: orderByCol, orderByType, targetLayoutFriendlyUrl,
057: targetPortletId, contentField, feedType, feedVersion,
058: addCommunityPermissions, addGuestPermissions);
059: }
060:
061: public JournalFeed addFeed(long plid, String feedId,
062: boolean autoFeedId, String name, String description,
063: String type, String structureId, String templateId,
064: String rendererTemplateId, int delta, String orderByCol,
065: String orderByType, String targetLayoutFriendlyUrl,
066: String targetPortletId, String contentField,
067: String feedType, double feedVersion,
068: String[] communityPermissions, String[] guestPermissions)
069: throws PortalException, SystemException {
070:
071: PortletPermissionUtil.check(getPermissionChecker(), plid,
072: PortletKeys.JOURNAL, ActionKeys.ADD_FEED);
073:
074: return journalFeedLocalService.addFeed(getUserId(), plid,
075: feedId, autoFeedId, name, description, type,
076: structureId, templateId, rendererTemplateId, delta,
077: orderByCol, orderByType, targetLayoutFriendlyUrl,
078: targetPortletId, contentField, feedType, feedVersion,
079: communityPermissions, guestPermissions);
080: }
081:
082: public void deleteFeed(long groupId, long feedId)
083: throws PortalException, SystemException {
084:
085: JournalFeedPermission.check(getPermissionChecker(), feedId,
086: ActionKeys.DELETE);
087:
088: journalFeedLocalService.deleteFeed(feedId);
089: }
090:
091: public void deleteFeed(long groupId, String feedId)
092: throws PortalException, SystemException {
093:
094: JournalFeedPermission.check(getPermissionChecker(), groupId,
095: feedId, ActionKeys.DELETE);
096:
097: journalFeedLocalService.deleteFeed(groupId, feedId);
098: }
099:
100: public JournalFeed getFeed(long groupId, long feedId)
101: throws PortalException, SystemException {
102:
103: JournalFeedPermission.check(getPermissionChecker(), feedId,
104: ActionKeys.VIEW);
105:
106: return journalFeedLocalService.getFeed(feedId);
107: }
108:
109: public JournalFeed getFeed(long groupId, String feedId)
110: throws PortalException, SystemException {
111:
112: JournalFeedPermission.check(getPermissionChecker(), groupId,
113: feedId, ActionKeys.VIEW);
114:
115: return journalFeedLocalService.getFeed(groupId, feedId);
116: }
117:
118: public JournalFeed updateFeed(long groupId, String feedId,
119: String name, String description, String type,
120: String structureId, String templateId,
121: String rendererTemplateId, int delta, String orderByCol,
122: String orderByType, String targetLayoutFriendlyUrl,
123: String targetPortletId, String contentField,
124: String feedType, double feedVersion)
125: throws PortalException, SystemException {
126:
127: JournalFeedPermission.check(getPermissionChecker(), groupId,
128: feedId, ActionKeys.UPDATE);
129:
130: return journalFeedLocalService.updateFeed(groupId, feedId,
131: name, description, type, structureId, templateId,
132: rendererTemplateId, delta, orderByCol, orderByType,
133: targetLayoutFriendlyUrl, targetPortletId, contentField,
134: feedType, feedVersion);
135: }
136:
137: }
|