SilverStream
Application Server 3.5

com.sssw.shr.page
Class AgpPage

java.lang.Object
 |
 +--com.sssw.shr.page.AgpPage
All Implemented Interfaces:
AgiInvokeBusinessObject, AgiPageControl, Comparator, Serializable, Servlet

public class AgpPage
extends Object
implements AgiPageControl, Serializable, Servlet, AgiInvokeBusinessObject, Comparator

Dynamically generated HTML page or subpage. Subpages have a smaller set of properties than pages. All the methods of AgpPage apply both to top-level pages and to subpages contained within another page.

Every page has these instance variables built-in:
agData - an instance of the AgpDataPrimary class that binds the page to a primary dataset.
agDataMgr - an instance of the AgoBindingManager class that manages data binding and enables searching the data.
agScriptHelper - an instance of the AgpScriptHelper class that performs common JavaScript functions.

Properties:
Action URL, Active Link Color, Background Color, Body Attributes, Distinct, Forever, Header Tags, Image, Initial Data Mode, Java Script, Limit Rows, Link Color, Loop, Maximum Rows, Method, Order By, Page URLs, Processor, Sound, Style Sheet, Target Frame, Text Color, Title, Visited Link Color, Where Clause
Events:
globalValidationFailed, globalValidationTest, handlePageException, pageGenerateBegin, pageLoaded, pageRequestBegin, pageRequestEnd, processPathInfo
See Also:
Serialized Form

Field Summary
static int MISMATCH_GET
          Return this value from handleStateMismatch() to indicate that an out-of-sync request should be handled as a GET.
static int MISMATCH_POST
          Return this value from handleStateMismatch() to indicate that an out-of-sync request should be handled as a POST.
 
Constructor Summary
AgpPage()
           
 
Method Summary
static String fullUrlForPage(String dbname, String pageurl)
          Returns a server-relative URL given a database name and a page specifier.
 AgpTag getBodyTag()
          Returns the BODY tag.
 String getCharEncoding()
          Returns the name of the character encoding scheme used by the page.
 AgiPageControl getControl(String name)
          Returns the control, as a Java object, whose Java name is given.
 AgiPageControl[] getControls()
          Returns an array of all the controls on a page.
 String getControlURL(String namespace)
          This method is for use in writing page controls.
 AgiHttpServletRequest getCurrentRequest()
          Provides access to the current request.
 AgiHttpServletResponse getCurrentResponse()
          Provides access to the response object for this request.
 String getDatabase()
          Returns the name of the database containing the page.
 URL getDatabaseURL()
          Returns an URL pointing to the database that contains the page.
 boolean getEmbedHTMLInTable()
          Returns true if the subpage or HTML control should be embedded in a table.
 boolean getEnableGenerateScript()
          Returns true if generation of JavaScript is enabled.
 boolean getEnableHistoryFixup()
          Returns true if history fixup is enabled.
 boolean getEnableHTMLGeneration()
          Returns whether HTML generation is enabled for this page.
 String getFormDataCharEncoding()
          Determine the encoding the server should expect from the browser for URL-encoded form data.
 AgpTag getFormTag()
          Returns the FORM tag if this page or a parent page defines a form processing tag.
 AgpFrame getFrame(String name)
          Returns the named frame control.
 AgpTag getHeadTag()
          Returns the HEAD tag.
 long getLastModified()
          Returns the last modified date as a long.
 Locale getLocale()
          Returns the locale for the client system
 AgpPage getPage(String pageurl)
          Returns a page from the user session.
 URL getPageURL()
          Returns an URL that can be used to access this page.
 URL getPageURL(String pageSpec)
          Returns an URL representing the specified page.
 URL getPageURL(String pagespec, String query, String orderby, Hashtable params)
          Returns an URL representing the specified page, using optional query, orderby, freeform parameters.
 AgpPage getParentPage()
          Returns the containing page if this page is used as a subpage.
 String getPath()
          Returns the server relative path of the page.
 Object getProperty(String name)
          Returns the specified page property.
 Object getSessionValue(String name)
          Retrieves a named value which has previously been stored in the session.
 AgpTag getTag(String name)
          Returns the named AgpTag object.
 String getTimeZoneID()
          Returns the server setting that keeps track of the client time zone
 boolean getUrlQueryMode()
          Determine whether the 'query' and 'order-by' parameters of the request URL are processed automatically by the page.
 boolean getUseMultipartFormData()
          Determine whether the page is set to request MIME multipart/form-data from the browser.
 String getUser()
          Gets the name of the current user.
 String getUserAgent()
          Returns the user agent string, obtained from the "user-agent" header of the HTTP request.
 int handleStateMismatch()
          handleStateMismatch() can be overridden to change the way that the page handles out-of-sync POST requests, which may occur if the end user navigates through the browser history, or if the server restarts between a user's requests to a page.
 boolean hasServicedRequest()
          Returns true if the page has serviced the request.
 void removePage(String pageurl)
          Removes a page from the user session.
 void removeSessionValue(String name)
          Removes a value from the user's session object.
 void setCharEncoding(String encoding)
          Sets the character encoding.
 void setEmbedHTMLInTable(boolean embed)
          Specifies whether the subpage or HTML control should be embedded in a table.
 void setEnableGenerateScript(boolean scriptenable)
          Specifies whether script generation is enabled.
 void setEnableHistoryFixup(boolean flag)
          Specifies the flag which indicates fixup of the browser history through JavaScript.
 void setEnableHTMLGeneration(boolean enable)
          Specifies whether HTML generation should be enabled.
 void setFormDataCharEncoding(String encoding)
          Specify the encoding the server should expect from the browser for URL-encoded form data.
 void setLocale(Locale locale)
          Sets a server variable that keeps track of the locale for the client system
 void setProperty(String name, Object obj)
          Sets the specified page property.
 void setSessionValue(String name, Object value)
          Sets a value in the user's session object.
 void setTimeZoneID(String zoneStr)
          Sets a server variable that keeps track of the time zone for the client system
 void setUrlQueryMode(boolean enable)
          Specify whether the 'query' and 'order-by' parameters of the request URL are handled by the page.
 void setUseMultipartFormData(boolean use)
          Tells the page to specify whether data POSTed from the browser should be encoded using MIME multipart/form-data.
 boolean showPage(String pageSpec)
          Redirects the most recent request for this page to a different URL.
 boolean showPage(String pageSpec, String query, String orderby)
          Redirects the most recent request for this page to a different URL.
 boolean showPage(String pageSpec, String query, String orderby, Hashtable params)
          Redirects the most recent request for this page to a different URL.
 boolean userInGroup(String groupName)
          Tests whether the current user is in the specified group
 void writeScript(String javascript)
          Adds the JavaScript to the current response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods implemented from interface com.sssw.rt.util.AgiInvokeBusinessObject
