You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Gianugo Rabellino <gi...@apache.org> on 2004/01/28 13:14:36 UTC

WebDAV client and ordered results

I don't know if/how this has been discussed before (from a quick search 
doesn't look like it has), but there is an issue in the SWCL which is 
bugging us quite a bit and that I need to sort out somehow.

The current DASL basicsearch spec allow for ordered result via the 
pseudo-sql <dav:orderby> clause. The current implementation of 
SearchMethod, though, extends XMLResponseBase which puts the results 
into an Hashtable, thus losing the order in which resources were 
presented by the server.

The fix is not a big deal but (be it commons-collections based - IMO 
preferrable - or tied to JDK 1.4's Linked stuff), but before delving 
into it myself and providing a patch, I wanted to make sure that I'm not 
seriously overlooking something (I would then happily wear my dumbass 
hat) and, in that case, that it would be a welcome addition before the 
next release. Comments?

-- 
Gianugo Rabellino
Pro-netics s.r.l. -  http://www.pro-netics.com
Orixo, the XML business alliance - http://www.orixo.com
     (Blogging at: http://www.rabellino.it/blog/)

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


Re: WebDAV client and ordered results

Posted by Gianugo Rabellino <gi...@apache.org>.
Ingo Brunberg wrote:

>>I agree that the commens-collections solution is preferable as JDK 1.3
>>is still "supported" AFAIK.
> 
> 
> There seems to be a consensus to utilize commons-collections, so I
> will comply, as it really doesn't matter for me. But what is meant by
> JDK 1.4's Linked stuff? If you refer to LinkedList, that's even
> present in JDK 1.2.

JDK 1.4 has a LinkedHashMap that allows you to pull keys in insertion 
order. Unfortunately it doesn't really apply here, as the SWCL is using 
the depracated Dictionary/Enumeration approach instead of Collection's 
Map/Iterator one. I would suggest to leave that untouched for now, but 
most probably some refactoring could be helpful in the near future.

Ciao,

-- 
Gianugo Rabellino
Pro-netics s.r.l. -  http://www.pro-netics.com
Orixo, the XML business alliance - http://www.orixo.com
     (Blogging at: http://www.rabellino.it/blog/)

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


Re: WebDAV client and ordered results

Posted by Ingo Brunberg <ib...@fiz-chemie.de>.
> Gianugo Rabellino wrote:
> > I don't know if/how this has been discussed before (from a quick
> > search doesn't look like it has), but there is an issue in the SWCL
> > which is bugging us quite a bit and that I need to sort out somehow.
> >
> > The current DASL basicsearch spec allow for ordered result via the
> > pseudo-sql <dav:orderby> clause. The current implementation of
> > SearchMethod, though, extends XMLResponseBase which puts the results
> > into an Hashtable, thus losing the order in which resources were
> > presented by the server.
> >
> > The fix is not a big deal but (be it commons-collections based - IMO
> > preferrable - or tied to JDK 1.4's Linked stuff), but before delving
> > into it myself and providing a patch, I wanted to make sure that I'm
> > not seriously overlooking something (I would then happily wear my
> > dumbass hat) and, in that case, that it would be a welcome addition
> > before the next release. Comments?
> 
> +1
> 
> That would be a nice contribution we would need for our project as well!
> 
> I'm sure Martin (Dulisch) will apply the patch as soon he has been
> granted karma for CVS :-)
> 
> I agree that the commens-collections solution is preferable as JDK 1.3
> is still "supported" AFAIK.

There seems to be a consensus to utilize commons-collections, so I
will comply, as it really doesn't matter for me. But what is meant by
JDK 1.4's Linked stuff? If you refer to LinkedList, that's even
present in JDK 1.2.

Regards,
Ingo


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


Re: WebDAV client and ordered results

Posted by Martin Holz <ho...@fiz-chemie.de>.
"Guido Casper" <gc...@s-und-n.de> writes:
> 
> I agree that the commens-collections solution is preferable as JDK 1.3
> is still "supported" AFAIK.

And commons-collections is already used by the server.

Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


Re: WebDAV client and ordered results

Posted by Guido Casper <gc...@s-und-n.de>.
Gianugo Rabellino wrote:
> I don't know if/how this has been discussed before (from a quick
> search doesn't look like it has), but there is an issue in the SWCL
> which is bugging us quite a bit and that I need to sort out somehow.
>
> The current DASL basicsearch spec allow for ordered result via the
> pseudo-sql <dav:orderby> clause. The current implementation of
> SearchMethod, though, extends XMLResponseBase which puts the results
> into an Hashtable, thus losing the order in which resources were
> presented by the server.
>
> The fix is not a big deal but (be it commons-collections based - IMO
> preferrable - or tied to JDK 1.4's Linked stuff), but before delving
> into it myself and providing a patch, I wanted to make sure that I'm
> not seriously overlooking something (I would then happily wear my
> dumbass hat) and, in that case, that it would be a welcome addition
> before the next release. Comments?

+1

That would be a nice contribution we would need for our project as well!

I'm sure Martin (Dulisch) will apply the patch as soon he has been
granted karma for CVS :-)

I agree that the commens-collections solution is preferable as JDK 1.3
is still "supported" AFAIK.

Guido


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


Re: WebDAV client and ordered results

Posted by Gianugo Rabellino <gi...@apache.org>.
Ingo Brunberg wrote:
> You are absolutely right. This issue has not been addressed before.
> 
> I'll happily accept a patch against the current implementation of
> SearchMethod. But I would feel more comfortable if you'd not introduce
> a new dependency on commons-collections.

Considering that it would require commons-collection just for a simple 
class, yes, this does make sense. This requires, though, some more code 
to maintain on the Slide side, since I'll have to implement a workaround 
  based on a LinkedList that keeps the order. Not a big deal, but still 
somehow reinventing wheels.

One point that might deserve discussion is whether all methods should 
return results in the order they received it from the WebDAV server. I'm 
all for it, since there might be a reason for the server to return 
results in a given order, and losing it could be an issue sometimes.

Besides, even the use of Hashtable in the API themselves could be worth 
a thought since it's way to much tied to a specific and deprecated 
implementation. But I'm not sure that changing the API to return a Map 
is good from a backward-compatible POV.

Anyway, time to start coding. Will report back soon.

Ciao,

-- 
Gianugo Rabellino
Pro-netics s.r.l. -  http://www.pro-netics.com
Orixo, the XML business alliance - http://www.orixo.com
     (Blogging at: http://www.rabellino.it/blog/)

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


Re: WebDAV client and ordered results

Posted by Ingo Brunberg <ib...@fiz-chemie.de>.
You are absolutely right. This issue has not been addressed before.

I'll happily accept a patch against the current implementation of
SearchMethod. But I would feel more comfortable if you'd not introduce
a new dependency on commons-collections.

Ingo

> I don't know if/how this has been discussed before (from a quick search 
> doesn't look like it has), but there is an issue in the SWCL which is 
> bugging us quite a bit and that I need to sort out somehow.
> 
> The current DASL basicsearch spec allow for ordered result via the 
> pseudo-sql <dav:orderby> clause. The current implementation of 
> SearchMethod, though, extends XMLResponseBase which puts the results 
> into an Hashtable, thus losing the order in which resources were 
> presented by the server.
> 
> The fix is not a big deal but (be it commons-collections based - IMO 
> preferrable - or tied to JDK 1.4's Linked stuff), but before delving 
> into it myself and providing a patch, I wanted to make sure that I'm not 
> seriously overlooking something (I would then happily wear my dumbass 
> hat) and, in that case, that it would be a welcome addition before the 
> next release. Comments?
> 
> -- 
> Gianugo Rabellino
> Pro-netics s.r.l. -  http://www.pro-netics.com
> Orixo, the XML business alliance - http://www.orixo.com
>      (Blogging at: http://www.rabellino.it/blog/)


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org