www.element4solution.com

e4s.html
Class HTML

java.lang.Object
  extended by e4s.util.E4Object
      extended by e4s.html.E4HtmlObject
          extended by e4s.html.E4HtmlElementGeneral
              extended by e4s.html.E4HtmlElement
                  extended by e4s.html.E4HtmlContentElement
                      extended by e4s.html.E4HtmlContentElementPersistant
                          extended by e4s.html.BODY
                              extended by e4s.html.HTML
All Implemented Interfaces:
E4HtmlElement_Intf
Direct Known Subclasses:
FRAME

public class HTML
extends BODY
implements E4HtmlElement_Intf

HTML: The very beginning of your output: creates a <HTML>-tag. The idea of the E4S environment is, to cover CGI calls by Java function, the method references or E4Method classes. Each E4Method represents a Java function by the same name, and one or two parameters. The first of those parameters to the function is a object of this HTML class, the other might be a E4CgiParams. You write your own modules and functions, and you can make use of the html parameter to print out structured HTML content. For example, you might begin like this:

Example_HelloWorld.java

For most of the classes in package e4s.html you will find a function by the same name as the class which creates the class, and holds it as an internal object in the HTML object. After finishing of your function, control is returned to the E4S environment, and contents are written out to the page displayed in the browser. From there, this game can start again.

Since:
JDK 1.4
See Also:
BODY, FRAMESET, E4Method, E4CgiParams

Nested Class Summary
static class HTML.E4HtmlMetaTags
          Meta Tags (included in HTML) see http://www.webmarketingnow.com/tips/meta-tags-uncovered.html
 
Field Summary
static java.lang.String JS_SERVLET_PRESERVED_REQUEST
           
static java.lang.String JS_SERVLET_REQUEST
           
 
Fields inherited from class e4s.html.BODY
DEFAULTSTYLE, HTML_TAG
 
Fields inherited from class e4s.html.E4HtmlContentElement
BOOL_STR_FALSE, BOOL_STR_TRUE
 
Fields inherited from class e4s.html.E4HtmlElementGeneral
m_elements, m_needed_scripts
 
Fields inherited from class e4s.html.E4HtmlObject
m_parent_e4sID
 
Fields inherited from class e4s.util.E4Object
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET
 
Constructor Summary
HTML()
           
HTML(E4ID parent_id)
           
 
Method Summary
static java.lang.String _getSVNVersionString()
          Get version info string from subversion.
 BODY BODY()
          Defines a <BODY> tag.
 void collectTranslationsForEditing(E4TranslationsVec v, E4ServletImplementation_Intf servlet)
          Build a list (Vector) with translation texts used so far during display of this page.
 BODY displayWaitAndForward(E4Method mref, E4ServletImplementation_Intf servlet)
          Displays the message "This function might take some time - please be patient" in a new created BODY tag, and forwards execution to the method specified.
 E4SubEditingBODY E4SubEditingBODY(E4Method mrefSave, E4CgiParams params, E4ServletImplementation_Intf servlet)
          Defines a <BODY> tag for editing within E4EditingElement.
 E4SubEditingBODY E4SubEditingBODY(E4Method mrefSave, E4Method mrefCancel, E4CgiParams params, E4ServletImplementation_Intf servlet)
          Defines a <BODY> tag for editing within E4EditingElement.
static void enableUTF8(boolean mode)
          Enable UTF output as default for all HTML outputs.
 E4FieldsetTabbed FieldsetTabbed()
          Construct a tabbed input form element, and add it to the internal collection.
 FRAMESET FRAMESET(boolean rows)
          Defines a <FRAMESET> tag.
 FRAMESET FRAMESET(boolean rows, java.lang.String size)
          Defines a <FRAMESET> tag.
 java.lang.String getIcon()
          Get the icon.
 java.lang.String getLocalCSS()
          Get the local defined E4CSS.
 HTML.E4HtmlMetaTags getMetaTags()
           
 E4Label_Intf getTitle()
          Get the title, which was either specified particular using setTitle(java.lang.String) or generally using setDefaultTitle(java.lang.String).
static boolean isUTF8enabled()
          Determine, if UTF8 is enabled.
 E4MenuFrameset MenuFrameset(int layout, E4ServletImplementation_Intf servlet)
          Add a frameset that contains a menu to the BODY context.
 E4MenuFrameset MenuFrameset(java.lang.String persistantObjId, int layout, E4ServletImplementation_Intf servlet)
          Add a frameset that contains a menu to the BODY context.
 void preventStyleEditing()
          Prevent from editing E4CSS at runtime.
 void preventTranslationEditing()
          Prevent from editing Translations at runtime.