invokeBusinessObject, invokeBusinessObject
 
Methods implemented from interface com.sssw.shr.page.AgiPageControl
generateHTML, getPrefix, notifyPageLoaded, notifyPageRequestBegin, notifyPageRequestEnd, notifyPostValue, notifyPostValues
 
Methods implemented from interface java.util.Comparator
compare
 
Methods implemented from interface javax.servlet.Servlet
destroy, getServletConfig, getServletInfo, init, service
 

Field Detail

MISMATCH_GET

public static int MISMATCH_GET
Return this value from handleStateMismatch() to indicate that an out-of-sync request should be handled as a GET. That is, any input from the user is ignored, and the response to the browser depicts the current state of the page as it exists on the server.

MISMATCH_POST

public static int MISMATCH_POST
Return this value from handleStateMismatch() to indicate that an out-of-sync request should be handled as a POST. This means that user input is accepted, which may cause updates to the database in unexpected order.
Constructor Detail

AgpPage

public AgpPage()
Method Detail

getLastModified

public long getLastModified()
Returns the last modified date as a long. This value represents the difference, measured in milliseconds, between the time of the last modification and midnight, January 1, 1970 UTC. The Java classes Java.util.Date and Java.util.DateFormat can be used to interpret and manipulate this value.
Example:
 		// Display the last-mod date of this page in a label
 		long lastMod = getLastModified();
 		if (lastmod == -1)
 			lastmodLabel.setText("Modification date not available");
 		else
 		{
 			Java.util.Date lastModDate(lastMod);
 			String lastModString = DateFormat.getDateInstance().format(lastModDate);
 			lastmodLabel.setText(lastModString);
 		}
 

getCurrentRequest

public AgiHttpServletRequest getCurrentRequest()
Provides access to the current request. This object represents the latest GET or POST request from the browser to the server for this page. If the server is not processing a GET or POST request for the page, this method returns null.
Example:
 		// determine whether the page is processing a "GET" or a "POST"
 		if (getCurrentRequest().getMethod().equals("GET"))
 		{
 			// ... process GET ...
 		}
 		else if (getCurrentRequest().getMethod().equals("POST"))
 		{
 			// ... process POST ...
 		}
 
 
 		// see if the current request includes one or more values for the "initialValues" parameter
 		String [] initialValues;
 		initialValues = getCurrentRequest().getParameterValues("initialValues");
 		if (initialValues != null)
 		{
 			for (int i = 0; i < initialValues.length; i++)
 			{
 				// ...process each initial value...
 			}
 		}
 
 
See Also:
AgiHttpServletRequest, AgpPage.getCurrentResponse()

getCurrentResponse

public AgiHttpServletResponse getCurrentResponse()
Provides access to the response object for this request. The contents of this object represent the values returned to the browser. Advanced HTTP programmers may wish to use the detailed level of browser control provided by the response object.
Example:
 		AgiHttpServletResponse resp = getCurrentResponse();
 		resp.setError(403);		// status code for "forbidden"
 
 
See Also:
AgiHttpServletResponse, AgpPage.getCurrentRequest()

getSessionValue

public Object getSessionValue(String name)
Retrieves a named value which has previously been stored in the session. This is a good way to share information among different pages that are part of the same application.
Parameters:
name - the name of the desired value
Example:
 		// if the user has entered a name in a previous step, initialize the
 		// "Author" text field with it.
 		Object prevValue = getSessionValue("UserName");
 		if (prevValue != null)
 		{
 			txtAuthor.setText((String)prevValue);
 		}
 
 
See Also:
AgpPage.removeSessionValue(String name), AgpPage.setSessionValue(String name, Object value)

setSessionValue

public void setSessionValue(String name,
                            Object value)
Sets a value in the user's session object. The session object is shared across all pages and business objects invoked during that session. The session object can be used to share information between pages that are used together as an application.
Parameters:
name - name of the object value.
value - object value.
Example:
 
See Also:
AgpPage.getSessionValue(String name), AgpPage.removeSessionValue(String name)

removeSessionValue

public void removeSessionValue(String name)
Removes a value from the user's session object. A subsequent call to getSessionValue() will return null.
Parameters:
name - The name of the object value.
Example:
 
See Also:
AgpPage.getSessionValue(String name), AgpPage.setSessionValue(String name, Object value)

getUrlQueryMode

public boolean getUrlQueryMode()
Determine whether the 'query' and 'order-by' parameters of the request URL are processed automatically by the page. The default setting is true.
Example:
 		if (getUrlQueryMode() == false)
 		{
 			Label1.setText("Automatic query processing disabled");
 		}
 
See Also:
AgpPage.setUrlQueryMode(boolean enable)

setUrlQueryMode

public void setUrlQueryMode(boolean enable)
Specify whether the 'query' and 'order-by' parameters of the request URL are handled by the page. The default setting is true.
Parameters:
enable - true if the 'query' and 'order-by' parameters should be handled by the page, otherwise false.
Example:
 
See Also:
AgpPage.getUrlQueryMode()

getDatabase

public String getDatabase()
Returns the name of the database containing the page.
Example:
 		String dbName = getDatabase();
 		Label1.setText(dbName);
 
 

getDatabaseURL

public URL getDatabaseURL()
Returns an URL pointing to the database that contains the page.
Usage:

For example, this method might return:

"http://MyServer/MyDatabase/"

Example:
 		String dbURL = getDatabaseURL().toString();
 
 		// Set up Label1 as a link pointing to the database directory
 		Label1.setType(AgpLabel.EXPRESSION_LINK);
 		Label1.setText("Database directory");
 		Label1.setLinkTarget(dbURL);
 
 

getPath

public String getPath()
Returns the server relative path of the page.
Example:
 		String pagePath = getPath();
 

getEnableHTMLGeneration

public boolean getEnableHTMLGeneration()
Returns whether HTML generation is enabled for this page. If HTML generation is not enabled, then the page will not return any visible content to the browser.
Example:
 		// If we're not showing the first subpage, don't show the second one either
 		if (!Subpage1.getEnableHTMLGeneration())
 			Subpage2.setEnableHTMLGeneration(false);
 
 
