The plugin uses the Java Excel API
to export a Microsoft Excel spreadsheet into an XML file of the following format:
<workbook>
<sheet>
<row>
<column>cell data</column>
</row>
</sheet>
</workbook>
The file is stored in the same location as the source spreadsheet and only regenerated if modified. A XSLT is then applied to the exported XML to generate the tabbed HTML view.
Installation #
- ~Copy the attached class file into (The source is also attached if you are interested)
<jspwiki>/WEB-INF/classes/com/valtech/wiki/excel
- ~Copy the attached XSL file to your JSPWiki root
- ~Download the Excel Java API from http://www.andykhan.com/jexcelapi/download.html
(tested with version 2.5.4). Copy the jxl.jar from the distribution to your <jspwiki>/WEB-INF/lib directory
- ~Download Xalan from http://www.apache.org/dist/xml/xalan-j/
. Copy serializer.jar, xalan.jar, xml-apis.jar and xercesImpl.jar from the distribution to your <jspwiki>/WEB-INF/lib directory.
Usage#
The following is an example usage for the plugin:[{INSERT com.valtech.wiki.excel.ViewerPlugin excel='D:/temp/test.xls'}]
Plugin insertion failed: Could not find plugin com.valtech.wiki.excel.ViewerPluginPlugin insertion failed: Could not find plugin com.valtech.wiki.excel.ViewerPlugin
Note, the path to the spreadsheet must be absolute. Feel free to change the plugin if you require it to work with URLs or make tea.
-- 5/11/04 NT
:
If you have problems getting it to work (running on JBoss), you may have to do two things:
- Hardcode variable "root" to the full pathname of the JspWiki root location.
- transformer.setParameter cannot handle null parameters, so must handle it to send "", instead. (-- 06/22/04 I have updated the attached class to send "" instead of null -mashooq-)
Thanks for all your help, Mashooq!
I have some interest in using this plugin.. but the whole hardcoded path thing is a real pain... I was hoping to be able to attach an spreadsheet to a page .. then be able to view it via the plugin.
Is there any other interest in getting this feature changed??
Take a look at ExcelToHTMLPlugin - I contributed this a couple of years ago, not sure why it doesn't show up under ContributedPlugins ... Anyway, it does handle attachments.
is there a Word version of this plugin available?
--AnonymousCoward, 11-Dec-2006
Add new attachment
List of attachments
| Kind | Attachment Name | Size | Version | Date Modified | Author | Change note |
|---|---|---|---|---|---|---|
xsl |
ToHTML.xsl | 5.8 kB | 1 | 26-Apr-2005 21:55 | MashooqBadar | |
class |
ViewerPlugin.class | 5.2 kB | 2 | 22-Jun-2005 17:23 | MashooqBadar | |
java |
ViewerPlugin.java | 4.9 kB | 2 | 22-Jun-2005 17:23 | MashooqBadar |