mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Initialised tags property to an empty array when creating a wiki page. Came up with a workaround to display "tags" property of a page in the Freemarker template.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10220 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -48,6 +48,9 @@ function createWikiPage(name, folder, options)
|
|||||||
page.content = options.content;
|
page.content = options.content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Initialise tags to empty array
|
||||||
|
page.tags = [];
|
||||||
|
|
||||||
// TODO: sort out appropriate permission(s)
|
// TODO: sort out appropriate permission(s)
|
||||||
page.save();
|
page.save();
|
||||||
return page;
|
return page;
|
||||||
|
@@ -74,15 +74,11 @@ function main()
|
|||||||
logger.log(e);
|
logger.log(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
return {
|
||||||
if (page.type == "{http://www.alfresco.org/model/content/1.0}link")
|
"page": page,
|
||||||
{
|
"tags": page.tags
|
||||||
page = search.findNode(page.properties["cm:destination"].nodeRef);
|
};
|
||||||
}
|
|
||||||
**/
|
|
||||||
return page;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var page = main();
|
model.result = main();
|
||||||
model.page = page;
|
|
||||||
|
@@ -1,8 +1,14 @@
|
|||||||
{
|
{
|
||||||
<#if page?exists>
|
<#if result?exists>
|
||||||
|
<#assign page = result.page>
|
||||||
"title" : "<#if page.properties.title?exists>${page.properties.title}<#else>${page.name?replace("_", " ")}</#if>",
|
"title" : "<#if page.properties.title?exists>${page.properties.title}<#else>${page.name?replace("_", " ")}</#if>",
|
||||||
"pagetext" : '${page.content?js_string}',
|
"pagetext" : '${page.content?js_string}',
|
||||||
"editable" : '<#if page.hasPermission("Write")>true<#else>false</#if>'
|
"editable" : '<#if page.hasPermission("Write")>true<#else>false</#if>',
|
||||||
|
"tags" : [
|
||||||
|
<#list result.tags as tag>
|
||||||
|
"${tag}"<#if tag_has_next>,</#if>
|
||||||
|
</#list>
|
||||||
|
]
|
||||||
<#if page.hasAspect("cm:versionable")>
|
<#if page.hasAspect("cm:versionable")>
|
||||||
, "versionhistory" : [
|
, "versionhistory" : [
|
||||||
<#list page.versionHistory?sort_by("versionLabel")?reverse as record>
|
<#list page.versionHistory?sort_by("versionLabel")?reverse as record>
|
||||||
|
Reference in New Issue
Block a user