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 65f9c2b..26f081d 100644 --- a/src/main/java/com/rackspace/cloud/api/docs/WebHelpMojo.java +++ b/src/main/java/com/rackspace/cloud/api/docs/WebHelpMojo.java @@ -645,7 +645,20 @@ public abstract class WebHelpMojo extends AbstractWebhelpMojo { pdfBuilder.setProject(getMavenProject()); pdfBuilder.setSourceDirectory(getSourceDirectory()); pdfBuilder.setAutopdfTargetDirectory(targetDir); + + pdfBuilder.setCoverColor(""); + pdfBuilder.setCoverLogoPath(""); + pdfBuilder.setSecondaryCoverLogoPath(""); + pdfBuilder.setCoverLogoLeft(""); + pdfBuilder.setCoverLogoTop(""); + pdfBuilder.setCoverUrl(""); + pdfBuilder.setBranding(branding); + pdfBuilder.setSecurity(security); + pdfBuilder.setDraftStatus(draftStatus); + pdfBuilder.setTrimWadlUriCount(trimWadlUriCount); + pdfBuilder.setComputeWadlPathFromDocbookPath(computeWadlPathFromDocbookPath); + pdfBuilder.setIncludes(getIncludes()); pdfBuilder.setEntities(getEntities()); 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 787a14c..0f8ad61 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 @@ -14,6 +14,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.Enumeration; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -94,8 +95,19 @@ public class PDFBuilder { private File imageDirectory = null; private String sourceFilePath; private String projectBuildDirectory; + //transformer settings + //TODO: need to somehow pass coverLogoPath, secondaryCoverLogoPath, coverLogoLeft, coverLogoTop, coverUrl from the WebHelp flow private String coverColor; + private String coverLogoPath; + private String secondaryCoverLogoPath; + private String coverLogoLeft; + private String coverLogoTop; + private String coverUrl; private String branding; + private String security; + private String draftStatus; + private String trimWadlUriCount; + private String computeWadlPathFromDocbookPath; /** * The location of the stylesheet customization. @@ -297,22 +309,27 @@ public class PDFBuilder { } else { transformer.setParameter("builtForOpenStack", "0"); } - transformer.setParameter("coverLogoPath", null); - transformer.setParameter("secondaryCoverLogoPath", null); - transformer.setParameter("coverLogoLeft", null); - transformer.setParameter("coverLogoTop", null); - transformer.setParameter("coverUrl", null); + transformer.setParameter("coverLogoPath", coverLogoPath); + transformer.setParameter("secondaryCoverLogoPath", secondaryCoverLogoPath); + transformer.setParameter("coverLogoLeft", coverLogoLeft); + transformer.setParameter("coverLogoTop", coverLogoTop); + transformer.setParameter("coverUrl", coverUrl); transformer.setParameter("coverColor", coverColor); transformer.setParameter("project.build.directory", projectBuildDirectory); - - /*if(security != null){ + if(security != null){ transformer.setParameter("security",security); } + String sysDraftStatus=System.getProperty("draft.status"); + if(null!=sysDraftStatus && !sysDraftStatus.isEmpty()){ + draftStatus=sysDraftStatus; + } + transformer.setParameter("draft.status", draftStatus); + if(trimWadlUriCount != null){ transformer.setParameter("trim.wadl.uri.count",trimWadlUriCount); - }*/ + } // // Setup graphics paths @@ -325,7 +342,7 @@ public class PDFBuilder { transformer.setParameter("docbook.infile",sourceDocBook.getAbsolutePath()); transformer.setParameter("source.directory",sourceDirectory); - //+++++++++++++++// transformer.setParameter("compute.wadl.path.from.docbook.path",computeWadlPathFromDocbookPath); + transformer.setParameter("compute.wadl.path.from.docbook.path",computeWadlPathFromDocbookPath); transformer.setParameter ("admon.graphics.path", imageDirectory.getAbsolutePath()+File.separator); transformer.setParameter ("callout.graphics.path", calloutDirectory.getAbsolutePath()+File.separator); @@ -462,6 +479,46 @@ public class PDFBuilder { this.coverColor = coverColor; } + public String getCoverLogoPath() { + return coverLogoPath; + } + + public void setCoverLogoPath(String coverLogoPath) { + this.coverLogoPath = coverLogoPath; + } + + public String getSecondaryCoverLogoPath() { + return secondaryCoverLogoPath; + } + + public void setSecondaryCoverLogoPath(String secondaryCoverLogoPath) { + this.secondaryCoverLogoPath = secondaryCoverLogoPath; + } + + public String getCoverLogoLeft() { + return coverLogoLeft; + } + + public void setCoverLogoLeft(String coverLogoLeft) { + this.coverLogoLeft = coverLogoLeft; + } + + public String getCoverLogoTop() { + return coverLogoTop; + } + + public void setCoverLogoTop(String coverLogoTop) { + this.coverLogoTop = coverLogoTop; + } + + public String getCoverUrl() { + return coverUrl; + } + + public void setCoverUrl(String coverUrl) { + this.coverUrl = coverUrl; + } + public String getBranding() { return branding; } @@ -469,6 +526,39 @@ public class PDFBuilder { this.branding = branding; } + public String getSecurity() { + return security; + } + + public void setSecurity(String security) { + this.security = security; + } + + public String getDraftStatus() { + return draftStatus; + } + + public void setDraftStatus(String draftStatus) { + this.draftStatus = draftStatus; + } + + public String getTrimWadlUriCount() { + return trimWadlUriCount; + } + + public void setTrimWadlUriCount(String trimWadlUriCount) { + this.trimWadlUriCount = trimWadlUriCount; + } + + public String getComputeWadlPathFromDocbookPath() { + return computeWadlPathFromDocbookPath; + } + + public void setComputeWadlPathFromDocbookPath( + String computeWadlPathFromDocbookPath) { + this.computeWadlPathFromDocbookPath = computeWadlPathFromDocbookPath; + } + public void setIncludes(String[] includes) { this.includes = includes; } @@ -771,10 +861,17 @@ public class PDFBuilder { final InputSource inputSource = new InputSource(sourceFile.getAbsolutePath()); Source source = new SAXSource(filter, inputSource); - map.put("outputType", "pdf"); - map.remove("webhelp"); + Map localMap = new HashMap(map); + localMap.put("outputType", "pdf"); - return CalabashHelper.createSource(source, pathToPipelineFile, map); + //removing webhelp specific settings from map + localMap.remove("webhelp"); + localMap.remove("webhelp.war"); + localMap.remove("groupId"); + localMap.remove("artifactId"); + localMap.remove("docProjectVersion"); + + return CalabashHelper.createSource(source, pathToPipelineFile, localMap); } /**