Package overit.geocall.ui
Class WindowManager
java.lang.Object
overit.geocall.ui.WindowManager
- All Implemented Interfaces:
Serializable,Identified
This class implements
This class implements methods and attributes to manage the different windows(and their attributes and operations) of the application.
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 Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected HashGetterprotected CancelExceptionprotected Stringprotected HashSetprotected booleanprotected GateKeeperprotected Stringprotected Identityprotected Interlocutorprotected Dateprotected Throwableprotected Tracerprotected static AtomicIntegerprotected Stringprotected UIMenuprotected WebParametersprotected ThreadContextprotected overit.geocall.ux.servlet.processor.ProcessingTrackprotected overit.geocall.ux.servlet.processor.RequestProcessorprotected intprotected WebResourceprotected Stringprotected Dateprotected ArrayListprotected overit.geocall.servlet.WebSessionprotected Wizardprotected WorkContextprotected static final Stringprotected static final Stringprotected Landingprotected String -
Constructor Summary
ConstructorsConstructorDescriptionWindowManager(Identity identity, overit.geocall.servlet.WebSession ws, WebParameters wp, String id, String color) Creates a window manager for the activeWebSessionand the selected view by the user without a master id.WindowManager(Identity identity, overit.geocall.servlet.WebSession ws, WebParameters wp, String id, String color, String masterId) Creates a window manager for the activeWebSessionand the selected view by the user. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new temporary file orWebResources.Try to serialize the current web session and logs the errors if anybooleanGets if the benchmark mode is active or not.Gets theCancelExceptionset.overit.geocall.clipboard.ClipboardDeprecated.Use getWS().getClipboard();getColor()Gets the description of the active window.booleanGets if the develop mode is active or not.Get the task that will manages the exceptions.booleanGets if the flag, of the activeWorkContextor the activeInterlocutor, passed by parameter exist or not.Gets theGateKeeperset.getId()Gets the active window id.Returns theIdentityassociated to the componentgetLabel()Gets the activeLandingpageGets the lastTracer.static intGets the number of actuve sessions.Gets the active master id of the window.getMenu()Gets theUIMenuof the active window.Gets the list ofXMLTreefavorites nodes for the active window.Gets the set of cookies sent to the client.getNonce()Gets the active nonce stringoverit.geocall.ux.servlet.processor.ProcessingTrackoverit.geocall.ux.servlet.processor.RequestProcessorGets theRequestProcessorof the active window.intGets the page refresh time.Gets the resource servlet document.Gets the route name related to thisWindowManager. 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.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.overit.geocall.servlet.WebSessionintGets the name of the temporary theme to testgetTop()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.getWindow(int pos) Gets the specific window positioned at the ith position in the stack.Gets the activeWorkContext.booleanGets if the user is allowed to configure and edit the UI of the application like grids and table, or not.booleanGets if this window manager is created and used from an external suite or not.booleanGets if theWindowManageris processing the navigation to a new page or not.iterator()voidOpen a window and close the previous open ones.voidOpen a window and close the previous open ones.voidonClose()Closing the active session.voidonClose(boolean deTouch) Closing the active session.voidonPickup(overit.geocall.servlet.WebSession ws) Sets a newWebSession.voidopenWindow(String url) Opens a new window identified by the url.voidopenWindow(Gate g) Opens a new window identified by theGate.protected UIMessageparseParams(WebParameters wp, Ref<String> destination, Ref<String> message, HashGetter params, HashGetter values, HashGetter daValues, HashGetter controlValues, Window w) Close the active window removing the firstWindowobject 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.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.voidpostWindow(String url, Map params) Opens a new window identified by the url passing it some parameters.voidTakes 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.voidOpen a window and add it on the top of the window stack (the previous open ones remains open).voidOpen a window and add it on the top of the window stack (the previous open ones remains open).voidReplaces the active window with the one passed by parameter.protected voidvoidsendCookie(String name, String value) Deprecated, for removal: This API element is subject to removal in a future version.usesendCookie(String, String, boolean, boolean)instead.voidsendCookie(String name, String value, boolean secure, boolean isHttpOnly) Sends aCookieto the client and add it to the set of cookie sent.voidsendCookie(String name, String value, boolean secure, boolean isHttpOnly, int maxage, String path) Sends aCookieto the client and add it to the set of cookie sent.voidsendCookie(String name, String value, int maxage, String path) Deprecated, for removal: This API element is subject to removal in a future version.voidsetBenchmarkMode(boolean mode) Sets if you want to activate the benchmark mode or not.voidSets theExceptionthat will raise when it is canceled some operation, and that can register the point and the reason of the cancelation.voidsetConfigurableMode(boolean b) Sets if the user is allowed to configure and edit the UI of the application like grids and table, or not.voidsetDevelopMode(boolean mode) Sets if you want to activate the develop mode or not.voidsetIdentity(Identity identity) Sets theIdentityto the componentvoidsetInterlocutor(Interlocutor interlocutor) voidsetIsExternal(boolean b) Sets if this window manager is created and used from an external suite or not.voidsetLanding(Landing landing) Sets theLandingpagevoidSets theDateof the last access.voidsetLastException(Throwable lastException) Sets the lastThrowableException to throws by the window-voidsetLastTracer(Tracer tracer) Sets the lastTracerto trace the events of the active session.voidSets theUIMenufor the active window.voidSets the list ofXMLTreefavorites nodes for the active window.voidSets the nonce attribute that will be used by the page into inline script and style tags.voidsetProcessingRedirectToRoute(boolean b) Sets if theWindowManageris processing the navigation to a new page.voidsetRefreshed(int times) Sets the page refresh time.voidSets aWebResourcefor the active session.voidsetRouteName(String routeName) Sets the route name related to thisWindowManager. 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.voidsetRouteParams(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.voidsetThemeToTest(String name) Sets the name of the temporary theme to testvoidsetWebRouteParams(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.voidvoidsetWorkContext(WorkContext workcontext) Sets the activeWorkContext.voidswitchMaster(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.toString()voidtouch()voiduseComponent(String name, SingleUseComponent otc) Sets the new component to use defined by name and aSingleUseComponent.
-
Field Details
-
ERROR_OCCURRED_WHILE_LAUNCHING_THE_USER_DE_TOUCH_EVENT
- See Also:
-
ERROR_OCCURRED_WHILE_LAUNCHING_THE_USER_TOUCH_EVENT
- See Also:
-
_webSession
protected overit.geocall.servlet.WebSession _webSession -
favouritesNodes
-
_processingTrack
protected overit.geocall.ux.servlet.processor.ProcessingTrack _processingTrack -
_stackWM
-
_processingThreadContext
-
_params
-
_processor
protected transient overit.geocall.ux.servlet.processor.RequestProcessor _processor -
_servletName
-
_temporaryFiles
-
_lastTracer
-
_cancelException
-
_wizard
-
_interlocutor
-
_workcontext
-
_identity
-
_developMode
protected boolean _developMode -
_startDate
-
_lastAccess
-
_lastException
-
_cache
-
_refreshed
protected int _refreshed -
_loggedSessions
-
_resourceServletDocument
-
_benchmarkMode
protected boolean _benchmarkMode -
_cookies
-
_id
-
_color
-
_masterId
-
_gk
-
landing
-
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 activeWebSessionand the selected view by the user.- Parameters:
identity- TheIdentityassociated with the user that select the viewws- The active WebSessionwp- The WebParameters associated to the WebSessionid- The id of the window to manage.color- The color of the window to managemasterId- 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 activeWebSessionand the selected view by the user without a master id.- Parameters:
identity- TheIdentityassociated with the user that select the viewws- The active WebSessionwp- The WebParameters associated to the WebSessionid- The id of the window to manage.color- The color of the window to manage
-
-
Method Details
-
setNonce
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
Gets the active nonce string- Returns:
- The active nonce string.
-
setLanding
Sets theLandingpage- Parameters:
landing- The landing page to set.
-
getLanding
Gets the activeLandingpage- Returns:
- The active landing page.
-
setThemeToTest
Sets the name of the temporary theme to test- Parameters:
name- The name of the temporary theme to test
-
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-trueif you want to activate the benchmark mode,falseotherwise.
-
getBenchmarkMode
public boolean getBenchmarkMode()Gets if the benchmark mode is active or not.- Returns:
trueif benchmark mode is active,falseotherwise.
-
getDevelopMode
public boolean getDevelopMode()Gets if the develop mode is active or not.- Returns:
trueif develop mode is active,falseotherwise.
-
setDevelopMode
public void setDevelopMode(boolean mode) Sets if you want to activate the develop mode or not.- Parameters:
mode-trueif you want to activate the develop mode,falseotherwise.
-
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:
trueif this window manager is created to be used from an external suite,falseotherwise.
-
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-trueif this window manager is created to be used from an external suite,falseotherwise.
-
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
Gets theUIMenuof the active window.- Returns:
- The
UIMenuof the active window.
-
setMenu
Sets theUIMenufor the active window.- Parameters:
uim- TheUIMenuto set.
-
getMenuFavourites
Gets the list ofXMLTreefavorites nodes for the active window.- Returns:
- The list of
XMLTreefavorites nodes for the active window.
-
setMenuFavourites
Sets the list ofXMLTreefavorites nodes for the active window.- Parameters:
l- The list ofXMLTreefavorites nodes for the active window.
-
getId
Gets the active window id.- Returns:
- The id of the active window.
-
switchMaster
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
Gets the active master id of the window.- Returns:
- The master id of the window.
-
getColor
- Returns:
- Gets the window color.
-
getStartDate
- Returns:
- Gets the
Datesince the window was created.
-
setLastAccess
Sets theDateof the last access.- Parameters:
d- The date to set.
-
getLastAccess
- Returns:
- Gets the
Dateof the last access.
-
getLastException
- Returns:
- Gets the last exception throws by the windows
-
setLastException
Sets the lastThrowableException to throws by the window-- Parameters:
lastException- The last exception to set.
-
setWizard
-
getWizard
-
setInterlocutor
-
getInterlocutor
-
getWorkContext
Gets the activeWorkContext.- Returns:
- The active
WorkContext.
-
setWorkContext
Sets the activeWorkContext.- Parameters:
workcontext- The activeWorkContextto set for the window.
-
getProcessor
public overit.geocall.ux.servlet.processor.RequestProcessor getProcessor()Gets theRequestProcessorof the active window.- Returns:
- The
RequestProcessorof the active window.
-
push
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
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 theContainer.onRestore(Object)method will not be called, when theContainer.onClose()will be called.
-
pop
Close the active window removing the firstWindowobject 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
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
Windowinside the stack and visited by the user.
-
getLabel
- Returns:
- The active window's label, if there's no windows in the stack the retuned value will be "---".
-
getTop
- Returns:
- The active
Windowat the top of the stack. If there's no windows on the stack return null.
-
getWindow
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
- Returns:
- The
WebParametersof the active session.
-
getIdentity
Description copied from interface:IdentifiedReturns theIdentityassociated to the component- Specified by:
getIdentityin interfaceIdentified- 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
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- TheWebParametersfrom 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
UIMessageprocessed 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
-
iterator
- Returns:
- The
Iteratorof the window's stack.
-
deleteOnExit
Adds a new temporary file orWebResources.- Parameters:
o- The object to add.
-
onClose
public void onClose()Closing the active session. All temporary files (orWebResources) 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 (orWebResources) associated to the session must be closed and delete from their temporary directory.- Parameters:
deTouch- iftrue, this window manager has to de-touch itself launching aUserDeTouchEvent; iffalse, noUserDeTouchEventis launched.
-
savePickedProfileState
- Throws:
DAExceptionDAValidateException
-
onPickup
public void onPickup(overit.geocall.servlet.WebSession ws) Sets a newWebSession.- Parameters:
ws- The new web session to set.
-
getResourceServletDocument
Gets the resource servlet document.- Returns:
- The resource servlet document.
-
setResourceServletDocument
Sets aWebResourcefor the active session.- Parameters:
wr- The web resource to set.
-
setIdentity
Description copied from interface:IdentifiedSets theIdentityto the component- Specified by:
setIdentityin interfaceIdentified- Parameters:
identity- The Identity that must be associated to the component
-
getClipboard
Deprecated.Use getWS().getClipboard();- Returns:
- Use getWS().getClipboard();
-
setLastTracer
Sets the lastTracerto trace the events of the active session.- Parameters:
tracer- The gtracer to set.
-
getLastTracer
Gets the lastTracer.- Returns:
- The last tracer set.
-
getFlag
Gets if the flag, of the activeWorkContextor the activeInterlocutor, passed by parameter exist or not.- Parameters:
flag- The Flag to search- Returns:
trueif the flag exits,falseotherwise.
-
sendCookie
Deprecated, for removal: This API element is subject to removal in a future version.usesendCookie(String, String, boolean, boolean)instead. Sends aCookieto 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
Sends aCookieto 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 protocolisHttpOnly- 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.usesendCookie(String, String, boolean, boolean, int, String)instead. Sends aCookieto 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 aCookieto 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 protocolisHttpOnly- true if this cookie is to be marked as HttpOnly, false otherwisemaxage- Define the expiration time for the cookie.path- The path in which the cookie will be saved
-
getNewCookies
Gets the set of cookies sent to the client.- Returns:
- The set of cookies sent to the client.
-
setCancelException
Sets theExceptionthat 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
Gets theCancelExceptionset.- Returns:
- The
CancelExceptionset.
-
openWindow
Opens a new window identified by the url.- Parameters:
url- The url that identify the new window
-
openWindow
Opens a new window identified by theGate.- Parameters:
g- The gate that identify the new window
-
postWindow
Opens a new window identified by the url passing it some parameters.- Parameters:
url- The url that identify the new windowparams- Params to pass to the new window to open
-
getProcessingTrack
public overit.geocall.ux.servlet.processor.ProcessingTrack getProcessingTrack()- Returns:
- Gets the
ProcessingTrackset for the active session. THe actual component in use.
-
useComponent
Sets the new component to use defined by name and aSingleUseComponent.- Parameters:
name- The name of the component to use.otc- TheSingleUseComponentto set.
-
getGateKeeper
Gets theGateKeeperset.- Returns:
- The active
GateKeeper.
-
getErrorNotifier
Get the task that will manages the exceptions.- Returns:
- the instance of the task or null if it is not defined.
-
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
Sets the route name related to thisWindowManager. 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 thisWindowManager
-
getRouteName
Gets the route name related to thisWindowManager. 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
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
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
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
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 theWindowManageris processing the navigation to a new page.- Parameters:
b-trueIf theWindowManageris processing the navigation to a new page,falseotherwise
-
isProcessingRedirectToRoute
public boolean isProcessingRedirectToRoute()Gets if theWindowManageris processing the navigation to a new page or not.- Returns:
trueIf theWindowManageris processing the navigation to a new page,falseotherwise
-
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-trueif the user is allowed to configure and edit the UI of the application like grids and table,falseotherwise.
-
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:
trueif the user is allowed to configure and edit the UI of the application like grids and table,falseotherwise.
-