Contributions?
Freemarker has been quite helpful in the medical documents product I am working on. Is there an issue you would recommend for a new contributor who wants to learn the code? Two issues interest me in particular: Java 8 Time Support Debugging and testing tools for people who write templates. Also not clear on whether it's better to contribute to Freemarker 2 or 3. Thanks
Re: [FM3] Question on CallPlace#executeNestedContent(...)
On Tue, Jan 30, 2018 at 3:45 PM, Daniel Dekany wrote: > Tuesday, January 30, 2018, 3:42:28 PM, Woonsan Ko wrote: > >> On Tue, Jan 30, 2018 at 3:45 AM, Daniel Dekany wrote: >>> Monday, January 29, 2018, 11:20:02 PM, Woonsan Ko wrote: >>> Hi, While implementing @form.errors directive (migrated from spring form:errors taglib), I ended up adding 'messages' nested parameter like the following example: <@form.errors '*'; messages> <#list messages as message> ${message} As spring's form:errors jsp tag allows default rendering when there's no nested body content, I found the following example doesn't look very convenient. With 'messages' omitted, I got a template exception. <@form.errors 'firstName'; messages /> # rendering the default error info markups.. So, I wonder if there's a way to omit the 'messages' nested parameter. The javadocs of CallPlace#getNestedContentParameterCount() and #executeNestedContent() say about the possibility with less nested parameters somehow, but I can't figure out how to make it flexible in the directive. Please let me know if you have any hints. >>> >>> I suppose nested content is allowed exactly if there's a nested >>> content argument (like `; message`). So you can decide if there's a >>> nested content argument with >>> CallPlace.getNestedContentParameterCount(), and if there isn't, then >>> you don't call CallPlace.executeNestedContent (but check if >>> CallPlace.hasNestedContent() returns `true`, in which case throw a >>> TemplateException that explains the problem), otherwise you call >>> CallPlace.executeNestedContent with 1 nested content argument. >> >> Thank you so much! Now, it's very clear to me. :-) >> >>> >>> Not sure if I'm missing something here. If not, what was the missing >>> piece? That information should be added to the API docs. >> >> I didn't understand this quite well yesterday: "If, however, you want >> to allow the caller to declare less parameters..." >> In my example, the 'caller' seems to mean the directive user (who is >> writing the directive in the template), and 'you' is I as a directive >> implementer. I read 'caller' as the directive code itself yesterday. > > I don't follow this. You can call a directive. The caller is the FTL > tag that calls it, like <@foo />. (It's entered by some user, > obviously.) The directive itself is the called. It's probably my problem. I was thinking too much last night. ;-) > >> That was my confusion. ;-) >> Perhaps would it be okay if I change the 'caller' to 'directive/function >> user'? > > Perhaps this: "allow the directive/function call to declare less > nested content parameters". Thanks. I've replaced that. Cheers, Woonsan > >> Regards, >> >> Woonsan >> >>> Regards, Woonsan >>> >>> -- >>> Thanks, >>> Daniel Dekany >>> >> > > -- > Thanks, > Daniel Dekany >
Re: [FM3] Question on CallPlace#executeNestedContent(...)
Tuesday, January 30, 2018, 3:42:28 PM, Woonsan Ko wrote: > On Tue, Jan 30, 2018 at 3:45 AM, Daniel Dekany wrote: >> Monday, January 29, 2018, 11:20:02 PM, Woonsan Ko wrote: >> >>> Hi, >>> >>> While implementing @form.errors directive (migrated from spring >>> form:errors taglib), I ended up adding 'messages' nested parameter >>> like the following example: >>> >>> <@form.errors '*'; messages> >>> <#list messages as message> >>> ${message} >>> >>> >>> >>> As spring's form:errors jsp tag allows default rendering when there's >>> no nested body content, I found the following example doesn't look >>> very convenient. With 'messages' omitted, I got a template exception. >>> >>> <@form.errors 'firstName'; messages /> # rendering the default error >>> info markups.. >>> >>> So, I wonder if there's a way to omit the 'messages' nested parameter. >>> The javadocs of CallPlace#getNestedContentParameterCount() and >>> #executeNestedContent() say about the possibility with less nested >>> parameters somehow, but I can't figure out how to make it flexible in >>> the directive. >>> >>> Please let me know if you have any hints. >> >> I suppose nested content is allowed exactly if there's a nested >> content argument (like `; message`). So you can decide if there's a >> nested content argument with >> CallPlace.getNestedContentParameterCount(), and if there isn't, then >> you don't call CallPlace.executeNestedContent (but check if >> CallPlace.hasNestedContent() returns `true`, in which case throw a >> TemplateException that explains the problem), otherwise you call >> CallPlace.executeNestedContent with 1 nested content argument. > > Thank you so much! Now, it's very clear to me. :-) > >> >> Not sure if I'm missing something here. If not, what was the missing >> piece? That information should be added to the API docs. > > I didn't understand this quite well yesterday: "If, however, you want > to allow the caller to declare less parameters..." > In my example, the 'caller' seems to mean the directive user (who is > writing the directive in the template), and 'you' is I as a directive > implementer. I read 'caller' as the directive code itself yesterday. I don't follow this. You can call a directive. The caller is the FTL tag that calls it, like <@foo />. (It's entered by some user, obviously.) The directive itself is the called. > That was my confusion. ;-) > Perhaps would it be okay if I change the 'caller' to 'directive/function > user'? Perhaps this: "allow the directive/function call to declare less nested content parameters". > Regards, > > Woonsan > >> >>> Regards, >>> >>> Woonsan >> >> -- >> Thanks, >> Daniel Dekany >> > -- Thanks, Daniel Dekany
Re: [FM3] Question on CallPlace#executeNestedContent(...)
On Tue, Jan 30, 2018 at 3:45 AM, Daniel Dekany wrote: > Monday, January 29, 2018, 11:20:02 PM, Woonsan Ko wrote: > >> Hi, >> >> While implementing @form.errors directive (migrated from spring >> form:errors taglib), I ended up adding 'messages' nested parameter >> like the following example: >> >> <@form.errors '*'; messages> >> <#list messages as message> >> ${message} >> >> >> >> As spring's form:errors jsp tag allows default rendering when there's >> no nested body content, I found the following example doesn't look >> very convenient. With 'messages' omitted, I got a template exception. >> >> <@form.errors 'firstName'; messages /> # rendering the default error >> info markups.. >> >> So, I wonder if there's a way to omit the 'messages' nested parameter. >> The javadocs of CallPlace#getNestedContentParameterCount() and >> #executeNestedContent() say about the possibility with less nested >> parameters somehow, but I can't figure out how to make it flexible in >> the directive. >> >> Please let me know if you have any hints. > > I suppose nested content is allowed exactly if there's a nested > content argument (like `; message`). So you can decide if there's a > nested content argument with > CallPlace.getNestedContentParameterCount(), and if there isn't, then > you don't call CallPlace.executeNestedContent (but check if > CallPlace.hasNestedContent() returns `true`, in which case throw a > TemplateException that explains the problem), otherwise you call > CallPlace.executeNestedContent with 1 nested content argument. Thank you so much! Now, it's very clear to me. :-) > > Not sure if I'm missing something here. If not, what was the missing > piece? That information should be added to the API docs. I didn't understand this quite well yesterday: "If, however, you want to allow the caller to declare less parameters..." In my example, the 'caller' seems to mean the directive user (who is writing the directive in the template), and 'you' is I as a directive implementer. I read 'caller' as the directive code itself yesterday. That was my confusion. ;-) Perhaps would it be okay if I change the 'caller' to 'directive/function user'? Regards, Woonsan > >> Regards, >> >> Woonsan > > -- > Thanks, > Daniel Dekany >
Re: [RESULT][VOTE] Graduate Apache FreeMarker Project from Incubator to TLP
Monday, January 29, 2018, 7:16:21 PM, David E Jones wrote: > On Mon, Jan 29, 2018 at 8:59 AM, Daniel Dekany wrote: > >> Monday, January 29, 2018, 4:35:38 PM, Sergio Fernández wrote: >> >> > Great, Daniel! >> > >> > Let's move to the next step and open the vote at general@incubator.a.o >> ;-) >> >> David has started discussing the issue with his Mentor status on Jan >> 24. I'm waiting for that to be resolved. Not sure if there's any >> progress. David, did they answer? Because then that wasn't CC-ed to >> the private list. > > > I got a reply from John D. Ament on Jan 24th saying he was sending notice, > but I haven't seen anything since and not sure if I should even expect any > sort of email notification or if it's something I'd have to hunt around for > or follow up on. > > FWIW I'm not on the Incubator PMC list yet (my ASF username is 'jonesde'): > > http://people.apache.org/phonebook.html?pmc=incubator > > I also don't know if my failure to respond to John's email in June will > cause any issues, or in general what to expect with all this so I really > can't say much. If the process is like here, they have vote (at least 3 days), then wait for 3 days so the board can veto the decision, and only then mail you... I hope they have started the process. If they won't report back in a few days, it would be good if you ask them. > -David -- Thanks, Daniel Dekany
Re: [FM3] Question on CallPlace#executeNestedContent(...)
Monday, January 29, 2018, 11:20:02 PM, Woonsan Ko wrote: > Hi, > > While implementing @form.errors directive (migrated from spring > form:errors taglib), I ended up adding 'messages' nested parameter > like the following example: > > <@form.errors '*'; messages> > <#list messages as message> > ${message} > > > > As spring's form:errors jsp tag allows default rendering when there's > no nested body content, I found the following example doesn't look > very convenient. With 'messages' omitted, I got a template exception. > > <@form.errors 'firstName'; messages /> # rendering the default error > info markups.. > > So, I wonder if there's a way to omit the 'messages' nested parameter. > The javadocs of CallPlace#getNestedContentParameterCount() and > #executeNestedContent() say about the possibility with less nested > parameters somehow, but I can't figure out how to make it flexible in > the directive. > > Please let me know if you have any hints. I suppose nested content is allowed exactly if there's a nested content argument (like `; message`). So you can decide if there's a nested content argument with CallPlace.getNestedContentParameterCount(), and if there isn't, then you don't call CallPlace.executeNestedContent (but check if CallPlace.hasNestedContent() returns `true`, in which case throw a TemplateException that explains the problem), otherwise you call CallPlace.executeNestedContent with 1 nested content argument. Not sure if I'm missing something here. If not, what was the missing piece? That information should be added to the API docs. > Regards, > > Woonsan -- Thanks, Daniel Dekany