Class SharingEntryServiceUtil

java.lang.Object
com.liferay.sharing.service.SharingEntryServiceUtil

public class SharingEntryServiceUtil extends Object
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 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 with
      classNameId - the resource's class name ID
      classPK - the primary key of the resource
      groupId - the primary key of the resource's group
      shareable - whether the user specified by toUserId can share the resource
      sharingEntryActions - the sharing entry actions
      expirationDate - the date when the sharing entry expires
      serviceContext - 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 contain SharingEntryAction#VIEW, or contain a null 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 with
      classNameId - the resource's class name ID
      classPK - the primary key of the resource
      groupId - the primary key of the resource's group
      shareable - whether the user specified by toUserId can share the resource
      sharingEntryActions - the sharing entry actions
      expirationDate - the date when the sharing entry expires
      serviceContext - 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 contain SharingEntryAction#VIEW, or contain a null 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

      public static String 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 entry
      sharingEntryActions - the sharing entry actions
      shareable - whether the user the resource is shared with can also share it
      expirationDate - the date when the sharing entry expires
      serviceContext - 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 contain SharingEntryAction#VIEW, or contain a null value), or if the expiration date is a past value
    • getService

      public static SharingEntryService getService()