Package com.liferay.sharing.service
Class SharingEntryServiceUtil
java.lang.Object
com.liferay.sharing.service.SharingEntryServiceUtil
Provides the remote service utility for SharingEntry. This utility wraps
com.liferay.sharing.service.impl.SharingEntryServiceImpl
and is an
access point for service operations in application layer code running on a
remote server. Methods of this service are expected to have security checks
based on the propagated JAAS credentials because this service can be
accessed remotely.- See Also:
- Generated:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SharingEntry
addOrUpdateSharingEntry
(String externalReferenceCode, long toUserGroupId, long toUserId, long classNameId, long classPK, long groupId, boolean shareable, Collection<SharingEntryAction> sharingEntryActions, Date expirationDate, com.liferay.portal.kernel.service.ServiceContext serviceContext) Adds a new sharing entry in the database or updates an existing one.static SharingEntry
addSharingEntry
(String externalReferenceCode, long toUserGroupId, long toUserId, long classNameId, long classPK, long groupId, boolean shareable, Collection<SharingEntryAction> sharingEntryActions, Date expirationDate, com.liferay.portal.kernel.service.ServiceContext serviceContext) Adds a new sharing entry in the database.static SharingEntry
deleteSharingEntry
(long sharingEntryId, com.liferay.portal.kernel.service.ServiceContext serviceContext) static SharingEntry
deleteSharingEntry
(SharingEntry sharingEntry) static SharingEntry
deleteSharingEntryByExternalReferenceCode
(String externalReferenceCode, long groupId) static SharingEntry
fetchSharingEntryByExternalReferenceCode
(String externalReferenceCode, long groupId) static String
Returns the OSGi service identifier.static SharingEntryService
static List<SharingEntry>
getSharingEntries
(long classNameId, long classPK, long groupId, int start, int end) static SharingEntry
getSharingEntry
(long sharingEntryId) static SharingEntry
getSharingEntryByExternalReferenceCode
(String externalReferenceCode, long groupId) static SharingEntry
updateSharingEntry
(long sharingEntryId, Collection<SharingEntryAction> sharingEntryActions, boolean shareable, Date expirationDate, com.liferay.portal.kernel.service.ServiceContext serviceContext) Updates the sharing entry in the database.
-
Constructor Details
-
SharingEntryServiceUtil
public SharingEntryServiceUtil()
-
-
Method Details
-
addOrUpdateSharingEntry
public static SharingEntry addOrUpdateSharingEntry(String externalReferenceCode, long toUserGroupId, long toUserId, long classNameId, long classPK, long groupId, boolean shareable, Collection<SharingEntryAction> sharingEntryActions, Date expirationDate, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException Adds a new sharing entry in the database or updates an existing one.- Parameters:
toUserId
- the ID of the user the resource is shared withclassNameId
- the resource's class name IDclassPK
- the primary key of the resourcegroupId
- the primary key of the resource's groupshareable
- whether the user specified bytoUserId
can share the resourcesharingEntryActions
- the sharing entry actionsexpirationDate
- the date when the sharing entry expiresserviceContext
- the service context- Returns:
- the sharing entry
- Throws:
com.liferay.portal.kernel.exception.PortalException
- if the user does not have permission to share the resource, if the sharing entry actions are invalid (e.g., empty don't containSharingEntryAction#VIEW
, or contain anull
value), if the to/from user IDs are the same, or if the expiration date is a past value
-
addSharingEntry
public static SharingEntry addSharingEntry(String externalReferenceCode, long toUserGroupId, long toUserId, long classNameId, long classPK, long groupId, boolean shareable, Collection<SharingEntryAction> sharingEntryActions, Date expirationDate, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException Adds a new sharing entry in the database.- Parameters:
toUserId
- the ID of the user the resource is shared withclassNameId
- the resource's class name IDclassPK
- the primary key of the resourcegroupId
- the primary key of the resource's groupshareable
- whether the user specified bytoUserId
can share the resourcesharingEntryActions
- the sharing entry actionsexpirationDate
- the date when the sharing entry expiresserviceContext
- the service context- Returns:
- the sharing entry
- Throws:
com.liferay.portal.kernel.exception.PortalException
- if the user does not have permission to share the resource, if a sharing entry already exists for the to/from user IDs, if the sharing entry actions are invalid (e.g., empty, do not containSharingEntryAction#VIEW
, or contain anull
value), if the to/from user IDs are the same, or if the expiration date is a past value
-
deleteSharingEntry
public static SharingEntry deleteSharingEntry(long sharingEntryId, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteSharingEntry
public static SharingEntry deleteSharingEntry(SharingEntry sharingEntry) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteSharingEntryByExternalReferenceCode
public static SharingEntry deleteSharingEntryByExternalReferenceCode(String externalReferenceCode, long groupId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
fetchSharingEntryByExternalReferenceCode
public static SharingEntry fetchSharingEntryByExternalReferenceCode(String externalReferenceCode, long groupId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getOSGiServiceIdentifier
Returns the OSGi service identifier.- Returns:
- the OSGi service identifier
-
getSharingEntries
public static List<SharingEntry> getSharingEntries(long classNameId, long classPK, long groupId, int start, int end) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getSharingEntry
public static SharingEntry getSharingEntry(long sharingEntryId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getSharingEntryByExternalReferenceCode
public static SharingEntry getSharingEntryByExternalReferenceCode(String externalReferenceCode, long groupId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
updateSharingEntry
public static SharingEntry updateSharingEntry(long sharingEntryId, Collection<SharingEntryAction> sharingEntryActions, boolean shareable, Date expirationDate, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException Updates the sharing entry in the database.- Parameters:
sharingEntryId
- the primary key of the sharing entrysharingEntryActions
- the sharing entry actionsshareable
- whether the user the resource is shared with can also share itexpirationDate
- the date when the sharing entry expiresserviceContext
- the service context- Returns:
- the sharing entry
- Throws:
com.liferay.portal.kernel.exception.PortalException
- if the sharing entry does not exist, if the sharing entry actions are invalid (e.g., empty, don't containSharingEntryAction#VIEW
, or contain anull
value), or if the expiration date is a past value
-
getService
-