public final class TVCSystem
extends java.lang.Object
The properties of this class is configured using init-params to the TVCServlet. Example:
<servlet>
<servlet-name>tvc_servlet</servlet-name>
<servlet-class>com.technia.tvc.core.TVCServlet</servlet-class>
<init-param>
<param-name>tvc.core.host</param-name>
<param-value>rmi://localhost:1099</param-value>
</init-param>
</servlet>
Besides setting all custom properties directly in the deployment descriptor (The web.xml file), you can create one or more Page objects in the Matrix database and set the page init parameter to contain a comma-separated list of Page object names, then every Page object will be loaded as a .properties file.
Here are the most central properties that can be configured:
Also note that the properties tvc.core.server, tvc.core.host, tvc.core.dateTimeFormat and tvc.core.inputDateTimeFormat are set from the AEF if possible, thereby discarding any settings made in the deployment descriptor.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PROGRAM_INIT_TVC_SYSTEM_USER
Name of program used to fetch TVC System user name/password
|
| Modifier and Type | Method and Description |
|---|---|
static void |
destroyForDebug()
This method should be used to destroy the system from code outside this
package.
|
static <T> T |
execFromJPO(matrix.db.Context ctx,
TxAction<T> action)
This method can be used to run TVC code from within a JPO.
|
java.lang.Boolean |
getBooleanProperty(java.lang.String key)
Returns the system property with the specified key converted to a
Boolean instance.
|
boolean |
getBooleanProperty(java.lang.String key,
boolean defaultValue)
Returns the system property with the specified key converted to a
boolean, or the default value if not such property exist.
|
java.lang.Boolean |
getBooleanProperty(java.lang.String key,
java.lang.Boolean defaultValue)
Returns the system property with the specified key converted to a
Boolean instance, or the default value if not such property
exist.
|
java.lang.String |
getCountry()
Returns the system's default country when retrieving locale sensitive
information.
|
java.lang.String |
getDateTimeFormat()
Returns the system's date time format to use when parsing dates recieved
from the Matrix database.
|
java.lang.String |
getEncoding()
Returns the systems default encoding used when sending/recieving HTTP
information.
|
java.lang.Float |
getFloatProperty(java.lang.String key)
Returns the system property with the specified key converted to a
Float instance.
|
float |
getFloatProperty(java.lang.String key,
float defaultValue)
Returns the system property with the specified key converted to a
float, or the default value if not such property exist.
|
java.lang.Float |
getFloatProperty(java.lang.String key,
java.lang.Float defaultValue)
Returns the system property with the specified key converted to a
Float instance, or the default value if not such property exist.
|
java.lang.String |
getHost()
Returns the default host.
|
java.lang.String |
getInputDateTimeFormat()
Returns the system's date time format to use when setting date time
values in the Matrix database.
|
static TVCSystem |
getInstance()
Returns the TVCSystem instance.
|
java.lang.Integer |
getIntegerProperty(java.lang.String key)
Returns the system property with the specified key converted to a
Integer instance.
|
int |
getIntegerProperty(java.lang.String key,
int defaultValue)
Returns the system property with the specified key converted to an
int, or the default value if not such property exist.
|
java.lang.Integer |
getIntegerProperty(java.lang.String key,
java.lang.Integer defaultValue)
Returns the system property with the specified key converted to a
Integer instance, or the default value if not such property
exist.
|
java.lang.String |
getLanguage()
Returns the system's default language when retrieving locale sensitive
information.
|
java.util.Locale |
getLocale()
Returns the system's default locale when retrieving locale sensitive
information.
|
java.lang.Long |
getLongProperty(java.lang.String key)
Returns the system property with the specified key converted to a
Long instance.
|
long |
getLongProperty(java.lang.String key,
long defaultValue)
Returns the system property with the specified key converted to a
long, or the default value if not such property exist.
|
java.lang.Long |
getLongProperty(java.lang.String key,
java.lang.Long defaultValue)
Returns the system property with the specified key converted to a
Long instance, or the default value if not such property exist.
|
com.technia.tvc.core.resource.TVCPropertyMessageResources |
getMessageResources()
Returns the message resource bundle, used to localize messages or UI
labels within the TVC subsystem.
|
java.lang.String |
getPassword()
Returns the system user's password.
|
java.lang.String |
getProperty(java.lang.String key)
Returns the system property with the specified key.
|
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Returns the system property with the specified key, or the default value
if not such property exist.
|
com.technia.tvc.core.res.ResourceDefLocator |
getResourceLocator()
Returns the
resource locator used to ... |
java.lang.String |
getServer()
Deprecated.
Deprecated in ADK 10.6.3 or later.
|
long |
getStartupTime()
Returns the time when TVC was started (or when TVC System was
initialized)
|
java.lang.String |
getTempDir()
Returns the path to the application's temp directory.
|
java.lang.String |
getUser()
Returns the system user's name.
|
java.lang.String |
getWebappRootDir()
Returns the path to the webapp root directory.
|
static void |
initForDebug(java.util.Properties prop)
This method is the only way to initialize the system from code outside
this package.
|
boolean |
isDevelopmentMode()
Returns whether the application is running in development mode or not.
|
static boolean |
isInitialized()
Returns true if the system has been initialized.
|
static boolean |
isInitializedForDebug()
Returns true if the system has been initialized for debug.
|
static boolean |
isNotInitialized()
Returns true if the system has NOT been initialized.
|
boolean |
isProductionMode()
Returns whether the application is running in production mode or not.
|
java.util.Iterator<java.lang.String> |
propertyKeys()
Returns an iterator over the available property keys.
|
java.util.Iterator<java.lang.String> |
propertyKeys(java.lang.String prefix)
Returns an iterator over the available property keys starting with the
specified prefix.
|
void |
setProductionMode(boolean productionMode)
Sets the production mode
|
public static final java.lang.String PROGRAM_INIT_TVC_SYSTEM_USER
public long getStartupTime()
public com.technia.tvc.core.resource.TVCPropertyMessageResources getMessageResources()
These resources were previously only available from the servlet context, thus making it impossible to use these resources from any code outside the "servlet/jsp/custom tag" area.
public java.lang.String getProperty(java.lang.String key)
key - the key to the property.public java.lang.String getProperty(java.lang.String key,
java.lang.String defaultValue)
key - the key to the property.defaultValue - the default value.public java.util.Iterator<java.lang.String> propertyKeys()
public java.util.Iterator<java.lang.String> propertyKeys(java.lang.String prefix)
prefix - the property prefix.public java.lang.Boolean getBooleanProperty(java.lang.String key)
key - the key to the property.public java.lang.Boolean getBooleanProperty(java.lang.String key,
java.lang.Boolean defaultValue)
key - the key to the property.defaultValue - the default value.public boolean getBooleanProperty(java.lang.String key,
boolean defaultValue)
key - the key to the property.defaultValue - the default value.public java.lang.Integer getIntegerProperty(java.lang.String key)
key - the key to the property.public java.lang.Integer getIntegerProperty(java.lang.String key,
java.lang.Integer defaultValue)
key - the key to the property.defaultValue - the default value.public int getIntegerProperty(java.lang.String key,
int defaultValue)
key - the key to the property.defaultValue - the default value.public java.lang.Long getLongProperty(java.lang.String key)
key - the key to the property.public java.lang.Long getLongProperty(java.lang.String key,
java.lang.Long defaultValue)
key - the key to the property.defaultValue - the default value.public long getLongProperty(java.lang.String key,
long defaultValue)
key - the key to the property.defaultValue - the default value.public java.lang.Float getFloatProperty(java.lang.String key)
key - the key to the property.public java.lang.Float getFloatProperty(java.lang.String key,
java.lang.Float defaultValue)
key - the key to the property.defaultValue - the default value.public float getFloatProperty(java.lang.String key,
float defaultValue)
key - the key to the property.defaultValue - the default value.@Deprecated public java.lang.String getServer()
public java.lang.String getHost()
public java.lang.String getUser()
public java.lang.String getPassword()
public java.lang.String getDateTimeFormat()
public java.lang.String getInputDateTimeFormat()
public java.lang.String getCountry()
public java.lang.String getLanguage()
public java.util.Locale getLocale()
public java.lang.String getEncoding()
public boolean isProductionMode()
public void setProductionMode(boolean productionMode)
public boolean isDevelopmentMode()
public java.lang.String getWebappRootDir()
public java.lang.String getTempDir()
public com.technia.tvc.core.res.ResourceDefLocator getResourceLocator()
resource locator used to ...public static TVCSystem getInstance()
TVCSystemUnavailableException - if the system has not been properly
setup.public static void initForDebug(java.util.Properties prop)
prop - the properties.TVCSystemAlreadyInitializedException - if the system has already
been initialized.destroyForDebug()public static void destroyForDebug()
initForDebug(Properties)public static boolean isNotInitialized()
public static boolean isInitialized()
public static boolean isInitializedForDebug()
public static <T> T execFromJPO(matrix.db.Context ctx,
TxAction<T> action)
throws TVCException,
TxException,
TxActionException
ctx - The context.action - The action to execute.TVCException - If unable to initialize TVCSystem or execute the
action.TxException - If an exception is thrown while executing the action.TxActionException - If an exception is thrown from the
action.Copyright ? Technia AB. All Rights Reserved.