[Standards] PubSub questions: Modification of Items? Combining "configure" forms?

Peter Saint-Andre stpeter at jabber.org
Mon Jan 22 16:55:51 UTC 2007


Nick Parker wrote:
> Hi, I have two questions about PubSub:
> 
> 1) Is there a way to modify the metadata stored in an Item? PubSub 
> (XEP-0060) talks about modifying nodes, but doesn't mention how Items 
> can be directly modified. 

An item is modified by re-publishing it with the same ItemID used to 
publish it in the first place.

> 2) When configuring a Node, can two sets of form data be combined into 
> the same "configure" request, or do they have to be sent separately? I'm 
> assuming separate, but wanted to check for certain. Example of combined 
> forms, with #node_config and #meta-data in the same request:
> 
> <iq type='set'
>    from='juliet at capulet.com/balcony'
>    to='pubsub.shakespeare.lit'
>    id='create3'>
>  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
>    <create node='NODEID'/>
>    <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#collection'><value>juliets_sonnets</value></field>
>        <field var='pubsub#node_type'><value>collection</value></field>
>        <field var='FORM_TYPE' type='hidden'>
>          <value>http://jabber.org/protocol/pubsub#meta-data</value>
>        </field>
>        <field var='pubsub#title'><value>Sonnets</value></field>
>        <field var='pubsub#description'><value>Description</value></field>
>      </x>
>    </configure>
>  </pubsub>
> </iq>

You'd send the two forms like this:

<iq type='set'
    from='juliet at capulet.com/balcony'
    to='pubsub.shakespeare.lit'
    id='create3'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <create node='NODEID'/>
    <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#collection'><value>juliets_sonnets</value></field>
        <field var='pubsub#node_type'><value>collection</value></field>
      </x>
      <x xmlns='jabber:x:data' type='submit'>
        <field var='FORM_TYPE' type='hidden'>
          <value>http://jabber.org/protocol/pubsub#meta-data</value>
        </field>
        <field var='pubsub#title'><value>Sonnets</value></field>
        <field var='pubsub#description'><value>Description</value></field>
      </x>
    </configure>
  </pubsub>
</iq>

However, currently the schemas for the pubsub namespaces forbid 
including more than one x:data form in the <configure/> element. 
Therefore you'd need to send two different IQs, unless we change the 
schemas to allow including more than one data form.

Peter

-- 
Peter Saint-Andre
XMPP Standards Foundation
http://www.xmpp.org/xsf/people/stpeter.shtml

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 7358 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.jabber.org/pipermail/standards/attachments/20070122/20daae52/attachment.bin>


More information about the Standards mailing list