Re: FreeMarker has graduated to TLP!

2018-03-24 Thread Christoph Rüger
Wow congratulations for your hard work and persistence :-)

Daniel Dekany <ddek...@apache.org> schrieb am Fr., 23. März 2018, 21:00:

> To quote the relevant part from the ASF Board Meeting Summary of March
> 21, 2018:
>
>   The following resolutions were passed unanimously:
>
> A. Establish the Apache FreeMarker Project (Dániel Dékány VP)
>
> So now that this uncertainty was eliminated, we can feel much more
> motivated to push FM ahead. We were awarded with the additional trust
> associated to the "Apache" brand, so let's put code behind it that
> fits the modern standards, by which I mean FM3. Of course, FM2 also
> needs to be maintained, even receive new features. But I believe FM3
> is absolutely necessary for growth, adoption in new projects.
>
> It will take a while until all the "paper work" and infrastructural
> changes are done
> (https://incubator.apache.org/guides/transferring.html). But we don't
> have to wait for all of that to release 2.3.28 as non-incubating, so I
> hope that will be done sometimes next week.
>
> --
> Thanks,
>  Daniel Dekany
>
>

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 5596493
Fax.: +49 3641 5596499
Internet: https://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: Started graduation resolution DISCUSS on general@incubator.a.o

2018-02-22 Thread Christoph Rüger
Congratulations :) Keeping my fingers crossed.

2018-02-22 15:16 GMT+01:00 Woonsan Ko <woon...@apache.org>:

> Congrats! Great job, everyone!
>
> Cheers,
>
> Woonsan
>
>
> On Thu, Feb 22, 2018 at 8:10 AM, Jacopo Cappellato
> <jacopo.cappell...@gmail.com> wrote:
> > The vote is now closed and it was successful!
> > While this is not the final step in the graduation process, and we will
> > have to wait until the 21st of March for the ASF Board to ratify the
> > resolution to establish the project, it is indeed an important step and
> > achievement: we got 12 positive binding votes from Incubator PMC members
> > and no negative votes. Congratulations to the community!
> >
> > I am going to wait for a few days before submitting the resolution to the
> > next Board meeting agenda.
> >
> > Kind regards,
> >
> > Jacopo
> >
> >
> > On Tue, Feb 6, 2018 at 6:42 PM, Daniel Dekany <ddek...@apache.org>
> wrote:
> >
> >> I have started the resolution DISCUSS thread on the
> >> general@incubator.a.o. PPMC members please follow the discussion, and
> >> chime in if necessary!
> >>
> >> --
> >> Thanks,
> >>  Daniel Dekany
> >>
> >>
>

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 5596493
Fax.: +49 3641 5596499
Internet: https://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: Changing official domain to freemarker.apache.org now? Was: Migrating [try.]freemarker.org to HTTPS, anyone?

2017-10-23 Thread Christoph Rüger
+1 for the change.

Please keep the structure of the urls the same as before as we have linked
to the Freemarker docs from various of our pages. This would make migration
of deeplinks easier.
http://freemarker.org/docs/ref_builtins_string.html
should then be
http://freemarker.apache.org/docs/ref_builtins_string.html

Also it would be helpful to keep freemarker.org around for a while with a
redirect.
We need some time to migrate all the links.



2017-10-23 11:48 GMT+02:00 Daniel Dekany <ddek...@apache.org>:

> As this issue that we aren't using an apache.org domain comes up again
> and again, I propose that we switch to freemarker.apache.org now. Also
> to try.freemarker.apache.org. Anybody for or against it?
>
>
> Friday, October 20, 2017, 10:18:01 PM, Ralph Goers wrote:
>
> >
> >> On Oct 20, 2017, at 5:59 AM, Daniel Dekany <ddek...@apache.org> wrote:
> >>
> >> Friday, October 20, 2017, 12:24:30 PM, Jacques Le Roux wrote:
> >>
> >>> Le 01/10/2017 à 23:27, Daniel Dekany a écrit :
> >>>> Sunday, October 1, 2017, 8:26:53 PM, Jacques Le Roux wrote:
> >>>>
> >>>>> Le 23/09/2017 à 08:44, Daniel Dekany a écrit :
> >>>>>> Friday, September 22, 2017, 11:17:59 PM, Jacques Le Roux wrote:
> >>>>>>
> >>>>>>> Le 22/09/2017 à 22:22, Daniel Dekany a écrit :
> >>>>>>>> Google doesn't like plain HTTP sites as we know (SEO), also I hear
> >>>>>>>> that starting from October they want to show warning in Chrome if
> you
> >>>>>>>> have forms on your page. We do have forms... On all page under
> >>>>>>>> http://freemarker.org/docs/ there's a search field, and
> >>>>>>>> http://try.freemarker.org/ is nothing but a form.
> >>>>>>>>
> >>>>>>>> Anyone want to tackle this? Or part of this?
> >>>>>>>>
> >>>>>>> I did that for OFBiz. I can have a look before October.
> >>>>>> That would be great, thanks!
> >>>>>>
> >>>>>>> Jacques
> >>>>>>>
> >>>>>>>
> >>>>> Sorry, OFBiz still being my priority, I was not able to do it yet.
> >>>>> But I should be able to start this week, most likely Monday...
> >>>> No problem, and thanks for keep us informed!
> >>>>
> >>>>> Jacques
> >>> Sorry again, my current contract has changed and I'll not be available
> before November
> >>> I'm though trying the new release in OFBiz right now, so far all seems
> OK :)
> >>
> >> The latest Chrome doesn't (yet?) show any warnings on our site, so no
> >> problem. (Maybe they only do it if there's a password filed, for now.)
> >>
> >> Thanks for the checking the release!
> >
> > I should also point out that in the last board report the issue of
> > freemarker not yet having an apache.org <http://apache.org/> web
> > site came up. I would suggest that the project make that transition
> > sooner than later if graduation is desired.
> >
> > Ralph
> >
>
> --
> Thanks,
>  Daniel Dekany
>
>


-- 
Christoph Rüger, Geschäftsführer
Synesty <https://synesty.com/> - Anbinden und Automatisieren ohne
Programmieren - Automatisierung, Schnittstellen, Datenfeeds

Xing: https://www.xing.com/profile/Christoph_Rueger2
LinkedIn: http://www.linkedin.com/pub/christoph-rueger/a/685/198

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: Slow access to XML node attribute because of XPath in NodeModel.get()?

2017-10-13 Thread Christoph Rüger
2017-10-13 0:33 GMT+02:00 Daniel Dekany <ddek...@apache.org>:

> Actually, in `someNode.something` (which is the same as
> `someNode["something"]`) the "something" meant to be XPath (appart
> from a few FreeMarker-specific things).

But as you have seen in some
> very simple cases we solve the XPath query "natively" instead of
> delegating it to XPath.


Thanks Daniel, good to know. So there probably was a reason for this too in
the past.

Now if profiling reliably(!) shows that it's
> indeed XPath in this case that's so slow, then it seems it would be

better if we take over even more cases from XPath, such as
> "@something"... I will have to look into that though. (This can be
> tricky though, as you replace the implementation of that kind of query
> under thousands of already working applications, so it really has to
> behave exactly like the real thing earlier.


I agree, this is very risky and my poor-mans "benchmark" is not reliable at
all. I can try if I can find some time to come up with a programmatic
test-case maybe which makes it better visible.
Your insights tell me so far that we better go with the custom
TemplateMethodModel for now (shortterm) to solve our specific business
problem. Less risk.

I will try fiddling around with the sources of
freemarker.ext.dom.NodeModel.get(String)
etc. which already do some "key.startsWith("@@")" checks. Maybe I find the
place where to add an improvement and try it out.


> That's unlike with
> product.PRODUCT_DETAILS which was never delegated to the real XPath
> implementation.)
>

> Thursday, October 12, 2017, 7:35:42 PM, Christoph Rüger wrote:
>
> > Hi,
> >
> > we have the following XML snippet:
> >
> > 
> >   4011395534809
> > 
> >
> > We iterate over XML-Nodes like this:
> >
> > <#list product["PRODUCT_DETAILS"]?children as detail>
>
> Note that you can write `product["PRODUCT_DETAILS"]` as
> `product.PRODUCT_DETAILS`.
>

Ok. Usually we do. Not sure why we didn't here. Was a code snippet from a
colleague :)


>
> >   nodeValue: ${detail!}
> > 
> >
> > This code snippet is pretty fast (result appears after e.g. 3 seconds).
> But
> > when we turn it into this and try to add the node attribute "type"...
> >
> > <#list product["PRODUCT_DETAILS"]?children as detail>
> >  <#if detail.*@type*[0]?? && detail.*@type*[0] == "GTIN">
> >   node*Attribute* type: ${detail.@type}
> >   nodeValue: ${detail!}
> >  
> > 
> >
> > ...it gets very very slow (result appears after > 1 minute). We have a
> large XML with >> 1000 products here.
> >
> > I have digged a little bit in the code and found that when the check for
> > *detail.@type[0]??* is in the mix, then
> > *freemarker.ext.dom.NodeModel.get(String) *is jumping into the
> else-branch
> > which uses XPath:
> >
> >  public TemplateModel get(String key) throws TemplateModelException {
> >
> >if (key.startsWith("@@")) {
> > // 
> >
> > }
> >
> > else{
> >
> > XPathSupport xps = getXPathSupport();
> >   if (xps != null) {
> >
> > *return xps.executeQuery(node, key);*}
> >
> > }
> >
> > This *xps.executeQuery(node, key); *seems to be the reason why it gets
> > slow. Internally it
> > calls
> > freemarker.ext.dom.SunInternalXalanXPathSupport.executeQuery(Object,
> > String)
> >
> > To work around this problem I have tried creating an own
> > TemplateMethodModel ${nodeAttrib(node, attributename)}
> >
> > where I do something like this (I know it's ugly but experimental...) :
> >
> > new TemplateMethodModelEx(){
> >
> > public Object exec(List arg0) throws TemplateModelException {
> >
> > Object node = arg0.get(0);
> >
> > Object attribute = arg0.get(1);
> >
> > if(node instanceof NodeModel) {
> >
> > NamedNodeMap attributes = ((NodeModel) node).getNode().getAttributes();
> >
> > if(attributes != null && attributes.getLength() > 0) {
> >
> > Node namedItem = *attributes.getNamedItem(attribute.toString())*;
> >
> > if(namedItem != null) {
> >
> > System.out.println(namedItem.getNodeValue());
> >
> > return namedItem.getNodeValue();
> >
> > }
> >
> > else {
> >
> > return "";
> >
> > }
> >
> > }
> >
> > }
> >
> > return "";
> >
> > }
> >
> >

Slow access to XML node attribute because of XPath in NodeModel.get()?

2017-10-12 Thread Christoph Rüger
Hi,

we have the following XML snippet:


  4011395534809


We iterate over XML-Nodes like this:

<#list product["PRODUCT_DETAILS"]?children as detail>
  nodeValue: ${detail!}


This code snippet is pretty fast (result appears after e.g. 3 seconds). But
when we turn it into this and try to add the node attribute "type"...

<#list product["PRODUCT_DETAILS"]?children as detail>
 <#if detail.*@type*[0]?? && detail.*@type*[0] == "GTIN">
  node*Attribute* type: ${detail.@type}
  nodeValue: ${detail!}
 


...it gets very very slow (result appears after > 1 minute). We have a
large XML with > 1000 products here.

I have digged a little bit in the code and found that when the check for
*detail.@type[0]??* is in the mix, then
*freemarker.ext.dom.NodeModel.get(String) *is jumping into the else-branch
which uses XPath:

 public TemplateModel get(String key) throws TemplateModelException {

   if (key.startsWith("@@")) {
// 

}

else{

XPathSupport xps = getXPathSupport();
  if (xps != null) {

*return xps.executeQuery(node, key);*}

}

This *xps.executeQuery(node, key); *seems to be the reason why it gets
slow. Internally it
calls freemarker.ext.dom.SunInternalXalanXPathSupport.executeQuery(Object,
String)

To work around this problem I have tried creating an own
TemplateMethodModel ${nodeAttrib(node, attributename)}

where I do something like this (I know it's ugly but experimental...) :

new TemplateMethodModelEx(){

public Object exec(List arg0) throws TemplateModelException {

Object node = arg0.get(0);

Object attribute = arg0.get(1);

if(node instanceof NodeModel) {

NamedNodeMap attributes = ((NodeModel) node).getNode().getAttributes();

if(attributes != null && attributes.getLength() > 0) {

Node namedItem = *attributes.getNamedItem(attribute.toString())*;

if(namedItem != null) {

System.out.println(namedItem.getNodeValue());

return namedItem.getNodeValue();

}

else {

return "";

}

}

}

return "";

}


When we then use this it is much faster:
<#list product["PRODUCT_DETAILS"]?children as detail>
  <#if *nodeAttribute(details, "type")!* == "GTIN" >
   node*Attribute* type: ${*nodeAttribute(details, "type")!*}
   nodeValue: ${detail!}
  


It seems that NamedNodeMap.*getNamedItem() *much faster and does not use
XPath. Although it is also iterating internally over the whole array to
find the index of the attribute - the overhead seems to be less then XPath.

My questions are:
1. What is the reason that *detail.@type[0]?? *causes a heavy XPath
evaluation under the hood?
2. Are we doing something wrong?
3. Should we go the custom TemplateMethodModel way? Is this approach ok?

I hope this was understandable.

Thanks
Christoph

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: Test 2.3.27-incubating-SNAPSHOT with your system

2017-10-10 Thread Christoph Rüger
We also ran our testsuite containing a few Freemarker related tests plus a
few manual tests. No errors so far.
versionForOSGi=2.3.27.nightly_20171008T190128Z-incubating

2017-10-10 13:30 GMT+02:00 Daniel Dekany <ddek...@apache.org>:

> Hi,
>
> Thanks for the feedback!
>
> This was with a snapshot downloaded after 2017-10-08 19:00 GMT, right?
>
>
> Tuesday, October 10, 2017, 9:35:12 AM, d...@dejc.com wrote:
>
> >
> > Hi Danial,
> >
> > I ran this through the various test suites in the Moqui Ecosystem
> > projects plus a few manual tests and everything worked fine, I see
> > no issues.
> >
> > -David
> >
> >
> > On Thu, 2017-10-05 at 10:42 +0200, Daniel Dekany wrote:
> >> If it's easy for someone (like you have a good test suite), it would
> >> be good if you can test 2.3.27-incubating-SNAPSHOT. (Hopefully this is
> >> the same as the final release will be.)
> >>
> >> Binaries are here:
> >> https://dist.apache.org/repos/dist/dev/incubator/freemarker/
> engine/2.3.27-incubating-SNAPSHOT/binaries/
> >> and also in the
> >> https://repository.apache.org/content/repositories/snapshots/
> >> repositry with 2.3.27-incubating-SNAPSHOT.
> >>
>
> --
> Thanks,
>  Daniel Dekany
>
>


-- 
Christoph Rüger, Geschäftsführer
Synesty <https://synesty.com/> - Anbinden und Automatisieren ohne
Programmieren - Automatisierung, Schnittstellen, Datenfeeds

Xing: https://www.xing.com/profile/Christoph_Rueger2
LinkedIn: http://www.linkedin.com/pub/christoph-rueger/a/685/198

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: Preparing for 2.3.27 - please check the change log

2017-09-21 Thread Christoph Rüger
+1 for the #continue directive :)

2017-09-21 11:23 GMT+02:00 Jacques Le Roux <jacques.le.r...@les7arts.com>:

> Le 20/09/2017 à 20:13, Daniel Dekany a écrit :
>
>> We have quite a few bug fixes piled up, so I it's time for a new
>> release. There's a few very minor new feature as well (mostly in
>> response to issues raised on StackOverflow). Please review them, also
>> tell if you want some more changes to get into 2.3.27!
>>
>> Here's the change log (so far):
>> http://freemarker.org/builds/fm2.3.27/versions_2_3_27.html
>>
>> I plan to start the usual release process early next week.
>>
>> Hi Daniel,
>
> Thanks for this release notes, really interesting. Nothing else to say.
>
> Jacques
>
>


-- 
Christoph Rüger, Geschäftsführer
Synesty <https://synesty.com/> - Anbinden und Automatisieren ohne
Programmieren - Automatisierung, Schnittstellen, Datenfeeds

Xing: https://www.xing.com/profile/Christoph_Rueger2
LinkedIn: http://www.linkedin.com/pub/christoph-rueger/a/685/198

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: [FM3] Should localized template lookup be off by default?

2017-06-14 Thread Christoph Rüger
+1 for turning it off by default. Just make sure it is clearly described in
the localization section of the manual. I know it always depends but
outofthebox-performance is more important here in my opinion.

Am 14.06.2017 4:20 nachm. schrieb "Woonsan Ko" <woon...@apache.org>:

> I don't think the template lookup feature based on locale is used
> often in practices, either.
> In FM3, I think people need to follow a guideline on how to migrate
> FM2 anyway, so it seems just fine to me if we turn it off by default
> as the feature requires additional IOs.
>
> Regards,
>
> Woonsan
>
>
> On Wed, Jun 14, 2017 at 5:55 AM, Siegfried Goeschl
> <siegfried.goes...@gmail.com> wrote:
> > Hi folks,
> >
> > sorry to skip in as FM rookie :-)
> >
> > IMHO both approaches (opt-in & opt-out) are valid but I personally lean
> towards opt-out
> >
> > * The newbie (and casual user) is delighted if a useful feature works
> out of the box
> > * Changing the existing behaviour is an annoying (and potentially
> breaking) change for existing users
> > * Assuming that the caching works the IO is minimal even for cache misses
> > * Assuming that the little IO becomes relevant those user will be heavy
> users anyway
> >
> > Thanks in advance,
> >
> > Siegfried Goeschl
> >
> >
> >> On 14 Jun 2017, at 11:12, Daniel Dekany <ddek...@apache.org> wrote:
> >>
> >> Tuesday, June 13, 2017, 2:49:17 PM, brede...@me.com wrote:
> >>
> >>> ‎-1
> >>>
> >>> I think that is one place where feature by default is better than
> performance by default.
> >>
> >> OK, but why?
> >>
> >> The reason I prefer opt-in approach (as opposed to opt-out) here is
> >> that you won't use this feature unless you are aware of its existence.
> >> But if you are aware of its existence, and you want to use it too,
> >> then certainly you will see that you have to turn it on. For the
> >> others, who are the vast majority of users, why waste resources
> >> (especially I/O) on something they will not use? For low level
> >> libraries things like that mater, because you can't anticipate the use
> >> cases. In some applications they may need to keep the
> >> templateUpdateDelay low, and have many templates, so cache misses are
> >> frequent.
> >>
> >>> Are the missing files cached?
> >>
> >> Yes, the fact that a file is missing is cached, for
> >> cfg.templateUpdateDelay duration.
> >>
> >>> Cheers,
> >>>
> >>> -- Denis.
> >>>   Original Message
> >>> From: Daniel Dekany
> >>> Sent: Tuesday, 13 June 2017 13:19
> >>> To: dev@freemarker.incubator.apache.org
> >>> Reply To: dev@freemarker.incubator.apache.org
> >>> Subject: [FM3] Should localized template lookup be off by deault?
> >>>
> >>> In FM2 the localizedLookup configuration setting defaults to true, so
> >>> by default if you issue cfg.getTemplate("foo.ftl") and cfg.locale is
> >>> en_US, then FM will look for foo_en_US.ftl, then foo_en.ftl, then
> >>> foo.ftl. I think most users don't use localized lookup, and they don't
> >>> realize that this is happening, while this means extra I/O.
> >>>
> >>> I propose that in FM3 we change the default of this setting to false.
> >>>
> >>
> >> --
> >> Thanks,
> >> Daniel Dekany
> >>
> >
>

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: New ASF Member from FreeMarker Community

2017-04-05 Thread Christoph Rüger
Congratulations Daniel :)

2017-04-05 9:09 GMT+02:00 Jacopo Cappellato <jacopo.cappell...@gmail.com>:

> Good news: Daniel Dekany from the FreeMarker community has been invited to
> become member of the Apache Software Foundation.
>
> Many congratulations Daniel!!!
>
> Jacopo
>



-- 
Christoph Rüger, Geschäftsführer
Synesty <https://synesty.com/> - Anbinden und Automatisieren ohne
Programmieren - Automatisierung, Schnittstellen, Datenfeeds

Xing: https://www.xing.com/profile/Christoph_Rueger2
LinkedIn: http://www.linkedin.com/pub/christoph-rueger/a/685/198

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: About a Freemarker template evaluator service

2017-02-25 Thread Christoph Rüger
gt;>>>> providing the template code and its context.
>> >>>>>>>>>>
>> >>>>>>>>>> Wouldn't be nice is we could offer that or a similar service
to
>> the users
>> >>>>>>>>>> and potential adopters of Freemarker? I think it would be a
>> very useful
>> >>>>>>>>>> tool and also a good mechanism to attract new consumers.
>> >>>>>>>>>>
>> >>>>>>>>>> If there is an interest in this community then we could move
in
>> two
>> >>>>>>>>>> directions:
>> >>>>>>>>>>
>> >>>>>>>>>> 1) get in touch with the maintainers of freemarker-online and
>> see if they
>> >>>>>>>>>> are interested to contribute their work [*] or join our
>> community and help
>> >>>>>>>>>> to build a similar one here; if they are not interested then
we
>> could
>> >>>>>>>>>> discuss if it would make sense to build our own here
>> >>>>>>>>>>
>> >>>>>>>>>> 2) get in touch with the Infra team and explore the
possibility
>> to set up a
>> >>>>>>>>>> virtual machine to dedicated to our project that we could use
>> to deploy a
>> >>>>>>>>>> similar service, from our official website
>> >>>>>>>>>>
>> >>>>>>>>>> I can volunteer to try to get in touch with them (#1); any
>> volunteers for
>> >>>>>>>>>> #2 (or even #1)?
>> >>>>>>>>>>
>> >>>>>>>>>> Kind regards,
>> >>>>>>>>>>
>> >>>>>>>>>> Jacopo
>> >>>>>>>>>>
>> >>>>>>>>>> [*] which is licensed with the AL2.0 and available here:
>> >>>>>>>>>> https://github.com/kenshoo/freemarker-online
>> >>>>>>>>>>
>> >>>>>>>>> Hi Jacopo,
>> >>>>>>>>>
>> >>>>>>>>> I can take care of 2, I'm used to these kind of things for
OFBiz
>> >>>>>>>>> I guess 1 is a prerequisite and I'm not well placed for this
>> task.
>> >>>>>>>>>
>> >>>>>>>>> Jacques
>> >>>>>>>>>
>> >>>>>>>>>
>> >>>
>> >
>> >
>>
>> --
>> Thanks,
>>  Daniel Dekany
>>
>>

--
Thanks,
 Daniel Dekany

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: Feature question FM2 / FM3: Hook into loops

2017-02-23 Thread Christoph Rüger
Thanks, good stuff.

2017-02-24 6:29 GMT+01:00 Jacques Le Roux <jacques.le.r...@les7arts.com>:

> +1 for timeout
>
> Jacques
>
>
>
> Le 24/02/2017 à 01:12, Daniel Dekany a écrit :
>
>> There's a hidden feature in FreeMarker 2 that allows templates be
>> interrupted with Thread.interrupt(). This can be used to limit the
>> template execution time (one thread processes the template, the other
>> waits for it to finish with a timeout, and then interrupts the
>> template processing thread). To see this in action, go to
>> http://freemarker-online.kenshoo.com/ and enter some very long loop.
>> The processing will be aborted with timeout. The related part of the
>> source code is around here:
>> https://github.com/kenshoo/freemarker-online/blob/master/src
>> /main/java/com/kenshoo/freemarker/services/FreeMarkerService.java#L123
>>
>> That's the closes I can think of right now. But I'm open to ideas,
>> because this used to be concern if you allow users to write templates.
>>
>> The problem with limiting #list iterations is that you can nest
>> #list-s into each other, so it's easy to square, cube, etc. your
>> iteration limit. (There are other fun ways of doing infinitely running
>> templates too, like with recursion. That's why simply measuring how
>> long the template is running is certainly the most robust solution.)
>>
>> If you have some collections that you know shouldn't be fully listed,
>> then perhaps you should wrap those into your own TemplateSequenceModel
>> implementation.
>>
>>
>> Thursday, February 23, 2017, 3:14:06 PM, Christoph Rüger wrote:
>>
>> We would like to hook into loops (<#list>) to e.g. count the number of
>>> iterations and react based on some business conditions. For example stop
>>> with an Exception after 10k iterations.
>>>
>>> I would think about some kind of callback which we can register which is
>>> called by freemarker inside <#list> iterations, so that our callback code
>>> can do whatever is needed.
>>>
>>> Is something like that possible already (haven't checked code yet) or
>>> planned for FM3?
>>>
>>> Thanks
>>> Christoph
>>>
>>>
>


-- 
Christoph Rüger, Geschäftsführer
Synesty <https://synesty.com/> - Anbinden und Automatisieren ohne
Programmieren - Automatisierung, Schnittstellen, Datenfeeds

Xing: https://www.xing.com/profile/Christoph_Rueger2
LinkedIn: http://www.linkedin.com/pub/christoph-rueger/a/685/198

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Feature question FM2 / FM3: Hook into loops

2017-02-23 Thread Christoph Rüger
We would like to hook into loops (<#list>) to e.g. count the number of
iterations and react based on some business conditions. For example stop
with an Exception after 10k iterations.

I would think about some kind of callback which we can register which is
called by freemarker inside <#list> iterations, so that our callback code
can do whatever is needed.

Is something like that possible already (haven't checked code yet) or
planned for FM3?

Thanks
Christoph

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: [RESULT][VOTE] Which logo?

2017-01-30 Thread Christoph Rüger
+1 Looks good :)

2017-01-30 16:27 GMT+01:00 Daniel Dekany <ddek...@freemail.hu>:

> I have just went ahead and replaced the logo on
> https://twitter.com/freemarker with #1.5.
>
> --
> Thanks,
>  Daniel Dekany
>
>
> Saturday, January 28, 2017, 6:08:16 PM, Daniel Dekany wrote:
>
> > So this meant to be kind of a survey, rather than a proper vote, and
> > for now we use the logo only on Twitter, and it can be changed
> > anytime. Here's what we have:
> >
> > Logos: https://drive.google.com/open?id=0B5BwTaGcWGtNS2VaTDhCcDVLQTQ
> > - #1: "" with the infinitely long dropshadow, no gradients or such
> > - #1.5 #1 with fading out (somewhat) the shadow on bottom-right
> > - #2: #.5 with brighter top-left
> > - #3: Totally flat "". The cornets of the square aren't rounded in
> >   this one, though that's not up to us, as Twitter will round it.
> >
> > The votes:
> > Sergio Fernández (PPMC): #3
> > Christoph Rüger: #1.5
> > Denis Bredelet: #2
> > Mauricio Nuñez: #3
> > Jacques Le Roux: #1 #2 (counted as two 0.5 votes)
> > Jacopo Cappellato (PPMC): #1.5
> > Piyush Mor: #3
> > Julien NICOLAS: #1.5
> > Barrie Selack: #3
> > David E Jones (PPMC): #3
> > Kirys: #1.5
> > Daniel Dekany (PPMC): #1.5
> >
> > Thus the result:
> > #3: 5 total (2 PPMC)
> > #1.5: 5 total (2 PPMC)
> > #2: 1.5 total
> > #1: 0.5 total
> >
> > (I have checked, and no opinion was expressed on the related tweet.)
> >
> > I guess both the #1 and #2 votes would gravitate towards the more
> > similar #1.5, rather than #3. (Also note that while minimalism is
> > trending, it still stands that simply typing something, choosing a
> > standard font and a color, and a flat background color, then calling
> > it a logo is... Let's just say, users won't necessarily realize that
> > the product has a logo at all.)
> >
> > So, Nicolas, can you provide:
> >
> > - What font is that, with what license? Do we have right to use it?
> > - An SVG version of #1.5 without and without the round corner
> > - A 200x200 px rendering of #1.5 *without* the round corner (because
> >   Twitter will do the rounding)
> >
> > Thank you!
> >
> > BTW, I guess it could fade out the shadow faster a bit... but, let's
> > not complicate the matter. We want replace that blurry JPEG artifact
> > demonstration that we have on Twitter currently ASAP.
> >
>
> --
> Thanks,
>  Daniel Dekany
>
>


-- 
Christoph Rüger, Geschäftsführer
Synesty <https://synesty.com/> - Anbinden und Automatisieren ohne
Programmieren - Automatisierung, Schnittstellen, Datenfeeds

Xing: https://www.xing.com/profile/Christoph_Rueger2
LinkedIn: http://www.linkedin.com/pub/christoph-rueger/a/685/198

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: [FM3] Dropping support before Servlet 2.5 / JSP 2.1. Or even before 3.0/2.2?

2017-01-21 Thread Christoph Rüger
+1

Am 20.01.2017 4:26 nachm. schrieb "Daniel Dekany" <ddek...@freemail.hu>:

> In FM3, I want to get rid of JSP 2.0 support. It needlessly
> complicates the build (because we also have to support the new methods
> in JSP 2.1). Then our minimum requirement will be still Servet 2.5,
> JSP 2.1, which was part of Java EE 5 (May 11, 2006). So I trust that
> nobody will want to stop me doing this.
>
> We might even want to require Servlet 3.0 and JSP 2.2, from Java EE 6
> (December 10, 2009), just to make things easier in the future, though
> at the moment we don't utilize that.
>
> --
> Thanks,
>  Daniel Dekany
>
>

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: [VOTE] Which logo, now with a new contender (#1.5)

2017-01-19 Thread Christoph Rüger
+1 for 1.5

Am 19.01.2017 6:19 nachm. schrieb "Jacopo Cappellato" <
jacopo.cappell...@gmail.com>:

> On Thu, Jan 19, 2017 at 1:30 PM, Daniel Dekany <ddek...@freemail.hu>
> wrote:
>
> > A new choice! So now in theory I should cancel this vote and start a
> > new one. But I guess we can be less formal in this case. After all,
> > changing a logo is backward compatible (an almost disturbing feeling
> > if you have maintained FM... <-; ).
> >
>
> :-)
>
>
> >
> > I change my vote to +1 for #1.5.
> >
>
> I am also going to change my vote with a +1 for #1.5
>
> Jacopo
>
>
> >
> >
> > Monday, January 16, 2017, 11:07:29 PM, Julien NICOLAS wrote:
> >
> > > Hello,
> > >
> > > I prefer #1.
> > >
> > > But... If I can provide a new one regarding comments
> > > (https://drive.google.com/open?id=0B5BwTaGcWGtNS2VaTDhCcDVLQTQ) I
> prefer
> > > #1.5 ;)
> > >
> > > Regards,
> > >
> > > Julien.
> > >
> > >
> > > On 16/01/2017 12:11, Daniel Dekany wrote:
> > >> We will replace our square logo at Twitter
> > >> (https://twitter.com/freemarker), and probably will use the same logo
> > >> in the future elsewhere too.
> > >>
> > >> Which one do you prefer from the *top* row (1, 2, 3)?
> > >> https://drive.google.com/open?id=0B5BwTaGcWGtNLU0wQmFiUElFc2c
> > >>
> > >> (The bottom row is for file icons, but currently we won't use them
> > >> anywhere.)
> > >>
> > >> Thanks for Julien Nicolas for providing these!
> > >>
> > >
> > >
> >
> > --
> > Thanks,
> >  Daniel Dekany
> >
> >
>

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: [VOTE] Which logo?

2017-01-16 Thread Christoph Rüger
+1 for top row #3

I would also like a version of #3 with rounded corners for an app-icon
look-and-feel.

2017-01-16 12:11 GMT+01:00 Daniel Dekany <ddek...@freemail.hu>:

> We will replace our square logo at Twitter
> (https://twitter.com/freemarker), and probably will use the same logo
> in the future elsewhere too.
>
> Which one do you prefer from the *top* row (1, 2, 3)?
> https://drive.google.com/open?id=0B5BwTaGcWGtNLU0wQmFiUElFc2c
>
> (The bottom row is for file icons, but currently we won't use them
> anywhere.)
>
> Thanks for Julien Nicolas for providing these!
>
> --
> Thanks,
>  Daniel Dekany
>
>


-- 
Christoph Rüger, Geschäftsführer
Synesty <https://synesty.com/> - Automatisierung, Schnittstellen, Datenfeeds
Tel.: +49 3641/559649

Xing: https://www.xing.com/profile/Christoph_Rueger2
LinkedIn: http://www.linkedin.com/pub/christoph-rueger/a/685/198

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: [FM3] Further legacy things to drop...

2017-01-16 Thread Christoph Rüger
2017-01-16 11:58 GMT+01:00 Daniel Dekany <ddek...@freemail.hu>:

> Monday, January 16, 2017, 10:05:13 AM, Christoph Rüger wrote:
>
> [snip]
> > The DocumentBuildFactory created
> > in freemarker.ext.dom.NodeModel.getDocumentBuilderFactory() is currently
> > setup to resolve external entities (which is default behavior).
>
> I believe it's pretty much necessary too. Many XML-s do need them in
> reality.
>
> > This opens
> > the door for XXE attacks (External Entity Injection): see
> > http://colesec.inventedtheinternet.com/attacking-xml-with-xml-
> external-entity-injection-xxe/
>
> That's good to keep in mind in general, but a template author isn't
> supposed to be able to provide the XML. The DOM is normally already in
> the data-model before the template processing is started. So if
> someone can only edit the template, can he still exploit this?
>
I would say no. It is not something the template author can exploit, but
more the party providing the XML.



>
> > Lot's of web-apps have this problem e.g. also PHP where this is enabled
> by
> > default too (not a php guy, but read about it).
> >
> > We basically chose to forbid ExternalEntities completely by extending
> > NodeModel and so set some properties to the DocumentBuilderFactory as
> > described here:
> > https://www.owasp.org/index.php/XML_External_Entity_(XXE)_
> Prevention_Cheat_Sheet#JAXP_DocumentBuilderFactory.2C_
> SAXParserFactory_and_DOM4J
>
> Note sure what you can do with extending NodeModel, because
> getDocumentBuilderFactory is static. As far as I see, all we (at
> FreeMarker) can do is adding a boolean disableExternalEntityResolution
> parameter to that static method and to the also static NodeModel.parse
> methods, and JavaDoc the dangers clearly there.


A parameter *disableExternalEntityResolution* would be helpful.


> I'm not aware of
> FreeMarker itself loading XML automatically (it doesn't call these
> static methods from inside), it only works with the DOM provided
> (which then already contains the external entities resolved).
>

You can pass a File to *NodeModel.parse(File f)* which is at this point not
parsed yet. The parsing happens later using the DocumentBuilderFactory
created by *NodeModel.getDocumentBuilderFactory(). *This is when also the
external entities are resolved and DOM is created. So it would be good, if
this could be customized (either by passing parameters or some other
mechanism).

I guess we had to do some "hacky" customizing of NodeModel in order to be
able to use our own instance of DocumentBuilderFactory used by NodeModel.


>
> >> >> > 2017-01-12 23:58 GMT+01:00 Daniel Dekany <ddek...@freemail.hu>:
> >> >> > I have collected some further easy changes for FM3... Any comments?
> >> >> >
> >> >> > - Drop FTL classic compatible mode option (Roughly emulates FM1
> >> >> >   behavior at null-s and at some type handling issues)
> >> >> >
> >> >> > - Drop FTL non-strict syntax option (FM1 syntax - that's where you
> >> >> >   could write  instead of <#if x>).
> >> >> >
> >> >> > - Drop all the "public static void main(String[] args)" methods
> >> >> (security concern)
> >> >> >
> >> >> > - Drop freemarker.log. That's a simple log adapter facility from
> the
> >> >> >   ancient times of Java, kind of like commons-logging or slf4j. I
> >> >> >   would instead introduce slf4j-api as a required dependency.
> >> >> >
> >> >> > - Drop legacy XML wrapper (freemarker.ext.xml, not to be confused
> with
> >> >> >   freemarker.ext.dom)
> >> >> >
> >> >> > - Drop ant task (freemarker.ext.ant)
> >> >> >
> >> >> > --
> >> >> > Thanks,
> >> >> >  Daniel Dekany
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >>
> >> >> --
> >> >> Thanks,
> >> >>  Daniel Dekany
> >> >>
> >> >>
> >> >
> >> >
> >> > --
> >> > Christoph Rüger, Geschäftsführer
> >> > Synesty <https://synesty.com/> - Automatisierung, Schnittstellen,
> >> Datenfeeds
> >> > Tel.: +49 3641/559649
> >> >
> >> > Xing: https://www.xing.com/profile/Christoph_Rueger2
> >> > LinkedIn: http://www.linkedin.com/pub/christoph-rueger/a/685/198
> >> >

Re: [FM3] Further legacy things to drop...

2017-01-13 Thread Christoph Rüger
2017-01-13 1:17 GMT+01:00 Daniel Dekany <ddek...@freemail.hu>:

> Friday, January 13, 2017, 12:08:12 AM, Christoph Rüger wrote:
>
> > +1 for everything.
> >
> > additional security topics:
> > use TemplateClassResolver.ALLOWS_NOTHING_RESOLVER by default to
> > avoid template injection attacks.
>
> At least in FM2 you pull in your TemplateDirectiveModel-s and
> TemplateMethodModel-s into #import/#include-able FTL-s with `?new`. I
> can imagine much better mechanisms for that use-case though... But for
> now, the point is that we can't just default to
> ALLOWS_NOTHING_RESOLVER without giving an alternative first. But, now
> that you say, I will delete those legacy "utility" TemplateModel-s
> which make `?new` rather dangerous.
>

Yes, that's what I meant. e.g. "Execute
<http://freemarker.org/docs/api/freemarker/template/utility/Execute.html>"
where can run code on the server:

<#assign ex="freemarker.template.utility.Execute"?new()> ${ ex("id")}
Source
<http://blog.portswigger.net/2015/08/server-side-template-injection.html#FreeMarker>

I have another thing regarding XXE-Attacks in FM-XML-processing
(regarding DocumentBuilderFactory
in freemarker.ext.dom.NodeModel) where a different default behavior would
be good IMO.
I can give more details in a separate email if you want.



> > 2017-01-12 23:58 GMT+01:00 Daniel Dekany <ddek...@freemail.hu>:
> > I have collected some further easy changes for FM3... Any comments?
> >
> > - Drop FTL classic compatible mode option (Roughly emulates FM1
> >   behavior at null-s and at some type handling issues)
> >
> > - Drop FTL non-strict syntax option (FM1 syntax - that's where you
> >   could write  instead of <#if x>).
> >
> > - Drop all the "public static void main(String[] args)" methods
> (security concern)
> >
> > - Drop freemarker.log. That's a simple log adapter facility from the
> >   ancient times of Java, kind of like commons-logging or slf4j. I
> >   would instead introduce slf4j-api as a required dependency.
> >
> > - Drop legacy XML wrapper (freemarker.ext.xml, not to be confused with
> >   freemarker.ext.dom)
> >
> > - Drop ant task (freemarker.ext.ant)
> >
> > --
> > Thanks,
> >  Daniel Dekany
> >
> >
> >
> >
>
> --
> Thanks,
>  Daniel Dekany
>
>


-- 
Christoph Rüger, Geschäftsführer
Synesty <https://synesty.com/> - Automatisierung, Schnittstellen, Datenfeeds
Tel.: +49 3641/559649

Xing: https://www.xing.com/profile/Christoph_Rueger2
LinkedIn: http://www.linkedin.com/pub/christoph-rueger/a/685/198

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: [FM3] Further legacy things to drop...

2017-01-12 Thread Christoph Rüger
+1 for everything.

additional security topics:
use TemplateClassResolver.ALLOWS_NOTHING_RESOLVER by default to avoid
template injection attacks.



2017-01-12 23:58 GMT+01:00 Daniel Dekany <ddek...@freemail.hu>:

> I have collected some further easy changes for FM3... Any comments?
>
> - Drop FTL classic compatible mode option (Roughly emulates FM1
>   behavior at null-s and at some type handling issues)
>
> - Drop FTL non-strict syntax option (FM1 syntax - that's where you
>   could write  instead of <#if x>).
>
> - Drop all the "public static void main(String[] args)" methods (security
> concern)
>
> - Drop freemarker.log. That's a simple log adapter facility from the
>   ancient times of Java, kind of like commons-logging or slf4j. I
>   would instead introduce slf4j-api as a required dependency.
>
> - Drop legacy XML wrapper (freemarker.ext.xml, not to be confused with
>   freemarker.ext.dom)
>
> - Drop ant task (freemarker.ext.ant)
>
> --
> Thanks,
>  Daniel Dekany
>
>


-- 
Christoph Rüger, Geschäftsführer
Synesty <https://synesty.com/> - Automatisierung, Schnittstellen, Datenfeeds
Tel.: +49 3641/559649

Xing: https://www.xing.com/profile/Christoph_Rueger2
LinkedIn: http://www.linkedin.com/pub/christoph-rueger/a/685/198

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: Thoughts on using FM with Transformy (Was: Using Social Media to Help Promote Freemarker)

2017-01-09 Thread Christoph Rüger
2017-01-08 15:00 GMT+01:00 Daniel Dekany <ddek...@freemail.hu>:

> Sunday, January 8, 2017, 1:10:11 AM, Christoph Rüger wrote:
>
> [snip]
> > ok.
> > I like the chainability of Joda-Time API e.g.
> > ${mydate?plusDay(1)?string("-MM-dd")}
> > ${mydate?date_trunc("month")}
>
> Or, since there's ?plus_day(n) (instead of ?date_plus("day", n)), it
> should be ?date_trunc_month(1). Or the other way around (both should
> have a parameter like "day" and "month"), but typos in that string
> aren't spotted until runtime, so maybe the first approach is better.
>
> Also instead of ?plus_day, ?add_day is perhaps marginally better,
> because ?plus_day(-1) look a bit stranger than ?add_day(-1).
>

All good ideas. I got the plusXXX from the Joda-Time API guys e.g.
http://www.joda.org/joda-time/apidocs/org/joda/time/
DateTime.html#plusDays-int-
I am fine with ?add_day(1) too...and week,month, year :)



> [snip]
> >>> *my wishes would be (for the moment):*
> >>> - be able to create custom built-ins (like TemplateMethodModels but
> with
> >>> the ?mybuiltin syntax). This would allow us to build some custom
> functions
> >>> with the same syntax and it could be used like a fluent-interface
> >>> ?funcA?funcB?funcC
> >>
> >> That's a frequently required thing, but it raises some tricky
> >> problems. The whole point of built-ins was that since the `?` syntax
> >> is reserved for the template language, we can add new built-ins
> >> without breaking backward compatibility. And another advantage of them
> >> is that you can look them up in the FreeMarker Manual, because nobody
> >> can add/remove them.
> >>
> >> For FM 3, I'm thinking about introducing #import namespace prefixes
> >> that use `:` instead of `.`. So then, you would write `<#my:foo />`
> >> instead of `<@my.foo />`. Yes, that doesn't help so far, but it opens
> >> the possibility of writing x?my:bar, while with `.` it couldn't work
> >> (`x?my.bar`, which just means `(x?my).bar`). So this allows you to use
> >> the `arg?f` syntax instead of `f(arg)`), but only if you are using a
> >> namespace prefix (`my`), so that it's clearly separated from the core
> >> callables.
> >>
> >> However, some, especially in projects like yours, doesn't want to
> >> burden the user with such a prefix (`my:`) either. You just want to
> >> write `x?bar`. So that's also a valid use case, if you provide a
> >> complete documentation for your users instead them trying to look up
> >> things in the FreeMarker Manual. Because the problem with is not
> >> technical; it's the seer chaos this can start. Imagine if every second
> >> project starts to define his own FTL dialect, because now they can do
> >> it easily, without forking... My thought on this is that you should be
> >> allowed to define a custom FTL dialect, but then you aren't allowed to
> >> call it FTL or a FreeMarker Template. It would be Synesty Template
> >> Language (*.stl) or whatever. So then, you have your own specialized
> >> language, no silly prefixes, just what your users need (also no core
> >> FreeMarker functionality that you don't want to expose to your users),
> >> yet you didn't have to fork, and you benefit from the new FreeMarker
> >> releases. So I want the FM 3 architecture to be able to handle this
> >> task, but there are some non-technical issues with it; we might open
> >> some a Pandora's box be allowing this.
> >
> > This sounds pretty interesting and opens up new possibilities. I
> > can see this might be useful for us.
> > If we could define our own namespace globally also one idea could
> > be to define some kind of default namespace like you can do with FM's
> XML-namespace handling:
> > <#ftl ns_prefixes={"D":"http://example.com/ebook"}>
> >
> > What you say about the chaos makes total sense, but I still like
> > the idea of adding stuff on top of the FM-core-functionality.
>
> I also want to go for it, but it remains to be seen what others will
> think about it. I guess as far as we communicate clearly when using a
> a custom dialect is appropriate, and as far as we try to enforce
> technically that people don't use ftl file extension, and show clearly
> in error messages that you aren't using FTL but STL or whatever (in
> case where it can have importance), it will be a much better
> compromise than what we have in FM 2.
>
> > Maybe it could be configurable somehow e.g. in pseu

Re: Thoughts on using FM with Transformy (Was: Using Social Media to Help Promote Freemarker)

2017-01-07 Thread Christoph Rüger
2017-01-07 22:56 GMT+01:00 Daniel Dekany <ddek...@freemail.hu>:

> I have changed the subject so that we don't pollute the social media
> thread... See my comments below.
>
>
> Saturday, January 7, 2017, 9:01:06 PM, Christoph Rüger wrote:
> [snip]
> >> For example, apparently, you have hard time
> >> dealing with null-s in your application (lot of `exp!`-s everywhere),
> >> so you may want to chime in when the null/missing handling
> >> improvements in FM3 are discussed.
> >>
> > Yeah we just decided to put ! by default everywhere. In our uses cases in
> > 99% this is ok, as it should just render an empty String when something
> is
> > null.
>
> The reason we are picky about null-s is to catch typos. It's a partial
> solution as if you have values which can be legally null, you have to
> add some `!`, and then any typo you make will be hidden... but we
> couldn't do better if we assume that the data-model is some kind of
> Map.
>

Yes, I know. I think the strict null handling is ok. I also like it to spot
typos.
To make it short: I guess it is a bit of legacy on our end that we've
suggested the customer to put it.


>
> If you put `!` almost everywhere, then the way null is treated by FM
> is just a burden without the benefits. Can't you tell on that platform
> what the accepted variable *names* are? Because then you could default
> the valid ones to general-purpose-nothing (the result of null!) on the
> data-model level, and let the others be null and explode, because they
> are typos.
>
> BTW if I write ${nosuchthing}, it just prints nothing... So I do not
> need the `!` apparently.
>

I guess we are already experimenting with a wrapper underneath. I don't
know all the code anymore ;) But remember there are cases (maybe in other
parts... Transformy is just one part. we also use FM to write
filter-conditions for something we call SpreadsheetFilter...which you
cannot see in Transformy. maybe it was needed there because things can
become null... don't know).

I guess that is our part of the homework to figure out better
pre-processing here.



>
> >> BTW I see some examples like ${datecalc("HOUR", 1)!?datetime}. I guess
> >> you can't possibly get a null there. Even if you do, ?datetime will be
> >> unhappy with the '' it had to convert to date-time, unless you have a
> >> custom data-time format there.
> >>
> > Your are probably right. in this case the ! is not needed and we could
> > avoid it. Can't remember why we've put it... maybe just to make it look
> > consistent to our customers and to avoid questions ;)
> >
> >
> >>
> >> > (it"s german...just use google translator) where we show how to do
> >> > various stuff with Freemarker expressions. We have also written some
> >> > own functions (here) which could also be useful maybe as core
> >> > built-ins (see here)
> >>
> >> Some questions/notes...
> >>
> >> How does `escapeHTML(exp)` differ from `exp?html`?
> >>
> > our escapeHTML uses
> > https://commons.apache.org/proper/commons-lang/javadocs/
> api-2.6/org/apache/commons/lang/StringEscapeUtils.html#
> escapeHtml(java.lang.String)
> > under
> > the hood.
>
> Maybe because StringEscapeUtils.escapeHtml(String) escapes accented
> letters. Though nowadays that's not needed... you just set the
> response charset to UTF-8, and all funny characters come through.
>

Ok good to know.

>
> >> What's the practical use of `unescapeHTML(exp)`?
> >>
> > the opposite of escapeHTML  using
> > https://commons.apache.org/proper/commons-lang/javadocs/
> api-2.6/org/apache/commons/lang/StringEscapeUtils.html#
> unescapeHtml(java.lang.String)
> >
> > I can't remember but I think we had a case where we needed exactly the
> > escaping of Apache StringUtils and maybe it was different than what
> > Freemarker does? not sure...
>
> FreeMarker doesn't have unescape functionality at all. The question
> is, why do you need to unescape in a template?
>

Not sure anymore, but I guess assume the following:
A 3rd party supplier of our customer sends a CSV containing escaped
HTML-code (with all the  etc.). But the customer wants to  convert it
back to > because that is how he needs it in his output data (e.g. for
importing somewhere else). Most of the time our customers need to deal with
data which is a mess (like you said with Excel), but we cannot change it.
And we provide FM as the tool to move this data around until it fits your
needs. It does the job so far.


>
> >> Also note that there's the auto-escaping machinery (output formats,
> >> ?esc, etc.) 

Re: FreeMarker Project Maturity Model Assessment

2017-01-07 Thread Christoph Rüger
What I am talking about at github is the wiki. But it needs to be enabled
first in the settings..
[image: Inline-Bild 2]

Regarding confluence:
We use it too, and the one thing I really like about it , is the ability to
paste images from the clip board and they are automatically uploaded. but
we use screenshots a lot. Not sure this is a requirement for FM.
But on the other hand confluence is a huge tool which may be more that what
is needed here.
Just my 2 cents.


2017-01-07 21:02 GMT+01:00 Jacopo Cappellato <jacopo.cappell...@gmail.com>:

> On Sat, Jan 7, 2017 at 8:36 PM, Daniel Dekany <ddek...@freemail.hu> wrote:
>
> > Does Confluence work well for developer topics though? Because I guess
> > we will want to use it for FM3. I had to use it on workplace, a
> > relatively old version, and it was a nightmare because it gets
> > confused by the odd stuff we programmers write... and yes, there are
> > some escaping rules and all, but over all it wasn't practical to use,
> > plus it was buggy... though yet again maybe nowadays it's better.
> >
> >
> I am not an expert, nor a huge fan of Confluence, but maybe for our simple
> requirement we could live with any Wiki tool that the ASF Infra can provide
> or , as suggested by Christoph, with a page in git. My only concern with
> Git is that it may make the workflow a bit complicated.
>
> Jacopo
>



-- 
Christoph Rüger, Geschäftsführer
Synesty <https://synesty.com/> - Automatisierung, Schnittstellen, Datenfeeds
Tel.: +49 3641/559649

Xing: https://www.xing.com/profile/Christoph_Rueger2
LinkedIn: http://www.linkedin.com/pub/christoph-rueger/a/685/198

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: Using Social Media to Help Promote Freemarker

2017-01-07 Thread Christoph Rüger
Hi Daniel,


2017-01-07 17:19 GMT+01:00 Daniel Dekany <ddek...@freemail.hu>:

> Saturday, January 7, 2017, 2:38:16 PM, Christoph Rüger wrote:
>
> > regarding promoting freemarker:
> > We are already doing that  in our Cloud-Data-platform where you can
> > use freemarker to do almost anything to transform, map and manipulate
> data.
> > We use it for our own application too (all templates) but we also
> > have chosen Freemarker as the main internal scripting language for data
> transformation.
> >
> > Here is a small example which just concatenates two variables in
> > the column "newtitle". Check it out if you want. It goes in a
> > similar direction as  http://freemarker-online.kenshoo.com/
> >
> > That being said I think we are also happy to contribute interesting
> > usecases, examples and whatever which could be spread using
> > SocialMedia. We have lots of examples in our own documentation
> > (here)
>
> I would only answer to this as technical guy.
>
> Your use cases are interesting in that you want not-so-technical
> people to write templates.

Exactly. Our customers are usually Excel-savvy but no programmers.


> For example, apparently, you have hard time
> dealing with null-s in your application (lot of `exp!`-s everywhere),
> so you may want to chime in when the null/missing handling
> improvements in FM3 are discussed.
>
Yeah we just decided to put ! by default everywhere. In our uses cases in
99% this is ok, as it should just render an empty String when something is
null.


>
> BTW I see some examples like ${datecalc("HOUR", 1)!?datetime}. I guess
> you can't possibly get a null there. Even if you do, ?datetime will be
> unhappy with the '' it had to convert to date-time, unless you have a
> custom data-time format there.
>
Your are probably right. in this case the ! is not needed and we could
avoid it. Can't remember why we've put it... maybe just to make it look
consistent to our customers and to avoid questions ;)


>
> > (it"s german...just use google translator) where we show how to do
> > various stuff with Freemarker expressions. We have also written some
> > own functions (here) which could also be useful maybe as core
> > built-ins (see here)
>
> Some questions/notes...
>
> How does `escapeHTML(exp)` differ from `exp?html`?
>
our escapeHTML uses
https://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/StringEscapeUtils.html#escapeHtml(java.lang.String)
under
the hood.

>
> What's the practical use of `unescapeHTML(exp)`?
>
the opposite of escapeHTML  using
https://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/StringEscapeUtils.html#unescapeHtml(java.lang.String)

I can't remember but I think we had a case where we needed exactly the
escaping of Apache StringUtils and maybe it was different than what
Freemarker does? not sure...

>
> Also note that there's the auto-escaping machinery (output formats,
> ?esc, etc.) nowadays. It tries to removing the responsibility of
> escaping from the template author (without using #escape, which itself
> can be forgotten, or had to be added with TemplateLoader hacks). You
> can have HTML fragments in the data-model that are automatically *not*
> escaped, and everything else is automatically escaped. But even if
> your data-model can't be made that smart (i.e. HTML is also Space), at
> least you escape be default (and the you can do exp?noEsc to prevent
> it), which is safer than the opposite.
>
Yes, we want to try that out too, but many of our custom functions were
created a long time ago. We currently have a strong focus on ecommerce and
onlinemarketing, so the use-cases which drove those functions where coming
from such projects.



>
> As of `now()`, we have `.now`, though that returns a java.util.Date
> instead of a long. So the equivalent is `.now?long`, which is somewhat
> ugly. Note sure why and how often do you need the numerical version
> though.
>
We provide both to the users in some kind of context-menu. Maybe at the
time we wanted something as short but with the numerical version.


> > Just let me know if this is interesting, so we can think about
> > concrete stuff we could contribute where it fits.
>
> Calendar arithmetic is something users often request (i.e., adding a
> day, truncating the date down to the beginning of the month/day/hour
> and such). Anyway, if you have some concrete recommendation for
> built-ins, tell us.
>
Yes calendar arithmetic is a big one. we already have a dateCalc() function
and first/lastDayOfMonth() (which we will probably make more generic into
something like firstDayOf("year",mydate) or so.
Customers need this often to cr

Re: Using Social Media to Help Promote Freemarker

2017-01-07 Thread Christoph Rüger
regarding promoting freemarker:
We are already doing that  in our Cloud-Data-platform where you can use
freemarker to do almost anything to transform, map and manipulate data.
We use it for our own application too (all templates) but we also have
chosen Freemarker as the main internal scripting language for data
transformation.

Here is a small example
<https://apps.synesty.com/transformy/en-us?m=7cd5ac359c284775a45fd96df032e896>
which
just concatenates two variables in the column "newtitle". Check it out if
you want. It goes in a similar direction as  http://freemarker-online.
kenshoo.com/

That being said I think we are also happy to contribute interesting
usecases, examples and whatever which could be spread using SocialMedia. We
have lots of examples in our own documentation (here
<https://synesty.freshdesk.com/support/search/solutions?term=freemarker>)
(it"s german...just use google translator) where we show how to do various
stuff with Freemarker expressions. We have also written some own functions (
here
<http://docs.synesty.com/display/SSUD/Spreadsheets#Spreadsheets-TemplateFunktionen>)
which could also be useful maybe as core built-ins (see here
<http://docs.synesty.com/display/SSUD/Spreadsheets#Spreadsheets-TemplateFunktionen>
)

Just let me know if this is interesting, so we can think about concrete
stuff we could contribute where it fits.

I don't want this to be considered spam - so let me know what you think...
but of course it would be promotion for us too :)

Christoph





2017-01-07 13:36 GMT+01:00 Daniel Dekany <ddek...@freemail.hu>:

> Saturday, January 7, 2017, 9:37:36 AM, Denis Bredelet wrote:
>
> > Hi Daniel,
> >
> >>> That was also my impression on the OFBiz tweet, as a software
> >>> developer. The last is important, that I'm looking at it as a
> >>> developer. FreeMarker, unless OFBiz, is mostly only interesting for
> >>> them I believe. It doesn't have an UI that a manager type could click
> >>> around. It's not a complete end-user product, it's Java library used
> >>> internally by other products.
> >
> > I am thinking of contributing a very simple UI for FreeMarker.
> > Something able to read a single template and process it with a
> > datamodel pulled from various sources (user interface window, properties
> file, XML file…)
> >
> > Would that be useful and help with advertising FreeMarker?
>
> I believe it's something that many users need, because it's not always
> convenient to try things right in the real product that integrates
> FreeMarker. Especially if you just want the wrap your head around
> something you have just read in the Manual. So I was considering
> creating a such GUI, only my priorities (core maintenance) didn't
> allow that. And then suddenly come
> http://freemarker-online.kenshoo.com/, so we do have something like
> that, but it could be improved further, also perhaps an offline
> version (like a SWT application or such) can be handy (if you want to
> connect to a local DB, etc).
>
> These template evaluators are also useful to draw the user's attention
> to best practices and features. Like if you go to
> http://freemarker-online.kenshoo.com/, you will be aware of output
> formats, a relatively novel but very useful feature.
>
> > I have some code to use as a starting point on my website:
> > http://bredelet.com/Denis/FreeMarker%20first%20steps.html
>
> These are some getting started examples. What are your ideas about the
> final product?
>
> > Maybe this could come as a separate JAR to avoid loading UI classes
> unnecessarily.
>
> > Cheers,
> > — Denis.
>
> --
> Thanks,
>  Daniel Dekany
>
>


-- 
Christoph Rüger, Geschäftsführer
Synesty <https://synesty.com/> - Automatisierung, Schnittstellen, Datenfeeds
Tel.: +49 3641/559649

Xing: https://www.xing.com/profile/Christoph_Rueger2
LinkedIn: http://www.linkedin.com/pub/christoph-rueger/a/685/198

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: About a Freemarker template evaluator service

2017-01-03 Thread Christoph Rüger
+1

watch out for security / template injection attacks: e.g. see
http://blog.portswigger.net/2015/08/server-side-template-injection.html

set

configuration.setNewBuiltinClassResolver(TemplateClassResolver.
ALLOWS_NOTHING_RESOLVER);

2017-01-03 16:07 GMT+01:00 Taher Alkhateeb <slidingfilame...@gmail.com>:

> Very cool idea, and I think in worst case scenario not too difficult to
> redo the work if needed. It's just one page that calls the parser.
>
> On Jan 3, 2017 3:27 PM, "Daniel Dekany" <ddek...@freemail.hu> wrote:
>
> > Probably there will be a higher chance for positive answer if we can
> > offer running the service too. Because I guess that's a burden for
> > them, while owning a piece of software on GitHub is not, that's just
> > good PR.
> >
> >
> > Tuesday, January 3, 2017, 12:53:12 PM, Jacques Le Roux wrote:
> >
> > > Le 03/01/2017 à 09:32, Jacopo Cappellato a écrit :
> > >> Hi all,
> > >>
> > >> a couple of days ago Daniel brought to my attention the site/service:
> > >>
> > >> http://freemarker-online.kenshoo.com/
> > >>
> > >> They provide a nice online tool to evaluate any Freemarker template by
> > >> providing the template code and its context.
> > >>
> > >> Wouldn't be nice is we could offer that or a similar service to the
> > users
> > >> and potential adopters of Freemarker? I think it would be a very
> useful
> > >> tool and also a good mechanism to attract new consumers.
> > >>
> > >> If there is an interest in this community then we could move in two
> > >> directions:
> > >>
> > >> 1) get in touch with the maintainers of freemarker-online and see if
> > they
> > >> are interested to contribute their work [*] or join our community and
> > help
> > >> to build a similar one here; if they are not interested then we could
> > >> discuss if it would make sense to build our own here
> > >>
> > >> 2) get in touch with the Infra team and explore the possibility to set
> > up a
> > >> virtual machine to dedicated to our project that we could use to
> deploy
> > a
> > >> similar service, from our official website
> > >>
> > >> I can volunteer to try to get in touch with them (#1); any volunteers
> > for
> > >> #2 (or even #1)?
> > >>
> > >> Kind regards,
> > >>
> > >> Jacopo
> > >>
> > >> [*] which is licensed with the AL2.0 and available here:
> > >> https://github.com/kenshoo/freemarker-online
> > >>
> > > Hi Jacopo,
> > >
> > > I can take care of 2, I'm used to these kind of things for OFBiz
> > > I guess 1 is a prerequisite and I'm not well placed for this task.
> > >
> > > Jacques
> > >
> > >
> >
> > --
> > Thanks,
> >  Daniel Dekany
> >
> >
>



-- 
Christoph Rüger, Geschäftsführer
Synesty <https://synesty.com/> - Automatisierung, Schnittstellen, Datenfeeds
Tel.: +49 3641/559649

Xing: https://www.xing.com/profile/Christoph_Rueger2
LinkedIn: http://www.linkedin.com/pub/christoph-rueger/a/685/198

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Re: Freemarker OSGI MANIFEST.MF

2016-07-31 Thread Christoph Rüger
2016-07-29 20:18 GMT+02:00 Daniel Dekany <ddek...@freemail.hu>:

> Friday, July 29, 2016, 5:06:49 PM, Christoph Rüger wrote:
>
> > I just asked a friend who is a Eclipse contributor and very familiar with
> > OSGI practises.
> > Here is a rough translation of his anwer:
> >
> > *bndtools takes the "generate Manifest" approach. *
> > *Eclipse on the other hand takes "Manifest first" approach. *
> > *You cannot mix the two, because Eclipse needs the manifest file,
> bndtools
> > doesn't. *
>
> Maintaining the OSGi manifest manually sounds quite impractical to me
> though, so it's only half of the story. The other half is certainly
> BundlerEclipse, though it won't be good for us anyway.
>
> > *One possible way could be to do the following in Eclipse:*
> > *Maybe create a separate ant-target which you add to the builders in
> > eclipse. This ant target could copy the generated MANIFEST.MF file into
> the
> > Eclipse Workspace project under META-INF/MANIFEST.MF instead of putting
> it
> > only in the jar file. *
>
> Sure, that's a possibility. Even right now, you expected to run `ant
> ide-dependencies`. That could be generalized to `ide-preparations` or
> somethingm which call ide-dependnecies and then also calls bnd to
> generates the metainf somewhere where Eclipse finds it but the Ant
> build ignores it. And then of course it has to be added to the
> gitignore.
>

Good idea.
I just tried that, adding the following to the ide-dependencies task:


  
   
 
   
  

And adding META-INF to .gitignore


> > I will try to investigate how I can modify the bnd ant-target so that the
> > MANIFEST.MF file is generated but not only in the JAR but also as a
> > separate file so that I do the copying.
>
> The important thing is that it must not affect the jar that Ant
> builds. That is, the metainfest generated by the Ant build must win.
>
> > If you have ideas or tips, let me know.
> >
> >
> > 2016-07-28 20:34 GMT+02:00 Daniel Dekany <ddek...@freemail.hu>:
> >
> >> Ah, I see... and I don't know the answer. I have never developed
> >> FreeMarker itself while trying to depend on it via OSGi inside the
> >> IDE. Generating the OSGi manifest from a "template" (in this case with
> >> bnd) is quite normal though. Quick googling reveals that
> >> BundlorEclipse supports such a thing, but it works by regenerating the
> >> existing MAINFEST.MF (so it's not compatible with out current build),
> >> and also it uses Bundlor not Bnd.
> >>
> >>
> >> Thursday, July 28, 2016, 10:06:35 AM, Christoph Rüger wrote:
> >>
> >> > I expected the MANIFEST.MF as part of the freemarker source-code
> >> > which I have cloned/branched from github before.
> >> >
> >> > I realize I should get familiar with bnd / bndtools. I noticed the
> >> > .bnd file which creates the MANIFEST.MF file during the build.
> >> >
> >> > I need to find out how I can use bndtools in eclipse so that I have
> >> > a proper OSGI-Bundle at development time.
> >> > Because I need the META-INF/MANIFEST.MF in Eclipse at development
> >> > time so that other bundles in the same Eclipse Project recognize my
> >> Freemarker Workspace project.
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > 2016-07-28 8:54 GMT+02:00 Daniel Dekany <ddek...@freemail.hu>:
> >> > The OSGi container should automatically use the MANIFEST.MF in the
> >> > jar. That's why it's there. Or how do you do this with other 3rd party
> >> > OSGi-ready jar-s?
> >> >
> >> >
> >> > Thursday, July 28, 2016, 12:08:42 AM, Christoph Rüger wrote:
> >> >
> >> >> Hi,
> >> >> I just started trying to be a Freemarker contributor for the first
> time
> >> >> today
> >> >> I got Eclipse setup and running I could work on a first idea
> regarding
> >> >> error handling. Not much, just some debugging, making a change, see
> if
> >> it
> >> >> compiles and has an effect. All fine so far.
> >> >>
> >> >> In the freemarker.jar (2.3.25) from maven central there is a
> >> >> META-INF/MANIFEST.MF with all the required OSGI Bundle headers. Seems
> >> that
> >> >> this gets generated by bndtools. As I am not familiar with bndtools
> yet
> >> I
> >> >> just hard-copied that folder (MET

Re: Freemarker OSGI MANIFEST.MF

2016-07-29 Thread Christoph Rüger
I just asked a friend who is a Eclipse contributor and very familiar with
OSGI practises.
Here is a rough translation of his anwer:

*bndtools takes the "generate Manifest" approach. *
*Eclipse on the other hand takes "Manifest first" approach. *
*You cannot mix the two, because Eclipse needs the manifest file, bndtools
doesn't. *

*One possible way could be to do the following in Eclipse:*
*Maybe create a separate ant-target which you add to the builders in
eclipse. This ant target could copy the generated MANIFEST.MF file into the
Eclipse Workspace project under META-INF/MANIFEST.MF instead of putting it
only in the jar file. *

I will try to investigate how I can modify the bnd ant-target so that the
MANIFEST.MF file is generated but not only in the JAR but also as a
separate file so that I do the copying.
If you have ideas or tips, let me know.


2016-07-28 20:34 GMT+02:00 Daniel Dekany <ddek...@freemail.hu>:

> Ah, I see... and I don't know the answer. I have never developed
> FreeMarker itself while trying to depend on it via OSGi inside the
> IDE. Generating the OSGi manifest from a "template" (in this case with
> bnd) is quite normal though. Quick googling reveals that
> BundlorEclipse supports such a thing, but it works by regenerating the
> existing MAINFEST.MF (so it's not compatible with out current build),
> and also it uses Bundlor not Bnd.
>
>
> Thursday, July 28, 2016, 10:06:35 AM, Christoph Rüger wrote:
>
> > I expected the MANIFEST.MF as part of the freemarker source-code
> > which I have cloned/branched from github before.
> >
> > I realize I should get familiar with bnd / bndtools. I noticed the
> > .bnd file which creates the MANIFEST.MF file during the build.
> >
> > I need to find out how I can use bndtools in eclipse so that I have
> > a proper OSGI-Bundle at development time.
> > Because I need the META-INF/MANIFEST.MF in Eclipse at development
> > time so that other bundles in the same Eclipse Project recognize my
> Freemarker Workspace project.
> >
> >
> >
> >
> >
> >
> >
> > 2016-07-28 8:54 GMT+02:00 Daniel Dekany <ddek...@freemail.hu>:
> > The OSGi container should automatically use the MANIFEST.MF in the
> > jar. That's why it's there. Or how do you do this with other 3rd party
> > OSGi-ready jar-s?
> >
> >
> > Thursday, July 28, 2016, 12:08:42 AM, Christoph Rüger wrote:
> >
> >> Hi,
> >> I just started trying to be a Freemarker contributor for the first time
> >> today
> >> I got Eclipse setup and running I could work on a first idea regarding
> >> error handling. Not much, just some debugging, making a change, see if
> it
> >> compiles and has an effect. All fine so far.
> >>
> >> In the freemarker.jar (2.3.25) from maven central there is a
> >> META-INF/MANIFEST.MF with all the required OSGI Bundle headers. Seems
> that
> >> this gets generated by bndtools. As I am not familiar with bndtools yet
> I
> >> just hard-copied that folder (META-INF/MANIFEST.MF) manually into my
> >> Eclipse freemarker project, so that our other OSGI bundles can see and
> >> import this bundle as a dependency.
> >> This works fine.
> >>
> >> *My question(s): *
> >> 1. What would be a better way instead of copying the MANIFEST.MF from
> the
> >> .jar file.
> >> 2. Anybody using freemarker in an OSGI context and also working with
> >> freemarker source?
> >>
> >> Thanks
> >> Christoph
> >>
> >
> > --
> > Thanks,
> >  Daniel Dekany
> >
> >
> >
> >
>
> --
> Thanks,
>  Daniel Dekany
>
>


-- 
Christoph Rüger, Geschäftsführer
Synesty <https://synesty.com/> - Automatisierung, Schnittstellen, Datenfeeds
Tel.: +49 3641/559649

Xing: https://www.xing.com/profile/Christoph_Rueger2
LinkedIn: http://www.linkedin.com/pub/christoph-rueger/a/685/198

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982


Freemarker OSGI MANIFEST.MF

2016-07-27 Thread Christoph Rüger
Hi,
I just started trying to be a Freemarker contributor for the first time
today :)
I got Eclipse setup and running I could work on a first idea regarding
error handling. Not much, just some debugging, making a change, see if it
compiles and has an effect. All fine so far.

In the freemarker.jar (2.3.25) from maven central there is a
META-INF/MANIFEST.MF with all the required OSGI Bundle headers. Seems that
this gets generated by bndtools. As I am not familiar with bndtools yet I
just hard-copied that folder (META-INF/MANIFEST.MF) manually into my
Eclipse freemarker project, so that our other OSGI bundles can see and
import this bundle as a dependency.
This works fine.

*My question(s): *
1. What would be a better way instead of copying the MANIFEST.MF from the
.jar file.
2. Anybody using freemarker in an OSGI context and also working with
freemarker source?

Thanks
Christoph

-- 
Synesty GmbH
Moritz-von-Rohr-Str. 1a
07745 Jena
Tel.: +49 3641 559649
Fax.: +49 3641 5596499
Internet: http://synesty.com

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: DE287564982