r676 - branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst
Author: jpages Date: 2012-05-25 12:03:29 +0200 (Fri, 25 May 2012) New Revision: 676 Url: http://nuiton.org/repositories/revision/jrst/676 Log: Completed JRST javadoc. Modified: branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java Modified: branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java =================================================================== --- branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java 2012-05-25 09:30:55 UTC (rev 675) +++ branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java 2012-05-25 10:03:29 UTC (rev 676) @@ -42,6 +42,8 @@ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.TransformerException; + +import org.apache.commons.io.FileUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.dom4j.Document; @@ -52,7 +54,6 @@ import org.nuiton.jrst.convertisor.DocUtils2RST; import org.nuiton.jrst.convertisor.DocUtilsVisitor; import org.nuiton.util.ApplicationConfig; -import org.nuiton.util.FileUtil; import org.nuiton.util.Resource; import org.nuiton.util.StringUtil; import org.python.util.PythonInterpreter; @@ -192,14 +193,6 @@ } - static public String getMimeType(String generationType) { - String result = mimeType.get(generationType); - if (result == null) { - result = "application/octet-stream"; - } - return result; - } - /** * Main method. * @@ -285,8 +278,8 @@ File fileOut, Overwrite overwrite) throws Exception { if (fileOut != null && fileOut.exists() - && (overwrite == Overwrite.NEVER || (overwrite == Overwrite.IFNEWER && FileUtil - .isNewer(fileIn, fileOut)))) { + && (overwrite == Overwrite.NEVER || (overwrite == Overwrite.IFNEWER && FileUtils + .isFileNewer(fileIn, fileOut)))) { log.info("Don't generate file " + fileOut + ", because already exists"); @@ -308,11 +301,10 @@ } /** - * TODO ! + * Transforms a restructured text file to a XML file using Jython interpreter to execute DocUtils scripts. * - * - * @param in - * @return + * @param in Input restructured text file (.rst) + * @return A document which contains XML code * @throws Exception */ public static Document generateDocutils(File in) throws Exception { @@ -377,11 +369,11 @@ } /** - * TODO ! + * Applies XSL stylesheet(s) to a XML document * - * @param doc - * @param xslListOrOutType - * @return + * @param doc A document which contains XML code + * @param xslListOrOutType String which describes transformations to apply to the XML document + * @return A document which contains XML transformed by XSL stylesheets * @throws IOException * @throws TransformerException */ @@ -419,10 +411,10 @@ } /** - * TODO ! + * Writes the XML content generated in a file * - * @param doc - * @param fileOut + * @param doc Document which contains XML code + * @param fileOut Output file * @throws IOException */ public static void generateFile(Document doc, File fileOut) throws IOException { @@ -448,11 +440,11 @@ } /** - * TODO ! + * Generates PDF file with IText with an HTML document * - * @param result - * @param fileIn - * @param fileOut + * @param result Document which contains HTML code + * @param fileIn ReST file used to build resources path + * @param fileOut PDF Output file * @throws Exception */ public static void generatePdf(Document result, File fileIn, File fileOut) throws Exception {
participants (1)
-
jpages@users.nuiton.org