HTMLObject::WAP(3)

NAME
HTMLObject::WAP - Perl extension for HTMLObject.

SYNOPSIS
  use HTMLObject::WAP;
  my $doc = HTMLObject::WAP->new(type => "WML",
            version => "1.1", language => "en",
            charsetEncoding => "");

  $doc->createDeck(id => "hello");
  $doc->createCard(id => "card1");
  $doc->print(<<"END_OF_BODY");
  <p>
  HTMLObject::WAP<br/>
  This is cool!<br/>
  </p>
  END_OF_BODY

  $doc->setCookie(name => 'testing', value => 'WML 1.1');

  # Actually generate the entire document, cookie and all!
  $doc->display();

DESCRIPTION
HTMLObject::WAP provides the Base methods needed to create a generic WAP document dynamically. See documentation.html for complete details. It supports Internationalization.

Exported FUNCTIONS
  scalar new(type, version, language, charsetEncoding)
    Creates a new instance of the HTMLObject::WAP document type.
    type = (WML or HDML) - the type of document to create
    version = (1.1 or 3 - the version of WML or HDML to use)

  void reset(type, version, language, charsetEncoding)
    Resets the HTMLObject::WAP document back to the defaults.

  void setErrorMessage(code => '', message => '')
    This adds the error message associated with code to the
    errorMessages hash. Modifies %errorMessages.

  void clearErrorMessage(code => '')
    This removes the message associated with code from the
    errorMessages hash. Modifies %errorMessages.

  void setError(code => '')
    This takes the code and sets $error=1, $errorCode = $code. This is a
    helper function for the derived classes to use to signal when an
    error has occurred. Modifies $error and $errorCode.

  scalar didErrorOccur()
    Returns 1 if an error occurred, 0 otherwise.

  scalar getErrorMessage()
    Returns the message that was generated via the code that was set.

  scalar getErrorCode()
    Returns the code that was set to indicate the error that occurred.

  void doRequiredParameterError(title => '', message => '')
    Creates an Error document using the customized title to display the
    error of Required Parameter missing. The specified message is also
    included in the body so that the program can notify the user of what
    variable is missing. Uses displayError() to generate the Error
    document.

  int createDeck(name, url)
    creates the deck named name in the decks hash and stores the url
    given for use in digest mode.  The url is not needed unless you
    are creating more than 1 deck.

  int createCard(id, ...)
    calls the currently selected deck's createCard method passing
    in all parameters passed into itself.

  void display()
    This function generates the WAP Document displaying any cookies,
    plus the contents of the Body that the user created.  This function
    prints the generated document to standard out which is then hopefully
    being sent to a web server to process.

  void displayError(title => '', message => '')
    Creates a HTML document that displays the user specified error
    message along with the error message generated by the program. The
    user specified title is used also. The program is exited after the
    document is displayed. Uses display() to generate the actual document.

  scalar encodeString(string => '')
    URI encodes the string and returns the result.

  scalar formEncodeString(string => '')
    encode the string to replace all HTML special characters with their
    tag equivalents.  Ex.  & => &amp;

  void setCookie(name => '', value => '', expires => '', path => '',
                  domain => '', secure => '')
    Creates an entry in the cookies array that specifies the name=value
    pair and the expiration date and if it is to be secure for the
    specified cookie.  If secure is defined then it is included in the
    Set-Cookie line, else it is left out. The value does not matter as it
    is a tag in the Set-Cookie line and not a name=value item. Modifies
    @cookies.

    Valid formats for the expiration date are:
             Weekday, dd-Mon-yyyy hh:mm:ss GMT
    Valid formats for the domain are:
             The domain must be within the current domain and must have
             2 or more periods depending on the type of domain.
             Ex. ".host.com"

  void setCompressedCookie(name => '', cookies => [name, value],
                             expires => '', path => '', domain => '',
                             secure => '')
    Creates an entry in the cookies array that specifes the name=value
    pair where the value is the embedded cookies to be stored in this
    cookie. The embedded cookies are seperated with a :: but other than
    that everything else is the same as setCookie. The cookies hash
    entry is pointing to an array where each entry is another array with
    the first entry being the name and the second entry the value for
    each embedded cookie. Modifies @cookies.

  scalar setFocus(section) (scalar value)
    Calls the current deck's setFocus method to signal which card to
    work with.  Returns the previously selected card.  If nothing
    passed in, then just returns the currently selected card.

  scalar setCardFocus(location) (scalar value)
    Calls the current deck's setCardFocus method to signal the current
    card to set it's focus to the specified location and then return
    the previous location.  If nothing is passed in just returns the
    current location.

  void print(string) (scalar value)
    Appends the contents of string to the currently specified section.
    This could modify $head_string or $body_string.

  void printHead(string) (scalar value)
    Appends the contents of string to the currently specified WML Decks
    head section. This modifies $head.

  void printTemplate(string) (scalar value)
    Appends the contents of string to the currently specified WML Decks
    template section.  This modifies $template.

AUTHOR
James A. Pattie, htmlobject@pcxperience.com

SEE ALSO
perl(1), HTMLObject::Base(3), HTMLObject::Normal(3), HTMLObject::FrameSet(3), HTMLObject::ReadCookie(3).