mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
. Update of all example template files - for bootstrap and source distribution.
. Fixed templates list in Preview screen to catch AccessDeniedException for Guest user access to templates folder git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2339 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0"?>
|
||||
<rss version="2.0">
|
||||
<channel>
|
||||
<title>Alfresco</title>
|
||||
<copyright>Copyright (c) 2005 Alfresco Software, Inc. All rights reserved.</copyright>
|
||||
<#assign hostname="http://localhost:8080/alfresco">
|
||||
<#assign spaceref="${hostname}/navigate/browse/${space.nodeRef.storeRef.protocol}/${space.nodeRef.storeRef.identifier}/${space.nodeRef.id}">
|
||||
<#assign datetimeformat="EEE, dd MMM yyyy hh:mm:ss zzz">
|
||||
<link>${spaceref}</link>
|
||||
<description>Recent Changes to '${space.name}'</description>
|
||||
<language>en-us</language>
|
||||
<lastBuildDate>${date?string(datetimeformat)}</lastBuildDate>
|
||||
<pubDate>${date?string(datetimeformat)}</pubDate>
|
||||
<ttl>120</ttl>
|
||||
<generator>Alfresco 1.2</generator>
|
||||
<image>
|
||||
<title>${space.name}</title>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
<link>${spaceref}</link>
|
||||
<url>${hostname}${space.icon32}</url>
|
||||
</image>
|
||||
<#assign weekms=1000*60*60*24*7>
|
||||
<#list space.childrenByXPath[".//*[subtypeOf('cm:content')]"] as child>
|
||||
<#if (dateCompare(child.properties["cm:modified"], date, weekms) == 1) || (dateCompare(child.properties["cm:created"], date, weekms) == 1)>
|
||||
<item>
|
||||
<title>${child.properties.name}</title>
|
||||
<link>${hostname}${child.url}</link>
|
||||
<description>
|
||||
${"<a href='${hostname}${child.url}'>"?xml}${child.properties.name}${"</a>"?xml}
|
||||
<#if child.properties["cm:description"]?exists && child.properties["cm:description"] != "">
|
||||
${child.properties["cm:description"]}
|
||||
</#if>
|
||||
</description>
|
||||
<pubDate>${child.properties["cm:modified"]?string(datetimeformat)}</pubDate>
|
||||
<guid isPermaLink="false">${hostname}${child.url}</guid>
|
||||
</item>
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
</channel>
|
||||
</rss>
|
@@ -1,17 +1,18 @@
|
||||
<#-- Shows some general info about the current document, including NodeRef and aspects applied -->
|
||||
<h3>=====Template Start=====</h3>
|
||||
|
||||
<h4>Current Document Info:</h4>
|
||||
<b>Name:</b> ${document.name}<br>
|
||||
<b>Ref:</b> ${document.nodeRef}<br>
|
||||
<b>Type:</b> ${document.type}<br>
|
||||
<b>Content URL:</b> <a href="/alfresco${document.url}">/alfresco${document.url}</a><br>
|
||||
<b>Locked:</b> <#if document.isLocked>Yes<#else>No</#if><br>
|
||||
<b>Aspects:</b>
|
||||
<table>
|
||||
<#list document.aspects as aspect>
|
||||
<tr><td>${aspect}</td></tr>
|
||||
</#list>
|
||||
</table>
|
||||
|
||||
<h3>=====Template End=====</h3>
|
||||
<h3>General document info</h3>
|
||||
<#if document?exists>
|
||||
<h4>Current Document Info:</h4>
|
||||
<b>Name:</b> ${document.name}<br>
|
||||
<b>Ref:</b> ${document.nodeRef}<br>
|
||||
<b>Type:</b> ${document.type}<br>
|
||||
<b>Content URL:</b> <a href="/alfresco${document.url}">/alfresco${document.url}</a><br>
|
||||
<b>Locked:</b> <#if document.isLocked>Yes<#else>No</#if><br>
|
||||
<b>Aspects:</b>
|
||||
<table>
|
||||
<#list document.aspects as aspect>
|
||||
<tr><td>${aspect}</td></tr>
|
||||
</#list>
|
||||
</table>
|
||||
<#else>
|
||||
No document found!
|
||||
</#if>
|
||||
|
@@ -0,0 +1,49 @@
|
||||
<h3>=====Example Template Start=====</h3>
|
||||
|
||||
<b>Company Home Space:</b> ${companyhome.properties.name}
|
||||
<br>
|
||||
<b>My Home Space:</b> ${userhome.properties.name}
|
||||
<br>
|
||||
<b>Company Home children count:</b> ${companyhome.children?size}
|
||||
<br>
|
||||
<b>Company Home first child node name:</b> ${companyhome.children[0].properties.name}
|
||||
<br>
|
||||
<#if document?exists>
|
||||
<b>Current Document Name:</b> ${document.name}
|
||||
<br>
|
||||
</#if>
|
||||
<b>Current Space Name:</b> ${space.name}
|
||||
|
||||
<h4>List of child spaces in my Home Space:</h4>
|
||||
<table>
|
||||
<#list userhome.children as child>
|
||||
<#if child.isContainer>
|
||||
<tr>
|
||||
<td><img src="/alfresco${child.icon32}"></td>
|
||||
<td><b>${child.properties.name}</b> (${child.children?size})</td>
|
||||
<td><b>Path:</b> ${child.displayPath}</td>
|
||||
</tr>
|
||||
</#if>
|
||||
</#list>
|
||||
</table>
|
||||
|
||||
<h4>List of docs in my Home Space (text only content shown inline, JPG images shown as thumbnails):</h4>
|
||||
<table>
|
||||
<#list userhome.children as child>
|
||||
<#if child.isDocument>
|
||||
<tr><td><img src="/alfresco${child.icon16}"></td><td><a href="/alfresco${child.url}">${child.properties.name}</a></td></tr>
|
||||
<#if child.mimetype = "text/plain">
|
||||
<tr><td></td><td>${child.content}</td></tr>
|
||||
<#elseif child.mimetype = "image/jpeg">
|
||||
<tr><td></td><td><img width=100 height=65 src="/alfresco${child.url}"></td></tr>
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
</table>
|
||||
|
||||
<h4>Assoc example:</h4>
|
||||
<#if userhome.children[0].assocs["cm:contains"]?exists>
|
||||
${userhome.children[0].assocs["cm:contains"][0].name}
|
||||
</#if>
|
||||
|
||||
<h3>=====Example Template End=====</h3>
|
@@ -1,10 +1,14 @@
|
||||
<#-- Shows if a document is localizable and the locale if set -->
|
||||
<b>Localisable:</b>
|
||||
<#if hasAspect(document, "cm:localizable") = 1>
|
||||
Yes<br>
|
||||
<#if document.properties.locale?exists>
|
||||
Locale: ${document.properties.locale.properties.name}
|
||||
<#if document?exists>
|
||||
<#if hasAspect(document, "cm:localizable") = 1>
|
||||
Yes<br>
|
||||
<#if document.properties.locale?exists>
|
||||
Locale: ${document.properties.locale.properties.name}
|
||||
</#if>
|
||||
<#else>
|
||||
No<br>
|
||||
</#if>
|
||||
<#else>
|
||||
No<br>
|
||||
No document found!
|
||||
</#if>
|
||||
|
@@ -0,0 +1,15 @@
|
||||
<#-- List of docs in the Home Space for current user -->
|
||||
<#-- If the doc mimetype is plain/text then the content is shown inline -->
|
||||
<#-- If the doc mimetype is JPEG then the image is shown inline as a small thumbnail image -->
|
||||
<table>
|
||||
<#list userhome.children as child>
|
||||
<#if child.isDocument>
|
||||
<tr><td>${child.properties.name}</td></tr>
|
||||
<#if child.mimetype = "text/plain">
|
||||
<tr><td style='padding-left:16px'>${child.content}</td></tr>
|
||||
<#elseif child.mimetype = "image/jpeg">
|
||||
<tr><td style='padding-left:16px'><img width=100 height=65 src="/alfresco${child.url}"><td></tr>
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
</table>
|
20
config/alfresco/templates/content/examples/recent_docs.ftl
Normal file
20
config/alfresco/templates/content/examples/recent_docs.ftl
Normal file
@@ -0,0 +1,20 @@
|
||||
<#-- Table of docs in a specific folder, that have been created or modified in the last week -->
|
||||
<h3>Documents created or modified in the last week</h3>
|
||||
<table cellpadding=2>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><b>Name</b></td>
|
||||
<td><b>Created Date</b></td>
|
||||
<td><b>Modified Date</b></td>
|
||||
</tr>
|
||||
<#list space.childrenByXPath[".//*[subtypeOf('cm:content')]"] as child>
|
||||
<#if (dateCompare(child.properties["cm:modified"], date, 1000*60*60*24*7) == 1) || (dateCompare(child.properties["cm:created"], date, 1000*60*60*24*7) == 1)>
|
||||
<tr>
|
||||
<td><a href="/alfresco${child.url}" target="new"><img src="/alfresco${child.icon16}" border=0></a></td>
|
||||
<td><a href="/alfresco${child.url}" target="new">${child.properties.name}</a></td>
|
||||
<td>${child.properties["cm:created"]?datetime}</td>
|
||||
<td>${child.properties["cm:modified"]?datetime}</td>
|
||||
</tr>
|
||||
</#if>
|
||||
</#list>
|
||||
</table>
|
@@ -1,12 +1,16 @@
|
||||
<#-- Shows the translations applied to a doc through the translatable aspect -->
|
||||
<b>Translatable:</b>
|
||||
<#if hasAspect(document, "cm:translatable") = 1>
|
||||
Yes<br>
|
||||
<table>
|
||||
<#list document.assocs["cm:translations"] as t>
|
||||
<tr><td>${t.content}</td></tr>
|
||||
</#list>
|
||||
</table>
|
||||
<#if document?exists>
|
||||
<#if hasAspect(document, "cm:translatable") = 1>
|
||||
Yes<br>
|
||||
<table>
|
||||
<#list document.assocs["cm:translations"] as t>
|
||||
<tr><td>${t.content}</td></tr>
|
||||
</#list>
|
||||
</table>
|
||||
<#else>
|
||||
No<br>
|
||||
</#if>
|
||||
<#else>
|
||||
No<br>
|
||||
No document found!
|
||||
</#if>
|
||||
|
26
config/alfresco/templates/content/examples/xpath_search.ftl
Normal file
26
config/alfresco/templates/content/examples/xpath_search.ftl
Normal file
@@ -0,0 +1,26 @@
|
||||
<#-- Shows use of the childByNamePath, childrenByXPath and childrenByLuceneSearch API -->
|
||||
|
||||
<h3>Template Documents in 'Company Home/Data Dictionary/Content Templates':</h3>
|
||||
<table>
|
||||
<#list companyhome.childByNamePath["Data Dictionary/Content Templates"].children as child>
|
||||
<#if child.isDocument>
|
||||
<tr><td><a href="/alfresco${child.url}" target="new">${child.properties.name}</a></td></tr>
|
||||
</#if>
|
||||
</#list>
|
||||
</table>
|
||||
|
||||
<h3>Folders in 'Company Home/Data Dictionary/Space Templates/Software Engineering Project':</h3>
|
||||
<table>
|
||||
<#list companyhome.childrenByXPath["*[@cm:name='Data Dictionary']/*[@cm:name='Space Templates']/*[@cm:name='Software Engineering Project']/*"] as child>
|
||||
<#if child.isContainer>
|
||||
<tr><td><img src="/alfresco${child.icon32}"> ${child.properties.name}</td></tr>
|
||||
</#if>
|
||||
</#list>
|
||||
</table>
|
||||
|
||||
<h3>Lucene Search - documents containing the text 'Alfresco'</h3>
|
||||
<table>
|
||||
<#list companyhome.childrenByLuceneSearch["TEXT:alfresco"] as child>
|
||||
<tr><td><a href="/alfresco${child.url}" target="new">${child.properties.name}</a></td></tr>
|
||||
</#list>
|
||||
</table>
|
Reference in New Issue
Block a user