Updated Spring Social JARs and made channels.get webscript a bit more robust.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28686 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
N Smith
2011-06-29 10:42:32 +00:00
parent 8ffa518037
commit 1aad9f6ac4
2 changed files with 41 additions and 35 deletions

View File

@@ -3,7 +3,7 @@
{ {
"data": "data":
{ {
urlLength: ${data.urlLength}, <#if data.urlLength??>urlLength: ${data.urlLength},</#if>
"publishChannels": "publishChannels":
<@publishLib.channelsJSON channels=data.publishChannels />, <@publishLib.channelsJSON channels=data.publishChannels />,
"statusUpdateChannels": "statusUpdateChannels":

View File

@@ -1,51 +1,57 @@
<#-- Renders a List of Channel.s --> <#-- Renders a List of Channel.s -->
<#macro channelsJSON channels> <#macro channelsJSON channels>
<#escape x as jsonUtils.encodeJSONString(x)> <#escape x as jsonUtils.encodeJSONString(x)>
[ [
<#list channels as channel> <#if channels??>
<@channelJSON channel=channel /> <#list channels as channel>
<#if channel_has_next>,</#if> <@channelJSON channel=channel />
</#list> <#if channel_has_next>,</#if>
] </#list>
</#if>
]
</#escape> </#escape>
</#macro> </#macro>
<#-- Renders a Channel. --> <#-- Renders a Channel. -->
<#macro channelJSON channel> <#macro channelJSON channel>
{ {
"url": "${channel.url}", "url": "${channel.url}",
"name": "${channel.name}", "name": "${channel.name}",
"title": "${channel.title}", "title": "${channel.title}",
"channelType": "channelType":
<@channelTypeJSON type=channel.channelType /> <@channelTypeJSON type=channel.channelType />
} }
</#macro> </#macro>
<#-- Renders a Channel Type. --> <#-- Renders a Channel Type. -->
<#macro channelTypeJSON type> <#macro channelTypeJSON type>
{ {
"id": "${type.id}", "id": "${type.id}",
"title": "${type.title}", "title": "${type.title}",
"url": "${type.url}", "url": "${type.url}",
"channelNodeType": "${type.channelNodeType}", <#if type.channelNodeType??>"channelNodeType": "${type.channelNodeType}",</#if>
"supportedContentTypes": "supportedContentTypes":
<@iterateStringsJSON strings=type.supportedContentTypes />, <@iterateStringsJSON strings=type.supportedContentTypes />,
"supportedMimeTypes": "supportedMimeTypes":
<@iterateStringsJSON strings=type.supportedMimeTypes/>, <@iterateStringsJSON strings=type.supportedMimeTypes/>,
"canPublish": ${type.canPublish}, "canPublish": ${type.canPublish},
"canPublishStatusUpdates": ${type.canPublishStatusUpdates}, "canPublishStatusUpdates": ${type.canPublishStatusUpdates},
"canUnpublish": ${type.canUnpublish}, "canUnpublish": ${type.canUnpublish},
"maxStatusLength": ${type.maxStatusLength}, <#if type.icon??>"icon": "${type.icon}",</#if>
"icon": "${type.icon}" "maxStatusLength": ${type.maxStatusLength}
} }
</#macro> </#macro>
<#-- Renders a List of Strings. --> <#-- Renders a List of Strings. -->
<#macro iterateStringsJSON strings> <#macro iterateStringsJSON strings>
[ <#if strings??>
<#list strings as string> [
"${string}" <#list strings as string>
<#if string_has_next>,</#if> "${string}"
</#list> <#if string_has_next>,</#if>
] </#list>
]
<#else>
[]
</#if>
</#macro> </#macro>