com.opencms.boot
Class CmsBase

java.lang.Object
  |
  +--com.opencms.boot.CmsBase
All Implemented Interfaces:
I_CmsLogChannels

public class CmsBase
extends Object
implements I_CmsLogChannels

OpenCms Base class for static access to system wide properties and helper functions, e.g. OpenCms logging oder OpenCms base path.

Version:
$Revision: 1.9 $ $Date: 2003/01/20 23:59:26 $
Author:
Alexander Lucas

Field Summary
protected static boolean c_servletLogging
          Indicates if the system log is initialized
 
Fields inherited from interface com.opencms.boot.I_CmsLogChannels
C_FLEX_CACHE, C_FLEX_LOADER, C_LOGGING, C_MODULE_CRITICAL, C_MODULE_DEBUG, C_MODULE_INFO, C_OPENCMS_CACHE, C_OPENCMS_CRITICAL, C_OPENCMS_CRONSCHEDULER, C_OPENCMS_DEBUG, C_OPENCMS_ELEMENTCACHE, C_OPENCMS_INFO, C_OPENCMS_INIT, C_OPENCMS_POOL, C_OPENCMS_STATICEXPORT, C_OPENCMS_STREAMING, C_PREPROCESSOR_IS_LOGGING
 
Constructor Summary
CmsBase()
           
 
Method Summary
static String getAbsolutePath(String s)
           
static String getAbsoluteWebPath(String s)
           
static String getBasePath()
          Get the OpenCms base path
static String getPropertiesPath(boolean absolute)
           
static String getWebAppName()
          Get the OpenCms WebApplicationName
static String getWebBasePath()
          Get the OpenCms web-base path
static void initializeServletLogging(source.org.apache.java.util.Configurations config)
          Initialize the logging mechanism of the Jserv
static boolean isLogging()
          Check if the system logging is active.
static boolean isLogging(String channel)
          Check if the system logging is active for the selected channel.
static void log(String channel, String message)
          Log a message into the OpenCms logfile.
static String setBasePath(String s)
          Set the base path to the given value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

c_servletLogging

protected static boolean c_servletLogging
Indicates if the system log is initialized

Constructor Detail

CmsBase

public CmsBase()
Method Detail

initializeServletLogging

public static void initializeServletLogging(source.org.apache.java.util.Configurations config)
Initialize the logging mechanism of the Jserv


isLogging

public static boolean isLogging()
Check if the system logging is active.

Returns:
true if the logging is active, false otherwise.

isLogging

public static boolean isLogging(String channel)
Check if the system logging is active for the selected channel.

Returns:
true if the logging is active for the selected channel, false otherwise.

log

public static void log(String channel,
                       String message)
Log a message into the OpenCms logfile. If the logfile was not initialized (e.g. due tue a missing ServletConfig while working with the console) any log output will be written to the apache error log.

Parameters:
channel - The channel the message is logged into
message - The message to be logged,

setBasePath

public static String setBasePath(String s)
Set the base path to the given value


getBasePath

public static String getBasePath()
Get the OpenCms base path


getWebBasePath

public static String getWebBasePath()
Get the OpenCms web-base path


getWebAppName

public static String getWebAppName()
Get the OpenCms WebApplicationName


getAbsoluteWebPath

public static String getAbsoluteWebPath(String s)

getAbsolutePath

public static String getAbsolutePath(String s)

getPropertiesPath

public static String getPropertiesPath(boolean absolute)