Concept allow to paging messages to sent via a jabber server.
Format of HTML message is:<body>...</body>
Example:<body>Hello it is a <b>test</b>.</body>
This example connect to jabber Server with specified 'userID' and 'passwd'
and sent 'message' message to 'send_to_user', until waiting for response.
define jabberTest [
static : main ( $arg typeof Series ) [
$instance typeof jabberTest
$jabber = JabberClient.create("jabber.org", 5222)
$jabber.addHandler( $instance, "showMessage")
$jabber.login("userID", "passwd")
$jabber.send("send_to_user", "message")
print "Waiting for response ..."
while( $jabber/response@length $lt; 100 ) do [
]
]
: showMessage( $inst typeof JabberClient, $e typeof Element ) [
print "Reply:" + $e.toXML
]
]
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getConceptsAtPath, getErrorHandler, getInheritedConcepts, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML |
|
Label: | response |
Type: | Series |
Is Static: | false |
Is Hidden: | false |
Show Empty: | true |
Contains the series of the responses that you get from the server.
Parameters: |
$host : |
The name of the jabber server to connect to.
|
$port : |
The port of the jabber server to connect to.
|
|
Method to set up the jabber server host and port.
Parameters: |
$user : |
The username to log into jabber server with.
|
$pwd : |
The password to log into jabber server with.
|
|
Exceptions: |
connectionFailed :
(Error) | Connection refuzed by Jabber server. |
Method to log into Jabber server.
This method established connection to jabber server.
Parameters: |
$to : |
The user to send the message to.
|
$message : |
The text message to send.
|
$html : |
The html message to send.
|
|
Exceptions: |
recipientMissing :
(Warning) | No recipient has been specified. |
messageMissing :
(Warning) | No message text has been specified. |
connectionFailed :
(Error) | Connection refuzed by Jabber server. |
Method to send to specified user the specified message.
Parameters: |
$to : |
The user to send the message to.
|
$message : |
The text message to send.
|
|
Exceptions: |
recipientMissing :
(Warning) | No recipient has been specified. |
messageMissing :
(Warning) | No message text has been specified. |
connectionFailed :
(Error) | Connection refuzed by Jabber server. |
Method to send to specified user the specified message.
Parameters: |
$concept : | Instance of current concept. |
$methodName : | The handler method name that will be called when JabberClient receive a message. |
|
Adds a handler to this JabberClient.
Singature of handler method is :
methodName( $inst typeof JabberClient, $e typeof Element ), where
- $inst : instance of current concept
- $e : XML document that will be showed.