LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.web
Class LyWebPageWriter

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.web.LyWebObject
          extended by leon.view.web.LyWebPageWriter
All Implemented Interfaces:
LyGraphicalComponent, LyViewComponent, LyFreeInterface, LyWebComponent
Direct Known Subclasses:
LyJQPage, LyMobileDialog, LyStrutsContainer, LyStrutsDictionary, LyStrutsGantt, LyStrutsMap, LyStrutsPage, LyStrutsView

public abstract class LyWebPageWriter
extends LyWebObject
implements LyWebComponent

It must be inherited in order to generate HTML pages.


Field Summary
static java.lang.String __VERSION
           
static boolean FORCE_AJAX
          Indicates whether Ajax mode must be forced in every page.
static java.lang.String MAIN_BUFFER
          The main buffer name.
 
Fields inherited from class leon.view.web.LyWebObject
WEB_COMPONENT_ID, WEB_CONTROLLER_ID, WEB_SESSION_ID
 
Constructor Summary
LyWebPageWriter(LyComponent component)
          Constructor.
 
Method Summary
 void addBeginScript(java.lang.String text, boolean isFile)
          (non-Javadoc).
 void addCssScript(java.lang.String text, boolean isFile)
          (non-Javadoc).
 void addEndScript(java.lang.String text, boolean isFile)
          (non-Javadoc).
 void addEndScript(java.lang.String text, boolean isFile, boolean insertEnd)
          (non-Javadoc).
 void append(java.lang.String string)
          (non-Javadoc).
 void clearBeginScripts()
          (non-Javadoc).
 void clearBeginScripts(java.lang.String name)
          Clears the begin scripts of the given frame.
 void clearBuffer(java.lang.String name)
          (non-Javadoc).
 void clearCssScripts()
          (non-Javadoc).
 void clearCssScripts(java.lang.String name)
          Clears all CSS scripts of the given frame.
 void clearEndScripts()
          (non-Javadoc).
 void clearEndScripts(java.lang.String name)
          Clears the end scripts of the given frame.
 void copyScriptsTo(LyWebPageWriter pw)
          Copy Begin, End and CSS scripts to the specified page writer.
 void endComponent(LyWebObject webObject)
          End writing of given component.
 void free()
          (non-Javadoc).
 java.lang.String getActionUrl()
          Builds the URL of the action attribute of the <FORM> HTML tag.
 java.lang.String getActiveFormId()
          Implementation of LyWebPageWriter.
 java.lang.String getActiveName()
          (non-Javadoc).
 java.lang.String getAttachmentDirectory(java.lang.String key)
          (non-Javadoc).
 java.lang.String getAttachmentHandler(java.lang.String key)
          (non-Javadoc).
 java.lang.String getBackground()
          Gets the background motif of the page.
 java.lang.String getBackgroundColor(java.lang.String frame)
          Gets the background color of the given frame.
 java.lang.StringBuffer getBeginScriptsAsHtml(java.lang.String frame)
          Gets a StringBuffer that contains the HTML for the begin scripts associated to the given frame.
 java.lang.StringBuffer getBuffer(java.lang.String frame)
          Gets the buffer associated to the given frame.
 java.lang.StringBuffer getCssFileAsHtml(java.lang.String frame)
          Gets the HTML code corresponding to a CSS file style sheet declaration of the given frame.
 java.lang.StringBuffer getCssScriptsAsHtml(java.lang.String frame, boolean file)
          Gets a StringBuffer that contains the HTML code of the given frame CSS scripts.
 java.lang.StringBuffer getEndScriptsAsHtml(java.lang.String frame)
          Gets a StringBuffer that contains the HTML for the end scripts associated to the given frame.
 boolean getForceReloadState()
          (non-Javadoc).
 java.lang.String getFormId(java.lang.String frame)
          Gets the formId associated to the given frame.
 java.lang.String getFrameName()
          (non-Javadoc).
 java.lang.String getId()
          (non-Javadoc).
 long getLastReloadTime()
          (non-Javadoc).
 long getNextJavaScriptId()
          (non-Javadoc).
 java.util.Vector<java.lang.String> getOldIds()
          (non-Javadoc).
 java.lang.String getOpenFormContent(java.lang.String frame)
          Writes the open form tag of the frame and the given writer.
 java.lang.String getOpenFormContent(java.lang.String frame, boolean force)
          Writes the open form tag of the frame and the given writer.
abstract  java.util.Vector<LyWebPageWriter> getPageWriters()
          (non-Javadoc).
 java.lang.String getProperty(java.lang.String name)
          (non-Javadoc).
abstract  java.lang.String getRedirect(java.lang.String frame)
          Gets the url for an alternate Web page.
 java.lang.String getScriptRoot()
          Gets the script root path of the page.
 java.lang.String getTarget()
          (non-Javadoc).
 java.lang.String getWindowName()
          (non-Javadoc).
 void init()
          Initialization method.
 boolean isFrameSet()
          (non-Javadoc).
 boolean isInnerView()
          (non-Javadoc).
 boolean isNoFrames()
          Indicates if frameset are used or not.
 boolean isPrintMode()
          (non-Javadoc).
 boolean isVisible()
          Indicates if the component is visible or not.
 void preparePage(java.lang.String frame, java.lang.String targetWindow)
          (non-Javadoc).
 void setActiveBuffer(java.lang.String name)
          (non-Javadoc).
 void setAttachmentDirectory(java.lang.String attachmentDirectory)
          Accessor to the attachment handler directory.
 void setAttachmentDirectory(java.lang.String key, java.lang.String attachmentDirectory)
          Accessor to the attachment handler directory.
 void setAttachmentHandler(java.lang.String attachmentHandler)
          Accessor to the attachment handler.
 void setAttachmentHandler(java.lang.String key, java.lang.String attachmentHandler)
          Accessor to the attachment handler.
 void setBackground(java.lang.String image)
          Sets the background motif of the page.
 void setBackgroundColor(java.lang.String hexColor, java.lang.String frame)
          Set the background color of the page and store the mapping between the color and frame.
 void setBodyClassName(java.lang.String bodyClassName)
          Sets the name of the CSS class to be used for body tag.
 void setForceReloadState(boolean force)
          (non-Javadoc).
 void setFormId(java.lang.String formId)
          (non-Javadoc).
 void setFrameName(java.lang.String name)
          (non-Javadoc).
 void setInnerView(boolean innerView)
          (non-Javadoc).
 void setLastModified(LyViewManager viewManager, long lastModified)
          (non-Javadoc).
 void setNoFrames(boolean noFrames)
          Prevent from using frameset.
 void setPrintMode(boolean printMode)
          (non-Javadoc).
 void setProperty(java.lang.String name, java.lang.String value)
          (non-Javadoc).
 void setTitle(java.lang.String title)
          (non-Javadoc).
 void setVisible(boolean status)
           
 void setWindowName(java.lang.String name)
          (non-Javadoc).
 void setWriteDivOnly(boolean writeDivOnly)
          Change the _writeDivOnly parameter.
 void startComponent(LyWebObject webObject)
          Start writing of given component.
 void writeBeginPage(java.io.Writer pw, java.lang.String frame)
          Writes the beginning of a HTML page (head, scripts and open the body).
 void writeBeginScripts(java.io.Writer pw, java.lang.String frame)
          Writes the begin scripts of the given frame.
 void writeCssScripts(java.io.Writer pw, java.lang.String frame)
          Writes CSS scritps associated to the given frame into the given writer.
 boolean writeDivOnly()
          (non-Javadoc).
 void writeEndPage(java.io.Writer pw, java.lang.String frame)
          Writes the end of HTML page.
 void writeEndScripts(java.io.Writer pw, java.lang.String frame)
          Writes the end scripts of the given frame.
 void writeHtml(java.io.Writer pw, java.lang.String frame)
          (non-Javadoc).
 void writePageContent(java.io.Writer pw, java.lang.String frame)
          Writes the page content of the frame and the given writer.
 
Methods inherited from class leon.view.web.LyWebObject
addFileScript, decodeUrl, displayUpPage, encodeUrl, encodeUrlXhtml, expandUrl, getDisabledImageUrl, getFontSize, getFontString, getFontString, getFontString, getHexColor, getHexColor, getHtmlEntitiesString, getHtmlString, getImageSize, getImageSize, getImageUrl, getJavascriptString, getLastFrameName, getLyFont, getMessage, getRootUrl, getRootURL, getScrollHeightForSplitter, getUrl, getWebViewManager, refresh, replaceUrl, replaceUrl, setUpdating, updateRefreshInfo, writeJson
 
Methods inherited from class leon.view.graphic.LyGraphicalObject
expand, getBounds, getChildrenBounds, getController, getEnv, getEnvironment, getIdCode, getIntResource, getMessage, getResource, getString, getString, getString, getViewComponent, getViewManager, isFreed, isFreeing, isImageAnimated, processDemand, processDemand, testResource, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.view.web.LyWebComponent
writeHtml
 

Field Detail

__VERSION

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

MAIN_BUFFER

public static final java.lang.String MAIN_BUFFER
The main buffer name.


FORCE_AJAX

public static boolean FORCE_AJAX
Indicates whether Ajax mode must be forced in every page.

Constructor Detail

LyWebPageWriter

public LyWebPageWriter(LyComponent component)
Constructor.

Parameters:
component - the component of this page
Method Detail

init

public void init()
Initialization method.
Sets the main buffer as the active buffer, register this page writer on its view manager and set a default value to the class attributes.


free

public void free()
(non-Javadoc).

Specified by:
free in interface LyGraphicalComponent
Specified by:
free in interface LyFreeInterface
Overrides:
free in class LyWebObject
See Also:
LyFreeInterface.free()

getId

public java.lang.String getId()
(non-Javadoc).

See Also:
getId()

writeHtml

public void writeHtml(java.io.Writer pw,
                      java.lang.String frame)
               throws java.io.IOException
(non-Javadoc).

Throws:
java.io.IOException
See Also:
writeHtml(java.io.Writer, java.lang.String)

preparePage

public void preparePage(java.lang.String frame,
                        java.lang.String targetWindow)
(non-Javadoc).

See Also:
preparePage(java.lang.String, java.lang.String)

writeBeginPage

public void writeBeginPage(java.io.Writer pw,
                           java.lang.String frame)
                    throws java.io.IOException
Writes the beginning of a HTML page (head, scripts and open the body).

Parameters:
pw - the page writer
frame - the frame where the page is written
Throws:
java.io.IOException - if something is wrong during page writing

setBodyClassName

public void setBodyClassName(java.lang.String bodyClassName)
Sets the name of the CSS class to be used for body tag.

Parameters:
bodyClassName - the CSS class name to be used.

writeBeginScripts

public void writeBeginScripts(java.io.Writer pw,
                              java.lang.String frame)
                       throws java.io.IOException
Writes the begin scripts of the given frame.

Parameters:
pw - the page writer
frame - the wrame
Throws:
java.io.IOException
See Also:
getBeginScriptsAsHtml(String)

writePageContent

public void writePageContent(java.io.Writer pw,
                             java.lang.String frame)
                      throws java.io.IOException
Writes the page content of the frame and the given writer.

Parameters:
pw - the page writer
frame - the frame to write
Throws:
java.io.IOException

getOpenFormContent

public java.lang.String getOpenFormContent(java.lang.String frame)
Writes the open form tag of the frame and the given writer.

Parameters:
frame - the frame to write

getOpenFormContent

public java.lang.String getOpenFormContent(java.lang.String frame,
                                           boolean force)
Writes the open form tag of the frame and the given writer.

Parameters:
frame - the frame to write
force - indicates whether form must be generated event if no form name has been specified on this page writer

writeCssScripts

public void writeCssScripts(java.io.Writer pw,
                            java.lang.String frame)
                     throws java.io.IOException
