Class ScriptUrlTemplateScannerImpl

java.lang.Object
org.craftercms.engine.scripting.impl.ScriptUrlTemplateScannerImpl
All Implemented Interfaces:
ScriptUrlTemplateScanner

public class ScriptUrlTemplateScannerImpl extends Object implements ScriptUrlTemplateScanner
Default implementation of ScriptUrlTemplateScanner, which retrieves all the Groovy scripts at the specified scriptsFolder path, and then looks for those that have the URL variable placeholder in them.
Author:
avasquez
  • Field Details

    • DEFAULT_URL_VARIABLE_PLACEHOLDER_PATTERN

      public static final String DEFAULT_URL_VARIABLE_PLACEHOLDER_PATTERN
      See Also:
    • urlVariablePlaceholderPattern

      protected Pattern urlVariablePlaceholderPattern
    • scriptsFolder

      protected String scriptsFolder
  • Constructor Details

    • ScriptUrlTemplateScannerImpl

      public ScriptUrlTemplateScannerImpl()
  • Method Details

    • 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 interface ScriptUrlTemplateScanner
      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)