I'm new here

i want to display all the formet template that i am using in module


I want to display all the formet template that starts from "ft_" . i did lot of changes but could't get formet template list.

I am able to get all page template ("pt_"), section template (st_ ) except formet template (ft_)

TemplateStoreRoot  templateStoreRoot=(TemplateStoreRoot) project_name.getUserService().getStore(Type.TEMPLATESTORE,false),

Listable<Template> listable=templateStoreRoot.getChildren(Template.class,true);

for(Template template : listable)







Please assist me what change i can make to get all the formet template for a given project (project_name)


8 Replies
Returning Creator

I use this:

ts = us.getStore(, false);

FormatTemplates fts = ts.getFormatTemplates();

Class templateClassName = java.lang.Class.forName("");

listable = fts.getChildren(templateClassName, true);


Thanks Andreas for answer.

but my requirement is i want to collect first all the template(page, section,formet,datasource etc) from template store root and store in a list and then want to apply other logic by iterating each template if they are formet template do something else something.

0 Kudos

I've implemented something similar once:

map = new HashMap();

map.put("PageTemplate", PageTemplate.class);

map.put("SectionTemplate", SectionTemplate.class);

map.put("FormatTemplate", FormatTemplate.class);

map.put("LinkTemplate", LinkTemplate.class);

map.put("Script", Script.class);

map.put("Schema", Schema.class);

map.put("Workflow", Workflow.class);

set = map.keySet();

for (s : set) {

      print("CHECKING TEMPLATES OF: " + s);


      templates = store.getChildren(map.get(s), true);

      for (tpl : templates) {




Syntax Highlighting ergänzt

0 Kudos

Hello Saurabh,

do you need further help or did the given answers already help you? If so, it would be great if you mark the "correct answer".

If you meanwhile found a solution by yourself, it would be very kind of you if you post it here.

Best regards


0 Kudos
I'm new here

Hi Saurabh

list = context.requireSpecialist(StoreAgent.TYPE).getStore(Store.Type.TEMPLATESTORE).getChildren(, true).toList() will get you all the format templates.



0 Kudos

Hi Vijay,

toList is not recommended, since it can cause performance issues!

You can still iterate without the toList call though.

Kind regards


I tried "getChildren(" but it didn't work. Previously I iterated it without any parameter at all and the classname of one of the elements of the result list had exactly this classname (I copied it from there). But no results.

0 Kudos

Hi Stefan,

sounds strange. The getChildren Method can be called on any Store, but passing PageRef doesn't make any sense when you're in the TemplateStore. TemplateStore can only return a template from the package "*".

PageRef will work when you're using the SiteStore.

Also you shouldn't use "PageRefImpl" as it is not a part of the official FirstSpirit Access API. So you should basically use Classes/Interfaces from the package "de.espirit.firstspirit.access.*". In this case you would pass just the PageRef Interface instead of the PageRefImpl Class.

Kind regards


0 Kudos