- Fixed couple of bugs in forums stuff

- Made delete pages consistent

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2025 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2005-12-12 15:55:55 +00:00
parent 8f6bcff2d6
commit 7b8394f1f8
8 changed files with 65 additions and 24 deletions

View File

@@ -1098,7 +1098,8 @@ public class BrowseBean implements IContextListener
// clear the UI state in preparation for finishing the next action
if (invalidate == true)
{
invalidateComponents();
// use the context service to notify all registered beans
UIContextService.getInstance(FacesContext.getCurrentInstance()).notifyBeans();
}
}

View File

@@ -36,6 +36,7 @@ import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.GUID;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.UIListItem;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -192,7 +193,7 @@ public class NewTopicWizard extends NewSpaceWizard
// set the mimetype and encoding
writer.setMimetype(Repository.getMimeTypeForFileName(context, fileName));
writer.setEncoding("UTF-8");
writer.putContent(this.message);
writer.putContent(Utils.replaceLineBreaks(this.message));
}
}
}

View File

@@ -16,7 +16,9 @@
*/
package org.alfresco.web.ui.common;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.StringReader;
import java.net.URLEncoder;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@@ -278,6 +280,43 @@ public final class Utils
return out.append(str.substring(lastindex, str.length())).toString();
}
/**
* Replaces carriage returns and line breaks with the <br> tag.
*
* @param str The string to be parsed
* @return The string with line breaks removed
*/
public static String replaceLineBreaks(String str)
{
String replaced = null;
if (str != null)
{
try
{
StringBuilder parsedContent = new StringBuilder();
BufferedReader reader = new BufferedReader(new StringReader(str));
String line = reader.readLine();
while (line != null)
{
parsedContent.append(line).append("<br/>");
line = reader.readLine();
}
replaced = parsedContent.toString();
}
catch (IOException ioe)
{
if (logger.isWarnEnabled())
{
logger.warn("Failed to replace line breaks in string: " + str);
}
}
}
return replaced;
}
/**
* Helper to output an attribute to the output stream
*

View File

@@ -71,7 +71,7 @@
</td>
<td>
<div class="mainSubTitle"><h:outputText value="#{NavigationBean.nodeProperties.name}" /></div>
<div class="mainTitle"><h:outputText value="#{msg.delete_post}" /> '<h:outputText value="#{BrowseBean.actionSpace.name}" />'</div>
<div class="mainTitle"><h:outputText value="#{msg.delete_post}" /></div>
<div class="mainSubText"><h:outputText value="#{msg.delete_post_info}" /></div>
</td>
</tr>
@@ -117,7 +117,7 @@
<tr>
<td class="mainSubTitle">
<h:outputFormat value="#{msg.delete_post_confirm}">
<f:param value="#{BrowseBean.actionSpace.name}"/>
<f:param value="#{BrowseBean.document.properties.creator}"/>
</h:outputFormat>
</td>
</tr>
@@ -137,7 +137,7 @@
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.yes}" action="#{BrowseBean.deleteSpaceOK}" styleClass="dialogControls" />
<h:commandButton value="#{msg.yes}" action="#{BrowseBean.deleteFileOK}" styleClass="dialogControls" />
</td>
</tr>
<tr><td class="dialogButtonSpacing"></td></tr>

View File

@@ -88,7 +88,7 @@
</a:actionLink>
<r:permissionEvaluator value="#{NavigationBean.currentNode}" allow="Delete" id="eval2">
<a:actionLink value="#{msg.delete_topic}" image="/images/icons/delete.gif" padding="4" action="deleteTopic" actionListener="#{BrowseBean.setupDeleteAction}" id="link3">
<f:param name="id" value="#{NavigationBean.currentNodeId}" id="param1" />
<f:param name="id" value="#{NavigationBean.currentNodeId}" id="param2" />
</a:actionLink>
</r:permissionEvaluator>
<%-- Current space More actions menu --%>
@@ -160,7 +160,7 @@
<f:facet name="header">
<h:outputText value="#{msg.post}" />
</f:facet>
<h:outputText value="#{r.message}" />
<h:outputText value="#{r.message}" escape="false" />
</a:column>
<%-- Author column for the details view mode --%>
@@ -227,7 +227,7 @@
</a:actionLink>
</r:permissionEvaluator>
<r:permissionEvaluator value="#{r}" allow="Delete">
<a:actionLink value="#{msg.delete_post}" image="/images/icons/delete.gif" showLink="false" styleClass="inlineAction" action="deletePost" actionListener="#{BrowseBean.setupDeleteAction}">
<a:actionLink value="#{msg.delete_post}" image="/images/icons/delete.gif" showLink="false" styleClass="inlineAction" action="deletePost" actionListener="#{BrowseBean.setupContentAction}">
<f:param name="id" value="#{r.id}" />
</a:actionLink>
</r:permissionEvaluator>

View File

@@ -121,13 +121,13 @@
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.remove}" action="#{UserMembersBean.removeOK}" styleClass="dialogControls" />
<h:commandButton value="#{msg.yes}" action="#{UserMembersBean.removeOK}" styleClass="dialogControls" />
</td>
</tr>
<tr><td class="dialogButtonSpacing"></td></tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="cancel" styleClass="dialogControls" />
<h:commandButton value="#{msg.no}" action="cancel" styleClass="dialogControls" />
</td>
</tr>
</table>

View File

@@ -121,13 +121,13 @@
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.delete}" action="#{UsersBean.deleteOK}" styleClass="dialogControls" />
<h:commandButton value="#{msg.yes}" action="#{UsersBean.deleteOK}" styleClass="dialogControls" />
</td>
</tr>
<tr><td class="dialogButtonSpacing"></td></tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="manageUsers" styleClass="dialogControls" />
<h:commandButton value="#{msg.no}" action="manageUsers" styleClass="dialogControls" />
</td>
</tr>
</table>