See Also:
AgpPage.setEnableHTMLGeneration(boolean enable)

setEnableHTMLGeneration

public void setEnableHTMLGeneration(boolean enable)
Specifies whether HTML generation should be enabled.
Parameters:
enable - true to enable HTML generation, otherwise false
Example:
 
See Also:
AgpPage.getEnableHTMLGeneration()

getEnableHistoryFixup

public boolean getEnableHistoryFixup()
Returns true if history fixup is enabled. The default value is false. History fixup requires JavaScript, so it will not work in all browsers.

If an end user is viewing a page that has history fixup enabled, pressing the browser's Back button will return the user to the page that was viewed before the current page, regardless of how many POSTs have been made to the current page. If history fixup is not enabled, the Back button causes an error.

Example:
 		if (getEnableHistoryFixup())
 		{
 			Label1.setText("Press your browser's BACK button to return to the previous page.");
 		}
 
See Also:
AgpPage.setEnableHistoryFixup(boolean flag)

setEnableHistoryFixup

public void setEnableHistoryFixup(boolean flag)
Specifies the flag which indicates fixup of the browser history through JavaScript.
Parameters:
flag - true to enable browser history fixup; otherwise false.
Example:
 
See Also:
AgpPage.getEnableHistoryFixup()

setUseMultipartFormData

public void setUseMultipartFormData(boolean use)
Tells the page to specify whether data POSTed from the browser should be encoded using MIME multipart/form-data.
Parameters:
use - Set to "true" to use MIME multipart/form-data.
See Also:
AgpPage.getUseMultipartFormData(), AgpPage.setFormDataCharEncoding(String encoding), AgpPage.setCharEncoding(String encoding)

getUseMultipartFormData

public boolean getUseMultipartFormData()
Determine whether the page is set to request MIME multipart/form-data from the browser.
See Also:
AgpPage.setUseMultipartFormData(boolean use), AgpPage.getFormDataCharEncoding(), AgpPage.setFormDataCharEncoding(String encoding), AgpPage.getCharEncoding()

getFormTag

public AgpTag getFormTag()
Returns the FORM tag if this page or a parent page defines a form processing tag.
Usage:

The tag returned by this method can be used to set JavaScript on it (dynamically) just like setting any other properties.

See Also:
AgpPage.getBodyTag(), AgpPage.getHeadTag()

getBodyTag

public AgpTag getBodyTag()
Returns the BODY tag.
Usage:

The AgpTag object that this method returns can be used to set properties for the body of the page. The properties that are attributes of the HTML BODY tag can be set, such as BGCOLOR. JavaScript can also be added to the BODY tag using this object.

Example:
 		// This code could be used in an event handler on a page
 		AgpTag bodyTag = getBodyTag();
 		bodyTag.setProperty("BGCOLOR", "Red");
 
See Also:
AgpTag, AgpPage.getFormTag(), AgpPage.getHeadTag()

getHeadTag

public AgpTag getHeadTag()
Returns the HEAD tag.
Usage:

Use the tag returned by this method to set JavaScript on it (dynamically) just like setting any other properties.

See Also:
AgpPage.getBodyTag(), AgpPage.getFormTag()

setEnableGenerateScript

public void setEnableGenerateScript(boolean scriptenable)
Specifies whether script generation is enabled.
Parameters:
scriptenable - true if generation should be enabled; otherwise false.
Example:
 
See Also:
AgpPage.getEnableGenerateScript()

getEnableGenerateScript

public boolean getEnableGenerateScript()
Returns true if generation of JavaScript is enabled. The default value is true.
Example:
 		// put up a warning label if this page uses JavaScript
 		Label1.setType(AgpLabel.EXPRESSION_LINK);
 
 		if (getEnableGenerateScript())
 		{
 			Label1.setText("JavaScript version: click here to use HTML-only version");
 			Label1.setLinkTarget(htmlURL);
 		}
 		else
 		{
 			Label1.setText("HTML-only version: click here to use JavaScript version");
 			Label1.setLinkTarget(javascriptURL);
 		}
 
See Also:
AgpPage.setEnableGenerateScript(boolean scriptenable)

getCharEncoding

public String getCharEncoding()
Returns the name of the character encoding scheme used by the page. The default encoding scheme is UTF-8. The character encoding can be set using the setCharEncoding() method.
Example:
 		String encodingName = getCharEncoding();
 
See Also:
AgpPage.setCharEncoding(String encoding), AgpPage.getFormDataCharEncoding(), AgpPage.getUseMultipartFormData()

setCharEncoding

public void setCharEncoding(String encoding)
Sets the character encoding.
Parameters:
encoding - a string containing the encoding.
Usage:

This method assumes that the converter has the same name.

Example:
 
See Also:
AgpPage.getCharEncoding(), AgpPage.setFormDataCharEncoding(String encoding), AgpPage.setUseMultipartFormData(boolean use)

setFormDataCharEncoding

public void setFormDataCharEncoding(String encoding)
Specify the encoding the server should expect from the browser for URL-encoded form data. This is only useful if the page does not specify multipart form data, and should be set to the same encoding as the server uses to deliver the page to the browser.
Parameters:
encoding - The string representing the encoding. For example "iso-8859-1".
See Also:
AgpPage.getFormDataCharEncoding(), AgpPage.setUseMultipartFormData(boolean use), AgpPage.setCharEncoding(String encoding)

getFormDataCharEncoding

public String getFormDataCharEncoding()
Determine the encoding the server should expect from the browser for URL-encoded form data. This method are only useful if the page does not specify multipart form data.
See Also:
AgpPage.setFormDataCharEncoding(String encoding), AgpPage.getUseMultipartFormData(), AgpPage.getCharEncoding()

getParentPage

public AgpPage getParentPage()
Returns the containing page if this page is used as a subpage. Returns null if there is no containing page.
Example:
 		// If this is a top-level page, show a label for the title
 		if (getParentPage() == null)
 		{
 			lblTitle.setEnableHTMLGeneration(true);
 		}
 		else
 		{
 			lblTitle.setEnableHTMLGeneration(false);
 		}
 

getControl

public AgiPageControl getControl(String name)
Returns the control, as a Java object, whose Java name is given. This is useful for writing code in one page, or in a business object, that manipulates another page's controls.
Parameters:
name - the Java name of the desired control.
Example:
 		// set the value of a control on a subpage
 		AgiPageControl c = Subpage1.getControl("TitleLabel");
 		if (c instanceof AgpLabel)
 		{
 			AgpLabel label = (AgpLabel)c;
 			label.setText("Enter detail information here:");
 		}
 
See Also:
AgiPageControl, AgpPage.getControls()

getTag

public AgpTag getTag(String name)
Returns the named AgpTag object.
Parameters:
name - a string representing the name.
Usage:

If the named object does not exist, or if the named object is not a tag, returns null. This method is meant to be used for tags that are not programmable by the WYSIWYG editor but marked with "_NAME" in the raw HTML editor.

Example:
 		// center-align the paragraph named "HighlightMe".
 		AgpTag paraTag = getTag("HighlightMe");
 		if (paraTag != null)
 			paraTag.setProperty("ALIGN", "CENTER");
 
 
See Also:
AgpPage.getFrame(String name)

getFrame

public AgpFrame getFrame(String name)
Returns the named frame control.
Parameters:
name - the name of the desired frame.
Usage:

If the named object does not exist, or if the named object is not a frame, returns null. This method is very useful to access a frame object in the frameset page from elsewhere.

See Also:
AgpPage.getTag(String name)

getControls

public AgiPageControl[] getControls()
Returns an array of all the controls on a page.
Example:
 		// Hide any text buttons that appear on a subpage
 		AgiPageControl [] controlArray = Subpage1.getControls();
 		for (int i = 0; i < controlArray.length; i++)
 		{
 			if (controlArray[i] instanceof AgpButtonText)
 			{
 				AgpButtonText button = (AgpButtonText)controlArray[i];
 				button.setEnableHTMLGeneration(false);
 			}
 		}
 
 
See Also:
AgpPage.getControl(String name)

getPage

public AgpPage getPage(String pageurl)
                throws AgoApiException
Returns a page from the user session.
Parameters:
pageurl - a string containing the URL.
Usage:

The string must be a database relative url if in the same database as the page being called, or DBNAME:database relative url if in another database.

Example:

This is an example of retrieving another page in the same database:

 	AgpPage p = getPage("anotherpage.html");
 
See Also:
AgpPage.getPageURL()

removePage

public void removePage(String pageurl)
                throws AgoApiException
