예제 #1
0
  protected String buildBody(ThemeDisplay themeDisplay, String excerpt, String url) {

    if (PropsValues.DISCUSSION_COMMENTS_FORMAT.equals("bbcode")) {
      return buildBBCodeBody(themeDisplay, excerpt, url);
    }

    return buildHTMLBody(themeDisplay, excerpt, url);
  }
  @Override
  public void populateConfigJSONObject(
      JSONObject jsonObject,
      Map<String, Object> inputEditorTaglibAttributes,
      ThemeDisplay themeDisplay,
      RequestBackedPortletURLFactory requestBackedPortletURLFactory) {

    jsonObject.put("allowedContent", PropsValues.DISCUSSION_COMMENTS_ALLOWED_CONTENT);
    jsonObject.put("toolbars", JSONFactoryUtil.createJSONObject());

    if (PropsValues.DISCUSSION_COMMENTS_FORMAT.equals("bbcode")) {
      String extraPlugins = jsonObject.getString("extraPlugins");

      if (Validator.isNull(extraPlugins)) {
        extraPlugins = "bbcode";
      } else if (!extraPlugins.contains("bbcode")) {
        extraPlugins = extraPlugins + ",bbcode";
      }

      jsonObject.put("extraPlugins", extraPlugins);
    }
  }