Hi,
has anyone a working example how to add some sort of plugin to the yui rte as it's described online[1]? It would be great if there would be a way to do this without modifying the content of the orbeon jars. In the mailing list archives, i've found some information how to apply a custom configuration to the rte [2] using YUI_RTE_CUSTOM_CONFIG, so it's possible to add custom toolbar buttons, but i found no way to make those custom buttons trigger a custom function. florian PS: I'm still searching for a way to make xxforms:dialog windows resizeable. There's a "Resize Utility" shipping with YUI [3] - it there a way to use it together with xxforms:dialog or xf:htmlarea? [1] http://developer.yahoo.com/yui/editor/#plugins [2] http://n4.nabble.com/Modifying-the-YUI-Rich-Text-Editor-buttons-tp998305p999591.html [3] http://developer.yahoo.com/yui/resize/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
ok, i found a way to add a working custom button to insert a custom (non-html) element in the htmlarea and get it displayed using css (btw - could i get a wiki account so i could write a short text about the solution?). But when putting the editor content into my xforms instance, the custom tag seems to be stripped (checked using instance explorer) . I'm using a modified clean-html.xsl containing my custom element, but that didn't help.
In the YUI forums, i got the info that the rte doesn't strip unknown elements, so now i need a way to debug what's going on when the editor content is sent to the server. Is there a way to debug the input/oputput of the clean-html.xsl transformation? BTW, i'm using a nightly build downloaded yesterday with Tomcat 6.0.?? / Ubuntu 9.10. I'll try to create a sandbox example tomorrow. florian |
This is great news! You got it halfway working, which is halfway more than I did. I also ran into the problem of having my custom XML element stripped out, but I wasn't sure if it was on the yuiRTE, Orbeon, or browser levels. At least you got your custom XML element represented in CSS, that's a great step in the right direction. That effectively eliminates the RTE as the culprit, and I also added my element to clean.html.xsl Please keep the list posted on your progress. This is something I also plan on working on fairly soon.
Ethan On Tue, Feb 16, 2010 at 2:05 PM, fl.schmitt(ops-users) <[hidden email]> wrote:
-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
after all, i think i found the cause. When using the nightly builds,
custom (non-html) tags are stripped by the TagSoup lib - TagSoup prepares the htmlarea content before clean-html.xsl jumps in. So, after TagSoup had removed any custom tags, a modified clean-html.xsl can't help any more. To tell TagSoup to ignore custom tags, it seems to be sufficient to comment out line 294 of src/java/org/orbeon/oxf/xforms/XFormsUtils.java [1], or to set the Feature to false: xmlReader.setFeature(org.ccil.cowan.tagsoup.Parser.ignoreBogonsFeature, true); At first i thougth that this line would make TagSoup ignore "bogons" [2], but it seems that is does the opposite! After removing that line or setting ignoreBogonsFeature to false, TagSoup behaves as if it was called from the command line, where it suppresses unknown elements only if the option --nobogons is explicitly set. Maybe that feature should generally be set to 'false'. So, TagSoup just creates valid html including any unknown tags, and it's solely the task of clean-html.xsl to decide which tags should be allowed in the editor output. florian [1] http://github.com/orbeon/orbeon-forms/blob/master/src/java/org/orbeon/oxf/xforms/XFormsUtils.java [2] http://home.ccil.org/~cowan/XML/tagsoup/#properties -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
In reply to this post by fl.schmitt(ops-users)
Florian,
> ok, i found a way to add a working custom button to insert a custom > (non-html) element in the htmlarea and get it displayed using css :jumping: > (btw - could i get a wiki account so i could write a short text about the > solution?). Send me the email address you want to use and I will add you to the wiki. > But when putting the editor content into my xforms instance, the > custom tag seems to be stripped (checked using instance explorer) :-((. I'm > using a modified clean-html.xsl containing my custom element, but that > didn't help. > > In the YUI forums, i got the info that the rte doesn't strip unknown > elements, so now i need a way to debug what's going on when the editor > content is sent to the server. Is there a way to debug the input/oputput of > the clean-html.xsl transformation? In your oxf.xforms.logging.debug, add the "control" token to the value, and the before/after values will be logged. -Erik -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Erik,
> Send me the email address you want to use and I will add you to the wiki. please use this address: [hidden email] > In your oxf.xforms.logging.debug, add the "control" token to the > value, and the before/after values will be logged. thanks - i found it already myself (still have to get familiar with the documentation split between the main site and the wiki), and it became apparent that TagSoup was responsible for stripping the unknown elements. Concerning TagSoup, i think it's a bug that unknown tags are suppressed instead of ignored when ignoreBogonsFeature is true, but i didn't get an answer yet on the TagSoup google group. I will report if there are any news. florian -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
>> Send me the email address you want to use and I will add you to the wiki.
> > please use this address: [hidden email] You now now been added as a collaborator. >> In your oxf.xforms.logging.debug, add the "control" token to the >> value, and the before/after values will be logged. > > thanks - i found it already myself (still have to get familiar with the > documentation split between the main site and the wiki), and it became > apparent that TagSoup was responsible for stripping the unknown > elements. Concerning TagSoup, i think it's a bug that unknown tags are > suppressed instead of ignored when ignoreBogonsFeature is true, but i > didn't get an answer yet on the TagSoup google group. I will report if > there are any news. -Erik -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Could someone possible provide the updated orbeon.war with the tagsoup allowing unknown xml elements? I attempted to package up a new jar file but I get an error when it is deployed in tomcat. Or maybe detailed instructions on the steps you take to get the downloaded unmodified orbeon.war to be modified to allow xml elements in RTE. I see this is not done on the wiki yet.
What I am doing is creating a template within the RTE and placing XML elements for users to enter in required fields. This works, but whenever the user wants to bold some text within the RTE, as soon as the focus is set off the RTE, the bold font style goes away? I am hoping that this thread will resolve that issue. Thank you. |
Brian,
> Could someone possible provide the updated orbeon.war with the tagsoup > allowing unknown xml elements? I attempted to package up a new jar file but > I get an error when it is deployed in tomcat. Or maybe detailed > instructions on the steps you take to get the downloaded unmodified > orbeon.war to be modified to allow xml elements in RTE. I see this is not > done on the wiki yet. shortly after i started to create that wiki page, a mozilla update caused major changes regarding the insertHtml function i proposed to use. Now, firefox removes non-html elements from content that's passed to the insertHtml function. So, modifying the YUI RTE as proposed has no benefit for me any more, and any solution would be browser-specific. So i stopped with that wiki page half the way. How to continue depends on how the mozilla developers handle the issue. It seems that non-HTML elements will stay invalid and get stripped when using insertHtml... Regarding the TagSoup lib, i'm not sure about the cause of the problem. What's the error message? Did you test the modified jar separately? With line 962 of Parser.java commented out, the --nobogons option should have no effect any more. This should render the ignoreBogonsFeature=true noneffective, so TagSoup should simply sanitize malformed xml, without stripping any unknown tags. > What I am doing is creating a template within the RTE and placing XML > elements for users to enter in required fields. This works, but whenever > the user wants to bold some text within the RTE, as soon as the focus is set > off the RTE, the bold font style goes away? hmm - not clear to me - the bold style is using html, i suppose, so TagSoup shouldn't modify the content at all. As long as you don't update your xforms instance, tagsoup shouldn't catch sight of the editor content, so i doubt that tagsoup is the cuplrit in this case. HTH florian -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Is there anyway to disable tidy? I do not want to loose my xml tags I place within the textarea reference that as use for templates. Everything is fine until you update the textarea and then any escaped tags get deleted. If you do not escape the xml tags, then you can not update the textarea styling. I have seen other sites that use an RTE preloaded with text and formatted. And then controls that users enter in text and the template is populated in the correct locations while at the same time allowing users to edit the style and text content. Similiar to this -
http://www.whichdraft.com/amendments/amendment.html Anyway to do this in Orbeon with YUI?
Brian Steuhl home office: 732-961-3187 From: Florian Schmitt <[hidden email]> To: [hidden email] Sent: Fri, September 24, 2010 10:23:34 AM Subject: [ops-users] Re: Re: Re: Re: Re: YUI RTE Customisation Brian, > Could someone possible provide the updated orbeon.war with the tagsoup > allowing unknown xml elements? I attempted to package up a new jar file but > I get an error when it is deployed in tomcat. Or maybe detailed > instructions on the steps you take to get the downloaded unmodified > orbeon.war to be modified to allow xml elements in RTE. I see this is not > done on the wiki yet. shortly after i started to create that wiki page, a mozilla update caused major changes regarding the insertHtml function i proposed to use. Now, firefox removes non-html elements from content that's passed to the insertHtml function. So, modifying the YUI RTE as proposed has no benefit for me any more, and any solution would be browser-specific. So i stopped with that wiki page half the way. How to continue depends on how the mozilla developers handle the issue. It seems that non-HTML elements will stay invalid and get stripped when using insertHtml... Regarding the TagSoup lib, i'm not sure about the cause of the problem. What's the error message? Did you test the modified jar separately? With line 962 of Parser.java commented out, the --nobogons option should have no effect any more. This should render the ignoreBogonsFeature=true noneffective, so TagSoup should simply sanitize malformed xml, without stripping any unknown tags. > What I am doing is creating a template within the RTE and placing XML > elements for users to enter in required fields. This works, but whenever > the user wants to bold some text within the RTE, as soon as the focus is set > off the RTE, the bold font style goes away? hmm - not clear to me - the bold style is using html, i suppose, so TagSoup shouldn't modify the content at all. As long as you don't update your xforms instance, tagsoup shouldn't catch sight of the editor content, so i doubt that tagsoup is the cuplrit in this case. HTH florian -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
I modified the clean-html.xsl to include a tag just to test. This allowed the tag to remain, but I am still not able to format any other text with this tag in the reference. I am assuming it has something to do with XFormsUtils.class. I decompiled and set attribute bogons to false but I am not able to comppile because I do not have the locations of all the class files which are icnluded on the imports I am assuming.
So, little further but still stuck. Appreciate the help. Thanks. |
Brian,
> I am assuming it has something to do with XFormsUtils.class. I > decompiled and set attribute bogons to false but I am not able to > comppile because I do not have the locations of all the class files > which are icnluded on the imports I am assuming. there's no need to decompile the class files - just grab the sources at github, extract them and select "open project" in IntelliJ [1]. Then, one click should be sufficient to build all parts and create a WAR structure (using the orbeon-war target). Both the TagSoup and Tidy (BTW: the jtidy lib shipped with Orbeon seems very old) config options are hard-coded in XFormsUtils.java. Changing the TagSoup options (especially the ignoreBogonsFeature) maybe woulnd't be sufficient, because the content of a xforms:output with mediatyp="text/html" gets cleaned up by JTidy. So even if custom tags have reached the instance, they won't get displayed in an xforms:output (i suppose that was the cause for the disappearance of the canvas element, too). At least Tidy allows external configuration using setConfigurationFromFile() or setConfigurationFromProps - so Tidy should be easily configurable without recompiling XFormsUtils if one of those config alternatives is implemented. Doesn anyone know how to reference a file in, e.g., WEB-INF/resources/config for usage in setConfigurationFromFile()? This way, setting the new-inline-tags or new-empty-tags options should make tidy accept custom tags. HTH florian [1] http://wiki.orbeon.com/forms/doc/contributor-guide/development-environment/java-development -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |