Yahoo Instant Messaging Processor
1. Scope
This processor can send and receive Yahoo Instant Messages (IM) from within a Web
application. To use this processor, you need to create a Yahoo account that will act
as the sender. You can send an IM to any Yahoo subscriber. The processor launches a
customizable pipeline when an IM is received. The IM processor has two mandatory
inputs: session contains login information, and message
contains the message to send. A third input, declared in the
on-message-received element contains the pipeline to be executed when a
message is received. This pipeline must have a data input parameter
containing a document describing the incoming message:
<message> <from>john</from>
<body>Hello!</body>
</message>
2. Config Input
The
config input contains basic information
such as login, password and definition of the pipeline to
execute when an IM is received.
login
|
A Yahoo account, used as the sender of the IM |
password
|
The matching password |
on-message-received
|
- A URL pointing to an XPL pipeline
- An input name, starting with a
#. The IMSerializer must have
the corresponding input declared.
|
3. Data Input
The
data input contains the message to send under
the
message element.
to
|
A Yahoo account to send to message to |
body
|
The body of the message to send |
4. Example
The following code illustrates the instantiation of the
IMSerializer to send a message to the Yahoo account
tove from
jani. Additionally, a
statement is written in the log file when a message is received.
<p:processor name="oxf:im" xmlns:p="
http://www.orbeon.com/oxf/pipeline"
> <p:input name="config"> <session> <login>jani</login>
<password>secret</password>
<on-message-received>#response-pipeline</on-message-received>
</session> </p:input> <p:input name="data"> <message> <to>trove</to>
<body>Don't forget me!</body>
</message> </p:input> <p:input name="response-pipeline"> <p:config> <p:param name="data" type="input"/>
<p:processor name="oxf:null-serializer"> <p:input name="data" href="#data"/>
</p:processor> </p:config> </p:input> </p:processor>