codeflood logo

Configuring the Script Locators

For Revolver version 3+

Script locators are used to locate scripts the user can execute. Revolver includes 2 script locators OOTB, one for locating scripts in the Sitecore database and another for locating scripts from disk.

Script locators are configured through the /configuration/sitecore/revolver/script/locator configuration node which is defined in the App_Config\Include\Revolver.config configuration patch file. Below is the default script locator configuration.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
	<sitecore>
	<!-- Revolver specific settings -->
	<revolver>
		<script>
		<!-- Defines the script locators -->
		<locator>
			<!-- Locates scripts from a Sitecore content database -->
			<database type="Revolver.Core.ScriptLocator.DatabaseScriptLocator, Revolver.Core">
				<param name="database">core</param>
				<param name="path">/sitecore/system/modules/revolver/scripts</param>
			</database>
			<!-- Locates scripts from a folder on disk -->
			<file type="Revolver.Core.ScriptLocator.FileScriptLocator, Revolver.Core">
				<param name="path">/sitecore modules/shell/revolver/scripts</param>
				<param name="extension">rs</param>
			</file>
		</locator>
		</script>
	</revolver>
	</sitecore>
</configuration>

Database Script Locator

The first locator above, given by the database node, configures a database script locator. This locator locates scripts inside a Sitecore content database. The following parameters can be set, given by the param child nodes.

Parameter Purpose
<param name="database">core</param> The name of the database to search for scripts in.
<param name="path">/sitecore/system/modules/revolver/scripts</param> The path in the database to start searching from. Scripts must be a descendant of this item.

File Script Locator

The second locator above, given by the file node, configures a file script locator. This locator locates scripts in a folder on the same disk as the Sitecore instance. The following parameters can be set, given by the param child nodes.

Parameter Purpose
<param name="path">/sitecore modules/shell/revolver/scripts</param> The relative path to a folder under the Sitecore application to find the script files.
<param name="extension">rs</param> The file extension to look for.