| java.lang.Object nextapp.echo2.webrender.output.XmlDocument nextapp.echo2.webrender.ServerMessage
ServerMessage | public class ServerMessage extends XmlDocument (Code) | | The outgoing XML message which synchronizes the state of the client to that
of the server.
|
Field Summary | |
final public static String | GROUP_ID_INIT Constant for the "init" message part group. | final public static String | GROUP_ID_POSTUPDATE Constant for the "postupdate" message part group. | final public static String | GROUP_ID_PREREMOVE Constant for the "preremove" message part group. | final public static String | GROUP_ID_REMOVE Constant for the "remove" message part group. | final public static String | GROUP_ID_UPDATE Constant for the "update" message part group. | final public static int | LEFT_TO_RIGHT Constant for the use with setRootLayoutDirection()
indicating a left-to-right layout direction. | final public static int | RIGHT_TO_LEFT Constant for the use with setRootLayoutDirection()
indicating a right-to-left layout direction. |
Constructor Summary | |
public | ServerMessage() Creates a new ServerMessage . |
Method Summary | |
public void | addLibrary(String serviceId) Adds a JavaScript library service to be dynamically loaded. | public Element | addPart(String groupId, String processor) Adds a "message-part" to the document that will be processed by the
specified client-side processor object. | public Element | addPartGroup(String groupId) Adds a "group" to the document. | public Element | appendPartDirective(String groupId, String processor, String directiveName) Creates and appends a directive element beneath to a message part.
Attempts to append the directive to an existing message part if the last
message part in the specified group happens to have the same processor as
is specified by the processor argument. | public Element | getItemizedDirective(String groupId, String processor, String directiveName, String[] keyAttributeNames, String[] keyAttributeValues) Creates or retrieves a suitable "Itemized Directive" element. | public Element | getPartGroup(String groupId) Retrieves the "message-part-group" element pertaining to a specific group. | public void | setAsynchronousMonitorInterval(int newValue) Sets the interval between asynchronous requests to the server to check
for server-pushed updates. | public void | setModalContextRootId(String id) Sets the element id of the root of the modal context. | public void | setRootLayoutDirection(int layoutDirection) Sets the root layout direction of the application, i.e., either
LEFT_TO_RIGHT or RIGHT_TO_LEFT . | public void | setTransactionId(long transactionId) Sets the numeric identifier for this transaction, which will be returned
in next client message. |
GROUP_ID_INIT | final public static String GROUP_ID_INIT(Code) | | Constant for the "init" message part group. Message parts in this group are
processed before the "preremove", "remove" "update", and "postupdate"
groups.
|
GROUP_ID_POSTUPDATE | final public static String GROUP_ID_POSTUPDATE(Code) | | Constant for the "postupdate" message part group. Message parts in this
group are processed after the "init", "preremove", "remove" and "update"
groups.
|
GROUP_ID_PREREMOVE | final public static String GROUP_ID_PREREMOVE(Code) | | Constant for the "preremove" message part group. Message parts in this group
are processed after the "init" group. Message parts in this group are
processed before the "remove", "update" and "postupdate" groups.
|
GROUP_ID_REMOVE | final public static String GROUP_ID_REMOVE(Code) | | Constant for the "remove" message part group. Message parts in this group
are processed after the "init" and "preremove" groups. Message parts in
this group are processed before the "update" and "postupdate" groups.
This group is used for removing elements from the DOM.
|
GROUP_ID_UPDATE | final public static String GROUP_ID_UPDATE(Code) | | Constant for the "update" message part group. Message parts in this group
are processed after the "init", "preremove" and "remove" groups.
Message parts in this group are processed before the "postupdate" group.
This group is used for adding elements to the DOM.
|
LEFT_TO_RIGHT | final public static int LEFT_TO_RIGHT(Code) | | Constant for the use with setRootLayoutDirection()
indicating a left-to-right layout direction.
|
RIGHT_TO_LEFT | final public static int RIGHT_TO_LEFT(Code) | | Constant for the use with setRootLayoutDirection()
indicating a right-to-left layout direction.
|
ServerMessage | public ServerMessage()(Code) | | Creates a new ServerMessage .
|
addLibrary | public void addLibrary(String serviceId)(Code) | | Adds a JavaScript library service to be dynamically loaded.
Parameters: serviceId - the id of the service to load (the service must returnJavaScript code with content-type "text/javascript") |
addPart | public Element addPart(String groupId, String processor)(Code) | | Adds a "message-part" to the document that will be processed by the
specified client-side processor object.
Parameters: groupId - the id of the group to which the "message-part" elementshould be added Parameters: processor - the name of the client-side processor object which willprocess the message part, e.g., "EchoEventUpdate", or"EchoDomUpdate" the created "message-part" element |
addPartGroup | public Element addPartGroup(String groupId)(Code) | | Adds a "group" to the document. Part groups enable certain groups of
operations, e.g., remove operations, to be performed before others, e.g.,
add operations.
Parameters: groupId - the identifier of the group the created "message-part-group" element. |
appendPartDirective | public Element appendPartDirective(String groupId, String processor, String directiveName)(Code) | | Creates and appends a directive element beneath to a message part.
Attempts to append the directive to an existing message part if the last
message part in the specified group happens to have the same processor as
is specified by the processor argument. If this is not
possible, a new "message-part" element is created and the directive is
added to it.
Parameters: groupId - Parameters: processor - the name of the client-side processor object which willprocess the message part, e.g., "EchoEventUpdate", or"EchoDomUpdate" Parameters: directiveName - the name of the directive, e.g., "event-add" or"dom-remove". the directive element |
getItemizedDirective | public Element getItemizedDirective(String groupId, String processor, String directiveName, String[] keyAttributeNames, String[] keyAttributeValues)(Code) | | Creates or retrieves a suitable "Itemized Directive" element. Itemized
Directives may be used to create more bandwidth-efficient ServerMessage
output in cases where a particular operation may need to be performed on
a significant number of targets. In the case that the directive must be
created, it will be added to the message. Repeated invocations of this
method with equivalent values of all parameters will result in the same
directive being returned each time.
This method should only be used for adding directives to the
GROUP_ID_PREREMOVE and GROUP_ID_POSTUPDATE
groups as itemized directives will not be executed in-order, which
will cause problems if they are used for to manipulate the DOM.
Parameters: groupId - the identifier of the target message part group,either GROUP_ID_PREREMOVE or GROUP_ID_POSTUPDATE Parameters: processor - the name of the client-side processor object which willprocess the message part containing the directive, e.g.,"EchoEventUpdate", or "EchoDomUpdate" Parameters: directiveName - the name of the directive, e.g., "event-add" or"dom-remove" Parameters: keyAttributeNames - the names of the key attributes Parameters: keyAttributeValues - the values of the key attributes the created/retrieved directive element |
getPartGroup | public Element getPartGroup(String groupId)(Code) | | Retrieves the "message-part-group" element pertaining to a specific group.
Parameters: groupId - the id of the group the "message-part-group" element |
setAsynchronousMonitorInterval | public void setAsynchronousMonitorInterval(int newValue)(Code) | | Sets the interval between asynchronous requests to the server to check
for server-pushed updates.
Parameters: newValue - the new interval in milliseconds (a negative value willdisable asynchronous requests) |
setModalContextRootId | public void setModalContextRootId(String id)(Code) | | Sets the element id of the root of the modal context. Only elements
within the modal context will be enabled. A id value of
null will disable the modal context, thus allowing ALL elements to be
enabled.
Parameters: id - the root element id of the modal context |
setRootLayoutDirection | public void setRootLayoutDirection(int layoutDirection)(Code) | | Sets the root layout direction of the application, i.e., either
LEFT_TO_RIGHT or RIGHT_TO_LEFT .
Parameters: layoutDirection - the new layout direction |
setTransactionId | public void setTransactionId(long transactionId)(Code) | | Sets the numeric identifier for this transaction, which will be returned
in next client message.
Parameters: transactionId - the transaction identifier |
|
|