com.webmethods.portal.system
Class PortalSystem

java.lang.Object
  extended by com.webmethods.portal.system.PortalSystem

public class PortalSystem
extends Object

The entry point into the Portal server.

PortalSystem is a singleton. It exposes the PortalSystem.main(java.lang.String[]) method which initializes Portal. Initialization leverages the DefaultPhaseProvider to initialize all of the IPhaseProviders registered in the system. Upon successful initialization, all IComponentProviders will be available as well as their IComponents.

PortalSystem also defines many constants that can be passed into PortalSystem.acquireURI(java.lang.String) to find common portal resources. This includes: PortalSystem.TOPIC_ROOT, PortalSystem.FOLDER_ROOT, PortalSystem.FOLDER_SYSTEM and many others.

PortalSystem also defines the various states that the system can be in. These vary from PortalSystem.UNINITIALIZED_STATE to PortalSystem.SHUTDOWN_STATE and a few in between.

PortalSystem also exposes all of the registered IComponentProviders. When requiring a specific IComponentProvider invoke an API like PortalSystem.getCommandProvider() and cast it to the appropriate implementation, in this instance: com.webmethods.portal.bizPolicy.command.ICommandManager.


Field Summary
static int BOOTSTRAP_STATE
          The system is in a pre-initialized 'bootstrap' state.
static String CURRENT_RESOURCE
          The current resource.
static String CURRENT_RESOURCE_ANCESTOR
          The current resource's ancestor to the specified step (current.resource.ancestor.1=parent, current.resource.ancestor.2=grandparent).
static String CURRENT_RESOURCE_PARENT
          The current resource's parent.
static String CURRENT_RESOURCE_TYPE
           
static String FOLDER_CONTENT_SERVICE
          The content service folder.
static String FOLDER_DIRECTORY_SERVICE
          The directory service folder.
static String FOLDER_HELP
          The Help folder.
static String FOLDER_PORTLET_INSTANCES
          The portlet instances folder.
static String FOLDER_PORTLETS
          The XTypes Portlet folder.
static String FOLDER_PUBLIC
          The public folder.
static String FOLDER_ROOT
          The Root folder.
static String FOLDER_SKINS
          The skins folder.
static String FOLDER_SYSTEM
          The System folder.
static String FOLDER_TEMPLATES
          The templates folder.
static String FOLDER_TEMPLATES_MANAGEMENT
          The templates management folder.
static String FOLDER_THEMES
          The themes folder.
static String FOLDER_USERS
          The users folder.
static String FOLDER_XTYPE
          The xtype folder.
static String FOLDER_XTYPES
          The XTypes folder.
static int INITIALIZING_STATE
          The system is initializing and the MetaManager is available.
protected  Map m_componentProviders
          This is the map of managers that implement the IComponentProvider interface
protected  IPhaseProvider m_phaseProvider
          This is what initializes us through the various phases of the product.
protected static PortalSystem m_portalSystem
          A static singleton
protected  int m_state
           
protected  List m_uriResolverList
          A storage of IURIResolver
protected  IURIResolver[] m_uriResolvers
          This is the IURIResolver that always gets first crack at calls to PortalSystem.acquireURI(java.lang.String)
protected static String m_VMID
           
static String PERSISTENT_SYSTEM_PROPERTIES_DEFAULT
          Where the persistent properties are stored.
static String PERSISTENT_SYSTEM_PROPERTIES_KEY
          The key identifying persistent property storage.
static String PHASE_PROVIDER_CLASS
          This is the phase provider that manages initializing the various phases of the product.
static long PORTAL_START_TIME
           
static String PORTAL_SYSTEM_CLASS
          Identifies which PortalSystem to use.
static String PORTLET_DEFAULT_ADMIN_PAGE
          Alias for the default admin page portlet.
static String PORTLET_DEFAULT_PAGE
          Alias for the default page portlet.
static String PORTLET_DIRECTORY
          Alias for the directory portlet.
static String PORTLET_ERROR_REPORT
          Alias for the error report portlet.
static String PORTLET_FOLDERVIEW
          Alias for the folderview portlet.
static String PORTLET_HEAD
          Alias for the head portlet.
