Tuesday, October 13, 2015, 7:27:18 PM, Pradeep Murugesan wrote:

> Hi Daniel,
>     Thanks for your pointers, Now I have figured out a way to check
> if the immediate previous node has a role 'formDataModel'. 
>
> <#local siblingSize = .node['preceding-sibling::*']?size>
> <#local prevSibling = .node['preceding-sibling::*'][siblingSize-1]>
> <#local siblingRole = prevSibling.@role[0]!?string>

Those 3 lines could be written like this:

  <#local siblingRole = .node['preceding-sibling::*[1]'].@role[0]!>

> <span>${siblingRole}</span>
> <#if role == "template" && siblingRole == "formDataModel">...</#if>
> once I did the above, I googled to check what is
> "preceding-sibling" and understood that is Xpath terminology. I hope
> there should be a cleaner way than above to get the immediate
> preceding-sibling which I will try to find out.

We could add a built-in for it. The XPath way is not exactly
obvious...

> BTW, what are all the templates we have to add the dataModel. We need to do 
> it for all ?

You mean, what if a template doesn't need a data model. I guess for
now then we add an empty data-model programlisting...

> Pradeep.
>> Date: Tue, 13 Oct 2015 01:59:30 +0200
>> From: [email protected]
>> To: [email protected]
>> Subject: Re: Freemarker manual Local set up
>> 
>> With an example:
>> 
>> Template:
>>   <#assign n = doc.r.b>
>>   ${n['preceding-sibling::*']}
>>   ${n['following-sibling::*']}
>> 
>> Data model:
>>   doc=<r><a>aaa</a><b>bbb</b><c x='1'>ccc</c></r>
>> 
>> Result:
>>   aaa
>>   ccc
>> 
>> Monday, October 12, 2015, 10:29:24 AM, Pradeep Murugesan wrote:
>> 
>> > Hi Daniel,
>> >     So this is where I am struck. 
>> > In the ProgramListing macro I need to check if the current role is
>> > template and if it has a immediate previous sibling with role
>> > frm-dataModel . If so I will generate our hidden form elements and a 
>> > visible "Try it out" button.
>> > http://freemarker.org/docs/xgui.html 
>> > I read through this already, but I was not able to find any node
>> > build-ins to navigate to my immediate previous node, I mean it has
>> > pointers to go to a parent or child. But in this case I want to
>> > navigate to my preceding sibling right ?
>> > Kindly let me know If I am missing something.
>> > Pradeep.
>> >> Date: Sun, 11 Oct 2015 19:40:49 +0200
>> >> From: [email protected]
>> >> To: [email protected]
>> >> Subject: Re: Freemarker manual Local set up
>> >> 
>> >> I'm not sure where exactly you stuck, but I try to give some pointers.
>> >> Read http://freemarker.org/docs/xgui.html if you haven't. As you will
>> >> see there, you got the current XML node as .node in the programlisting
>> >> macro, and you can move around in the DOM tree from there, like
>> >> examine the previous/next programlisting, etc.
>> >> 
>> >> As of shrinking the content, certainly you should work with a
>> >> minimalistic docbook. I don't know what error you get. (Of course the
>> >> XML must be well-formed XDocBook.)
>> >> 
>> >> -- 
>> >> Thanks,
>> >>  Daniel Dekany
>> >> 
>> >> 
>> >> Sunday, October 11, 2015, 5:50:06 PM, Pradeep Murugesan wrote:
>> >> 
>> >> > Hi Daniel,
>> >> >   I am still trying to knock it down but in vain. I dig down to
>> >> > programListing macro in NodeHandlers.ftlh and I am lost there as what 
>> >> > is going on.
>> >> > I tried to shrink the content in book.xml and ran docgen to
>> >> > understand where do i need to inject the logic but that approach threw 
>> >> > few other errors.
>> >> >
>> >> > It comes all the way down to generateHTMLFile_inner where we get
>> >> > page.fthl and process it and I am not able to proceed further.
>> >> > Could you please give me a clue ?
>> >> > Pradeep. 
>> >> >> From: [email protected]
>> >> >> To: [email protected]
>> >> >> Subject: RE: Freemarker manual Local set up
>> >> >> Date: Mon, 5 Oct 2015 14:45:09 +0530
>> >> >> 
>> >> >> Hi Daniel,
>> >> >> 
>> >> >>  I am going through the docgen code and its taking some time to 
>> >> >> clearly get what is happening in the Transform.java.
>> >> >> I am tracing down to the part where to check if the previous node is 
>> >> >> frmDataModel if the current node is Template so that I have a hidden 
>> >> >> form and try it out button. I am facing some challenges there.
>> >> >> I will try to complete things within this week. 
>> >> >> Pradeep.
>> >> >> 
>> >> >> > Date: Tue, 29 Sep 2015 21:45:41 +0200
>> >> >> > From: [email protected]
>> >> >> > To: [email protected]
>> >> >> > CC: [email protected]
>> >> >> > Subject: Re: Freemarker manual Local set up
>> >> >> > 
>> >> >> > FM is *built* with JDK 8 (and runs on Java 5+ as of 2.3.24). This
>> >> >> > information was missing from the README.txt... I have fixed that now.
>> >> >> > The important thing is to ensure that Ant runs on JDK 8 too. Perhaps
>> >> >> > you need to adjust the JAVA_HOME environment variable for that.
>> >> >> > (Clearing the Ivy or Ant directories is not needed.)
>> >> >> > 
>> >> >> > 
>> >> >> > Tuesday, September 29, 2015, 8:56:44 PM, Pradeep Murugesan wrote:
>> >> >> > 
>> >> >> > > Tried upgrading to java 1.8 and cleared the ant and ivy cache.
>> >> >> > > still facing the same issue. Have any of you guys faced this 
>> >> >> > > already
>> >> >> > > Pradeep.
>> >> >> > >
>> >> >> > >> From: [email protected]
>> >> >> > >> To: [email protected]
>> >> >> > >> Subject: RE: Freemarker manual Local set up
>> >> >> > >> Date: Tue, 29 Sep 2015 08:43:05 +0530
>> >> >> > >> 
>> >> >> > >> Hi,  I tried to do "ant manualFreemarkerOrg" to bring up the 
>> >> >> > >> manual locally.
>> >> >> > >> But end up in the following error.
>> >> >> > >> BUILD 
>> >> >> > >> FAILEDC:\Users\pmuruge\Desktop\Pradeep\Personal\github\apache\freemarker\incubator-freemarker\build.xml:570:
>> >> >> > >>  The following error occurred while executing this 
>> >> >> > >> line:C:\Users\pmuruge\Desktop\Pradeep\Personal\github\apache\freemarker\incubator-freemarker\build.xml:556:
>> >> >> > >>  java.lang.UnsupportedClassVersionError: 
>> >> >> > >> org/freemarker/docgen/TransformAntTask : Unsupported major.minor 
>> >> >> > >> version 52.0
>> >> >> > >> 
>> >> >> > >> Googling got me to the state that the docgen jar would have been 
>> >> >> > >> build using different java and from the github readme understood 
>> >> >> > >> that docgen requires java 1.8. which means compiling Freemarker 
>> >> >> > >> project also require Java 1.8 ? Its not mentioned in Freemarker 
>> >> >> > >> readme though. 
>> >> >> > >> Please guide me.
>> >> >> > >> Also,
>> >> >> > >>  How are you guys working with multiple java versions in the same 
>> >> >> > >> machine. BTW I am using Windows and tried to manage java 1.7 & 
>> >> >> > >> java 1.8 but failed with an error . If you guys are already 
>> >> >> > >> following some way kindly let me know.
>> >> >> > >> 
>> >> >> > >> Pradeep.
>> >> >> > >> 
>> >> >> > >> 
>> >> >> > >> > Date: Wed, 23 Sep 2015 20:34:03 +0200
>> >> >> > >> > From: [email protected]
>> >> >> > >> > To: [email protected]
>> >> >> > >> > Subject: Re: Freemarker manual Local set up
>> >> >> > >> > 
>> >> >> > >> > The Manual is in the "freemarker" project, under src/manual. It 
>> >> >> > >> > also
>> >> >> > >> > uses docgen of course. (You can download the latest docgen 
>> >> >> > >> > artifact
>> >> >> > >> > with running `ant update-deps` in the "freemarker" project.) The
>> >> >> > >> > manual is built with `ant manualOffline` or 
>> >> >> > >> > `manualFreemarkerOrg`.
>> >> >> > >> > 
>> >> >> > >> > As of README-s, all 3 modules (freemarker, site, docgen) has 
>> >> >> > >> > one, so
>> >> >> > >> > what's not described there is probably undocumented...
>> >> >> > >> > 
>> >> >> > >> > Anyway, it's docgen's responsibility to generate the hidden 
>> >> >> > >> > HTML forms
>> >> >> > >> > and JavaScript that will be needed. (Both the Web site and the 
>> >> >> > >> > Manual
>> >> >> > >> > is built from DocBook XML by Docgen.)
>> >> >> > >> > 
>> >> >> > >> > -- 
>> >> >> > >> > Thanks,
>> >> >> > >> >  Daniel Dekany
>> >> >> > >> > 
>> >> >> > >> > 
>> >> >> > >> > Wednesday, September 23, 2015, 7:33:05 PM, Pradeep Murugesan 
>> >> >> > >> > wrote:
>> >> >> > >> > 
>> >> >> > >> > > Hi Daniel,
>> >> >> > >> > >    I could see that freemarker manual is part of the site
>> >> >> > >> > > http://freemarker.org/docs/index.html
>> >> >> > >> > > Since that is generated using the doc-gen, I am trying to 
>> >> >> > >> > > look into
>> >> >> > >> > > the https://github.com/apache/incubator-freemarker-site for 
>> >> >> > >> > > manual contents.
>> >> >> > >> > > https://github.com/apache/incubator-freemarker-site/blob/master/src/main/docgen/book.xml
>> >> >> > >> > > references to the site but I am not able to get the xml for 
>> >> >> > >> > > manual which doc-gen converts.
>> >> >> > >> > >
>> >> >> > >> > > I am trying to get the manual up and running locally to 
>> >> >> > >> > > connect
>> >> >> > >> > > with the freemarker online. Is there any readme kind of thing 
>> >> >> > >> > > to achieve the same ?
>> >> >> > >> > > Please guide me.
>> >> >> > >> > > Pradeep.                                          
>> >> >> > >> > 
>> >> >> > >>                                         
>> >> >> > >                                           
>> >> >> > 
>> >> >> > -- 
>> >> >> > Thanks,
>> >> >> >  Daniel Dekany
>> >> >> > 
>> >> >>                                         
>> >> >                                           
>> >> 
>> >
>> >                                           
>> 
>> -- 
>> Thanks,
>>  Daniel Dekany
>> 
>                                           

-- 
Thanks,
 Daniel Dekany

Reply via email to