org.hackystat.projectbrowser
Class ProjectBrowserProperties

java.lang.Object
  extended by org.hackystat.projectbrowser.ProjectBrowserProperties

public class ProjectBrowserProperties
extends java.lang.Object

Provides access to the values stored in the sensorbase.properties file.

Author:
Philip Johnson

Field Summary
static java.lang.String ADMIN_EMAIL_KEY
          The admin email key.
static java.lang.String APPLICATION_LOGO_KEY
          Application logo URL.
static java.lang.String APPLICATION_NAME_KEY
          Optional name.
static java.lang.String AVAILABLEPAGE_KEY
          Key for tabs of pages.
static java.lang.String BACKGROUND_PROCESS_KEY
          If background process enable for pages.
static java.lang.String CONTEXT_ROOT_KEY
          The projectbrowser context root.
static java.lang.String DAILYPROJECTDATA_HOST_KEY
          The dpd host.
static java.lang.String HOSTNAME_KEY
          The projectbrowser hostname key.
static java.lang.String LOG_USAGE_KEY
          Directory of portfolio definitions.
static java.lang.String LOGGING_LEVEL_KEY
          The logging level.
static java.lang.String[] PAGE_NAMES
          Available pages.
static java.lang.String PORT_KEY
          The projectbrowser port key.
static java.lang.String PORTFOLIO_DEFINITION_DIR
          Directory of portfolio definitions.
static java.lang.String PROJECTS_TEXTMAXHEIGHT_KEY
          Optional max height of text area in Projects Page.
static java.lang.String SENSORBASE_HOST_KEY
          The sensorbase host.
static java.lang.String SENSORDATA_ITEMSPERPAGE_KEY
          Optional items per page.
static java.lang.String TELEMETRY_HOST_KEY
          The telemetry host.
static java.lang.String WICKET_CONFIGURATION_KEY
          How to control wicket development vs.
 
Constructor Summary
ProjectBrowserProperties()
          The default public constructor, which gets all properties from projectbrowser.properties.
ProjectBrowserProperties(java.util.Properties properties)
          Creates a new ProjectBrowserProperties instance.
 
