Class FolderScanningSiteListResolver
java.lang.Object
org.craftercms.engine.service.context.FolderScanningSiteListResolver
- All Implemented Interfaces:
SiteListResolver,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ResourceLoaderAware
public class FolderScanningSiteListResolver
extends Object
implements SiteListResolver, org.springframework.context.ResourceLoaderAware, org.springframework.beans.factory.InitializingBean
Default implementation of
SiteListResolver. Basically, parses the site root folder path to separate
the folder where all the sites reside and the site folder format. Then, iterates through the children of the
folder looking for site folders that match the format, extracting the site names from the folder name. To better
illustrate, here's an example:
Assume the site root folder path is file:/opt/websites/{siteName}app. The sites folder, or basically the folder that contains all sites, is resolved to /opt/websites. The children of this folder are brochureapp, corporateapp and plutonapp. By using the {siteName}app site name format, the site names are finally determined to be brochure, corporate and pluton.
- Author:
- avasquez
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidReturns the entire list of sites.protected FilevoidsetMacroResolver(MacroResolver macroResolver) voidsetResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) voidsetSiteNameMacroName(String siteNameMacroName) voidsetSiteRootFolderPath(String siteRootFolderPath)
-
Field Details
-
SITE_ROOT_FOLDER_PATH_REGEX
- See Also:
-
SITES_FOLDER_PATH_GROUP
public static final int SITES_FOLDER_PATH_GROUP- See Also:
-
SITE_FOLDER_NAME_FORMAT_GROUP
public static final int SITE_FOLDER_NAME_FORMAT_GROUP- See Also:
-
siteRootFolderPath
-
siteNameMacroName
-
macroResolver
-
resourceLoader
protected org.springframework.core.io.ResourceLoader resourceLoader -
sitesFolderPath
-
siteFolderNamePattern
-
-
Constructor Details
-
FolderScanningSiteListResolver
public FolderScanningSiteListResolver()
-
-
Method Details
-
setSiteRootFolderPath
-
setSiteNameMacroName
-
setMacroResolver
-
setResourceLoader
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) - Specified by:
setResourceLoaderin interfaceorg.springframework.context.ResourceLoaderAware
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
getSiteList
Description copied from interface:SiteListResolverReturns the entire list of sites.- Specified by:
getSiteListin interfaceSiteListResolver
-
getSitesFolder
-