Pugo - Google Docs Export
This project is part of a paper for my M.CSc at Trier University of Applied Science.
What is it?
A webservice that provides a way of exporting a Google Doc to any XML or Text based format that can be generated with XSLT.
How does it work?
It takes a Google Docs html export file and transforms it into wellformed xhtml that can then be transformed into anything that can be generated with XSLT.
The project uses maven, so the best way to run and compile it is using maven, however it can also easily be imported into Eclipse or Intellij and run from there.
To run locally using maven:
To compile a war:
The compiled war can be deployed on Tomcat 7 and 8
To use send a request to http://server/war_name/convert with the following Parameters:
this does not have to be an URL from docs, the file could come from elsewhere or not even be a docs file at all.
token (optional) = OAuth token for the file if needed for the source URL
fname = filename of the resulting Output
mode (optional) = mode for selecting which transformation to run, by default it does html (when mode parameter is omitted), md for markdown and epub
Additionally any number of Parameters of the form xslParam_<Parameter Name> can be send and will be passed to the XSLT transformation as <Parameter Name>
In the webapp directory are config files of the following form that can be added or adjusted:
<config> <!-- XSLT Stylesheet used for the transformation --> <xsl>html.xsl</xsl> <!-- Extension of Output file --> <outputExt>html</outputExt> <!-- HttpServletResponse.setContentType --> <mimeType>text/html</mimeType> <!-- If true files generated with xsl:result-document will be written to a zip file, standard output will be discarded --> <zipOutput>false</zipOutput> </config>
Additional config files should be named
config_<mode>.xml and can be used using the mode parameter.