Hi Devs,
As reported @
http://jira.xwiki.org/jira/browse/XWIKI-3288 and
http://jira.xwiki.org/jira/browse/XAOFFICE-10, OfficeImporter wysiwyg plugin
has issues with importing some documents on some platforms.
When importing documents from the wysiwyg plugin, the approach we follow is
to upload the file that need to be imported into the current page and then
import the corresponding attachment. But this scheme has two problems:
1) If the file being uploaded contains special characters, the attachment
name will be different from the file name. And this will cause the
officeimporter to fail because after uploading the file we will be making a
second request to import the attachment with the original file name (but now
there is no such attachment).
2) The fileName returned by GWT FileUpload widget is different from Firefox
to IE. While Firefox returns the file name, IE returns the whole file path.
This causes the officeimporter wysiwyg plugin to fail completely under IE
(File Import Tab only).
The solution I can see is the following,
1) Upload the file as an attachment just as before.
2) Make a second rpc call. This RPC call will import the latest attachment
to the current page by the current user. This way we don't need to worry
about crappy file names and browser specific stuff.
I know it's a bit ugly but it will work.
WDYT?
Thanks.