Velocity Tools Velocity Context Provider

Note: this component is designated "advanced", which means that objects of this type are not expected to be created or altered in most environments. If you believe that such a change is necessary, you may want to contact support in order to understand the potential impact of that change.

The Velocity Tools Velocity Context Provider manages the set of Velocity Tools that are exposed in the Velocity contexts. This provider will contribute tools for all HTTP requests regardless of the method specified.

Parent Component Properties dsconfig Usage

Parent Component

The Velocity Tools Velocity Context Provider component inherits from the Velocity Context Provider

Properties

The properties supported by this managed object are as follows:


Basic Properties: Advanced Properties:
 enabled  None
 object-scope
 included-view
 excluded-view
 response-header
 request-tool
 session-tool
 application-tool

Basic Properties

enabled

Description
Indicates whether this Velocity Context Provider is enabled. If set to 'false' this Velocity Context Provider will not contribute context content for any requests.
Default Value
true
Allowed Values
true
false
Multi-Valued
No
Required
No
Admin Action Required
None. Modification requires no further action

object-scope

Description
Scope for context objects contributed by this Velocity Context Provider. Must be either 'request' or 'session' or 'application'.
Default Value
application
Allowed Values
application - Objects contributed by this Velocity Context Provider need only once per the life of the server's JVM instance.

session - Objects contributed by this Velocity Context Provider should be created once per the current client request's session.

request - Objects contributed by this Velocity Context Provider should be created for each client request.
Multi-Valued
No
Required
No
Admin Action Required
None. Modification requires no further action

included-view

Description
The name of a view for which this Velocity Context Provider will contribute content. A provider may be restricted to specific views using the included-view and excluded-view properties. If one or more views are specified by this property then only requests for those views will result in this Velocity Context Provider contributing content for the request's Velocity context. If this property is unspecified and this provider is not excluded by the excluded-view property, this provider will contribute content for all requests.

A view name is the URL request path to a template that does not include the HTTP servlet extension's base context path, nor a starting path separator. So for example if a template was accessible by the URL http://localhost:8080/view/path/to/template the view name would be 'path/to/template'.

Default Value
None
Allowed Values
A string
Multi-Valued
Yes
Required
No
Admin Action Required
None. Modification requires no further action

excluded-view

Description
The name of a view for which this Velocity Context Provider will not contribute content. A Velocity Context Provider may be restricted to specific views using the included-view and excluded-view properties. If one or more views are specified by this property then this provider will not contribute content for the request's Velocity context.

A view name is the URL request path to a template that does not include the HTTP servlet extension's base context path, nor a starting path separator. So for example if a template was accessible by the URL http://localhost:8080/view/path/to/template the view name would be 'path/to/template'.

Default Value
None
Allowed Values
A string
Multi-Valued
Yes
Required
No
Admin Action Required
None. Modification requires no further action

response-header

Description
Specifies HTTP header fields and values added to response headers for template page requests to which this Velocity Context Provider contributes content. The values specified here will override those configured for the same field names in the Velocity HTTP Servlet Extension. A Velocity Context Provider may also manipulate header fields in its updateContext method by updating the HTTP response directly.

Values specified here must specify both the header field name and the value in conformance with RFC 2616. Fields may only be specified once; multiple values for the same header should be comma-separated. See RFC 7231 for a standard set of field names.

Default Value
None
Allowed Values
Colon-separated header field name and value
Multi-Valued
Yes
Required
No
Admin Action Required
None. Modification requires no further action

request-tool

Description
The fully-qualified name of a Velocity Tool class that will be initialized for each request. May optionally include a path to a properties file used to configure this tool separated from the class name by a semi-colon (;). The path may absolute or relative to the server root. All classes specified using this property must be marked with the org.apache.velocity.tools.config.DefaultKey class annotation.
Default Value
None
Allowed Values
Velocity Tool class name and optional path to a properties file that will be used to initialize the tool instance when it is instantiated, separated by a semi-colon. For example, org/apache/velocity/tools/generic/ResourceTool;/path/to/file. The path may absolute or relative to the server root.
Multi-Valued
Yes
Required
No
Admin Action Required
None. Modification requires no further action

session-tool

Description
The fully-qualified name of a Velocity Tool class that will be initialized for each session. May optionally include a path to a properties file used to configure this tool separated from the class name by a semi-colon (;). The path may absolute or relative to the server root. All classes specified using this property must be marked with the org.apache.velocity.tools.config.DefaultKey class annotation.
Default Value
None
Allowed Values
Velocity Tool class name and optional path to a properties file that will be used to initialize the tool instance when it is instantiated, separated by a semi-colon. For example, org/apache/velocity/tools/generic/ResourceTool;/path/to/file. The path may absolute or relative to the server root.
Multi-Valued
Yes
Required
No
Admin Action Required
None. Modification requires no further action

application-tool

Description
The fully-qualified name of a Velocity Tool class that will be initialized once for the life of the server. May optionally include a path to a properties file used to configure this tool separated from the class name by a semi-colon (;). The path may absolute or relative to the server root. All classes specified using this property must be marked with the org.apache.velocity.tools.config.DefaultKey class annotation.
Default Value
None
Allowed Values
Velocity Tool class name and optional path to a properties file that will be used to initialize the tool instance when it is instantiated, separated by a semi-colon. For example, org/apache/velocity/tools/generic/ResourceTool;/path/to/file. The path may absolute or relative to the server root.
Multi-Valued
Yes
Required
No
Admin Action Required
None. Modification requires no further action


dsconfig Usage

To list the configured Velocity Context Providers:

dsconfig list-velocity-context-providers
     [--property {propertyName}] ...

To view the configuration for an existing Velocity Context Provider:

dsconfig get-velocity-context-provider-prop
     --provider-name {name}
     --extension-name {name}
     [--tab-delimited]
     [--script-friendly]
     [--property {propertyName}] ...

To update the configuration for an existing Velocity Context Provider:

dsconfig set-velocity-context-provider-prop
     --provider-name {name}
     --extension-name {name}
     (--set|--add|--remove) {propertyName}:{propertyValue}
     [(--set|--add|--remove) {propertyName}:{propertyValue}] ...

To create a new Velocity Tools Velocity Context Provider:

dsconfig create-velocity-context-provider
     --provider-name {name}
     --extension-name {name}
     --type velocity-tools
     [--set {propertyName}:{propertyValue}] ...

To delete an existing Velocity Context Provider:

dsconfig delete-velocity-context-provider
     --provider-name {name}
     --extension-name {name}