`_ extension.
Here is a Freemarker template snipped using the layer information:
.. code-block::
<#include "common-header.ftl">
This is a collection with layers
<#list collection.layers as layerWrapper>
<#assign layer=layerWrapper.rawValue>
${layer.workspace.value}:${layer.layer.value}
${layer.title.value}
${layer.description.value}
<#if layer.styles??>
Styles
<#list layer.styles as styleWrapper>
<#assign style=styleWrapper.rawValue>
${(style.name.value)!}: ${(style.title.value)!}
#list>
#if>
<#assign wms=layer.services.rawValue.wms.rawValue>
<#if wms??>
WMS
Enabled: ${wms.enabled.value}
Formats:
<#list wms.formats as format>
- ${format.value}
#list>
#if>
<#assign wcs=layer.services.rawValue.wcs.rawValue>
<#if wcs??>
WCS
Enabled: ${wcs.enabled.value}
Formats:
<#list wcs.formats as format>
- ${format.value}
#list>
#if>
<#assign wmts=layer.services.rawValue.wmts.rawValue>
<#if wmts??>
WMTS
Enabled: ${wmts.enabled.value}
Formats:
<#list wmts.formats as format>
- ${format.value}
#list>
#if>
#list>
And here is a Features Templating JSON template exposing the same information, to use in the collection JSON output:
.. code-block:: json
{
"collections": [
{
"id": "${name}",
"title": "${title}",
"layers": [
{
"$source": "layers"
},
{
"workspace": "${workspace}",
"layer": "${layer}",
"styles": [
{
"$source": "styles"
},
{
"name": "${name}",
"title": "${title}"
}
],
"services": {
"wms": {
"enabled": "${services.wms.enabled}",
"formats": "${services.wms.formats}"
},
"wcs": {
"enabled": "${services.wcs.enabled}",
"formats": "${services.wcs.formats}"
}
}
}
]
}
]
}