Smart copy-paste

gwhite
Posts: 70

Smart copy-paste

Fri Jun 05, 2015 9:19 pm

When I try to do smart paste from an Excel file into a concept topic in Oxygen Author, the copied table cells just go in as plain text. What is the secret to doing smart copy/paste of table cells as demonstrated in http://www.oxygenxml.com/demo/Smart_Pas ... ments.html? I haven't made any modifications to preferences which should affect this behavior.

Our use case is actually to copy two columns of Excel data into an unordered list in DITA. In fact it would be only "half-smart," as for each row we want the two columns to collapse into a single list item. Is this possible? For example, could we use refactoring to accomplish this?

Gary
Costin
Posts: 273

Re: Smart copy-paste

Fri Jun 05, 2015 9:46 pm

Hello,

Could you please let us know what specific version and build of oXygen XML Author are you using?

You can find this information in the oXygen's menu Help > About.

Best Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
gwhite
Posts: 70

Re: Smart copy-paste

Fri Jun 05, 2015 10:39 pm

Using Oxygen Author 17.0.

Ah! Out of curiosity I just tried the smart paste in 16.1 and it worked as expected.

Gary
gwhite
Posts: 70

Re: Smart copy-paste

Fri Jun 05, 2015 10:40 pm

Sorry, that's <oXygen/> XML Author 17.0, build 2015043018.
Costin
Posts: 273

Re: Smart copy-paste

Mon Jun 08, 2015 11:26 am

Hi,

We have tested the Smart Paste behavior for both v16 and v17 versions and it works as it should, in both of them.
Do you recall to have created any custom Document Type Association (framework)?

If you did, you should try performing Smart Paste, using the default DITA Document Type Association in oXygen and see if this changes anything.

For that, first go into the oXygen menu Options > Preferences > Document Type Association > Location and make sure you have the Default location selected for the frameworks folder in the oXygen installation, not a custom one.
Then, back to the > Document Type Association page, check if you have the default "DITA" document type selected; if you don't please enable it.

Restart oXygen and retry copy-pasting content in Author mode.

If the Smart Paste feature works find with the default DITA document type predefined in oXygen, that would mean the issue is related to some custom framework you might have created, so you should double check its configuration and especially the presence of the "ro.sync.ecss.extensions.dita.DITAExtensionsBundle" in the "Extensions bundle" field under the "Extensions" tab in the configuration dialog for the appropriate custom document type association you have configured.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
sorin_ristache
Posts: 4144

Re: Smart copy-paste

Mon Jun 08, 2015 11:54 am

Hi,

gwhite wrote:Using Oxygen Author 17.0.

Ah! Out of curiosity I just tried the smart paste in 16.1 and it worked as expected.


What is the name and version number of the application on the Mac OS X machine where you performed the Copy action? Was it Microsoft Office for Mac?

In what Java version was the Oxygen application running? You can see the Java version in the Oxygen application by going to menu Oxygen XML Author -> About Oxygen XML Author -- the System Properties tab -- the java.runtime.version property.

We need these details in order to reproduce and fix the problem.

Oxygen 17 can run in a Java 6 virtual machine or in a Java 8 one as you can read on the Download page. The Java 8 virtual machine has some known problems with accessing the OS X system clipboard. The Mac app where you performed the Copy action should place the copied content in the OS X system clipboard, and the Oxygen application will fetch it from there.
Regards,
Sorin

<oXygen/> XML Editor Support
sorin_ristache
Posts: 4144

Re: Smart copy-paste

Mon Jun 08, 2015 11:57 am

gwhite wrote:Our use case is actually to copy two columns of Excel data into an unordered list in DITA. In fact it would be only "half-smart," as for each row we want the two columns to collapse into a single list item. Is this possible? For example, could we use refactoring to accomplish this?


Do you mean an XML Refactoring action? You would need to develop your own custom XML Refactoring script.

I suggest writing a short XSLT stylesheet to transform the table to a list and run it on the result of the Smart Paste action.
Regards,
Sorin

<oXygen/> XML Editor Support
gwhite
Posts: 70

Re: Smart copy-paste

Mon Jun 08, 2015 6:30 pm

This was on a Windows 7 machine, not OSX. The java runtime version is 1.8.0_40-b25.

I do have two extensions -- one that creates a table with different characteristics from the default created from the toolbar -- and one that is the extension for the Dynamic Information Model functionality you guys made available on github. I think the latter is the only difference between my Oxygen 16.1 and Oxygen 17.0 setups--the DITA DIM extension; it's not present in 16.1 (and Smart Paste works in 16.1). Well, also in 16.1, Additional frameworks directories under Document Type Association > Locations specifies ${frameworksDir}/dita-ext. That's different. For 17.0, the additional framework directory is specified as ${pd}/frameworks.

The Priority for both extensions is Normal, whereas the Priority for the DITA document type is Low. Don't know if that's a problem.

Gary
sorin_ristache
Posts: 4144

Re: Smart copy-paste

Mon Jun 08, 2015 6:38 pm

gwhite wrote:The Priority for both extensions is Normal, whereas the Priority for the DITA document type is Low. Don't know if that's a problem.


This is probably the cause of the problem. The document types that were added probably have no Smart Paste handler. In order to check this, please switch the DITA document type of Oxygen (the built-in DITA document type that comes int he Oxygen install kit) to High, re-open the DITA topic and try again the Smart Paste feature.
Regards,
Sorin

<oXygen/> XML Editor Support
gwhite
Posts: 70

Re: Smart copy-paste

Mon Jun 08, 2015 9:17 pm

This didn't actually work, Sorin. Changed the DITA document type Priority to High, saved, then restarted oXygen and tried Smart Paste. No luck.

Gary
sorin_ristache
Posts: 4144

Re: Smart copy-paste

Wed Jun 10, 2015 10:00 am

gwhite wrote:This didn't actually work, Sorin. Changed the DITA document type Priority to High, saved, then restarted oXygen and tried Smart Paste. No luck.


I figured it out eventually: Microsoft Excel places badly formatted content in the Windows system clipboard, which can't be parsed as a well-formatted table by other clipboard consuming applications like Oxygen.

I have a workaround for you: first paste the table in Microsoft Word (or other Word-compatible application, like OpenOffice Writer or LibreOffice Writer), and after that copy the table from the Word application and paste it to Oxygen Author mode. It requires an extra copy & paste operation, but it works :)
Regards,
Sorin

<oXygen/> XML Editor Support
gwhite
Posts: 70

Re: Smart copy-paste

Wed Jun 10, 2015 4:21 pm

We will use that workaround in Author 17.0. It is strange, though, that the problem doesn't occur in Author 16.1.

Gary
sorin_ristache
Posts: 4144

Re: Smart copy-paste

Wed Jun 10, 2015 4:41 pm

Oxygen 16.1 comes with a Java 1.7 virtual machine, while Oxygen 17.0 comes with a Java 1.8 one, which is not as able as the JVM 1.7 to extract correctly the clipboard content placed by the Excel application. So it is strange only in the sense that JVM 1.8 from Oracle has this unexpected regression (as compared with JVM 1.7) w.r.t. the handling of the Windows system clipboard.

That offers you another workaround: replace the default Windows JVM 1.8 from the OXYGEN_17_INSTALL_DIR/jre directory with a JVM 1.7 one.
Regards,
Sorin

<oXygen/> XML Editor Support
Eddie
Posts: 89

Re: Smart copy-paste

Thu Aug 06, 2015 5:37 am

Hello,

We also noticed this problem.
Will you be doing anything to fix it in subsequent versions, or does it depend on Oracle making changes to the Java VM?

Cheers,
Eddie
Radu
Posts: 5208

Re: Smart copy-paste

Thu Aug 06, 2015 8:19 am

Hi Eddie,

Could you try to download the latest Oxygen 17 kit from our web site, install it and try to reproduce the problem?
One of our minor bug fix releases contained a possible fix for your problem:

http://www.oxygenxml.com/rssBuildID.xml

Author/Smart Paste: Copying table data from MS Excel and pasting it in the Author mode did not generate a table structure.


Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Eddie
Posts: 89

Re: Smart copy-paste

Thu Aug 06, 2015 9:20 am

Thanks Radu,

I tried that with a simple sample table and it worked.
Great response!

Cheers,
Eddie.
gwhite
Posts: 70

Re: Smart copy-paste

Thu Aug 06, 2015 5:48 pm

Within the past few days, running the latest version of Oxygen with no reversion to the previous JRE, I have noticed that when I copy-paste content from MS Word the formatting is retained, including table data. Just now tried with Excel and it works as expected.

Seems to be fixed!

Gary
Radu
Posts: 5208

Re: Smart copy-paste

Fri Aug 07, 2015 7:57 am

Hi Gary,

Right, we found a fix for this issue in our own code.
Thanks for confirming it.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 3 guests