telosys.objects
Class ScreenActions

java.lang.Object
  extended bytelosys.objects.ScreenActions

public class ScreenActions
extends java.lang.Object


Constructor Summary
ScreenActions(Screen screen)
          Constructor The default AJAX mode is set to "synchronous"
ScreenActions(Screen screen, boolean flagAsync)
          Constructor with AJAX mode parameter
 
Method Summary
 void clearElementsToRetrieve()
          Clears all elements to retrieve
 void clearParameters()
          Clears all parameters
 void clearViewsToRetrieve()
          Clears all views to retrieve
 ScreenResponse doClear(boolean bUpdateScreen)
          Invokes the standard "CLEAR" action to clear the Screen Context on the server
 ScreenResponse doClose()
          Invokes the standard "CLOSE" action
 ScreenResponse doDelete(boolean bClearScreen, boolean bUpdateScreen)
          Invokes the standard "DELETE" action to delete data on the server
 ScreenResponse doExec(string sProcName, object parameters)
          Executes the given procedure with the given parameters
 ScreenResponse doGet(boolean bUpdateScreen)
          Invokes the standard "GET" action to get data from the server.
 ScreenResponse doGetElements()
          Invokes the standard "GET" action to get data from the server.
 ScreenResponse doGetView(string sViewName, string sRenderer)
          Invokes the standard "GET" action to get data from the server.
 ScreenResponse doGetViews()
          Invokes the standard "GET" action to get data from the server.
 ScreenResponse doInsert(boolean bUpdateScreen)
          Invokes the standard "INSERT" action to insert data on the server
 ScreenResponse doListAdd(string sListName, string sItemName, number iOldIndex, boolean bUpdateScreen)
          Adds the given item on the list
 ScreenResponse doListClear(string sListName, string sItemName, number iOldIndex)
          Clears the given item from the list
 ScreenResponse doListInsert(string sListName, string sItemName, number iOldIndex, number iIndex, boolean bUpdateScreen)
          Inserts the given item on the list
 ScreenResponse doListRemove(string sListName, string sItemName, number iOldIndex, number iIndex, boolean bUpdateScreen)
          Removes the given item from the list
 ScreenResponse doListSelect(string sListName, string sItemName, number iOldIndex, number iIndex, boolean bUpdateScreen)
          Selects the given item of the list
 ScreenResponse doListSort(string sListName, string sItemName, number iOldIndex, string sColumn, string sOrder)
          Sorts a list in the screen context ( VOList or DataSet )
 ScreenResponse doLoad(boolean bUpdateScreen)
          Invokes the standard "LOAD" action to load data from the server.
 ScreenResponse doLoadElements()
          Invokes the standard "LOAD" action to load data from the server.
 ScreenResponse doLoadView(string sViewName, string sRenderer)
          Invokes the standard "LOAD" action to load data from the server.
 ScreenResponse doLoadViews()
          Invokes the standard "LOAD" action to load data from the server.
 void doNotClearContextData()
          No clear when we execute an action
 void doNotGetContextData()
          No get when we execute an action
 void doNotSetContextData()
          No set when we execute an action
 ScreenResponse doOpen()
          Invokes the standard "OPEN" action
 ScreenResponse doSave(boolean bUpdateScreen)
          Invokes the standard "SAVE" action to save data on the server.
 ScreenResponse doSet()
          Invokes the standard "SET" action to update data on the server.
 ScreenResponse doUpdate(boolean bUpdateScreen)
          Invokes the standard "UPDATE" action to update data on the server
protected  ScreenRequest getRequest(string action)
          INTERNAL : Do not use Returns a request with the given action and the parameters to send
 object getScreen()
          Returns the screen instance
protected  void openWindowLastAction(string sURL, string sRequest, string sResponse)
          INTERNAL : Do not use
protected  void populateFields(object oResponse)
          INTERNAL : Do not use Populates the screen fields with XML data received
protected  object sendScreenData(string sAction, function caller, boolean bUpdateScreen)
          INTERNAL : Do not use Sends a request to the server to execute a given action
 void setCallback(function callback)
          Set the callback function (replace the default callback just for once)
 void setDefaultCallback(function callback)
          Set the default callback function ( default callback for all future requests )
 void setDefaultModeAsync()
          Set the default mode to "Asynchronous" ( default mode for all future requests )
 void setDefaultModeSync()
          Set the default mode to "Synchronous" ( default mode for all future requests )
 void setElementsToRetrieve()
          Adds elements to retrieve after receiving the response
 void setElementToRetrieve(string sElementName)
          Adds an element to retrieve after receiving the response
 void setModeAsync()
          Set the mode "Asynchronous" (replace the default mode just for once)
The next AJAX request will be sent in "Asynchronous" mode
 void setModeSync()
          Set the mode "Synchronous" (replace the default mode just for once)
The next AJAX request will be sent in "Synchronous" mode
 void setParameter(string sName, string sValue)
          Sets a parameter
protected  void setTrace(boolean flag)
          Set the trace flag
 void setViewsToRetrieve()
          Adds views to retrieve after receiving the response
 void setViewToRetrieve(string sViewName)
          Define a single view to retrieve (the view renderer is used by default )
 void setViewToRetrieve(string sViewName, string sRenderer)
          Define a single view to retrieve using a specific renderer to generate it
 void showElementsToRetrieve()
          Shows (alert) all elements to retrieve
 void showLastAction()
          Open a window with last action's request and response
 void showParameters()
          Shows (alert) all parameters
 void showViewsToRetrieve()
          Shows (alert) all views to retrieve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScreenActions

public ScreenActions(Screen screen)
Constructor The default AJAX mode is set to "synchronous"

Parameters:
screen - : the screen instance (not null)

ScreenActions

public ScreenActions(Screen screen,
                     boolean flagAsync)
Constructor with AJAX mode parameter

Parameters:
screen - : the screen instance (not null)
flagAsync - : true to set the default mode to "asynchronous"
Method Detail

setTrace

protected void setTrace(boolean flag)
Set the trace flag

Parameters:
flag -

getScreen

public object getScreen()
Returns the screen instance

Returns:
the screen instance

doNotClearContextData

public void doNotClearContextData()
No clear when we execute an action


doNotSetContextData

public void doNotSetContextData()
No set when we execute an action


doNotGetContextData

public void doNotGetContextData()
No get when we execute an action


setParameter

public void setParameter(string sName,
                         string sValue)
Sets a parameter

Parameters:
sName - the parameter name
sValue - the parameter value

clearParameters

public void clearParameters()
Clears all parameters


showParameters

public void showParameters()
Shows (alert) all parameters


setElementToRetrieve

public void setElementToRetrieve(string sElementName)
Adds an element to retrieve after receiving the response

Parameters:
sElementName - the element name

setElementsToRetrieve

public void setElementsToRetrieve()
Adds elements to retrieve after receiving the response


clearElementsToRetrieve

public void clearElementsToRetrieve()
Clears all elements to retrieve


showElementsToRetrieve

public void showElementsToRetrieve()
Shows (alert) all elements to retrieve


setViewToRetrieve

public void setViewToRetrieve(string sViewName)
Define a single view to retrieve (the view renderer is used by default )

Parameters:
sViewName -

setViewToRetrieve

public void setViewToRetrieve(string sViewName,
                              string sRenderer)
Define a single view to retrieve using a specific renderer to generate it

Parameters:
sViewName - the view name
sRenderer - the renderer

setViewsToRetrieve

public void setViewsToRetrieve()
Adds views to retrieve after receiving the response


clearViewsToRetrieve

public void clearViewsToRetrieve()
Clears all views to retrieve


showViewsToRetrieve

public void showViewsToRetrieve()
Shows (alert) all views to retrieve


setDefaultModeAsync

public void setDefaultModeAsync()
Set the default mode to "Asynchronous" ( default mode for all future requests )


setDefaultModeSync

public void setDefaultModeSync()
Set the default mode to "Synchronous" ( default mode for all future requests )


setModeAsync

public void setModeAsync()
Set the mode "Asynchronous" (replace the default mode just for once)
The next AJAX request will be sent in "Asynchronous" mode


setModeSync

public void setModeSync()
Set the mode "Synchronous" (replace the default mode just for once)
The next AJAX request will be sent in "Synchronous" mode


setDefaultCallback

public void setDefaultCallback(function callback)
Set the default callback function ( default callback for all future requests )

Parameters:
callback -

setCallback

public void setCallback(function callback)
Set the callback function (replace the default callback just for once)

Parameters:
callback -

doOpen

public ScreenResponse doOpen()
Invokes the standard "OPEN" action

Returns:
the server response object

doClose

public ScreenResponse doClose()
Invokes the standard "CLOSE" action

Returns:
the server response object

doGet

public ScreenResponse doGet(boolean bUpdateScreen)
Invokes the standard "GET" action to get data from the server. Gets all the Screen Context elements and all the views

Parameters:
bUpdateScreen - true(update the screen) | false(no screen update)
Returns:
the server response object

doGetView

public ScreenResponse doGetView(string sViewName,
                                string sRenderer)
Invokes the standard "GET" action to get data from the server. Gets the given Screen Context view a use the given renderer

Parameters:
sViewName - the view name
sRenderer - the renderer to use
Returns:
the server response object

doGetElements

public ScreenResponse doGetElements()
Invokes the standard "GET" action to get data from the server. Gets all the Screen Context elements

Returns:
the server response object

doGetViews

public ScreenResponse doGetViews()
Invokes the standard "GET" action to get data from the server. Gets all the Screen Context views

Returns:
the server response object

doSet

public ScreenResponse doSet()
Invokes the standard "SET" action to update data on the server. Sets all the Screen Context elements

Returns:
the server response object

doClear

public ScreenResponse doClear(boolean bUpdateScreen)
Invokes the standard "CLEAR" action to clear the Screen Context on the server

Parameters:
bUpdateScreen - true(clear the screen fields) | false(do not clear the screen fields)
Returns:
the server response object

doLoad

public ScreenResponse doLoad(boolean bUpdateScreen)
Invokes the standard "LOAD" action to load data from the server. Loads all the Screen Context elements and all the views

Parameters:
bUpdateScreen - true(update the screen) | false(no screen update)
Returns:
the server response object

doLoadViews

public ScreenResponse doLoadViews()
Invokes the standard "LOAD" action to load data from the server. Loads all the Screen Context views

Returns:
the server response object

doLoadView

public ScreenResponse doLoadView(string sViewName,
                                 string sRenderer)
Invokes the standard "LOAD" action to load data from the server. Loads the given Screen Context view a use the given renderer

Parameters:
sViewName - the view name
sRenderer - the renderer to use
Returns:
the server response object

doLoadElements

public ScreenResponse doLoadElements()
Invokes the standard "LOAD" action to load data from the server. Loads all the Screen Context elements

Returns:
the server response object

populateFields

protected void populateFields(object oResponse)
INTERNAL : Do not use Populates the screen fields with XML data received

Parameters:
oResponse - the server response object

openWindowLastAction

protected void openWindowLastAction(string sURL,
                                    string sRequest,
                                    string sResponse)
INTERNAL : Do not use

Parameters:
sURL -
sRequest -
sResponse -

showLastAction

public void showLastAction()
Open a window with last action's request and response


getRequest

protected ScreenRequest getRequest(string action)
INTERNAL : Do not use Returns a request with the given action and the parameters to send

Parameters:
action -
Returns:

sendScreenData

protected object sendScreenData(string sAction,
                                function caller,
                                boolean bUpdateScreen)
INTERNAL : Do not use Sends a request to the server to execute a given action

Parameters:
sAction - : the action ("save"|"insert"|"update")
caller - : the caller function
bUpdateScreen - : true(update the screen) | false(no screen update)
Returns:
the server response object

doSave

public ScreenResponse doSave(boolean bUpdateScreen)
Invokes the standard "SAVE" action to save data on the server. If data exists, executes a "UPDATE" action else a "INSERT" action

Parameters:
bUpdateScreen - true(update the screen) | false(no screen update)
Returns:
the server response object

doInsert

public ScreenResponse doInsert(boolean bUpdateScreen)
Invokes the standard "INSERT" action to insert data on the server

Parameters:
bUpdateScreen - true(update the screen) | false(no screen update)
Returns:
the server response object

doUpdate

public ScreenResponse doUpdate(boolean bUpdateScreen)
Invokes the standard "UPDATE" action to update data on the server

Parameters:
bUpdateScreen - true(update the screen) | false(no screen update)
Returns:
the server response object

doDelete

public ScreenResponse doDelete(boolean bClearScreen,
                               boolean bUpdateScreen)
Invokes the standard "DELETE" action to delete data on the server

Parameters:
bClearScreen - true(clear the screen) | false(no screen clear)
bUpdateScreen - true(update the screen) | false(no screen update)
Returns:
the server response object

doListSelect

public ScreenResponse doListSelect(string sListName,
                                   string sItemName,
                                   number iOldIndex,
                                   number iIndex,
                                   boolean bUpdateScreen)
Selects the given item of the list

Parameters:
sListName - the list name
sItemName - the item name
iOldIndex - the old index
iIndex - the new index
bUpdateScreen - true(update the screen) | false(no screen update)
Returns:
the server response object

doListInsert

public ScreenResponse doListInsert(string sListName,
                                   string sItemName,
                                   number iOldIndex,
                                   number iIndex,
                                   boolean bUpdateScreen)
Inserts the given item on the list

Parameters:
sListName - the list name
sItemName - the item name
iOldIndex - the old index
iIndex - the new index
bUpdateScreen - true(update the screen) | false(no screen update)
Returns:
the server response object

doListAdd

public ScreenResponse doListAdd(string sListName,
                                string sItemName,
                                number iOldIndex,
                                boolean bUpdateScreen)
Adds the given item on the list

Parameters:
sListName - the list name
sItemName - the item name
iOldIndex - the old index
bUpdateScreen - true(update the screen) | false(no screen update)
Returns:
the server response object

doListRemove

public ScreenResponse doListRemove(string sListName,
                                   string sItemName,
                                   number iOldIndex,
                                   number iIndex,
                                   boolean bUpdateScreen)
Removes the given item from the list

Parameters:
sListName - the list name
sItemName - the item name
iOldIndex - the old index
iIndex - the new index
bUpdateScreen - true(update the screen) | false(no screen update)
Returns:
the server response object

doListClear

public ScreenResponse doListClear(string sListName,
                                  string sItemName,
                                  number iOldIndex)
Clears the given item from the list

Parameters:
sListName - the list name
sItemName - the item name
iOldIndex - the old index
Returns:
the server response object

doListSort

public ScreenResponse doListSort(string sListName,
                                 string sItemName,
                                 number iOldIndex,
                                 string sColumn,
                                 string sOrder)
Sorts a list in the screen context ( VOList or DataSet )

Parameters:
sListName - the symbolic name of the list to sort ( the 'element name' of the list )
sItemName - the name of the list item to update if any ( can be null )
iOldIndex - the index of the list item to update if any ( can be null )
sColumn - the column to use as sort criteria ( VOList : attribute name, DataSet : column number )
sOrder - the sort order : "asc" for ascending order, "desc" for descending order ( can be null : automatic reverse )
Returns:
the server response object

doExec

public ScreenResponse doExec(string sProcName,
                             object parameters)
Executes the given procedure with the given parameters

Parameters:
sProcName - the procedure name
parameters - object
Returns:
the server response object