public class PortalSystem extends Object implements com.webmethods.portal.system.IURIResolver
The entry point into the Portal server.
PortalSystem is a singleton. It exposes the main(java.lang.String[])
method which initializes Portal. Initialization leverages the
DefaultPhaseProvider
to initialize all of the IPhaseProvider
s registered in the system. Upon successful
initialization, all IComponentProvider
s will be available as well as their IComponent
s.
PortalSystem also defines many constants that can be passed into acquireURI(java.lang.String)
to find common portal resources.
This includes: TOPIC_ROOT
, FOLDER_ROOT
, FOLDER_SYSTEM
and many others.
PortalSystem also defines the various states that the system can be in. These vary from UNINITIALIZED_STATE
to SHUTDOWN_STATE
and a few in between.
PortalSystem also exposes all of the registered IComponentProvider
s. When requiring a specific IComponentProvider
invoke an API like getCommandProvider()
and cast it to the appropriate implementation, in this instance: ICommandManager
.
Modifier and Type | Field and Description |
---|---|
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<String,com.webmethods.portal.system.IComponentProvider> |
m_componentProviders
This is the map of managers that implement the
IComponentProvider interface |
protected com.webmethods.portal.system.init.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<com.webmethods.portal.system.IURIResolver> |
m_uriResolverList
A storage of
IURIResolver |
protected com.webmethods.portal.system.IURIResolver[] |
m_uriResolvers
This is the
IURIResolver that always gets first crack at calls to 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
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 and Description |
---|
PortalSystem()
Default constructor used for reflection
|
Modifier and Type | Method and Description |
---|---|
IURI |
acquireURI(String uri)
Retrieve the provider-specific implementation of
IURI based on the URI information. |
static void |
addComponentProvider(String name,
com.webmethods.portal.system.IComponentProvider cp)
Updates the map that holds the
IComponentProvider s. |
void |
addURIResolver(com.webmethods.portal.system.IURIResolver newUriResolver)
Allows the
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 String |
fixClientSideURI(String uri)
adds mws root context path to uri
|
static String |
fixMWSURI(String uri)
removes context path from uri to be processed by other MWS apis.
|
static com.webmethods.portal.system.IComponentProvider |
getAppServerProvider()
Deprecated.
|
static com.webmethods.portal.system.IComponentProvider |
getAuditManager() |
static com.webmethods.portal.system.IComponentProvider |
getBizPolicyProvider() |
static com.webmethods.portal.system.IComponentProvider |
getBundleManager() |
static com.webmethods.portal.system.IComponentProvider |
getCacheProvider() |
static com.webmethods.portal.system.IComponentProvider |
getClassManager() |
static com.webmethods.portal.system.IComponentProvider |
getClusterProvider() |
static com.webmethods.portal.system.IComponentProvider |
getCommandProvider() |
static com.webmethods.portal.system.IComponentProvider |
getComponentProvider(String componentProvider)
Retrieves the registered
IComponentProvider after which you should cast to
the specific interface requested. |
static Map<String,com.webmethods.portal.system.IComponentProvider> |
getComponentProviders()
Gets the map of all registered
IComponentProvider s. |
static com.webmethods.portal.system.IComponentProvider |
getContentProvider() |
static String |
getContextPath() |
static com.webmethods.portal.system.IComponentProvider |
getContextProvider() |
static com.webmethods.portal.system.IComponentProvider |
getDirectoryProvider() |
static com.webmethods.portal.system.IComponentProvider |
getGlobalProvider() |
static com.webmethods.portal.system.IComponentProvider |
getInstallProvider() |
static com.webmethods.portal.system.IComponentProvider |
getMechanicsProvider() |
static com.webmethods.portal.system.IComponentProvider |
getMetaProvider() |
static com.webmethods.portal.system.IComponentProvider |
getNoodleProvider() |
static com.webmethods.portal.system.init.IPhaseProvider |
getPhaseProvider() |
static PortalSystem |
getPortalSystem()
Get the singleton instance of the PortalSystem.
|
static com.webmethods.portal.system.IComponentProvider |
getPortletProvider() |
static com.webmethods.portal.system.IComponentProvider |
getPRCacheProvider() |
static int |
getState()
Get the state of the PortalSystem.
|
static String |
getSystemProperty(String propertyName,
String defaultValue)
Retrieve a system property.
|
static com.webmethods.portal.system.IComponentProvider |
getTaskProvider() |
com.webmethods.portal.system.IURIResolver[] |
getUriResolvers()
Get the array of currently registered
IURIResolver s. |
static com.webmethods.portal.system.IComponentProvider |
getVersionProvider() |
static String |
getVMID() |
static com.webmethods.portal.system.IComponentProvider |
getWebAppProvider() |
static com.webmethods.portal.system.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 boolean |
isReady() |
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) |
public static final int UNINITIALIZED_STATE
public static final int PRE_META_STATE
IMetaManager
is available yet,
because the PortalSystem is still initializing.public static final int BOOTSTRAP_STATE
IMetaManager
is initialized, but
prior to the bootstrap Phase being executed.public static final int INITIALIZING_STATE
BOOTSTRAP_STATE
.public static final int READY_STATE
public static final int SHUTDOWN_STATE
public static final String PORTAL_SYSTEM_CLASS
public static final String PHASE_PROVIDER_CLASS
public static final String PERSISTENT_SYSTEM_PROPERTIES_KEY
public static final String PERSISTENT_SYSTEM_PROPERTIES_DEFAULT
public static final String TOPIC_ROOT
public static final String TOPIC_ADMIN
public static final String TOPIC_SYSTEM
public static final String TOPIC_HELP
public static final String FOLDER_ROOT
public static final String FOLDER_SYSTEM
public static final String FOLDER_HELP
public static final String FOLDER_XTYPES
public static final String FOLDER_PORTLETS
public static final String FOLDER_PORTLET_INSTANCES
public static final String FOLDER_TEMPLATES_MANAGEMENT
public static final String FOLDER_USERS
public static final String FOLDER_XTYPE
public static final String FOLDER_THEMES
public static final String FOLDER_SKINS
public static final String FOLDER_DIRECTORY_SERVICE
public static final String FOLDER_CONTENT_SERVICE
public static final String FOLDER_TEMPLATES
public static final String FOLDER_PUBLIC
public static final String TEMPLATE_BASIC
public static final String TEMPLATE_EMPTY
public static final String TEMPLATE_THREE_COL
public static final String TEMPLATE_USECORPGOV
public static final String USER_CURRENT
public static final String USER_CURRENT_ROOT
public static final String USER_CURRENT_HOME
public static final String USER_CURRENT_START_PAGE
public static final String USER_CURRENT_FAVORITES
public static final String USER_CURRENT_SAVED_SEARCHES
public static final String USER_CURRENT_PROFILE
public static final String CURRENT_RESOURCE
public static final String CURRENT_RESOURCE_TYPE
public static final String CURRENT_RESOURCE_PARENT
public static final String CURRENT_RESOURCE_ANCESTOR
public static final String PORTLET_PERMISSIONS
public static final String PORTLET_DEFAULT_ADMIN_PAGE
public static final String PORTLET_DEFAULT_PAGE
public static final String PORTLET_HEAD
public static final String PORTLET_DIRECTORY
public static final String PORTLET_FOLDERVIEW
public static final String PORTLET_LEFTNAV
public static final String PORTLET_LOCATIONS
public static final String PORTLET_LOGOUT
public static final String PORTLET_PROPERTIES
public static final String PORTLET_PUBLISH
public static final String PORTLET_TITLEBAR
public static final String PORTLET_UNI_PICKER
public static final String PORTLET_USER_PROFILE
public static final String PORTLET_STREAMING_CONTENT_VIEWER
public static final String PORTLET_ERROR_REPORT
protected static PortalSystem m_portalSystem
protected Map<String,com.webmethods.portal.system.IComponentProvider> m_componentProviders
IComponentProvider
interfaceprotected List<com.webmethods.portal.system.IURIResolver> m_uriResolverList
IURIResolver
protected com.webmethods.portal.system.IURIResolver[] m_uriResolvers
IURIResolver
that always gets first crack at calls to acquireURI(java.lang.String)
protected com.webmethods.portal.system.init.IPhaseProvider m_phaseProvider
protected int m_state
getState()
public static long PORTAL_START_TIME
protected static String m_VMID
public static PortalSystem getPortalSystem()
PortalSystem
public static Map<String,com.webmethods.portal.system.IComponentProvider> getComponentProviders()
IComponentProvider
s.
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 getMechanicsProvider()
instead
of retrieving the map directly.IComponentProvider
s.m_componentProviders
public com.webmethods.portal.system.IURIResolver[] getUriResolvers()
IURIResolver
s.m_uriResolvers
public static com.webmethods.portal.system.IComponentProvider getComponentProvider(String componentProvider)
IComponentProvider
after which you should cast to
the specific interface requested.componentProvider
- the name of a registered IComponentProvider
.
It is highly recommended to use a named constant from IComponentProvider
.IComponentProvider
or null if not foundpublic static void addComponentProvider(String name, com.webmethods.portal.system.IComponentProvider cp)
IComponentProvider
s. No other logic is performed.name
- The name of the component providercp
- The IComponentProvider
getComponentProviders()
,
removeComponentProvider(java.lang.String)
public static void removeComponentProvider(String name)
IComponentProvider
from the internal map.name
- The name of the component provider.getComponentProviders()
,
addComponentProvider(java.lang.String, com.webmethods.portal.system.IComponentProvider)
public static com.webmethods.portal.system.IComponentProvider getDirectoryProvider()
IDirSystem
public static com.webmethods.portal.system.IComponentProvider getMetaProvider()
IMetaManager
public static com.webmethods.portal.system.IComponentProvider getMechanicsProvider()
IMechanicsManager
public static com.webmethods.portal.system.IComponentProvider getCommandProvider()
ICommandManager
public static com.webmethods.portal.system.IComponentProvider getBizPolicyProvider()
IBizPolicyManager
public static com.webmethods.portal.system.IComponentProvider getContentProvider()
IContextProvider
public static com.webmethods.portal.system.IComponentProvider getCacheProvider()
ICacheManager
public static com.webmethods.portal.system.IComponentProvider getInstallProvider()
com.webmethods.portal.service.install.IInstallProvider
public static com.webmethods.portal.system.IComponentProvider getPortletProvider()
IPortletProvider
public static com.webmethods.portal.system.IComponentProvider getClassManager()
com.webmethods.portal.service.classmanager.IClassManager
public static com.webmethods.portal.system.IComponentProvider getAuditManager()
com.webmethods.portal.service.classmanager.IAuditManager
public static com.webmethods.portal.system.IComponentProvider getBundleManager()
com.webmethods.portal.service.bundle.BundleManager
public static com.webmethods.portal.system.IComponentProvider getTaskProvider()
public static com.webmethods.portal.system.IComponentProvider getWebAppProvider()
IWebApplication
public static com.webmethods.portal.system.IComponentProvider getWebServiceProvider()
com.webmethods.portal.webservices.IWebService
public static com.webmethods.portal.system.IComponentProvider getAppServerProvider()
public static com.webmethods.portal.system.IComponentProvider getClusterProvider()
IClusterProvider
public static com.webmethods.portal.system.IComponentProvider getVersionProvider()
com.webmethods.portal.service.version.IVersionProvider
public static com.webmethods.portal.system.IComponentProvider getContextProvider()
IContextProvider
public static com.webmethods.portal.system.IComponentProvider getPRCacheProvider()
com.webmethods.portal.framework.prc.service.IPRCProvider
public static com.webmethods.portal.system.IComponentProvider getGlobalProvider()
IGlobalProvider
public static com.webmethods.portal.system.IComponentProvider getNoodleProvider()
com.webmethods.portal.noodle.INoodleProvider
public static com.webmethods.portal.system.init.IPhaseProvider getPhaseProvider()
IPhaseProvider
public static String localizeMessage(Class<?> resourceBundle, String messageKey, Object[] args, boolean includeMessageKeyPrefix)
resourceBundle
- the bundle to get the message frommessageKey
- the key of the message to retrieveargs
- any args needed to complete the message (may be null)includeMessageKeyPrefix
- true to include the message key in the returned message, false otherwisepublic static int getState()
public static void setState(int state)
state
- The state to set.getState()
,
UNINITIALIZED_STATE
,
BOOTSTRAP_STATE
,
INITIALIZING_STATE
,
READY_STATE
,
SHUTDOWN_STATE
public Object lookup(IURI objectURI) throws PortalException
objectURI
- the URI to the objectPortalException
public boolean exists(IURI objectURI) throws PortalException
objectURI
- the URI to of an objectPortalException
public IURI acquireURI(String uri) throws PortalException
IURI
based on the URI information.acquireURI
in interface com.webmethods.portal.system.IURIResolver
uri
- the String version of the URIIURI
PortalException
- if the URI cannot be constructed or if the URI has an invalid syntaxpublic IURI resolveURIByPath(String value) throws PortalException
value
- IURI
PortalException
- if the URI cannot be constructed or if the URI has an invalid syntaxpublic void addURIResolver(com.webmethods.portal.system.IURIResolver newUriResolver)
acquireURI(java.lang.String)
to be 'hooked' by other resolversnewUriResolver
- acquireURI(java.lang.String)
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
args
- portal.propertiesException
protected void init(String configLocation) throws com.webmethods.portal.system.init.InitializationException
configLocation
- The location of the bootstrap config stuff.com.webmethods.portal.system.init.InitializationException
public void shutdown()
public static String getSystemProperty(String propertyName, String defaultValue)
propertyName
- The system property name to find.defaultValue
- The default value to return if the property isn't found.public static void setSystemProperty(String key, String value) throws IOException
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
key
- The name of the property to set.value
- The value to set the property to.IOException
- if it can't save to the persistent system properties file.public static boolean inDevMode()
public static boolean inPreviewServerMode()
public static String getVMID()
public static void waitUntilReady(Runnable runnable)
public static boolean isReady()
public static String fixMWSURI(String uri)
uri
- public static String fixClientSideURI(String uri)
uri
- public static String getContextPath()