org.springframework.extensions.surf
Class FrameworkUtil

java.lang.Object
  extended by org.springframework.extensions.surf.FrameworkUtil

public final class FrameworkUtil
extends Object

Static methods which are useful for working with services and beans within the Web Framework.

Author:
muzquiano

Constructor Summary
FrameworkUtil()
           
 
Method Summary
static WebFrameworkConfigElement getConfig()
          Retrieves the web framework configuration.
static ConfigService getConfigService()
          Gets the config service.
static Connector getConnector(javax.servlet.http.HttpSession httpSession, String userId, String endpointId)
          Creates an authenticated connector to a given endpoint.
static Connector getConnector(RequestContext context, String endpointId)
          Creates an authenticated connector to a given endpoint.
static Connector getConnector(String endpointId)
          Creates an unauthenticated connector to a given endpoint.
static ConnectorService getConnectorService()
          Retrieves the connector service.
static ConnectorSession getConnectorSession(javax.servlet.http.HttpSession httpSession, String endpointId)
          Retrieves the Connector Session instance for the current session and given endpoint.
static ConnectorSession getConnectorSession(RequestContext context, String endpointId)
          Retrieves the Connector Session instance for the current user and given endpoint.
static CredentialVault getCredentialVault(javax.servlet.http.HttpSession httpSession, String userId)
          Retrieves the session-bound credential vault for a given user.
static CredentialVault getCredentialVault(RequestContext context, String userId)
          Retrieves the session-bound credential vault for a given user.
static RequestContext getCurrentRequestContext()
          Retrieves the request context for the current thread.
static RemoteConfigElement.EndpointDescriptor getEndpoint(String endpointId)
          Loads the endpoint descriptor for a given endpoint.
static String getFrameworkTitle()
          Returns the official title of this release of the Alfresco Web Framework
static String getFrameworkVersion()
          Returns the official version of this release of the Alfresco Web Framework
static org.apache.commons.logging.Log getLogger()
          Retrieves the general web framework logger.
static RemoteConfigElement getRemoteConfiguration()
          Retrieves the web framework remote configuration.
static RenderService getRenderService()
          Gets the render service.
static ResourceLoader getResourceLoader(String objectId, String endpointId)
          Produces a ResourceLoader for the given object id on a given endpoint
static ResourceService getResourceService()
          Gets the resource service.
static WebFrameworkServiceRegistry getServiceRegistry()
          Retrieves the web framework services registry.
static WebFrameworkConfigElement getWebFrameworkConfiguration()
          Retrieves the web framework configuration.
static void logFullStacktrace(Throwable throwable)
          Tells the web flow application context to refresh This will reload all web flow beans
static void removeConnectorSessions(RequestContext context)
          Removes all session-bound Connector Sessions for the current user
static void resetWebScripts()
          Helper function to reset all web scripts in the web framework web scripts container
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrameworkUtil

public FrameworkUtil()
Method Detail

getCurrentRequestContext

public static RequestContext getCurrentRequestContext()
Retrieves the request context for the current thread.

Returns:
RequestContext

getServiceRegistry

public static WebFrameworkServiceRegistry getServiceRegistry()
Retrieves the web framework services registry.

Returns:

getConfigService

public static ConfigService getConfigService()
Gets the config service.

Returns:
the config service

getWebFrameworkConfiguration

public static WebFrameworkConfigElement getWebFrameworkConfiguration()
Retrieves the web framework configuration.

Returns:

getConfig

public static WebFrameworkConfigElement getConfig()
Retrieves the web framework configuration. Note: Provided for convenience

Returns:

getRemoteConfiguration

public static RemoteConfigElement getRemoteConfiguration()
Retrieves the web framework remote configuration.

Returns:

getConnectorService

public static ConnectorService getConnectorService()
Retrieves the connector service.

Returns:

getRenderService

public static RenderService getRenderService()
Gets the render service.

Returns:
the render service

getResourceService

public static ResourceService getResourceService()
Gets the resource service.

Returns:
the resource service

getLogger

public static org.apache.commons.logging.Log getLogger()
Retrieves the general web framework logger.

Returns:
general web framework logger

getEndpoint

public static RemoteConfigElement.EndpointDescriptor getEndpoint(String endpointId)
Loads the endpoint descriptor for a given endpoint.

Parameters:
endpointId - the endpoint id
Returns:
the descriptor

getConnector

public static Connector getConnector(String endpointId)
                              throws ConnectorServiceException
Creates an unauthenticated connector to a given endpoint.

Parameters:
endpointId - endpoint id
Returns:
the connector
Throws:
ConnectorServiceException - the connector service exception

getConnector

public static Connector getConnector(RequestContext context,
                                     String endpointId)
                              throws ConnectorServiceException
Creates an authenticated connector to a given endpoint.

Parameters:
context - the request context
endpointId - the endpoint
Returns:
the connector
Throws:
ConnectorServiceException - the connector service exception

getConnector

public static Connector getConnector(javax.servlet.http.HttpSession httpSession,
                                     String userId,
                                     String endpointId)
                              throws ConnectorServiceException
Creates an authenticated connector to a given endpoint.

Parameters:
httpSession - the http session
userId - the user id
endpointId - the endpoint id
Returns:
the connector
Throws:
ConnectorServiceException - the connector service exception

getCredentialVault

public static CredentialVault getCredentialVault(javax.servlet.http.HttpSession httpSession,
                                                 String userId)
Retrieves the session-bound credential vault for a given user.

Parameters:
httpSession - the http session
userId - the user id
Returns:
the credential vault

getCredentialVault

public static CredentialVault getCredentialVault(RequestContext context,
                                                 String userId)
Retrieves the session-bound credential vault for a given user.

Parameters:
context - the context
userId - the user id
Returns:
the credential vault

getConnectorSession

public static ConnectorSession getConnectorSession(RequestContext context,
                                                   String endpointId)
Retrieves the Connector Session instance for the current user and given endpoint.

Parameters:
context - the context
endpointId - the endpoint id
Returns:
the connector session

getConnectorSession

public static ConnectorSession getConnectorSession(javax.servlet.http.HttpSession httpSession,
                                                   String endpointId)
Retrieves the Connector Session instance for the current session and given endpoint.

Parameters:
httpSession - the http session
endpointId - the endpoint id
Returns:
the connector session

removeConnectorSessions

public static void removeConnectorSessions(RequestContext context)
Removes all session-bound Connector Sessions for the current user

Parameters:
context - the context

getFrameworkTitle

public static String getFrameworkTitle()
Returns the official title of this release of the Alfresco Web Framework

Returns:
the framework title

getFrameworkVersion

public static String getFrameworkVersion()
Returns the official version of this release of the Alfresco Web Framework

Returns:
the framework version

getResourceLoader

public static ResourceLoader getResourceLoader(String objectId,
                                               String endpointId)
Produces a ResourceLoader for the given object id on a given endpoint

Parameters:
objectId - the object id
endpointId - the endpoint id
Returns:
the resource loader

resetWebScripts

public static void resetWebScripts()
Helper function to reset all web scripts in the web framework web scripts container


logFullStacktrace

public static void logFullStacktrace(Throwable throwable)
Tells the web flow application context to refresh This will reload all web flow beans



Copyright © 2009 SpringSource, Inc. All Rights Reserved.