static String PORTLET_LEFTNAV
          Alias for the leftnav (Content Manager) portlet.
static String PORTLET_LOCATIONS
          Alias for the locations portlet.
static String PORTLET_LOGOUT
          Alias for the logout portlet.
static String PORTLET_PERMISSIONS
          Alias for the permissions portlet.
static String PORTLET_PROPERTIES
          Alias for the properties portlet.
static String PORTLET_PUBLISH
          Alias for the publish portlet.
static String PORTLET_STREAMING_CONTENT_VIEWER
          Alias for the streaming content viewer portlet.
static String PORTLET_TITLEBAR
          Alias for the titlebar portlet.
static String PORTLET_UNI_PICKER
          Alias for the unipicker (Universal Picker) portlet.
static String PORTLET_USER_PROFILE
          Alias for the user profile portlet.
static int PRE_META_STATE
          This is the point during initialization when no com.webmethods.portal.service.meta2.IMetaManager is available yet, because the PortalSystem is still initializing.
static int READY_STATE
          The system is ready and initialized.
static int SHUTDOWN_STATE
          The system is shutting down.
static String TEMPLATE_BASIC
          The basic template.
static String TEMPLATE_EMPTY
          The "empty" template.
static String TEMPLATE_THREE_COL
          The three column template.
static String TEMPLATE_USECORPGOV
          The Corporate Governance template.
static String TOPIC_ADMIN
          The Admin topic.
static String TOPIC_HELP
          The Help topic.
static String TOPIC_ROOT
          The root topic.
static String TOPIC_SYSTEM
          The System topic.
static int UNINITIALIZED_STATE
          The system hasn't begun initializing yet.
static String USER_CURRENT
          Alias for the current user.
static String USER_CURRENT_FAVORITES
          Alias for the current user's scrapbook.
static String USER_CURRENT_HOME
          Alias for the current user's home folder.
static String USER_CURRENT_PROFILE
          Alias for the current user's profile.
static String USER_CURRENT_ROOT
          Alias for the current user's root folder (contains user home and scrapbook).
static String USER_CURRENT_SAVED_SEARCHES
          Alias for the current user's saved search page.
static String USER_CURRENT_START_PAGE
          Alias for the current user's start page.
 
Constructor Summary
PortalSystem()
          Default constructor used for reflection
 
Method Summary
 IURI acquireURI(String uri)
          Retrieve the provider-specific implementation of IURI based on the URI information.
static void addComponentProvider(String name, IComponentProvider cp)
          Updates the map that holds the IComponentProviders.
 void addURIResolver(IURIResolver newUriResolver)
          Allows the PortalSystem.acquireURI(java.lang.String) to be 'hooked' by other resolvers
 boolean exists(IURI objectURI)
          Checks if an items specified by objectURI exists in the system
static IComponentProvider getAppServerProvider()
          Deprecated.  
static IComponentProvider getAuditManager()
           
static IComponentProvider getBizPolicyProvider()
           
static IComponentProvider getBundleManager()
           
static IComponentProvider getCacheProvider()
           
static IComponentProvider getClassManager()
           
static IComponentProvider getClusterProvider()
           
static IComponentProvider getCommandProvider()
           
static IComponentProvider getComponentProvider(String componentProvider)
          Retrieves the registered IComponentProvider after which you should cast to the specific interface requested.
static Map getComponentProviders()
          Gets the map of all registered IComponentProviders.
static IComponentProvider getContentProvider()
           
static IComponentProvider getContextProvider()
           
static IComponentProvider getDirectoryProvider()
           
static IComponentProvider getGlobalProvider()
           
static IComponentProvider getInstallProvider()
           
static IComponentProvider getMechanicsProvider()
           
static IComponentProvider getMetaProvider()
           
static IComponentProvider getNoodleProvider()
           
static IPhaseProvider getPhaseProvider()
           
static PortalSystem getPortalSystem()
          Get the singleton instance of the PortalSystem.
static IComponentProvider getPortletProvider()
           
static IComponentProvider getPRCacheProvider()
           
static int getState()
          Get the state of the PortalSystem.
