how can I use 'smart paste' from the TEI framework in anothe

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Ron Van den Branden
Posts: 65
Joined: Fri Jan 18, 2008 5:54 pm

how can I use 'smart paste' from the TEI framework in anothe

Post by Ron Van den Branden »

Hi,

I'm developing an Oxygen project dealing with TEI conformant documents and would like to offer my users 'smart paste' functionality in Author mode. I had noticed that 'smart paste' didn't work out-of-the-box, and is apparently a feature that has to be catered for by the framework (see http://www.oxygenxml.com/forum/topic10060.html). I've totally no Java skills, but since we're producing TEI P5 files, the feature is available in the TEI framework, and that framework is shipped with Oxygen, I decided I might as well just try and borrow the relevant code from there.

I have tried to copy what I thought were relevant items from the TEI framework (I'll attach screenshots from the Oxygen "Preferences" menu):
  • set the classpath to:
    • ${frameworks}/tei/tei.jar
    • ${frameworks}/tei/resources/
    • ${frameworks}/tei/i18n/
    Image
  • -selecting the TEIP5ExtensionsBundle in the "Extensions" tab
Image

This seems to work only partially: when images are dragged into a document, they are now successfully converted to TEI <graphic> elements. Yet, styling information (bold, italics,...) from Word documents is not preserved when pasting.

I've tested by pasting the same test Word fragment into a TEI file (using the TEI framework), which does preserve the styling information, though. Apparently I'm missing something: perhaps a stylesheet is not correctly applied?

What should I do to make full use of the TEI framework's smart paste feature in another Oxygen project?

Best,

Ron
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: how can I use 'smart paste' from the TEI framework in an

Post by alex_jitianu »

Hello,

From what you've described I expect the Paste to work. TEIP5ExtensionsBundle creates the handler for both URL DnD and smart paste (TEIP5ExternalObjectInsertionHandler). This handler looks for xhtml2tei5Driver.xsl inside classpath. I see that you've added ${frameworks}/tei/resources/ in the classpath. Is there a xhtml2tei5Driver.xsl on disk, in the resources folder?

If this missing resource is not the cause then perhaps you can send us the framework on support@oxygenxml.com so that we can get a closer look at it. To do that you should change the storage type to External (in the Document Type Dialog). Sending the *.framework file should do since in it you are referring resources from the built-in TEI framework.

Best regards,
Alex
Ron Van den Branden
Posts: 65
Joined: Fri Jan 18, 2008 5:54 pm

Re: how can I use 'smart paste' from the TEI framework in an

Post by Ron Van den Branden »

Hi Alex,

Thanks for the confirmation: I've double checked, and all files are in place. Even better, on closer investigation, I can confirm the 'smart paste' does work as it should!

I seem to have been misled by some specific display options in the Author Mode for the project I'm working on: the display of tags has been disabled in the author CSS (-oxy-display-tags: none;), and for some reason <hi> elements weren't highlighted in the Author CSS. As a result, the <hi> elements were present, but not highlighted in the Author view at all, which made me suspect they weren't there.

Apologies for the red herring; this 'll teach me to look at the source XML before shouting!

Best,

Ron
Post Reply