Document Info example template now displays the target associations for a document.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5503 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast 2007-04-17 14:42:16 +00:00
parent 29f74ce148
commit 8977aaa12e
2 changed files with 36 additions and 26 deletions

View File

@ -12,35 +12,45 @@
</#if> </#if>
<b>Aspects:</b> <b>Aspects:</b>
<table> <table>
<#list document.aspects as aspect> <#list document.aspects as aspect>
<tr><td>${aspect}</td></tr> <tr><td>${aspect}</td></tr>
</#list> </#list>
</table>
<b>Assocs:</b>
<table>
<#list document.assocs?keys as key>
<tr><td>${key}</td><td>
<#list document.assocs[key] as t>
${t.displayPath}/${t.name}<br>
</#list>
</td></tr>
</#list>
</table> </table>
<b>Properties:</b> <b>Properties:</b>
<table> <table>
<#-- Get a list of all the property names for the document --> <#-- Get a list of all the property names for the document -->
<#assign props = document.properties?keys> <#assign props = document.properties?keys>
<#list props as t> <#list props as t>
<#-- If the property exists --> <#-- If the property exists -->
<#if document.properties[t]?exists> <#if document.properties[t]?exists>
<#-- If it is a date, format it accordingly --> <#-- If it is a date, format it accordingly -->
<#if document.properties[t]?is_date> <#if document.properties[t]?is_date>
<tr><td>${t} = ${document.properties[t]?datetime}</td></tr> <tr><td>${t} = ${document.properties[t]?datetime}</td></tr>
<#-- If it is a boolean, format it accordingly --> <#-- If it is a boolean, format it accordingly -->
<#elseif document.properties[t]?is_boolean> <#elseif document.properties[t]?is_boolean>
<tr><td>${t} = ${document.properties[t]?string("yes", "no")}</td></tr> <tr><td>${t} = ${document.properties[t]?string("yes", "no")}</td></tr>
<#-- If it is a collection, enumerate it --> <#-- If it is a collection, enumerate it -->
<#elseif document.properties[t]?is_enumerable> <#elseif document.properties[t]?is_enumerable>
<tr><td>${t} = <#list document.properties[t] as i>${i} </#list></td></tr> <tr><td>${t} = <#list document.properties[t] as i>${i} </#list></td></tr>
<#-- Otherwise treat it as a string --> <#-- Otherwise treat it as a string -->
<#else> <#else>
<tr><td>${t} = ${document.properties[t]}</td></tr> <tr><td>${t} = ${document.properties[t]}</td></tr>
</#if>
</#if> </#if>
</#if> </#list>
</#list>
</table> </table>
<#else> <#else>
No document found! No document found!

View File

@ -8,7 +8,7 @@
<view:properties> <view:properties>
<app:editInline>true</app:editInline> <app:editInline>true</app:editInline>
<cm:description>Displays useful information about the current document</cm:description> <cm:description>Displays useful information about the current document</cm:description>
<cm:content>contentUrl=classpath:alfresco/templates/content/examples/doc_info.ftl|mimetype=text/plain|size=1884|encoding=UTF-8</cm:content> <cm:content>contentUrl=classpath:alfresco/templates/content/examples/doc_info.ftl|mimetype=text/plain|size=2227|encoding=UTF-8</cm:content>
<cm:title>doc_info.ftl</cm:title> <cm:title>doc_info.ftl</cm:title>
<cm:name>doc_info.ftl</cm:name> <cm:name>doc_info.ftl</cm:name>
</view:properties> </view:properties>