static void setDefaultIcon(java.lang.String url)
          Defines a general <LINK REL="SHORTCUT ICON" ..
static void setDefaultTitle(E4Label_Intf title)
          Set's the default title of the HTML page.
static void setDefaultTitle(E4String title)
          Set's the default title of the HTML page.
static void setDefaultTitle(java.lang.String title)
          Set's the default title of the HTML page.
 void setIcon(java.lang.String url)
          Defines a <LINK REL="SHORTCUT ICON" ..
 void setLocalCSS(java.lang.String filename)
          Define the name of the style sheet to be included.
 void setMetaTag(java.lang.String tag, java.lang.String value)
          Add a meta tag to be included in the HEAD section of your HTML output.
 void setStrict()
          Set the output to strict - this includes <!
 void setTitle(E4Label_Intf title)
          Set's the title of the HTML page.
 void setTitle(E4String title)
          Set's the title of the HTML page.
 void setTitle(java.lang.String title)
          Set's the title of the HTML page.
 void toHtml(E4StringBufferHtml buf, E4ServletImplementation_Intf servlet)
          Create the HTML output for this element.
 void toHtml(E4StringBufferHtml buf, E4ServletImplementation_Intf servlet, boolean inline)
           
 
Methods inherited from class e4s.html.BODY
A_Name, A_Name, A_Name, A_Name, A_Name, addKeepAliveScript, BlockMenuElement, createEventHandler, createEventHandler, defineNoScript, E4DropDownMenu, E4DropDownMenu, eventHandlers, FIELDSET, FieldsetTable, FORM, FORM, FORM, FORM, FullSizeE4Message, getBgColor, getBgImage, getEventHandlers, IFRAME, IFRAME, IFRAME, MenuElement, MenuElement, MenuElement, MethodInlineElement, MethodInlineElement, NOSCIPT, onLoad_Print, onLoad, onLoad, onLoad, onResize, onUnLoad, onUnLoad, redirectLocation, redirectLocation, setBgcolor, setBgColor, setBgImage, setCodeBeforeClosing, setEventHandler, setStatusBar, setSTYLE, SortedListElement, SortedListElement, toHtml_without_BodyTag, TreeElement, TreeElement
 
Methods inherited from class e4s.html.E4HtmlContentElementPersistant
preventFromRemoving, preventFromRemoving, removeAll, toDebug
 
Methods inherited from class e4s.html.E4HtmlContentElement
A_Email, A_Email, A_Multiple, A_Popup, A_Popup, A_Popup, A_Popup, A_Popup, A_Popup, A_Popup, A_Reference, A_Reference, A_Reference, A_Reference, A_Reference, A_ReturnValue, A_ReturnValue, A_ReturnValue, A_ReturnValue, A, A, A, A, A, A, A, AjaxElement, AjaxElement, AjaxElement, B, B, BIG, Box, Box, Box, BoxRoundCorners, BoxRoundCorners, BoxRoundCorners, BR, BUTTON, BUTTON, BUTTON, BUTTON, BUTTON, BUTTON, BUTTON, BUTTON, BUTTON, BUTTON, BUTTON, BUTTON, BUTTON, CENTER, DEL, DIV, DIV, DIV, DIV, FONT, FONT, FONT, FONT, FONT, FONT, FONT, FONT, FONT, FONT, FONT, FONT, FONT, FONT, FONT, FullSizeE4Message, H1, H2, H3, H4, Hint, HR, I, I, IMG, IMG, IMG, IMG, IMG, IMG, IMG, IMG, INS, Message, Message, Message, Message, Message, NBSP, NOBR, P_NBSP, P, PRE, print, print, print, print, print, print, print, print, print, print, print, print, print, print, print, print, print, println, println, println, println, println, println, println, rem, rem, rem, rem, rem, rem, SMALL, SPAN, STRIKE, strike, SystemError, SystemError, SystemError, SystemError, TABLE, TABLE, trace, trace, trace, trace, trace, trace, translate_Sys, translate, U, UL
 
Methods inherited from class e4s.html.E4HtmlElement
addElement, addElement, addElement, copyElements, print
 
