[Zope-dev] Re: Zope 2.7: OrderSupport for ObjectManager
Trevor Toenjes
zope@toenjes.com
Wed, 7 May 2003 11:32:26 -0400
hi all.
I just caught this and excited to see this discussion. I have been using
OrderedFolder for a while and not aware of OrderedObjectManager.
My inquiry is more about implementation.
I have a requirement on my plate right now to develop an interface to enable
a user to custom order about 350 items. For simplicity, I have decided not
to allow batching for now and make them do the reordering on one large page.
I agree that moveObjectsToTop and moveObjectsToBottom are great API as long
as they subclass moveObjectsUp and moveObjectsDown.
I mainly want to use these methods outside the ZMI for a custom report that
displays more custom data that assists the user in ordering (mainly
meta-properties of the objects).
It would also be great to be able to use the same scripts for data in an RDB
as well. ex: each table would be required to have a 'position' that is
altered by the OrderSuuport.
anyway...
I think the real challenge is in the usability of using serialized "position
#'s".
the current UI is completely unusable to make object "jump" position. And
how do you handle it when multiple objects are selected to "jump".?
I am currently getting usability feedback from the users on this issue. The
feedback so far is to let the "position" be altered inline with the object.
And I also think...
OrderedObjectManager should be an optional attribute on a container.
Because of the interface bloat, I am leery of something like this that
forces itself onto every container, whether you need ordering or not.
I apologize if I am very late in the discussion and missing some facts here.
Thanks,
Trevor
> -----Original Message-----
> From: zope-dev-admin@zope.org [mailto:zope-dev-admin@zope.org]On Behalf
> Of Lennart Regebro
> Sent: Wednesday, May 07, 2003 8:38 AM
> To: Yuppie; zope-dev@zope.org
> Subject: [Zope-dev] Re: Zope 2.7: OrderSupport for ObjectManager
>
>
> Yuppie wrote:
> > This is the Interface we defined:
> >
> <http://cvs.zope.org/Zope/lib/python/OFS/Attic/IOrderSupport.py?re
> v=1.1.2.2&content-type=text/vnd.viewcvs-markup>
>
> Right, more or less as expected. Although the moveObjectsUp and
> moveObjectsDown, moveObjectsToTop and moveObjectsToBottom is a bit
> redundant it doesn't hurt to have them there either.
>
> > That's the way we did it.
>
> Perfect.
>
> All that is left if then the question if it should be implemented more
> as a 'mixin' than as a replacement for ObjectManager. Since, as far as I
> understand from the code, the ordered support is really done by a mixin
> class, and the OrderedFolder is just a Fodler+OrderSupport, this is
> really how it is done already, as a mixin, where you have a list that
> contain an order of Id's.
>
> That means that the question of this being a replacement or a mixin is
> mostly a question of replacing the main.dtml or having a separate tab.
> As the code is now, OrderedFolder is using a replacement manage_main
> taken from OrderSupport. OrderSupport doesn't have a manage_main, so it
> will acquire it, but I assume this is just a temporary ommision, and
> that OrderSupport is supposed to have a specialized 'ordered_main.dtml'.
> It would in that case be no problems in supplying a management tag that
> only supplies ordering too, of you need ordering mixin, but can't
> override manage_main.
>
> The last question, as I understand it, is if the mixin should really be
> just a mixin where you not only order keys, but supply a storage for
> what should be ordered, so that the mixin has no ordering by itself, but
> instead order other sets. It would indeed be possible to do this, if
> these sets implement a standard ordering interface, for example the one
> above, or the simple ordering interface of being a list.
>
> It can be done, and quite simply, by replacing the references to
> self._objects with a call to a method, like this one:
>
> def getOrderStorage(self):
> return self._objects
>
> You could then override this getOrderStorage() method with whatever you
> want in your object, and get it to point to whatever. In this case, the
> order storage must be a list.
>
>
>
> Is this what you have been discussing, or have I misunderstood something?
>
>
> _______________________________________________
> Zope-Dev maillist - Zope-Dev@zope.org
> http://mail.zope.org/mailman/listinfo/zope-dev
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope )