diff --git a/config/alfresco/templates/content/examples/RSS_2.0_recent_docs.ftl b/config/alfresco/templates/content/examples/RSS_2.0_recent_docs.ftl
new file mode 100644
index 0000000000..4e4e68a4e8
--- /dev/null
+++ b/config/alfresco/templates/content/examples/RSS_2.0_recent_docs.ftl
@@ -0,0 +1,42 @@
+
+
+
+ Alfresco
+ Copyright (c) 2005 Alfresco Software, Inc. All rights reserved.
+ <#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">
+ ${spaceref}
+ Recent Changes to '${space.name}'
+ en-us
+ ${date?string(datetimeformat)}
+ ${date?string(datetimeformat)}
+ 120
+ Alfresco 1.2
+
+ ${space.name}
+ 32
+ 32
+ ${spaceref}
+ ${hostname}${space.icon32}
+
+ <#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)>
+ -
+
${child.properties.name}
+ ${hostname}${child.url}
+
+ ${""?xml}${child.properties.name}${" "?xml}
+ <#if child.properties["cm:description"]?exists && child.properties["cm:description"] != "">
+ ${child.properties["cm:description"]}
+ #if>
+
+ ${child.properties["cm:modified"]?string(datetimeformat)}
+ ${hostname}${child.url}
+
+ #if>
+ #list>
+
+
+
diff --git a/config/alfresco/templates/content/examples/doc_info.ftl b/config/alfresco/templates/content/examples/doc_info.ftl
index 859ba73dd7..00af7cc5b0 100644
--- a/config/alfresco/templates/content/examples/doc_info.ftl
+++ b/config/alfresco/templates/content/examples/doc_info.ftl
@@ -1,17 +1,18 @@
<#-- Shows some general info about the current document, including NodeRef and aspects applied -->
-
=====Template Start=====
-
-Current Document Info:
-Name: ${document.name}
-Ref: ${document.nodeRef}
-Type: ${document.type}
-Content URL: /alfresco${document.url}
-Locked: <#if document.isLocked>Yes<#else>No#if>
-Aspects:
-
-<#list document.aspects as aspect>
- ${aspect}
-#list>
-
-
-=====Template End=====
+General document info
+<#if document?exists>
+ Current Document Info:
+ Name: ${document.name}
+ Ref: ${document.nodeRef}
+ Type: ${document.type}
+ Content URL: /alfresco${document.url}
+ Locked: <#if document.isLocked>Yes<#else>No#if>
+ Aspects:
+
+ <#list document.aspects as aspect>
+ ${aspect}
+ #list>
+
+<#else>
+ No document found!
+#if>
diff --git a/config/alfresco/templates/content/examples/general_example.ftl b/config/alfresco/templates/content/examples/general_example.ftl
new file mode 100644
index 0000000000..c39d9b855f
--- /dev/null
+++ b/config/alfresco/templates/content/examples/general_example.ftl
@@ -0,0 +1,49 @@
+=====Example Template Start=====
+
+Company Home Space: ${companyhome.properties.name}
+
+My Home Space: ${userhome.properties.name}
+
+Company Home children count: ${companyhome.children?size}
+
+Company Home first child node name: ${companyhome.children[0].properties.name}
+
+<#if document?exists>
+Current Document Name: ${document.name}
+
+#if>
+Current Space Name: ${space.name}
+
+List of child spaces in my Home Space:
+
+<#list userhome.children as child>
+ <#if child.isContainer>
+
+
+ ${child.properties.name} (${child.children?size})
+ Path: ${child.displayPath}
+
+ #if>
+#list>
+
+
+List of docs in my Home Space (text only content shown inline, JPG images shown as thumbnails):
+
+<#list userhome.children as child>
+ <#if child.isDocument>
+ ${child.properties.name}
+ <#if child.mimetype = "text/plain">
+ ${child.content}
+ <#elseif child.mimetype = "image/jpeg">
+
+ #if>
+ #if>
+#list>
+
+
+Assoc example:
+<#if userhome.children[0].assocs["cm:contains"]?exists>
+ ${userhome.children[0].assocs["cm:contains"][0].name}
+#if>
+
+=====Example Template End=====
diff --git a/config/alfresco/templates/content/examples/localizable.ftl b/config/alfresco/templates/content/examples/localizable.ftl
index 12cf233a83..2b800f9ec0 100644
--- a/config/alfresco/templates/content/examples/localizable.ftl
+++ b/config/alfresco/templates/content/examples/localizable.ftl
@@ -1,10 +1,14 @@
<#-- Shows if a document is localizable and the locale if set -->
Localisable:
-<#if hasAspect(document, "cm:localizable") = 1>
- Yes
- <#if document.properties.locale?exists>
- Locale: ${document.properties.locale.properties.name}
+<#if document?exists>
+ <#if hasAspect(document, "cm:localizable") = 1>
+ Yes
+ <#if document.properties.locale?exists>
+ Locale: ${document.properties.locale.properties.name}
+ #if>
+ <#else>
+ No
#if>
<#else>
- No
+ No document found!
#if>
diff --git a/config/alfresco/templates/content/examples/my_docs_inline.ftl b/config/alfresco/templates/content/examples/my_docs_inline.ftl
new file mode 100644
index 0000000000..20e56a336c
--- /dev/null
+++ b/config/alfresco/templates/content/examples/my_docs_inline.ftl
@@ -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 -->
+
+<#list userhome.children as child>
+ <#if child.isDocument>
+ ${child.properties.name}
+ <#if child.mimetype = "text/plain">
+ ${child.content}
+ <#elseif child.mimetype = "image/jpeg">
+
+ #if>
+ #if>
+#list>
+
diff --git a/config/alfresco/templates/content/examples/recent_docs.ftl b/config/alfresco/templates/content/examples/recent_docs.ftl
new file mode 100644
index 0000000000..b15abb509d
--- /dev/null
+++ b/config/alfresco/templates/content/examples/recent_docs.ftl
@@ -0,0 +1,20 @@
+<#-- Table of docs in a specific folder, that have been created or modified in the last week -->
+Documents created or modified in the last week
+
+
+
+ Name
+ Created Date
+ Modified Date
+
+ <#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)>
+
+
+ ${child.properties.name}
+ ${child.properties["cm:created"]?datetime}
+ ${child.properties["cm:modified"]?datetime}
+
+ #if>
+ #list>
+
diff --git a/config/alfresco/templates/content/examples/translatable.ftl b/config/alfresco/templates/content/examples/translatable.ftl
index f47dc69d98..664f6e78e2 100644
--- a/config/alfresco/templates/content/examples/translatable.ftl
+++ b/config/alfresco/templates/content/examples/translatable.ftl
@@ -1,12 +1,16 @@
<#-- Shows the translations applied to a doc through the translatable aspect -->
Translatable:
-<#if hasAspect(document, "cm:translatable") = 1>
- Yes
-
- <#list document.assocs["cm:translations"] as t>
- ${t.content}
- #list>
-
+<#if document?exists>
+ <#if hasAspect(document, "cm:translatable") = 1>
+ Yes
+
+ <#list document.assocs["cm:translations"] as t>
+ ${t.content}
+ #list>
+
+ <#else>
+ No
+ #if>
<#else>
- No
+ No document found!
#if>
diff --git a/config/alfresco/templates/content/examples/xpath_search.ftl b/config/alfresco/templates/content/examples/xpath_search.ftl
new file mode 100644
index 0000000000..9d9a34c150
--- /dev/null
+++ b/config/alfresco/templates/content/examples/xpath_search.ftl
@@ -0,0 +1,26 @@
+<#-- Shows use of the childByNamePath, childrenByXPath and childrenByLuceneSearch API -->
+
+Template Documents in 'Company Home/Data Dictionary/Content Templates':
+
+<#list companyhome.childByNamePath["Data Dictionary/Content Templates"].children as child>
+ <#if child.isDocument>
+ ${child.properties.name}
+ #if>
+#list>
+
+
+Folders in 'Company Home/Data Dictionary/Space Templates/Software Engineering Project':
+
+<#list companyhome.childrenByXPath["*[@cm:name='Data Dictionary']/*[@cm:name='Space Templates']/*[@cm:name='Software Engineering Project']/*"] as child>
+ <#if child.isContainer>
+ ${child.properties.name}
+ #if>
+#list>
+
+
+Lucene Search - documents containing the text 'Alfresco'
+
diff --git a/config/alfresco/templates/content_template_examples.xml b/config/alfresco/templates/content_template_examples.xml
index 4889b16653..078bf14ffb 100644
--- a/config/alfresco/templates/content_template_examples.xml
+++ b/config/alfresco/templates/content_template_examples.xml
@@ -1,212 +1,211 @@
-
+
-
+
+ true
admin
- 2005-10-21T15:11:00.103+01:00
- company_logos.ftl
- 8138e003-423c-11da-be9d-bb84ac6911f1
+ 2006-02-10T09:10:45.906Z
+ Displays basic information about the current document
admin
- workspace
- contentUrl=classpath:alfresco/templates/content/examples/company_logos.ftl|mimetype=text/plain|size=690|encoding=UTF-8
- company_logos.ftl
- company_logos.ftl
- SpacesStore
- 2005-10-21T15:10:59.509+01:00
-
-
-
-
-
-
-
-
-
-
- admin
- 2005-10-21T15:11:00.900+01:00
- doc_info.ftl
- 81d1768e-423c-11da-be9d-bb84ac6911f1
- admin
- workspace
- contentUrl=classpath:alfresco/templates/content/examples/doc_info.ftl|mimetype=text/plain|size=577|encoding=UTF-8
+ contentUrl=classpath:alfresco/templates/content/examples/doc_info.ftl|mimetype=text/plain|size=636|encoding=UTF-8
doc_info.ftl
doc_info.ftl
- SpacesStore
2005-10-21T15:11:00.446+01:00
-
+
-
+
+ true
admin
- 2005-10-21T15:11:01.759+01:00
- example.ftl
- 8243e77b-423c-11da-be9d-bb84ac6911f1
+ 2006-02-10T09:10:50.390Z
+ Calculates if the document has the localizable aspect applied
admin
- workspace
- contentUrl=classpath:alfresco/templates/content/examples/example.ftl|mimetype=text/plain|size=1577|encoding=UTF-8
- example.ftl
- example.ftl
- SpacesStore
- 2005-10-21T15:11:01.196+01:00
-
-
-
-
-
-
-
-
-
-
- admin
- 2005-10-21T15:11:02.743+01:00
- localizable.ftl
- 82d7c318-423c-11da-be9d-bb84ac6911f1
- admin
- workspace
- contentUrl=classpath:alfresco/templates/content/examples/localizable.ftl|mimetype=text/plain|size=293|encoding=UTF-8
+ contentUrl=classpath:alfresco/templates/content/examples/localizable.ftl|mimetype=text/plain|size=380|encoding=UTF-8
localizable.ftl
localizable.ftl
- SpacesStore
2005-10-21T15:11:02.181+01:00
-
+
-
+
+ true
admin
- 2005-10-21T15:11:03.587+01:00
- my_docs.ftl
- 83692db5-423c-11da-be9d-bb84ac6911f1
+ 2006-02-10T09:10:51.937Z
+ Displays a list of the documents in the current user Home Space
admin
- workspace
contentUrl=classpath:alfresco/templates/content/examples/my_docs.ftl|mimetype=text/plain|size=750|encoding=UTF-8
my_docs.ftl
my_docs.ftl
- SpacesStore
2005-10-21T15:11:03.118+01:00
-
+
-
+
+ true
admin
- 2005-10-21T15:11:04.337+01:00
- my_pressreleases.ftl
- 83db9ea2-423c-11da-be9d-bb84ac6911f1
+ 2006-02-10T09:10:57.890Z
+ Displays a list of spaces in the current user Home Space
admin
- workspace
- contentUrl=classpath:alfresco/templates/content/examples/my_pressreleases.ftl|mimetype=text/plain|size=910|encoding=UTF-8
- my_pressreleases.ftl
- my_pressreleases.ftl
- SpacesStore
- 2005-10-21T15:11:03.868+01:00
-
-
-
-
-
-
-
-
-
-
- admin
- 2005-10-21T15:11:05.150+01:00
- my_spaces.ftl
- 84553b7f-423c-11da-be9d-bb84ac6911f1
- admin
- workspace
contentUrl=classpath:alfresco/templates/content/examples/my_spaces.ftl|mimetype=text/plain|size=682|encoding=UTF-8
my_spaces.ftl
my_spaces.ftl
- SpacesStore
2005-10-21T15:11:04.665+01:00
-
+
-
+
+ true
admin
- 2005-10-21T15:11:05.994+01:00
- my_summary.ftl
- 84d3934c-423c-11da-be9d-bb84ac6911f1
+ 2006-02-10T09:10:59.421Z
+ Shows a simple summary page about the current user and their Home Space
admin
- workspace
contentUrl=classpath:alfresco/templates/content/examples/my_summary.ftl|mimetype=text/plain|size=537|encoding=UTF-8
my_summary.ftl
my_summary.ftl
- SpacesStore
2005-10-21T15:11:05.509+01:00
-
+
-
+
+ true
admin
- 2005-10-21T15:11:06.759+01:00
- translatable.ftl
- 854f7a19-423c-11da-be9d-bb84ac6911f1
+ 2006-02-10T09:11:04.953Z
+ Calculates if the document has the translatable aspect applied
admin
- workspace
- contentUrl=classpath:alfresco/templates/content/examples/translatable.ftl|mimetype=text/plain|size=322|encoding=UTF-8
+ contentUrl=classpath:alfresco/templates/content/examples/translatable.ftl|mimetype=text/plain|size=415|encoding=UTF-8
translatable.ftl
translatable.ftl
- SpacesStore
2005-10-21T15:11:06.306+01:00
-
+
-
+
+ true
admin
- 2005-10-21T15:11:07.525+01:00
- userhome_docs.ftl
- 85c45b07-423c-11da-be9d-bb84ac6911f1
+ 2006-02-10T09:10:41.656Z
+ Renders a valid RSS2.0 XML document showing the documents in the current space created or modified in the last 7 days. The template should be configured to use the appropriate server and port before use.
admin
- workspace
- contentUrl=classpath:alfresco/templates/content/examples/userhome_docs.ftl|mimetype=text/plain|size=652|encoding=UTF-8
- userhome_docs.ftl
- userhome_docs.ftl
- SpacesStore
- 2005-10-21T15:11:07.072+01:00
+ contentUrl=classpath:alfresco/templates/content/examples/RSS_2.0_recent_docs.ftl|mimetype=text/plain|size=1917|encoding=UTF-8
+ RSS_2.0_recent_docs.ftl
+ RSS_2.0_recent_docs.ftl
+ 2006-01-13T15:49:50.695Z
+
+
+
+
+
+
+
+
+
+
+ true
+ admin
+ 2006-02-10T09:11:00.953Z
+ Displays a list of the documents in the current space created or modified in the last 7 days
+ admin
+ contentUrl=classpath:alfresco/templates/content/examples/recent_docs.ftl|mimetype=text/plain|size=968|encoding=UTF-8
+ recent_docs.ftl
+ recent_docs.ftl
+ 2006-01-13T15:50:02.164Z
+
+
+
+
+
+
+
+
+
+
+ true
+ admin
+ 2006-02-10T09:10:48.062Z
+ Example of various lists of documents, spaces and summary information about the current user
+ admin
+ contentUrl=classpath:alfresco/templates/content/examples/general_example.ftl|mimetype=text/plain|size=1608|encoding=UTF-8
+ general_example.ftl
+ general_example.ftl
+ 2006-02-10T09:10:47.796Z
+
+
+
+
+
+
+
+
+
+
+ true
+ admin
+ 2006-02-10T09:10:53.531Z
+ Displays a list of the documents in the current user Home Space. Text document content is shown inline, as is JPG content as small thumbnail images.
+ admin
+ contentUrl=classpath:alfresco/templates/content/examples/my_docs_inline.ftl|mimetype=text/plain|size=652|encoding=UTF-8
+ my_docs_inline.ftl
+ my_docs_inline.ftl
+ 2006-02-10T09:10:53.281Z
+
+
+
+
+
+
+
+
+
+
+ true
+ admin
+ 2006-02-10T09:11:07.031Z
+ Example of using XPath and Lucene searches within a template.
+ admin
+ contentUrl=classpath:alfresco/templates/content/examples/xpath_search.ftl|mimetype=text/plain|size=1109|encoding=UTF-8
+ xpath_search.ftl
+ xpath_search.ftl
+ 2006-02-10T09:11:06.750Z