Method Summary
 java.lang.String echoProperties()
          Returns a string containing the current properties.
 java.lang.String get(java.lang.String key)
          Returns the value of the ProjectBrowser Property specified by the key.
 java.lang.String getContextRoot()
          Returns the context root for this application.
 java.lang.String getHost()
          Returns the URL to this system as defined by the project properties.
 int getPort()
          Returns the port to be used for this application.
 java.lang.String getPortfolioDefinitionDir()
          Return the directroy of portfolio definition xmls.
 int getSensorDataItemsPerPage()
          Returns an integer indicating the number of SensorData instances to display per page.
 boolean hasApplicationLogo()
          Returns true if the user has supplied an application logo URL.
 boolean isBackgroundProcessEnable(java.lang.String pageName)
           
 boolean isLoggingUserUsage()
           
 boolean isPageAvailable(java.lang.String pageName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SENSORBASE_HOST_KEY

public static final java.lang.String SENSORBASE_HOST_KEY
The sensorbase host.

See Also:
Constant Field Values

DAILYPROJECTDATA_HOST_KEY

public static final java.lang.String DAILYPROJECTDATA_HOST_KEY
The dpd host.

See Also:
Constant Field Values

TELEMETRY_HOST_KEY

public static final java.lang.String TELEMETRY_HOST_KEY
The telemetry host.

See Also:
Constant Field Values

LOGGING_LEVEL_KEY

public static final java.lang.String LOGGING_LEVEL_KEY
The logging level.

See Also:
Constant Field Values

ADMIN_EMAIL_KEY

public static final java.lang.String ADMIN_EMAIL_KEY
The admin email key.

See Also:
Constant Field Values

WICKET_CONFIGURATION_KEY

public static final java.lang.String WICKET_CONFIGURATION_KEY
How to control wicket development vs. deployment mode.

See Also:
Constant Field Values

APPLICATION_LOGO_KEY

public static final java.lang.String APPLICATION_LOGO_KEY
Application logo URL.

See Also:
Constant Field Values

APPLICATION_NAME_KEY

public static final java.lang.String APPLICATION_NAME_KEY
Optional name.

See Also:
Constant Field Values

SENSORDATA_ITEMSPERPAGE_KEY

public static final java.lang.String SENSORDATA_ITEMSPERPAGE_KEY
Optional items per page.

See Also:
Constant Field Values

PROJECTS_TEXTMAXHEIGHT_KEY

public static final java.lang.String PROJECTS_TEXTMAXHEIGHT_KEY
Optional max height of text area in Projects Page.

See Also:
Constant Field Values

AVAILABLEPAGE_KEY

public static final java.lang.String AVAILABLEPAGE_KEY
Key for tabs of pages.

See Also:
Constant Field Values

BACKGROUND_PROCESS_KEY

public static final java.lang.String BACKGROUND_PROCESS_KEY
If background process enable for pages.

See Also:
Constant Field Values

PORTFOLIO_DEFINITION_DIR

public static final java.lang.String PORTFOLIO_DEFINITION_DIR
Directory of portfolio definitions.

See Also:
Constant Field Values

LOG_USAGE_KEY

public static final java.lang.String LOG_USAGE_KEY
Directory of portfolio definitions.

See Also:
Constant Field Values

PAGE_NAMES

public static final java.lang.String[] PAGE_NAMES
Available pages.


HOSTNAME_KEY

public static final java.lang.String HOSTNAME_KEY
The projectbrowser hostname key.

See Also:
Constant Field Values

CONTEXT_ROOT_KEY

public static final java.lang.String CONTEXT_ROOT_KEY
The projectbrowser context root.

See Also:
Constant Field Values

PORT_KEY

public static final java.lang.String PORT_KEY
The projectbrowser port key.

See Also:
Constant Field Values
Constructor Detail

ProjectBrowserProperties

public ProjectBrowserProperties(java.util.Properties properties)
Creates a new ProjectBrowserProperties instance. Prints an error to the console if problems occur on loading.

Parameters:
properties - A properties instance containing values that override those in the properties file. Can be null if no properties are to be overridden.

ProjectBrowserProperties

public ProjectBrowserProperties()
The default public constructor, which gets all properties from projectbrowser.properties.

Method Detail

echoProperties

public java.lang.String echoProperties()
Returns a string containing the current properties.

Returns:
A string with the properties.

get

public java.lang.String get(java.lang.String key)
Returns the value of the ProjectBrowser Property specified by the key.

Parameters:
key - Should be one of the public static final strings in this class.
Returns:
The value of the key, or null if not found.

hasApplicationLogo

public boolean hasApplicationLogo()
Returns true if the user has supplied an application logo URL.

Returns:
True if the application logo URL was supplied.

isPageAvailable

public boolean isPageAvailable(java.lang.String pageName)
Parameters:
pageName - name of the page.
Returns:
true if the user set the page as available.

isBackgroundProcessEnable

public boolean isBackgroundProcessEnable(java.lang.String pageName)
Parameters:
pageName - name of the page.
Returns:
true if the user set the background process of the page enable.

isLoggingUserUsage

public boolean isLoggingUserUsage()
Returns:
true if the user set to enable usage logging

getSensorDataItemsPerPage

public int getSensorDataItemsPerPage()
Returns an integer indicating the number of SensorData instances to display per page. Defaults to the default number of items per page, currently 50.

Returns:
An int with the number of sensor data items per page.

getPort

public int getPort()
Returns the port to be used for this application. Defaults to 8080.

Returns:
The port as an integer.

getContextRoot

public java.lang.String getContextRoot()
Returns the context root for this application. Defaults to "projectbrowser".

Returns:
The context root.

getHost

public java.lang.String getHost()
Returns the URL to this system as defined by the project properties.

Returns:
The URL to this system.

getPortfolioDefinitionDir

public java.lang.String getPortfolioDefinitionDir()
Return the directroy of portfolio definition xmls.

Returns:
the file path.