You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by "Siegfried Goeschl (Jira)" <ji...@apache.org> on 2020/06/30 05:55:00 UTC

[jira] [Updated] (FREEMARKER-148) [freemarker-cli] Make usage of "DataSources" more "Freemarker" like

     [ https://issues.apache.org/jira/browse/FREEMARKER-148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Siegfried Goeschl updated FREEMARKER-148:
-----------------------------------------
    Description: 
"DataSources" is exposed to get/find documents - as suggested it would be nice to make the access more aligned with FreeMarker usage.

The way to go is to wrap "DataSources" and expose "TemplateSequenceModel" and "TemplateHashModel".

So accessing the first datasource would look like 

{code:java}
${GsonTool.toJson(YamlTool.parse(DataSources[0]))}
{code}

instead of 

```
${GsonTool.toJson(YamlTool.parse(DataSources.get(0)))}
```


  was:
"DataSources" is exposed to get/find documents - as suggested it would be nice to make the access more aligned with FreeMarker usage.

The way to go is to wrap "DataSources" and expose "TemplateSequenceModel" and "TemplateHashModel".

So accessing the first datasource would look like 

```
${GsonTool.toJson(YamlTool.parse(DataSources[0]))}
```

instead of 

```
${GsonTool.toJson(YamlTool.parse(DataSources.get(0)))}
```



> [freemarker-cli] Make usage of "DataSources" more "Freemarker" like
> -------------------------------------------------------------------
>
>                 Key: FREEMARKER-148
>                 URL: https://issues.apache.org/jira/browse/FREEMARKER-148
>             Project: Apache Freemarker
>          Issue Type: Task
>            Reporter: Siegfried Goeschl
>            Assignee: Siegfried Goeschl
>            Priority: Major
>
> "DataSources" is exposed to get/find documents - as suggested it would be nice to make the access more aligned with FreeMarker usage.
> The way to go is to wrap "DataSources" and expose "TemplateSequenceModel" and "TemplateHashModel".
> So accessing the first datasource would look like 
> {code:java}
> ${GsonTool.toJson(YamlTool.parse(DataSources[0]))}
> {code}
> instead of 
> ```
> ${GsonTool.toJson(YamlTool.parse(DataSources.get(0)))}
> ```



--
This message was sent by Atlassian Jira
(v8.3.4#803005)