cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bart Remmerie <remme...@gmail.com>
Subject Re: from wysiwyg-editor to database and/or nice html-output
Date Thu, 27 May 2010 12:24:47 GMT
Dear Robby,
Dear all,

Thanks for this solution, I'll definitely experiment with it ... but I'm
hoping to find an even better one.

Maybe I should have explained my use case a bit more:

I have a cforms page to administer content translations.
Basically, it's a repeater containing multiple translations for one term
(id, locale, translationText).

Ideally the translation texts would be displayed as output and after
clicking it (or an edit button), a wysiwyg-editor could appear in a modal
div & after saving it's written to the db & the page is updated (with or
without ajax).

The downside of your solution is the following:
to generate the cforms-repeater-list, i already have all the data in an
object (in flow).  Calling cinclude again as you proposed would generate a
new database call per translation.

Do you understand what I mean ?

I know I cannot fix it on xsl-level (formatting the field in some sort of
way), since the markup is adjusted before passing it to the forms-xsl.

Are you / Is anyone familiar with the xmlize options for jx-templates &
would this provide an adequate solution ... ? (even though I'm working on
2.1.11 now)

I've also been trying with org.apache.cocoon.xml.StringXMLizable ... but
that doesn't get me there either.  The closest I got was an error message
when transforming my jx-template, mentioning I could not have content before
the prolog.

(It would also be cool to have something like the dojo inplace editor with
wysiwyg possibilites)

Anyway, all alternatives, tips, tricks and hints are welcome !!

Kind regards,
Bart

On Thu, May 27, 2010 at 12:29 PM, Robby Pelssers
<robby.pelssers@ciber.com>wrote:

>  In your jx template you can define something like:
>
>
>
>
>
> <?xml version=*"1.0"* encoding=*"UTF-8"*?>
>
> <jx:template
>
>   xmlns:jx=*"http://apache.org/cocoon/templates/jx/1.0"*
>
>   xmlns:cinclude=*"http://apache.org/cocoon/include/1.0"*>
>
>
>
>     <html>
>
>      …
>
>      <cinclude:include src=*"cocoon:/dbrecord/${recordId}"*/>
>
>      …
>
>     </html>
>
> </jx:template>
>
>
>
>
>
> And next you need to add the include transformer to that pipeline.
>
>
>
> So you would end up with something like:
>
>
>
>
>
>       <map:match pattern=*"dbrecord/*"*>
>
>         <map:generate src=*"dbrecord.jx"* type=*"jx"*/>
>
>         <map:transform type=*"cinclude"*/>
>
>         <map:serialize type=”xhtml”/>
>
>       </map:match>
>
>
>
>
>
>
>
> Cheers,
>
> Robby Pelssers
>
>
>
> *From:* Bart Remmerie [mailto:remmerie@gmail.com]
> *Sent:* Thursday, May 27, 2010 12:13 PM
> *To:* users
> *Subject:* from wysiwyg-editor to database and/or nice html-output
>
>
>
> Hi,
>
> One way or another, I can't get this working ... and I guess I'm
> overlooking an easy essential bit:
>
> in a CForm, I use an htmlarea-editor to allow users to create input with
> basic markup (bold, underline, italic, ...)
> When I store the information in a database, it looks like a nice
> html-snippet, something like this:
>
> This is <span style="font-style: italic;"><span style="font-weight:
> bold;">a simple </span>test</span>
>
> What I'm struggling with is how to get this text integrated into a jx-page
> or in a CForm-field with an output-state in the desired way:
>
> Not with the markup visible
> Not with the markup replaced by &lt; &gt; ...
>
> But simply the text, with the markup applied (for the sample above
> partially bold and italic).
>
> Someone must have done this before I guess.
>
> In the application, it should allow the text to be read on the screen &
> used as basis (template) for emails too.
>
> Kind regards,
> Bart
>



-- 
Bart Remmerie
+32 (0477) 78.88.76
remmerie@gmail.com

Mime
View raw message