Package org.craftercms.engine.properties
Class SiteProperties
- java.lang.Object
-
- org.craftercms.engine.properties.SiteProperties
-
public class SiteProperties extends Object
Properties specific of the current site.- Author:
- avasquez
-
-
Field Summary
Fields Modifier and Type Field Description static String
AVAILABLE_TARGET_IDS_CONFIG_KEY
static String
CACHE_WARMUP_CONTENT_FOLDERS_CONFIG_KEY
static String
CACHE_WARMUP_DESCRIPTOR_FOLDERS_CONFIG_KEY
Cache warm-up propertiesstatic String
DEFAULT_INDEX_FILE_NAME
static String
DEFAULT_SPA_VIEW_NAME
static String
DISABLE_FULL_MODEL_TYPE_CONVERSION_CONFIG_KEY
static String
EXCLUDE_PATTERNS_CONFIG_KEY
static String
FALLBACK_ID_CONFIG_KEY
static String
INDEX_FILE_NAME_CONFIG_KEY
static String
MERGE_FOLDERS_CONFIG_KEY
static String
NAVIGATION_ADDITIONAL_FIELDS_CONFIG_KEY
static String
REDIRECT_TO_TARGETED_URL_CONFIG_KEY
static String
ROOT_FOLDERS_CONFIG_KEY
static String
SPA_ENABLED_CONFIG_KEY
static String
SPA_VIEW_NAME
static String
TARGETING_ENABLED_CONFIG_KEY
-
Constructor Summary
Constructors Constructor Description SiteProperties()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String[]
getAvailableTargetIds()
Returns the list of available target IDs.static Map<String,Integer>
getContentPreloadFolders()
Gets the list of content folders to preload in the cache.static Map<String,Integer>
getDescriptorPreloadFolders()
Gets the list of descriptor folders to preload in the cache.static String[]
getExcludePatterns()
Returns the patterns that a path might match if it should be excludedstatic String
getFallbackTargetId()
Returns the fallback target ID.static String
getIndexFileName()
Returns the name of a page's index file, orDEFAULT_INDEX_FILE_NAME
if not in configuration.static String[]
getNavigationAdditionalFields()
Returns the list of additional fields that navigation items should extract from the item descriptor.static String[]
getRootFolders()
Returns the folders that will be handled for targeted content.static String
getSpaViewName()
Returns the view name for the SPA (Single Page Application).static boolean
isDisableFullModelTypeConversion()
Returns true if full content model type conversion should be disabled.static boolean
isMergeFolders()
Returns true if the sub items of folders with the same family of target IDs should be merged (e.g.static boolean
isRedirectToTargetedUrl()
Returns true if the request should be redirected when the targeted URL is different from the current URL.static boolean
isSpaEnabled()
Returns true if SPA (Single Page App) mode is enabled.static boolean
isTargetingEnabled()
Returns trues if targeting is enabled.
-
-
-
Field Detail
-
INDEX_FILE_NAME_CONFIG_KEY
public static final String INDEX_FILE_NAME_CONFIG_KEY
- See Also:
- Constant Field Values
-
DISABLE_FULL_MODEL_TYPE_CONVERSION_CONFIG_KEY
public static final String DISABLE_FULL_MODEL_TYPE_CONVERSION_CONFIG_KEY
- See Also:
- Constant Field Values
-
NAVIGATION_ADDITIONAL_FIELDS_CONFIG_KEY
public static final String NAVIGATION_ADDITIONAL_FIELDS_CONFIG_KEY
- See Also:
- Constant Field Values
-
SPA_ENABLED_CONFIG_KEY
public static final String SPA_ENABLED_CONFIG_KEY
- See Also:
- Constant Field Values
-
SPA_VIEW_NAME
public static final String SPA_VIEW_NAME
- See Also:
- Constant Field Values
-
TARGETING_ENABLED_CONFIG_KEY
public static final String TARGETING_ENABLED_CONFIG_KEY
- See Also:
- Constant Field Values
-
AVAILABLE_TARGET_IDS_CONFIG_KEY
public static final String AVAILABLE_TARGET_IDS_CONFIG_KEY
- See Also:
- Constant Field Values
-
FALLBACK_ID_CONFIG_KEY
public static final String FALLBACK_ID_CONFIG_KEY
- See Also:
- Constant Field Values
-
ROOT_FOLDERS_CONFIG_KEY
public static final String ROOT_FOLDERS_CONFIG_KEY
- See Also:
- Constant Field Values
-
EXCLUDE_PATTERNS_CONFIG_KEY
public static final String EXCLUDE_PATTERNS_CONFIG_KEY
- See Also:
- Constant Field Values
-
MERGE_FOLDERS_CONFIG_KEY
public static final String MERGE_FOLDERS_CONFIG_KEY
- See Also:
- Constant Field Values
-
REDIRECT_TO_TARGETED_URL_CONFIG_KEY
public static final String REDIRECT_TO_TARGETED_URL_CONFIG_KEY
- See Also:
- Constant Field Values
-
CACHE_WARMUP_DESCRIPTOR_FOLDERS_CONFIG_KEY
public static final String CACHE_WARMUP_DESCRIPTOR_FOLDERS_CONFIG_KEY
Cache warm-up properties- See Also:
- Constant Field Values
-
CACHE_WARMUP_CONTENT_FOLDERS_CONFIG_KEY
public static final String CACHE_WARMUP_CONTENT_FOLDERS_CONFIG_KEY
- See Also:
- Constant Field Values
-
DEFAULT_INDEX_FILE_NAME
public static final String DEFAULT_INDEX_FILE_NAME
- See Also:
- Constant Field Values
-
DEFAULT_SPA_VIEW_NAME
public static final String DEFAULT_SPA_VIEW_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
isTargetingEnabled
public static boolean isTargetingEnabled()
Returns trues if targeting is enabled.
-
getAvailableTargetIds
public static String[] getAvailableTargetIds()
Returns the list of available target IDs.
-
getFallbackTargetId
public static String getFallbackTargetId()
Returns the fallback target ID. The fallback target ID is used in case none of the resolved candidate targeted URLs map to existing content.
-
getRootFolders
public static String[] getRootFolders()
Returns the folders that will be handled for targeted content.
-
getExcludePatterns
public static String[] getExcludePatterns()
Returns the patterns that a path might match if it should be excluded
-
isMergeFolders
public static boolean isMergeFolders()
Returns true if the sub items of folders with the same family of target IDs should be merged (e.g. "en_US" and "en" are of the same family).
-
isRedirectToTargetedUrl
public static boolean isRedirectToTargetedUrl()
Returns true if the request should be redirected when the targeted URL is different from the current URL.
-
getIndexFileName
public static final String getIndexFileName()
Returns the name of a page's index file, orDEFAULT_INDEX_FILE_NAME
if not in configuration.
-
isDisableFullModelTypeConversion
public static boolean isDisableFullModelTypeConversion()
Returns true if full content model type conversion should be disabled. Up to and including version 2: Crafter Engine, in the FreeMarker host only, converts model elements based on a suffix type hint, but only for the first level in the model, and not for _dt. For example, for contentModel.myvalue_i Integer is returned, but for contentModel.repeater.myvalue_i and contentModel.date_dt a String is returned. In the Groovy host no type of conversion was performed. In version 3 onwards, Crafter Engine converts elements with any suffix type hints (including _dt) at at any level in the content model and for both Freemarker and Groovy hosts.
-
getNavigationAdditionalFields
public static String[] getNavigationAdditionalFields()
Returns the list of additional fields that navigation items should extract from the item descriptor.
-
isSpaEnabled
public static boolean isSpaEnabled()
Returns true if SPA (Single Page App) mode is enabled.
-
getSpaViewName
public static String getSpaViewName()
Returns the view name for the SPA (Single Page Application). Current view names can be a page URL (like /) or a template name (like /template/web/app.ftl). By default, if SPA is enabled and no view name config property is found, / is returned.
-
getDescriptorPreloadFolders
public static final Map<String,Integer> getDescriptorPreloadFolders()
Gets the list of descriptor folders to preload in the cache. Each folder can have it's depth specified after a colon, likePATH:DEPTH
-
-