Home

custom view templates

You are here

10 posts / 0 new
Last post
custom view templates

Is there a repository for custom view templates?
I have seen screen shots of a jpg preview but cannot locate a template for it anywhere.

I should be under "Company Home" -> "Data Dictionary" -> "Presentation Templates".

You will be able to assign this templates to specific spaces using top area of "View Details" screen.

I'm sorry, I did not make myself clear. I do know how to apply a template. I was wondering if there is a place where Alfresco users post and trade their templates. I try to avoid doing anything that has already been done.

Ah... what a great idea!

I've created a page in the wiki where people can add presentation template examples (hopefully this is the right place to put these types of things):
http://wiki.alfresco.com/wiki/Example_Presentation_Templates

There are also some examples in the http://wiki.alfresco.com/wiki/Template_Guide

To help get the ball rolling i've added one of my templates that doesn't get installed by default.

Thanks,

Kevin

UI Team Manager and Technical Lead
http://twitter.com/kevinroast - Find me on Twitter!
http://wiki.alfresco.com - Alfresco Wiki docs and Community downloads
http://www.kevs3d.co.uk/dev - My personal HTML5 projects

Re: custom view templates

Hi all,

I need reports like following scenarios :
any HELP ?

1)
Audit data for a document
e.g. Document Name: Testout.txt
Number User Name Download time
1 | Joe 01/04/2008 HH:MM:SS
2 | Joe 11/02/2008 HH:MM:SS
3 | Smith 09/03/2008 HH:MM:SS
4 | Laura 10/03/2008 HH:MM:SS

2)
Document access for selected User
e.g. Document Accessed by Joe

Name Of Document Number of time accessed Last Accessed time
Testout.txt 10 04/01/2008
mySql.doc 2 03/11/2008

3)
Top 10 downloaded/clicked/viewed documents

Document Rank Document Name Number of times downloaded
1 Doc.txt 167
2 S3d.doc 101
3 Testout.txt 3
4 Setup.txt 1

Here all are fine but How do I major followings :
1) Number of times downloaded
2) Number of times accessed
3) Downloads
4) Login / Logout time

Please help for these FTLs.

Thanks

Ghanshyam Rathod
Senior Consultant
CIGNEX Datamatics Pvt Ltd
INDIA
http://alfrescocms.blogspot.in/
<< If this post was helpful, please click "mark comment as useful" >>

Re: custom view templates

Hi all,

For those interested, I explained one template to show the size of the contents of a space. It includes a chart and a table and show several interesting possible uses of Freemarker, like:

  • Creating a Freemarker sequence to reuse data several times in the template[/*]
  • Generate a dynamic Javascript function using Freemarker[/*]
  • Creating a recursive function in Freemarker[/*]

I hope this could help others either to show space contents sizes or create other templates.

The template is explained here on my blog:
http://cedric.bosdonnat.free.fr/wordpress/?p=85&lang_view=en

OpenOffice.org & Alfresco Consultant
StarXpert: http://www.starxpert.fr
Blog: http://cedric.bosdonnat.free.fr

Re: custom view templates

g_rathod wrote:

Audit data for a document
e.g. Document Name: Testout.txt
Number User Name Download time
1 | Joe 01/04/2008 HH:MM:SS
2 | Joe 11/02/2008 HH:MM:SS
3 | Smith 09/03/2008 HH:MM:SS
4 | Laura 10/03/2008 HH:MM:SS

You should get your ideas from the show-audit.ftl audit template shipped with Alfresco. If the number you want to show is only a incremented number, you can do it using a freemarker variable like this:

<#assign counter=1/>
<#list document.auditTrail as trail>
   <td>${counter}</td>
   <td>show the other audit informations here</td>
   <#assign counter = counter + 1/>
</#list>

g_rathod wrote:

2)
Document access for selected User
e.g. Document Accessed by Joe

Name Of Document Number of time accessed Last Accessed time
Testout.txt 10 04/01/2008
mySql.doc 2 03/11/2008

As the entry point to get the audit trail is the node, you should directly use an SQL request to query the audit facts on the user name. Here is the SQL request to use:

SELECT store_protocol, store_id, node_uuid FROM alf_audit_fact WHERE user_id = 'YOUR_LOGIN_HERE';

You sould mind that there might be audit facts that corresponds to no existing node as they might have been deleted. You can embed the SQL query and result presentation in a custom Freemarker root object. Here is the documentation on how to do this:

http://wiki.alfresco.com/wiki/Template_Guide#Custom_Root_Objects

g_rathod wrote:

3)
Top 10 downloaded/clicked/viewed documents

Document Rank Document Name Number of times downloaded
1 Doc.txt 167
2 S3d.doc 101
3 Testout.txt 3
4 Setup.txt 1

Here all are fine but How do I major followings :
1) Number of times downloaded
2) Number of times accessed
3) Downloads
4) Login / Logout time

The number of downloads is the number of ContentService.getReader audit facts for the document. You should be aware that this is the number of downloads from the server... and there may be caching on your network making it different from the number of clicks on the link.

For the login and logout times you should audit the AuthenticationService.authenticate method and AuthenticationService.deleteAuthentication methods.

I hope this could help you

OpenOffice.org & Alfresco Consultant
StarXpert: http://www.starxpert.fr
Blog: http://cedric.bosdonnat.free.fr

Re: custom view templates

Hi,
I need to make some reporting on my Alfresco repository, and I started from the 'Example Recursive Template' from the wiki (http://wiki.alfresco.com/wiki/Example_Recursive_Template). I added some counters in my template, and everything goes fine, but when I'm launching my template on a bigger space (more than 2000 sub-items) the results are wrong. It seems that relaunching the template finally gets the right count:
here is the output:

Content of /Platform/Education and training on 2009-06-06 15:06:43 (Fri)
Project count: 1,872
Result count: 692
Content count: 379
Content of /Platform/Education and training on 2009-51-06 15:51:11 (Fri)
Project count: 2,347
Result count: 1,266
Content count: 398
Content of /Platform/Education and training on 2009-21-06 16:21:48 (Fri)
Project count: 2,347
Result count: 1,266
Content count: 398

How could the template issue a different count when relaunching?!? Any idea? Thanks
here is the (quite simple) code:
<#macro recurse_macro node depth>
<#if !node.type?ends_with("systemfolder")>
<#if node.type?ends_with("project")><#assign projectCount= projectCount +1>
<#elseif node.type?ends_with("result")><#assign resultCount= resultCount +1>
<#elseif node.type?ends_with("content")><#assign contentCount= contentCount +1>
</#if>
<#if node.isContainer>
<#list node.children as child>
<#if node.children?size != 0 >
<@recurse_macro node=child depth=depth+1/>
</#if>
</#list>
</#if>
</#if>
</#macro>
 
<#assign projectCount= 0>
<#assign resultCount= 0>
<#assign contentCount= 0>
<#assign datetimeformat="yyyy-mm-dd HH:mm:ss (EEE)">
Content of <b>${space.displayPath}/${space.name}</b> on ${date?string(datetimeformat)}</br>
<#list space.children as child>
<@recurse_macro node=child depth=0/>
</#list>
 
Project count: <b>${projectCount}</b></br>
Result count: <b>${resultCount}</b></br>
Content count: <b>${contentCount}</b></br>

Re: custom view templates

Hi cbosdonnat,
I'm not able to access your blog may it has been expired.
Please do needful to me.

Thanks again for your contribution.