public class RAPPCallHost extends RAPPAction
The information for the current screen is:
The reply value for the action is stored in a RAPPHostScreen class instance.
Field information can be retrieved using the getField action. The operation to get information is:
The information for each host cell is:
The reply value for the action is stored in a RAPPHostCell or RAPPHostCells class instance, depending of the requested information.
Note: When getting a single host field with the option
"*" or when requesting all fields on a screen, continued fields
as defined in Phantom are returned as separate host cells. In other
words, if you need to retrieve the contents of a continued field
as just one string, you have to call the constructor as
RAPPCallHost(screenName,fieldName)
. Then the contents
of the field is returned by the method
getField().getValue()
of this class.
Request the entire screen with the data, all host fields available, all host fields that has a name beginning with "COL", a column of a host field (list-type) and last an entire host field.
RAPPTransaction trans=new RAPPTransaction(); RAPPCallHost screen=new RAPPCallHost(true); trans.addAction(screen); RAPPCallHost all=new RAPPCallHost("CUSTLIST","*"); trans.addAction(all); RAPPCallHost col=new RAPPCallHost("CUSTLIST","COL*"); trans.addAction(col); RAPPCallHost msg=new RAPPCallHost("CUSTLIST","MSG"); trans.addAction(msg); RAPPCallHost col1=new RAPPCallHost("CUSTLIST","COL1",1); trans.addAction(col1);
getField()
,
getFields()
,
getScreen()
,
RAPPHostScreen
,
RAPPHostCell
,
RAPPHostCells
Modifier and Type | Field and Description |
---|---|
static int |
GET_FIELD
The getField request action.
|
static int |
GET_SCREEN
The getScreen request action.
|
ACTION_CALL_CLASS, ACTION_CALL_HOST, ACTION_CALL_OBJECT, ACTION_CALL_PANEL, ACTION_GLOB_VAR, ERROR_CALL_CLASS_RUN_ACTION, ERROR_CONTROL_ID_NOT_FOUND, ERROR_GLOB_VAR_NOT_FOUND, ERROR_HOST_FIELD_NOT_FOUND, ERROR_HOST_SESSION_NOT_CONNECTED, ERROR_INSTANCIATING_CALLED_CLASS, ERROR_INTERFACE_NOT_FOUND, ERROR_NOT_CURRENT_HOST_SCREEN, ERROR_OBJECT_NOT_FOUND, ERROR_UNEXPECTED_RETURN_STRING, errorCode, errorDescription
Modifier | Constructor and Description |
---|---|
protected |
RAPPCallHost()
Creates an empty request of callHost.
|
|
RAPPCallHost(boolean doGetScreenContents)
Creates a request to get the current host screen with or without
screen contents depending on the flag
doGetScreenContents . |
|
RAPPCallHost(String screen)
Creates a request to get all fields from the current host screen.
|
|
RAPPCallHost(String screen,
String field)
Creates a request to get a field from the current host screen.
|
|
RAPPCallHost(String screen,
String field,
int index)
Creates a request to get a field index from the current host screen.
|
Modifier and Type | Method and Description |
---|---|
boolean |
doGetScreenContents()
For getScreen, gets the flag indicating that the screen
contents is required.
|
int |
getAction()
Gets the request action.
|
String |
getActionClass()
Always returns "callHost".
|
int |
getActionType()
Gets the type of action for this class.
|
String |
getComment()
Comment for action class tag when serialized from a request
the first time.
|
RAPPHostCell |
getField()
Use this method to get the reply from a getField request.
|
String |
getFieldName()
For getField, gets the name of the field, null if not yet set.
|
RAPPHostCells |
getFields()
Use this method to get the reply from a getField request.
|
int |
getIndex()
For getField, gets the index number of the requested field.
|
RAPPNameSpaceItem |
getNameSpaceItem()
Gets the namespace item for this action.
|
RAPPHostScreen |
getScreen()
Use this method to get the reply from a getScreen request.
|
String |
getScreenName()
For getField, gets the name of the screen, null if not yet set.
|
String |
getStatus()
Gets the status text of the host.
|
boolean |
hasError()
Gets the flag indicating that the host was in error state at the time
the operation was performed.
|
boolean |
isLocked()
Gets the flag indicating that the host was locked at the time
the operation was performed.
|
String |
paramString()
Gets the parameter string for this class for testing purposes.
|
void |
serializeFromReply(RAPPElement reply)
Initializes the action class instance from a reply element.
|
void |
serializeFromRequest(RAPPElement request)
Initializes the action class instance from a request element.
|
void |
serializeToReply(RAPPElement reply)
Initializes the reply Element with all attributes.
|
void |
serializeToRequest(RAPPElement request)
Initializes the request Element with all attributes.
|
void |
setReply(boolean isLocked,
boolean hasError,
String status)
Sets the reply common for all requests.
|
void |
setReply(RAPPHostCell cell)
Sets the reply for a getField.
|
void |
setReply(RAPPHostCells cells)
Sets the reply for a getField where the reply contains more than
one field.
|
void |
setReply(RAPPHostScreen screen)
Sets the reply for a getScreen.
|
appendReplyElement, appendReplyElement, appendRequestElement, getClass, getErrorCode, getErrorDescription, initialize, removeAllElements, setError, toString, updateReplyFromDocument
public static final int GET_SCREEN
public static final int GET_FIELD
protected RAPPCallHost()
public RAPPCallHost(boolean doGetScreenContents)
doGetScreenContents
.
Use the method getScreen
to get the reply.
getScreen()
public RAPPCallHost(String screen)
Use the method getFields
to get the data from
the reply.
screen
- the name of the current screen. If the screen doesn't
match the current host screen, an error will be
returned.getScreen()
public RAPPCallHost(String screen, String field)
Use the method getFields
to get the data from
the reply.
screen
- the name of the current screen. If the screen doesn't
match the current host screen, an error will be
returned.field
- the name of the requested field or "*" for all fields.getScreen()
public RAPPCallHost(String screen, String field, int index)
Use the method getField
or getFields
to get the data from the reply.
screen
- the name of the current screen. If the screen doesn't
match the current host screen, an error will be
returned.field
- the name of the requested field or "*" for all fields.index
- the index of the requested field when field
specifies a unique field name.
The index can be -2 for all cells in a field of
"list-type" or the index of the cell in the list.
When the index is -1 the entire host field is
requested (only valid when field != "*").getScreen()
public RAPPNameSpaceItem getNameSpaceItem()
getNameSpaceItem
in class RAPPAction
public boolean isLocked()
public boolean hasError()
public String getStatus()
public int getAction()
GET_SCREEN = 1 GET_FIELD = 2
public boolean doGetScreenContents()
public String getScreenName()
public String getFieldName()
public int getIndex()
public int getActionType()
getActionType
in class RAPPAction
public String getActionClass()
getActionClass
in class RAPPAction
public void setReply(boolean isLocked, boolean hasError, String status)
public void setReply(RAPPHostScreen screen)
public void setReply(RAPPHostCell cell)
public void setReply(RAPPHostCells cells)
public RAPPHostScreen getScreen()
null
if the request is not yet available
or the request was a getField.public RAPPHostCell getField()
null
if the request is not yet available
or the request was a getScreen. It is
also null if the request had "index=*" (-2)
or "field=*".public RAPPHostCells getFields()
null
if the request is not yet available
or the request was a getScreen. It is
also null if the request had "index=*" (-2)
or "field=*".public String getComment()
getComment
in class RAPPAction
public void serializeToRequest(RAPPElement request)
The XML for the node looks like (replace parenthesis with less-more-than signs) for getScreen:
(action actionClass="callHost"/) (callHostRequest action="getScreen" getContents={"true" | "false"} /) (/action)or for getField:
(action actionClass="callHost"/) (callHostRequest action="getField" screen="LOGIN" field ={"USERID" | "*"} [ index ={"nn" | "*" } ] /) (/action)
serializeToRequest
in class RAPPAction
public void serializeFromRequest(RAPPElement request) throws SAXException
serializeFromRequest
in class RAPPAction
SAXException
- for errors in the document.public void serializeToReply(RAPPElement reply)
For the XML reply, see the classes RAPPHostCell, RAPPHostCells and RAPPHostScreen.
serializeToReply
in class RAPPAction
public void serializeFromReply(RAPPElement reply) throws SAXException
serializeFromReply
in class RAPPAction
SAXException
- for errors in the document.public String paramString()
paramString
in class RAPPAction
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.