Methods inherited from class e4s.html.E4HtmlElementGeneral
addScript, addScript, addScript, addStyleForEditing, addTranslationForEditing, buildStyleAttribute, buildStyleClassReference, collectScripts, collectStylesForEditing, collectStylesForEditing, collectStylesForEditing, collectTranslationsForEditing, createScript, createScript, debugToString, findElement, findElement, findElement, findElement, getElements, getElementsVec, getField, getId, getLastElement, getStringContent, getStyle, getSTYLE, getStyle, hasScripts, hasSTYLE, isContentClass, isE4InputField_Intf, openTag, removeElementById, removeElements, removeElements, removeStyle, setId, setReadOnly, setStyle, setStyle, setSTYLE, setValue, Style, Style, toHtml_hidden, validate
 
Methods inherited from class e4s.html.E4HtmlObject
E4ID, E4ID, set_e4sID
 
Methods inherited from class e4s.util.E4Object
Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, finalize, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDouble, toFloat, toFloat, toString, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface e4s.html.E4HtmlElement_Intf
addScript, addScript, addScript, collectScripts, collectStylesForEditing, debugToString, findElement, findElement, getElements, getElementsVec, getField, getId, getStringContent, isContentClass, removeAll, removeElementById, removeElements, set_e4sID, setId, setReadOnly, setValue, toHtml_hidden, validate
 

Field Detail

JS_SERVLET_REQUEST

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

JS_SERVLET_PRESERVED_REQUEST

public static final java.lang.String JS_SERVLET_PRESERVED_REQUEST
See Also:
Constant Field Values
Constructor Detail

HTML

public HTML(E4ID parent_id)

HTML

public HTML()
Method Detail

setTitle

public void setTitle(java.lang.String title)
Set's the title of the HTML page. Only possible when not running within a FRAMESET.

Example_openWindow.java

Parameters:
title - null : no title, any other value will be displayed within the <TITLE> tag.
See Also:
getTitle(), setDefaultTitle(java.lang.String)

setTitle

public void setTitle(E4String title)
Set's the title of the HTML page. Only possible when not running within a FRAMESET.

Example_openWindow.java

Parameters:
title - null : no title, any other value will be displayed within the <TITLE> tag.
See Also:
getTitle(), setDefaultTitle(java.lang.String)

setTitle

public void setTitle(E4Label_Intf title)
Set's the title of the HTML page. Only possible when not running within a FRAMESET.

Example_openWindow.java

Parameters:
title - null : no title, any other value will be displayed within the <TITLE> tag.
See Also:
getTitle(), setDefaultTitle(java.lang.String)

setDefaultTitle

public static void setDefaultTitle(java.lang.String title)
Set's the default title of the HTML page. This will be used anytime, unless you specify a particular's title using setTitle(java.lang.String).

Parameters:
title - null : no title, any other value will be displayed within the <TITLE> tag.
See Also:
setTitle(java.lang.String), getTitle()

setDefaultTitle

public static void setDefaultTitle(E4String title)
Set's the default title of the HTML page. This will be used anytime, unless you specify a particular's title using setTitle(java.lang.String).

Parameters:
title - null : no title, any other value will be displayed within the <TITLE> tag.
See Also:
setTitle(java.lang.String), getTitle()

setDefaultTitle

public static void setDefaultTitle(E4Label_Intf title)
Set's the default title of the HTML page. This will be used anytime, unless you specify a particular's title using setTitle(java.lang.String).

Parameters:
title - null : no title, any other value will be displayed within the <TITLE> tag.
See Also:
setTitle(java.lang.String), getTitle()

getTitle

public E4Label_Intf getTitle()
Get the title, which was either specified particular using setTitle(java.lang.String) or generally using setDefaultTitle(java.lang.String).

Returns:
the title or null if no title is specified
See Also:
setTitle(java.lang.String), setDefaultTitle(java.lang.String)

setIcon

public void setIcon(java.lang.String url)
Defines a <LINK REL="SHORTCUT ICON" .. > tag. This function overrides the default icon which can be set general using setDefaultIcon(String). This enables you to load an icon into the browser's URL address section.

Parameters:
url - a ful qualified URL to an icon (*.ico file).
See Also:
setDefaultIcon(String), getIcon()

setDefaultIcon

public static void setDefaultIcon(java.lang.String url)
Defines a general <LINK REL="SHORTCUT ICON" .. > tag. This icon will be used on every HTML page, it can be overridden using setIcon(String). This enables you to load an icon into the browser's URL address section.

Parameters:
url - a ful qualified URL to an icon (*.ico file).
See Also:
setIcon(String), getIcon()

getIcon

public java.lang.String getIcon()
Get the icon. Either this icon was defined using setIcon(java.lang.String) or it was generally defined using setDefaultIcon(java.lang.String).