Writes CSS scritps associated to the given frame into the given writer.

Parameters:
pw - the page writer
frame - the frame to write CSS scripts
Throws:
java.io.IOException
See Also:
getCssScriptsAsHtml(String, boolean)

writeEndScripts

public void writeEndScripts(java.io.Writer pw,
                            java.lang.String frame)
                     throws java.io.IOException
Writes the end scripts of the given frame.

Parameters:
pw - the page writer
frame - the wrame
Throws:
java.io.IOException
See Also:
getEndScriptsAsHtml(String)

writeEndPage

public void writeEndPage(java.io.Writer pw,
                         java.lang.String frame)
                  throws java.io.IOException
Writes the end of HTML page. Closes the body and html tags and the form tag if it exists.

Parameters:
pw - the page writer
frame - the frame where the page is written
Throws:
java.io.IOException - if something is wrong during end page writes

getBuffer

public java.lang.StringBuffer getBuffer(java.lang.String frame)
Gets the buffer associated to the given frame.

Parameters:
frame - the frame
Returns:
the buffer associated to the given frame if it exists, null otherwise

getFormId

public java.lang.String getFormId(java.lang.String frame)
Gets the formId associated to the given frame.

Parameters:
frame - the frame
Returns:
the form id associated to the given frame if it exists, null otherwise
See Also:
setFormId(String)

getAttachmentHandler

public java.lang.String getAttachmentHandler(java.lang.String key)
(non-Javadoc).

See Also:
getAttachmentHandler(java.lang.String)

getAttachmentDirectory

public java.lang.String getAttachmentDirectory(java.lang.String key)
(non-Javadoc).

See Also:
getAttachmentDirectory(java.lang.String)

clearBeginScripts

public void clearBeginScripts()
(non-Javadoc).

See Also:
clearBeginScripts()

clearEndScripts

public void clearEndScripts()
(non-Javadoc).

See Also:
clearEndScripts()

clearCssScripts

public void clearCssScripts()
(non-Javadoc).

See Also:
clearCssScripts()

clearBeginScripts

public void clearBeginScripts(java.lang.String name)
Clears the begin scripts of the given frame. This method is not called during the generic action, but it may be used in specific code.

Parameters:
name - the name of the frame begin scripts to clear.

clearEndScripts

public void clearEndScripts(java.lang.String name)
Clears the end scripts of the given frame. This method is not called during the generic action, but it may be used in specific code.

Parameters:
name - the name of the frame end scripts to clear.

clearCssScripts

public void clearCssScripts(java.lang.String name)
Clears all CSS scripts of the given frame. This method is not called during the generic action, but it may be used in specific code.

Parameters:
name - the name of the frame of all CSS scripts to clear.

clearBuffer

public void clearBuffer(java.lang.String name)
(non-Javadoc).

See Also:
clearBuffer(java.lang.String)

setActiveBuffer

public void setActiveBuffer(java.lang.String name)
(non-Javadoc).

See Also:
setActiveBuffer(java.lang.String)

append

public final void append(java.lang.String string)
(non-Javadoc).

See Also:
append(java.lang.String)

getActiveName

public java.lang.String getActiveName()
(non-Javadoc).

See Also:
getActiveName()

addBeginScript

public void addBeginScript(java.lang.String text,
                           boolean isFile)
(non-Javadoc).

See Also:
addBeginScript(java.lang.String, boolean)

addEndScript

public void addEndScript(java.lang.String text,
                         boolean isFile)
(non-Javadoc).

See Also:
addEndScript(java.lang.String, boolean)

addEndScript

public void addEndScript(java.lang.String text,
                         boolean isFile,
                         boolean insertEnd)
(non-Javadoc).

See Also:
addEndScript(java.lang.String, boolean)

addCssScript

public void addCssScript(java.lang.String text,
                         boolean isFile)
(non-Javadoc).

See Also:
addCssScript(java.lang.String, boolean)

copyScriptsTo

public void copyScriptsTo(LyWebPageWriter pw)
Copy Begin, End and CSS scripts to the specified page writer. Utility methods for tabs within tabs (COMPOSITION RELATION).

Parameters:
pw - the page writer

setFormId

public void setFormId(java.lang.String formId)
(non-Javadoc).

See Also:
setFormId(java.lang.String)

setAttachmentHandler

public void setAttachmentHandler(java.lang.String attachmentHandler)
Accessor to the attachment handler. Default value is null, This value is set by a File fieldItem in a form to submit file content on server side for storage.

Parameters:
handler - is set by a File fieldItem. default handler is leon.view.web.LyFileAttachmentHandler
See Also:
LyWebForm#getAttachmentHandler

setAttachmentHandler

public void setAttachmentHandler(java.lang.String key,
                                 java.lang.String attachmentHandler)
Accessor to the attachment handler. Default value is null, This value is set by a File fieldItem in a form to submit file content on server side for storage.

Parameters:
key - key used to save attachment handler
handler - is set by a File fieldItem. default handler is leon.view.web.LyFileAttachmentHandler
See Also:
LyWebForm#getAttachmentHandler

setAttachmentDirectory

public void setAttachmentDirectory(java.lang.String attachmentDirectory)
Accessor to the attachment handler directory. Default value is null, This value is set by a File fieldItem in a form to submit file content directory on server side for storage.

Parameters:
key - key used to save attachment directory
handler - is set by a File fieldItem. default directory is 'files'
See Also:
LyWebForm#getAttachmentHandler

setAttachmentDirectory

public void setAttachmentDirectory(java.lang.String key,
                                   java.lang.String attachmentDirectory)
Accessor to the attachment handler directory. Default value is null, This value is set by a File fieldItem in a form to submit file content directory on server side for storage.

Parameters:
handler - is set by a File fieldItem. default directory is 'files'
See Also:
LyWebForm#getAttachmentHandler

getActiveFormId

public java.lang.String getActiveFormId()
Implementation of LyWebPageWriter.


getBeginScriptsAsHtml

public java.lang.StringBuffer getBeginScriptsAsHtml(java.lang.String frame)
Gets a StringBuffer that contains the HTML for the begin scripts associated to the given frame.

Parameters:
frame - the given frame
Returns:
the StringBuffer containing the HTML for the begin scripts
See Also:
getBeginScripts(String)

getEndScriptsAsHtml

public java.lang.StringBuffer getEndScriptsAsHtml(java.lang.String frame)
Gets a StringBuffer that contains the HTML for the end scripts associated to the given frame.

Parameters:
frame - the given frame
Returns:
the StringBuffer containing the HTML for the end scripts
See Also:
getEndScripts(String)

getCssScriptsAsHtml

public java.lang.StringBuffer getCssScriptsAsHtml(java.lang.String frame,
                                                  boolean file)
Gets a StringBuffer that contains the HTML code of the given frame CSS scripts.

Parameters:
frame - the frame
file - indicates if the CSS script is in a file or not
Returns:
a StringBuffer containing the HTML code of the CSS scripts of the given frame
See Also:
getCssScripts(String)

getCssFileAsHtml

public java.lang.StringBuffer getCssFileAsHtml(java.lang.String frame)
Gets the HTML code corresponding to a CSS file style sheet declaration of the given frame.

Parameters:
frame - the frame
Returns:
StringBuffer containg the HTML code of a CSS file declaration

setVisible

public void setVisible(boolean status)

setInnerView

public void setInnerView(boolean innerView)
(non-Javadoc).

See Also:
setInnerView(boolean)

isVisible

public boolean isVisible()
Indicates if the component is visible or not.

Returns:
true if it is visible, false otherwise

isInnerView

public boolean isInnerView()
(non-Javadoc).

See Also:
isInnerView()

isFrameSet

public boolean isFrameSet()
(non-Javadoc).

See Also:
isFrameSet()

getPageWriters

public abstract java.util.Vector<LyWebPageWriter> getPageWriters()
(non-Javadoc).

See Also:
getPageWriters()

setFrameName

