Class SocialRequestLocalServiceImpl
- All Implemented Interfaces:
com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService,com.liferay.portal.kernel.service.BaseLocalService,com.liferay.portal.kernel.service.change.tracking.CTService<com.liferay.social.kernel.model.SocialRequest>,com.liferay.portal.kernel.service.PersistedModelLocalService,com.liferay.social.kernel.service.SocialRequestLocalService
- Author:
- Brian Wing Shun Chan
-
Field Summary
Fields inherited from class com.liferay.portlet.social.service.base.SocialRequestLocalServiceBaseImpl
counterLocalService, socialRequestLocalService, socialRequestPersistence -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.liferay.social.kernel.model.SocialRequestaddRequest(long userId, long groupId, String className, long classPK, int type, String extraData, long receiverUserId) Adds a social request to the database.voiddeleteReceiverUserRequests(long receiverUserId) Removes all the social requests for the receiving user.voiddeleteRequest(long requestId) Removes the social request identified by its primary key from the database.voiddeleteRequest(com.liferay.social.kernel.model.SocialRequest request) Removes the social request from the database.voiddeleteRequests(long className, long classPK) voiddeleteUserRequests(long userId) Removes all the social requests for the requesting user.List<com.liferay.social.kernel.model.SocialRequest>getReceiverUserRequests(long receiverUserId, int start, int end) Returns a range of all the social requests for the receiving user.List<com.liferay.social.kernel.model.SocialRequest>getReceiverUserRequests(long receiverUserId, int status, int start, int end) Returns a range of all the social requests with the given status for the receiving user.intgetReceiverUserRequestsCount(long receiverUserId) Returns the number of social requests for the receiving user.intgetReceiverUserRequestsCount(long receiverUserId, int status) Returns the number of social requests with the given status for the receiving user.List<com.liferay.social.kernel.model.SocialRequest>getUserRequests(long userId, int start, int end) Returns a range of all the social requests for the requesting user.List<com.liferay.social.kernel.model.SocialRequest>getUserRequests(long userId, int status, int start, int end) Returns a range of all the social requests with the given status for the requesting user.intgetUserRequestsCount(long userId) Returns the number of social requests for the requesting user.intgetUserRequestsCount(long userId, int status) Returns the number of social requests with the given status for the requesting user.booleanhasRequest(long userId, String className, long classPK, int type, int status) Returnstrueif a matching social requests exists in the database.booleanhasRequest(long userId, String className, long classPK, int type, long receiverUserId, int status) Returnstrueif a matching social request exists in the database.com.liferay.social.kernel.model.SocialRequestupdateRequest(long requestId, int status, com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay) Updates the social request replacing its status.Methods inherited from class com.liferay.portlet.social.service.base.SocialRequestLocalServiceBaseImpl
addSocialRequest, afterPropertiesSet, createPersistedModel, createSocialRequest, deletePersistedModel, deleteSocialRequest, deleteSocialRequest, destroy, dslQuery, dslQueryCount, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQueryCount, dynamicQueryCount, fetchSocialRequest, fetchSocialRequestByUuidAndGroupId, getActionableDynamicQuery, getBasePersistence, getCounterLocalService, getCTPersistence, getIndexableActionableDynamicQuery, getModelClass, getModelClassName, getOSGiServiceIdentifier, getPersistedModel, getSocialRequest, getSocialRequestByUuidAndGroupId, getSocialRequestLocalService, getSocialRequestPersistence, getSocialRequests, getSocialRequestsByUuidAndCompanyId, getSocialRequestsByUuidAndCompanyId, getSocialRequestsCount, initActionableDynamicQuery, runSQL, setCounterLocalService, setSocialRequestLocalService, setSocialRequestPersistence, updateSocialRequest, updateWithUnsafeFunctionMethods inherited from class com.liferay.portal.kernel.service.BaseLocalServiceImpl
getClassLoader, getLocalizationMapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.liferay.portal.kernel.service.PersistedModelLocalService
fetchPersistedModel
-
Constructor Details
-
SocialRequestLocalServiceImpl
public SocialRequestLocalServiceImpl()
-
-
Method Details
-
addRequest
public com.liferay.social.kernel.model.SocialRequest addRequest(long userId, long groupId, String className, long classPK, int type, String extraData, long receiverUserId) throws com.liferay.portal.kernel.exception.PortalException Adds a social request to the database.In order to add a social request, both the requesting user and the receiving user must be from the same company and neither of them can be the default user.
- Parameters:
userId- the primary key of the requesting usergroupId- the primary key of the groupclassName- the class name of the asset that is the subject of the requestclassPK- the primary key of the asset that is the subject of the requesttype- the request's typeextraData- the extra data regarding the requestreceiverUserId- the primary key of the user receiving the request- Returns:
- the social request
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteReceiverUserRequests
public void deleteReceiverUserRequests(long receiverUserId) Removes all the social requests for the receiving user.- Parameters:
receiverUserId- the primary key of the receiving user
-
deleteRequest
public void deleteRequest(long requestId) throws com.liferay.portal.kernel.exception.PortalException Removes the social request identified by its primary key from the database.- Parameters:
requestId- the primary key of the social request- Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteRequest
public void deleteRequest(com.liferay.social.kernel.model.SocialRequest request) Removes the social request from the database.- Parameters:
request- the social request to be removed
-
deleteRequests
public void deleteRequests(long className, long classPK) -
deleteUserRequests
public void deleteUserRequests(long userId) Removes all the social requests for the requesting user.- Parameters:
userId- the primary key of the requesting user
-
getReceiverUserRequests
public List<com.liferay.social.kernel.model.SocialRequest> getReceiverUserRequests(long receiverUserId, int start, int end) Returns a range of all the social requests for the receiving user.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil.ALL_POSwill return the full result set.- Parameters:
receiverUserId- the primary key of the receiving userstart- the lower bound of the range of resultsend- the upper bound of the range of results (not inclusive)- Returns:
- the range of matching social requests
-
getReceiverUserRequests
public List<com.liferay.social.kernel.model.SocialRequest> getReceiverUserRequests(long receiverUserId, int status, int start, int end) Returns a range of all the social requests with the given status for the receiving user.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil.ALL_POSwill return the full result set.- Parameters:
receiverUserId- the primary key of the receiving userstatus- the social request's statusstart- the lower bound of the range of resultsend- the upper bound of the range of results (not inclusive)- Returns:
- the range of matching social requests
-
getReceiverUserRequestsCount
public int getReceiverUserRequestsCount(long receiverUserId) Returns the number of social requests for the receiving user.- Parameters:
receiverUserId- the primary key of the receiving user- Returns:
- the number of matching social requests
-
getReceiverUserRequestsCount
public int getReceiverUserRequestsCount(long receiverUserId, int status) Returns the number of social requests with the given status for the receiving user.- Parameters:
receiverUserId- the primary key of the receiving userstatus- the social request's status- Returns:
- the number of matching social requests
-
getUserRequests
public List<com.liferay.social.kernel.model.SocialRequest> getUserRequests(long userId, int start, int end) Returns a range of all the social requests for the requesting user.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil.ALL_POSwill return the full result set.- Parameters:
userId- the primary key of the requesting userstart- the lower bound of the range of resultsend- the upper bound of the range of results (not inclusive)- Returns:
- the range of matching social requests
-
getUserRequests
public List<com.liferay.social.kernel.model.SocialRequest> getUserRequests(long userId, int status, int start, int end) Returns a range of all the social requests with the given status for the requesting user.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil.ALL_POSwill return the full result set.- Parameters:
userId- the primary key of the requesting userstatus- the social request's statusstart- the lower bound of the range of resultsend- the upper bound of the range of results (not inclusive)- Returns:
- the range of matching social requests
-
getUserRequestsCount
public int getUserRequestsCount(long userId) Returns the number of social requests for the requesting user.- Parameters:
userId- the primary key of the requesting user- Returns:
- the number of matching social requests
-
getUserRequestsCount
public int getUserRequestsCount(long userId, int status) Returns the number of social requests with the given status for the requesting user.- Parameters:
userId- the primary key of the requesting userstatus- the social request's status- Returns:
- the number of matching social request
-
hasRequest
Returnstrueif a matching social requests exists in the database.- Parameters:
userId- the primary key of the requesting userclassName- the class name of the asset that is the subject of the requestclassPK- the primary key of the asset that is the subject of the requesttype- the request's typestatus- the social request's status- Returns:
trueif the request exists;falseotherwise
-
hasRequest
public boolean hasRequest(long userId, String className, long classPK, int type, long receiverUserId, int status) Returnstrueif a matching social request exists in the database.- Parameters:
userId- the primary key of the requesting userclassName- the class name of the asset that is the subject of the requestclassPK- the primary key of the asset that is the subject of the requesttype- the request's typereceiverUserId- the primary key of the receiving userstatus- the social request's status- Returns:
trueif the social request exists;falseotherwise
-
updateRequest
public com.liferay.social.kernel.model.SocialRequest updateRequest(long requestId, int status, com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay) throws com.liferay.portal.kernel.exception.PortalException Updates the social request replacing its status.If the status is updated to
SocialRequestConstants.STATUS_CONFIRMthenSocialRequestInterpreterLocalService.processConfirmation(SocialRequest, ThemeDisplay)is called. If the status is updated toSocialRequestConstants.STATUS_IGNOREthenSocialRequestInterpreterLocalService.processRejection(SocialRequest, ThemeDisplay)is called.- Parameters:
requestId- the primary key of the social requeststatus- the new statusthemeDisplay- the theme display- Returns:
- the updated social request
- Throws:
com.liferay.portal.kernel.exception.PortalException
-