Returns:
null if no icon was specified or the icon as specified
See Also:
setIcon(String), setDefaultIcon(String)

FRAMESET

public FRAMESET FRAMESET(boolean rows)
Defines a <FRAMESET> tag. When this function is used, it cannot be combined with any other HTML element that causes the page not to display correctly.

Parameters:
rows - true: <FRAMESET ROWS="..">, false: <FRAMESET COLS="..">
Returns:
the FRAMESET object which can be used to build up again FRAMESET or FRAME objects.

FRAMESET

public FRAMESET FRAMESET(boolean rows,
                         java.lang.String size)
Defines a <FRAMESET> tag. When this function is used, it cannot be combined with any other HTML element that causes the page not to display correctly.

Returns:
the FRAMESET object which can be used to build up again FRAMESET or FRAME objects.

FieldsetTabbed

public E4FieldsetTabbed FieldsetTabbed()
Construct a tabbed input form element, and add it to the internal collection.

Overrides:
FieldsetTabbed in class BODY
Returns:
the new created and added object

BODY

public BODY BODY()
Defines a <BODY> tag.

Example_openWindow.java

Returns:
the new created and added object

E4SubEditingBODY

public E4SubEditingBODY E4SubEditingBODY(E4Method mrefSave,
                                         E4Method mrefCancel,
                                         E4CgiParams params,
                                         E4ServletImplementation_Intf servlet)
                                  throws java.lang.Exception
Defines a <BODY> tag for editing within E4EditingElement. Note that this is a special case, and make familar with editing first. A E4JavaScript will be added and one or two buttons are added for closing the sub frame in conjunction with E4ModuleEditingHandling02.

Parameters:
mrefSave - can be null if no save is required, or the method for saving.
mrefCancel - can be null if default cancel shall be involved or the method for cancel.
params - the current E4CgiParams, containing at least E4ModuleEditingHandlingSettings.PARAM_EDITING_OBJ
servlet - the servlet environment (E4ModuleImplementation.getServlet()
Returns:
the new created and added object
Throws:
java.lang.Exception

E4SubEditingBODY

public E4SubEditingBODY E4SubEditingBODY(E4Method mrefSave,
                                         E4CgiParams params,
                                         E4ServletImplementation_Intf servlet)
                                  throws java.lang.Exception
Defines a <BODY> tag for editing within E4EditingElement. Note that this is a special case, and make familar with editing first. A E4JavaScript will be added and one or two buttons are added for closing the sub frame in conjunction with E4ModuleEditingHandling02. Uses the default cancel function E4ModuleEditingHandling02.cancelRecord, which is recommended.

Parameters:
mrefSave - can be null if no save is required, or the method for saving.
params - the current E4CgiParams, containing at least E4ModuleEditingHandlingSettings.PARAM_EDITING_OBJ
servlet - the servlet environment (E4ModuleImplementation.getServlet()
Returns:
the new created and added object
Throws:
java.lang.Exception

toHtml

public void toHtml(E4StringBufferHtml buf,
                   E4ServletImplementation_Intf servlet)
            throws java.lang.Exception
Description copied from interface: E4HtmlElement_Intf
Create the HTML output for this element. Also run throught all child elements, and call their E4HtmlElement_Intf.toHtml(e4s.util.E4StringBufferHtml, e4s.servlet.E4ServletImplementation_Intf) function to generate output of those objects which becomes appended. Normally, there is no need to call this function anyway, and this also might result in side effects of too-early relasing of objects in some cases. This function is called by E4ServletImplementation_Intf.write(e4s.html.E4HtmlElement) on the top level HTML element (common this is a HTML or BODY element) and branches down to all child elements.

Specified by:
toHtml in interface E4HtmlElement_Intf
Overrides:
toHtml in class BODY
Parameters:
servlet - is the servlet context which can be retrieved using the E4ModuleImplementation.getServlet().
Throws:
java.lang.Exception
See Also:
#toHtml(E4ServletImplementation_Intf, boolean)

toHtml

public void toHtml(E4StringBufferHtml buf,
                   E4ServletImplementation_Intf servlet,
                   boolean inline)
            throws java.lang.Exception
Parameters:
servlet - is the servlet context which can be retrieved using the E4ModuleImplementation.getServlet().
inline - false (= default) does not write the >HTML< tag. Usage of this parameter with a value of false will cause inproper display under normal circumstances.
Throws:
java.lang.Exception
See Also:
#toHtml(E4ServletImplementation_Intf)

preventStyleEditing

public void preventStyleEditing()
Prevent from editing E4CSS at runtime. Normally, if E4ServletImplementation_Intf.sessionCanEditStyles() returns true, a small grafic is displayed enabling the editing of the E4CSS style sheets. By calling this function, this will be prevented.


preventTranslationEditing

public void preventTranslationEditing()
Prevent from editing Translations at runtime. Normally, if E4ServletImplementation_Intf.sessionCanEditTranslations() returns true, a small grafic is displayed enabling the editing of the translations. By calling this function, this will be prevented.


collectTranslationsForEditing

public void collectTranslationsForEditing(E4TranslationsVec v,
                                          E4ServletImplementation_Intf servlet)
Description copied from class: E4HtmlElementGeneral
Build a list (Vector) with translation texts used so far during display of this page. Run throught all subclasses elements and collect their texts as well. Note, that a text will only be added one time. The Vector contains elements of class E4Label.

Specified by:
collectTranslationsForEditing in interface E4HtmlElement_Intf
Overrides:
collectTranslationsForEditing in class E4HtmlElementGeneral
Parameters:
v - the Vector where the styles will be collected, may not be null
servlet - the current servlet instance
See Also:
E4Label_Intf

setLocalCSS

public void setLocalCSS(java.lang.String filename)
Define the name of the style sheet to be included. This is optional but additional, in any case, E4StyleSettings.getStyleUrl() + default/e4s.css and e4s.servlet.E4ServletImplementation_Intf#getCSS() will be included in this order.

Parameters:
filename - the full or relative specified path and filename of an .css file, a value of null to include no file (default)
See Also:
getLocalCSS(), e4s.servlet.E4ServletImplementation_Intf#getCSS(), E4StyleSettings.getStyleUrl()

getLocalCSS

public java.lang.String getLocalCSS()
Get the local defined E4CSS.

Returns:
the .css file or null if not defined
See Also:
setLocalCSS(String)

isUTF8enabled

public static boolean isUTF8enabled()
Determine, if UTF8 is enabled.

Returns:
true, if UTF8 is enabled
See Also:
E4DBSelect.isUnicodeEnabled(), E4DBSelect.enableUnicode(boolean), #enableUTF8()

enableUTF8

public static void enableUTF8(boolean mode)
Enable UTF output as default for all HTML outputs. This forces the HTML content to include <meta http-equiv="Content-Type" content="text/html;charset=utf-8">

Parameters:
mode - true to enable UTF8
See Also:
E4DBSelect.isUnicodeEnabled(), E4DBSelect.enableUnicode(boolean), isUTF8enabled()

setMetaTag

public void setMetaTag(java.lang.String tag,
                       java.lang.String value)
Add a meta tag to be included in the HEAD section of your HTML output. By default, these meta-tags are included: expires=0, cache-control=no-cache and pragma=no-cache but can be overwritten here.

Parameters:
tag - the tag name, e.g.
value -

displayWaitAndForward

public BODY displayWaitAndForward(E4Method mref,
                                  E4ServletImplementation_Intf servlet)
Displays the message "This function might take some time - please be patient" in a new created BODY tag, and forwards execution to the method specified.

Parameters:
mref - the method to be executed
servlet - an actual servlet context
Returns:
the created and added BODY tag

getMetaTags

public HTML.E4HtmlMetaTags getMetaTags()

setStrict

public void setStrict()
Set the output to strict - this includes <!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'> as first line of the output.


MenuFrameset

public E4MenuFrameset MenuFrameset(int layout,
                                   E4ServletImplementation_Intf servlet)
Add a frameset that contains a menu to the BODY context. Use a generic name to specify the E4Menu.

Parameters:
layout - a menu layout, E4Menu
servlet - the current servlet context
Returns:
the new created and added frameset for the menu

MenuFrameset

public E4MenuFrameset MenuFrameset(java.lang.String persistantObjId,
                                   int layout,
                                   E4ServletImplementation_Intf servlet)
Add a frameset that contains a menu to the BODY context. Use a specified name to specify the E4Menu.

Parameters:
persistantObjId - the ID of the menu element for session persistance
layout - a menu layout, E4Menu
servlet - the current servlet context
Returns:
the new created and added frameset for the menu

_getSVNVersionString

public static java.lang.String _getSVNVersionString()
Get version info string from subversion.

Returns:
the version info string.
See Also:
E4Util.getRevisionCodeFromSVN(Class)

www.element4solution.com