diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/publishing/channels.get.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/publishing/channels.get.json.ftl index 8658650106..4eff4610ad 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/repository/publishing/channels.get.json.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/repository/publishing/channels.get.json.ftl @@ -3,7 +3,7 @@ { "data": { - urlLength: ${data.urlLength}, + <#if data.urlLength??>urlLength: ${data.urlLength}, "publishChannels": <@publishLib.channelsJSON channels=data.publishChannels />, "statusUpdateChannels": diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/publishing/publishing.lib.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/publishing/publishing.lib.ftl index f3504c7229..8d0e64aa7b 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/repository/publishing/publishing.lib.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/repository/publishing/publishing.lib.ftl @@ -1,51 +1,57 @@ <#-- Renders a List of Channel.s --> <#macro channelsJSON channels> <#escape x as jsonUtils.encodeJSONString(x)> - [ - <#list channels as channel> - <@channelJSON channel=channel /> - <#if channel_has_next>, - - ] +[ + <#if channels??> + <#list channels as channel> + <@channelJSON channel=channel /> + <#if channel_has_next>, + + +] <#-- Renders a Channel. --> <#macro channelJSON channel> - { - "url": "${channel.url}", - "name": "${channel.name}", - "title": "${channel.title}", - "channelType": - <@channelTypeJSON type=channel.channelType /> - } +{ + "url": "${channel.url}", + "name": "${channel.name}", + "title": "${channel.title}", + "channelType": + <@channelTypeJSON type=channel.channelType /> +} <#-- Renders a Channel Type. --> <#macro channelTypeJSON type> - { - "id": "${type.id}", - "title": "${type.title}", - "url": "${type.url}", - "channelNodeType": "${type.channelNodeType}", - "supportedContentTypes": - <@iterateStringsJSON strings=type.supportedContentTypes />, - "supportedMimeTypes": - <@iterateStringsJSON strings=type.supportedMimeTypes/>, - "canPublish": ${type.canPublish}, - "canPublishStatusUpdates": ${type.canPublishStatusUpdates}, - "canUnpublish": ${type.canUnpublish}, - "maxStatusLength": ${type.maxStatusLength}, - "icon": "${type.icon}" - } +{ + "id": "${type.id}", + "title": "${type.title}", + "url": "${type.url}", + <#if type.channelNodeType??>"channelNodeType": "${type.channelNodeType}", + "supportedContentTypes": + <@iterateStringsJSON strings=type.supportedContentTypes />, + "supportedMimeTypes": + <@iterateStringsJSON strings=type.supportedMimeTypes/>, + "canPublish": ${type.canPublish}, + "canPublishStatusUpdates": ${type.canPublishStatusUpdates}, + "canUnpublish": ${type.canUnpublish}, + <#if type.icon??>"icon": "${type.icon}", + "maxStatusLength": ${type.maxStatusLength} +} <#-- Renders a List of Strings. --> <#macro iterateStringsJSON strings> - [ - <#list strings as string> - "${string}" - <#if string_has_next>, - - ] +<#if strings??> +[ + <#list strings as string> + "${string}" + <#if string_has_next>, + +] +<#else> +[] +