mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +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.Node;
|
||||
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.wizard.NewSpaceWizard;
|
||||
import org.alfresco.web.config.ClientConfigElement;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
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.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Bean providing properties and behaviour for the forums screens.
|
||||
@@ -467,6 +470,7 @@ public class ForumsBean implements IContextListener
|
||||
// create our Node representation
|
||||
MapNode node = new MapNode(nodeRef, this.nodeService, true);
|
||||
node.addPropertyResolver("icon", this.browseBean.resolverSpaceIcon);
|
||||
node.addPropertyResolver("smallIcon", this.resolverSmallIcon);
|
||||
|
||||
this.forums.add(node);
|
||||
}
|
||||
@@ -475,6 +479,7 @@ public class ForumsBean implements IContextListener
|
||||
// create our Node representation
|
||||
MapNode node = new MapNode(nodeRef, this.nodeService, true);
|
||||
node.addPropertyResolver("icon", this.browseBean.resolverSpaceIcon);
|
||||
node.addPropertyResolver("smallIcon", this.resolverSmallIcon);
|
||||
node.addPropertyResolver("replies", this.resolverReplies);
|
||||
|
||||
this.topics.add(node);
|
||||
@@ -485,6 +490,7 @@ public class ForumsBean implements IContextListener
|
||||
MapNode node = new MapNode(nodeRef, this.nodeService, true);
|
||||
|
||||
this.browseBean.setupDataBindingProperties(node);
|
||||
node.addPropertyResolver("smallIcon", this.resolverSmallIcon);
|
||||
node.addPropertyResolver("message", this.resolverContent);
|
||||
node.addPropertyResolver("replyTo", this.resolverReplyTo);
|
||||
|
||||
@@ -786,6 +792,24 @@ public class ForumsBean implements IContextListener
|
||||
// ------------------------------------------------------------------------------
|
||||
// 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 Object get(Node node)
|
||||
{
|
||||
@@ -1146,7 +1170,7 @@ public class ForumsBean implements IContextListener
|
||||
String colour = "orange";
|
||||
|
||||
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("/images/icons/user_large.gif'/><br/>");
|
||||
out.write((String)node.getProperties().get("creator"));
|
||||
@@ -1186,7 +1210,7 @@ public class ForumsBean implements IContextListener
|
||||
renderBodyContents(context, primaryColumn);
|
||||
renderBubbleBottom(out, contextPath, colour);
|
||||
|
||||
out.write("</td><td><img src='");
|
||||
out.write("</td><td valign='top'><img src='");
|
||||
out.write(contextPath);
|
||||
out.write("/images/icons/user_large.gif'/><br/>");
|
||||
out.write((String)node.getProperties().get("creator"));
|
||||
|
@@ -20,6 +20,8 @@ package org.alfresco.web.bean.wizard;
|
||||
import javax.faces.event.ActionEvent;
|
||||
|
||||
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.ui.common.Utils;
|
||||
import org.apache.commons.logging.Log;
|
||||
@@ -35,6 +37,44 @@ public class NewReplyWizard extends NewPostWizard
|
||||
{
|
||||
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)
|
||||
*/
|
||||
|
@@ -142,7 +142,19 @@ public class NewTopicWizard extends NewSpaceWizard
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user