Re: Request For Comment - freemarker-cli

2017-03-06 Thread David E Jones
![](https://link.nylas.com/open/5xm8m568zhx9qyloglsg31huz/local-
f9830cf8-c217?r=ZGV2QGZyZWVtYXJrZXIuaW5jdWJhdG9yLmFwYWNoZS5vcmc=)

  

On Mar 6 2017, at 7:24 am, Daniel Dekany  wrote:  

> Anyway, anybody has thoughts about this?  

  

This sort of contribution seems to come up a lot with open source projects,
and IMO this is in the category of something that doesn't make sense in the
core project but rather as an extension or add on that (at least initially) is
better as a separate project. GitHub or the like are helpful places to host
them and some page on the FreeMarker site (or in a wiki) can be dedicated to
listing these related projects. I've seen these referred to as 'awesome'
lists, but I have not idea where that term came from!

  

-David

  

  

> Monday, March 6, 2017, 12:07:26 PM, Siegfried Goeschl wrote:

>

> > Hi folks,  
>  
> I'm playing around with Template Engines for a couple of years and  
> over Christmas I moved some of my code from Velocity for FreeMarker.  
>  
> One piece of code which could be useful to the public is  
> https://github.com/sgoeschl/freemarker-cli  
>   
>  
> * Don’t now if I already re-invented the wheel :-)  
> * Please note that this is my first contact with Apache FreeMarker  
> * I would like to ditch Groovy and migrate to a stand-alone Java application  
> * It is already under ASL-2.0  
>  
> So the question is - could this be a useful contribution to the  
> project?! As far as I know open source is not oneway only :-)  
>  
> Thanks in advance,  
>  
> Siegfried Goeschl  
>

>

> \--  
Thanks,  
 Daniel Dekany



Re: Question about String Concatenation [FM2]

2017-03-06 Thread Daniel Dekany
Monday, March 6, 2017, 4:36:12 PM, Ingo Mahnke wrote:

> Hallo,
> one question.
>
> This works:
> <#list imagesLayout?split(";") as x>
>  style="width:100%">
> 
> <#list x?split("-") as y>
> <#assign s = "image"+y>
> <@img
> width="100%" height="185" style="width:100%;" name="${s}"/>
> 
> 
> 
> 
>
>
>
> Why this will not work:
> <#list imagesLayout?split(";") as x>
>  style="width:100%">
> 
> <#list x?split("-") as y>
>   <@img
> width="100%" height="185" style="width:100%;" name="${"image"+y}"/>
> 
> 
> 
> 
>
>
> Why I have to use the "assign"?

It should be

   name="image"+y

or

  name="image${y}"

The problem occurs because the @img tag isn't just static like HTML,
so the parameters to it are FTL expressions. "${"image"+y}" isn't a
valid expression (the quotation marks are messed up). "${'image'+y}"
would be valid, but it's not the shortest way.

> Thank you
> Ingo

-- 
Thanks,
 Daniel Dekany



Re: Request For Comment - freemarker-cli

2017-03-06 Thread Siegfried Goeschl
Hi Denis,

a few thoughts along the line

* all of the mentioned dependencies are ASL 2.0 so in terms of licences that is 
as safe as it gets
* personally I would have a hard time NOT use Apache Commons CSV :-)

Thanks in advance,

Siegfried Goeschl


> On 6 Mar 2017, at 12:52, brede...@me.com wrote:
> 
> Thanks Siegfried, looks good. 
> 
> It has dependency on org.jayway.jsonpath, org.apache.poi and 
> org.apache.commons, need to think how to handle that (I may select a 
> different csv parser in fact).
> 
> Regards,
> 
> -- Denis.
>   Original Message  
> From: Siegfried Goeschl
> Sent: Monday, 6 March 2017 11:07
> To: dev@freemarker.incubator.apache.org
> Reply To: dev@freemarker.incubator.apache.org
> Subject: Request For Comment - freemarker-cli
> 
> Hi folks,
> 
> I'm playing around with Template Engines for a couple of years and over 
> Christmas I moved some of my code from Velocity for FreeMarker.
> 
> One piece of code which could be useful to the public is 
> https://github.com/sgoeschl/freemarker-cli 
> 
> 
> * Don’t now if I already re-invented the wheel :-)
> * Please note that this is my first contact with Apache FreeMarker
> * I would like to ditch Groovy and migrate to a stand-alone Java application
> * It is already under ASL-2.0
> 
> So the question is - could this be a useful contribution to the project?! As 
> far as I know open source is not oneway only :-)
> 
> Thanks in advance,
> 
> Siegfried Goeschl
> 



Re: Request For Comment - freemarker-cli

2017-03-06 Thread Daniel Dekany
Regarding if it's an useful contribution to the project. Currently,
the Apache FreeMarker (incubating) project is only the engine itself.
So unless we widen the scope of the project, while it certainly helps
with the popularity/usefulness of the FreeMarker project, it's not a
direct contribution to it.

Some may point out that the project already have multiple "products",
all in its own repository (but still under the umbrella of the Apache
FreeMarker project):

- freemarker: The engine itself, freemarker.jar. This is the only thing
  has releases. The others are just dependencies.

- freemarker-docgen: Transforms XDocBook to HTML. The reason it's here
  is that both our homepage and the Manual are generated with this.

- freemarker-site: The content of the homepage

- Recently we started working on bringing over the small project
  behind http://freemarker-online.kenshoo.com/. So it's just yet
  another 3rd party tool, so why bring it in as a "product" of the
  project? The intent is that it will be part of our home page (so
  it's not a product with actual releases). It's a "tool" for trying
  out the engine itself, it has no other intended utility, so it
  fits in. Though the real incentive was that we saw the service being
  endangered (becoming outdated, etc.), and we want a service where
  the users can try the engine quickly. Also we have contributed to it
  substantially... we don't want those work hours to be lost.

So these are all stuff used for publish/documenting the engine itself.

But I'm not saying that it's totally impossible to bring in standalone
tools as additional "products". I'm just not sure if we want get into
that business. Because, what policy we want to follow? Why some
project remains on GitHub, and why some become products of the
FreeMarker project? Is that good for the ecosystem?

(BTW, there's FMPP for example, another command line tool for
FreeMarker. It has always remained an independent GitHub project. It
was actually written by me (when I was still quite junior so I'm not
very proud of it... but it works), so surely I could use my influence,
but I just think it fits in. However, it's linked from the
freemarker.org side menu, for ages... can be seen as an abuse of
power. (-: Heck, I have never though of that... I will remove that
link. But, note that freemarker-online is also linked there, simply
because it's quite useful for many users. So for widely useful and
proven stuff that's a possibility.)

Anyway, anybody has thoughts about this?


Monday, March 6, 2017, 12:07:26 PM, Siegfried Goeschl wrote:

> Hi folks,
>
> I'm playing around with Template Engines for a couple of years and
> over Christmas I moved some of my code from Velocity for FreeMarker.
>
> One piece of code which could be useful to the public is
> https://github.com/sgoeschl/freemarker-cli
> 
>
> * Don’t now if I already re-invented the wheel :-)
> * Please note that this is my first contact with Apache FreeMarker
> * I would like to ditch Groovy and migrate to a stand-alone Java application
> * It is already under ASL-2.0
>
> So the question is - could this be a useful contribution to the
> project?! As far as I know open source is not oneway only :-)
>
> Thanks in advance,
>
> Siegfried Goeschl
>

-- 
Thanks,
 Daniel Dekany



Re: Request For Comment - freemarker-cli

2017-03-06 Thread bredelet
Thanks Siegfried, looks good. 

It has dependency on org.jayway.jsonpath, org.apache.poi and 
org.apache.commons, need to think how to handle that (I may select a different 
csv parser in fact).

Regards,

-- Denis.
  Original Message  
From: Siegfried Goeschl
Sent: Monday, 6 March 2017 11:07
To: dev@freemarker.incubator.apache.org
Reply To: dev@freemarker.incubator.apache.org
Subject: Request For Comment - freemarker-cli

Hi folks,

I'm playing around with Template Engines for a couple of years and over 
Christmas I moved some of my code from Velocity for FreeMarker.

One piece of code which could be useful to the public is 
https://github.com/sgoeschl/freemarker-cli 


* Don’t now if I already re-invented the wheel :-)
* Please note that this is my first contact with Apache FreeMarker
* I would like to ditch Groovy and migrate to a stand-alone Java application
* It is already under ASL-2.0

So the question is - could this be a useful contribution to the project?! As 
far as I know open source is not oneway only :-)

Thanks in advance,

Siegfried Goeschl