Class PortalContextDelegate

java.lang.Object
com.aquima.interactions.portal.model.session.PortalContextDelegate
All Implemented Interfaces:
IPortalContext, IInternalPortalContext, Serializable
Direct Known Subclasses:
ActionHandlerContext, CallbackContext, ContainerContext, DisposeContext, DomainSchemaContext, FlowFunctionContext, InstanceStackPortalContext, SchemaContext, ServiceContext, SoapMessageContext, UpdateFieldVisitor

public class PortalContextDelegate extends Object implements IInternalPortalContext
Utility class to allow for easy wrapping of a portal context implementation.

This an internal class.

Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Constructor Details

  • Method Details

    • getContext

      protected IPortalContext getContext()
    • getId

      public ApplicationID getId()
      Description copied from interface: IInternalPortalContext
      This method returns the ID of the application.
      Specified by:
      getId in interface IInternalPortalContext
      Returns:
      the ID of the application.
    • getMetaModel

      public IMetaModel getMetaModel()
      Description copied from interface: IPortalContext
      Returns the metamodel for which the current portal-session is constructed. This metamodel does not necessarily reflect the most recent version but it is the exact version this session was started with.
      Specified by:
      getMetaModel in interface IPortalContext
      Returns:
      The metamodel which is never null.
    • getProfile

      public InferenceContext getProfile()
      Description copied from interface: IPortalContext
      This method will return the current profile interface. In addition to the standard profile behavior, the implementation returned here will also automatically inference unknown values, and is aware of the instances that might have been activated during the page flow.

      See also getUserProfile()

      Specified by:
      getProfile in interface IPortalContext
      Returns:
      Profile interface.
    • getRuleEngine

      public IRuleEngine getRuleEngine()
      Description copied from interface: IPortalContext
      Returns the rule-engine for which the current portal-session is constructed. This rule-engine does not necessarily reflect the most recent version with the most recent rules however it is the exact version this session was started with.
      Specified by:
      getRuleEngine in interface IPortalContext
      Returns:
      The rule-engine which is never null.
    • getMatchEngine

      public IMatchEngine getMatchEngine()
      Description copied from interface: IPortalContext
      This method returns the match engine as configured for the application.
      Specified by:
      getMatchEngine in interface IPortalContext
      Returns:
      the match engine as configured for the application.
    • getElementComposer

      public IElementComposer getElementComposer()
      Description copied from interface: IPortalContext
      This method returns an element factory that may be used to expand pre-defined elements from the composer using the current container context.
      Specified by:
      getElementComposer in interface IPortalContext
      Returns:
      An element factory that can be used to expand elements from the composer.
    • getMappingComposer

      public IMappingComposer getMappingComposer()
      Description copied from interface: IPortalContext
      This method returns an element factory that may be used to expand pre-defined elements from the composer using the mapping context.
      Specified by:
      getMappingComposer in interface IPortalContext
      Returns:
      An element factory that can be used to expand elements from the composer.
    • getExpressionParser

      public IExpressionParser getExpressionParser()
      Description copied from interface: IPortalContext
      Holds the expression parser which is bound to the rule engine. One can use this to prepare expressions for evaluation.
      Specified by:
      getExpressionParser in interface IPortalContext
      Returns:
      The expression parser which is never null
    • getFlowEngine

      public IFlowEngine getFlowEngine()
      Description copied from interface: IPortalContext
      The flow engine for the current session.
      Specified by:
      getFlowEngine in interface IPortalContext
      Returns:
      The flow-engine which is never null.
    • getTreeEngine

      public ITreeEngine getTreeEngine()
      Description copied from interface: IPortalContext
      The tree engine for the current session.
      Specified by:
      getTreeEngine in interface IPortalContext
      Returns:
      The tree-engine which is never null.
    • getRequestScope

      public IRequestScope getRequestScope()
      Description copied from interface: IPortalContext
      Retrieves the request scope form the context. This object contains parameters and information about the request.
      Specified by:
      getRequestScope in interface IPortalContext
      Returns:
      A request scope corresponding to this request. Never null
      See Also:
    • getPageScope

      public IPageScope getPageScope()
      Description copied from interface: IPortalContext
      Retrieves the page scope form the context. This object contains parameters and information as long as the portal-engine is on the same page. After the page is left the scope is changed and is cleared to hold new properties bound to that page.
      Specified by:
      getPageScope in interface IPortalContext
      Returns:
      The page-bound scope which is never null.
      See Also:
    • getSessionScope

      public ISessionScope getSessionScope()
      Description copied from interface: IPortalContext
      This object contains parameters and information the entire session. This means from the portalsession is created until it has been destroyed. One could say the session scope lives at least as long as one is working with a specific application and profile.
      Specified by:
      getSessionScope in interface IPortalContext
      Returns:
      The session-bound scope which is never null.
      See Also:
    • getUserScope

      public IUserScope getUserScope()
      Description copied from interface: IPortalContext
      Retrieves the user scope for the current user from the context. This object's life time is shared over sessions and applications.
      Specified by:
      getUserScope in interface IPortalContext
      Returns:
      A request scope corresponding to this request. Never null
      See Also:
    • getActiveInstance

      public IEntityInstance getActiveInstance(String entityName)
      Description copied from interface: IPortalContext
      Returns the active instance connected to the specified entity name. An instance might have been activated in the following ways:
      • The instance is a singleton, and therefore always active.
      • The instance is activated through a container (only during page evaluation).
      • The instance is activated by using the pushActiveInstance within the same flow.
      Specified by:
      getActiveInstance in interface IPortalContext
      Parameters:
      entityName - The entity name for which the active instance is requested.
      Returns:
      The instance that is active for the specified entity type.
    • pushActiveInstance

      public void pushActiveInstance(IEntityInstance instance)
      Description copied from interface: IPortalContext
      This method will activate the instance in the current context. Once an instance has been activated in a portal context, the instance will stay active until the page flow the activation occurred in has been completed.
      Specified by:
      pushActiveInstance in interface IPortalContext
      Parameters:
      instance - The instance that should be activated.
    • getResourceManager

      public IResourceManager getResourceManager()
      Description copied from interface: IPortalContext
      Retrieves the resource manager.
      Specified by:
      getResourceManager in interface IPortalContext
      Returns:
      Resource manager for the current session.
    • getConnectionManager

      public IConnectionManager getConnectionManager()
      Description copied from interface: IPortalContext
      This method may be used to request the connection manager of the application. The connection manager services the connections that are predefined for the application.
      Specified by:
      getConnectionManager in interface IPortalContext
      Returns:
      the connection manager of the application.
    • getApplicationMode

      public ApplicationMode getApplicationMode()
      Description copied from interface: IPortalContext
      This method returns the current application mode. Never returns null
      Specified by:
      getApplicationMode in interface IPortalContext
      Returns:
      The current application mode.
    • getDocumentEngine

      public IDocumentEngine getDocumentEngine()
      Description copied from interface: IPortalContext
      This method returns a document engine for the current context.
      Specified by:
      getDocumentEngine in interface IPortalContext
      Returns:
      Document engine for the current session.
    • getServiceManager

      public IServiceManager getServiceManager()
      Description copied from interface: IPortalContext
      This method returns a service manager for the current context. Never returns null
      Specified by:
      getServiceManager in interface IPortalContext
      Returns:
      A service manager for the current session.
    • getFunctionCallDefinitionManager

      public IFunctionCallDefinitionManager getFunctionCallDefinitionManager()
      Description copied from interface: IPortalContext
      This method returns a function call definition manager for the current context. Never returns null
      Specified by:
      getFunctionCallDefinitionManager in interface IPortalContext
      Returns:
      A function call definition manager for the current session.
    • getConfiguration

      public IApplicationConfig getConfiguration()
      Description copied from interface: IInternalPortalContext
      This method returns the application configuration. The configuration might be useful for services and containers, and may therefore be moved to the IPortalContext interface if needed.
      Specified by:
      getConfiguration in interface IInternalPortalContext
      Returns:
      the application configuration.
    • getFactoryManager

      public IFactoryManager getFactoryManager()
      Description copied from interface: IInternalPortalContext
      This method returns the factory manager of the application.
      Specified by:
      getFactoryManager in interface IInternalPortalContext
      Returns:
      the factory manager of the application.
    • getComposer

      public IComposer getComposer()
      Description copied from interface: IInternalPortalContext
      This method returns the internal composer. Components like services and containers should use the IElementComposer interface instead of this one.
      Specified by:
      getComposer in interface IInternalPortalContext
      Returns:
      The internal composer.
    • getApplicationModel

      public IModule getApplicationModel()
      Description copied from interface: IInternalPortalContext
      This method returns the current application model.
      Specified by:
      getApplicationModel in interface IInternalPortalContext
      Returns:
      The current application model.
    • getApplication

      public ISolution getApplication()
      Description copied from interface: IInternalPortalContext
      This method returns the current application.
      Specified by:
      getApplication in interface IInternalPortalContext
      Returns:
      The current application.
    • getMaskManager

      public IMaskManager getMaskManager()
      Description copied from interface: IPortalContext
      This method returns a mask manager for the current context. Never returns null
      Specified by:
      getMaskManager in interface IPortalContext
      Returns:
      A mask manager for the current session.
    • getContentManagerFactory

      public IContentManagerFactory getContentManagerFactory()
      Description copied from interface: IPortalContext
      This method returns the content manager factory for the current context
      Specified by:
      getContentManagerFactory in interface IPortalContext
      Returns:
      A content manager factory
    • getContentManagerFactory

      public IContentManagerFactory getContentManagerFactory(PersistenceLevel persistence)
      Description copied from interface: IPortalContext
      Returns a content manager factory for the current context and the given persistence level.

      When the persistence level is temporary, the content created with the returned content manager factory and content manager will be deleted when a certain event occurs (eg. portal scope ends, a certain amount of time passes, etc.) The strategy used to delete the temporary content is determined by the underlying ITemporaryPersistenceStrategy in use.

      When the persistence level is permanent, the content must explicitly be deleted from the connection when it is no longer needed.

      Specified by:
      getContentManagerFactory in interface IPortalContext
      Parameters:
      persistence - the desired persistence level
      Returns:
      the content manager factory, never null
    • getProcessScope

      public IProcessScope getProcessScope()
      Description copied from interface: IPortalContext
      This method returns a process scope for the current context. Never returns null
      Specified by:
      getProcessScope in interface IPortalContext
      Returns:
      A process scope.
    • getProject

      public IProject getProject()
      Description copied from interface: IPortalContext
      Returns the project for which the current portal-session is constructed. This project does not necessarily reflect the most recent version but it is the exact version this session was started with.
      Specified by:
      getProject in interface IPortalContext
      Returns:
      The project which is never null.
    • getMappingManager

      public IMappingManager getMappingManager()
      Description copied from interface: IPortalContext
      This method returns a mapping manager for the current context. Never returns null
      Specified by:
      getMappingManager in interface IPortalContext
      Returns:
      A mapping manager for the current session.
    • getUserProfile

      public IProfile getUserProfile()
      Description copied from interface: IPortalContext
      This method returns the profile of all the user set data. This profile may be used to retrieve the user data without any sourcing of values.
      Specified by:
      getUserProfile in interface IPortalContext
      Returns:
      The readonly user profile, never null
    • getFlowScope

      public IFlowScope getFlowScope()
      Description copied from interface: IPortalContext
      Retrieves the flow scope form the context. This object contains parameters and information for the current flow. After the flow is left the scope is changed and is cleared to hold new properties bound to that flow.
      Specified by:
      getFlowScope in interface IPortalContext
      Returns:
      The flow-bound scope which is never null.
      See Also:
    • forModule

      public IPortalContext forModule(ModuleID moduleId)
      Description copied from interface: IPortalContext
      This method returns a portal context for the specified module. If the module id refers to module of this context: 'this' is returned. Otherwise a new portal context (with empty state) is returned.
      Specified by:
      forModule in interface IPortalContext
      Parameters:
      moduleId - The module id, may not be null.
      Returns:
      The portal context for the specified module.
    • forModule

      public IPortalContext forModule(ModuleID moduleId, boolean createNew)
      Description copied from interface: IPortalContext
      This method returns a portal context for the specified module. If `createNew` is true, a new portal context (with empty state) is returned even if the module id refers to the module of this context. Otherwise, this method behaves identically to IPortalContext.forModule(ModuleID).
      Specified by:
      forModule in interface IPortalContext
      Parameters:
      moduleId - The module id, may not be null.
      createNew - Whether to create a new, empty, portal context even if this context refers to the requested module id.
      Returns:
      The portal context for the specified module.
    • getCommunicationEngine

      public ICommunicationEngine getCommunicationEngine()
      Description copied from interface: IPortalContext
      This method returns the current communication engine for the current context.
      Specified by:
      getCommunicationEngine in interface IPortalContext
      Returns:
      The communication engine, never null.
    • getWebServices

      public IWebServices getWebServices()
      Description copied from interface: IPortalContext
      This method returns the webservices for the current context.
      Specified by:
      getWebServices in interface IPortalContext
      Returns:
      The webservices, never null.
    • getState

      public IPortalContextState getState()
      Description copied from interface: IPortalContext
      Returns the state of the portalcontext (for serialization).
      Specified by:
      getState in interface IPortalContext
      Returns:
      returns the current state of the portalcontext.
    • restore

      public void restore(IPortalContextState state)
      Description copied from interface: IPortalContext
      Clears the current state and overrides it with the provided state.
      Specified by:
      restore in interface IPortalContext
      Parameters:
      state - The new state for this context.
    • getTraceEngine

      public ITraceEngine getTraceEngine()
      Description copied from interface: IPortalContext
      This method returns the trace engine.
      Specified by:
      getTraceEngine in interface IPortalContext
      Returns:
      the Trace Engine.
    • getAuditEngine

      public IAuditEngine getAuditEngine()
      Description copied from interface: IPortalContext
      This method returns the audit engine. The audit engine can be used to log messages that can later be used to audit users behaviour inside the application. It is up to the developer to call the audit engine's audit functionality on the appropriate times when user activity should be logged.
      Specified by:
      getAuditEngine in interface IPortalContext
      Returns:
      the Audit Engine.
    • getCurrentLanguage

      public ILanguage getCurrentLanguage()
      Description copied from interface: IPortalContext
      Gets the current language for this context, which could be null depending on the implementation.
      Specified by:
      getCurrentLanguage in interface IPortalContext
      Returns:
      The current language, could be null.
    • getCurrentFlow

      public String getCurrentFlow()
      Description copied from interface: IPortalContext
      Returns the current top-level flow.
      Specified by:
      getCurrentFlow in interface IPortalContext
      Returns:
      The current top-level flow.
    • getSessionId

      public String getSessionId()
      Description copied from interface: IPortalContext
      Returns the ID of the session.
      Specified by:
      getSessionId in interface IPortalContext
      Returns:
      the id of the session (may be null).
    • getCaseEngineClient

      public CaseEngineClient getCaseEngineClient()
      Description copied from interface: IPortalContext
      Returns the case engine client, may be null
      Specified by:
      getCaseEngineClient in interface IPortalContext
      Returns:
      the case engine client, may be null
    • getCommentsManager

      public ICommentsManager getCommentsManager()
      Description copied from interface: IPortalContext
      Returns the comments manager
      Specified by:
      getCommentsManager in interface IPortalContext
      Returns:
      the comments manager
    • getDebugger

      public IDebugger getDebugger()
      Description copied from interface: IPortalContext
      Returns a debugger instance if one is currently attached, or null if no debugger is attached.
      Specified by:
      getDebugger in interface IPortalContext
      Returns:
      a debugger instance, or null if none is attached.