LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.web
Class LyWebViewManager

java.lang.Object
  extended by leon.view.LyViewManager
      extended by leon.view.web.LyWebViewManager
All Implemented Interfaces:
LyViewManagerInterface
Direct Known Subclasses:
LyJQViewManager, LyMobileViewManager, LyStrutsViewManager

public abstract class LyWebViewManager
extends LyViewManager

Communication control layer --> View Will implement remote update notifications.


Field Summary
static java.lang.String __VERSION
           
 java.lang.String _mobileStartUrl
          Mobile component web view URL.
 java.lang.String _root_url
          localhost root URL.
static int BROWSER_CHROME
          The Chrome browser.
static java.lang.String BROWSER_CHROME_ID
          The Chrome browser identifier.
static int BROWSER_FIREFOX
          The Firefox browser.
static java.lang.String BROWSER_FIREFOX_ID
          The Firefox browser identifier.
static int BROWSER_MSIE
          The MicroSoft Internet Explorer browser.
static java.lang.String BROWSER_MSIE_ID
          The MicroSoft Internet Explorer browser identifier.
static int BROWSER_NETSCAPE
          The Netscape browser.
static java.lang.String BROWSER_NETSCAPE_ID
          The Netscape browser identifier.
static int BROWSER_OPERA
          The Opera browser.
static java.lang.String BROWSER_OPERA_ID
          The Opera browser identifier.
static int BROWSER_OTHER
          Unspecified browser.
static int CACHED_IMAGE_MAX_SIZE
          Maximum size of the images that may be cached (in pixels²).
static int DEFAULT_POPUP_HEIGHT
           
static int DEFAULT_POPUP_WIDTH
          Indicates the size (in pixel) used for a new window if nothing is specified for width or height.
static boolean OPTIMIZE_TABLE_GENERATION
          Indicates whether the TABLE HTML tags must be optimized.
static java.lang.String PARAMETERS
          Separator used within a message text to introduce parameters.
static boolean REGISTER_PAGE_WRITERS
          Indicates whether page writers must be registered on view managers.
static java.lang.String SEP_PW_ID
          The page writer id separator : used within a frame name to introduce the page writer identifier.
static short SHOW_LOCATION_PARAMETER_DIRECTORIES
          For show location : indicates whether directories must be set in newly opened window.
static short SHOW_LOCATION_PARAMETER_LOCATION
          For show location : indicates whether location must be set in newly opened window.
static short SHOW_LOCATION_PARAMETER_MENUBAR
          For show location : indicates whether menubar must be set in newly opened window.
static short SHOW_LOCATION_PARAMETER_NAME
          For show location : indicates the name of the newly opened window.
static short SHOW_LOCATION_PARAMETER_RESIZABLE
          For show location : indicates whether newly opened window must be resizable.
static short SHOW_LOCATION_PARAMETER_SCROLLBARS
          For show location : indicates whether scrollbars must be set in newly opened window.
static short SHOW_LOCATION_PARAMETER_STATUSBAR
          For show location : indicates whether statusbar must be set in newly opened window.
static short SHOW_LOCATION_PARAMETER_TOOLBAR
          For show location : indicates whether toolbar must be set in newly opened window.
static int TYPE_ALERT
          The alert message type.
static int TYPE_LOCATION
          The location in current window message type.
static int TYPE_LOCATION_NEW_WINDOW
          The location in new window message type.
static int TYPE_NO
          The type of a message that have no type.
static int TYPE_QUESTION
          The question message type.
static int TYPE_SHOW_FILE
          The show file message type.
static boolean WEB_FILE_NEW_WINDOW
          Indicates that we open a new window when there is a file to show.
 
Fields inherited from class leon.view.LyViewManager
COMMAND_ALL, COMMAND_CANCEL, COMMAND_CLOSED, COMMAND_HELP, COMMAND_NO, COMMAND_NONE, COMMAND_OK, COMMAND_YES, EMPTY_AREA_HEIGHT, EMPTY_AREA_WIDTH, EMPTY_FORM_FIELD_HEIGHT, EMPTY_FORM_FIELD_WIDTH, EMPTY_FORM_HEIGHT, EMPTY_FORM_WIDTH, EMPTY_LABEL_HEIGHT, EMPTY_LABEL_WIDTH, EMPTY_MENUBAR_HEIGHT, EMPTY_MESSAGES_HEIGHT, EMPTY_MESSAGES_WIDTH, EMPTY_TABLE_HEIGHT, EMPTY_TABLE_WIDTH, EMPTY_TOOLBAR_HEIGHT, EMPTY_TOOLBAR_WIDTH, EMPTY_TOP_AREA_HEIGHT, EMPTY_TOP_AREA_WIDTH, SHOW_LOCATION_PARAMETER_FULL_SCREEN, SHOW_LOCATION_PARAMETER_HEIGHT, SHOW_LOCATION_PARAMETER_WIDTH, SHOW_LOCATION_PARAMETER_X, SHOW_LOCATION_PARAMETER_Y
 
Constructor Summary
LyWebViewManager(LyEnvironment environment)
          Constructor.
 
Method Summary
 void activateAdditionalRefreshScriptsBuffer(boolean activate)
          Enables or disables the use of a temporary buffer for additional refresh scripts.
 void addAdditionalRefreshScripts(java.lang.String script)
          Adds the given additional refresh script to the _additionalRefreshScripts list.
 void addAdditionalRefreshScripts(java.lang.String script, boolean insertEnd)
          Adds the given additional refresh script to the _additionalRefreshScripts list.
 void addNewWindowScript(java.lang.String script)
           
 void addPageWriter(LyWebPageWriter page)
          Adds the given PageWriter in the known page writer list.
 void addPopupViewMapping(java.lang.String frame, java.lang.String view)
          Adds the mapping between the given frame and its given popup view.
 void addRefreshingView(LyGetRefreshInterface viewComp)
          Adds a refreshing view in the list : this enables auto-refresh mode.
 void addReloadFrame(java.lang.String frame)
          Adds the given frame to the list of reload frames.
 void addReloadFrame(java.lang.String frame, java.lang.String pageWriterId)
          Adds the given frame to the list of reload frames.
 LyAnswerInterface answerMessage(java.lang.String infoId, boolean result)
          Answer the interface by calling the answer associated to message associated to the given ID.
 LyAnswerInterface answerMessage(java.lang.String infoId, short result)
          Answer the interface by calling the answer associated to message associated to the given ID.
 void askQuestion(LyComponent source, java.lang.String message, LyQuestionAnswerInterface client, java.lang.Object clientData)
          Ask a question to the user.
 LyViewComponent buildInternalView(LyComponent component)
          Build internal view.
 LyWebDecoration buildWebDecoration(LyEnvironment environment)
          Builds an instance of LyWebDecoration corresponding to current view manager.
 void clearAdditionalRefreshScripts()
          Clear the list of additional refresh scripts _additionalRefreshScripts.
 void clearRefreshingView(LyGetRefreshInterface viewComp)
          Removes the given view from the _refreshingViews list.
 void clearReloadFrame(java.lang.String frame)
          Removes a frames from the _reloadFrames list.
 void clearReloadFrames()
          Clears the list of frames which need to be reloaded.
 void clearTemporaryResources()
          Clear all the temporary resources used by the viewManager Implemented in subclasses.
 boolean encodeImage(java.lang.Object image, java.lang.String imageDir, java.lang.String imageFile)
          Encodes an image to JPEG format.
static java.lang.String encodeString(java.lang.String message)
          Encodes a String to enable displaying it in an alert message box.
 void exit(int code)
          To exit an application.
 boolean forceScrolling()
          Indicates if IFRAME tags must contain the scrolling attribute set.
 void free()
          Free the view manager.
 java.lang.String generateScriptsInclusion()
          Generates a string containing all the Javascript files inclusion.
 java.util.Vector<java.lang.String> getAdditionalRefreshScripts()
          Gets the list of additional refresh scripts _additionalRefreshScripts.
 java.util.Vector<java.lang.String> getAdditionalRefreshScripts(boolean clearScripts)
          Gets the list of additional refresh scripts _additionalRefreshScripts.
 int getBrowser()
          Gets the browser type code.
 double getBrowserVersion()
          Gets the browser version.
 boolean getClose()
          Gets the current thread close request status from the _closeRequests list.
 java.lang.String getCurrentWindowName()
          Accessor to the target popup window name if using popup.This is stored on a per-thread basis Default mplementation always return null (used for web modes).
 LyWebDecoration getDecoration()
          Gets the current decoration page.
 java.lang.String getDefaultPageResource()
          Returns the name of the resource to be used for default page.
 LyViewController getLastPopupViewController()
          Returns the view controller that was last displayed in the popup view.
 java.lang.String getMainTargetFrame()
          Gets the main target frame suffix.
 java.lang.String getMessage()
          Gets the message associated to the current thread.
 java.lang.String getMessage(boolean anyThread)
          Gets the message associated to the current thread.
 java.lang.String getMessage(boolean anyThread, boolean ignoreSentMessages)
          Gets the message associated to the current thread.
 java.lang.String getMessageAnswerURL()
          Returns the URL that must be used to answer messages.
 java.lang.String getMobileStartURL()
          Gets the component web view URL.
 java.util.Vector<java.lang.String> getNewWindowScripts()
           
 LyWebPageWriter getPageWriter()
          Gets the pageWriter for current context (Thread).
 LyWebPageWriter getPageWriter(java.lang.String id)
          Gets the PageWriter associated to the given id.
 java.lang.String getPopupViewMapping(java.lang.String frame)
          Gets the popup view mapped to the given frame.
 java.util.Properties getPropertiesFromContext(java.lang.String prefix)
          Accessor to the properties file or parameter if specified in constructor.
 int getRefreshRate()
          Gets the refresh rate for the auto refresh views.
 java.util.Vector<java.lang.String> getReloadFrames()
          Gets the list of frames which need to be refreshed.
 java.lang.String getRootURL()
          Gets servlet root URL : this is "http://"+local host + LY_APP_DOC.
 java.lang.String getScriptsDir()
          Returns the directory that contains the Javascript files.
 java.lang.String getScriptsDocDir()
          Returns the path of the directory that contains the Javascript files.
 java.lang.String getTargetCode()
          Return the target code used in multi-windows mode.
 java.lang.String getTemporaryLocation()
          Return the temporary directory used to store temporary resources but dependant from the viewer type (for ex: url / partial url for web).
 void hideView(LyWebPageWriter pageWriter)
          Hides the view wrote in the given page writer.
 boolean isBrowserSupported()
          Indicates if current browser is supported with the version of Leonardi.
 boolean isMultipleSession()
          Indicates wether this view manager handles multiple user sessions or not.
 boolean isMultiSession()
          Checks whether this manager handles multiple session.
 boolean isReload()
          Gets the reload mode status of the view.
 LyAnswerInterface messageActionPerformed(java.lang.Object infoId, int cmdResult)
          Method used to call back the listener of the specified message window for the specified result.
 boolean needsUpdate()
          Indicates whether the client needs an update.
 void removeMessageAnswer(java.lang.String infoId)
          Removes the message answer associated to the given ID.
 void removePageWriter(LyWebPageWriter page)
          Removes the given PageWriter from the known page writer list.
 void setBrowser(java.lang.String userAgent)
          Sets the browser type and eventually properties that are not supported by this browser.
 void setClose(LyWebPageWriter pageWriter, boolean close)
          If the current page writer is not the given page writer,
