Commit 0bc8ba14 authored by Stephan Kreutzer's avatar Stephan Kreutzer

wakelet_to_pdf_1: Recursive download of wakes.

parent 637db242
/* Copyright (C) 2019 Stephan Kreutzer
*
* This file is part of wakelet_downloader_1.
*
* wakelet_downloader_1 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License version 3 or any later version,
* as published by the Free Software Foundation.
*
* wakelet_downloader_1 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License 3 for more details.
*
* You should have received a copy of the GNU Affero General Public License 3
* along with wakelet_downloader_1. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @author Stephan Kreutzer
* @since 2019-08-05
*/
import java.io.File;
public class CardSource
{
public CardSource(int id, File cardFile)
{
this.id = id;
this.cardFile = cardFile;
}
public int GetId()
{
return this.id;
}
public File GetCardFile()
{
return this.cardFile;
}
protected int id;
protected File cardFile;
}
...@@ -13,4 +13,4 @@ ...@@ -13,4 +13,4 @@
# You should have received a copy of the GNU Affero General Public License 3 # You should have received a copy of the GNU Affero General Public License 3
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
java xhtml_to_latex_1 ./output/ ./output_print/ java xhtml_to_latex_1 ./wake/ ./output_print/
...@@ -20,7 +20,7 @@ along with wakelet_downloader_1. If not, see <http://www.gnu.org/licenses/>. ...@@ -20,7 +20,7 @@ along with wakelet_downloader_1. If not, see <http://www.gnu.org/licenses/>.
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/"> <xsl:template match="/">
<xsl:comment> This file was generated by jsonxml_preparation_stylesheet_cards.xsl of wakelet_downloader_1, which is free software licensed under the GNU Affero General Public License 3 or any later version (see https://gitlab.com/publishing-systems/clients/ and http://www.publishing-systems.org). </xsl:comment><xsl:text>&#xA;</xsl:text> <xsl:comment> This file was generated by jsonxml_preparation_stylesheet_wake.xsl of wakelet_downloader_1, which is free software licensed under the GNU Affero General Public License 3 or any later version (see https://gitlab.com/publishing-systems/clients/ and http://www.publishing-systems.org). </xsl:comment><xsl:text>&#xA;</xsl:text>
<wakelet> <wakelet>
<wake> <wake>
<xsl:apply-templates/> <xsl:apply-templates/>
......
...@@ -13,4 +13,4 @@ ...@@ -13,4 +13,4 @@
# You should have received a copy of the GNU Affero General Public License 3 # You should have received a copy of the GNU Affero General Public License 3
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
java wakelet_downloader_1 "https://wakelet.com/wake/013f9ec7-3e37-4dec-9c45-90ca5f1679be" ./output/ java wakelet_downloader_1 "https://wakelet.com/wake/013f9ec7-3e37-4dec-9c45-90ca5f1679be" .
...@@ -27,10 +27,7 @@ xhtml_to_latex_1: xhtml_to_latex_1.class ...@@ -27,10 +27,7 @@ xhtml_to_latex_1: xhtml_to_latex_1.class
CardSource.class: CardSource.java wakelet_downloader_1.class: wakelet_downloader_1.java
javac -encoding UTF-8 CardSource.java
wakelet_downloader_1.class: wakelet_downloader_1.java CardSource.class
javac -encoding UTF-8 wakelet_downloader_1.java javac -encoding UTF-8 wakelet_downloader_1.java
xhtml_to_latex_1.class: xhtml_to_latex_1.java xhtml_to_latex_1.class: xhtml_to_latex_1.java
...@@ -39,4 +36,3 @@ xhtml_to_latex_1.class: xhtml_to_latex_1.java ...@@ -39,4 +36,3 @@ xhtml_to_latex_1.class: xhtml_to_latex_1.java
clean: clean:
rm -f wakelet_downloader_1.class rm -f wakelet_downloader_1.class
rm -f xhtml_to_latex_1.class rm -f xhtml_to_latex_1.class
rm -f CardSource.class
...@@ -413,7 +413,7 @@ public class xhtml_to_latex_1 ...@@ -413,7 +413,7 @@ public class xhtml_to_latex_1
for (int i = 0; i < sourceList.size(); i++) for (int i = 0; i < sourceList.size(); i++)
{ {
File preparedFile = new File(tempDirectory.getAbsolutePath() + File.separator + "xhtml_prepared-" + i + ".xhtml"); File preparedFile = new File(tempDirectory.getAbsolutePath() + File.separator + "xhtml_prepared-" + (i + 1) + ".xhtml");
ProcessBuilder builder = new ProcessBuilder("java", "html_prepare4latex1", sourceList.get(i).getAbsolutePath(), preparedFile.getAbsolutePath()); ProcessBuilder builder = new ProcessBuilder("java", "html_prepare4latex1", sourceList.get(i).getAbsolutePath(), preparedFile.getAbsolutePath());
builder.directory(new File(programPath + "automated_digital_publishing" + File.separator + "latex" + File.separator + "html_prepare4latex1")); builder.directory(new File(programPath + "automated_digital_publishing" + File.separator + "latex" + File.separator + "html_prepare4latex1"));
...@@ -437,7 +437,7 @@ public class xhtml_to_latex_1 ...@@ -437,7 +437,7 @@ public class xhtml_to_latex_1
System.exit(1); System.exit(1);
} }
File latexFile = new File(outputDirectory.getAbsolutePath() + File.separator + "printrun-" + i + ".tex"); File latexFile = new File(outputDirectory.getAbsolutePath() + File.separator + "printrun-" + (i + 1) + ".tex");
if (latexFile.exists() == true) if (latexFile.exists() == true)
{ {
...@@ -470,15 +470,17 @@ public class xhtml_to_latex_1 ...@@ -470,15 +470,17 @@ public class xhtml_to_latex_1
} }
} }
/** @todo This would be much smarter if the preparations can be completed in advance,and
* and then doing the transformations in one go with one jobfile containing several jobs. */
StringBuilder xmlXsltTransformator1JobfileContentStringBuilder = new StringBuilder(); StringBuilder xmlXsltTransformator1JobfileContentStringBuilder = new StringBuilder();
xmlXsltTransformator1JobfileContentStringBuilder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); xmlXsltTransformator1JobfileContentStringBuilder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
xmlXsltTransformator1JobfileContentStringBuilder.append("<xml-xslt-transformator-1-jobfile>\n"); xmlXsltTransformator1JobfileContentStringBuilder.append("<xml-xslt-transformator-1-jobfile>\n");
xmlXsltTransformator1JobfileContentStringBuilder.append(" <job input-file=\"" + preparedFile.getAbsolutePath() + "\" entities-resolver-config-file=\"" + programPath + File.separator + "digital_publishing_workflow_tools" + File.separator + "xml_xslt_transformator" + File.separator + "xml_xslt_transformator_1" + File.separator + "entities" + File.separator + "config_xhtml_1_0_strict.xml\" stylesheet-file=\"" + programPath + File.separator + "automated_digital_publishing" + File.separator + "html2latex" + File.separator + "html2latex1" + File.separator + "layout" + File.separator + "xhtml_to_latex_2.xsl\" output-file=\"" + latexFile.getAbsolutePath() + "\"/>\n"); xmlXsltTransformator1JobfileContentStringBuilder.append(" <job input-file=\"" + preparedFile.getAbsolutePath() + "\" entities-resolver-config-file=\"" + programPath + File.separator + "digital_publishing_workflow_tools" + File.separator + "xml_xslt_transformator" + File.separator + "xml_xslt_transformator_1" + File.separator + "entities" + File.separator + "config_xhtml_1_0_strict.xml\" stylesheet-file=\"" + programPath + File.separator + "automated_digital_publishing" + File.separator + "html2latex" + File.separator + "html2latex1" + File.separator + "layout" + File.separator + "xhtml_to_latex_2.xsl\" output-file=\"" + latexFile.getAbsolutePath() + "\"/>\n");
xmlXsltTransformator1JobfileContentStringBuilder.append("</xml-xslt-transformator-1-jobfile>\n"); xmlXsltTransformator1JobfileContentStringBuilder.append("</xml-xslt-transformator-1-jobfile>\n");
File xmlXsltTransformator1Jobfile = new File(tempDirectory.getAbsolutePath() + File.separator + "jobfile_xml_xslt_transformator_1-" + i + ".xml"); File xmlXsltTransformator1Jobfile = new File(tempDirectory.getAbsolutePath() + File.separator + "jobfile_xml_xslt_transformator_1-" + (i + 1) + ".xml");
File xmlXsltTransformator1Path = new File(programPath + File.separator + "digital_publishing_workflow_tools" + File.separator + "xml_xslt_transformator" + File.separator + "xml_xslt_transformator_1"); File xmlXsltTransformator1Path = new File(programPath + File.separator + "digital_publishing_workflow_tools" + File.separator + "xml_xslt_transformator" + File.separator + "xml_xslt_transformator_1");
File xmlXsltTransformator1ResultInfoFile = new File(tempDirectory.getAbsolutePath() + File.separator + "resultinfo_xml_xslt_transformator_1-" + i + ".xml"); File xmlXsltTransformator1ResultInfoFile = new File(tempDirectory.getAbsolutePath() + File.separator + "resultinfo_xml_xslt_transformator_1-" + (i + 1) + ".xml");
callCapability(xmlXsltTransformator1Jobfile, xmlXsltTransformator1JobfileContentStringBuilder.toString(), "xml_xslt_transformator_1", xmlXsltTransformator1Path, xmlXsltTransformator1ResultInfoFile); callCapability(xmlXsltTransformator1Jobfile, xmlXsltTransformator1JobfileContentStringBuilder.toString(), "xml_xslt_transformator_1", xmlXsltTransformator1Path, xmlXsltTransformator1ResultInfoFile);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment