Class CommentWidget

  • All Implemented Interfaces:
    Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
    Direct Known Subclasses:
    CommentEditionTag, CommentListTag, CommentTag

    public abstract class CommentWidget
    extends javax.servlet.jsp.tagext.TagSupport
    It defines the base class of a widget for the rendering and handling of comments in Silverpeas.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String COMMENT_WIDGET_DIV_CLASS
      The CSS class name of the XHTML div tag within which the comment widgets are displayed.
      static String COMMENT_WIDGET_DIV_ID
      The identifier of the XHTML div tag within which the comment widgets are displayed.
      • Fields inherited from class javax.servlet.jsp.tagext.TagSupport

        id, pageContext
      • Fields inherited from interface javax.servlet.jsp.tagext.IterationTag

        EVAL_BODY_AGAIN
      • Fields inherited from interface javax.servlet.jsp.tagext.Tag

        EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
    • Constructor Summary

      Constructors 
      Constructor Description
      CommentWidget()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      String getCallback()
      Gets a javascript function to call when an event occurs on a comment or on a list of comments.
      String getComponentId()
      Gets the identifier of the Silverpeas component instance to which the resource belongs.
      String getResourceId()
      Gets the unique identifier of the resource in Silverpeas.
      String getResourceType()
      Gets the type of the commented resource.
      String getUserId()
      Gets the unique identifier of the user that requested the page in which will be rendered the widget.
      org.apache.ecs.ElementContainer initWidget()
      Sets up the widget with all required information.
      void setCallback​(String callback)
      Sets the javascript function to call when an event occurs on a comment or on a list of comments.
      void setComponentId​(String componentId)
      Sets the unique identifier of the Silverpeas component instance to which the commented resource belongs.
      void setResourceId​(String resourceId)
      Sets the unique identifier of the resource that is commented out.
      void setResourceType​(String resourceType)
      Sets the type of the resource that is commented out.
      void setUserId​(String userId)
      Sets the unique identifier of the user that requested the page in which will be rendered the widget.
      • Methods inherited from class javax.servlet.jsp.tagext.TagSupport

        doAfterBody, doEndTag, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
    • Field Detail

      • COMMENT_WIDGET_DIV_ID

        public static final String COMMENT_WIDGET_DIV_ID
        The identifier of the XHTML div tag within which the comment widgets are displayed.
        See Also:
        Constant Field Values
      • COMMENT_WIDGET_DIV_CLASS

        public static final String COMMENT_WIDGET_DIV_CLASS
        The CSS class name of the XHTML div tag within which the comment widgets are displayed.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CommentWidget

        public CommentWidget()
    • Method Detail

      • getCallback

        public String getCallback()
        Gets a javascript function to call when an event occurs on a comment or on a list of comments.
        Returns:
        the callback to invoke.
      • setCallback

        public void setCallback​(String callback)
        Sets the javascript function to call when an event occurs on a comment or on a list of comments.
        Parameters:
        callback - the callback to invoke.
      • initWidget

        public org.apache.ecs.ElementContainer initWidget()
                                                   throws javax.servlet.jsp.JspException
        Sets up the widget with all required information. It initializes the JQuery comment plugin with and it parameterizes from Silverpeas settings and from the resource for which the comments should be rendered.
        Returns:
        a container of rendering elements.
        Throws:
        javax.servlet.jsp.JspException - if an error occurs while initializing the JQuery comment plugin.
      • getUserId

        public String getUserId()
        Gets the unique identifier of the user that requested the page in which will be rendered the widget.
        Returns:
        the unique identifier of the user.
      • setUserId

        public void setUserId​(String userId)
        Sets the unique identifier of the user that requested the page in which will be rendered the widget.
        Parameters:
        userId - the user identifier.
      • setComponentId

        public void setComponentId​(String componentId)
        Sets the unique identifier of the Silverpeas component instance to which the commented resource belongs.
        Parameters:
        componentId - the unique identifier of the instance of a Silverpeas component.
      • setResourceId

        public void setResourceId​(String resourceId)
        Sets the unique identifier of the resource that is commented out.
        Parameters:
        resourceId - the unique identifier of the commented resource.
      • setResourceType

        public void setResourceType​(String resourceType)
        Sets the type of the resource that is commented out.
        Parameters:
        resourceType - the type of the commented resource.
      • getComponentId

        public String getComponentId()
        Gets the identifier of the Silverpeas component instance to which the resource belongs.
        Returns:
        the component identifier.
      • getResourceId

        public String getResourceId()
        Gets the unique identifier of the resource in Silverpeas.
        Returns:
        the resource identifier.
      • getResourceType

        public String getResourceType()
        Gets the type of the commented resource.
        Returns: