Package org.jbake.app.configuration
Class DefaultJBakeConfiguration
- java.lang.Object
-
- org.jbake.app.configuration.DefaultJBakeConfiguration
-
- All Implemented Interfaces:
JBakeConfiguration
public class DefaultJBakeConfiguration extends java.lang.Object implements JBakeConfiguration
The default implementation of aJBakeConfiguration
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_TYHMELEAF_TEMPLATE_MODE
-
Constructor Summary
Constructors Constructor Description DefaultJBakeConfiguration(java.io.File sourceFolder, org.apache.commons.configuration2.CompositeConfiguration configuration)DefaultJBakeConfiguration(org.apache.commons.configuration2.CompositeConfiguration configuration)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConfiguration(java.util.Properties properties)java.util.Map<java.lang.String,java.lang.Object>asHashMap()java.lang.Objectget(java.lang.String key)Get property value by a given key from the configurationjava.lang.StringgetAbbreviatedGitHash()java.lang.StringgetArchiveFileName()java.util.List<java.lang.String>getAsciidoctorAttributes()java.util.List<java.lang.String>getAsciidoctorOption(java.lang.String optionKey)Get an asciidoctor option by it's keyjava.util.List<java.lang.String>getAsciidoctorOptionKeys()Get a list of asciidoctor optionsjava.io.FilegetAssetFolder()java.lang.StringgetAssetFolderName()booleangetAssetIgnoreHidden()java.lang.StringgetAttributesExportPrefixForAsciidoctor()java.lang.StringgetBuildTimeStamp()booleangetClearCache()org.apache.commons.configuration2.CompositeConfigurationgetCompositeConfiguration()java.io.FilegetContentFolder()java.lang.StringgetContentFolderName()java.lang.StringgetDatabasePath()java.lang.StringgetDatabaseStore()java.lang.StringgetDataFileDocType()java.io.FilegetDataFolder()java.lang.StringgetDataFolderName()java.lang.StringgetDateFormat()java.lang.StringgetDefaultStatus()java.lang.StringgetDefaultType()java.io.FilegetDestinationFolder()java.util.List<java.lang.String>getDocumentTypes()java.lang.StringgetDraftSuffix()java.lang.StringgetError404FileName()java.lang.StringgetExampleProjectByType(java.lang.String templateType)Get name for example project name by given template typebooleangetExportAsciidoctorAttributes()java.lang.StringgetFeedFileName()java.lang.StringgetHeaderSeparator()java.lang.StringgetIgnoreFileName()booleangetImgPathPrependHost()booleangetImgPathUpdate()java.lang.StringgetIndexFileName()java.util.List<Property>getJbakeProperties()java.lang.StringgetJvmLocale()java.util.Iterator<java.lang.String>getKeys()Get an iterator of available configuration keysjava.util.List<java.lang.String>getMarkdownExtensions()A list of markdown extensionsjava.lang.StringgetOutputEncoding()java.lang.StringgetOutputExtension()java.lang.StringgetOutputExtensionByDocType(java.lang.String docType)booleangetPaginateIndex()intgetPostsPerPage()java.lang.StringgetPrefixForUriWithoutExtension()booleangetRenderArchive()java.lang.StringgetRenderEncoding()booleangetRenderError404()booleangetRenderFeed()booleangetRenderIndex()booleangetRenderSiteMap()booleangetRenderTags()booleangetRenderTagsIndex()booleangetSanitizeTag()java.lang.StringgetServerContextPath()java.lang.StringgetServerHostname()intgetServerPort()java.lang.StringgetSiteHost()java.lang.StringgetSiteMapFileName()java.io.FilegetSourceFolder()java.lang.StringgetTagPathName()java.lang.StringgetTemplateEncoding()java.io.FilegetTemplateFileByDocType(java.lang.String docType)java.io.FilegetTemplateFolder()java.lang.StringgetTemplateFolderName()java.lang.StringgetThymeleafLocale()java.lang.StringgetThymeleafModeByType(java.lang.String type)booleangetUriWithoutExtension()java.lang.StringgetVersion()voidsetAssetFolder(java.io.File assetFolder)voidsetAssetIgnoreHidden(boolean assetIgnoreHidden)voidsetClearCache(boolean clearCache)voidsetCompositeConfiguration(org.apache.commons.configuration2.CompositeConfiguration configuration)voidsetContentFolder(java.io.File contentFolder)voidsetDatabasePath(java.lang.String path)voidsetDatabaseStore(java.lang.String storeType)voidsetDataFileDocType(java.lang.String dataFileDocType)voidsetDataFolder(java.io.File dataFolder)voidsetDefaultStatus(java.lang.String status)voidsetDefaultType(java.lang.String type)voidsetDestinationFolder(java.io.File destinationFolder)voidsetDestinationFolderName(java.lang.String folderName)voidsetExampleProject(java.lang.String type, java.lang.String fileName)voidsetHeaderSeparator(java.lang.String headerSeparator)voidsetImgPathPrependHost(boolean imgPathPrependHost)voidsetImgPathUPdate(boolean imgPathUpdate)voidsetMarkdownExtensions(java.lang.String... extensions)voidsetOutputExtension(java.lang.String outputExtension)voidsetPaginateIndex(boolean paginateIndex)voidsetPostsPerPage(int postsPerPage)voidsetPrefixForUriWithoutExtension(java.lang.String prefix)voidsetProperty(java.lang.String key, java.lang.Object value)Set a property value for the given keyvoidsetRenderTagsIndex(boolean enable)voidsetServerPort(int port)voidsetSiteHost(java.lang.String siteHost)voidsetSourceFolder(java.io.File sourceFolder)voidsetTemplateExtensionForDocType(java.lang.String docType, java.lang.String extension)voidsetTemplateFileNameForDocType(java.lang.String docType, java.lang.String fileName)voidsetTemplateFolder(java.io.File templateFolder)voidsetUriWithoutExtension(boolean withoutExtension)
-
-
-
Field Detail
-
DEFAULT_TYHMELEAF_TEMPLATE_MODE
public static final java.lang.String DEFAULT_TYHMELEAF_TEMPLATE_MODE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultJBakeConfiguration
@Deprecated public DefaultJBakeConfiguration(org.apache.commons.configuration2.CompositeConfiguration configuration)
Deprecated.Some deprecated implementations just need access to the configuration without access to the source folder- Parameters:
configuration- The project configuration
-
DefaultJBakeConfiguration
public DefaultJBakeConfiguration(java.io.File sourceFolder, org.apache.commons.configuration2.CompositeConfiguration configuration)
-
-
Method Detail
-
get
public java.lang.Object get(java.lang.String key)
Description copied from interface:JBakeConfigurationGet property value by a given key from the configuration- Specified by:
getin interfaceJBakeConfiguration- Parameters:
key- a key for the property like site.host- Returns:
- the value of the property
-
getArchiveFileName
public java.lang.String getArchiveFileName()
- Specified by:
getArchiveFileNamein interfaceJBakeConfiguration- Returns:
- Output filename for archive file, is only used when
JBakeConfiguration.getRenderArchive()is true
-
getAsciidoctorAttributes
public java.util.List<java.lang.String> getAsciidoctorAttributes()
- Specified by:
getAsciidoctorAttributesin interfaceJBakeConfiguration- Returns:
- attributes to be set when processing input
-
getAsciidoctorOption
public java.util.List<java.lang.String> getAsciidoctorOption(java.lang.String optionKey)
Description copied from interface:JBakeConfigurationGet an asciidoctor option by it's key- Specified by:
getAsciidoctorOptionin interfaceJBakeConfiguration- Parameters:
optionKey- an option key- Returns:
- the value of the option key
-
getAsciidoctorOptionKeys
public java.util.List<java.lang.String> getAsciidoctorOptionKeys()
Description copied from interface:JBakeConfigurationGet a list of asciidoctor options- Specified by:
getAsciidoctorOptionKeysin interfaceJBakeConfiguration- Returns:
- list of asciidoctor options
-
getAssetFolder
public java.io.File getAssetFolder()
- Specified by:
getAssetFolderin interfaceJBakeConfiguration- Returns:
- the folder where assets are stored, they are copied directly in output folder and not processed
-
setAssetFolder
public void setAssetFolder(java.io.File assetFolder)
-
getAssetFolderName
public java.lang.String getAssetFolderName()
- Specified by:
getAssetFolderNamein interfaceJBakeConfiguration- Returns:
- name of folder for assets
-
getAssetIgnoreHidden
public boolean getAssetIgnoreHidden()
- Specified by:
getAssetIgnoreHiddenin interfaceJBakeConfiguration- Returns:
- Flag indicating if hidden asset resources should be ignored
-
setAssetIgnoreHidden
public void setAssetIgnoreHidden(boolean assetIgnoreHidden)
-
getAttributesExportPrefixForAsciidoctor
public java.lang.String getAttributesExportPrefixForAsciidoctor()
- Specified by:
getAttributesExportPrefixForAsciidoctorin interfaceJBakeConfiguration- Returns:
- Prefix to be used when exporting JBake properties to Asciidoctor
-
getBuildTimeStamp
public java.lang.String getBuildTimeStamp()
- Specified by:
getBuildTimeStampin interfaceJBakeConfiguration- Returns:
- Timestamp that records when JBake build was made
-
getClearCache
public boolean getClearCache()
- Specified by:
getClearCachein interfaceJBakeConfiguration- Returns:
- Flag indicating to flash the database cache
-
setClearCache
public void setClearCache(boolean clearCache)
-
getCompositeConfiguration
public org.apache.commons.configuration2.CompositeConfiguration getCompositeConfiguration()
-
setCompositeConfiguration
public void setCompositeConfiguration(org.apache.commons.configuration2.CompositeConfiguration configuration)
-
getContentFolder
public java.io.File getContentFolder()
- Specified by:
getContentFolderin interfaceJBakeConfiguration- Returns:
- the content folder
-
setContentFolder
public void setContentFolder(java.io.File contentFolder)
-
getContentFolderName
public java.lang.String getContentFolderName()
- Specified by:
getContentFolderNamein interfaceJBakeConfiguration- Returns:
- name of Folder where content (that's to say files to be transformed) resides in
-
getDataFolder
public java.io.File getDataFolder()
- Specified by:
getDataFolderin interfaceJBakeConfiguration- Returns:
- the data folder
-
setDataFolder
public void setDataFolder(java.io.File dataFolder)
-
getDataFolderName
public java.lang.String getDataFolderName()
- Specified by:
getDataFolderNamein interfaceJBakeConfiguration- Returns:
- name of Folder where data files reside in
-
getDataFileDocType
public java.lang.String getDataFileDocType()
- Specified by:
getDataFileDocTypein interfaceJBakeConfiguration- Returns:
- docType for data files
-
setDataFileDocType
public void setDataFileDocType(java.lang.String dataFileDocType)
-
getDatabasePath
public java.lang.String getDatabasePath()
- Specified by:
getDatabasePathin interfaceJBakeConfiguration- Returns:
- Folder to store database files in
-
setDatabasePath
public void setDatabasePath(java.lang.String path)
-
getDatabaseStore
public java.lang.String getDatabaseStore()
- Specified by:
getDatabaseStorein interfaceJBakeConfiguration- Returns:
- name to identify if database is kept in memory (memory) or persisted to disk (plocal)
-
setDatabaseStore
public void setDatabaseStore(java.lang.String storeType)
-
getDateFormat
public java.lang.String getDateFormat()
- Specified by:
getDateFormatin interfaceJBakeConfiguration- Returns:
- How date is formated
-
getDefaultStatus
public java.lang.String getDefaultStatus()
- Specified by:
getDefaultStatusin interfaceJBakeConfiguration- Returns:
- Default status to use (in order to avoid putting it in all files)
-
setDefaultStatus
public void setDefaultStatus(java.lang.String status)
-
getDefaultType
public java.lang.String getDefaultType()
- Specified by:
getDefaultTypein interfaceJBakeConfiguration- Returns:
- Default type to use (in order to avoid putting it in all files)
-
setDefaultType
public void setDefaultType(java.lang.String type)
-
getDestinationFolder
public java.io.File getDestinationFolder()
- Specified by:
getDestinationFolderin interfaceJBakeConfiguration- Returns:
- The destination folder to render and copy files to
-
setDestinationFolder
public void setDestinationFolder(java.io.File destinationFolder)
- Specified by:
setDestinationFolderin interfaceJBakeConfiguration
-
getDocumentTypes
public java.util.List<java.lang.String> getDocumentTypes()
- Specified by:
getDocumentTypesin interfaceJBakeConfiguration
-
getDraftSuffix
public java.lang.String getDraftSuffix()
- Specified by:
getDraftSuffixin interfaceJBakeConfiguration- Returns:
- Suffix used to identify draft files
-
getError404FileName
public java.lang.String getError404FileName()
- Specified by:
getError404FileNamein interfaceJBakeConfiguration- Returns:
- Output filename for error404 file, is only used when
JBakeConfiguration.getRenderError404()is true
-
getExampleProjectByType
public java.lang.String getExampleProjectByType(java.lang.String templateType)
Description copied from interface:JBakeConfigurationGet name for example project name by given template type- Specified by:
getExampleProjectByTypein interfaceJBakeConfiguration- Parameters:
templateType- a template type- Returns:
- example project name
-
getExportAsciidoctorAttributes
public boolean getExportAsciidoctorAttributes()
- Specified by:
getExportAsciidoctorAttributesin interfaceJBakeConfiguration- Returns:
- Flag indicating if JBake properties should be made available to Asciidoctor
-
getFeedFileName
public java.lang.String getFeedFileName()
- Specified by:
getFeedFileNamein interfaceJBakeConfiguration- Returns:
- Output filename for feed file, is only used when
JBakeConfiguration.getRenderFeed()is true
-
getIgnoreFileName
public java.lang.String getIgnoreFileName()
- Specified by:
getIgnoreFileNamein interfaceJBakeConfiguration- Returns:
- Filename to use to ignore a directory in addition to ".jbakeignore"
-
getIndexFileName
public java.lang.String getIndexFileName()
- Specified by:
getIndexFileNamein interfaceJBakeConfiguration- Returns:
- Output filename for index, is only used when
JBakeConfiguration.getRenderIndex()is true
-
getKeys
public java.util.Iterator<java.lang.String> getKeys()
Description copied from interface:JBakeConfigurationGet an iterator of available configuration keys- Specified by:
getKeysin interfaceJBakeConfiguration- Returns:
- an iterator of configuration keys
-
getMarkdownExtensions
public java.util.List<java.lang.String> getMarkdownExtensions()
Description copied from interface:JBakeConfigurationA list of markdown extensionsmarkdown.extension=HARDWRAPS,AUTOLINKS,FENCED_CODE_BLOCKS,DEFINITIONS- Specified by:
getMarkdownExtensionsin interfaceJBakeConfiguration- Returns:
- list of markdown extensions as string
-
setMarkdownExtensions
public void setMarkdownExtensions(java.lang.String... extensions)
-
getOutputExtension
public java.lang.String getOutputExtension()
- Specified by:
getOutputExtensionin interfaceJBakeConfiguration- Returns:
- file extension to be used for all output files
-
setOutputExtension
public void setOutputExtension(java.lang.String outputExtension)
-
getOutputExtensionByDocType
public java.lang.String getOutputExtensionByDocType(java.lang.String docType)
- Specified by:
getOutputExtensionByDocTypein interfaceJBakeConfiguration
-
getPaginateIndex
public boolean getPaginateIndex()
- Specified by:
getPaginateIndexin interfaceJBakeConfiguration- Returns:
- Flag indicating if there should be pagination when rendering index
-
setPaginateIndex
public void setPaginateIndex(boolean paginateIndex)
-
getPostsPerPage
public int getPostsPerPage()
- Specified by:
getPostsPerPagein interfaceJBakeConfiguration- Returns:
- How many posts per page on index
-
setPostsPerPage
public void setPostsPerPage(int postsPerPage)
-
getPrefixForUriWithoutExtension
public java.lang.String getPrefixForUriWithoutExtension()
- Specified by:
getPrefixForUriWithoutExtensionin interfaceJBakeConfiguration- Returns:
- URI prefix for content that should be given extension-less output URI's
-
setPrefixForUriWithoutExtension
public void setPrefixForUriWithoutExtension(java.lang.String prefix)
-
getRenderArchive
public boolean getRenderArchive()
- Specified by:
getRenderArchivein interfaceJBakeConfiguration- Returns:
- Flag indicating if archive file should be generated
-
getRenderEncoding
public java.lang.String getRenderEncoding()
- Specified by:
getRenderEncodingin interfaceJBakeConfiguration- Returns:
- Encoding used when rendering files
-
getOutputEncoding
public java.lang.String getOutputEncoding()
- Specified by:
getOutputEncodingin interfaceJBakeConfiguration- Returns:
- Output encoding for freemarker url escaping
-
getRenderError404
public boolean getRenderError404()
- Specified by:
getRenderError404in interfaceJBakeConfiguration- Returns:
- Flag indicating if error404 file should be generated
-
getRenderFeed
public boolean getRenderFeed()
- Specified by:
getRenderFeedin interfaceJBakeConfiguration- Returns:
- Flag indicating if feed file should be generated
-
getRenderIndex
public boolean getRenderIndex()
- Specified by:
getRenderIndexin interfaceJBakeConfiguration- Returns:
- Flag indicating if index file should be generated
-
getRenderSiteMap
public boolean getRenderSiteMap()
- Specified by:
getRenderSiteMapin interfaceJBakeConfiguration- Returns:
- Flag indicating if sitemap file should be generated
-
getRenderTags
public boolean getRenderTags()
- Specified by:
getRenderTagsin interfaceJBakeConfiguration- Returns:
- Flag indicating if tag files should be generated
-
getRenderTagsIndex
public boolean getRenderTagsIndex()
- Specified by:
getRenderTagsIndexin interfaceJBakeConfiguration- Returns:
- Flag indicating if tag index file should be generated
-
setRenderTagsIndex
public void setRenderTagsIndex(boolean enable)
-
getSanitizeTag
public boolean getSanitizeTag()
- Specified by:
getSanitizeTagin interfaceJBakeConfiguration- Returns:
- Flag indicating if the tag value should be sanitized
-
getServerPort
public int getServerPort()
- Specified by:
getServerPortin interfaceJBakeConfiguration- Returns:
- Port used when running Jetty server
-
setServerPort
public void setServerPort(int port)
-
getSiteHost
public java.lang.String getSiteHost()
- Specified by:
getSiteHostin interfaceJBakeConfiguration- Returns:
- the host url of the site e.g. http://jbake.org
-
setSiteHost
public void setSiteHost(java.lang.String siteHost)
-
getSiteMapFileName
public java.lang.String getSiteMapFileName()
- Specified by:
getSiteMapFileNamein interfaceJBakeConfiguration- Returns:
- Sitemap template file name. Used only when
JBakeConfiguration.getRenderSiteMap()is set to true
-
getSourceFolder
public java.io.File getSourceFolder()
- Specified by:
getSourceFolderin interfaceJBakeConfiguration- Returns:
- the source folder of the project
-
setSourceFolder
public void setSourceFolder(java.io.File sourceFolder)
-
getTagPathName
public java.lang.String getTagPathName()
- Specified by:
getTagPathNamein interfaceJBakeConfiguration- Returns:
- Tags output path, used only when
JBakeConfiguration.getRenderTags()is true
-
getTemplateEncoding
public java.lang.String getTemplateEncoding()
- Specified by:
getTemplateEncodingin interfaceJBakeConfiguration- Returns:
- Encoding to be used for template files
-
getTemplateFileByDocType
public java.io.File getTemplateFileByDocType(java.lang.String docType)
- Specified by:
getTemplateFileByDocTypein interfaceJBakeConfiguration
-
getTemplateFolder
public java.io.File getTemplateFolder()
- Specified by:
getTemplateFolderin interfaceJBakeConfiguration- Returns:
- the template folder
-
setTemplateFolder
public void setTemplateFolder(java.io.File templateFolder)
-
getTemplateFolderName
public java.lang.String getTemplateFolderName()
- Specified by:
getTemplateFolderNamein interfaceJBakeConfiguration- Returns:
- name of folder where template files are looked for
-
getThymeleafLocale
public java.lang.String getThymeleafLocale()
- Specified by:
getThymeleafLocalein interfaceJBakeConfiguration- Returns:
- Locale used for Thymeleaf template rendering
-
getUriWithoutExtension
public boolean getUriWithoutExtension()
- Specified by:
getUriWithoutExtensionin interfaceJBakeConfiguration- Returns:
- Flag indicating if content matching prefix below should be given extension-less URI's
-
setUriWithoutExtension
public void setUriWithoutExtension(boolean withoutExtension)
-
getVersion
public java.lang.String getVersion()
- Specified by:
getVersionin interfaceJBakeConfiguration- Returns:
- Version of JBake
-
setDestinationFolderName
public void setDestinationFolderName(java.lang.String folderName)
-
setExampleProject
public void setExampleProject(java.lang.String type, java.lang.String fileName)
-
setProperty
public void setProperty(java.lang.String key, java.lang.Object value)Description copied from interface:JBakeConfigurationSet a property value for the given key- Specified by:
setPropertyin interfaceJBakeConfiguration- Parameters:
key- the key for the propertyvalue- the value of the property
-
getThymeleafModeByType
public java.lang.String getThymeleafModeByType(java.lang.String type)
- Specified by:
getThymeleafModeByTypein interfaceJBakeConfiguration- Parameters:
type- the documents type- Returns:
- the the thymeleaf render mode ( defaults to
DEFAULT_TYHMELEAF_TEMPLATE_MODE)
-
getServerContextPath
public java.lang.String getServerContextPath()
- Specified by:
getServerContextPathin interfaceJBakeConfiguration
-
getServerHostname
public java.lang.String getServerHostname()
- Specified by:
getServerHostnamein interfaceJBakeConfiguration
-
asHashMap
public java.util.Map<java.lang.String,java.lang.Object> asHashMap()
- Specified by:
asHashMapin interfaceJBakeConfiguration
-
setTemplateExtensionForDocType
public void setTemplateExtensionForDocType(java.lang.String docType, java.lang.String extension)
-
setTemplateFileNameForDocType
public void setTemplateFileNameForDocType(java.lang.String docType, java.lang.String fileName)
-
getHeaderSeparator
public java.lang.String getHeaderSeparator()
- Specified by:
getHeaderSeparatorin interfaceJBakeConfiguration- Returns:
- String used to separate the header from the body
-
setHeaderSeparator
public void setHeaderSeparator(java.lang.String headerSeparator)
-
getImgPathPrependHost
public boolean getImgPathPrependHost()
- Specified by:
getImgPathPrependHostin interfaceJBakeConfiguration- Returns:
- Flag indicating if image paths should be prepended with
JBakeConfiguration.getSiteHost()value - only has an effect ifJBakeConfiguration.getImgPathUpdate()is set to true
-
setImgPathPrependHost
public void setImgPathPrependHost(boolean imgPathPrependHost)
-
getImgPathUpdate
public boolean getImgPathUpdate()
- Specified by:
getImgPathUpdatein interfaceJBakeConfiguration- Returns:
- Flag indicating if image paths in content should be updated with absolute path (using URI value of content file),
see
JBakeConfiguration.getImgPathUpdate()which allows you to control the absolute path used
-
setImgPathUPdate
public void setImgPathUPdate(boolean imgPathUpdate)
-
getJbakeProperties
public java.util.List<Property> getJbakeProperties()
- Specified by:
getJbakePropertiesin interfaceJBakeConfiguration
-
addConfiguration
public void addConfiguration(java.util.Properties properties)
- Specified by:
addConfigurationin interfaceJBakeConfiguration
-
getAbbreviatedGitHash
public java.lang.String getAbbreviatedGitHash()
- Specified by:
getAbbreviatedGitHashin interfaceJBakeConfiguration- Returns:
- Abbreviated hash of latest git commit
-
getJvmLocale
public java.lang.String getJvmLocale()
- Specified by:
getJvmLocalein interfaceJBakeConfiguration- Returns:
- Locale to set in the JVM
-
-