diff --git a/source/java/org/alfresco/web/app/servlet/BaseServlet.java b/source/java/org/alfresco/web/app/servlet/BaseServlet.java index ca598c1c63..e810ed4445 100644 --- a/source/java/org/alfresco/web/app/servlet/BaseServlet.java +++ b/source/java/org/alfresco/web/app/servlet/BaseServlet.java @@ -74,7 +74,6 @@ public abstract class BaseServlet extends HttpServlet validRedirectJSPs.add("/jsp/dialog/about.jsp"); validRedirectJSPs.add("/jsp/dialog/advanced-search.jsp"); validRedirectJSPs.add("/jsp/dialog/system-info.jsp"); - validRedirectJSPs.add("/jsp/forums/forums.jsp"); validRedirectJSPs.add("/jsp/users/users.jsp"); validRedirectJSPs.add("/jsp/trashcan/trash-list.jsp"); } diff --git a/source/java/org/alfresco/web/bean/forums/CreateReplyDialog.java b/source/java/org/alfresco/web/bean/forums/CreateReplyDialog.java index 6eb6c0c471..5da944ae4b 100644 --- a/source/java/org/alfresco/web/bean/forums/CreateReplyDialog.java +++ b/source/java/org/alfresco/web/bean/forums/CreateReplyDialog.java @@ -62,32 +62,4 @@ public class CreateReplyDialog extends CreatePostDialog { return Application.getMessage(FacesContext.getCurrentInstance(), "reply"); } - - // ------------------------------------------------------------------------------ - // Bean Getters and Setters - - /** - * Returns the content of the post we are replying to - * - * @return The content - */ - public String getReplyContent() - { - if (this.replyContent == null) - { - // get the content reader of the node we are replying to - NodeRef replyNode = this.browseBean.getDocument().getNodeRef(); - if (replyNode != null) - { - ContentReader reader = this.contentService.getReader(replyNode, ContentModel.PROP_CONTENT); - - if (reader != null) - { - this.replyContent = reader.getContentString(); - } - } - } - - return this.replyContent; - } } diff --git a/source/java/org/alfresco/web/bean/forums/ForumsBean.java b/source/java/org/alfresco/web/bean/forums/ForumsBean.java index f6e14efa61..124d38388c 100644 --- a/source/java/org/alfresco/web/bean/forums/ForumsBean.java +++ b/source/java/org/alfresco/web/bean/forums/ForumsBean.java @@ -17,6 +17,7 @@ package org.alfresco.web.bean.forums; import java.io.IOException; +import java.io.StringWriter; import java.io.Writer; import java.text.MessageFormat; import java.text.SimpleDateFormat; @@ -536,6 +537,61 @@ public class ForumsBean implements IContextListener } } + /** + * Returns the HTML to represent a bubble rendition of the text of the the + * forum article being replied to. + * + * @return The HTML for the bubble + */ + public String getReplyBubbleHTML() + { + try + { + // if the forum being replied to was a new post show the orange bubble + // with the user on the left otherwise show the yellow bubble with the + // user on the right. + StringWriter writer = new StringWriter(); + + FacesContext context = FacesContext.getCurrentInstance(); + Node replyToNode = this.browseBean.getDocument(); + boolean isReplyPost = this.nodeService.hasAspect(replyToNode.getNodeRef(), + ContentModel.ASPECT_REFERENCING); + String contextPath = context.getExternalContext().getRequestContextPath(); + String colour = isReplyPost ? "yellow" : "orange"; + String bgColour = isReplyPost ? "#FFF5A3" : "#FCC75E"; + + // build the HTML to represent the user that posted the article being replied to + StringBuilder replyPosterHTML = new StringBuilder("