org.apache.pluto.portlet.admin.util
Class PlutoAdminContext

java.lang.Object
  extended by org.apache.pluto.portlet.admin.util.PlutoAdminContext

public class PlutoAdminContext
extends java.lang.Object

A singleton factory that holds methods to get various data on the Pluto install such as the path to the Pluto home directory held within properties files. A HashMap cache is used to store the properties (as a Properties object) when they are first loaded.

Author:
Craig Doremus

Field Summary
private static java.util.Map _cache
           
private static java.lang.String _containerHome
          Home for the container (servlet engine) that Pluto sits inside of.
private static java.lang.String _deploymentPath
           
private static PlutoAdminContext _instance
           
private static java.lang.String _plutoContext
           
private static java.lang.String _plutoHome
           
private static java.lang.String CLASS_NAME
           
 
Constructor Summary
private PlutoAdminContext()
           
 
Method Summary
static java.lang.String getContainerHome()
          Finds home directory of the container that holds Pluto (usually Tomcat)
static java.lang.String getDeploymentPath()
          Accessor for the path to the portlet deployment directory (webapps in Tomcat container)
static PlutoAdminContext getInstance()
           
 java.lang.String getPageRegistryPath()
          Accessor for the full path to the pageregistry.xml file using the getPlutoHome() method.
 java.lang.String getPlutoHome()
          Uses properties in pluto-admin.properties to get the full path to the installed Pluto home directory, which in Tomcat is Pluto's webapps directory (usually 'pluto').
static java.lang.String getPlutoWebContext()
          Accessor for the web context for Pluto (default=pluto)
 java.lang.String getPortletContextsPath()
          Accessor for the full path to the portletcontexts.txt file
 java.lang.String getPortletEntityRegistryPath()
          Accessor for the full path to the portletentityregistry.xml file using the getPlutoHome() method.
static java.util.Properties getProperties()
           
static java.util.Properties getProperties(java.lang.String propFileName)
          Returns the Properties object from a properties file that is in the classpath.
private  java.lang.String getRelDataDir()
           
static void parseDeploymentPaths(java.lang.String plutoHome)
          Parses out paths from the Pluto Home directory sent in from PortletContext.getRealPath("") call in ControllerPortlet.init()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_NAME

private static final java.lang.String CLASS_NAME
See Also:
Constant Field Values

_containerHome

private static java.lang.String _containerHome
Home for the container (servlet engine) that Pluto sits inside of. In Tomcat, this is


_plutoHome

private static java.lang.String _plutoHome

_plutoContext

private static java.lang.String _plutoContext

_deploymentPath

private static java.lang.String _deploymentPath

_cache

private static java.util.Map _cache

_instance

private static PlutoAdminContext _instance
Constructor Detail

PlutoAdminContext

private PlutoAdminContext()
Method Detail

getInstance

public static PlutoAdminContext getInstance()

getPageRegistryPath

public java.lang.String getPageRegistryPath()
Accessor for the full path to the pageregistry.xml file using the getPlutoHome() method.

Returns:
The absolute path to pageregistry.xml
See Also:
getPlutoHome()

getPortletEntityRegistryPath

public java.lang.String getPortletEntityRegistryPath()
Accessor for the full path to the portletentityregistry.xml file using the getPlutoHome() method.

Returns:
The absolute path to portletentityregistry.xml
See Also:
getPlutoHome()

getPlutoHome

public java.lang.String getPlutoHome()
Uses properties in pluto-admin.properties to get the full path to the installed Pluto home directory, which in Tomcat is Pluto's webapps directory (usually 'pluto').

Returns:
The absolute path to the directory where the Pluto container is installed.

getProperties

public static java.util.Properties getProperties(java.lang.String propFileName)
Returns the Properties object from a properties file that is in the classpath. After it's first access, the properties are stored in a cache.

Parameters:
propFileName - Name of the properties file.
Returns:
Properties The filled properties object
Throws:
java.lang.NullPointerException - If the InputStream accessing the properties file is null.

getProperties

public static java.util.Properties getProperties()

getRelDataDir

private java.lang.String getRelDataDir()

getPortletContextsPath

public java.lang.String getPortletContextsPath()
Accessor for the full path to the portletcontexts.txt file


getContainerHome

public static java.lang.String getContainerHome()
Finds home directory of the container that holds Pluto (usually Tomcat)


parseDeploymentPaths

public static void parseDeploymentPaths(java.lang.String plutoHome)
Parses out paths from the Pluto Home directory sent in from PortletContext.getRealPath("") call in ControllerPortlet.init()

Parameters:
plutoHome - The _plutoHome to set.

getDeploymentPath

public static java.lang.String getDeploymentPath()
Accessor for the path to the portlet deployment directory (webapps in Tomcat container)


getPlutoWebContext

public static java.lang.String getPlutoWebContext()
Accessor for the web context for Pluto (default=pluto)