Skip to content

Commit

Permalink
Debug statements toegevoegd.
Browse files Browse the repository at this point in the history
  • Loading branch information
arjan authored and arjan committed Nov 28, 2024
1 parent 2e24cbf commit 5650f6a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/java/nl/imvertor/OfficeCompiler/OfficeCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ private boolean transformDocx(AnyFile mswordFile) throws Exception {

succeeds = succeeds? infile.toXhtmlFile(outfile) : false;

configurator.getRunner().debug(logger,"DOCUMENTOR","File prepared okay? " + succeeds);

if (succeeds) {
// transformeer die XHTML naar iets bruikbaars, extraheer ook meteen respec properties
transformer.setXslParm("msword-file-path", outfile.getCanonicalPath());
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/nl/imvertor/common/file/WordFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpHeaders;
import org.apache.log4j.Logger;
import org.json.JSONObject;

import nl.imvertor.common.Configurator;
import nl.imvertor.common.Runner;
Expand Down Expand Up @@ -96,10 +95,14 @@ public boolean toXhtmlFile(XmlFile outFile) throws Exception {
+ "\"text\": \"" + payloadBase64 + "\""
+ "}";
try {
configurator.getRunner().debug(logger,"DOCUMENTOR","Posting payload, base64 size " + payloadBase64.length());
String result = localFile.post(HttpFile.METHOD_POST_CONTENT, URI.create(pandocServerUrl), headerMap, null, new String[] {payload});
if (StringUtils.startsWith(result,"<")) {
outFile.setContent(result);
return true;
} else if (result.equals("")) {
runner.error(logger, "Documentor processing error: empty result");
return false;
} else {
runner.error(logger, "Documentor processing error: \"" + result + "\"");
return false;
Expand Down Expand Up @@ -152,6 +155,7 @@ public boolean toXhtmlFile(XmlFile outFile) throws Exception {
*/
public boolean correctCodeSpaces() throws Exception{
Configurator configurator = Configurator.getInstance();
configurator.getRunner().debug(logger,"DOCUMENTOR","Correcting code spaces");
try {
ZipFile thisFile = new ZipFile(this);
AnyFolder tempFolder = configurator.getWorkFolder("documentor/msword");
Expand Down

0 comments on commit 5650f6a

Please sign in to comment.