Hi Stephan,

Reading over this seems that you'll be doing a lot of work that is
tedious to get to function correctly if you want all the features of
RIFE's template engine in the browser. There are concepts in the RIFE
template engine that are much more advanced than the simple
value/content pair. Each content item is actually stored logically as
the snippets that constitute that content item. This means that when
you create a value through aggregation and change some included value
afterwards, the new content of that included value will be updated in
all content items that use it. The benefit of this is that the
template can be perused by everything in the system in any order, ie.
form tags can be replaced during the element.print(template) call even
though the user has already used those form tags to build his final
content.

My suggestion for you is two-fold:

* first look at DWR and see if it's not able to simple remote the
template instance, if this works, you have no work to do. If there are
small issues with it, I can help you to look into it.

* second, use the template's getAvailableValueIds() method to get the
IDs of all the values. You can then iterate over them, retrieve the
value content through getValue(String) and then render the key/value
pairs as JSON with a Java JSON library. This will evaluate all the
content in the value tags though and the moment you do getValue will
make that value a fixed string that doesn't have the internal logical
construction anymore.

Does this help?

Best regards,

Geert


On 12/17/07, Stephan Schmidt <[EMAIL PROTECTED]> wrote:
> I would like to use RIFE to parse a template and create a JS class like
>
> { vars: ["title", "user"] ... } where it can be rendered with a JS Renderer
> (like RIFE does I assume).
>
> The client Javascript code should load the JS template and render it with
> some JSON data to render HTML on the client.
>
> I now could write a Javascript Parser (with Rhino on the server or directly
> in the browser) to read the <!-- V ... --> etc values and create a
> template object
> and send it to the client.
>
> Or I could reuse the RIFE parsing logic and write a Java class which 
> translates
> the parsed RIFE templates into an executable JS object.
>
> The problem with yet another mailing list is that I can't manage it :-)
> But I'll try to subscribe (with some problems lately concerning MLs and Gmail)
>
> Thanks for your response,
>
> Regards
> -stephan
>
> On Dec 17, 2007 9:30 AM, Geert Bevin <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > just let me get this straight, you would like to output JavaScript
> > using RIFE templates, or create a JavaScript template class that you
> > use at the client-side to manipulate content, similar to how RIFE
> > templates do that on server-side?
> >
> > Geert
> >
> > PS.: I'd appreciate if you would send your previous email to the
> > RIFE's mailing list
> >
> >
> > On 16 Dec 2007, at 20:04, Stephan Schmidt wrote:
> >
> > > Hello Geert,
> > >
> > > I've been thinking about using RIFE templates in the browser to render
> > > widgets. My idea was to create a Javascript Template from the RIFE
> > > template and send it to the browser (instead of a Java Template
> > > object). Any pointers on where to start?
> > >
> > > I also wrote something about business logic in templates, where I got
> > > some heat e.g. fro Gavin. I had some days for holidays and thought -
> > > pling - now I get RIFE, it's just more in the direction of no business
> > > logic in templates.
> > >
> > > http://stephan.reposita.org/archives/2007/11/27/people-dont-get-the-difference-between-business-and-ui-logic/
> > >
> > > Cheers
> > > -stephan
> >
> > --
> > Geert Bevin
> > Terracotta - http://www.terracotta.org
> > Uwyn "Use what you need" - http://uwyn.com
> > RIFE Java application framework - http://rifers.org
> > Music and words - http://gbevin.com
> >
> >
>
>
>
> --
> Stephan Schmidt :: [EMAIL PROTECTED]
> Reposita Open Source - Monitor your software development
> http://www.reposita.org
> Blog at http://stephan.reposita.org - No signal. No noise.
>


-- 
Geert Bevin
Terracotta - http://www.terracotta.org
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"rife-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rife-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to