Class SharingEntryLocalServiceUtil
com.liferay.sharing.service.impl.SharingEntryLocalServiceImpl
and
is an access point for service operations in application layer code running
on the local server. Methods of this service will not have security checks
based on the propagated JAAS credentials because this service can only be
accessed from within the same VM.- See Also:
- Generated:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SharingEntry
addOrUpdateSharingEntry
(String externalReferenceCode, long userId, 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
(SharingEntry sharingEntry) Adds the sharing entry to the database.static SharingEntry
addSharingEntry
(String externalReferenceCode, long userId, 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 com.liferay.portal.kernel.model.PersistedModel
createPersistedModel
(Serializable primaryKeyObj) static SharingEntry
createSharingEntry
(long sharingEntryId) Creates a new sharing entry with the primary key.static void
deleteCompanySharingEntries
(long companyId, long classNameId) static void
Deletes the sharing entries whose expiration date is before the current date.static void
deleteGroupSharingEntries
(long groupId) Deletes the group's sharing entries.static com.liferay.portal.kernel.model.PersistedModel
deletePersistedModel
(com.liferay.portal.kernel.model.PersistedModel persistedModel) static void
deleteSharingEntries
(long classNameId, long classPK) Deletes the resource's sharing entries.static SharingEntry
deleteSharingEntry
(long sharingEntryId) Deletes the sharing entry with the primary key from the database.static SharingEntry
deleteSharingEntry
(long toUserId, long classNameId, long classPK) Deletes the sharing entry for the resource and users.static SharingEntry
deleteSharingEntry
(SharingEntry sharingEntry) Deletes the sharing entry from the database.static SharingEntry
deleteSharingEntryByExternalReferenceCode
(String externalReferenceCode, long groupId) static void
deleteToUserSharingEntries
(long toUserId) Deletes the sharing entries for resources shared with the user.static <T> T
dslQuery
(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) static int
dslQueryCount
(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) static com.liferay.portal.kernel.dao.orm.DynamicQuery
static <T> List<T>
dynamicQuery
(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) Performs a dynamic query on the database and returns the matching rows.static <T> List<T>
dynamicQuery
(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end) Performs a dynamic query on the database and returns a range of the matching rows.static <T> List<T>
dynamicQuery
(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) Performs a dynamic query on the database and returns an ordered range of the matching rows.static long
dynamicQueryCount
(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) Returns the number of rows matching the dynamic query.static long
dynamicQueryCount
(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, com.liferay.portal.kernel.dao.orm.Projection projection) Returns the number of rows matching the dynamic query.static SharingEntry
fetchSharingEntry
(long sharingEntryId) static SharingEntry
fetchSharingEntry
(long toUserId, long classNameId, long classPK) Returns the sharing entry for the resource shared with the user ornull
if there's none.static SharingEntry
fetchSharingEntryByExternalReferenceCode
(String externalReferenceCode, long groupId) static SharingEntry
fetchSharingEntryByUuidAndGroupId
(String uuid, long groupId) Returns the sharing entry matching the UUID and group.static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery
static int
getCompanySharingEntriesCount
(long companyId, long classNameId) static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery
getExportActionableDynamicQuery
(com.liferay.exportimport.kernel.lar.PortletDataContext portletDataContext) static List<SharingEntry>
getFromUserSharingEntries
(long fromUserId, long classNameId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<SharingEntry> orderByComparator) Returns the ordered range of sharing entries for the type of resource shared by the user.static int
getFromUserSharingEntriesCount
(long fromUserId, long classNameId) Returns the number of sharing entries for the type of resource shared by the user.static List<SharingEntry>
getGroupSharingEntries
(long groupId) Returns the the group's sharing entries.static int
getGroupSharingEntriesCount
(long groupId) Returns the the group's sharing entries count.static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery
static String
Returns the OSGi service identifier.static com.liferay.portal.kernel.model.PersistedModel
getPersistedModel
(Serializable primaryKeyObj) static SharingEntryLocalService
static List<SharingEntry>
getSharingEntries
(int start, int end) Returns a range of all the sharing entries.static List<SharingEntry>
getSharingEntries
(long classNameId, long classPK) Returns the resource's sharing entries.static List<SharingEntry>
getSharingEntries
(long classNameId, long classPK, int start, int end) Returns the resource's sharing entries.static List<SharingEntry>
getSharingEntriesByUuidAndCompanyId
(String uuid, long companyId) Returns all the sharing entries matching the UUID and company.static List<SharingEntry>
getSharingEntriesByUuidAndCompanyId
(String uuid, long companyId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<SharingEntry> orderByComparator) Returns a range of sharing entries matching the UUID and company.static int
Returns the number of sharing entries.static int
getSharingEntriesCount
(long classNameId, long classPK) Returns the resource's sharing entries count.static SharingEntry
getSharingEntry
(long sharingEntryId) Returns the sharing entry with the primary key.static SharingEntry
getSharingEntry
(long toUserId, long classNameId, long classPK) Returns the sharing entry for the resource shared with the user.static SharingEntry
getSharingEntryByExternalReferenceCode
(String externalReferenceCode, long groupId) static SharingEntry
getSharingEntryByUuidAndGroupId
(String uuid, long groupId) Returns the sharing entry matching the UUID and group.static List<SharingEntry>
getToUserSharingEntries
(long toUserId) Returns the list of sharing entries for resources shared with the user.static List<SharingEntry>
getToUserSharingEntries
(long toUserId, int start, int end) Returns the range of sharing entries for resources shared with the user.static List<SharingEntry>
getToUserSharingEntries
(long toUserId, long classNameId) Returns the list of sharing entries for the type of resource shared with the user.static List<SharingEntry>
getToUserSharingEntries
(long toUserId, long classNameId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<SharingEntry> orderByComparator) Returns the ordered range of sharing entries for the type of resource shared with the user.static int
getToUserSharingEntriesCount
(long toUserId) Returns the number of sharing entries for resources shared with the user.static int
getToUserSharingEntriesCount
(long toUserId, long classNameId) Returns the number of sharing entries for the type of resource shared with the user.static boolean
hasShareableSharingPermission
(long toUserId, long classNameId, long classPK, SharingEntryAction sharingEntryAction) Returnstrue
if the resource with the sharing entry action has been shared with a user who can also share that resource.static boolean
hasSharingPermission
(long toUserId, long classNameId, long classPK, SharingEntryAction sharingEntryAction) Returnstrue
if the resource with the sharing entry action has been shared with the user.static SharingEntry
updateSharingEntry
(long userId, long sharingEntryId, Collection<SharingEntryAction> sharingEntryActions, boolean shareable, Date expirationDate, com.liferay.portal.kernel.service.ServiceContext serviceContext) Updates the sharing entry in the database.static SharingEntry
updateSharingEntry
(long sharingEntryId, Collection<SharingEntryAction> sharingEntryActions, boolean shareable, Date expirationDate, com.liferay.portal.kernel.service.ServiceContext serviceContext) Deprecated.static SharingEntry
updateSharingEntry
(SharingEntry sharingEntry) Updates the sharing entry in the database or adds it if it does not yet exist.
-
Constructor Details
-
SharingEntryLocalServiceUtil
public SharingEntryLocalServiceUtil()
-
-
Method Details
-
addOrUpdateSharingEntry
public static SharingEntry addOrUpdateSharingEntry(String externalReferenceCode, long userId, 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:
userId
- the ID of the user sharing the resourcetoUserId
- the ID of the user the resource is shared withclassNameId
- the resource's class name IDclassPK
- the class 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 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
Adds the sharing entry to the database. Also notifies the appropriate model listeners.Important: Inspect SharingEntryLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
sharingEntry
- the sharing entry- Returns:
- the sharing entry that was added
-
addSharingEntry
public static SharingEntry addSharingEntry(String externalReferenceCode, long userId, 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:
userId
- the ID of the user sharing the resourcetoUserId
- the ID of the user the resource is shared withclassNameId
- the resource's class name IDclassPK
- the class 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 a sharing entry already exists for the to/from user IDs, 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
-
createPersistedModel
public static com.liferay.portal.kernel.model.PersistedModel createPersistedModel(Serializable primaryKeyObj) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
createSharingEntry
Creates a new sharing entry with the primary key. Does not add the sharing entry to the database.- Parameters:
sharingEntryId
- the primary key for the new sharing entry- Returns:
- the new sharing entry
-
deleteCompanySharingEntries
public static void deleteCompanySharingEntries(long companyId, long classNameId) -
deleteExpiredEntries
public static void deleteExpiredEntries()Deletes the sharing entries whose expiration date is before the current date. -
deleteGroupSharingEntries
public static void deleteGroupSharingEntries(long groupId) Deletes the group's sharing entries.- Parameters:
groupId
- the group's ID
-
deletePersistedModel
public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(com.liferay.portal.kernel.model.PersistedModel persistedModel) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteSharingEntries
public static void deleteSharingEntries(long classNameId, long classPK) Deletes the resource's sharing entries. The class name ID and class primary key identify the resource's type and instance, respectively.- Parameters:
classNameId
- the resource's class name IDclassPK
- the class primary key of the resource
-
deleteSharingEntry
public static SharingEntry deleteSharingEntry(long sharingEntryId) throws com.liferay.portal.kernel.exception.PortalException Deletes the sharing entry with the primary key from the database. Also notifies the appropriate model listeners.Important: Inspect SharingEntryLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
sharingEntryId
- the primary key of the sharing entry- Returns:
- the sharing entry that was removed
- Throws:
com.liferay.portal.kernel.exception.PortalException
- if a sharing entry with the primary key could not be found
-
deleteSharingEntry
public static SharingEntry deleteSharingEntry(long toUserId, long classNameId, long classPK) throws com.liferay.portal.kernel.exception.PortalException Deletes the sharing entry for the resource and users. The class name ID and class primary key identify the resource's type and instance, respectively.- Parameters:
toUserId
- the ID of the user the resource is shared withclassNameId
- the resource's class name IDclassPK
- the class primary key of the resource- Returns:
- the deleted sharing entry
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteSharingEntry
Deletes the sharing entry from the database. Also notifies the appropriate model listeners.Important: Inspect SharingEntryLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
sharingEntry
- the sharing entry- Returns:
- the sharing entry that was removed
-
deleteSharingEntryByExternalReferenceCode
public static SharingEntry deleteSharingEntryByExternalReferenceCode(String externalReferenceCode, long groupId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteToUserSharingEntries
public static void deleteToUserSharingEntries(long toUserId) Deletes the sharing entries for resources shared with the user.- Parameters:
toUserId
- the user's ID
-
dslQuery
public static <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) -
dslQueryCount
public static int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) -
dynamicQuery
public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() -
dynamicQuery
Performs a dynamic query on the database and returns the matching rows.- Parameters:
dynamicQuery
- the dynamic query- Returns:
- the matching rows
-
dynamicQuery
public static <T> List<T> dynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end) Performs a dynamic query on the database and returns a range of the matching rows.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.sharing.model.impl.SharingEntryModelImpl
.- Parameters:
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)- Returns:
- the range of matching rows
-
dynamicQuery
public static <T> List<T> dynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) Performs a dynamic query on the database and returns an ordered range of the matching rows.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.sharing.model.impl.SharingEntryModelImpl
.- Parameters:
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)orderByComparator
- the comparator to order the results by (optionallynull
)- Returns:
- the ordered range of matching rows
-
dynamicQueryCount
public static long dynamicQueryCount(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) Returns the number of rows matching the dynamic query.- Parameters:
dynamicQuery
- the dynamic query- Returns:
- the number of rows matching the dynamic query
-
dynamicQueryCount
public static long dynamicQueryCount(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, com.liferay.portal.kernel.dao.orm.Projection projection) Returns the number of rows matching the dynamic query.- Parameters:
dynamicQuery
- the dynamic queryprojection
- the projection to apply to the query- Returns:
- the number of rows matching the dynamic query
-
fetchSharingEntry
-
fetchSharingEntry
Returns the sharing entry for the resource shared with the user ornull
if there's none. The class name ID and class primary key identify the resource's type and instance, respectively.- Parameters:
toUserId
- the user's IDclassNameId
- the resource's class name IDclassPK
- the class primary key of the resource- Returns:
- the sharing entry or
null
if none
-
fetchSharingEntryByExternalReferenceCode
public static SharingEntry fetchSharingEntryByExternalReferenceCode(String externalReferenceCode, long groupId) -
fetchSharingEntryByUuidAndGroupId
Returns the sharing entry matching the UUID and group.- Parameters:
uuid
- the sharing entry's UUIDgroupId
- the primary key of the group- Returns:
- the matching sharing entry, or
null
if a matching sharing entry could not be found
-
getActionableDynamicQuery
public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() -
getCompanySharingEntriesCount
public static int getCompanySharingEntriesCount(long companyId, long classNameId) -
getExportActionableDynamicQuery
public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(com.liferay.exportimport.kernel.lar.PortletDataContext portletDataContext) -
getFromUserSharingEntries
public static List<SharingEntry> getFromUserSharingEntries(long fromUserId, long classNameId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<SharingEntry> orderByComparator) Returns the ordered range of sharing entries for the type of resource shared by the user. The class name ID identifies the resource type.- Parameters:
fromUserId
- the user's IDclassNameId
- the class name ID of the resourcesstart
- the ordered range's lower boundend
- the ordered range's upper bound (not inclusive)orderByComparator
- the comparator that orders the sharing entries- Returns:
- the ordered range of sharing entries
-
getFromUserSharingEntriesCount
public static int getFromUserSharingEntriesCount(long fromUserId, long classNameId) Returns the number of sharing entries for the type of resource shared by the user. The class name ID identifies the resource type.- Parameters:
fromUserId
- the user's IDclassNameId
- the class name ID of the resources- Returns:
- the number of sharing entries
-
getGroupSharingEntries
Returns the the group's sharing entries.- Parameters:
groupId
- the primary key of the group- Returns:
- the sharing entries
-
getGroupSharingEntriesCount
public static int getGroupSharingEntriesCount(long groupId) Returns the the group's sharing entries count.- Parameters:
groupId
- the primary key of the group- Returns:
- the sharing entries count
-
getIndexableActionableDynamicQuery
public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() -
getOSGiServiceIdentifier
Returns the OSGi service identifier.- Returns:
- the OSGi service identifier
-
getPersistedModel
public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(Serializable primaryKeyObj) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getSharingEntries
Returns a range of all the sharing entries.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.sharing.model.impl.SharingEntryModelImpl
.- Parameters:
start
- the lower bound of the range of sharing entriesend
- the upper bound of the range of sharing entries (not inclusive)- Returns:
- the range of sharing entries
-
getSharingEntries
Returns the resource's sharing entries. The class name ID and class primary key identify the resource's type and instance, respectively.- Parameters:
classNameId
- the resource's class name IDclassPK
- the class primary key of the resource- Returns:
- the sharing entries
-
getSharingEntries
public static List<SharingEntry> getSharingEntries(long classNameId, long classPK, int start, int end) Returns the resource's sharing entries. The class name ID and class primary key identify the resource's type and instance, respectively.- Parameters:
classNameId
- the resource's class name IDclassPK
- the class primary key of the resourcestart
- the range's lower boundend
- the range's upper bound (not inclusive)- Returns:
- the sharing entries
-
getSharingEntriesByUuidAndCompanyId
Returns all the sharing entries matching the UUID and company.- Parameters:
uuid
- the UUID of the sharing entriescompanyId
- the primary key of the company- Returns:
- the matching sharing entries, or an empty list if no matches were found
-
getSharingEntriesByUuidAndCompanyId
public static List<SharingEntry> getSharingEntriesByUuidAndCompanyId(String uuid, long companyId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<SharingEntry> orderByComparator) Returns a range of sharing entries matching the UUID and company.- Parameters:
uuid
- the UUID of the sharing entriescompanyId
- the primary key of the companystart
- the lower bound of the range of sharing entriesend
- the upper bound of the range of sharing entries (not inclusive)orderByComparator
- the comparator to order the results by (optionallynull
)- Returns:
- the range of matching sharing entries, or an empty list if no matches were found
-
getSharingEntriesCount
public static int getSharingEntriesCount()Returns the number of sharing entries.- Returns:
- the number of sharing entries
-
getSharingEntriesCount
public static int getSharingEntriesCount(long classNameId, long classPK) Returns the resource's sharing entries count. The class name ID and class primary key identify the resource's type and instance, respectively.- Parameters:
classNameId
- the resource's class name IDclassPK
- the class primary key of the resource- Returns:
- the sharing entries count
-
getSharingEntry
public static SharingEntry getSharingEntry(long sharingEntryId) throws com.liferay.portal.kernel.exception.PortalException Returns the sharing entry with the primary key.- Parameters:
sharingEntryId
- the primary key of the sharing entry- Returns:
- the sharing entry
- Throws:
com.liferay.portal.kernel.exception.PortalException
- if a sharing entry with the primary key could not be found
-
getSharingEntry
public static SharingEntry getSharingEntry(long toUserId, long classNameId, long classPK) throws com.liferay.portal.kernel.exception.PortalException Returns the sharing entry for the resource shared with the user. The class name ID and class primary key identify the resource's type and instance, respectively.- Parameters:
toUserId
- the user's IDclassNameId
- the resource's class name IDclassPK
- the class primary key of the resource- Returns:
- the sharing entry
- 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
-
getSharingEntryByUuidAndGroupId
public static SharingEntry getSharingEntryByUuidAndGroupId(String uuid, long groupId) throws com.liferay.portal.kernel.exception.PortalException Returns the sharing entry matching the UUID and group.- Parameters:
uuid
- the sharing entry's UUIDgroupId
- the primary key of the group- Returns:
- the matching sharing entry
- Throws:
com.liferay.portal.kernel.exception.PortalException
- if a matching sharing entry could not be found
-
getToUserSharingEntries
Returns the list of sharing entries for resources shared with the user.- Parameters:
toUserId
- the user's ID- Returns:
- the list of sharing entries
-
getToUserSharingEntries
Returns the range of sharing entries for resources shared with the user.- Parameters:
toUserId
- the user's IDstart
- the range's lower boundend
- the range's upper bound (not inclusive)- Returns:
- the range of sharing entries
-
getToUserSharingEntries
Returns the list of sharing entries for the type of resource shared with the user. The class name ID identifies the resource type.- Parameters:
toUserId
- the user's IDclassNameId
- the class name ID of the resources- Returns:
- the list of sharing entries
-
getToUserSharingEntries
public static List<SharingEntry> getToUserSharingEntries(long toUserId, long classNameId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<SharingEntry> orderByComparator) Returns the ordered range of sharing entries for the type of resource shared with the user. The class name ID identifies the resource type.- Parameters:
toUserId
- the user's IDclassNameId
- the class name ID of the resourcesstart
- the ordered range's lower boundend
- the ordered range's upper bound (not inclusive)orderByComparator
- the comparator that orders the sharing entries- Returns:
- the ordered range of sharing entries
-
getToUserSharingEntriesCount
public static int getToUserSharingEntriesCount(long toUserId) Returns the number of sharing entries for resources shared with the user.- Parameters:
toUserId
- the user's ID- Returns:
- the number of sharing entries
-
getToUserSharingEntriesCount
public static int getToUserSharingEntriesCount(long toUserId, long classNameId) Returns the number of sharing entries for the type of resource shared with the user. The class name ID identifies the resource type.- Parameters:
toUserId
- the user's IDclassNameId
- the class name ID of the resources- Returns:
- the number of sharing entries
-
hasSharingPermission
public static boolean hasSharingPermission(long toUserId, long classNameId, long classPK, SharingEntryAction sharingEntryAction) Returnstrue
if the resource with the sharing entry action has been shared with the user. The class name ID and class primary key identify the resource's type and instance, respectively.- Parameters:
toUserId
- the user's IDclassNameId
- the resource's class name IDclassPK
- the class primary key of the shared resourcesharingEntryAction
- the sharing entry action- Returns:
true
if the resource with the sharing entry action has been shared with the user;false
otherwise
-
updateSharingEntry
@Deprecated 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 Deprecated.As of Mueller (7.2.x), replaced bySharingEntryLocalService.updateSharingEntry(long, long, Collection, boolean, Date, ServiceContext)
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
-
updateSharingEntry
public static SharingEntry updateSharingEntry(long userId, 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:
userId
- the primary key of the user updating the sharing entrysharingEntryId
- 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
-
updateSharingEntry
Updates the sharing entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.Important: Inspect SharingEntryLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
sharingEntry
- the sharing entry- Returns:
- the sharing entry that was updated
-
getService
-
SharingEntryLocalService.updateSharingEntry(long, long, Collection, boolean, Date, ServiceContext)