fr.paris.lutece.plugins.extend.modules.comment.service
Class CommentListenerService

java.lang.Object
  extended by fr.paris.lutece.plugins.extend.modules.comment.service.CommentListenerService

public class CommentListenerService
extends Object

Service to manage listeners over comments


Field Summary
static String CONSTANT_EVERY_EXTENDABLE_RESOURCE_TYPE
          Constant that represents every extendable resource type
 
Method Summary
static void createComment(String strExtendableResourceType, String strIdExtendableResource, boolean bPublished)
          Notify to listeners the creation of a comment.
static void deleteComment(String strExtendableResourceType, String strIdExtendableResource, List<Integer> listIdRemovedComment)
          Notify to listeners the modification of a comment.
static boolean hasListener()
          Check if there is listeners to notify
static void publishComment(int nIdComment, boolean bPublished)
          Notify to listeners the modification of a comment.
static void publishComment(String strExtendableResourceType, String strIdExtendableResource, boolean bPublished)
          Notify to listeners the modification of a comment.
static void registerListener(String strExtendableResourceType, ICommentListener listener)
          Register a comment listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONSTANT_EVERY_EXTENDABLE_RESOURCE_TYPE

public static final 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(String strExtendableResourceType,
                                    ICommentListener listener)
Register a comment 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

createComment

public static void createComment(String strExtendableResourceType,
                                 String strIdExtendableResource,
                                 boolean bPublished)
Notify to listeners the creation of a comment. Only listeners associated with the extendable resource type of the comment are notified.

Parameters:
strExtendableResourceType - The extendable resource type of the created comment
strIdExtendableResource - The extendable resource id of the comment
bPublished - True if the comment is published, false otherwise

publishComment

public static void publishComment(int nIdComment,
                                  boolean bPublished)
Notify to listeners the modification of a comment. Only listeners associated with the extendable resource type of the comment are notified.

Parameters:
nIdComment - The id of the updated comment
bPublished - True if the comment was published, false if it was unpublished

publishComment

public static void publishComment(String strExtendableResourceType,
                                  String strIdExtendableResource,
                                  boolean bPublished)
Notify to listeners the modification of a comment. Only listeners associated with the extendable resource type of the comment are notified.

Parameters:
strExtendableResourceType - The extendable resource type of the updated comment
strIdExtendableResource - The extendable resource id of the comment
bPublished - True if the comment was published, false if it was unpublished

deleteComment

public static void deleteComment(String strExtendableResourceType,
                                 String strIdExtendableResource,
                                 List<Integer> listIdRemovedComment)
Notify to listeners the modification of a comment. Only listeners associated with the extendable resource type of the comment are notified.

Parameters:
strExtendableResourceType - The extendable resource type of the removed comment
strIdExtendableResource - The extendable resource id of the comment
listIdRemovedComment - The list of ids of removed comments


Copyright © 2013 Mairie de Paris. All Rights Reserved.