Hi team,
it would be great if we could frame vertices in Freemarker templates.
It would allow various tricks in @GremlinGroovy which could return
things like .table() and .tree() and .groupBy(), i.e. Table, Map<Map<>>
and Map<...>
And then we could iterate through these structures right in the
template, without need for
a) extra type just to have somewhere to put the query to, or
b) an extra Freemarker function.
In combination with capability to do a gremlin query from WindupVertexFrame,
it could work like this:
<#list
reportModel.rootProject.gremlin("it.as('root').subProjects.as('project').files.as('file').table.cap")
as row>
<tr>
<td>${row['project']?frame('ProjectModel').name}</td>
<td>${row['file']?frame('FileModel').prettyPath}</td>
</tr>
<#/list>
The main advantage is that we could do quite complex data gathering
right in the template without need to introduce yet another model.
That could make reports significantly easier to code, IMO.
WDYT? Is it useful? Is it possible?
Ondra