Re: XDocReport, IDE support (Was: Re: Anybody with deeper OSGi bundle can comment on freemarker.jar OSGification?)

Daniel Dekany <[email protected]> Tue, 4 Jun 2013 11:16:28 +0200
Newsgroups gmane.comp.web.freemarker.devel
Message-ID <[email protected]>
Tuesday, June 4, 2013, 9:53:17 AM, Angelo zerr wrote:

> 2013/6/3 Daniel Dekany <[email protected]>
> Monday, June 3, 2013, 2:29:45 PM, Angelo zerr wrote:
[snip]
> When you type some content in a docx, MS word split your content in several xml elements.
> For instance if you type :
>
> --------------------------------------------------- 
> ${name}
> ---------------------------------------------------
>
> The word/document.xml looks like this :
>
> ---------------------------------------------------
> <t>${</t>name}</t>
> ---------------------------------------------------

Aha, I see. I wonder what's the *generic* solution for this, one that
could be used in multiple projects. You had to get rid of all the tags
then un-escape, and in the resulting "plain text" find the template
language elements, then in the XML document you had to remove all the
elements inside and move out all the element "edges" from the
corresponding section, then replace the now cleared section with the
plain text version. Then execute the resulting template, which will
produce an XML, that you might want to transform further because there
can be elements in it, like <fm:repeatParent element="wm:tableRow">
... </fm:repeatParent> that should find the parent "wm:taleRow" and
repeat it once for each nested fm:repeatParent, with the contents of
the fm:parentContent element. Stuff like that. Obviously not part of
plain FreeMarker, but could be in a generally useful library.

> Ok. And if we do that, you could host an online demo in order to
> future users can play with FM syntax with online demo.
> You could have a JSON editor + FM editor. As soon as you modify it, you could see the FM preview.

Oh, that would be very cool. Although running arbitrary user-specified
FTL on a server is a bit too brave (see FAQ about precautions)...
unless it runs in some discardable VPS. But it could be done with an
applet running on the client too, and then he can only hack himself.

> On other words, do the same thing than our demo (generate reports +
> convert it to pdf as soon as you change the HTML model)  :
> http://xdocreport.opensagres.cloudbees.net/processReport?reportId=DocxTextStylingWithFreemarker.docx&dispatch=load&converter=PDF_XWPF

[snip]
> Its a long time that I have developped  Freemarker-DLTK, but if I remember DLTK needs to maintain
> a DLTK AST even if the editor breaks the FM AST. (As soon as you type text in the editor, I called
> the FM AST to create a DLTK AST). The DLTK AST is used for instance
> for the Outline View to display elements of FM (#list, etc)

How do they do this with other languages? Eclipse has its own Java
parser, and that's surely was designed with this in mind, and it's
fast too. But what about Jython, Ruby, etc? Do they use the "real"
parser, or somebody has developed a special parser just for the
Eclipse plugin?

-- 
Thanks,
 Daniel Dekany


------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j