Class RatingListenerService
- java.lang.Object
-
- fr.paris.lutece.plugins.extend.modules.rating.service.RatingListenerService
-
public class RatingListenerService extends java.lang.ObjectService to manage listeners over ratings
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONSTANT_EVERY_EXTENDABLE_RESOURCE_TYPEConstant that represents every extendable resource type
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcreateRating(java.lang.String strExtendableResourceType, java.lang.String strIdExtendableResource, fr.paris.lutece.portal.service.security.LuteceUser user)Notify to listeners the creation of a rating.static voiddeleteRating(java.lang.String strExtendableResourceType, java.lang.String strIdExtendableResource, fr.paris.lutece.portal.service.security.LuteceUser user)Notify to listeners the modification of a rating.static booleanhasListener()Check if there is listeners to notifystatic voidregisterListener(java.lang.String strExtendableResourceType, IRatingListener listener)Register a rating listener.
-
-
-
Field Detail
-
CONSTANT_EVERY_EXTENDABLE_RESOURCE_TYPE
public static final java.lang.String CONSTANT_EVERY_EXTENDABLE_RESOURCE_TYPE
Constant that represents every extendable resource type- See Also:
- Constant Field Values
-
-
Method Detail
-
registerListener
public static void registerListener(java.lang.String strExtendableResourceType, IRatingListener listener)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(java.lang.String strExtendableResourceType, java.lang.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(java.lang.String strExtendableResourceType, java.lang.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
-
-