mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Reply page now shows bubble of last post
Small icons in details view now reflect what it's set to Creating a topic or discussion now goes straight to bubble view git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2062 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -57,7 +57,9 @@ import org.alfresco.web.app.context.UIContextService;
|
|||||||
import org.alfresco.web.bean.repository.MapNode;
|
import org.alfresco.web.bean.repository.MapNode;
|
||||||
import org.alfresco.web.bean.repository.Node;
|
import org.alfresco.web.bean.repository.Node;
|
||||||
import org.alfresco.web.bean.repository.NodePropertyResolver;
|
import org.alfresco.web.bean.repository.NodePropertyResolver;
|
||||||
|
import org.alfresco.web.bean.repository.QNameNodeMap;
|
||||||
import org.alfresco.web.bean.repository.Repository;
|
import org.alfresco.web.bean.repository.Repository;
|
||||||
|
import org.alfresco.web.bean.wizard.NewSpaceWizard;
|
||||||
import org.alfresco.web.config.ClientConfigElement;
|
import org.alfresco.web.config.ClientConfigElement;
|
||||||
import org.alfresco.web.ui.common.Utils;
|
import org.alfresco.web.ui.common.Utils;
|
||||||
import org.alfresco.web.ui.common.component.UIActionLink;
|
import org.alfresco.web.ui.common.component.UIActionLink;
|
||||||
@@ -67,6 +69,7 @@ import org.alfresco.web.ui.common.component.data.UIRichList;
|
|||||||
import org.alfresco.web.ui.common.renderer.data.IRichListRenderer;
|
import org.alfresco.web.ui.common.renderer.data.IRichListRenderer;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bean providing properties and behaviour for the forums screens.
|
* Bean providing properties and behaviour for the forums screens.
|
||||||
@@ -467,6 +470,7 @@ public class ForumsBean implements IContextListener
|
|||||||
// create our Node representation
|
// create our Node representation
|
||||||
MapNode node = new MapNode(nodeRef, this.nodeService, true);
|
MapNode node = new MapNode(nodeRef, this.nodeService, true);
|
||||||
node.addPropertyResolver("icon", this.browseBean.resolverSpaceIcon);
|
node.addPropertyResolver("icon", this.browseBean.resolverSpaceIcon);
|
||||||
|
node.addPropertyResolver("smallIcon", this.resolverSmallIcon);
|
||||||
|
|
||||||
this.forums.add(node);
|
this.forums.add(node);
|
||||||
}
|
}
|
||||||
@@ -475,6 +479,7 @@ public class ForumsBean implements IContextListener
|
|||||||
// create our Node representation
|
// create our Node representation
|
||||||
MapNode node = new MapNode(nodeRef, this.nodeService, true);
|
MapNode node = new MapNode(nodeRef, this.nodeService, true);
|
||||||
node.addPropertyResolver("icon", this.browseBean.resolverSpaceIcon);
|
node.addPropertyResolver("icon", this.browseBean.resolverSpaceIcon);
|
||||||
|
node.addPropertyResolver("smallIcon", this.resolverSmallIcon);
|
||||||
node.addPropertyResolver("replies", this.resolverReplies);
|
node.addPropertyResolver("replies", this.resolverReplies);
|
||||||
|
|
||||||
this.topics.add(node);
|
this.topics.add(node);
|
||||||
@@ -485,6 +490,7 @@ public class ForumsBean implements IContextListener
|
|||||||
MapNode node = new MapNode(nodeRef, this.nodeService, true);
|
MapNode node = new MapNode(nodeRef, this.nodeService, true);
|
||||||
|
|
||||||
this.browseBean.setupDataBindingProperties(node);
|
this.browseBean.setupDataBindingProperties(node);
|
||||||
|
node.addPropertyResolver("smallIcon", this.resolverSmallIcon);
|
||||||
node.addPropertyResolver("message", this.resolverContent);
|
node.addPropertyResolver("message", this.resolverContent);
|
||||||
node.addPropertyResolver("replyTo", this.resolverReplyTo);
|
node.addPropertyResolver("replyTo", this.resolverReplyTo);
|
||||||
|
|
||||||
@@ -786,6 +792,24 @@ public class ForumsBean implements IContextListener
|
|||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
// Property Resolvers
|
// Property Resolvers
|
||||||
|
|
||||||
|
public NodePropertyResolver resolverSmallIcon = new NodePropertyResolver() {
|
||||||
|
public Object get(Node node) {
|
||||||
|
QNameNodeMap props = (QNameNodeMap)node.getProperties();
|
||||||
|
String icon = (String)props.getRaw("app:icon");
|
||||||
|
|
||||||
|
if (icon != null)
|
||||||
|
{
|
||||||
|
icon = StringUtils.replace(icon, "_large", "");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
icon = "space_small";
|
||||||
|
}
|
||||||
|
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
public NodePropertyResolver resolverReplies = new NodePropertyResolver() {
|
public NodePropertyResolver resolverReplies = new NodePropertyResolver() {
|
||||||
public Object get(Node node)
|
public Object get(Node node)
|
||||||
{
|
{
|
||||||
@@ -1146,7 +1170,7 @@ public class ForumsBean implements IContextListener
|
|||||||
String colour = "orange";
|
String colour = "orange";
|
||||||
|
|
||||||
out.write("<td><table border='0' cellpadding='0' cellspacing='0' width='100%'><tr>");
|
out.write("<td><table border='0' cellpadding='0' cellspacing='0' width='100%'><tr>");
|
||||||
out.write("<td><img src='");
|
out.write("<td valign='top'><img src='");
|
||||||
out.write(contextPath);
|
out.write(contextPath);
|
||||||
out.write("/images/icons/user_large.gif'/><br/>");
|
out.write("/images/icons/user_large.gif'/><br/>");
|
||||||
out.write((String)node.getProperties().get("creator"));
|
out.write((String)node.getProperties().get("creator"));
|
||||||
@@ -1186,7 +1210,7 @@ public class ForumsBean implements IContextListener
|
|||||||
renderBodyContents(context, primaryColumn);
|
renderBodyContents(context, primaryColumn);
|
||||||
renderBubbleBottom(out, contextPath, colour);
|
renderBubbleBottom(out, contextPath, colour);
|
||||||
|
|
||||||
out.write("</td><td><img src='");
|
out.write("</td><td valign='top'><img src='");
|
||||||
out.write(contextPath);
|
out.write(contextPath);
|
||||||
out.write("/images/icons/user_large.gif'/><br/>");
|
out.write("/images/icons/user_large.gif'/><br/>");
|
||||||
out.write((String)node.getProperties().get("creator"));
|
out.write((String)node.getProperties().get("creator"));
|
||||||
|
@@ -20,6 +20,8 @@ package org.alfresco.web.bean.wizard;
|
|||||||
import javax.faces.event.ActionEvent;
|
import javax.faces.event.ActionEvent;
|
||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
|
import org.alfresco.service.cmr.repository.ContentReader;
|
||||||
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
||||||
import org.alfresco.web.ui.common.Utils;
|
import org.alfresco.web.ui.common.Utils;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
@@ -35,6 +37,44 @@ public class NewReplyWizard extends NewPostWizard
|
|||||||
{
|
{
|
||||||
private static Log logger = LogFactory.getLog(NewReplyWizard.class);
|
private static Log logger = LogFactory.getLog(NewReplyWizard.class);
|
||||||
|
|
||||||
|
private String replyContent = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.alfresco.web.bean.wizard.AbstractWizardBean#init()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void init()
|
||||||
|
{
|
||||||
|
super.init();
|
||||||
|
|
||||||
|
this.replyContent = null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.alfresco.web.bean.wizard.AbstractWizardBean#startWizard(javax.faces.event.ActionEvent)
|
* @see org.alfresco.web.bean.wizard.AbstractWizardBean#startWizard(javax.faces.event.ActionEvent)
|
||||||
*/
|
*/
|
||||||
|
@@ -142,7 +142,19 @@ public class NewTopicWizard extends NewSpaceWizard
|
|||||||
{
|
{
|
||||||
super.finish();
|
super.finish();
|
||||||
|
|
||||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
String outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||||
|
|
||||||
|
if (this.editMode == false)
|
||||||
|
{
|
||||||
|
// if we are successful in creating the topic we need to setup
|
||||||
|
// the browse context for the new topic and pass an override
|
||||||
|
// outcome of 'showTopic'
|
||||||
|
this.browseBean.clickSpace(this.createdNode);
|
||||||
|
|
||||||
|
outcome = outcome + AlfrescoNavigationHandler.DIALOG_SEPARATOR + "showTopic";
|
||||||
|
}
|
||||||
|
|
||||||
|
return outcome;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -994,6 +994,14 @@
|
|||||||
</navigation-case>
|
</navigation-case>
|
||||||
</navigation-rule>
|
</navigation-rule>
|
||||||
|
|
||||||
|
<navigation-rule>
|
||||||
|
<from-view-id>/jsp/forums/create-topic.jsp</from-view-id>
|
||||||
|
<navigation-case>
|
||||||
|
<from-outcome>showTopic</from-outcome>
|
||||||
|
<to-view-id>/jsp/forums/topic.jsp</to-view-id>
|
||||||
|
</navigation-case>
|
||||||
|
</navigation-rule>
|
||||||
|
|
||||||
<navigation-rule>
|
<navigation-rule>
|
||||||
<from-view-id>/jsp/forums/forums-details.jsp</from-view-id>
|
<from-view-id>/jsp/forums/forums-details.jsp</from-view-id>
|
||||||
<navigation-case>
|
<navigation-case>
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
|
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
|
||||||
<%@ page isELIgnored="false" %>
|
<%@ page isELIgnored="false" %>
|
||||||
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
|
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
|
||||||
|
<%@ page import="org.alfresco.web.bean.ForumsBean.TopicBubbleViewRenderer" %>
|
||||||
|
|
||||||
<r:page titleId="title_create_reply">
|
<r:page titleId="title_create_reply">
|
||||||
|
|
||||||
@@ -84,7 +85,7 @@
|
|||||||
<h:graphicImage id="wizard-logo" url="/images/icons/post_reply_large.gif" />
|
<h:graphicImage id="wizard-logo" url="/images/icons/post_reply_large.gif" />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="mainSubTitle"><h:outputText value="#{BrowseBean.actionSpace.name}" /></div>
|
<div class="mainSubTitle"><h:outputText value="#{NavigationBean.nodeProperties.name}" /></div>
|
||||||
<div class="mainTitle"><h:outputText value="#{msg.post_reply}" /></div>
|
<div class="mainTitle"><h:outputText value="#{msg.post_reply}" /></div>
|
||||||
<div class="mainSubText"><h:outputText value="#{msg.create_reply_description}" /></div>
|
<div class="mainSubText"><h:outputText value="#{msg.create_reply_description}" /></div>
|
||||||
</td>
|
</td>
|
||||||
@@ -128,6 +129,29 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td colspan="2"><h:outputText value="#{msg.create_reply_finish}" /></td>
|
<td colspan="2"><h:outputText value="#{msg.create_reply_finish}" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr><td class="paddingRow"></td></tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||||
|
<tr>
|
||||||
|
<td width="100%">
|
||||||
|
<% TopicBubbleViewRenderer.renderBubbleTop(out, request.getContextPath(), "yellow", "#FFF5A3"); %>
|
||||||
|
<h:outputText value="#{msg.posted}:" styleClass="mainSubTitle" />
|
||||||
|
<h:outputText value="#{BrowseBean.document.properties.created}">
|
||||||
|
<a:convertXMLDate type="both" pattern="#{msg.date_time_pattern}" />
|
||||||
|
</h:outputText>
|
||||||
|
<% TopicBubbleViewRenderer.renderBubbleMiddle(out, request.getContextPath(), "yellow"); %>
|
||||||
|
<h:outputText value="#{CreateReplyDialog.replyContent}" escape="false" />
|
||||||
|
<% TopicBubbleViewRenderer.renderBubbleBottom(out, request.getContextPath(), "yellow"); %>
|
||||||
|
</td>
|
||||||
|
<td valign="top">
|
||||||
|
<h:graphicImage id="poster" url="/images/icons/user_large.gif" /><br/>
|
||||||
|
<h:outputText value="#{BrowseBean.document.properties.creator}" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
|
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
|
||||||
</td>
|
</td>
|
||||||
|
@@ -160,7 +160,7 @@
|
|||||||
<a:sortLink label="#{msg.topic}" value="name" mode="case-insensitive" styleClass="header"/>
|
<a:sortLink label="#{msg.topic}" value="name" mode="case-insensitive" styleClass="header"/>
|
||||||
</f:facet>
|
</f:facet>
|
||||||
<f:facet name="small-icon">
|
<f:facet name="small-icon">
|
||||||
<a:actionLink value="#{r.name}" image="/images/icons/topic.gif" actionListener="#{BrowseBean.clickSpace}" showLink="false">
|
<a:actionLink value="#{r.name}" image="/images/icons/#{r.smallIcon}.gif" actionListener="#{BrowseBean.clickSpace}" showLink="false">
|
||||||
<f:param name="id" value="#{r.id}" />
|
<f:param name="id" value="#{r.id}" />
|
||||||
</a:actionLink>
|
</a:actionLink>
|
||||||
</f:facet>
|
</f:facet>
|
||||||
|
@@ -172,7 +172,7 @@
|
|||||||
<a:sortLink label="#{msg.name}" value="name" mode="case-insensitive" styleClass="header"/>
|
<a:sortLink label="#{msg.name}" value="name" mode="case-insensitive" styleClass="header"/>
|
||||||
</f:facet>
|
</f:facet>
|
||||||
<f:facet name="small-icon">
|
<f:facet name="small-icon">
|
||||||
<a:actionLink value="#{r.name}" image="/images/icons/space_small.gif" actionListener="#{BrowseBean.clickSpace}" action="showTopics" showLink="false">
|
<a:actionLink value="#{r.name}" image="/images/icons/#{r.smallIcon}.gif" actionListener="#{BrowseBean.clickSpace}" action="showTopics" showLink="false">
|
||||||
<f:param name="id" value="#{r.id}" />
|
<f:param name="id" value="#{r.id}" />
|
||||||
</a:actionLink>
|
</a:actionLink>
|
||||||
</f:facet>
|
</f:facet>
|
||||||
|
Reference in New Issue
Block a user