if close=true
and if the page writer window is a pop up window
then adds a script to hide the pop up view
Else if close=true
and if the given page writer's window is null
then adds the current target frame to the list of frame to reload and adds the current thread to associations between thread and close requests.
 void setCurrentWindowName(java.lang.String name)
          Accessor to the target popup window name if using popup.This is stored on a per-thread basis Default mplementation always return null (used for web modes).
 void setDecoration(LyWebDecoration deco)
          Sets the decoration page.
 void setMessage(java.lang.String message)
          Adds the given message to the list of messages identified by their thread.
 void setMessage(java.lang.String message, java.lang.String title, java.lang.String icon, int type, java.lang.String bgColor, java.util.BitSet commands, java.lang.String infoId, java.util.Hashtable<java.lang.Short,java.lang.String> parameters)
          Adds the given message to the list of messages identified by their thread or remove it if message=null.
 void setMessageAnswerUrl(java.lang.String answerUrl)
          This method looks for the current message and sets the URL for the answer to the question.
 void setMobileStartURL(java.lang.String mobileStartUrl)
          Sets component web view URL.
 void setPageWriter(LyWebPageWriter pageWriter)
          Sets the pageWriter for current context (Thread).
 void setReload(boolean reload)
          Sets the reload status with the given value.
 void setRootURL(java.lang.String rootUrl)
          Sets servlet root URL.
 void setTargetCode(java.lang.String targetCode)
          Sets the target code used in multi-windows mode.
 void setWaiting(boolean status)
          Sets the Waiting status for all view of the application.
 void showError(LyComponent source, java.lang.String message)
          Shows a warning message to the user.
 void showFile(LyComponent source, java.lang.String location)
          Shows a file to the user.
 void showLocation(LyComponent source, java.lang.String location, boolean newWindow)
          Shows a location to the user.
 void showLocation(LyComponent source, java.lang.String location, boolean newWindow, java.util.Hashtable<java.lang.Short,java.lang.String> parameters)
          Shows a location to the user.
 void showMessage(LyComponent source, java.lang.String title, java.lang.String icon, java.lang.String message, java.util.BitSet commands, LyMessageAnswerInterface client, java.lang.Object clientData)
          Show a message to the user and return the selection code.
 void showPDFPreview(LyComponent source, java.lang.String location)
          Shows a PDF file to the user.
 void showView(LyWebPageWriter pageWriter)
          Shows the view wrote in the given page writer.
 void showWarning(LyComponent source, java.lang.String message)
          Shows a warning message to the user.
 void updateControllersStackList(java.util.Hashtable<java.lang.String,java.util.Stack<LyViewController>> controllersStackList)
          Updates the _controllerStackList parameter with the count of controllers from the controllersStackList parameter. controllersStackList must contain names of controller stacks as keys and stack of controllers as values.
 boolean useCacheForImage(java.lang.String path, java.lang.Object image)
          Indicates whether given image may be cached.
 boolean usePopupView()
          Indicates if popup view is allowed.
 boolean writeDivs()
          Indicates if DIV tags may be written.
 
Methods inherited from class leon.view.LyViewManager
addDemandListener, addView, areViewManagerCompatible, beep, buildChartConverter, buildErrorImage, buildInternalView, buildInternalView, containsView, copyToClipboard, execGui, execGui, findDefinition, freeImage, getColor, getControllerStackSize, getDefaultImage, getDelay, getDemandTransmitter, getDownloadAction, getEnvironment, getFont, getMaxScreenSize, getMaxWindowSize, getPdfPrintManager, getPluginId, getPrintManager, getScaledInstance, getScreenSize, getSizes, getSlaveSessionClassName, getStringWidth, getTemporaryDir, getView, getView, getViewCount, getWaitingCounter, hasPerspective, hasProperty, isPortletMode, isRtlMode, isSameImage, isShared, loadDefinitions, loadDefinitions, loadImageFromStream, moveCursor, prepareGui, processDemand, raiseError, registerDefinition, removeDemandListener, removeView, replay, repostGuiEvents, setPluginId, shareSession, showComments, showPerspective, startGui, stopGui, swapSession, takeSnapshot, takeSnapshot, unregisterDefinition, waitForLoading
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values

TYPE_NO

public static final int TYPE_NO
The type of a message that have no type. Other types of message can be :

See Also:
Constant Field Values

TYPE_ALERT

public static final int TYPE_ALERT
The alert message type. Indicates that the message is an alert.

See Also:
TYPE_NO, Constant Field Values

TYPE_QUESTION

public static final int TYPE_QUESTION
The question message type. Indicates that the message shown to the user is a question.

See Also:
TYPE_NO, Constant Field Values

TYPE_LOCATION

public static final int TYPE_LOCATION
The location in current window message type. Those messages are used to show a location in the window to the user.

See Also:
TYPE_NO, Constant Field Values

TYPE_LOCATION_NEW_WINDOW

public static final int TYPE_LOCATION_NEW_WINDOW
The location in new window message type. Those messages are used to show a location in a new window to the user.

See Also:
TYPE_NO, Constant Field Values

TYPE_SHOW_FILE

public static final int TYPE_SHOW_FILE
The show file message type. Indicates that the message have to show a file.

See Also:
TYPE_NO, Constant Field Values

BROWSER_MSIE

public static final int BROWSER_MSIE
The MicroSoft Internet Explorer browser.

See Also:
BROWSER_OTHER, Constant Field Values

BROWSER_NETSCAPE

public static final int BROWSER_NETSCAPE
The Netscape browser.

See Also:
BROWSER_OTHER, Constant Field Values

BROWSER_OPERA

public static final int BROWSER_OPERA
The Opera browser.

See Also:
BROWSER_OTHER, Constant Field Values

BROWSER_OTHER

public static final int BROWSER_OTHER
Unspecified browser.
Means other browsers than:

See Also:
Constant Field Values

BROWSER_FIREFOX

public static final int BROWSER_FIREFOX
The Firefox browser.

See Also:
BROWSER_OTHER, Constant Field Values

BROWSER_CHROME

public static final int BROWSER_CHROME
The Chrome browser.

See Also:
BROWSER_OTHER, Constant Field Values

BROWSER_MSIE_ID

public static final java.lang.String BROWSER_MSIE_ID
The MicroSoft Internet Explorer browser identifier.

See Also:
Constant Field Values

BROWSER_FIREFOX_ID

public static final java.lang.String BROWSER_FIREFOX_ID
The Firefox browser identifier.

See Also:
Constant Field Values

BROWSER_CHROME_ID

public static final java.lang.String BROWSER_CHROME_ID
The Chrome browser identifier.

See Also:
Constant Field Values

BROWSER_NETSCAPE_ID

public static final java.lang.String BROWSER_NETSCAPE_ID
The Netscape browser identifier.

See Also:
Constant Field Values

BROWSER_OPERA_ID

public static final java.lang.String BROWSER_OPERA_ID
The Opera browser identifier.

See Also:
Constant Field Values

SHOW_LOCATION_PARAMETER_NAME

public static final short SHOW_LOCATION_PARAMETER_NAME
For show location : indicates the name of the newly opened window.

See Also:
Constant Field Values

SHOW_LOCATION_PARAMETER_SCROLLBARS

public static final short SHOW_LOCATION_PARAMETER_SCROLLBARS
For show location : indicates whether scrollbars must be set in newly opened window.

See Also:
Constant Field Values

SHOW_LOCATION_PARAMETER_RESIZABLE

public static final short SHOW_LOCATION_PARAMETER_RESIZABLE
For show location : indicates whether newly opened window must be resizable.

See Also:
Constant Field Values

SHOW_LOCATION_PARAMETER_TOOLBAR

public static final short SHOW_LOCATION_PARAMETER_TOOLBAR
For show location : indicates whether toolbar must be set in newly opened window.

See Also:
Constant Field Values

SHOW_LOCATION_PARAMETER_STATUSBAR

public static final short SHOW_LOCATION_PARAMETER_STATUSBAR
For show location : indicates whether statusbar must be set in newly opened window.

See Also:
Constant Field Values

SHOW_LOCATION_PARAMETER_MENUBAR

public static final short SHOW_LOCATION_PARAMETER_MENUBAR
For show location : indicates whether menubar must be set in newly opened window.

See Also:
Constant Field Values

SHOW_LOCATION_PARAMETER_DIRECTORIES

public static final short SHOW_LOCATION_PARAMETER_DIRECTORIES
For show location : indicates whether directories must be set in newly opened window.

See Also:
Constant Field Values

SHOW_LOCATION_PARAMETER_LOCATION

public static final short SHOW_LOCATION_PARAMETER_LOCATION
For show location : indicates whether location must be set in newly opened window.

See Also:
Constant Field Values

SEP_PW_ID

public static final java.lang.String SEP_PW_ID
The page writer id separator : used within a frame name to introduce the page writer identifier.

See Also:
Constant Field Values

PARAMETERS

public static final java.lang.String PARAMETERS
Separator used within a message text to introduce parameters.

See Also:
Constant Field Values

REGISTER_PAGE_WRITERS

public static boolean REGISTER_PAGE_WRITERS
Indicates whether page writers must be registered on view managers.


OPTIMIZE_TABLE_GENERATION

public static boolean OPTIMIZE_TABLE_GENERATION
Indicates whether the TABLE HTML tags must be optimized.


DEFAULT_POPUP_WIDTH

public static int DEFAULT_POPUP_WIDTH
Indicates the size (in pixel) used for a new window if nothing is specified for width or height.


DEFAULT_POPUP_HEIGHT

public static int DEFAULT_POPUP_HEIGHT

WEB_FILE_NEW_WINDOW

public static boolean WEB_FILE_NEW_WINDOW
Indicates that we open a new window when there is a file to show. If set to false, show the window in the target frame.


CACHED_IMAGE_MAX_SIZE

public static int CACHED_IMAGE_MAX_SIZE
Maximum size of the images that may be cached (in pixels²).


_root_url

public java.lang.String _root_url
localhost root URL.


_mobileStartUrl

public java.lang.String _mobileStartUrl
Mobile component web view URL.

Constructor Detail

LyWebViewManager

public LyWebViewManager(LyEnvironment environment)
Constructor.

Parameters:
environment - the application environment
Method Detail

free

public void free()
Description copied from class: LyViewManager
Free the view manager. Clears all

Specified by:
free in interface LyViewManagerInterface
Overrides:
free in class LyViewManager

buildWebDecoration

public LyWebDecoration buildWebDecoration(LyEnvironment environment)
Builds an instance of LyWebDecoration corresponding to current view manager.

Parameters:
environment - the environment of the web decoration.
Returns:
an instance of web decoration corresponding to current view manager.

buildInternalView

public LyViewComponent buildInternalView(LyComponent component)
Description copied from class: LyViewManager
Build internal view.

Specified by:
buildInternalView in class LyViewManager

clearTemporaryResources

public void clearTemporaryResources()
Description copied from class: LyViewManager
Clear all the temporary resources used by the viewManager Implemented in subclasses.

Specified by:
clearTemporaryResources in interface LyViewManagerInterface
Specified by:
clearTemporaryResources in class LyViewManager

getScriptsDir

public java.lang.String getScriptsDir()
Returns the directory that contains the Javascript files.

Returns:
the directory that contains the Javascript files.

getScriptsDocDir

public java.lang.String getScriptsDocDir()
Returns the path of the directory that contains the Javascript files.

Returns:
the path of the directory that contains the Javascript files.

getTemporaryLocation

public java.lang.String getTemporaryLocation()
Description copied from class: LyViewManager
Return the temporary directory used to store temporary resources but dependant from the viewer type (for ex: url / partial url for web).

Specified by:
getTemporaryLocation in interface LyViewManagerInterface
Specified by:
getTemporaryLocation in class LyViewManager
Returns:
the temporary directory

getDefaultPageResource

public java.lang.String getDefaultPageResource()
Returns the name of the resource to be used for default page.


generateScriptsInclusion

public java.lang.String generateScriptsInclusion()
Generates a string containing all the Javascript files inclusion.


showView

public void showView(LyWebPageWriter pageWriter)
Shows the view wrote in the given page writer.

Parameters:
pageWriter - the page writer
See Also:
setPageWriter(LyWebPageWriter)

hideView

public void hideView(LyWebPageWriter pageWriter)
Hides the view wrote in the given page writer.

Parameters:
pageWriter - the page writer containing view to hide

exit

public void exit(int code)
To exit an application. This method does nothing.

Specified by:
exit in interface LyViewManagerInterface
Specified by:
exit in class LyViewManager
Parameters:
code - exit code of the application.

setWaiting

public void setWaiting(boolean status)
Sets the Waiting status for all view of the application.
This method does nothing.

Specified by:
setWaiting in class LyViewManager

showWarning

public void showWarning(LyComponent source,
                        java.lang.String message)
Description copied from class: LyViewManager
Shows a warning message to the user.

Specified by:
showWarning in class LyViewManager
Parameters:
source - view element which raises the warning
message - warning message

showError

public void showError(LyComponent source,
                      java.lang.String message)
Description copied from class: LyViewManager
Shows a warning message to the user.

Specified by:
showError in class LyViewManager
Parameters:
source - view element which raises the error
message - error message

askQuestion

public void askQuestion(LyComponent source,
                        java.lang.String message,
                        LyQuestionAnswerInterface client,
                        java.lang.Object clientData)
Ask a question to the user.

Specified by:
askQuestion in class LyViewManager
Parameters:
source - view element which asks the question
message - text of the question
client - registred to receive the response.
clientData - freely set data which will be returned with the response.
See Also:
LyViewManager.showWarning(LyComponent, String)

showFile

public void showFile(LyComponent source,
                     java.lang.String location)
Description copied from class: LyViewManager
Shows a file to the user.

Specified by:
showFile in class LyViewManager
Parameters:
source - view element which raises the location
location - location

showLocation

public void showLocation(LyComponent source,
                         java.lang.String location,
                         boolean newWindow)
Description copied from class: LyViewManager
Shows a location to the user.

Specified by:
showLocation in class LyViewManager
Parameters:
source - view element which raises the location
location - location
newWindow - indicates whether a new window must be opened

showLocation

public void showLocation(LyComponent source,
                         java.lang.String location,
                         boolean newWindow,
                         java.util.Hashtable<java.lang.Short,java.lang.String> parameters)
Description copied from class: LyViewManager
Shows a location to the user.

Specified by:
showLocation in class LyViewManager
Parameters:
source - view element which raises the location
location - location
newWindow - indicates whether a new window must be opened
parameters - list of parameters

getNewWindowScripts

public java.util.Vector<java.lang.String> getNewWindowScripts()

addNewWindowScript

