Subject: RE: [Simple] Update to xcap package

From: [email-masked]
Date: Thu, 26 Feb 2004 14:00:52 +0200

> -----Original Message-----
> From: ext Jonathan Rosenberg [mailto:[email-masked]]
> Sent: 25.February.2004 18:28
> To: Khartabil Hisham (Nokia-TP-MSW/Helsinki)
> Cc: [email-masked]; [email-masked]
> Subject: Re: [Simple] Update to xcap package
> 
> 
> 
> 
> 
> [email-masked] wrote:
> 
> > Jonathan,
> > 
> > Apparently (according to Jari), the current solution in 
> xcap supports
> > this:
> > 
> > we have:
> > 
> > <foo> <bar>a</bar> <bar>b</bar> </foo>
> > 
> > and I do an xcap addition operation:
> > 
> > PUT http://document/foo/bar[3]
> > 
> > <bar>c</bar>
> > 
> > We end up with (c replaces a):
> > 
> > <foo> <bar>a</bar> <bar>b</bar> <bar>c</bar> </foo>
> 
> Correct. c does not replace a; c is added at the end as you 
> have shown.
> XCAP currently allows selection by element name, element position, or
> element filtered by value of an attribute.

Oops, I didn't mean to say c replaces a. A copy paste error, sorry.

> 
> > 
> > This helps. There is the limitation that you can only add an element
> > at the end, otherwise it is a replace. I'm ok with that.
> 
> OK, good. I think its also worth noting in xcap that this is a useful 
> case for doing basic insertion operations. I also make sure 
> to note the 
> importance of designing the schema in a way that makes it 
> efficient with 
> xcap.
> 
> >> So, the question is - what kind of information do we want to allow
> >> xcap to use to uniquely identify an element for deletion, insertion
> >> or creation? Right now, the spec focuses on element names and 
> >> attributes. One would need to design one's schema to make sure that
> >> these existed as unique identifiers. It is easy to add any of the
> >> following:
> >> 
> >> 1. text content 2. names of child elements 3. boolean operators
> >> (i.e., a child exists) 4. existence of attributes
> > 
> > 
> > 1 and 2 at least, not sure about 3 and 4.
> 
> Can you provide some motivating cases for 1 and 2? Is there 
> something in 
> CPCP?

In CPCP, you might need to replace a resource in the ACL, or change its access-type from allowed to blocked. The way XCAP is specified now, as we discussed, you need to know the exact position for the resource you want replace (they don't have unique IDs besides the URI they carry). This might be ok, if we always assume that the client has an exact copy of what is on the server. I.e. The client MUST always know the number of elements present and provide the position where to insert the new element as the last element, and therefore knows the exact position of the element to replace.

If that can't be guaranteed then we need 1 and 2 above for CPCP.

My proposal is:

a. If there is an attribute that uniquely identifies an element, then the client uses that to insert and/or replace.
b. If there is no attribute that uniquely identifies an element, then the client can only insert an element as the last one in a list.

It would also be nice if, for a, the client can indicate the position it wants to insert, for hashing reasons.

/Hisham

> 
> Thanks,
> Jonathan R.
> 
> -- 
> 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
> 

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

---

From: Jonathan Rosenberg <[email-masked]>
Date: Fri, 27 Feb 2004 17:21:41 -0500

inline.

[email-masked] wrote:

> 
>> -----Original Message----- From: ext Jonathan Rosenberg
>> [mailto:[email-masked]] Sent: 25.February.2004 18:28 To:
>> Khartabil Hisham (Nokia-TP-MSW/Helsinki) Cc: [email-masked];
>> [email-masked] Subject: Re: [Simple] Update to xcap package

>> something in CPCP?
> In CPCP, you might need to replace a resource in the ACL, or change
> its access-type from allowed to blocked. The way XCAP is specified
> now, as we discussed, you need to know the exact position for the
> resource you want replace (they don't have unique IDs besides the URI
> they carry). This might be ok, if we always assume that the client
> has an exact copy of what is on the server. I.e. The client MUST
> always know the number of elements present and provide the position
> where to insert the new element as the last element, and therefore
> knows the exact position of the element to replace.

This is really an important assumption to verify or reject.

Things can get a lot easier and more flexible if we can generally assume 
that the client has a copy of the data its modifying, so that it can use 
position to effect insertions and modifications.

If its not possible, then I think we need to insist on unique attributes 
or it just gets really out of hand.

> a. If there is an attribute that uniquely identifies an element, then
> the client uses that to insert and/or replace. b. If there is no
> attribute that uniquely identifies an element, then the client can
> only insert an element as the last one in a list.

In both cases, I think that insertion should take place at the end of 
the list. This vastly simplifies subsequent position based operations on 
the document.

> it wants to insert, for hashing reasons.

This appears hard to do. I was unable to come up with a specific reason 
it would be needed. What do you mean by hashing?

-Jonathan R.