diff --git a/src/main/java/com/rackspace/cloud/api/docs/PDFMojo.java b/src/main/java/com/rackspace/cloud/api/docs/PDFMojo.java index 9cd50f7..8d7e8fa 100644 --- a/src/main/java/com/rackspace/cloud/api/docs/PDFMojo.java +++ b/src/main/java/com/rackspace/cloud/api/docs/PDFMojo.java @@ -420,7 +420,9 @@ public abstract class PDFMojo extends AbstractFoMojo { String sysDraftStatus=System.getProperty("draft.status"); - getLog().info("adjustTransformer():sysDraftStatus="+sysDraftStatus); + if (getLog().isDebugEnabled()) { + getLog().info("adjustTransformer():sysDraftStatus="+sysDraftStatus); + } if(null!=sysDraftStatus && !sysDraftStatus.isEmpty()){ draftStatus=sysDraftStatus; } @@ -436,7 +438,9 @@ public abstract class PDFMojo extends AbstractFoMojo { transformer.setParameter("project.build.directory", projectBuildDirectory.toURI().toString()); String sysSecurity=System.getProperty("security"); - getLog().info("adjustTransformer():sysSecurity="+sysSecurity); + if (getLog().isDebugEnabled()) { + getLog().info("adjustTransformer():sysSecurity="+sysSecurity); + } if(null!=sysSecurity && !sysSecurity.isEmpty()){ security=sysSecurity; } @@ -507,7 +511,9 @@ public abstract class PDFMojo extends AbstractFoMojo { //transformer.setParameter("docbook.infile",sourceDocBook.toURI().toString()); String srcFilename = sourceDocBook.getName(); - getLog().info("SOURCE FOR COVER PAGE: "+this.projectBuildDirectory+"/docbkx/"+srcFilename); + if (getLog().isDebugEnabled()) { + getLog().info("SOURCE FOR COVER PAGE: "+this.projectBuildDirectory+"/docbkx/"+srcFilename); + } transformer.setParameter("docbook.infile", new File(this.projectBuildDirectory, "docbkx/"+srcFilename).toURI().toString()); transformer.transform (new StreamSource(coverImageTemplate), new StreamResult(coverImage)); } diff --git a/src/main/java/com/rackspace/cloud/api/docs/WebHelpMojo.java b/src/main/java/com/rackspace/cloud/api/docs/WebHelpMojo.java index e444261..7504054 100644 --- a/src/main/java/com/rackspace/cloud/api/docs/WebHelpMojo.java +++ b/src/main/java/com/rackspace/cloud/api/docs/WebHelpMojo.java @@ -864,7 +864,9 @@ public abstract class WebHelpMojo extends AbstractWebhelpMojo { //makePdf is a POM configuration for generate-webhelp goal to control the execution of //automatic building of pdf output if(this.makePdf) { + if (getLog().isDebugEnabled()) { getLog().info("\n************************************* START: Automatically generating PDF for WEBHELP *************************************"); + } //Target directory for Webhelp points to ${basepath}/target/docbkx/webhelp. So get parent. File baseDir = getTargetDirectory().getParentFile(); //The point FO/PDF file output to be generated at ${basepath}/target/docbkx/autopdf. @@ -910,10 +912,14 @@ public abstract class WebHelpMojo extends AbstractWebhelpMojo { File srcFilename = new File(this.projectBuildDirectory, "docbkx/"+sourceFile.getName()); if(srcFilename.exists()) { + if (getLog().isDebugEnabled()) { getLog().debug("***********************"+ srcFilename); + } pdfBuilder.setSourceFilePath(srcFilename); } else { + if (getLog().isDebugEnabled()) { getLog().debug("***********************"+ getSourceDirectory()+File.separator+inputFilename); + } pdfBuilder.setSourceFilePath(new File(getSourceDirectory(), inputFilename)); } @@ -932,14 +938,16 @@ public abstract class WebHelpMojo extends AbstractWebhelpMojo { com.rackspace.cloud.api.docs.FileUtils.mkdir(targetDirForPdf); } boolean moved = pdfBuilder.movePdfToWebhelpDir(pdfFile, targetDirForPdf); - if(moved) { + if(moved && getLog().isDebugEnabled()) { getLog().info("Successfully moved auto-generated PDF file to Webhelp target directory!"); - } else { + } else if(getLog().isDebugEnabled()) { getLog().error("Unable to move auto-generated PDF file to Webhelp target directory!"); } } autoPdfUrl = "../"+foFile.getName(); - getLog().info("************************************* END: Automatically generating PDF for WEBHELP *************************************\n"); + if (getLog().isDebugEnabled()) { + getLog().info("************************************* END: Automatically generating PDF for WEBHELP *************************************\n"); + } } diff --git a/src/main/java/com/rackspace/cloud/api/docs/builders/PDFBuilder.java b/src/main/java/com/rackspace/cloud/api/docs/builders/PDFBuilder.java index f7d15e1..70939dd 100644 --- a/src/main/java/com/rackspace/cloud/api/docs/builders/PDFBuilder.java +++ b/src/main/java/com/rackspace/cloud/api/docs/builders/PDFBuilder.java @@ -226,9 +226,9 @@ public class PDFBuilder { final Result result = new StreamResult(targetFile.getAbsolutePath()); transformer.transform(xmlSource, result); - - getLog().info(targetFile + " has been generated."); - + if (getLog().isDebugEnabled()) { + getLog().debug(targetFile + " has been generated."); + } return targetFile; } catch (SAXException saxe) { throw new MojoExecutionException("Failed to parse " + sourceFilePath + ".", saxe); @@ -274,8 +274,9 @@ public class PDFBuilder { baseURL = baseURL.replace("file:/", "file:///"); userAgent.setBaseURL(baseURL); - getLog().info("Absolute path is "+baseURL); - + if (getLog().isDebugEnabled()) { + getLog().debug("Absolute path is "+baseURL); + } in = new FileInputStream(result); targetPdfFile = new File (result.getAbsolutePath().replaceAll(".fo$", properties.getProperty("pdfsuffix","") + ".pdf")); @@ -475,12 +476,14 @@ public class PDFBuilder { transformer.setParameter ("cloud.api.background.image", coverImage.toURI().toString()); transformer.setParameter ("cloud.api.cc.image.dir", ccSub.toURI().toString()); - - // getLog().info("SOURCE FOR COVER PAGE: "+sourceFilePath); + if (getLog().isDebugEnabled()) { + getLog().info("SOURCE FOR COVER PAGE: "+sourceFilePath); + } // transformer.setParameter("docbook.infile", sourceFilePath.toURI().toString()); - - getLog().info("SOURCE FOR COVER PAGE: " + new File(projectBuildDirectory, inputFilename).getAbsolutePath()); + if (getLog().isDebugEnabled()) { + getLog().debug("SOURCE FOR COVER PAGE: " + new File(projectBuildDirectory, inputFilename).getAbsolutePath()); + } transformer.setParameter("docbook.infile", new File(projectBuildDirectory, inputFilename).toURI().toString()); transformer.transform (new StreamSource(coverImageTemplate), new StreamResult(coverImage)); @@ -883,7 +886,9 @@ public class PDFBuilder { URIResolver uriResolver; try { URL url = getNonDefaultStylesheetURL() == null ? getDefaultStylesheetURL() : getNonDefaultStylesheetURL(); - getLog().debug("Using stylesheet: " + url.toExternalForm()); + if (getLog().isDebugEnabled()) { + getLog().debug("Using stylesheet: " + url.toExternalForm()); + } uriResolver = new StylesheetResolver("urn:docbkx:stylesheet", new StreamSource(url.openStream(), url .toExternalForm()), catalogResolver); } catch (IOException ioe) { @@ -963,7 +968,6 @@ public class PDFBuilder { } if (getCustomizationParameters() != null) { - getLog().info("Applying customization parameters"); final Iterator iterator = getCustomizationParameters().iterator(); while (iterator.hasNext()) { Parameter param = (Parameter) iterator.next(); @@ -1135,4 +1139,4 @@ public class PDFBuilder { System.exit(-1); } } -} \ No newline at end of file +} diff --git a/src/main/java/com/rackspace/cloud/api/docs/calabash/extensions/ReplaceTextXProcStep.java b/src/main/java/com/rackspace/cloud/api/docs/calabash/extensions/ReplaceTextXProcStep.java index fad4349..9ba7b65 100644 --- a/src/main/java/com/rackspace/cloud/api/docs/calabash/extensions/ReplaceTextXProcStep.java +++ b/src/main/java/com/rackspace/cloud/api/docs/calabash/extensions/ReplaceTextXProcStep.java @@ -84,7 +84,9 @@ public class ReplaceTextXProcStep extends DefaultStep { if(fileLength>0){ BufferedReader br = null; try { + if (getLog().isDebugEnabled()) { getLog().info("REPLACEMENTS FILE = " + replacementsFile.getAbsolutePath()); + } br = new BufferedReader(new FileReader(replacementsFile)); String line; @@ -107,8 +109,7 @@ public class ReplaceTextXProcStep extends DefaultStep { //ignore input line } } - - if (xpathReplacements.size()==0) { + if (xpathReplacements.size()==0 && getLog().isDebugEnabled()) { getLog().info("SKIPPING REPLACEMENTS: Replacements file is empty or was not found at specified location '"+fileName+ "'."); } } catch (IOException e) { @@ -120,7 +121,7 @@ public class ReplaceTextXProcStep extends DefaultStep { getLog().error("Unable to release/close replacements config file", e); } } - } else { + } else if(getLog().isDebugEnabled()) { getLog().info("SKIPPING REPLACEMENTS: Replacements file is empty or was not found at specified location '"+fileName+ "'."); } @@ -248,4 +249,4 @@ class Replacement { return false; } -} \ No newline at end of file +} diff --git a/src/main/resources/cloud/webhelp/bookinfo.xsl b/src/main/resources/cloud/webhelp/bookinfo.xsl index 5206f85..07d4411 100644 --- a/src/main/resources/cloud/webhelp/bookinfo.xsl +++ b/src/main/resources/cloud/webhelp/bookinfo.xsl @@ -49,7 +49,6 @@ - bookinfo.xsl: webhelpDirname="" @@ -233,4 +232,4 @@ branding= - \ No newline at end of file + diff --git a/src/main/resources/cloud/webhelp/docbook.xsl b/src/main/resources/cloud/webhelp/docbook.xsl index 35bd536..be97526 100644 --- a/src/main/resources/cloud/webhelp/docbook.xsl +++ b/src/main/resources/cloud/webhelp/docbook.xsl @@ -16,6 +16,7 @@ 0 + 1 diff --git a/src/main/resources/cloud/webhelp/profile-webhelp.xsl b/src/main/resources/cloud/webhelp/profile-webhelp.xsl index 154de25..d5999e8 100644 --- a/src/main/resources/cloud/webhelp/profile-webhelp.xsl +++ b/src/main/resources/cloud/webhelp/profile-webhelp.xsl @@ -59,11 +59,6 @@ - -######################################## -Processing legalnotice: -######################################## - @@ -385,4 +380,4 @@ body { background-image: url(' - \ No newline at end of file + diff --git a/src/main/resources/pdf.xpl b/src/main/resources/pdf.xpl index a0a281f..f373a0a 100644 --- a/src/main/resources/pdf.xpl +++ b/src/main/resources/pdf.xpl @@ -18,7 +18,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -90,75 +90,50 @@ pdfsuffix= - + - + - + - - - + - - - - + - + - - - + - - - - + - - - + - + + - - + - - - - - - - + - - - + - + + - - - - - - - + - - + + - + diff --git a/src/main/resources/rackspace-library.xpl b/src/main/resources/rackspace-library.xpl index 5ae052b..42be698 100644 --- a/src/main/resources/rackspace-library.xpl +++ b/src/main/resources/rackspace-library.xpl @@ -571,12 +571,7 @@ setting failOnValidationError to no in your pom. - - - - - - + diff --git a/src/main/resources/webhelp.xpl b/src/main/resources/webhelp.xpl index 3fc10a5..619d11b 100644 --- a/src/main/resources/webhelp.xpl +++ b/src/main/resources/webhelp.xpl @@ -11,38 +11,23 @@ - - - - - - - - - - + - + - + - + - - - - + - + - - - - + - + @@ -54,50 +39,29 @@ - - - - - - - - - - - - - - - - - - - - - - +