Passage Server Java API

All Classes

WServer

Constructor
  Not available. Object is created by the system.
Methods
WFile newFile()
Creates new object.

Returns:
WFile object
WMail newMail()
Creates new object.

Returns:
WMail object
WParamList newParamList()
Creates new object.

Returns:
WParamList object
WTable newTable()
Creates new object.

Returns:
WTable object
WTableList newTableList()
Creates new object.

Returns:
WTableList object
WTableList request(String name, WParamList oParamList)
Runs Request with specified name and parameters, and puts result data into the table list.

Parameters:
name - the request name
oParamList - the request parameter list

Returns:
WTableList object
int setPage(String page)
Sets the name of html file. The file is a html template, has data tags, which are replaced by the server with a business logic data. After tag replacement the content is sent to a browser as http message body.

Parameters:
page - the html file name [".html" is not required]

Returns:
0 if the page is set successfully; -1 otherwise

Example:
setPage("mypage");
String getPage(WTableList oTableList, String page)
Gets the content of html file. The file is a html template, has data tags, which are replaced by the server with data from oTableList. The content can be used for email html message or pdf generation.

Parameters:
oTableList - list of tables with data
page - the html file name [".html" is not required]

Returns:
html page

Example:
getPage("mypage");
int login(String userName)
Used for creating and keeping a session on the server side.
Compares the userName with assigned userName for private Requests,
and if matching, creates a new login session and cookie "jsessionid".

Parameters:
userName - the user name

Returns:
0 if login is successfull; -1 otherwise

Example:
login("myusername");
void logout()
Deletes login session and cookie "jsessionid".

Example:
logout();
void setCookie(String name, String value)
Creates cookie name=value.

Parameters:
name - the cookie name
value - the cookie value

Example:
setCookie("mycookie","123"); // creates cookie mycookie=123
String getCookie(String name)
If cookie with specified name exists, returns the cookie value, otherwise returns empty String.

Parameters:
name - the cookie name

Example:
mystr = getCookie("mycookie"); // returns value of cookie with name mycookie
void setVar(String name, String value)
Creates the variable that can be used by private Requests within the session.

Parameters:
name - the variable name
value - the variable value

Example:
setVar("myvar","123");
String getVar(String name)
If variable with this name exists, returns the variable value, created within the session by private Requests.

Parameters:
name - the variable name

Returns:
a String that represents the variable value
an empty String if variable with this name does not exist

Example:
getVar("myvar"); // returns 123
void trace(String text)
Puts the text in the server log file ws_app.log

Parameters:
text - the trace text

Example:
trace("my trace message...");
Example
  api_WServer.java


PASSAGE
Internet Software Development
www.canadianpassage.com

© PASSAGE