<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<META content="MSHTML 6.00.6000.17080" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=914182622-21102010><FONT face=Arial
color=#0000ff size=2>Hi Mario,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=914182622-21102010><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=914182622-21102010><FONT face=Arial
color=#0000ff size=2>Thanks a bunch – easy, clean approach
and works like a charm! ;-)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=914182622-21102010><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=914182622-21102010><FONT face=Arial
color=#0000ff size=2>Cheers,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=914182622-21102010><FONT face=Arial
color=#0000ff size=2>Paul</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> opencms-dev-bounces@opencms.org
[mailto:opencms-dev-bounces@opencms.org] <B>On Behalf Of </B>Mario
Jäger<BR><B>Sent:</B> 5. oktober 2010 09:08<BR><B>To:</B> The OpenCms mailing
list<BR><B>Subject:</B> Re: [opencms-dev] Map OpenCmsHmtl element as plain
text to property<BR></FONT><BR></DIV>
<DIV></DIV><PRE>Hi Paul,
I think, you have to implement your own xml content handler for that. Your Xml content handler should extend the default xml content handler org.opencms.xml.content.CmsDefaultXmlContentHandler.java. But, your handler should
overwrite the method resolveMapping(). In this method you have to implement your logic, that for some properties the plain text is mapped only. With the method CmsHtmlExtractor.extractText() you get the plain text. The XML
content handler to use must be specified in the appinfo section of the XSD defining the XML content:
<xsd:annotation>
<xsd:appinfo>
<handler class="mypackage.myContentHandler" />
...
Please note, that your own xml content handler should be in your own module. Otherwise it is overwritten after an OpenCms update.
</PRE><PRE class=moz-signature cols="72">--
Kind Regards,
Mario.
-------------------
Mario Jäger
Alkacon Software GmbH - The OpenCms Experts
<A class=moz-txt-link-freetext href="http://www.alkacon.com">http://www.alkacon.com</A> - <A class=moz-txt-link-freetext href="http://www.opencms.org">http://www.opencms.org</A></PRE><BR>Am
14.09.2010 12:49, schrieb Paul-Inge Flakstad:
<BLOCKQUOTE
cite=mid:4D405B4872E4E54A95966E6CF909E7F32659374347@ANTON.nett.npolar
type="cite">
<META content="MSHTML 6.00.6000.17080" name=GENERATOR>
<DIV><SPAN class=250104310-14092010><FONT face=Arial size=2>Hi
all,</FONT></SPAN></DIV>
<DIV><SPAN class=250104310-14092010></SPAN> </DIV>
<DIV><SPAN class=250104310-14092010><FONT face=Arial size=2>Is there an easy
way to map an OpenCmsHtml element as plain text to a
property?</FONT></SPAN></DIV>
<DIV><SPAN class=250104310-14092010></SPAN> </DIV>
<DIV><SPAN class=250104310-14092010><FONT face=Arial size=2>I have an
ingress field (type OpenCmsHtml) mapped to the Description property,
and I want the property to contain only the plain text, not
the HTML markup.</FONT></SPAN></DIV>
<DIV><SPAN class=250104310-14092010></SPAN> </DIV>
<DIV><SPAN class=250104310-14092010><FONT face=Arial size=2>Best
regards,</FONT></SPAN></DIV>
<DIV><SPAN class=250104310-14092010><FONT face=Arial
size=2>Paul</FONT></SPAN></DIV><PRE wrap=""><FIELDSET class=mimeAttachmentHeader></FIELDSET>
_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
<A class=moz-txt-link-freetext href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</A></PRE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>