Class RatingListenerService
java.lang.Object
fr.paris.lutece.plugins.extend.modules.rating.service.RatingListenerService
Service to manage listeners over ratings
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstant that represents every extendable resource type -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcreateRating(String strExtendableResourceType, String strIdExtendableResource, fr.paris.lutece.portal.service.security.LuteceUser user) Notify to listeners the creation of a rating.static voiddeleteRating(String strExtendableResourceType, String strIdExtendableResource, fr.paris.lutece.portal.service.security.LuteceUser user) Notify to listeners the modification of a rating.static booleanCheck if there is listeners to notifystatic voidregisterListener(String strExtendableResourceType, IRatingListener listener) Register a rating listener.
-
Field Details
-
CONSTANT_EVERY_EXTENDABLE_RESOURCE_TYPE
Constant that represents every extendable resource type- See Also:
-
-
Method Details
-
registerListener
Register a rating listener.- Parameters:
strExtendableResourceType- The extendable resource type associated with the listener. UseCONSTANT_EVERY_EXTENDABLE_RESOURCE_TYPEto associated the listener with every resource type.listener- The listener to register
-
hasListener
public static boolean hasListener()Check if there is listeners to notify- Returns:
- True if there is at last one listener, false otherwise
-
createRating
public static void createRating(String strExtendableResourceType, String strIdExtendableResource, fr.paris.lutece.portal.service.security.LuteceUser user) Notify to listeners the creation of a rating. Only listeners associated with the extendable resource type of the rating are notified.- Parameters:
strExtendableResourceType- The extendable resource type of the created ratingstrIdExtendableResource- The extendable resource id of the rating
-
deleteRating
public static void deleteRating(String strExtendableResourceType, String strIdExtendableResource, fr.paris.lutece.portal.service.security.LuteceUser user) Notify to listeners the modification of a rating. Only listeners associated with the extendable resource type of the rating are notified.- Parameters:
strExtendableResourceType- The extendable resource type of the removed ratingstrIdExtendableResource- The extendable resource id of the ratinglistIdRemovedrating- The list of ids of removed ratings
-