[ejabberd] PubSub collection nodes

kael ka-el at laposte.net
Wed Apr 28 17:26:16 MSD 2010


On 04/28/2010 01:08 PM, Ricardo Otero dos Santos wrote:
> Hi,

Hello,

> I was using pubsub collection nodes extensively while on Openfire, but
> now that I've migrated to ejabberd I'm having some headaches. I've
> made some research but can't quite figure out how to do it.
> 
> The plugin I must use is "dag", right?

Yes, like this :

{plugins, ["dag", "pep"]},
{nodetree, "dag"}

> Is collection nodes fully implemented? I read somewhere that it wont
> be supported since is a deferred XEP, is this correct?

It has a basic implementation.

> I've been playing around with configuration but I just can't make it
> work. I get leaf nodes or server errors.

1. Create a 'plays' collection node attached to the (implicit) root
collection node :

<iq type='set' to='pubsub.localhost'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
   <create node='plays'/>
   <configure>
    <x xmlns='jabber:x:data' type='submit'>
     <field var='FORM_TYPE' type='hidden'>
      <value>http://jabber.org/protocol/pubsub#node_config</value>
     </field>
     <field var='pubsub#node_type'><value>collection</value></field>
     <field var='pubsub#collection'><value/></field>
    </x>
   </configure>
  </pubsub>
</iq>


2. Create a 'shakespeare' collection node attached to the 'plays' 
collection node :

<iq type='set' to='pubsub.localhost'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
   <create node='shakespeare'/>
   <configure>
    <x xmlns='jabber:x:data' type='submit'>
     <field var='FORM_TYPE' type='hidden'>
      <value>http://jabber.org/protocol/pubsub#node_config</value>
     </field>
     <field var='pubsub#node_type'><value>collection</value></field>
     <field var='pubsub#collection'><value>plays</value></field>
    </x>
   </configure>
  </pubsub>
</iq>


3. Create a 'macbeth' leaf node attached to the 'shakespeare' collection 
node :

<iq type='set' to='pubsub.localhost'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
   <create node='macbeth'/>
   <configure>
    <x xmlns='jabber:x:data' type='submit'>
     <field var='pubsub#collection'><value>shakespeare</value></field>
    </x>
   </configure>
  </pubsub>
</iq>


-- 
kael



More information about the ejabberd mailing list