[oXygen-user] Applet Configuration and Extension: MathML, Office Cut and Paste

Oxygen XML Editor Support support at oxygenxml.com
Mon Mar 11 09:43:46 CDT 2013


Hi Eliot,

It seems that when using Java 1.7 on Mac both the web component and the 
standalone application cannot find anymore in the system clipboard the 
HTML flavor. This is an already Java 1.7 registered bug (and will be 
fixed in Java 1.8):

http://bugs.sun.com/view_bug.do?bug_id=8005932

But we found a workaround which seemed to be working on our side.
In the Author Component Sample Project on the applet's init() method:

ro.sync.ecss.samples.AuthorComponentSampleApplet.init()

after this line of code:

System.setSecurityManager(null);

you can add:

> try {
>   if (System.getProperty("os.name").toUpperCase().startsWith("MAC OS")) {
>     if(
>         //And Java 1.7
>         System.getProperty("java.version").compareTo("1.7") >= 0
>         && System.getProperty("java.version").compareTo("1.8") < 0) {
>       SystemFlavorMap map = (SystemFlavorMap) SystemFlavorMap.getDefaultFlavorMap();
>       Method pands = SystemFlavorMap.class.getDeclaredMethod("parseAndStoreReader", new Class[]{BufferedReader.class});
>       pands.setAccessible(true);
>       pands.invoke(map, new Object[]{new BufferedReader(
>           new StringReader("RICH_TEXT=text/rtf\n" +
>               "HTML=text/html;charset=utf-8;eoln=\"\\r\\n\";terminators=1"))});
>     }
>   }
> } catch (Throwable e) {
>   e.printStackTrace();
> }