Removes a page from the user session. The string must be a database-relative url (if in the same database as the page being called, or take the form DBNAME:database-relative url (if in another db).

fullUrlForPage

public static String fullUrlForPage(String dbname,
                                    String pageurl)
Returns a server-relative URL given a database name and a page specifier.
Parameters:
dbname - a string representing the dbname.
pageurl - a string representing the URL.
Usage:

This is a static method.

The database name is ignored if the pageurl includes a database specifier. For example:

fullUrlForPage("mydb", "MyPage")

    returns /mydb/SilverStream/Pages/MyPage

fullUrlForPage("mydb", "XXXX:MyPage")

    returns /XXXX/SilverStream/Pages/MyPage

This method supports two different ways of specifying the database where the desired page resides, for compatibility with other parts of the SilverStream programming environment.
Example:
 		// two ways to get a server-relative url for the page "foobar.html" in the
 		// database "MyDB"
 		String foobarUrl1 = AgpPage.fullUrlForPage("MyDB", "foobar.html");
 		String foobarUrl2 = AgpPage.fullUrlForPage(null, "MyDB:foobar.html");
 
 

getUserAgent

public String getUserAgent()
Returns the user agent string, obtained from the "user-agent" header of the HTTP request. This can be useful for implementing browser-specific functionality.

showPage

public boolean showPage(String pageSpec)
Redirects the most recent request for this page to a different URL.
Parameters:
pageSpec - a page-spec for the page This can be:
  • the name of a page in the current webbase,
  • Webbase:page for a page in another webbase, or
  • a full URL to a page.
Example:
 	     boolean successful;
 	     successful = AgpPage.showPage("index.html");
 

showPage

public boolean showPage(String pageSpec,
                        String query,
                        String orderby)
Redirects the most recent request for this page to a different URL. Accepts a query and an orderby.
Parameters:
pageSpec - a page-spec for the page This can be:
  • the name of a page in the current webbase,
  • Webbase:page for a page in another webbase, or
  • a full URL to a page.
query - a query to subset the records displayed on the page.
orderby - an orderby clause for the records on the page.
Example:
 
 	     boolean successful;
 	     successful = AgpPage.showPage("Employees.html",
 	     	"Employees.salary > 35000", "Employees.lastname asc");
 

showPage

public boolean showPage(String pageSpec,
                        String query,
                        String orderby,
                        Hashtable params)
Redirects the most recent request for this page to a different URL. Accepts a query, an orderby, and a hashtable.
Parameters:
pageSpec - a page-spec for the page This can be:
  • the name of a page in the current webbase,
  • Webbase:page for a page in another webbase, or
  • a full URL to a page.
query - a query to subset the records displayed on the page.
orderby - an orderby clause for the records on the page.
params - a hashtable containing parameters to pass to the specified page.
Example:
 	     Hashtable params;
 	     params = new Hashtable();
 	     // add useful data to hashtable here
 
 	     boolean successful;
 	     successful = AgpPage.showPage("Employees.html",
 	     	"Employees.salary > 35000", "Employees.lastname asc", params);
 

writeScript

public void writeScript(String javascript)
Adds the JavaScript to the current response.
Parameters:
javascript - a string containing the JavaScript.
Example:
 

getProperty

public Object getProperty(String name)
Returns the specified page property. Unlike getProperty for page controls, this method is not related to generated HTML. Instead it references a hashtable that pages use to store certain information. AgpPage.getProperty() can be used for communication between parent pages and sub-pages, or between different pages in a session.
Parameters:
name - the name of the property.
Usage:

Note that we allow the derived class to override this method to do custom processing.

Example:
 	     //Retrieve some previously stored information
 	     Integer custID=getProperty("CustomerID");
 
See Also:
AgpPage.setProperty(String name, Object obj)

setProperty

public void setProperty(String name,
                        Object obj)
Sets the specified page property. Unlike setProperty for page controls, this method is not related to generated HTML. Instead it references a hashtable that pages use to store certain information. AgpPage.setProperty() can be used for communication between parent pages and sub-pages, or between different pages in a session.
Parameters:
name - the name of the property.
obj - the value.
Usage:

Note that we allow derived class to override this method to do custom processing.

Example:
 	     //Store some information for use elsewhere on the page
 	     setProperty("CustomerID", newInteger(custID));
 
See Also:
AgpPage.getProperty(String name)

hasServicedRequest

public boolean hasServicedRequest()
Returns true if the page has serviced the request.
Example:
 

getEmbedHTMLInTable

public boolean getEmbedHTMLInTable()
Returns true if the subpage or HTML control should be embedded in a table. If the subpage is not embedded in a table, it appears "free-flow" into the text.
Example:
 		boolean b = Subpage1.getEmbedHTMLInTable()
 
 
See Also:
AgpPage.setEmbedHTMLInTable(boolean embed)

setEmbedHTMLInTable

public void setEmbedHTMLInTable(boolean embed)
Specifies whether the subpage or HTML control should be embedded in a table.
Parameters:
embed - true to embed the subpage or HTML control in a table, or false to make it "free-flow" into the text.
Example:
 
See Also:
AgpPage.getEmbedHTMLInTable()

getPageURL

public URL getPageURL()
Returns an URL that can be used to access this page.
Example:

This is an example of retrieving the URL of the current page:

 	URL url = getPageURL();
 	System.out.println("This is the URL of the page: " + url);
 
See Also:
AgpPage.getPage(String pageurl)

getPageURL

public URL getPageURL(String pageSpec)
Returns an URL representing the specified page.
Parameters:
pageSpec - a page-spec for the page This can be:
  • the name of a page in the current webbase,
  • Webbase:page for a page in another webbase, or
  • a full URL to a page.
Usage:

A call to getPageURL may return null if the URL cannot be constructed or if the method is called outside the context of a service() request.

Example:
 
See Also:
AgpPage.getPage(String pageurl)

getPageURL

public URL getPageURL(String pagespec,
                      String query,
                      String orderby,
                      Hashtable params)
Returns an URL representing the specified page, using optional query, orderby, freeform parameters.
Parameters:
pagespec - a page-spec for the page. This can be:
  • the name of a page in the current webbase,
  • Webbase:page for a page in another webbase, or
  • a full URL to a page.
query - a query to subset the records displayed on the page.
orderby - an orderby clause for the records on the page.
params - a hashtable containing parameters to pass to the specified page.
Usage:

A call to getPageURL may return null if the URL cannot be constructed or if the method is called outside the context of a service() request.

Example:
 
See Also:
AgpPage.getPage(String pageurl)

getControlURL

public String getControlURL(String namespace)
This method is for use in writing page controls. A page control that implements the Servlet interface may need to generate HTML containing a reference to an URL that is a sub-URL of the control. The control should call this method, passing the namespace provided to it by the page to get the base URL of the control. It can then append "/suburl" in order to process requests itself.

getUser

public String getUser()
Gets the name of the current user.

userInGroup

public boolean userInGroup(String groupName)
Tests whether the current user is in the specified group

handleStateMismatch

public int handleStateMismatch()
                        throws AgoException
handleStateMismatch() can be overridden to change the way that the page handles out-of-sync POST requests, which may occur if the end user navigates through the browser history, or if the server restarts between a user's requests to a page. The default is to treat all out-of-sync requests as GET requests. Returning MISMATCH_POST changes this behavior. Also, the override of handleStateMismatch() can throw an exception, which will cause control to move to the handlePageException() method.
Usage:

Sometimes, the end user issues a request that's out-of-sync with the server's page state. This happens when history fixup is turned off, and the user navigates through the browser history, or when the server restarts between user requests to a page. If the user enters information into the page, then submits it, while it is in this out-of-sync state, data may be unexpectedly overwritten in the database table.

The default implementation for handleStateMismatch() returns MISMATCH_GET, which ensures that any input from the user is ignored. You can instruct the server to accept input from the user by returning MISMATCH_POST in your overridden method.


getLocale

public Locale getLocale()
Returns the locale for the client system
Specified by:
getLocale in interface com.sssw.rt.event.AgiBindingManagerOwner

setLocale

public void setLocale(Locale locale)
Sets a server variable that keeps track of the locale for the client system

getTimeZoneID

public String getTimeZoneID()
Returns the server setting that keeps track of the client time zone
Specified by:
getTimeZoneID in interface com.sssw.rt.event.AgiBindingManagerOwner

setTimeZoneID

public void setTimeZoneID(String zoneStr)
Sets a server variable that keeps track of the time zone for the client system
Usage:

The server is unable to determine the time zone of the client unless the user provides this information. If the user provides this information, the page can call setTimeZoneID to set the time zone value that will be used to process the client request.


SilverStream
Application Server 3.5