public void addNewWindowScript(java.lang.String script)

showPDFPreview

public void showPDFPreview(LyComponent source,
                           java.lang.String location)
Description copied from class: LyViewManager
Shows a PDF file to the user.
This makes a preview for printings.

Specified by:
showPDFPreview in class LyViewManager
Parameters:
source - view element which raises the location
location - location

showMessage

public void showMessage(LyComponent source,
                        java.lang.String title,
                        java.lang.String icon,
                        java.lang.String message,
                        java.util.BitSet commands,
                        LyMessageAnswerInterface client,
                        java.lang.Object clientData)
Description copied from class: LyViewManager
Show a message to the user and return the selection code.

Specified by:
showMessage in class LyViewManager
Parameters:
source - view element which asks the question
title - title of the message window
icon - icon shown in the message window
message - text of the message
commands - bitset which contains COMMAND_xxx values
client - registred to receive the response.
clientData - freely set data which will be returned with the response.

removeMessageAnswer

public void removeMessageAnswer(java.lang.String infoId)
Removes the message answer associated to the given ID.

Parameters:
infoId - the id of the message answer to remove

getMessageAnswerURL

public java.lang.String getMessageAnswerURL()
Returns the URL that must be used to answer messages.

Returns:
the URL that must answer to the user messages.

setPageWriter

public void setPageWriter(LyWebPageWriter pageWriter)
Sets the pageWriter for current context (Thread).

Parameters:
pageWriter - the pagewriter we are currently working on when generating this page
See Also:
getPageWriter()

getPageWriter

public LyWebPageWriter getPageWriter()
Gets the pageWriter for current context (Thread).

Returns:
the pagewriter we are currently working on when generating this page
See Also:
setPageWriter(LyWebPageWriter)

addPageWriter

public void addPageWriter(LyWebPageWriter page)
Adds the given PageWriter in the known page writer list. This could be retreived by its id afterwards.

Parameters:
page - the new PageWriter

removePageWriter

public void removePageWriter(LyWebPageWriter page)
Removes the given PageWriter from the known page writer list.

Parameters:
page - the PageWriterwhich should be removed

getPageWriter

public LyWebPageWriter getPageWriter(java.lang.String id)
Gets the PageWriter associated to the given id.

Parameters:
id - identifier of the PageWriter
Returns:
the page writer if it is found, null otherwise
See Also:
setPageWriter(LyWebPageWriter)

setClose

public void setClose(LyWebPageWriter pageWriter,
                     boolean close)
If the current page writer is not the given page writer,
if close=true
and if the page writer window is a pop up window
then adds a script to hide the pop up view
Else if close=true
and if the given page writer's window is null
then adds the current target frame to the list of frame to reload and adds the current thread to associations between thread and close requests.

Parameters:
pageWriter - the page writer to close.
close - if true, indicates that the page of the page writer has to be closed
See Also:
getClose()

getClose

public boolean getClose()
Gets the current thread close request status from the _closeRequests list. If the current thread is found in the list, the remove it.

Returns:
true if the current thread is found in the _closeRequests list associated to the value true, false otherwise
See Also:
setClose(LyWebPageWriter, boolean)

setReload

public void setReload(boolean reload)
Sets the reload status with the given value.

Parameters:
reload - the status of the reload mode

isReload

public boolean isReload()
Gets the reload mode status of the view.

Returns:
true if the view has to be reloaded, false otherwise

setMessage

public void setMessage(java.lang.String message)
Adds the given message to the list of messages identified by their thread.

Parameters:
message - the message to add
See Also:
with values (message, NO_TYPE, null), getMessage()

setMessage

public void setMessage(java.lang.String message,
                       java.lang.String title,
                       java.lang.String icon,
                       int type,
                       java.lang.String bgColor,
                       java.util.BitSet commands,
                       java.lang.String infoId,
                       java.util.Hashtable<java.lang.Short,java.lang.String> parameters)
Adds the given message to the list of messages identified by their thread or remove it if message=null.

Parameters:
message - the content of the message to add. If null the remove the message from the list.
title - title of the message window
icon - icon shown in the message window
type - the type of the message from the values
commands - bitset which contains COMMAND_xxx values
bgColor - background color of the message window
infoId - id of the info answer that must be called when answer is given
See Also:
getMessage()

setMessageAnswerUrl

public void setMessageAnswerUrl(java.lang.String answerUrl)
This method looks for the current message and sets the URL for the answer to the question.
Note: This, of course, is only usefull for messages of type = TYPE_QUESTION.

Parameters:
answerUrl - The absolute URL to the server page (servlet or JSP) that manages the answer of the question.

getMessage

public java.lang.String getMessage()
Gets the message associated to the current thread.

Returns:
the message if it is found, null otherwise
See Also:
setMessage(String), #setMessage(String, int, String)

getMessage

public java.lang.String getMessage(boolean anyThread)
Gets the message associated to the current thread.

Parameters:
anyThread - take the first available message (from any thread) (used by hidden frame)
Returns:
the message if it is found, null otherwise
See Also:
setMessage(String), #setMessage(String, int, String)

getMessage

public java.lang.String getMessage(boolean anyThread,
                                   boolean ignoreSentMessages)
Gets the message associated to the current thread.

Parameters:
anyThread - take the first available message (from any thread) (used by hidden frame)
ignoreSentMessages - indicates whether messages that were already sent must be retrieved
Returns:
the message if it is found, null otherwise
See Also:
setMessage(String), #setMessage(String, int, String)

answerMessage

public LyAnswerInterface answerMessage(java.lang.String infoId,
                                       boolean result)
Answer the interface by calling the answer associated to message associated to the given ID.

Parameters:
infoId - the id of the answer message
result - true if the user chossed "yes" or "ok", false otherwise
Returns:
the answer interface

answerMessage

public LyAnswerInterface answerMessage(java.lang.String infoId,
                                       short result)
Answer the interface by calling the answer associated to message associated to the given ID.

Parameters:
infoId - the id of the answer message
result - true if the user chossed "yes" or "ok", false otherwise
Returns:
the answer interface

encodeString

public static java.lang.String encodeString(java.lang.String message)
Encodes a String to enable displaying it in an alert message box.

Parameters:
message - the message to encode
Returns:
the encoded string

getMainTargetFrame

public java.lang.String getMainTargetFrame()
Gets the main target frame suffix.

Returns:
the main target frame suffix

getRootURL

public final java.lang.String getRootURL()
Gets servlet root URL : this is "http://"+local host + LY_APP_DOC.
Rebuild the root URL.

Specified by:
getRootURL in interface LyViewManagerInterface
Overrides:
getRootURL in class LyViewManager
Returns:
the root URL
See Also:
setRootURL(String)

setRootURL

public void setRootURL(java.lang.String rootUrl)
Sets servlet root URL. This URL is built by server : application should never sets URL directly.

Parameters:
rootUrl - the new root URL
See Also:
getRootURL()

getMobileStartURL

public final java.lang.String getMobileStartURL()
Gets the component web view URL.

Returns:
the component web view URL
See Also:
setMobileStartURL(String)

setMobileStartURL

public void setMobileStartURL(java.lang.String mobileStartUrl)
Sets component web view URL.

Parameters:
mobileStartUrl - the new component web view URL
See Also:
getMobileStartURL()

setTargetCode

public void setTargetCode(java.lang.String targetCode)
Sets the target code used in multi-windows mode.

Parameters:
code - the new code

getTargetCode

public java.lang.String getTargetCode()
Return the target code used in multi-windows mode.

Returns:
the target code is it has been set, null otherwise

addReloadFrame

public void addReloadFrame(java.lang.String frame)
Adds the given frame to the list of reload frames.

Parameters:
frame - a frame which will need to be refreshed next time
See Also:
where page writer id = null

addReloadFrame

public void addReloadFrame(java.lang.String frame,
                           java.lang.String pageWriterId)
Adds the given frame to the list of reload frames.

Parameters:
frame - a frame which will need to be refreshed next time
pageWriterId - optional pagewriter identifier we check before refreshing.

addPopupViewMapping

public void addPopupViewMapping(java.lang.String frame,
                                java.lang.String view)
Adds the mapping between the given frame and its given popup view.

Parameters:
frame - the frame to map to the view
view - the view to map to the frame

getPopupViewMapping

public java.lang.String getPopupViewMapping(java.lang.String frame)
Gets the popup view mapped to the given frame.

Parameters:
frame - the frame
Returns:
the pop up view mapped to the frame

clearReloadFrame

public void clearReloadFrame(java.lang.String frame)
Removes a frames from the _reloadFrames list.

Parameters:
frame - a frame which will not need to be refreshed next time

getReloadFrames

public java.util.Vector<java.lang.String> getReloadFrames()
Gets the list of frames which need to be refreshed.

Returns:
the list of frames name, or null if no frame needs reload.

clearReloadFrames

public void clearReloadFrames()
Clears the list of frames which need to be reloaded.


needsUpdate

public boolean needsUpdate()
Indicates whether the client needs an update.


addRefreshingView

public void addRefreshingView(LyGetRefreshInterface viewComp)
Adds a refreshing view in the list : this enables auto-refresh mode.

Parameters:
viewComp - the refreshed view

clearRefreshingView

public void clearRefreshingView(LyGetRefreshInterface viewComp)
Removes the given view from the _refreshingViews list.

Parameters:
viewComp - the refreshed view to remove from the list

getRefreshRate

public int getRefreshRate()
Gets the refresh rate for the auto refresh views.

Returns:
refresh value (duration is seconds) or 0 if no refresh is set

writeDivs

public boolean writeDivs()
Indicates if DIV tags may be written.

Returns:
true if DIV tags may be written, false otherwise

usePopupView

public boolean usePopupView()
Indicates if popup view is allowed.

Returns:
true if popup view is allowed, false otherwise

forceScrolling

public boolean forceScrolling()
Indicates if IFRAME tags must contain the scrolling attribute set.

Returns:
true if IFRAME tags must contain the scrolling attribute set, false otherwise

setBrowser

public void setBrowser(java.lang.String userAgent)
Sets the browser type and eventually properties that are not supported by this browser.

Parameters:
userAgent - the userAgent string send by the browser.
See Also:
getBrowser()

getBrowser

public int getBrowser()
Gets the browser type code. Possible values are :

Returns:
browser the browser type
See Also:
setBrowser(String)

getBrowserVersion

public double getBrowserVersion()
Gets the browser version.

Returns:
browser the browser version

isMultipleSession

