LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.app.behavior
Class LyShowUrlBehavior

java.lang.Object
  extended by leon.app.behavior.LyBehavior
      extended by leon.app.behavior.LyActionBehavior
          extended by leon.app.behavior.LyShowUrlBehavior
All Implemented Interfaces:
LyActionBehaviorInterface, LyBehaviorInterface, LyShowUrlBehaviorInterface, LyGetSessionInterface

public class LyShowUrlBehavior
extends LyActionBehavior
implements LyShowUrlBehaviorInterface

This class implements the default behavior for action that is controlled by an show url controller.

See Also:
LyShowUrlController

Field Summary
static java.lang.String __VERSION
          File version
 
Constructor Summary
LyShowUrlBehavior()
          Construct a show url behavior.
 
Method Summary
 java.io.InputStream getFileInputStream(LyShowUrlController controller, java.lang.String urlName, LyEnvironment environment, boolean showError)
          Get the inputstream from the given parameters
 java.net.URL getFileUrl(LyShowUrlController controller, java.lang.String fileName, LyEnvironment environment, boolean showError)
          Gets the URL from the file name.
 java.lang.String getUrl(LyShowUrlController controller)
          Get the url from the controller
 boolean openNewWindow(LyShowUrlController controller)
          Indicates if the Url must be shown in a new window
 
Methods inherited from class leon.app.behavior.LyActionBehavior
endAction, getClientContext, getContextTitle, getHelpFile, getImage, getImageTooltip, getKeyValue, getMenuItemImage, getTitle, reset, startAction
 
Methods inherited from class leon.app.behavior.LyBehavior
free, getSession, handleDemand, init
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.app.behaviorinterface.LyActionBehaviorInterface
endAction, getClientContext, getContextTitle, getHelpFile, getImage, getImageTooltip, getKeyValue, getMenuItemImage, getTitle, reset, startAction
 
Methods inherited from interface leon.app.behaviorinterface.LyBehaviorInterface
free, handleDemand, init
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File version

See Also:
Constant Field Values
Constructor Detail

LyShowUrlBehavior

public LyShowUrlBehavior()
Construct a show url behavior.

Method Detail

getFileInputStream

public java.io.InputStream getFileInputStream(LyShowUrlController controller,
                                              java.lang.String urlName,
                                              LyEnvironment environment,
                                              boolean showError)
Get the inputstream from the given parameters

Specified by:
getFileInputStream in interface LyShowUrlBehaviorInterface
Parameters:
controller - the show url controller
urlName - the url name
environment - the current environment
showError - indicates if an error must be raise if needed
Returns:
the input stream

getFileUrl

public java.net.URL getFileUrl(LyShowUrlController controller,
                               java.lang.String fileName,
                               LyEnvironment environment,
                               boolean showError)
Gets the URL from the file name.
Tries first to create the URL from the String.
If an exception occurs, tries to create the URL from a file.
If a url is found, encode the URL name thaks to the method LyString.getXmlString(String, boolean, boolean).

Specified by:
getFileUrl in interface LyShowUrlBehaviorInterface
Parameters:
controller - the controller
fileName - the file whose URL is required
environment - the current environment
showError - indicates if an error message has to be shown to the user.
Returns:
the XML encoded file URL if found, null otherwise.

getUrl

public java.lang.String getUrl(LyShowUrlController controller)
Get the url from the controller

Parameters:
controller - the controller
Returns:
an url as a string

openNewWindow

public boolean openNewWindow(LyShowUrlController controller)
Indicates if the Url must be shown in a new window

Specified by:
openNewWindow in interface LyShowUrlBehaviorInterface
Parameters:
controller - the controller
Returns:
true if a new window must be opened

(c) January 2013 - W4 S.A.

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