SilverStream
Application Server 3.5

com.sssw.rt.form
Class PvHelperBrowser

java.lang.Object
 |
 +--com.sssw.rt.form.PvHelperBrowser

public class PvHelperBrowser
extends Object

The PvHelperBrowser class provides methods to manage the user's browser. An instance of the PvHelperBrowser, called agBrowser, is supplied with every instance of a form.

Note: Including forms or views in pages is not supported in SilverStream 3.0 due to limitations of the Sun Java 1.2 browser plug-in. We hope to re-enable this support in SilverStream in the future. See the release notes for updated information.


Constructor Summary
PvHelperBrowser()
           
 
Method Summary
 Applet getApplet()
          Get the applet containing the form
 AppletContext getAppletContext()
          Returns the applet context for the SilverStream form.
 boolean playSound(String soundSpec)
          Play a sound
 boolean showPage(String pagespec)
          Move the current frame of the browser to a new page
 boolean showPage(String pagespec, String frame)
          Move the browser to a new page in the specified frame.
 boolean showPage(String pagespec, String frame, Hashtable params)
          Moves the browser to a new page in the specified frame.
 boolean showPage(String pagespec, String frame, String query, String orderby, Hashtable params)
          Move the browser to a new page in the specified frame.
 void showStatus(String message)
          Show a status message in the browser's status bar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PvHelperBrowser

public PvHelperBrowser()
Method Detail

showPage

public boolean showPage(String pagespec)
Move the current frame of the browser to a new page
Parameters:
pagespec - a page-spec for the page. This can be:
  • The name of a page in the current database
  • database:page for a page in another database, or
  • A full URL to a page
Returns:
true if the call is successful
Example:
  boolean successful;
  successful = agBrowser.showPage("index.html");
 

showPage

public boolean showPage(String pagespec,
                        String frame)
Move the browser to a new page in the specified frame.
Parameters:
pagespec - a page-spec for the page. This can be:
  • The name of a page in the current database
  • database:page for a page in another database, or
  • A full URL to a page
frame - The name of the browser frame to switch to the new page. A null value is interpreted as "_self," the current frame.
Returns:
true if the call is successful.
Example:
  boolean successful;
  successful = agBrowser.showPage("index.html", "right");
 

showPage

public boolean showPage(String pagespec,
                        String frame,
                        Hashtable params)
Moves the browser to a new page in the specified frame.
Parameters:
pagespec - the page to show. This can be:
  • The name of a page in the current database
  • database:page for a page in another database
  • A full URL to a page
frame - the name of the browser frame to switch to the new page. A null value is interpreted as "_self," the current frame.
params - a hashtable containing parameters to pass to all presentations on the specified page.
Returns:
true if the call is successful
Example:
  Hashtable params;
  params = new Hashtable();
  // add useful data to hashtable here
 
  boolean successful;
  successful = agBrowser.showPage("index.html", "right", params);
 

showPage

public boolean showPage(String pagespec,
                        String frame,
                        String query,
                        String orderby,
                        Hashtable params)
Move the browser to a new page in the specified frame.
Parameters:
pagespec - a page-spec for the page. This can be:
  • The name of a page in the current database
  • database:page for a page in another webbase, or
  • A full URL to a page
frame - the name of the browser frame to switch to the new page. A null value is interpreted as "_self," the current frame.
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 all presentations on the specified page
Returns:
true if the call is successful
Usage:
The query specifies a subset of records to display on the page. The orderby specifies the sort order for the records returned by the query. This query string, like all other SilverStream query strings, must:
  • Reference only the fields in the form's current dataset.
  • Be syntactically correct (SilverStream does not check the declaration).

The query is appended (using the AND operator) to any existing queries (Where clauses) on all of the forms that reside on the page. If the target forms contains a call to the query() method, then the query() method overrides any query string passed to the form or page.

Example:
  Hashtable params;
  params = new Hashtable();
  // add useful data to hashtable here
 
  boolean successful;
  successful = agBrowser.showPage("Employees.html", "right",
  	"Employees.salary > 35000", "Employees.lastname asc", params);
 

showStatus

public void showStatus(String message)
Show a status message in the browser's status bar
Parameters:
message - the message to display
Example:
  agBrowser.showStatus(numRecords + " records retrieved");
 

playSound

public boolean playSound(String soundSpec)
Play a sound
Parameters:
soundSpec - the sound to play
Usage:

The soundSpec can be one of the following:

  • The name of the sound in the current database
  • The name of the sound in a different database (using the syntax database:soundName)
  • A full URL
Example:
  boolean successful;
  successful = agBrowser.playSound("ding.au");
 

getApplet

public Applet getApplet()
Get the applet containing the form

getAppletContext

public AppletContext getAppletContext()
Returns the applet context for the SilverStream form.
Usage:

The java.applet.AppletContext is an interface that corresponds to an applet's current environment. Forms running in SilverJRunner do not have an AppletContext.

Example:
  java.applet.AppletContext appletContext;
  appletContext = agBrowser.getAppletContext();
 

SilverStream
Application Server 3.5