Then you should re-build your applet and re-test running it in the browser.
I'm also attaching the fix code as an utility class.

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 3/8/2013 4:28 PM, Eliot Kimber wrote:
> Yes, VM under VMWare running Win XP.
>
> Cheers,
>
> E.
>
> On 3/8/13 9:22 AM, "Oxygen XML Editor Support" <support at oxygenxml.com>
> wrote:
>
>> Hi Eliot,
>>
>> Indeed on a MAC special paste between the external application and the
>> applet does not work, we'll look into this, but most probably there is
>> some security limitation which does not allow the applet full access to
>> the clipboard content (we look for the HTML content there).
>> I will be back with more details.
>>
>>> I also tested under Windows and got the same result.
>>
>> I originally tested this on my Windows 7 computer (pasting from
>> LibreOffice Calc to the online demo applet) and it worked for me, a
>> table was pasted. Did you test with a Windows VM running on MAC?
>>
>> Regards,
>> Radu
>>
>> Radu Coravu
>> <oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
>> http://www.oxygenxml.com
>>
>> On 3/8/2013 3:58 PM, Eliot Kimber wrote:
>>> I just get the text. I tried the demo applet and got the same result. This
>>> is using FF 19.0.2 on OSX using Java 7.
>>>
>>> I could only get the applet to run from FF--Safari says plugin not available
>>> and Chrome says it doesn't support Java 7--not sure what's going on there.
>>>
>>> I also tested under Windows and got the same result.
>>>
>>> Cheers,
>>>
>>> E.
>>>
>>> On 3/8/13 1:59 AM, "Oxygen XML Editor Support" <support at oxygenxml.com>
>>> wrote:
>>>
>>>> Hi Eliot,
>>>>
>>>> When pasting do you get an error or is the text pasted as it is, without
>>>> any formatting?
>>>>
>>>> Let's try this test:
>>>> We have an online demo of the applet here:
>>>>
>>>> http://www.oxygenxml.com/demo/AuthorDemoApplet/author-component-dita.html
>>>>
>>>> If you paste in it content from Excel does it create a DITA table for it?
>>>>
>>>> Are you running the applet in Firefox or in Safari?
>>>>
>>>> Regards,
>>>> Radu
>>>>
>>>> Radu Coravu
>>>> <oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
>>>> http://www.oxygenxml.com
>>>>
>>>> On 3/7/2013 4:48 PM, Eliot Kimber wrote:
>>>>> Hmm,
>>>>>
>>>>> Looking at my applet jar, I have this entry:
>>>>>
>>>>>      <jar href="lib/nekohtml.jar"/>
>>>>>
>>>>> And I verified that the jar is in our plugin jar.
>>>>>
>>>>> So I think it should have worked. I assume this must still be a
>>>>> configuration issue on my end: any guidance on how I might debug it?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> E.
>>>>>
>>>>>
>>>>> On 3/7/13 1:28 AM, "Oxygen XML Editor Support" <support at oxygenxml.com>
>>>>> wrote:
>>>>>
>>>>>> Hi Eliot,
>>>>>>
>>>>>> In addition to what George said, you have to make sure the applet you
>>>>>> are deploying has in its libraries list a library called "nekohtml.jar"
>>>>>> (the Author Component Sample Project from our web site comes with it).
>>>>>> That library is used in the paste process to transform the HTML
>>>>>> clipboard content to XHTML and if missing the paste will be made as
>>>>>> simple text content.
>>>>>>
>>>>>> Regards,
>>>>>> Radu
>>>>>>
>>>>>> Radu Coravu
>>>>>> <oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
>>>>>> http://www.oxygenxml.com
>>>>>>
>>>>>> On 3/6/2013 10:26 PM, George Cristian Bina wrote:
>>>>>>> Hi Eliot,
>>>>>>>
>>>>>>> Enabling the MathML editing support for the Author Component is
>>>>>>> described here
>>>>>>> http://www.oxygenxml.com/doc/ug-editor/#topics/mathml_support.html
>>>>>>> Both the built in editing
>>>>>>>
> http://www.oxygenxml.com/doc/ug-editor/#topics/mathml_support_jeuclid.htm>>>>>>
> l
>>>>>>> and the MathFlow integration
>>>>>>> http://www.oxygenxml.com/doc/ug-editor/#topics/mathml_support_mathflow.ht
>>>>>>> ml
>>>>>>> are supported.
>>>>>>>
>>>>>>> The smart paste is configured per framework and the DITA, DocBook, TEI
>>>>>>> frameworks already have this support. If you use DITA you just need to
>>>>>>> pack the DITA framework with the Author Component. Do you want to add
>>>>>>> this for another XML language?
>>>>>>>
>>>>>>> Best Regards,
>>>>>>> George
>>>>>>> --
>>>>>>> George Cristian Bina
>>>>>>> <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
>>>>>>> http://www.oxygenxml.com
>>>>>>>
>>>>>>> On 3/6/13 7:25 PM, Eliot Kimber wrote:
>>>>>>>> We have our Oxygen applet configured with the out-of-the-box DITA
>>>>>>>> framework
>>>>>>>> and it's working well.
>>>>>>>>
>>>>>>>> However, I would like to enable both MathML equation editing, either
>>>>>>>> using
>>>>>>>> the simple built-in editor or, ideally, the DesignScience graphical
>>>>>>>> editor.
>>>>>>>>
>>>>>>>> I'd also like to be able to cut and paste from Word and Excel the way I
>>>>>>>> can
>>>>>>>> in the standalone editor.
>>>>>>>>
>>>>>>>> What's involved in doing this?
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>> E.
>>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> oXygen-user mailing list
>>>>>>> oXygen-user at oxygenxml.com
>>>>>>> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>>>>>>>
>>>>>> _______________________________________________
>>>>>> oXygen-user mailing list
>>>>>> oXygen-user at oxygenxml.com
>>>>>> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>>>>>
>>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MacUtil.java
Type: text/x-java
Size: 3465 bytes
Desc: not available
Url : http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20130311/f62e115a/attachment.bin 


More information about the oXygen-user mailing list