Cleanup of duplicated code in Utils (webclient) and StringUtils (webscriptframework).

Change header case check to case-insensitive in RemoteClient.
Addition of helper object to Script root scope for WebScripts - 'scriptUtils' with helper methods for encoding and stripping of HTML/JS etc.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10216 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2008-08-04 09:55:15 +00:00
parent 979d719f54
commit d7e1aa7bb0
5 changed files with 9 additions and 377 deletions

View File

@@ -66,8 +66,8 @@ public class CreatePostDialog extends CreateContentWizard
this.mimeType = Repository.getMimeTypeForFileName(
FacesContext.getCurrentInstance(), this.fileName);
// remove link breaks and replace with <br/>
this.content = Utils.replaceLineBreaks(this.content);
// remove link breaks and replace with <br>
this.content = Utils.replaceLineBreaks(this.content, false);
return super.finishImpl(context, outcome);
}

View File

@@ -61,8 +61,8 @@ public class CreateReplyDialog extends CreatePostDialog
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
// remove link breaks and replace with <br/>
this.content = Utils.replaceLineBreaks(this.content);
// remove link breaks and replace with <br>
this.content = Utils.replaceLineBreaks(this.content, false);
super.finishImpl(context, outcome);

View File

@@ -112,7 +112,7 @@ public class CreateTopicDialog extends CreateSpaceDialog
// set the mimetype and encoding
writer.setMimetype(Repository.getMimeTypeForFileName(context, fileName));
writer.setEncoding("UTF-8");
writer.putContent(Utils.replaceLineBreaks(this.message));
writer.putContent(Utils.replaceLineBreaks(this.message, false));
return outcome;
}

View File

@@ -73,8 +73,8 @@ public class EditPostDialog extends CreatePostDialog
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
// remove link breaks and replace with <br/>
this.content = Utils.replaceLineBreaks(this.content);
// remove link breaks and replace with <br>
this.content = Utils.replaceLineBreaks(this.content, false);
// update the content
NodeRef postNode = this.browseBean.getDocument().getNodeRef();