public abstract class JspButler extends ExemptibleManagerImplementation
JspSessionStd
Modifier and Type | Field and Description |
---|---|
BackButton |
backButton
An object that provides to represent a button with go back functionality.
|
static java.lang.String |
FURTHER_PARAMETER_DELIMITER |
static java.lang.String |
HIDDEN_PANEL_FIELD |
protected SessionData |
sessionData |
Constructor and Description |
---|
JspButler(SessionData sessionData)
Constructs a new JSP butler with the session's public data as specified.
|
Modifier and Type | Method and Description |
---|---|
HalfDataComboBox |
createComboBox(SessionData sessionData,
java.lang.String name,
DataObject contentDataObject,
java.lang.String visibleColumn,
java.lang.String orderByColumn,
java.lang.String nameForNoChoice)
Creates a combo box.
|
MustPasswordField |
createPasswordField(int length) |
MustTextField |
createTextField(int length) |
boolean |
didUserChangeSomethingSinceLastOkOrCancel()
Returns true if user changed something since last OK or Cancel.
|
java.lang.String |
encode(java.lang.String url) |
java.lang.String |
encodeRedirectURL(java.lang.String url)
Encodes the specified URL for use in the sendRedirect method or, if
encoding is not needed, returns the URL unchanged.
|
protected void |
finalize() |
java.lang.String |
getAlertableString(java.lang.String stringToBeAlerted)
Returns a string which may be used in a JavaScript alert function.
|
protected java.lang.Class<?>[] |
getButlerFriends()
Returns an array of chummy butlers - used to exclude them from reducing
butler cache.
|
int |
getComeInDialogNbr()
Returns the dialog number identified by hidden field in JSP.
|
int |
getCurrentDialogNbr() |
int |
getDialogNbr()
Returns the nbr of the session's current dialog sequence.
|
java.lang.String |
getDialogNumberHiddenFieldTag() |
java.lang.String |
getDialogNumberUrlFragment() |
java.lang.String |
getFieldNameToReceiveFocus()
Returns the name of the field to receive the focus.
|
protected java.lang.String |
getHrefTag(java.lang.String target) |
protected java.lang.String |
getHrefTag(java.lang.String target,
boolean openInNewWindow) |
long |
getLastUse()
Returns the last usage of the butler as current time in milliseconds.
|
java.lang.String |
getPreviousURI()
Returns the URI of the previous served page.
|
java.lang.String |
getScriptToExecute()
Returns the JavaScript to be executed.
|
protected java.lang.Object |
getSychronizationObject() |
java.lang.String |
getTranslationByFramework(java.lang.String key) |
java.lang.String |
getURI()
Returns the URI of the current served page.
|
int |
getWindowNbr()
Returns the window number
|
protected void |
goBack()
Causes the butler to return to the previous page.
|
protected void |
handle(GeneralizedRequest request)
React on user input and prepare objects to be visualized in the JSP via
this method.
|
boolean |
handlingCausesReturn(HttpServletRequest request,
HttpServletResponse response)
To be called by the JSP before any output was created.
|
protected void |
informUserAbout(java.lang.Exception exc)
Informs the user about an exception.
|
void |
init()
Called by SessionStd if the previous butler class was different.
|
protected void |
invalidate()
Invalidates the butler to remove it from cache.
|
boolean |
isCloseWindowIfNoPreviousURIisAvailable()
Returns the closeWindowIfNoPreviousURIisAvailable.
|
protected boolean |
isExactDialogSequence()
Returns true if the request comes from exactly the last preparation of this
butler.
|
boolean |
isInvalidated()
Return true if the butler has been invalidated.
|
boolean |
isPreviousURIAvailable() |
boolean |
isToRun()
Returns the toRun flag.
|
void |
jspDestroyConsequences()
Consequences when JSP has been destroyed by Tomcat.
|
void |
setCloseWindowIfNoPreviousURIisAvailable(boolean closeWindowIfNoPreviousURIisAvailable)
Sets the closeWindowIfNoPreviousURIisAvailable.
|
protected void |
setFocusOn(MustInputField field)
Sets the focus on the input field - needs client JavaScript to set the focus.
|
void |
setForeignPreparationFlag()
Indicates that the butler has been prepared from outside, e.g. by another
butler.
|
void |
setMessageToKeep(java.lang.String message)
Sets the message to be read by the user.
|
void |
setToRun(boolean newToRun)
Set's the toRun flag.
|
protected void |
setUriToGo(java.lang.String newUriToGo)
Set's the URI to go next.
|
void |
setUserChangesSinceLastOkOrCancel(boolean userChanges)
Sets the flag indicating that user changed something since last OK or Cancel.
|
void |
setWindowNbr(int windowNbr)
Sets the windowNbr.
|
free, register
public static final java.lang.String HIDDEN_PANEL_FIELD
public static final java.lang.String FURTHER_PARAMETER_DELIMITER
public BackButton backButton
<%=butler.backButton%>
protected SessionData sessionData
public JspButler(SessionData sessionData)
sessionData
- the session's public datapublic boolean isCloseWindowIfNoPreviousURIisAvailable()
public void setCloseWindowIfNoPreviousURIisAvailable(boolean closeWindowIfNoPreviousURIisAvailable)
closeWindowIfNoPreviousURIisAvailable
- The closeWindowIfNoPreviousURIisAvailable to setpublic int getWindowNbr()
public void setWindowNbr(int windowNbr)
windowNbr
- The windowNbr to setpublic void setForeignPreparationFlag()
public void init()
protected java.lang.Object getSychronizationObject()
public MustTextField createTextField(int length)
public MustPasswordField createPasswordField(int length)
public HalfDataComboBox createComboBox(SessionData sessionData, java.lang.String name, DataObject contentDataObject, java.lang.String visibleColumn, java.lang.String orderByColumn, java.lang.String nameForNoChoice)
sessionData
- the session's public dataname
- the name of the combo boxcontentDataObject
- the source data object that shall fill the content of the combo boxvisibleColumn
- the column to be used to fill the combo box from the source data objectorderByColumnName
- the column name to determine for the list ordernameForNoChoice
- the expression that indicates "no choice"public boolean handlingCausesReturn(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException
<% if (butler.handlingCausesReturn(request, response)) return;%>
java.io.IOException
ServletException
public java.lang.String getTranslationByFramework(java.lang.String key)
public int getCurrentDialogNbr()
protected java.lang.Class<?>[] getButlerFriends()
protected void handle(GeneralizedRequest request)
request
- the request to be handledpublic int getDialogNbr()
isExactDialogSequence()
protected boolean isExactDialogSequence()
getDialogNumberHiddenFieldTag()
public int getComeInDialogNbr()
public void setToRun(boolean newToRun)
newToRun
- whether the butler's activity is to continue or not.public boolean isToRun()
protected void setUriToGo(java.lang.String newUriToGo)
newUriToGo
- the URI to go next.public boolean isPreviousURIAvailable()
protected void goBack()
public java.lang.String getURI()
public java.lang.String getPreviousURI()
protected java.lang.String getHrefTag(java.lang.String target)
protected java.lang.String getHrefTag(java.lang.String target, boolean openInNewWindow)
public java.lang.String encode(java.lang.String url)
public java.lang.String encodeRedirectURL(java.lang.String url)
the
- URL to be encodedprotected void informUserAbout(java.lang.Exception exc)
exc
- exception the user should be informed aboutprotected void setFocusOn(MustInputField field)
function shallIsetFocus() {
<% if (butler.getFieldNameToReceiveFocus() != null) { %>
for (var i = 0; i < window.document.forms[0].elements.length; i++) {
var e = window.document.forms[0].elements[i];
if (e.name == "<%=butler.getFieldNameToReceiveFocus()%>") {
e.focus();
break;
}
}
<% } %>
}
...
field
- Sets the focus on the input fieldgetFieldNameToReceiveFocus()
public java.lang.String getFieldNameToReceiveFocus()
public java.lang.String getDialogNumberHiddenFieldTag()
public java.lang.String getDialogNumberUrlFragment()
public void setMessageToKeep(java.lang.String message)
messageToKeep
- the message for the userpublic java.lang.String getScriptToExecute()
public java.lang.String getAlertableString(java.lang.String stringToBeAlerted)
stringToBeAlerted
- the string to be alertedpublic void setUserChangesSinceLastOkOrCancel(boolean userChanges)
whether
- or not user changed something since last OK or Cancel.public boolean didUserChangeSomethingSinceLastOkOrCancel()
public long getLastUse()
protected void invalidate()
public boolean isInvalidated()
public void jspDestroyConsequences()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de