Interface IPortalContext

All Superinterfaces:
Serializable
All Known Subinterfaces:
IActionContext, IContainerContext, IContainerEventContext, IDisposeContext, IDomainSchemaContext, IEventContext, IFunctionContext, IInternalPortalContext, ISchemaContext, IServiceContext, ISoapMessageContext
All Known Implementing Classes:
ActionHandlerContext, CallbackContext, ContainerContext, DisposeContext, DomainSchemaContext, FlowFunctionContext, FunctionCallContext, InstanceStackPortalContext, PortalContext, PortalContextDelegate, SchemaContext, ServiceContext, ServiceContextDelegate, SoapMessageContext, TxPortalContext, UpdateFieldVisitor

public interface IPortalContext extends Serializable
A portal context is an object which contains context information about this portal-session and it's loaded state. Including specific contexts for situational purposes like active-instances during page composition.
Since:
5.0
Author:
O. Kerpershoek, F. van der Meer
  • Method Details

    • getMetaModel

      IMetaModel getMetaModel()
      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.
      Returns:
      The metamodel which is never null.
    • getProject

      IProject getProject()
      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.
      Returns:
      The project which is never null.
      Since:
      7.1
    • getProfile

      InferenceContext getProfile()
      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()

      Returns:
      Profile interface.
    • getRuleEngine

      IRuleEngine getRuleEngine()
      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.
      Returns:
      The rule-engine which is never null.
    • getElementComposer

      IElementComposer getElementComposer()
      This method returns an element factory that may be used to expand pre-defined elements from the composer using the current container context.
      Returns:
      An element factory that can be used to expand elements from the composer.
      Since:
      5.1
    • getMappingComposer

      IMappingComposer getMappingComposer()
      This method returns an element factory that may be used to expand pre-defined elements from the composer using the mapping context.
      Returns:
      An element factory that can be used to expand elements from the composer.
      Since:
      12.3
    • getExpressionParser

      IExpressionParser getExpressionParser()
      Holds the expression parser which is bound to the rule engine. One can use this to prepare expressions for evaluation.
      Returns:
      The expression parser which is never null
    • getFlowEngine

      IFlowEngine getFlowEngine()
      The flow engine for the current session.
      Returns:
      The flow-engine which is never null.
    • getTreeEngine

      ITreeEngine getTreeEngine()
      The tree engine for the current session.
      Returns:
      The tree-engine which is never null.
    • getMatchEngine

      IMatchEngine getMatchEngine()
      This method returns the match engine as configured for the application.
      Returns:
      the match engine as configured for the application.
    • getTraceEngine

      ITraceEngine getTraceEngine()
      This method returns the trace engine.
      Returns:
      the Trace Engine.
    • getActiveInstance

      IEntityInstance getActiveInstance(String entityName)
      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.
      Parameters:
      entityName - The entity name for which the active instance is requested.
      Returns:
      The instance that is active for the specified entity type.
      Throws:
      UnknownInstanceException - This exception type is raised when no active instance could be found for the specified type.
      UnknownEntityException - This exception type is raised when the entity type is unknown.
      CreateInstanceException - This type of exception may be raised when a singleton instance could not be created for the specified type.
    • getAuditEngine

      IAuditEngine getAuditEngine()
      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.
      Returns:
      the Audit Engine.
    • pushActiveInstance

      void pushActiveInstance(IEntityInstance instance)
      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.
      Parameters:
      instance - The instance that should be activated.
    • getUserScope

      IUserScope getUserScope()
      Retrieves the user scope for the current user from the context. This object's life time is shared over sessions and applications.
      Returns:
      A request scope corresponding to this request. Never null
      See Also:
    • getRequestScope

      IRequestScope getRequestScope()
      Retrieves the request scope form the context. This object contains parameters and information about the request.
      Returns:
      A request scope corresponding to this request. Never null
      See Also:
    • getPageScope

      IPageScope getPageScope()
      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.
      Returns:
      The page-bound scope which is never null.
      See Also:
    • getSessionScope

      ISessionScope getSessionScope()
      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.
      Returns:
      The session-bound scope which is never null.
      See Also:
    • getResourceManager

      IResourceManager getResourceManager()
      Retrieves the resource manager.
      Returns:
      Resource manager for the current session.
    • getConnectionManager

      IConnectionManager getConnectionManager()
      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.
      Returns:
      the connection manager of the application.
    • getApplicationMode

      ApplicationMode getApplicationMode()
      This method returns the current application mode. Never returns null
      Returns:
      The current application mode.
    • getDocumentEngine

      IDocumentEngine getDocumentEngine()
      This method returns a document engine for the current context.
      Returns:
      Document engine for the current session.
    • getServiceManager

      IServiceManager getServiceManager()
      This method returns a service manager for the current context. Never returns null
      Returns:
      A service manager for the current session.
    • getFunctionCallDefinitionManager

      IFunctionCallDefinitionManager getFunctionCallDefinitionManager()
      This method returns a function call definition manager for the current context. Never returns null
      Returns:
      A function call definition manager for the current session.
    • getMaskManager

      IMaskManager getMaskManager()
      This method returns a mask manager for the current context. Never returns null
      Returns:
      A mask manager for the current session.
      Since:
      7.1
    • getContentManagerFactory

      IContentManagerFactory getContentManagerFactory()
      This method returns the content manager factory for the current context
      Returns:
      A content manager factory
      Since:
      9.3
    • getContentManagerFactory

      IContentManagerFactory getContentManagerFactory(PersistenceLevel persistence)
      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.

      Parameters:
      persistence - the desired persistence level
      Returns:
      the content manager factory, never null
    • getProcessScope

      IProcessScope getProcessScope()
      This method returns a process scope for the current context. Never returns null
      Returns:
      A process scope.
      Throws:
      AppException - Is thrown when no process scope is available.
      Since:
      7.1
    • getMappingManager

      IMappingManager getMappingManager()
      This method returns a mapping manager for the current context. Never returns null
      Returns:
      A mapping manager for the current session.
      Since:
      7.2
    • getUserProfile

      IProfile getUserProfile()
      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.
      Returns:
      The readonly user profile, never null
      Since:
      8.4
    • getFlowScope

      IFlowScope getFlowScope()
      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.
      Returns:
      The flow-bound scope which is never null.
      Throws:
      InvalidStateException - Is thrown when no flow scope is available (i.e. when no flow has been started yet)
      Since:
      9.0
      See Also:
    • forModule

      IPortalContext forModule(ModuleID moduleId)
      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.
      Parameters:
      moduleId - The module id, may not be null.
      Returns:
      The portal context for the specified module.
      Throws:
      UnknownModuleException - Is thrown when the provided module id refers to an unknown module.
      Since:
      9.0
    • forModule

      IPortalContext forModule(ModuleID moduleId, boolean createNew)
      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 forModule(ModuleID).
      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.
      Throws:
      UnknownModuleException - Is thrown when the provided module id refers to an unknown module.
      Since:
      16.8
    • getCommunicationEngine

      ICommunicationEngine getCommunicationEngine()
      This method returns the current communication engine for the current context.
      Returns:
      The communication engine, never null.
      Since:
      9.0
    • getWebServices

      IWebServices getWebServices()
      This method returns the webservices for the current context.
      Returns:
      The webservices, never null.
      Since:
      9.0
    • getState

      Returns the state of the portalcontext (for serialization).
      Returns:
      returns the current state of the portalcontext.
    • restore

      void restore(IPortalContextState state)
      Clears the current state and overrides it with the provided state.
      Parameters:
      state - The new state for this context.
    • getCurrentLanguage

      ILanguage getCurrentLanguage()
      Gets the current language for this context, which could be null depending on the implementation.
      Returns:
      The current language, could be null.
    • getCurrentFlow

      String getCurrentFlow()
      Returns the current top-level flow.
      Returns:
      The current top-level flow.
      Since:
      9.9
    • getSessionId

      String getSessionId()
      Returns the ID of the session.
      Returns:
      the id of the session (may be null).
      Since:
      11.0
    • getCaseEngineClient

      CaseEngineClient getCaseEngineClient()
      Returns the case engine client, may be null
      Returns:
      the case engine client, may be null
    • getCommentsManager

      ICommentsManager getCommentsManager()
      Returns the comments manager
      Returns:
      the comments manager
    • getDebugger

      IDebugger getDebugger()
      Returns a debugger instance if one is currently attached, or null if no debugger is attached.
      Returns:
      a debugger instance, or null if none is attached.
      Since:
      16.10