public void setFrameName(java.lang.String name)
(non-Javadoc).

See Also:
setFrameName(java.lang.String)

setWindowName

public void setWindowName(java.lang.String name)
(non-Javadoc).

See Also:
setWindowName(java.lang.String)

getWindowName

public java.lang.String getWindowName()
(non-Javadoc).

See Also:
getWindowName()

getTarget

public java.lang.String getTarget()
(non-Javadoc).

See Also:
getTarget()

setTitle

public void setTitle(java.lang.String title)
(non-Javadoc).

See Also:
setTitle(java.lang.String)

setBackgroundColor

public void setBackgroundColor(java.lang.String hexColor,
                               java.lang.String frame)
Set the background color of the page and store the mapping between the color and frame.

Parameters:
hexColor - the string that represents the hexadecimal code for the color
frame - the frame to associate to this background color
See Also:
getBackgroundColor(String)

getBackgroundColor

public java.lang.String getBackgroundColor(java.lang.String frame)
Gets the background color of the given frame.

Parameters:
frame - the frame
Returns:
the background color of the given frame
See Also:
setBackgroundColor(String, String)

setBackground

public void setBackground(java.lang.String image)
Sets the background motif of the page.

Parameters:
image - the image that must be used as a motif
See Also:
getBackgroundColor(String)

getBackground

public java.lang.String getBackground()
Gets the background motif of the page.

Returns:
the image that is used as a motif
See Also:
setBackground(String)

getScriptRoot

public java.lang.String getScriptRoot()
Gets the script root path of the page.

Returns:
the script root path of the page

setNoFrames

public void setNoFrames(boolean noFrames)
Prevent from using frameset.

Parameters:
noFrames - if true, means that no frame set is used, false otherwise

isNoFrames

public boolean isNoFrames()
Indicates if frameset are used or not.

Returns:
true if no frame set is used, false otherwise

getFrameName

public java.lang.String getFrameName()
(non-Javadoc).

See Also:
getFrameName()

setLastModified

public void setLastModified(LyViewManager viewManager,
                            long lastModified)
(non-Javadoc).

See Also:
setLastModified(leon.view.LyViewManager, long)

setForceReloadState

public void setForceReloadState(boolean force)
(non-Javadoc).

See Also:
setForceReloadState(boolean)

getForceReloadState

public boolean getForceReloadState()
(non-Javadoc).

See Also:
getForceReloadState()

getLastReloadTime

public long getLastReloadTime()
(non-Javadoc).

See Also:
getLastReloadTime()

setPrintMode

public void setPrintMode(boolean printMode)
(non-Javadoc).

See Also:
setPrintMode(boolean)

isPrintMode

public boolean isPrintMode()
(non-Javadoc).

See Also:
isPrintMode()

getOldIds

public java.util.Vector<java.lang.String> getOldIds()
(non-Javadoc).

See Also:
getOldIds()

getNextJavaScriptId

public long getNextJavaScriptId()
(non-Javadoc).

See Also:
getNextJavaScriptId()

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
(non-Javadoc).

See Also:
setProperty(java.lang.String, java.lang.String)

getProperty

public java.lang.String getProperty(java.lang.String name)
(non-Javadoc).

See Also:
getProperty(java.lang.String)

setWriteDivOnly

public void setWriteDivOnly(boolean writeDivOnly)
Change the _writeDivOnly parameter.


writeDivOnly

public boolean writeDivOnly()
(non-Javadoc).

See Also:
writeDivOnly()

getActionUrl

public java.lang.String getActionUrl()
Builds the URL of the action attribute of the <FORM> HTML tag.

Returns:
the URL of the action or null.

getRedirect

public abstract java.lang.String getRedirect(java.lang.String frame)
Gets the url for an alternate Web page.

Parameters:
frame - the frame to redirect
Returns:
the URL of the alternate Web page

startComponent

public void startComponent(LyWebObject webObject)
Start writing of given component.


endComponent

public void endComponent(LyWebObject webObject)
End writing of given component.


(c) January 2013 - W4 S.A.

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