Subject: [Simple] RE: [XCON] "Many users in a single operation" Requirements

From: [email-masked]
Date: Thu, 12 Feb 2004 18:29:36 +0200

[moved to SIMPLE since this is an XCAP issue]

Ok, I see what you mean. XCAP says

   The content of the request MUST be a single XML
   element and associated content (including children elements).

I don't know why that is. Isn't it enough that the URI points to a single XML element? Perhaps Jonathan can comment on why the limitation is in place.

Else, the example I gave has to be modified as follows:

PUT http://xcap.example.com/services/conferences/users/Alice/conference.xml?Conference HTTP/1.1
Content-Type:text/plain

<ACL>
   <ACL-target-URI Access-type="Allowed">sip:[email-masked]</ACL-target-URI>
   <ACL-target-URI Access-type="Allowed">sip:[email-masked]</ACL-target-URI>
   <ACL-target-URI Access-type="Allowed">sip:[email-masked]</ACL-target-URI>
</ACL>

/Hisham

> -----Original Message-----
> From: ext Orit Levin [mailto:[email-masked]]
> Sent: 12.February.2004 18:12
> To: Khartabil Hisham (Nokia-TP-MSW/Helsinki); [email-masked]
> Cc: Jonathan Rosenberg
> Subject: RE: [XCON] "Many users in a single operation" Requirements
> 
> 
> Where is this "XCAP extension" defined in the XCAP documents?!
> 
> Besides, you can't do in the same way REQ-CP-3: It MAY be possible for
> the client to batch multiple operations (such as add a user to ACL
> blocked list, or remove a user from ACL allowed list) into a single
> request that is processed atomically.
> 
> Thanks,
> Orit.
> 
> -----Original Message-----
> From: [email-masked] [mailto:[email-masked]] 
> Sent: Tuesday, February 10, 2004 12:18 AM
> To: Orit Levin; [email-masked]
> Subject: RE: [XCON] "Many users in a single operation" Requirements
> 
> Here is an example of how to add multiple users to an ACL list in a
> single operation:
> 
>       PUT
> http://xcap.example.com/services/conferences/users/Alice/confe
> rence.xml?
>          Conference/ACL/ACL-target-URI HTTP/1.1
>          Content-Type:text/plain
> 
>       <ACL-target-URI
> Access-type="Allowed">sip:[email-masked]</ACL-target-URI>
>       <ACL-target-URI
> Access-type="Allowed">sip:[email-masked]</ACL-target-URI>
>       <ACL-target-URI
> Access-type="Allowed">sip:[email-masked]</ACL-target-URI>
> 
> 
> The rest are done in a similar fashion.
> 
> /Hisham
> > -----Original Message-----
> > From: [email-masked] [mailto:[email-masked]]On 
> Behalf Of ext
> > Orit Levin
> > Sent: 10.February.2004 03:15
> > To: [email-masked]
> > Subject: [XCON] "Many users in a single operation" Requirements
> > 
> > 
> > Hi guys!
> >  
> > There are many places throughout the CPCP-req document that identify
> > operations on a "subset of list" as MUST be performed in a single
> > operation (e.g. G4, G6, H2, and H4).
> > How do you plan to meet these requirements with "XCAP CPCP"?
> >  
> > The same question for REQ-CP-3: It MAY be possible for the client to
> > batch multiple operations (such as add a user to ACL 
> blocked list, or
> > remove a user from ACL allowed list) into a single request that is
> > processed atomically.
> >  
> > Thanks,
> > Orit.
> > 
> > _______________________________________________
> > XCON mailing list
> > [email-masked]
> > https://www1.ietf.org/mailman/listinfo/xcon
> > 
> 

_______________________________________________
Simple mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/simple

---

From: Jonathan Rosenberg <[email-masked]>
Date: Thu, 12 Feb 2004 12:31:21 -0500

Sorry for the delay here...

Orit is right, and as you point out below, you can in fact only add a
single element/subtree at a time.

The reason is that, in order to use http out of the box, we need to keep 
its semantics. That means that things like GET(PUT(URI, body)) == body 
need to be maintained. If you did a get on the  URI below, you would 
retrieve the first entry. Indeed, if you did the original PUT you suggested:

  PUT 
http://xcap.example.com/services/conferences/users/Alice/conference.xml?
          Conference/ACL/ACL-target-URI HTTP/1.1
          Content-Type:text/plain

       <ACL-target-URI 

and there was already an ACL-target-URI in the document, it would be 
REPLACED by what is provided in the body. Thats normal http - if you PUT 
to a URI that identifies an existing resource, it gets replaced.

more inline.

[email-masked] wrote:

