templates.view-standardsregistry_docs-macros.ftl Maven / Gradle / Ivy
<#macro renderTags tags>
<#if tags?has_content>
<#list tags as tag>
<#if tag.objectIri?has_content>
${tag.label?html}
<#else>
${tag.label?html}
#if>
#list>
#if>
#macro>
<#macro renderPackage package>
${package.id?html}
(${package.id?html})
<#if package.description?has_content>${package.description}#if>
<@renderTags tags=package.tags/>
<#-- Subpackages -->
<#if package.children?has_content>
Packages
<#list package.children as subPackage>
- ${subPackage.id?html}
#list>
#if>
<#-- Entities index -->
<#if package.entityTypes?has_content>
Entities
<#list package.entityTypes as entity>
- ${entity.label?html}
#list>
back to top
<#-- Entities -->
<#list package.entityTypes as entity>
${entity.label?html}
<#if entity.extends?has_content>
extends ${entity.extends.label?html}#if><#if entity.isAbstract()> (abstract)#if>
<#if entity.description?has_content>${entity.description?html}<#else>No description
available#if>
<@renderTags tags=tagService.getTagsForEntity(entity)/>
<#-- Entity attributes -->
Attribute
Default
Type
Constraints
Description
<#assign depth = []/>
<#list entity.attributes as attribute>
<@renderAttribute attribute entity depth/>
#list>
back to entities
#list>
back to top
<#else>
This package does not contain entities
#if>
<#if package.children?has_content>
<#list package.children as subPackage>
<@renderPackage subPackage/>
#list>
#if>
#macro>
<#macro renderAttribute attribute entity depth>
<#assign nextDepth = depth + ["x"]/>
<#assign dataType=attribute.type>
<#list depth as lvl>
#list>${attribute.label?html}<#if attribute.isIdAttribute()>
(id attribute)#if><#if attribute.isLabelAttribute()> (label
attribute)#if><#if attribute.lookupAttributeIndex??>
(lookup attribute)#if>
<#if attribute.defaultValue?has_content>${attribute.defaultValue?html}#if>
${dataType?html}<#if dataType == "CATEGORICAL" || dataType == "CATEGORICAL_MREF" || dataType == "MREF" || dataType == "XREF">
(${attribute.refEntityType.label?html})#if>
<#assign constraints = []>
<#if attribute.isNillable()><#assign constraints = constraints + [ "nullable" ] />#if>
<#if attribute.isReadOnly()><#assign constraints = constraints + [ "read-only" ] />#if>
<#if attribute.isUnique()><#assign constraints = constraints + [ "unique" ] />#if>
<#if !attribute.isVisible()><#assign constraints = constraints + [ "hidden" ] />#if>
<#if attribute.isAuto()><#assign constraints = constraints + [ "auto" ] />#if>
<#if attribute.isAggregatable()><#assign constraints = constraints + [ "aggregates" ] />#if>
<#if attribute.range?has_content>
<#assign range = "range [">
<#if attribute.range.min?has_content>
<#assign range = range + "from " + attribute.range.min>
#if>
<#if attribute.range.max?has_content>
<#assign range = range + " to " + attribute.range.max>
#if>
<#assign range = range + "]">
<#assign constraints = constraints + [ range ] />
#if>
<#list constraints as constraint>${constraint?html}<#if constraint_has_next>, #if>#list>
<#if attribute.description?has_content>${attribute.description?html}#if>
<#if attribute.type == "COMPOUND">
<#list attribute.children as attributePart>
<@renderAttribute attributePart entity nextDepth/>
#list>
#if>
<#assign nextDepth = depth/>
#macro>
<#macro createPackageListItem package>
${package.id?html}
<#if package.children?has_content>
<#list package.children as subPackage>
<@createPackageListItem subPackage/>
#list>
#if>
#macro>