Configuration

NuGram Server is configured via context parameters and servlet initialization parameters in the webapp/WEB-INF/web.xml file. The servlet parameters essentially determine which context initializer to use for each dynamic grammar bundled with the server.

Context parameters

The following context parameters (context-param elements) can be customized in the web.xml file:

com.nuecho.application.grammarserver.license-directory
Location of the license directory on the filesystem.
com.nuecho.application.grammarserver.license-server
Machine and port to be used for contacting the Nu Echo license server, separated by a colon. The machine is given either as a hostname or an IP address, the port is given as a decimal number. Either may be omitted, the colon may be omitted if the port is missing. If the machine is undefined or empty, localhost is assumed. If the port is omitted, the default RMI port is used. If the license server does not respond, or has no acceptable license bundle, a degraded license is used.
com.nuecho.application.grammarserver.version-stamp
The version stamp is only used for computing checksums. By changing it, all previous results in caches are invalidated as a consequence. Defaults to 0.0.
com.nuecho.application.grammarserver.grammar-directory
Location of the grammar directory under the web application directory webapp/WEB-INF, used when loading grammars. If undefined or empty (the default), use the webapp grammars directory under webapp/WEB-INF.
com.nuecho.application.grammarserver.engine-id
Name of the target speech recognition engine. This identifier can be accessed from ABNF templates using the expression Global.engineId. The value is application-specific.
com.nuecho.application.grammarserver.input-charset
Charset used while decoding filenames or GET parameters. If undefined or empty (the default), use the platform's default charset.
com.nuecho.application.grammarserver.output-charset
Charset used to encode filenames or GET parameters. If undefined or empty, use UTF-8.
com.nuecho.application.grammarserver.last-modified
As the grammars are part of the packaged archive, a common date is used for time-stamping them all. This date might be the packaging date, or maybe more formally, the date of the youngest grammar within the package. Be careful to the date format (chosen because it is both readable and ISO 8601 compliant): YYYY-MM-DD HH:MM.
com.nuecho.application.grammarserver.max-age-if-dynamic
Max-age, in seconds, to declare for grammar text generated out of a template and context. If undefined or empty, do not declare any. Defaults to 10.
com.nuecho.application.grammarserver.max-age-if-static
Max-age, in seconds, to declare for grammar text returned from a file resource. If undefined or empty, do not declare any. Note that one year is 31556952. This is the default.

Servlet initialization parameters

The following servlet initialization parameters (init-param elements) can be customized in the web.xml file:

com.nuecho.application.grammarserver.default-context-initializer
Change this value to set a different default context initializer. The value must be the name of a class implementing the interface com.nuecho.application.grammarserver.api.ContextInitializer. Defaults to com.nuecho.application.grammarserver.servlets.DefaultContextInitializer.
com.nuecho.application.grammarserver.context-initializers
Add grammar-specific context initializers here. The value must be a line-separated set of mappings, each line being of the form: grammarPath=className


Copyright © 2007,2008,2009,2010,2011 Nu Echo Inc.