diff --git a/source/java/org/alfresco/web/bean/BrowseBean.java b/source/java/org/alfresco/web/bean/BrowseBean.java index 496bcb4933..2facfb463b 100644 --- a/source/java/org/alfresco/web/bean/BrowseBean.java +++ b/source/java/org/alfresco/web/bean/BrowseBean.java @@ -71,6 +71,7 @@ import org.alfresco.web.ui.repo.component.UINodePath; import org.alfresco.web.ui.repo.component.UISimpleSearch; import org.apache.log4j.Logger; import org.apache.log4j.Priority; +import org.springframework.util.StringUtils; /** * Bean providing properties and behaviour for the main folder/document browse screen and @@ -531,6 +532,7 @@ public class BrowseBean implements IContextListener // create our Node representation MapNode node = new MapNode(nodeRef, this.nodeService, true); node.addPropertyResolver("icon", this.resolverSpaceIcon); + node.addPropertyResolver("smallIcon", this.resolverSmallIcon); node.addPropertyResolver("beingDiscussed", this.resolverBeingDiscussed); this.containerNodes.add(node); @@ -648,6 +650,7 @@ public class BrowseBean implements IContextListener node.addPropertyResolver("path", this.resolverPath); node.addPropertyResolver("displayPath", this.resolverDisplayPath); node.addPropertyResolver("icon", this.resolverSpaceIcon); + node.addPropertyResolver("smallIcon", this.resolverSmallIcon); node.addPropertyResolver("beingDiscussed", this.resolverBeingDiscussed); this.containerNodes.add(node); @@ -814,6 +817,29 @@ public class BrowseBean implements IContextListener } }; + public NodePropertyResolver resolverSmallIcon = new NodePropertyResolver() { + public Object get(Node node) { + QNameNodeMap props = (QNameNodeMap)node.getProperties(); + + String icon = "space_small"; + + // we know we have small versions of the forum space types so use them! + QName nodeType = node.getType(); + if (nodeType.equals(ForumModel.TYPE_FORUMS) || nodeType.equals(ForumModel.TYPE_FORUM) || + nodeType.equals(ForumModel.TYPE_TOPIC)) + { + String storedIcon = (String)props.getRaw("app:icon"); + + if (storedIcon != null) + { + icon = StringUtils.replace(storedIcon, "_large", ""); + } + } + + return icon; + } + }; + public NodePropertyResolver resolverMimetype = new NodePropertyResolver() { public Object get(Node node) { ContentData content = (ContentData)node.getProperties().get(ContentModel.PROP_CONTENT); diff --git a/source/java/org/alfresco/web/bean/ForumsBean.java b/source/java/org/alfresco/web/bean/ForumsBean.java index 59ade67bae..162427c2e3 100644 --- a/source/java/org/alfresco/web/bean/ForumsBean.java +++ b/source/java/org/alfresco/web/bean/ForumsBean.java @@ -800,6 +800,21 @@ public class ForumsBean implements IContextListener */ public String deleteTopicOK() { + String outcomeOverride = "browse"; + + // find out what the parent type of the node being deleted + Node node = this.browseBean.getActionSpace(); + ChildAssociationRef assoc = this.nodeService.getPrimaryParent(node.getNodeRef()); + if (assoc != null) + { + NodeRef parent = assoc.getParentRef(); + QName parentType = this.nodeService.getType(parent); + if (parentType.equals(ForumModel.TYPE_FORUM)) + { + outcomeOverride = "topicDeleted"; + } + } + // call the generic handler String outcome = this.browseBean.deleteSpaceOK(); @@ -807,7 +822,7 @@ public class ForumsBean implements IContextListener if (outcome != null) { outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME + - AlfrescoNavigationHandler.DIALOG_SEPARATOR + "topicDeleted"; + AlfrescoNavigationHandler.DIALOG_SEPARATOR + outcomeOverride; } return outcome; diff --git a/source/web/jsp/browse/browse.jsp b/source/web/jsp/browse/browse.jsp index e97801b09a..006bfd24c6 100644 --- a/source/web/jsp/browse/browse.jsp +++ b/source/web/jsp/browse/browse.jsp @@ -226,7 +226,7 @@ - +