> The content of the request MUST be a single XML element and
> associated content (including children elements).
> 
> I don't know why that is. Isn't it enough that the URI points to a
> single XML element? Perhaps Jonathan can comment on why the
> limitation is in place.

See above.

> http://xcap.example.com/services/conferences/users/Alice/conference.xml?Conference
> HTTP/1.1 Content-Type:text/plain
> 
> <ACL> <ACL-target-URI
> Access-type="Allowed">sip:[email-masked]</ACL-target-URI> </ACL>

Yes, this would work. Effectively, since you can only add/replace/delete 
a single element at a time, you need to introduce hierarchy in the XML 
*IF* you want this kind of batching operation. I'll note that, once you 
do the PUT above to add the three entries, you can also do a single 
DELETE to remove that same three, but if you wanted to delete two of the 
three, then you would need to do two separate transactions.

We had discussed this particular limitation quite a bit during the 
design of xcap, and it was deemed an acceptable limitation. If it is no 
longer the case, then we can discuss fixes.

Allowing for deletion of multiple entries at a time is relatively easy. 
Indeed, whether to allow this was an open issue for a time, and we 
simplified to say no. If we allow fuller xpath expressions in the URI, 
you can include, in a DELETE, an xpath expression that selects multiple 
elements. Then, the delete would remove everything that is selected. The 
penalty for this is we need to support much more of xpath, whereas now 
the subset is so small, it is fully defined within xcap itself.

Adding multiple elements could be done the same kind of way - the HTTP 
URI expression would need to be something which (1) selects nothing when 
applied to the current document, (2) selects the contents of the body 
once the elements are added to the document. You can do that by using id 
parameters and other tokens that can be placed as attributes of the xml 
element.

There would still be a limitation that you could not add multiple 
elements at differing points of attachment in the tree; though xpath can 
define such selectors, the insertion operation for this becomes nearly 
impossible to perform, I believe.

Comments?

Thanks,
Jonathan R.
> 
> /Hisham
> 
> 
>> -----Original Message----- From: ext Orit Levin
>> [mailto:[email-masked]] Sent: 12.February.2004 18:12 To:
>> Khartabil Hisham (Nokia-TP-MSW/Helsinki); [email-masked] Cc:
>> Jonathan Rosenberg Subject: RE: [XCON] "Many users in a single
>> operation" Requirements
>> 
>> 
>> Besides, you can't do in the same way REQ-CP-3: It MAY be possible
>> for the client to batch multiple operations (such as add a user to
>> ACL blocked list, or remove a user from ACL allowed list) into a
>> single request that is processed atomically.
>> 
>> Thanks, Orit.
>> 
>> -----Original Message----- From: [email-masked]
>> [mailto:[email-masked]] Sent: Tuesday, February 10,
>> 2004 12:18 AM To: Orit Levin; [email-masked] Subject: RE: [XCON]
>> "Many users in a single operation" Requirements
>> 
>> PUT http://xcap.example.com/services/conferences/users/Alice/confe 
>> rence.xml? Conference/ACL/ACL-target-URI HTTP/1.1 
>> Content-Type:text/plain
>> 
>> <ACL-target-URI 
>>> -----Original Message----- From: [email-masked]
>>> [mailto:[email-masked]]On
>> 
>> Behalf Of ext
>> 
>>> Orit Levin Sent: 10.February.2004 03:15 To: [email-masked] 
>>> There are many places throughout the CPCP-req document that
>>> identify operations on a "subset of list" as MUST be performed in
>>> a single operation (e.g. G4, G6, H2, and H4). How do you plan to
>>> meet these requirements with "XCAP CPCP"?
>>> 
>>> The same question for REQ-CP-3: It MAY be possible for the client
>>> to batch multiple operations (such as add a user to ACL
>> 
>> blocked list, or
>> 
>>> remove a user from ACL allowed list) into a single request that
>>> is processed atomically.
>>> 
>>> Thanks, Orit.
>>> 
>>> _______________________________________________ XCON mailing list
>>>  [email-masked] https://www1.ietf.org/mailman/listinfo/xcon
>>> 
>> 
> 

-- 
Jonathan D. Rosenberg, Ph.D.                600 Lanidex Plaza
Chief Technology Officer                    Parsippany, NJ 07054-2711
dynamicsoft
[email-masked]                     FAX:   (973) 952-5050
http://www.jdrosen.net                      PHONE: (973) 952-5000
http://www.dynamicsoft.com

---

From: Jonathan Rosenberg <[email-masked]>
Date: Thu, 12 Feb 2004 12:31:21 -0500

PUT 

       <ACL-target-URI 

more inline.

See above.

Comments?

Thanks,
Jonathan R.