[jdev] Re: Jabber as a development platform

Magnus Henoch mange at freemail.hu
Sun Apr 11 12:42:51 CDT 2004


Faber Fedor <faber at linuxnj.com> writes:

> Here's the scenario:  Jabber server is installed on a linux box, Jabber
> clients on Win2K boxen.  User A sends an IM to User B that reads " B, be
> sure to call Faber today".  The Jabber server gets the messages, adds it
> to a MySQL Database retrieving the unique ID, and sends a modified
> messages of ""B, be sure to call Faber today. _Done_ _Delegated_
> _Canceled_" where "_Done_ _Delegated_ _Canceled_" are three hyperlinks.
> Clicking on the hyperlinks will execute some CGI or something on the
> server (using the unique ID from the database), marking the task as
> done, delegated or canceled.

The previous version of JEP-0004 (latest is at
http://www.jabber.org/jeps/jep-0004.html) had an example very similar
to what you want to do.  It was something like this:  (actual mascot
choices were different)

<message from='a at example.com/foo' to='b at example.com/bar' thread='unique_id'>
  <x xmlns='jabber:x:data' type='form'>
    <title>Mascot choice poll</title>
    <instructions>Please state your opinion on this matter.</instructions>
    <field var='opinion' type='list-single' label='Preferred mascot'>
      <option label='Anxious Ape'><value>aa</value></option>
      <option label='Bobbing Baboon'><value>bb</value></option>
      <option label='Charging Chimp'><value>cc</value></option>
      <option label='Drunken Monkey'><value>dm</value></option>
      <option label='Grumpy Gibbon'><value>gg</value></option>
    </field>
  </x>
  <body>If you can read this, your client doesn't support
  JEP-0004.</body>
</message>

That message would present a five-choice form to the recipient.
Answers would, however, go to the sender, not to some central
database.

An option would be to write a component.  Person A sends to the
component the text of the message and the JID of person B, and
the component forwards the message with appropriate buttons added to
person B, and keeps track of responses in a database.  Such a thing
wouldn't be very difficult to write, I believe.  (I have never written
a component myself, though, so I might be underestimating it)

Regards,
Magnus



More information about the JDev mailing list