@ProviderType
public class SharingEntryServiceUtil
extends java.lang.Object
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.SharingEntryService
Constructor and Description |
---|
SharingEntryServiceUtil() |
Modifier and Type | Method and Description |
---|---|
static SharingEntry |
addOrUpdateSharingEntry(long toUserId,
long classNameId,
long classPK,
long groupId,
boolean shareable,
java.util.Collection<SharingEntryAction> sharingEntryActions,
java.util.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(long toUserId,
long classNameId,
long classPK,
long groupId,
boolean shareable,
java.util.Collection<SharingEntryAction> sharingEntryActions,
java.util.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 java.lang.String |
getOSGiServiceIdentifier()
Returns the OSGi service identifier.
|
static SharingEntryService |
getService() |
static SharingEntry |
updateSharingEntry(long sharingEntryId,
java.util.Collection<SharingEntryAction> sharingEntryActions,
boolean shareable,
java.util.Date expirationDate,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
Updates the sharing entry in the database.
|
public static SharingEntry addOrUpdateSharingEntry(long toUserId, long classNameId, long classPK, long groupId, boolean shareable, java.util.Collection<SharingEntryAction> sharingEntryActions, java.util.Date expirationDate, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
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 by toUserId
can
share the resourcesharingEntryActions
- the sharing entry actionsexpirationDate
- the date when the sharing entry expiresserviceContext
- the service contextPortalException
- 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 valuepublic static SharingEntry addSharingEntry(long toUserId, long classNameId, long classPK, long groupId, boolean shareable, java.util.Collection<SharingEntryAction> sharingEntryActions, java.util.Date expirationDate, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
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 by toUserId
can
share the resourcesharingEntryActions
- the sharing entry actionsexpirationDate
- the date when the sharing entry expiresserviceContext
- the service contextPortalException
- 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 valuepublic static SharingEntry deleteSharingEntry(long sharingEntryId, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public static java.lang.String getOSGiServiceIdentifier()
public static SharingEntry updateSharingEntry(long sharingEntryId, java.util.Collection<SharingEntryAction> sharingEntryActions, boolean shareable, java.util.Date expirationDate, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
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 contextPortalException
- 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 valuepublic static SharingEntryService getService()