public boolean isMultipleSession()
Indicates wether this view manager handles multiple user sessions or not. Current implementation always returns true.

Returns:
true if the view manager uses multiple user sessions (like web server)

updateControllersStackList

public void updateControllersStackList(java.util.Hashtable<java.lang.String,java.util.Stack<LyViewController>> controllersStackList)
Updates the _controllerStackList parameter with the count of controllers from the controllersStackList parameter. controllersStackList must contain names of controller stacks as keys and stack of controllers as values. _controllerStackList must contain names of controller stacks as keys and stack of controllers as values.

Overrides:
updateControllersStackList in class LyViewManager
Parameters:
controllersStackList -

getLastPopupViewController

public LyViewController getLastPopupViewController()
Returns the view controller that was last displayed in the popup view.


isBrowserSupported

public boolean isBrowserSupported()
Indicates if current browser is supported with the version of Leonardi.
Supported browsers are :

Returns:
true if the browser is supported, false otherwise.

setCurrentWindowName

public void setCurrentWindowName(java.lang.String name)
Description copied from class: LyViewManager
Accessor to the target popup window name if using popup.This is stored on a per-thread basis Default mplementation always return null (used for web modes).

Overrides:
setCurrentWindowName in class LyViewManager

getCurrentWindowName

public java.lang.String getCurrentWindowName()
Description copied from class: LyViewManager
Accessor to the target popup window name if using popup.This is stored on a per-thread basis Default mplementation always return null (used for web modes).

Overrides:
getCurrentWindowName in class LyViewManager
Returns:
the window name or null for default main browser window

encodeImage

public boolean encodeImage(java.lang.Object image,
                           java.lang.String imageDir,
                           java.lang.String imageFile)
Description copied from class: LyViewManager
Encodes an image to JPEG format.

Overrides:
encodeImage in class LyViewManager
Parameters:
image - the image to encode
imageDir - temporary directory (optional)
imageFile - the JPEG File
Returns:
true if the file was generated, false otherwise.

useCacheForImage

public boolean useCacheForImage(java.lang.String path,
                                java.lang.Object image)
Indicates whether given image may be cached. Default implementation returns true.

Specified by:
useCacheForImage in interface LyViewManagerInterface
Specified by:
useCacheForImage in class LyViewManager
Parameters:
path - The path of image that may be cached.
image - The image that may be cached.
Returns:
true if image may be cached, false otherwise

getAdditionalRefreshScripts

public java.util.Vector<java.lang.String> getAdditionalRefreshScripts()
Gets the list of additional refresh scripts _additionalRefreshScripts.

Returns:
the list of additional refresh scripts

getAdditionalRefreshScripts

public java.util.Vector<java.lang.String> getAdditionalRefreshScripts(boolean clearScripts)
Gets the list of additional refresh scripts _additionalRefreshScripts.

Parameters:
clearScripts - indicates whether additional refresh scripts must be cleared.
Returns:
the list of additional refresh scripts

clearAdditionalRefreshScripts

public void clearAdditionalRefreshScripts()
Clear the list of additional refresh scripts _additionalRefreshScripts.


addAdditionalRefreshScripts

public final void addAdditionalRefreshScripts(java.lang.String script)
Adds the given additional refresh script to the _additionalRefreshScripts list.

Parameters:
script - the HTML representation of the script to add

addAdditionalRefreshScripts

public void addAdditionalRefreshScripts(java.lang.String script,
                                        boolean insertEnd)
Adds the given additional refresh script to the _additionalRefreshScripts list.

Parameters:
script - the HTML representation of the script to add
insertEnd - indicates whether the script must be inserted at the end of the list

activateAdditionalRefreshScriptsBuffer

public void activateAdditionalRefreshScriptsBuffer(boolean activate)
Enables or disables the use of a temporary buffer for additional refresh scripts.

Parameters:
activate - true if buffer must be activated, false otherwise.

getDecoration

public LyWebDecoration getDecoration()
Gets the current decoration page.

Returns:
the decoration.
See Also:
setDecoration(LyWebDecoration)

setDecoration

public void setDecoration(LyWebDecoration deco)
Sets the decoration page.

Parameters:
deco - The new decoration.
See Also:
getDecoration()

messageActionPerformed

public LyAnswerInterface messageActionPerformed(java.lang.Object infoId,
                                                int cmdResult)
Method used to call back the listener of the specified message window for the specified result.

Overrides:
messageActionPerformed in class LyViewManager
Parameters:
cmdResult - the comand result : 1 if the user chose 'YES' or 'OK', 0 otherwise
infoId - the message info Id (of type String
Returns:
the answer to the message
See Also:
answerMessage(String, boolean)

isMultiSession

public boolean isMultiSession()
Checks whether this manager handles multiple session. Return always true.

Specified by:
isMultiSession in interface LyViewManagerInterface
Specified by:
isMultiSession in class LyViewManager
Returns:
true if the view manager uses multiple user sessions (like web server)

getPropertiesFromContext

public java.util.Properties getPropertiesFromContext(java.lang.String prefix)
Accessor to the properties file or parameter if specified in constructor.

Specified by:
getPropertiesFromContext in interface LyViewManagerInterface
Overrides:
getPropertiesFromContext in class LyViewManager
Parameters:
prefix - Prefix used for properties files name.
Returns:
the properties.

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com