com.pepper.script
Class Bridge

java.lang.Object
  extended by com.pepper.script.Bridge

public class Bridge
extends Object

This class provides a bridge between javascript and specific functions of a Pepper Package.


Method Summary
 void action(String command)
          the action method performs the requested action if available for this page
 void action(String command, String parameter)
          the action method performs the requested action if available for this page
 void action(String command, String[] actionParams)
          Invokes the specified action for the current program; parameters are passed as a String[].
 String evalXPath(String xPath)
          Return the value of an XPath expression in the current page.
 String findAddresses(String str)
          Return a list of possible address matches in the cache based on the string value passed in.
 String[] getAMPMStrs()
          Return the localized strings for AM + PM.
 MessageCatalog getCatalog()
          Get the MessageCatalog for the program
 int getDaysInMonth(int year, int month)
          Return the number of days in the current month, according to the default Locale's default calendar.
 String getMessage(String key)
          Returns the specified message catalog string.
static Bridge getPackage(String packageID)
          Get the instance of Bridge for the specified package
 String getPackageID()
          Returns the unique ID of the package
 String getPackageTitle()
          Returns the title of the package.
 Object getProperty(String propertyName)
          Get the value of a specific property from the AbstractPepperProgram used by this bridge
 Object getProperty(String propertyName, String param)
          Get the value of a specific property from the AbstractPepperProgram used by this bridge
 Object getProperty(String propertyName, String[] params)
          Get the value of a specific property from the AbstractPepperProgram used by this bridge
 String getSelectedId(String sectionId)
          Calls into program to retrieve page id of the tree selection
 boolean isPad()
          Checks if we are on the pad
 void setModified(String id)
          Manually mark a given Form Element (represented by the passed in Element id attr) as modified so that it's value is saved when the page is auto saved.
 void setSelectedId(String sectionId, String id)
          Calls into program to store page id of the current tree selection
 void status(String message)
          The status method write a message into the Keeper's status area
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPackage

public static Bridge getPackage(String packageID)
Get the instance of Bridge for the specified package

Parameters:
packageID - The packageId to retrieve the Bridge object for
Returns:
a Bridge value

setSelectedId

public void setSelectedId(String sectionId,
                          String id)
Calls into program to store page id of the current tree selection

Parameters:
sectionId - the section id of the current section
id - the page id of the currently selected page

getSelectedId

public String getSelectedId(String sectionId)
Calls into program to retrieve page id of the tree selection

Parameters:
sectionId - a String value
Returns:
a String value

getProperty

public Object getProperty(String propertyName)
Get the value of a specific property from the AbstractPepperProgram used by this bridge

Parameters:
propertyName - The propertyName to look up in the package
Returns:
an Object value

getProperty

public Object getProperty(String propertyName,
                          String param)
Get the value of a specific property from the AbstractPepperProgram used by this bridge

Parameters:
propertyName - The propertyName to look up in the package
param - A String parameter to pass to the getProperty method
Returns:
an Object value

getProperty

public Object getProperty(String propertyName,
                          String[] params)
Get the value of a specific property from the AbstractPepperProgram used by this bridge

Parameters:
propertyName - The propertyName to look up in the package
params - A String[] of arguments to pass to the getProperty method
Returns:
an Object value

getPackageTitle

public String getPackageTitle()
Returns the title of the package.

Returns:
the title of the package.

getPackageID

public String getPackageID()
Returns the unique ID of the package

Returns:
the unique ID of the package

action

public void action(String command)
the action method performs the requested action if available for this page

Parameters:
command - A string matching a defined action

action

public void action(String command,
                   String parameter)
the action method performs the requested action if available for this page

Parameters:
command - A string matching a defined action
parameter - A string parameter for the command

action

public void action(String command,
                   String[] actionParams)
Invokes the specified action for the current program; parameters are passed as a String[].

Parameters:
command - a String instance specifying an action.
actionParams - a String[] instance containing the action's parameters.

isPad

public boolean isPad()
Checks if we are on the pad


status

public void status(String message)
The status method write a message into the Keeper's status area

Parameters:
message - A string to display

getCatalog

public MessageCatalog getCatalog()
Get the MessageCatalog for the program


getMessage

public String getMessage(String key)
Returns the specified message catalog string.

Parameters:
key - a String instance containg a message catalog key.
Returns:
a String instance containing the retrieved message text.

findAddresses

public String findAddresses(String str)
Return a list of possible address matches in the cache based on the string value passed in. Address is formatted for display as HTML.

Parameters:
str - a String value to find matches for
Returns:
a String of possible address matches

evalXPath

public String evalXPath(String xPath)
Return the value of an XPath expression in the current page. If the expression selects more than one node, returns only the first node.


getDaysInMonth

public int getDaysInMonth(int year,
                          int month)
Return the number of days in the current month, according to the default Locale's default calendar. Takes an ActionEventWithParams with the month (1-indexed) and year as parameters.


getAMPMStrs

public String[] getAMPMStrs()
Return the localized strings for AM + PM.


setModified

public void setModified(String id)
Manually mark a given Form Element (represented by the passed in Element id attr) as modified so that it's value is saved when the page is auto saved.

Parameters:
id - The Element id attribute that represents the node
Since:
3.2


Copyright © 2006-2007 Pepper Computer, Inc. All Rights Reserved.