static String getSystemProperty(String propertyName, String defaultValue)
          Retrieve a system property.
static IComponentProvider getTaskProvider()
           
 IURIResolver[] getUriResolvers()
          Get the array of currently registered IURIResolvers.
static IComponentProvider getVersionProvider()
           
static String getVMID()
           
static IComponentProvider getWebAppProvider()
           
static IComponentProvider getWebServiceProvider()
           
static boolean inDevMode()
          Returns true if system is in development mode
protected  void init(String configLocation)
          The main startup for the PortalSystem.
static boolean inPreviewServerMode()
           
static String localizeMessage(Class resourceBundle, String messageKey, Object[] args, boolean includeMessageKeyPrefix)
          Helper method to retrieve a localized message from a resource bundle
 Object lookup(IURI objectURI)
          Look up an object in the system.
static void main(String[] args)
          The arg identifies the portal.properties (configLocation) for example: java com.webmethods.portal.system.PortalSystem file:/c:/portalminder/config/portal.properties

static void removeComponentProvider(String name)
          Removes an IComponentProvider from the internal map.
 IURI resolveURIByPath(String value)
          Attempts to resolve URI by given path to the object.
static void setState(int state)
          Set the state of the PortalSystem.
static void setSystemProperty(String key, String value)
          Set a system property.
 void shutdown()
           
