Class ScriptUrlTemplateScannerImpl
- java.lang.Object
-
- org.craftercms.engine.scripting.impl.ScriptUrlTemplateScannerImpl
-
- All Implemented Interfaces:
ScriptUrlTemplateScanner
public class ScriptUrlTemplateScannerImpl extends Object implements ScriptUrlTemplateScanner
Default implementation ofScriptUrlTemplateScanner, which retrieves all the Groovy scripts at the specifiedscriptsFolderpath, and then looks for those that have the URL variable placeholder in them.- Author:
- avasquez
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_URL_VARIABLE_PLACEHOLDER_PATTERNprotected StringscriptsFolderprotected PatternurlVariablePlaceholderPattern
-
Constructor Summary
Constructors Constructor Description ScriptUrlTemplateScannerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfindScripts(org.craftercms.core.service.Context context, org.craftercms.core.service.ContentStoreService storeService, ScriptFactory scriptFactory, String folder, List<String> scriptUrls)List<org.springframework.web.util.UriTemplate>scan(SiteContext siteContext)Scans the site context at a certain path to discover script URL templates.voidsetScriptsFolder(String scriptsFolder)voidsetUrlVariablePlaceholderPattern(String urlVariablePlaceholderPattern)
-
-
-
Field Detail
-
DEFAULT_URL_VARIABLE_PLACEHOLDER_PATTERN
public static final String DEFAULT_URL_VARIABLE_PLACEHOLDER_PATTERN
- See Also:
- Constant Field Values
-
urlVariablePlaceholderPattern
protected Pattern urlVariablePlaceholderPattern
-
scriptsFolder
protected String scriptsFolder
-
-
Method Detail
-
setUrlVariablePlaceholderPattern
public void setUrlVariablePlaceholderPattern(String urlVariablePlaceholderPattern)
-
setScriptsFolder
public void setScriptsFolder(String scriptsFolder)
-
scan
public List<org.springframework.web.util.UriTemplate> scan(SiteContext siteContext)
Description copied from interface:ScriptUrlTemplateScannerScans the site context at a certain path to discover script URL templates.- Specified by:
scanin interfaceScriptUrlTemplateScanner- Parameters:
siteContext- the site context to scan- Returns:
- the list of URL templates
-
findScripts
public void findScripts(org.craftercms.core.service.Context context, org.craftercms.core.service.ContentStoreService storeService, ScriptFactory scriptFactory, String folder, List<String> scriptUrls)
-
-