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 specifiedscriptsFolder
path, and then looks for those that have the URL variable placeholder in them.- Author:
- avasquez
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_URL_VARIABLE_PLACEHOLDER_PATTERN
protected String
scriptsFolder
protected Pattern
urlVariablePlaceholderPattern
-
Constructor Summary
Constructors Constructor Description ScriptUrlTemplateScannerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
findScripts(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.void
setScriptsFolder(String scriptsFolder)
void
setUrlVariablePlaceholderPattern(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:ScriptUrlTemplateScanner
Scans the site context at a certain path to discover script URL templates.- Specified by:
scan
in 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)
-
-