list_objects freemarker method - List a collection that contains more than 1000 lines

371 views
Skip to first unread message

jeremy...@revevol.eu

unread,
Jul 16, 2013, 2:40:46 PM7/16/13
to suppor...@runmyprocess.com
Hi RMP community,

I'd like to list a collection bigger than 1000 lines in freemarker.

Unfortunately I cannot succes to loop (dynamically) on the (collection length)/100 in order to list the collection 100 lines by 100 lines (for bypassing the limitation)

Do you have freemarker examples for that, neither the examples in the user guide nor the freemarker references helped me.

Thanks a lot !!

Gareth Thiveux

unread,
Jul 17, 2013, 11:37:25 AM7/17/13
to suppor...@runmyprocess.com
Hi Jérémy,

The following function should do what you wanted :

<#function list_all_objects pattern collection_name index>
 <#assign list = list_objects(pattern,collection_name,index*1000,1000)>
 <#if (list?size = 1000)>
  <#assign list = list?eval+ list_all_objects(pattern,collection_name,index+1)>
  <#return list>
 <#else>
  <#return list?eval>
 </#if>
</#function>

<#assign my_pattern = {}>
<#assign my_collection_name = "clients">
${list_all_objects(my_pattern,my_collection_name,0)}


Regards,

Gareth THIVEUX   
Consultant Avant-Vente / Pre-Sales Consultant
 Fujitsu RunMyProcess
22 rue Chauchat, 75009 Paris - France (GMT+1)
website : Fujitsu RunMyProcess      



Fujitsu RunMyProcess user? Please add a review on GoogleApps Marketplace

Afin de contribuer au respect de l'environnement, merci de n'imprimer ce message qu'en cas de nécessité.
Be environmentally friendly: do not print this email unless it is entirely necessary.



--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
For more options, visit https://groups.google.com/a/runmyprocess.com/groups/opt_out.



Reply all
Reply to author
Forward
0 new messages