static void waitUntilReady(Runnable runnable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNINITIALIZED_STATE

public static final int UNINITIALIZED_STATE
The system hasn't begun initializing yet.

See Also:
Constant Field Values

PRE_META_STATE

public static final int PRE_META_STATE
This is the point during initialization when no com.webmethods.portal.service.meta2.IMetaManager is available yet, because the PortalSystem is still initializing.

See Also:
Constant Field Values

BOOTSTRAP_STATE

public static final int BOOTSTRAP_STATE
The system is in a pre-initialized 'bootstrap' state. This only occurs at one moment in the lifetime of a PortalSystem. This is the first time the PortalSystem ever starts, after the com.webmethods.portal.service.meta2.IMetaManager is initialized, but prior to the bootstrap Phase being executed.

See Also:
Constant Field Values

INITIALIZING_STATE

public static final int INITIALIZING_STATE
The system is initializing and the MetaManager is available. This also assumes that we are not in the rare PortalSystem.BOOTSTRAP_STATE.

See Also:
Constant Field Values

READY_STATE

public static final int READY_STATE
The system is ready and initialized.

See Also:
Constant Field Values

SHUTDOWN_STATE

public static final int SHUTDOWN_STATE
The system is shutting down.

See Also:
Constant Field Values

PORTAL_SYSTEM_CLASS

public static final String PORTAL_SYSTEM_CLASS
Identifies which PortalSystem to use.

See Also:
Constant Field Values

PHASE_PROVIDER_CLASS

public static final String PHASE_PROVIDER_CLASS
This is the phase provider that manages initializing the various phases of the product.

See Also:
Constant Field Values

PERSISTENT_SYSTEM_PROPERTIES_KEY

public static final String PERSISTENT_SYSTEM_PROPERTIES_KEY
The key identifying persistent property storage.

See Also:
Constant Field Values

PERSISTENT_SYSTEM_PROPERTIES_DEFAULT

public static final String PERSISTENT_SYSTEM_PROPERTIES_DEFAULT
Where the persistent properties are stored.

See Also:
Constant Field Values

TOPIC_ROOT

public static final String TOPIC_ROOT
The root topic.

See Also:
Constant Field Values

TOPIC_ADMIN

public static final String TOPIC_ADMIN
The Admin topic.

See Also:
Constant Field Values

TOPIC_SYSTEM

public static final String TOPIC_SYSTEM
The System topic.

See Also:
Constant Field Values

TOPIC_HELP

public static final String TOPIC_HELP
The Help topic.

See Also:
Constant Field Values

FOLDER_ROOT

public static final String FOLDER_ROOT
The Root folder.

See Also:
Constant Field Values

FOLDER_SYSTEM

public static final String FOLDER_SYSTEM
The System folder.

See Also:
Constant Field Values

FOLDER_HELP

public static final String FOLDER_HELP
The Help folder.

See Also:
Constant Field Values

FOLDER_XTYPES

public static final String FOLDER_XTYPES
The XTypes folder.

See Also:
Constant Field Values

FOLDER_PORTLETS

public static final String FOLDER_PORTLETS
The XTypes Portlet folder.

See Also:
Constant Field Values

FOLDER_PORTLET_INSTANCES

public static final String FOLDER_PORTLET_INSTANCES
The portlet instances folder.

See Also:
Constant Field Values

FOLDER_TEMPLATES_MANAGEMENT

public static final String FOLDER_TEMPLATES_MANAGEMENT
The templates management folder.

See Also:
Constant Field Values

FOLDER_USERS

public static final String FOLDER_USERS
The users folder.

See Also:
Constant Field Values

FOLDER_XTYPE

public static final String FOLDER_XTYPE
The xtype folder.

See Also:
Constant Field Values

FOLDER_THEMES

public static final String FOLDER_THEMES
The themes folder.

See Also:
Constant Field Values

FOLDER_SKINS

public static final String FOLDER_SKINS
The skins folder.

See Also:
Constant Field Values

FOLDER_DIRECTORY_SERVICE

public static final String FOLDER_DIRECTORY_SERVICE
The directory service folder.

See Also:
Constant Field Values

FOLDER_CONTENT_SERVICE

public static final String FOLDER_CONTENT_SERVICE
The content service folder.

See Also:
Constant Field Values

FOLDER_TEMPLATES

public static final String FOLDER_TEMPLATES
The templates folder.

See Also:
Constant Field Values

FOLDER_PUBLIC

public static final String FOLDER_PUBLIC
The public folder.

See Also:
Constant Field Values

TEMPLATE_BASIC

public static final String TEMPLATE_BASIC
The basic template.

See Also:
Constant Field Values

TEMPLATE_EMPTY

public static final String TEMPLATE_EMPTY
The "empty" template.

See Also:
Constant Field Values

TEMPLATE_THREE_COL

public static final String TEMPLATE_THREE_COL
The three column template.

See Also:
Constant Field Values

TEMPLATE_USECORPGOV

public static final String TEMPLATE_USECORPGOV
The Corporate Governance template.

See Also:
Constant Field Values

USER_CURRENT

public static final String USER_CURRENT
Alias for the current user. Only available if the webApplication is running.

See Also:
Constant Field Values

USER_CURRENT_ROOT

public static final String USER_CURRENT_ROOT
Alias for the current user's root folder (contains user home and scrapbook). Only available if the webApplication is running.

See Also:
Constant Field Values

USER_CURRENT_HOME

public static final String USER_CURRENT_HOME
Alias for the current user's home folder. Only available if the webApplication is running.

See Also:
Constant Field Values

USER_CURRENT_START_PAGE

public static final String USER_CURRENT_START_PAGE
Alias for the current user's start page. Only available if the webApplication is running.

See Also:
Constant Field Values

USER_CURRENT_FAVORITES

public static final String USER_CURRENT_FAVORITES
Alias for the current user's scrapbook. Only available if the webApplication is running.

See Also:
Constant Field Values

USER_CURRENT_SAVED_SEARCHES

public static final String USER_CURRENT_SAVED_SEARCHES
Alias for the current user's saved search page. Only available if the webApplication is running.

See Also:
Constant Field Values

USER_CURRENT_PROFILE

public static final String USER_CURRENT_PROFILE
Alias for the current user's profile. Only available if the webApplication is running.

See Also:
Constant Field Values

CURRENT_RESOURCE

public static final String CURRENT_RESOURCE
The current resource. This is only valid in the context of the webApplication.

See Also:
Constant Field Values

CURRENT_RESOURCE_TYPE

public static final String CURRENT_RESOURCE_TYPE
See Also:
Constant Field Values

CURRENT_RESOURCE_PARENT

public static final String CURRENT_RESOURCE_PARENT
The current resource's parent. Note that some resources do not have parents. This is only valid in the context of the webApplication.

See Also:
Constant Field Values

CURRENT_RESOURCE_ANCESTOR

public static final String CURRENT_RESOURCE_ANCESTOR
The current resource's ancestor to the specified step (current.resource.ancestor.1=parent, current.resource.ancestor.2=grandparent). This is only valid in the context of the webApplication.

See Also:
Constant Field Values

PORTLET_PERMISSIONS

public static final String PORTLET_PERMISSIONS
Alias for the permissions portlet.

See Also:
Constant Field Values

PORTLET_DEFAULT_ADMIN_PAGE

public static final String PORTLET_DEFAULT_ADMIN_PAGE
Alias for the default admin page portlet.

See Also:
Constant Field Values

PORTLET_DEFAULT_PAGE

public static final String PORTLET_DEFAULT_PAGE
Alias for the default page portlet.

See Also:
Constant Field Values

PORTLET_HEAD

public static final String PORTLET_HEAD
Alias for the head portlet.

See Also:
Constant Field Values

PORTLET_DIRECTORY

public static final String PORTLET_DIRECTORY
Alias for the directory portlet.

See Also:
Constant Field Values

PORTLET_FOLDERVIEW

public static final String PORTLET_FOLDERVIEW
Alias for the folderview portlet.

See Also:
Constant Field Values

PORTLET_LEFTNAV

public static final String PORTLET_LEFTNAV
Alias for the leftnav (Content Manager) portlet.

See Also:
Constant Field Values

PORTLET_LOCATIONS

public static final String PORTLET_LOCATIONS
Alias for the locations portlet.

See Also:
Constant Field Values

PORTLET_LOGOUT

public static final String PORTLET_LOGOUT
Alias for the logout portlet.

See Also:
Constant Field Values

PORTLET_PROPERTIES

public static final String PORTLET_PROPERTIES
Alias for the properties portlet.

See Also:
Constant Field Values

PORTLET_PUBLISH

public static final String PORTLET_PUBLISH
Alias for the publish portlet.

See Also:
Constant Field Values

PORTLET_TITLEBAR

public static final String PORTLET_TITLEBAR
Alias for the titlebar portlet.

See Also:
Constant Field Values

PORTLET_UNI_PICKER

public static final String PORTLET_UNI_PICKER
Alias for the unipicker (Universal Picker) portlet.

See Also:
Constant Field Values

PORTLET_USER_PROFILE

public static final String PORTLET_USER_PROFILE
Alias for the user profile portlet.

See Also:
Constant Field Values

PORTLET_STREAMING_CONTENT_VIEWER

public static final String PORTLET_STREAMING_CONTENT_VIEWER
Alias for the streaming content viewer portlet.

See Also:
Constant Field Values

PORTLET_ERROR_REPORT

public static final String PORTLET_ERROR_REPORT
Alias for the error report portlet.

See Also:
Constant Field Values

m_portalSystem

protected static PortalSystem m_portalSystem
A static singleton


m_componentProviders

protected Map m_componentProviders
This is the map of managers that implement the IComponentProvider interface


m_uriResolverList

protected List m_uriResolverList
A storage of IURIResolver


m_uriResolvers

protected IURIResolver[] m_uriResolvers
This is the IURIResolver that always gets first crack at calls to PortalSystem.acquireURI(java.lang.String)


m_phaseProvider

protected IPhaseProvider m_phaseProvider
This is what initializes us through the various phases of the product.


m_state

protected int m_state
See Also:
PortalSystem.getState()

PORTAL_START_TIME

public static long PORTAL_START_TIME

m_VMID

protected static String m_VMID
Constructor Detail

PortalSystem

public PortalSystem()
Default constructor used for reflection

Method Detail

getPortalSystem

public static PortalSystem getPortalSystem()
Get the singleton instance of the PortalSystem.

Returns:
the static instance of PortalSystem

getComponentProviders

public static Map getComponentProviders()
Gets the map of all registered IComponentProviders. The map's keys are the names (java.lang.String) of the IComponentProvider. The map's values are the instances of IComponentProvider. Typically, you should use the convenience functions like PortalSystem.getMechanicsProvider() instead of retrieving the map directly.

Returns:
a map of registered IComponentProviders.
See Also:
PortalSystem.m_componentProviders

getUriResolvers

public IURIResolver[] getUriResolvers()
Get the array of currently registered IURIResolvers.

Returns:
the PortalSystem.m_uriResolvers

getComponentProvider

public static IComponentProvider getComponentProvider(String componentProvider)
Retrieves the registered IComponentProvider after which you should cast to the specific interface requested.

Parameters:
componentProvider - the name of a registered IComponentProvider. It is highly recommended to use a named constant from IComponentProvider.
Returns:
the IComponentProvider or null if not found

addComponentProvider

public static void addComponentProvider(String name,
                                        IComponentProvider cp)
Updates the map that holds the IComponentProviders. No other logic is performed.

Parameters:
name - The name of the component provider
cp - The IComponentProvider
See Also:
PortalSystem.getComponentProviders(), PortalSystem.removeComponentProvider(java.lang.String)

removeComponentProvider

public static void removeComponentProvider(String name)
Removes an IComponentProvider from the internal map.

Parameters:
name - The name of the component provider.
See Also:
PortalSystem.getComponentProviders(), PortalSystem.addComponentProvider(java.lang.String, IComponentProvider)

getDirectoryProvider

public static IComponentProvider getDirectoryProvider()
See Also:
com.webmethods.portal.service.dir.IDirSystem

getMetaProvider

public static IComponentProvider getMetaProvider()
See Also:
com.webmethods.portal.service.meta2.IMetaManager

getMechanicsProvider

public static IComponentProvider getMechanicsProvider()
See Also:
com.webmethods.portal.mech.IMechanicsManager

getCommandProvider

public static IComponentProvider getCommandProvider()
See Also:
com.webmethods.portal.bizPolicy.command.ICommandManager

getBizPolicyProvider

public static IComponentProvider getBizPolicyProvider()
See Also:
IBizPolicyManager

getContentProvider

public static IComponentProvider getContentProvider()
See Also:
com.webmethods.portal.bizPolicy.IContextProvider

getCacheProvider

public static IComponentProvider getCacheProvider()
See Also:
com.webmethods.portal.service.cache.ICacheManager

getInstallProvider

public static IComponentProvider getInstallProvider()
See Also:
com.webmethods.portal.service.install.IInstallProvider

getPortletProvider

public static IComponentProvider getPortletProvider()
See Also:
com.webmethods.portal.service.portlet.IPortletProvider

getClassManager

public static IComponentProvider getClassManager()
See Also:
com.webmethods.portal.service.classmanager.IClassManager

getBundleManager

public static IComponentProvider getBundleManager()
See Also:
com.webmethods.portal.service.bundle.BundleManager

getAuditManager

public static IComponentProvider getAuditManager()
See Also:
com.webmethods.portal.service.classmanager.IAuditManager

getTaskProvider

public static IComponentProvider getTaskProvider()

getWebAppProvider

public static IComponentProvider getWebAppProvider()
See Also:
com.webmethods.portal.framework.IWebApplication

getWebServiceProvider

public static IComponentProvider getWebServiceProvider()
See Also:
com.webmethods.portal.webservices.IWebService

getAppServerProvider

public static IComponentProvider getAppServerProvider()
Deprecated. 


getClusterProvider

public static IComponentProvider getClusterProvider()
See Also:
com.webmethods.portal.system.cluster.IClusterProvider

getVersionProvider

public static IComponentProvider getVersionProvider()
See Also:
com.webmethods.portal.service.version.IVersionProvider

getContextProvider

public static IComponentProvider getContextProvider()
See Also:
com.webmethods.portal.bizPolicy.IContextProvider

getPRCacheProvider

public static IComponentProvider getPRCacheProvider()
See Also:
com.webmethods.portal.framework.prc.service.IPRCProvider

getGlobalProvider

public static IComponentProvider getGlobalProvider()
See Also:
com.webmethods.portal.service.global.IGlobalProvider

getNoodleProvider

public static IComponentProvider getNoodleProvider()
See Also:
com.webmethods.portal.noodle.INoodleProvider

getPhaseProvider

public static IPhaseProvider getPhaseProvider()
See Also:
com.webmethods.portal.system.init.IPhaseProvider

localizeMessage

public static String localizeMessage(Class resourceBundle,
                                     String messageKey,
                                     Object[] args,
                                     boolean includeMessageKeyPrefix)
Helper method to retrieve a localized message from a resource bundle

Parameters:
resourceBundle - the bundle to get the message from
messageKey - the key of the message to retrieve
args - any args needed to complete the message (may be null)
includeMessageKeyPrefix - true to include the message key in the returned message, false otherwise
Returns:
a localized message

getState

public static int getState()
Get the state of the PortalSystem.

See Also:
PortalSystem.setState(int), PortalSystem.UNINITIALIZED_STATE, PortalSystem.BOOTSTRAP_STATE, PortalSystem.INITIALIZING_STATE, PortalSystem.READY_STATE, PortalSystem.SHUTDOWN_STATE

setState

public static void setState(int state)
Set the state of the PortalSystem.

Parameters:
state - The state to set.
See Also:
PortalSystem.getState(), PortalSystem.UNINITIALIZED_STATE, PortalSystem.BOOTSTRAP_STATE, PortalSystem.INITIALIZING_STATE, PortalSystem.READY_STATE, PortalSystem.SHUTDOWN_STATE

lookup

public Object lookup(IURI objectURI)
              throws PortalException
Look up an object in the system. Determines which provider can handle this lookup request and delegates the call appropriately.

Parameters:
objectURI - the URI to the object
Returns:
a reference to the object in the system, or null if no such object exists
Throws:
PortalException

exists

public boolean exists(IURI objectURI)
               throws PortalException
Checks if an items specified by objectURI exists in the system

Parameters:
objectURI - the URI to of an object
Returns:
Throws:
PortalException

acquireURI

public IURI acquireURI(String uri)
                throws PortalException
Retrieve the provider-specific implementation of IURI based on the URI information.

Parameters:
uri - the String version of the URI
Returns:
the provider specific implementation of IURI
Throws:
PortalException - if the URI cannot be constructed or if the URI has an invalid syntax

resolveURIByPath

public IURI resolveURIByPath(String value)
                      throws PortalException
Attempts to resolve URI by given path to the object. Path could be in a form:
/alias
/alias/ContainerName/.../ResourceName

Parameters:
value -
Returns:
the provider specific implementation of IURI
Throws:
PortalException - if the URI cannot be constructed or if the URI has an invalid syntax

addURIResolver

public void addURIResolver(IURIResolver newUriResolver)
Allows the PortalSystem.acquireURI(java.lang.String) to be 'hooked' by other resolvers

Parameters:
newUriResolver -
See Also:
PortalSystem.acquireURI(java.lang.String)

main

public static void main(String[] args)
                 throws Exception

The arg identifies the portal.properties (configLocation) for example: java com.webmethods.portal.system.PortalSystem file:/c:/portalminder/config/portal.properties

Parameters:
args - portal.properties
Throws:
Exception

init

protected void init(String configLocation)
             throws InitializationException
The main startup for the PortalSystem. Instantiates the correct initialization manager and initializes.

Parameters:
configLocation - The location of the bootstrap config stuff.
Throws:
InitializationException

shutdown

public void shutdown()

getSystemProperty

public static String getSystemProperty(String propertyName,
                                       String defaultValue)
Retrieve a system property. If it's not found then display a helpful message so people will know what they might have been looking for.

Parameters:
propertyName - The system property name to find.
defaultValue - The default value to return if the property isn't found.
Returns:
The value of the property if found, defaultValue otherwise

setSystemProperty

public static void setSystemProperty(String key,
                                     String value)
                              throws IOException
Set a system property. This will perform a couple of operations:
 1) It will set the system property: System.setProperty(java.lang.String, java.lang.String)
 2) It will persist the property to the registry
 3) It will fire an event
 

Parameters:
key - The name of the property to set.
value - The value to set the property to.
Throws:
IOException - if it can't save to the persistent system properties file.

inDevMode

public static boolean inDevMode()
Returns true if system is in development mode

Returns:
true if in development mode, false otherwise

inPreviewServerMode

public static boolean inPreviewServerMode()

getVMID

public static String getVMID()

waitUntilReady

public static void waitUntilReady(Runnable runnable)