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
ConstructorsConstructorDescriptionFolderScanningSiteListResolver
(String siteRootFolderPath, MacroResolver macroResolver) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Returns the entire list of sites.protected File
void
setResourceLoader
(org.springframework.core.io.ResourceLoader resourceLoader) void
setSiteNameMacroName
(String siteNameMacroName)
-
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
-
-
Method Details
-
setSiteNameMacroName
-
setResourceLoader
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) - Specified by:
setResourceLoader
in interfaceorg.springframework.context.ResourceLoaderAware
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
getSiteList
Description copied from interface:SiteListResolver
Returns the entire list of sites.- Specified by:
getSiteList
in interfaceSiteListResolver
-
getSitesFolder
-