/**
   * 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.
   *
   * @return a container of rendering elements.
   * @throws JspException if an error occurs while initializing the JQuery comment plugin.
   */
  public ElementContainer initWidget() throws JspException {
    String context = URLManager.getApplicationURL();
    ElementContainer xhtmlcontainer = new ElementContainer();
    div comments = new div();
    comments.setID(COMMENT_WIDGET_DIV_ID);
    comments.setClass(COMMENT_WIDGET_DIV_CLASS);
    script checkForm =
        new script().setType("text/javascript").setSrc(context + "/util/javaScript/checkForm.js");
    script initCommentPlugin =
        new script().setType("text/javascript").addElement(setUpJQueryCommentPlugin());

    xhtmlcontainer.addElement(comments).addElement(checkForm);
    JavascriptPluginInclusion.includeUserZoom(xhtmlcontainer);
    JavascriptPluginInclusion.includeComment(xhtmlcontainer);
    xhtmlcontainer.addElement(initCommentPlugin);
    return xhtmlcontainer;
  }
 @Override
 public void doTag() throws JspException, IOException {
   ElementContainer xhtml = new ElementContainer();
   try {
     SupportedJavaScriptPlugins jsPlugin = SupportedJavaScriptPlugins.valueOf(getName());
     switch (jsPlugin) {
       case embedPlayer:
         includeEmbedPlayer(xhtml);
         break;
       case audioPlayer:
         includeAudioPlayer(xhtml);
         break;
       case videoPlayer:
         includeVideoPlayer(xhtml);
         break;
       case qtip:
         includeQTip(xhtml);
         break;
       case datepicker:
         includeDatePicker(xhtml, getLanguage());
         break;
       case pagination:
         includePagination(xhtml);
         break;
       case breadcrumb:
         includeBreadCrumb(xhtml);
         break;
       case userZoom:
         includeUserZoom(xhtml);
         break;
       case invitme:
         includeInvitMe(xhtml);
         break;
       case messageme:
         includeMessageMe(xhtml);
         break;
       case wysiwyg:
         includeWysiwygEditor(xhtml);
         break;
       case responsibles:
         includeResponsibles(xhtml, getLanguage());
         break;
       case popup:
         includePopup(xhtml);
         break;
       case calendar:
         includeCalendar(xhtml);
         break;
       case iframeajaxtransport:
         includeIFrameAjaxTransport(xhtml);
         break;
       case preview:
         includePreview(xhtml);
         break;
       case notifier:
         includeNotifier(xhtml);
         break;
       case password:
         includePassword(xhtml);
         break;
       case gauge:
         includeGauge(xhtml);
         break;
       case jquery:
         includeJQuery(xhtml);
         break;
       case tags:
         includeTags(xhtml);
         break;
       case pdc:
         includePdc(xhtml);
         break;
       case tkn:
         includeSecurityTokenizing(xhtml);
         break;
       case rating:
         includeRating(xhtml);
         break;
       case toggle:
         includeToggle(xhtml);
         break;
       case lightslideshow:
         includeLightweightSlideshow(xhtml);
         break;
       case lang:
         includeLang(xhtml);
         break;
       case ticker:
         includeTicker(xhtml);
     }
   } catch (IllegalArgumentException ex) {
     // ignore
   }
   xhtml.output(getJspContext().getOut());
 }