mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Fixed encoding issue. Fixed problem with string conversion for page rename function in the wiki.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10565 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -52,10 +52,9 @@ function createWikiPage(name, folder, options)
|
||||
page.tags = [];
|
||||
|
||||
// Set cm:title
|
||||
page.properties["cm:title"] = name.replace(/_/g, " ");
|
||||
|
||||
// TODO: sort out appropriate permission(s)
|
||||
page.properties["cm:title"] = new String(name).replace(/_/g, " ");
|
||||
page.save();
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,8 @@ function main()
|
||||
return jsonError("No new name property specified");
|
||||
}
|
||||
// Remove any whitespace and replace with "_"
|
||||
var newName = String(json.get("name")).replace(/\\s+/g, "_");
|
||||
var newName = new String(json.get("name"));
|
||||
newName = newName.replace(/\s+/g, "_");
|
||||
|
||||
var params = getTemplateArgs(["siteId", "pageTitle"]);
|
||||
|
||||
@@ -43,18 +44,15 @@ function main()
|
||||
// Finally, now we can do what we are supposed to do
|
||||
try
|
||||
{
|
||||
var currentName = page.name;
|
||||
var currentName = page.name;
|
||||
|
||||
page.name = newName;
|
||||
page.properties["cm:title"] = new String(newName).replace(/_/g, " ");
|
||||
page.save();
|
||||
|
||||
/**
|
||||
var link = wiki.createNode(currentName, "cm:link");
|
||||
link.properties["cm:destination"] = page.nodeRef;
|
||||
link.save();
|
||||
**/
|
||||
var placeholder = createWikiPage(currentName, wiki, {
|
||||
content: "This page has been moved [[" + newName + "|here]]."
|
||||
});
|
||||
content: "This page has been moved [[" + newName + "|here]]."
|
||||
});
|
||||
|
||||
var d = {
|
||||
currentName: newName,
|
||||
|
@@ -1,8 +1,9 @@
|
||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
||||
{
|
||||
<#if result.error?exists>
|
||||
"error" : "${result.error}"
|
||||
<#else>
|
||||
"name" : "${result.name}"
|
||||
</#if>
|
||||
|
||||
}
|
||||
</#escape>
|
||||
|
@@ -1,3 +1,4 @@
|
||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
||||
{
|
||||
<#if result.page??>
|
||||
<#assign page = result.page>
|
||||
@@ -31,3 +32,4 @@
|
||||
"error" : "${result.error!""}"
|
||||
</#if>
|
||||
}
|
||||
</#escape>
|
Reference in New Issue
Block a user