Class RatingListenerService

java.lang.Object
fr.paris.lutece.plugins.extend.modules.rating.service.RatingListenerService

public class RatingListenerService extends Object
Service to manage listeners over ratings
  • Field Details

    • CONSTANT_EVERY_EXTENDABLE_RESOURCE_TYPE

      public static final String CONSTANT_EVERY_EXTENDABLE_RESOURCE_TYPE
      Constant that represents every extendable resource type
      See Also:
  • Method Details

    • registerListener

      public static void registerListener(String strExtendableResourceType, IRatingListener listener)
      Register a rating listener.
      Parameters:
      strExtendableResourceType - The extendable resource type associated with the listener. Use CONSTANT_EVERY_EXTENDABLE_RESOURCE_TYPE to 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 rating
      strIdExtendableResource - 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 rating
      strIdExtendableResource - The extendable resource id of the rating
      listIdRemovedrating - The list of ids of removed ratings