com.konakartadmin.bl
Class AdminPdfMgr

java.lang.Object
  extended by com.konakartadmin.bl.AdminBaseMgr
      extended by com.konakartadmin.bl.AdminPdfMgr
All Implemented Interfaces:
AdminPdfMgrIf

public class AdminPdfMgr
extends AdminBaseMgr
implements AdminPdfMgrIf

The AdminPdfMgr - for creating various PDFs for the Admin Application


Nested Class Summary
protected  class AdminPdfMgr.StaticData
           
 
Field Summary
protected static org.apache.commons.logging.Log log
          the log
protected static java.lang.String mutex
           
protected static java.util.Map<java.lang.String,AdminPdfMgr.StaticData> staticDataHM
          Hash Map that contains the static data
 
Fields inherited from class com.konakartadmin.bl.AdminBaseMgr
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir
 
Constructor Summary
AdminPdfMgr(KKAdminIf eng)
          Constructor
 
Method Summary
 java.lang.String createPdfDirNameAfterBase(com.konakart.app.PdfOptions options)
          Returns the directory name (after the base part) where the PDF file will be generated
 java.lang.String createPdfFileNameLastPart(com.konakart.app.PdfOptions options)
          For creating a file name for the PDF file to be generated.
 void createPDFFromHTML(com.konakart.app.PdfOptions options, java.lang.String html, java.lang.String pdfFileName)
          Created the PDF file from the specified HTML String
 java.lang.String getFullPdfFileName(java.lang.String dirPath, java.lang.String pdfFileNameAfterBasePath)
          For creating a file name for the PDF file to be generated
 com.konakart.app.PdfResult getPdf(com.konakart.app.PdfOptions options)
          Create the PDF document and return the URL, File name or bytes as defined by the input options.
 java.lang.String getPdfFileBasePath()
          Get the base path for the PDF files from the configuration parameter.
 java.lang.String getUUID()
          Returns a UUID to add to the PDF file name to make it unique and hard to guess
 void refreshConfigs()
          Retrieve some commonly-used properties and set the velocity log file location
 org.xhtmlrenderer.pdf.ITextRenderer renderHtml(java.lang.String html)
          Render the HTML and return the ITextRenderer object for further processing
 
Methods inherited from class com.konakartadmin.bl.AdminBaseMgr
addInsertAttr, addInsertAttr, checkIntIsSet, checkRequired, getAdminAddressMgr, getAdminAuditMgr, getAdminBillingMgr, getAdminBookableProductMgr, getAdminCatMgr, getAdminConfigMgr, getAdminCurrMgr, getAdminCustMgr, getAdminCustTagMgr, getAdminEmailMgr, getAdminEng, getAdminHtmlMgr, getAdminLanguageMgr, getAdminManuMgr, getAdminMessageMgr, getAdminMiscItemMgr, getAdminModulesMgr, getAdminMultiStoreMgr, getAdminOrderMgr, getAdminPdfMgr, getAdminProdAttrMgr, getAdminProdMgr, getAdminPromMgr, getAdminPublishProdMgr, getAdminReviewMgr, getAdminSearchRuleMgr, getAdminSecMgr, getAdminSolrMgr, getAdminStoreMgr, getAdminTagMgr, getAdminTaxMgr, getAdminValidationMgr, getAdminVelocityContextMgr, getAdminWishListMgr, getBooleanFromString, getExportXMLData, getIntFromString, getKkConfig, getKkInstanceId, getMode, getModeString, getMqMgr, getNewCriteria, getNewCriteria, getPostSearchText, getPreSearchText, getPropertyValue, getRecordCount, getRewardPointMgr, getSingleIntResult, getStoreId, getTemplate, getTemplateBase, getXml_io, init, isConfigSet, isEnterprise, isMultiStoreLanguagesShared, isMultiStoreMode, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareProducts, isMultiStoreSingleDBCSMode, isMultiStoreSingleDBMode, isMultiStoreSingleDBNonCSMode, manageException, removeCData, setAdminEng, setupWildCardRules, setWildCardAfter, setWildCardBefore, shutdownGracefully, shutdownGracefully, timestampStr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
the log


mutex

protected static java.lang.String mutex

staticDataHM

protected static java.util.Map<java.lang.String,AdminPdfMgr.StaticData> staticDataHM
Hash Map that contains the static data

Constructor Detail

AdminPdfMgr

public AdminPdfMgr(KKAdminIf eng)
            throws java.lang.Exception
Constructor

Parameters:
eng - KKAdmin engine
Throws:
java.lang.Exception
Method Detail

getPdf

public com.konakart.app.PdfResult getPdf(com.konakart.app.PdfOptions options)
                                  throws java.lang.Exception
Create the PDF document and return the URL, File name or bytes as defined by the input options.

Specified by:
getPdf in interface AdminPdfMgrIf
Parameters:
options - the options that define the PDF report to be produced and what is returned from this interface.
Returns:
an AdminPdfResult object containing information that is defined in the options specified on input.
Throws:
java.lang.Exception

createPdfDirNameAfterBase

public java.lang.String createPdfDirNameAfterBase(com.konakart.app.PdfOptions options)
Returns the directory name (after the base part) where the PDF file will be generated

Parameters:
options - The AdminPdfOptions that were specified for creating the PDF file
Returns:
the PDF directory name that comes after the base directory

createPdfFileNameLastPart

public java.lang.String createPdfFileNameLastPart(com.konakart.app.PdfOptions options)
For creating a file name for the PDF file to be generated. This creates the name that will be added to the directory name.

Parameters:
options - The AdminPdfOptions that were specified for creating the PDF file
Returns:
the generated PDF file name - just the last part after the directories

getFullPdfFileName

public java.lang.String getFullPdfFileName(java.lang.String dirPath,
                                           java.lang.String pdfFileNameAfterBasePath)
For creating a file name for the PDF file to be generated

Parameters:
dirPath - the directory path for the PDF files
pdfFileNameAfterBasePath - The AdminPdfOptions that were specified for creating the PDF file
Returns:
the generated PDF file name

getPdfFileBasePath

public java.lang.String getPdfFileBasePath()
                                    throws KKAdminException
Get the base path for the PDF files from the configuration parameter.

Returns:
the PDF Files base path
Throws:
KKAdminException

getUUID

public java.lang.String getUUID()
Returns a UUID to add to the PDF file name to make it unique and hard to guess

Returns:
a randomly-generated UUID in a String

createPDFFromHTML

public void createPDFFromHTML(com.konakart.app.PdfOptions options,
                              java.lang.String html,
                              java.lang.String pdfFileName)
                       throws java.lang.Exception
Created the PDF file from the specified HTML String

Parameters:
options - the AdminPdfOptions options object which might one day be used to affect the PDF generation if this method is overriden.
html - the HTML String to convert into a PDF file
pdfFileName - the target pdfFileName
Throws:
java.lang.Exception

renderHtml

public org.xhtmlrenderer.pdf.ITextRenderer renderHtml(java.lang.String html)
Render the HTML and return the ITextRenderer object for further processing

Parameters:
html -
Returns:
the ITextRenderer object that contains the parsed HTML document

refreshConfigs

public void refreshConfigs()
                    throws java.lang.Exception
Retrieve some commonly-used properties and set the velocity log file location

Specified by:
refreshConfigs in interface AdminPdfMgrIf
Overrides:
refreshConfigs in class AdminBaseMgr
Throws:
java.lang.Exception


Copyright © 2011 DS Data Systems UK Ltd.