|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjaxcent.JaxcentPage
JaxcentPage is the base class from which all Jaxcent URL handlers need to be derived. In cases where no particular handler is needed (when using auto-session-management and when no data verification is needed), this class can be specified directly as the handler. This class provides over-ridable methods to process operations like load and unload. It also provides various common utility methods, such as showing JavaScript alert (dialog box) messages.
Constructor Summary | |
JaxcentPage()
Default constructor. |
Method Summary | |
boolean |
checkElementExists(SearchType searchType,
java.lang.String searchString,
int searchIndex)
Check if an element exists, without attempting to assign it to an object. |
void |
deleteCookie(java.lang.String cookieName)
Delete cookie. |
void |
deleteElementById(java.lang.String id)
Delete an element referenced by an ID. |
java.lang.String |
evalJavaScriptCode(java.lang.String code)
Execute JavaScript code, wait for results. |
java.lang.String |
evalJavaScriptCode(java.lang.String code,
boolean argsAsArray,
java.lang.Object[] args)
Same as execJavaScriptCode, but waits for the result of the evaluation and returns it. |
void |
execJavaScriptCode(java.lang.String code)
Execute JavaScript code, do not wait for results. |
void |
execJavaScriptCode(java.lang.String code,
boolean argsAsArray,
java.lang.Object[] args)
Call JavaScript, do not wait for results. |
java.util.Map |
getAllFormData()
Retrieve all form data on page. |
java.util.Map |
getAllSessionData(boolean getFromCurrentPage)
Get all data from session so far. |
java.lang.Object |
getAppContext()
This method will return the application server's or Jaxcent connector's application context. |
java.util.Enumeration |
getAppContextKeys()
Get list of key names from application context. |
java.lang.String |
getClientJaxcentURL()
Returns the URL used in the client for Jaxcent. |
java.lang.String |
getClientVersion()
Returns a string describing the connected page's version number, e.g. "2.1.1". |
java.lang.String |
getCookie(java.lang.String cookieName)
Get cookie value. |
java.util.Map |
getCookies()
Get cookies from page as name->value pairs. |
java.lang.String |
getCurrentPath()
Get the path of the URL that is being processed. |
boolean |
getFormSaveEnabled()
For AutoSessionData pages, returns whether saving form data in session upon page unloads, is enabled. |
java.lang.Object |
getFromAppContext(java.lang.String key)
Get data from application context. |
java.lang.Object |
getHttpSession()
If "UseSession" or "AutoSessionData" have been configured as true in the configuration file for this page, this method will return the HTTP session object from the application server or Jaxcent connector. |
static java.lang.String |
getJaxcentVersion()
Return Jaxcent version. |
java.util.Locale |
getLocale()
Get the remote locale if specified in HTTP Accept-Language header. |
java.util.Locale[] |
getLocales()
Get a list of remote locales if specified in HTTP Accept-Language header. |
java.lang.String |
getRemoteAddr()
Get the client IP address. |
java.awt.Dimension |
getScreenSize()
Get screen dimensions |
java.lang.String |
getStatusText()
Get status text. |
java.awt.Dimension |
getWindowSize()
Get window dimensions |
void |
goBack()
Navigate back. |
void |
goForward()
Navigate forward. |
void |
invalidateHttpSession()
If "UseSession" or "AutoSessionData" have been configured as true in the configuration file for this page, this method can be used to invalidate the session. |
java.lang.String |
makeContentURL(java.lang.String contentType,
byte[] content,
java.lang.String filename)
Returns a URL that will return a given content-type and bytes. |
void |
navigate(java.lang.String url)
Navigate to a given URL. |
protected void |
onFinalFormData(java.util.Map formData)
Override to receive form data during page unloading. |
protected void |
onJavaScriptRequest(java.lang.String cmd,
java.lang.String[] args)
Override to process data from JavaScript methods sent by calling the "JaxcentServerRequest( args... );" function defined by the Jaxcent JavaScript file. |
protected void |
onLoad()
Override to handle page loading. |
protected void |
onUnload()
Override to handle page unloading. |
void |
removeAppContextKey(java.lang.String key)
Remove key from application context. |
void |
resetFromSession()
Reset form data from session. |
void |
saveInAppContext(java.lang.String key,
java.lang.Object value)
Save data in the application context, using a given key (like a Map.) |
void |
setBatchUpdates(boolean batchUpdates)
Used to hold updates without sending them out to the client. |
void |
setCookie(java.lang.String cookieString)
Add cookie to page. |
void |
setCookie(java.lang.String name,
java.lang.String value,
java.util.Date expires,
java.lang.String domain,
java.lang.String path,
boolean isSecure)
Add cookie to page. |
void |
setFormSaveEnabled(boolean enable)
Enable or disable saving of form data from current page into session, for AutoSessionData management. |
void |
setStatusText(java.lang.String text)
Set status text. |
boolean |
showConfirmDialog(java.lang.String message)
Show JavaScript confirm dialog box to the user. |
java.lang.String |
showInputDialog(java.lang.String prompt,
java.lang.String defaultResult)
Show JavaScript prompt dialog box to the user. |
void |
showMessageDialog(java.lang.String message)
Show JavaScript alert dialog box to the user. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JaxcentPage()
Method Detail |
public java.lang.Object getHttpSession() throws Jaxception
If running with a standard Java servlet-container/application-server, the object returned is of type javax.servlet.http.HttpSession, and can be cast to that type.
If running with a direct Jaxcent connector for IIS/Apache, the object returned is of type jaxcentConnector.JaxcentSession.
Jaxception
public void invalidateHttpSession() throws Jaxception
Jaxception
public java.lang.Object getAppContext() throws Jaxception
If running with a standard Java servlet-container/application-server, the object returned is of type javax.servlet.ServletContext, and can be cast to that type.
If running with a direct Jaxcent connector for IIS/Apache, the object returned is of type jaxcentConnector.JaxcentAppContext.
Jaxception
saveInAppContext(java.lang.String, java.lang.Object)
,
getFromAppContext(java.lang.String)
,
getAppContextKeys()
protected void onLoad()
protected void onFinalFormData(java.util.Map formData)
public java.util.Map getAllFormData() throws Jaxception
The returned Map maps names or ids, to values.
Multile checkboxes can have the same name and multiple values. These are separated by commas. If the checkbox (or none of the checkboxes) is not selected, there will still be a value, and this value will be an empty string.
For lists (SELECT), the value contains of a selected index, followed by a colon character and the text selected. (Convenient utility functions JaxcentObject.getSelectedIndex and JaxcentObject.getSelectedValue are available to parse it.)
Jaxception
protected void onUnload()
public java.util.Map getAllSessionData(boolean getFromCurrentPage) throws Jaxception
Jaxception
public void navigate(java.lang.String url) throws Jaxception
Jaxception
public void goBack() throws Jaxception
Jaxception
public void goForward() throws Jaxception
Jaxception
public void execJavaScriptCode(java.lang.String code, boolean argsAsArray, java.lang.Object[] args) throws Jaxception
The arguments array can contain Strings, Integers, Doubles, Strings, Boolean, Integers, Jaxcent HTML Elements, or it can be null. If the argument array is not null, the "code" is just a JavaScript function name, and must not contain the parentheses character. In this case, the characters "( )" containing any arguments are appended to the "code". The array specifies the list of parameters. If the argument array is null, the "code" is evaluated as is, as an expression. To call a function with no args, use the form execJavaScriptCode( "myFunction()", null, false );
If the "argsAsArray" argument is true, the JavaScript function will be called with a single argument, which will be an array. Otherwise, the "args" array will be used as a list of arguments.
Jaxception
public void execJavaScriptCode(java.lang.String code) throws Jaxception
Same as execJavaScriptCode( code, false, null );
Jaxception
public java.lang.String evalJavaScriptCode(java.lang.String code, boolean argsAsArray, java.lang.Object[] args) throws Jaxception
Jaxception
public java.lang.String evalJavaScriptCode(java.lang.String code) throws Jaxception
Same as evalJavaScriptCode( code, false, null );
Jaxception
protected void onJavaScriptRequest(java.lang.String cmd, java.lang.String[] args)
The JavaScript call is asynchronous and does not wait for server response -- if it is required to process a server response in JavaScript, define a function in JavaScript and call that function via execJavaScriptCode or evalJavaScriptCode, from your override of this method.
If JaxcentServerRequest was called at the client with no arguments, this method is called with null args. If JaxcentServerRequest was called with 1 arg, this method is passed that arg as "cmd", the "args" is null. Otherwise, "cmd" is the first arg passed to JaxcentServerRequest, and "args" contains the rest of the args.
public void setStatusText(java.lang.String text) throws Jaxception
Jaxception
public java.lang.String getStatusText() throws Jaxception
Jaxception
public java.awt.Dimension getScreenSize() throws Jaxception
Jaxception
public java.awt.Dimension getWindowSize() throws Jaxception
Jaxception
public java.lang.String getCurrentPath()
public java.lang.String getRemoteAddr()
public java.util.Locale getLocale()
public java.util.Locale[] getLocales()
public void showMessageDialog(java.lang.String message)
public boolean showConfirmDialog(java.lang.String message) throws Jaxception
Jaxception
public java.lang.String showInputDialog(java.lang.String prompt, java.lang.String defaultResult) throws Jaxception
Jaxception
public java.util.Map getCookies() throws Jaxception
Jaxception
public java.lang.String getCookie(java.lang.String cookieName) throws Jaxception
Jaxception
public void setCookie(java.lang.String cookieString)
public void setCookie(java.lang.String name, java.lang.String value, java.util.Date expires, java.lang.String domain, java.lang.String path, boolean isSecure) throws Jaxception
Jaxception
public void deleteCookie(java.lang.String cookieName)
public void deleteElementById(java.lang.String id)
public boolean checkElementExists(SearchType searchType, java.lang.String searchString, int searchIndex) throws Jaxception
Jaxception
public void resetFromSession() throws Jaxception
Jaxception
public void setFormSaveEnabled(boolean enable)
public boolean getFormSaveEnabled()
public void setBatchUpdates(boolean batchUpdates)
If batch-updates has been set to true, no further data will be sent to the client until batch-updates is reset to false! This should be done in a try-finally clause.
Important: Do not attempt to retrieve data from page while batch-updates is true!
public void saveInAppContext(java.lang.String key, java.lang.Object value) throws Jaxception
Jaxception
public java.lang.Object getFromAppContext(java.lang.String key) throws Jaxception
Jaxception
saveInAppContext(java.lang.String, java.lang.Object)
public void removeAppContextKey(java.lang.String key) throws Jaxception
Jaxception
saveInAppContext(java.lang.String, java.lang.Object)
,
getFromAppContext(java.lang.String)
public java.util.Enumeration getAppContextKeys() throws Jaxception
Jaxception
saveInAppContext(java.lang.String, java.lang.Object)
,
getFromAppContext(java.lang.String)
public java.lang.String getClientVersion()
public java.lang.String getClientJaxcentURL()
public static java.lang.String getJaxcentVersion()
public java.lang.String makeContentURL(java.lang.String contentType, byte[] content, java.lang.String filename) throws Jaxception
Jaxception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |