Hi Wang,
On Jun 4, 2008, at 7:04 PM, Wang Ning wrote:
Hi,
I have built a standalone plugin to convert MS Doc, MS excel to html.
cool :)
This
plugin can run as a jar through command line or as a web application
through
url.
What do you mean by plugin? Do you mean xwiki plugin (probably not)?
You need to find out and propose how to integrate the import feature
into xwiki both in term of UI and in term of code. The best right now
is probably to add a button in the tiny MCE editor.
Next, how to convert the html to xwiki syntax
document? use xslt? Do
the new
rendering code have any influence?
I think we can do it in 2 steps:
Step 1: get clean HTML. Since XWiki is able to display HTML it should
work fine. This also means that the imported doc will be edited
through the WYSIWYG editor (tinyMCE)
Step 2: convert the HTML into wiki syntax wherever possible. This is
indeed a job for the new rendering module and you'll need to write an
HTML Parser (i.e. implementing the org.xwiki.rendernig.Parser
interface). You should have a look at the 2 existing parsers:
WikiModelXWikiParser and DoxiaConfluenceParser. In this case though
you should use an XML parser to parse the XHTML instead of wiki model
or doxia. Thus it's important that in step 1 you get clean XHTML
(probably run JTidy on it).
Now I can't handle the clipboard format. I think clipboard is at the
second
priority.
My another question: how to add my code to xwiki code sandbox? Do I
need to
build ,test and distrubut my plugin by maven way? If yes, please
tell how.
You need to follow all the coding conventions and best practices
described at
dev.xwiki.org
You need to provide a maven build yes. Plenty of examples in the xwiki
source tree.
The best is maybe that you package your code as a xwiki plugin for
now. check xwiki-platform-plugins for examples of plugin and how they
are packaged/built.
Thanks
-Vincent