Hi Asiri,
On Sun, Jan 25, 2009 at 8:24 PM, Asiri Rathnayake <
asiri.rathnayake(a)gmail.com> wrote:
Hi Anca,
You don't necessarily have to have your own servlet for this, you could
attach
it to a wiki document, by posting to the "upload" action for the wiki
document,
with the appropriate field names. I'm doing this in the image plugin with
the
FileUploadForm.
You could even have your own action to post to, similar to the "upload"
only
that it would invoke the importer plugin for the uploaded file and send
back the
results, although I'm not really sure this is a good idea, as actions are
quite
a core part of the wiki, and whose changing requires changes deep down
(need to
write your action and have it on the server, need to map it in the
actions
mapping file). Your servlet would require web.xml
mapping too, so maybe
it's
quite the same.
Or, in order to get the output back you can:
1. upload the file to the current document and, when the upload call
returns,
make a second call to the WywisygService to import the uploaded file and
send
back (x)html.
2. upload the file to an office importer special document, transform it
and
return it with the upload action result (I need
to digg more on this to
see
how
exactly would it be done). This solution would be hard to mix with the
uploaded
images in the file, as they won't be attached to the correct wiki
document
upon
save, you'd need to move them.
Of course, you could also use solution 1. with a special OfficeImporter
document
as a repository for all files uploaded which need to be imported.
Thanks for the idea :) We could do,
1. Upload the document into XWiki.OfficeImporter (The repository)
2. Have a GWT rpc call such as;
String importDocument(String fileName, String targetPage);
Here the fileName is the name of the attachment just added to
XWiki.OfficeImporter and targetPage would be the name of the current wiki
page being edited.
As you said, the attached document itself can be deleted when the import is
complete. (+ need to workaround name collisions with multiple users, but
that's not a big issue IMO).
Or you could just leave them there (could you?), as we do for all edit
situations, as I mentioned.
Hmmmm, yes that's possible too. I was wondering if it's not that nice.
I agree with Anca here. In usual edit situations, the user attachs files and
images to the page then chooses whether or not to display them. In many
cases the images stay attached to the pages even when not directly displayed
to take advantage of the storage facility itself. Therefore, keeping the
images added during the Office document import is not a problem. If the
users really wants them off, he can delete the attachments afterwards.
If there are a lot of images to delete that will take the user some time -
but that's an issue with how we handle page attachments management (we could
add checkboxes for instance), not with the office import part itself. So I
really think you can leave the attachments where they are once uploaded.
Another thing I've been wondering about: should we keep a copy of the
original office document attached to the wiki page it has been converted to?
It could be useful in some cases, when using a wiki page as a displayer for
a document that can be edited through webdav in its original format and
displayed on a wiki page for quick view... But maybe that makes more sense
for presentations than for Word documents. [I know this is akin to thread
hijacking - please move this part in another thread if planning a lengthy
answer ;-)]
Guillaume
Let's see if others agree.
Thanks.
- Asiri
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs