Class WindowManager

java.lang.Object
overit.geocall.ui.WindowManager
All Implemented Interfaces:
Serializable, Identified

public class WindowManager extends Object implements Serializable, Identified
This class implements Serializable and Identified.
This class implements methods and attributes to manage the different windows(and their attributes and operations) of the application.
See Also:
  • Field Details

    • ERROR_OCCURRED_WHILE_LAUNCHING_THE_USER_DE_TOUCH_EVENT

      protected static final String ERROR_OCCURRED_WHILE_LAUNCHING_THE_USER_DE_TOUCH_EVENT
      See Also:
    • ERROR_OCCURRED_WHILE_LAUNCHING_THE_USER_TOUCH_EVENT

      protected static final String ERROR_OCCURRED_WHILE_LAUNCHING_THE_USER_TOUCH_EVENT
      See Also:
    • _webSession

      protected overit.geocall.servlet.WebSession _webSession
    • _menu

      protected UIMenu _menu
    • favouritesNodes

      protected List<XMLTree> favouritesNodes
    • _processingTrack

      protected overit.geocall.ux.servlet.processor.ProcessingTrack _processingTrack
    • _stackWM

      protected ArrayList<Window> _stackWM
    • _processingThreadContext

      protected ThreadContext _processingThreadContext
    • _params

      protected WebParameters _params
    • _processor

      protected transient overit.geocall.ux.servlet.processor.RequestProcessor _processor
    • _servletName

      protected String _servletName
    • _temporaryFiles

      protected ArrayList _temporaryFiles
    • _lastTracer

      protected Tracer _lastTracer
    • _cancelException

      protected CancelException _cancelException
    • _wizard

      protected Wizard _wizard
    • _interlocutor

      protected Interlocutor _interlocutor
    • _workcontext

      protected WorkContext _workcontext
    • _identity

      protected Identity _identity
    • _developMode

      protected boolean _developMode
    • _startDate

      protected Date _startDate
    • _lastAccess

      protected Date _lastAccess
    • _lastException

      protected Throwable _lastException
    • _cache

      protected HashGetter _cache
    • _refreshed

      protected int _refreshed
    • _loggedSessions

      protected static AtomicInteger _loggedSessions
    • _resourceServletDocument

      protected WebResource _resourceServletDocument
    • _benchmarkMode

      protected boolean _benchmarkMode
    • _cookies

      protected HashSet _cookies
    • _id

      protected String _id
    • _color

      protected String _color
    • _masterId

      protected String _masterId
    • _gk

      protected GateKeeper _gk
    • landing

      protected Landing landing
    • themeToTest

      protected String themeToTest
  • Constructor Details

    • WindowManager

      public WindowManager(Identity identity, overit.geocall.servlet.WebSession ws, WebParameters wp, String id, String color, String masterId)
      Creates a window manager for the active WebSession and the selected view by the user.
      Parameters:
      identity - The Identity associated with the user that select the view
      ws - The active WebSession
      wp - The WebParameters associated to the WebSession
      id - The id of the window to manage.
      color - The color of the window to manage
      masterId - The master Id of the window
    • WindowManager

      public WindowManager(Identity identity, overit.geocall.servlet.WebSession ws, WebParameters wp, String id, String color)
      Creates a window manager for the active WebSession and the selected view by the user without a master id.
      Parameters:
      identity - The Identity associated with the user that select the view
      ws - The active WebSession
      wp - The WebParameters associated to the WebSession
      id - The id of the window to manage.
      color - The color of the window to manage
  • Method Details

    • setNonce

      public void setNonce(String nonce)
      Sets the nonce attribute that will be used by the page into inline script and style tags.
      Parameters:
      nonce - The nonce attribute that will be used by the page.
    • getNonce

      public String getNonce()
      Gets the active nonce string
      Returns:
      The active nonce string.
    • setLanding

      public void setLanding(Landing landing)
      Sets the Landing page
      Parameters:
      landing - The landing page to set.
    • getLanding

      public Landing getLanding()
      Gets the active Landing page
      Returns:
      The active landing page.
    • setThemeToTest

      public void setThemeToTest(String name)
      Sets the name of the temporary theme to test
      Parameters:
      name - The name of the temporary theme to test
    • getThemeToTest

      public String getThemeToTest()
      Gets the name of the temporary theme to test
      Returns:
      The name of the temporary theme to test
    • getLoggedSessionNumber

      public static int getLoggedSessionNumber()
      Gets the number of actuve sessions.
      Returns:
      The numbero of active sessions
    • setBenchmarkMode

      public void setBenchmarkMode(boolean mode)
      Sets if you want to activate the benchmark mode or not.
      Parameters:
      mode - true if you want to activate the benchmark mode,false otherwise.
    • getBenchmarkMode

      public boolean getBenchmarkMode()
      Gets if the benchmark mode is active or not.
      Returns:
      true if benchmark mode is active,false otherwise.
    • getDevelopMode

      public boolean getDevelopMode()
      Gets if the develop mode is active or not.
      Returns:
      true if develop mode is active,false otherwise.
    • setDevelopMode

      public void setDevelopMode(boolean mode)
      Sets if you want to activate the develop mode or not.
      Parameters:
      mode - true if you want to activate the develop mode,false otherwise.
    • isExternal

      public boolean isExternal()
      Gets if this window manager is created and used from an external suite or not.
      A WM is external if its id is defined into the company.ui.externalWebViews property.
      Returns:
      true if this window manager is created to be used from an external suite, false otherwise.
    • setIsExternal

      public void setIsExternal(boolean b)
      Sets if this window manager is created and used from an external suite or not.
      A WM is external if its id is defined into the company.ui.externalWebViews property.
      Parameters:
      b - true if this window manager is created to be used from an external suite, false otherwise.
    • getDescription

      public String getDescription()
      Gets the description of the active window. If there's no active window or the window has no description, return value will be "---".
      Returns:
      The description of the active window.
    • setRefreshed

      public void setRefreshed(int times)
      Sets the page refresh time.
      Parameters:
      times - The time to set for the page refresh.
    • getRefreshed

      public int getRefreshed()
      Gets the page refresh time.
      Returns:
      The page refresh time.
    • getMenu

      public UIMenu getMenu()
      Gets the UIMenu of the active window.
      Returns:
      The UIMenu of the active window.
    • setMenu

      public void setMenu(UIMenu uim)
      Sets the UIMenu for the active window.
      Parameters:
      uim - The UIMenu to set.
    • getMenuFavourites

      public List<XMLTree> getMenuFavourites()
      Gets the list of XMLTree favorites nodes for the active window.
      Returns:
      The list of XMLTree favorites nodes for the active window.
    • setMenuFavourites

      public void setMenuFavourites(List<XMLTree> l)
      Sets the list of XMLTree favorites nodes for the active window.
      Parameters:
      l - The list of XMLTree favorites nodes for the active window.
    • getId

      public String getId()
      Gets the active window id.
      Returns:
      The id of the active window.
    • switchMaster

      public void switchMaster(String id)
      Changes the master id of the window.
      If previously the view did not have a master, it is not possible to assign one now as the view, from free, would become dependent. Changing the type of a view is not allowed.
      Parameters:
      id - The new master id to set to the window.
    • getMasterId

      public String getMasterId()
      Gets the active master id of the window.
      Returns:
      The master id of the window.
    • getColor

      public String getColor()
      Returns:
      Gets the window color.
    • getStartDate

      public Date getStartDate()
      Returns:
      Gets the Date since the window was created.
    • setLastAccess

      public void setLastAccess(Date d)
      Sets the Date of the last access.
      Parameters:
      d - The date to set.
    • getLastAccess

      public Date getLastAccess()
      Returns:
      Gets the Date of the last access.
    • getLastException

      public Throwable getLastException()
      Returns:
      Gets the last exception throws by the windows
    • setLastException

      public void setLastException(Throwable lastException)
      Sets the last Throwable Exception to throws by the window-
      Parameters:
      lastException - The last exception to set.
    • setWizard

      public void setWizard(Wizard w)
    • getWizard

      public Wizard getWizard()
    • setInterlocutor

      public void setInterlocutor(Interlocutor interlocutor)
    • getInterlocutor

      public Interlocutor getInterlocutor()
    • getWorkContext

      public WorkContext getWorkContext()
      Gets the active WorkContext.
      Returns:
      The active WorkContext.
    • setWorkContext

      public void setWorkContext(WorkContext workcontext)
      Sets the active WorkContext.
      Parameters:
      workcontext - The active WorkContext to set for the window.
    • getProcessor

      public overit.geocall.ux.servlet.processor.RequestProcessor getProcessor()
      Gets the RequestProcessor of the active window.
      Returns:
      The RequestProcessor of the active window.
    • push

      public void push(Window wnd, Object o)
      Open a window and add it on the top of the window stack (the previous open ones remains open).
      Parameters:
      wnd - The window to open.
      o - The Children container of the window to open.
    • push

      public void push(Window wnd, Object o, boolean isBlindPush)
      Open a window and add it on the top of the window stack (the previous open ones remains open).
      Parameters:
      wnd - The window to open.
      o - The Children container of the window to open.
      isBlindPush - Set if this push is a blind one or not. A blind push will not manage the restore phase when this window will be closed.
      So with a blind window the Container.onRestore(Object) method will not be called, when the Container.onClose() will be called.
    • pop

      public Window pop(Object o)
      Close the active window removing the first Window object of the stack.
      After removing the window object will be invoked a specific method.
      If no class i specified to invoke the specific method to restore the context, will be inoked a default method "onRestore" from the first object in the stack after removing the first window.
      Parameters:
      o - The object class from which invoke the restore method after the pop action.
      Returns:
      The new window after removing the active one.
    • replace

      public void replace(Window wnd, Object o)
      Replaces the active window with the one passed by parameter.
      Parameters:
      wnd - The new window to set.
      o - The object class from which invoke the restore method after the pop action.
    • getStackSize

      public int getStackSize()
      Returns:
      The stack size of the window manager i.e. the number of Window inside the stack and visited by the user.
    • getLabel

      public String getLabel()
      Returns:
      The active window's label, if there's no windows in the stack the retuned value will be "---".
    • getTop

      public Window getTop()
      Returns:
      The active Window at the top of the stack. If there's no windows on the stack return null.
    • getWindow

      public Window getWindow(int pos)
      Gets the specific window positioned at the ith position in the stack.
      Parameters:
      pos - The ith position of the window.
      Returns:
      The specific window positioned at the ith position in the stack. If the pos is ≥ of the stack size (also i the stack is empty) the return value is null.
    • getSession

      public overit.geocall.servlet.WebSession getSession()
      Returns:
      The active WebSession.s
    • getParameters

      public WebParameters getParameters()
      Returns:
      The WebParameters of the active session.
    • getIdentity

      public Identity getIdentity()
      Description copied from interface: Identified
      Returns the Identity associated to the component
      Specified by:
      getIdentity in interface Identified
      Returns:
      The Identity of the user currently logged in the application
    • processRequests

      public void processRequests()
      Takes the first request from the stack and forwards it to the component it is intended for.
      If a date has been set in which the context is no longer available, the request to be processed will be invalidated and the user will be logged out after the first interaction. (For example for maintenance operations or something similar).
    • postRequest

      public UIMessage postRequest(WebParameters wp, boolean changelevel)
      Given the parameters that arrive with the http request, builds the request message for the application and puts it on top of the stack.
      Parameters:
      wp - The WebParameters from which extract the message to put on top of the stack.
      changelevel - Define if generates the code for the Window, used in the url creation for the Servlet or not.
      Returns:
      The UIMessage processed from the http request.
    • parseParams

      protected UIMessage parseParams(WebParameters wp, Ref<String> destination, Ref<String> message, HashGetter params, HashGetter values, HashGetter daValues, HashGetter controlValues, Window w)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • iterator

      public Iterator<Window> iterator()
      Returns:
      The Iterator of the window's stack.
    • deleteOnExit

      public void deleteOnExit(Object o)
      Adds a new temporary file or WebResources.
      Parameters:
      o - The object to add.
    • onClose

      public void onClose()
      Closing the active session. All temporary files (or WebResources) associated to the session must be closed and delete from their temporary directory.
    • onClose

      public void onClose(boolean deTouch)
      Closing the active session. All temporary files (or WebResources) associated to the session must be closed and delete from their temporary directory.
      Parameters:
      deTouch - if true, this window manager has to de-touch itself launching a UserDeTouchEvent; if false, no UserDeTouchEvent is launched.
    • savePickedProfileState

      protected void savePickedProfileState() throws DAException, DAValidateException
      Throws:
      DAException
      DAValidateException
    • onPickup

      public void onPickup(overit.geocall.servlet.WebSession ws)
      Sets a new WebSession.
      Parameters:
      ws - The new web session to set.
    • getResourceServletDocument

      public WebResource getResourceServletDocument()
      Gets the resource servlet document.
      Returns:
      The resource servlet document.
    • setResourceServletDocument

      public void setResourceServletDocument(WebResource wr)
      Sets a WebResource for the active session.
      Parameters:
      wr - The web resource to set.
    • setIdentity

      public void setIdentity(Identity identity)
      Description copied from interface: Identified
      Sets the Identity to the component
      Specified by:
      setIdentity in interface Identified
      Parameters:
      identity - The Identity that must be associated to the component
    • getClipboard

      @Deprecated public overit.geocall.clipboard.Clipboard getClipboard()
      Deprecated.
      Use getWS().getClipboard();
      Returns:
      Use getWS().getClipboard();
    • setLastTracer

      public void setLastTracer(Tracer tracer)
      Sets the last Tracer to trace the events of the active session.
      Parameters:
      tracer - The gtracer to set.
    • getLastTracer

      public Tracer getLastTracer()
      Gets the last Tracer.
      Returns:
      The last tracer set.
    • getFlag

      public boolean getFlag(String flag)
      Gets if the flag, of the active WorkContext or the active Interlocutor, passed by parameter exist or not.
      Parameters:
      flag - The Flag to search
      Returns:
      true if the flag exits,false otherwise.
    • sendCookie

      @Deprecated(since="11.1", forRemoval=true) public void sendCookie(String name, String value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use sendCookie(String, String, boolean, boolean) instead. Sends a Cookie to the client and add it to the set of cookie sent..
      Parameters:
      name - The name that identify the cookie.
      value - The value of the cookie.
    • sendCookie

      public void sendCookie(String name, String value, boolean secure, boolean isHttpOnly)
      Sends a Cookie to the client and add it to the set of cookie sent.
      Parameters:
      name - The name that identify the cookie.
      value - The value of the cookie.
      secure - if true, sends the cookie from the browser to the server only when using a secure protocol; if false, sent on any protocol
      isHttpOnly - true if this cookie is to be marked as HttpOnly, false otherwise
    • sendCookie

      @Deprecated(since="11.1", forRemoval=true) public void sendCookie(String name, String value, int maxage, String path)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use sendCookie(String, String, boolean, boolean, int, String) instead. Sends a Cookie to the client and add it to the set of cookie sent.
      Parameters:
      name - The name that identify the cookie.
      value - The value of the cookie.
      maxage - Define the expiration time for the cookie.
      path - The path in which the cookie will be saved
    • sendCookie

      public void sendCookie(String name, String value, boolean secure, boolean isHttpOnly, int maxage, String path)
      Sends a Cookie to the client and add it to the set of cookie sent.
      Parameters:
      name - The name that identify the cookie.
      value - The value of the cookie.
      secure - if true, sends the cookie from the browser to the server only when using a secure protocol; if false, sent on any protocol
      isHttpOnly - true if this cookie is to be marked as HttpOnly, false otherwise
      maxage - Define the expiration time for the cookie.
      path - The path in which the cookie will be saved
    • getNewCookies

      public HashSet getNewCookies()
      Gets the set of cookies sent to the client.
      Returns:
      The set of cookies sent to the client.
    • setCancelException

      public void setCancelException(CancelException ce)
      Sets the Exception that will raise when it is canceled some operation, and that can register the point and the reason of the cancelation.
      Parameters:
      ce - The exception to set.
    • getCancelException

      public CancelException getCancelException()
      Gets the CancelException set.
      Returns:
      The CancelException set.
    • openWindow

      public void openWindow(String url)
      Opens a new window identified by the url.
      Parameters:
      url - The url that identify the new window
    • openWindow

      public void openWindow(Gate g)
      Opens a new window identified by the Gate.
      Parameters:
      g - The gate that identify the new window
    • postWindow

      public void postWindow(String url, Map params)
      Opens a new window identified by the url passing it some parameters.
      Parameters:
      url - The url that identify the new window
      params - Params to pass to the new window to open
    • getProcessingTrack

      public overit.geocall.ux.servlet.processor.ProcessingTrack getProcessingTrack()
      Returns:
      Gets the ProcessingTrack set for the active session. THe actual component in use.
    • useComponent

      public void useComponent(String name, SingleUseComponent otc)
      Sets the new component to use defined by name and a SingleUseComponent.
      Parameters:
      name - The name of the component to use.
      otc - The SingleUseComponent to set.
    • getGateKeeper

      public GateKeeper getGateKeeper()
      Gets the GateKeeper set.
      Returns:
      The active GateKeeper.
    • getErrorNotifier

      public ErrorNotifier getErrorNotifier()
      Get the task that will manages the exceptions.
      Returns:
      the instance of the task or null if it is not defined.
    • doSessionSerializationTest

      public String doSessionSerializationTest()
      Try to serialize the current web session and logs the errors if any
      Returns:
      the serialization error message if present
    • touch

      public void touch()
    • setRouteName

      public void setRouteName(String routeName)
      Sets the route name related to this WindowManager.
      By default, the route name is set to null and is set when the user navigates to a new page.
      This attribute it's used to recognize whether the requested route is already active (and therefore does not need to be reloaded) or not.
      Parameters:
      routeName - The route name related to this WindowManager
    • getRouteName

      public String getRouteName()
      Gets the route name related to this WindowManager.
      By default, the route name is set to null and is set when the user navigates to a new page.
      This attribute it's used to recognize whether the requested route is already active (and therefore does not need to be reloaded) or not.
      Returns:
      The route name related to this WindowManager
    • setWebRouteParams

      public void setWebRouteParams(String params)
      Sets the route params related to the route in the query string format.
      By default, the route params are set to null and are set when the user pass them by query string on url.
      Parameters:
      params - The route params related to the route.
    • getWebRouteParams

      public String getWebRouteParams()
      Gets the route params related to the route in the query string format.
      By default, the route params are set to null and are set when the user pass them by query string on url.
      Returns:
      The route params related to the route if they are present.
    • setRouteParams

      public void setRouteParams(Map<String,Object> params)
      Sets the route params related to the route.
      By default, the route params are set to empty map, then they are set when the user pass them by query string on url.
      Parameters:
      params - The route params related to the route.
    • getRouteParams

      public Map<String,Object> getRouteParams()
      Gets the route params related to the route.
      By default, the route params are set to empty map, then they are set when the user pass them by query string on url.
      Returns:
      The route params related to the route if they are present.
    • setProcessingRedirectToRoute

      public void setProcessingRedirectToRoute(boolean b)
      Sets if the WindowManager is processing the navigation to a new page.
      Parameters:
      b - true If the WindowManager is processing the navigation to a new page, false otherwise
    • isProcessingRedirectToRoute

      public boolean isProcessingRedirectToRoute()
      Gets if the WindowManager is processing the navigation to a new page or not.
      Returns:
      true If the WindowManager is processing the navigation to a new page, false otherwise
    • setConfigurableMode

      public void setConfigurableMode(boolean b)
      Sets if the user is allowed to configure and edit the UI of the application like grids and table, or not.
      Parameters:
      b - true if the user is allowed to configure and edit the UI of the application like grids and table, false otherwise.
    • isConfigurableMode

      public boolean isConfigurableMode()
      Gets if the user is allowed to configure and edit the UI of the application like grids and table, or not.
      Returns:
      true if the user is allowed to configure and edit the UI of the application like grids and table, false otherwise.