[Zope-dev] Re: Ordered Folder again

Yuppie schubbe@web.de
Fri, 20 Jun 2003 16:04:21 +0200


Hi Florent!

Florent Guillaume wrote:
> I'm sorry to revisit an problem that I see has been discussed to death 
> last month, but I'd like to propose a change to what has currently been 
> checked in about Ordered Folders into Zope 2.7.

No problem. Welcome to the discussion :)


FYI, this is what Brian wrote off-list in reply to my last posting:

> I could only ok changing the standard Folder if the changes were 100% 
> backward compatible (and ignorable by people who don't care) in all 
> ways: data compatibility, api compatibility, ui compatibility.
> 
> If nothing else, I can't see how to maintain ui compatibility, and 
> given that lots of people currently have to override manage_main, it 
> seems like it would be hard to come up with a solution that didn't 
> require other product developers to do something to keep up.
> 
> But I could certainly be wrong :) Basically, I have no philosophical 
> problem with changing Folder, but it is a core enough thing that we 
> can't do it in a way that causes any b/w incompatibility.


And now some comments:

> - in a folder, has_order_support would be either a boolean, or not 
> present and thus found by acquisition
> - the zope root would have has_order_support = 0

I'm not sure if acquisition is useful in this case: Move a Folder out of 
that subtree and you lose OrderSupport. That's confusing.

Explicit is better than implicit ;)

> - OrderSupport.manage_renameObject would do its special stuff only if 
> self.has_order_support is true

Is there really a need to provide b/w compatibility for this behaviour? 
The only use case I know is 'ordering-by-heavy-renaming', and people 
using that should better migrate to the OrderSupport API.

> - dtml/main.dtml would test ordering with a simple
>   <dtml-let hasOrderSupport=has_order_support>
> - dtml/folderAdd.dtml would present the user with a choice to basically 
> decide if has_order_support should be set, unset or acquired.
> - manage_addFolder would take this additional argument and do nothing or 
> create a property for has_order_support.
> 
> Thus the default behavior would be the same as today, but if a folder is 
> created with the has_order_support property (or if it's set after 
> creation), the subtree would then be ordered. In a CMS that's always 
> what we want.

Would there be any UI to change that property? How would you set it 
after creation?

> The only downside is, I think that products like BTreeFolder2 would have 
> to add an has_order_support=0 class variable.

Should be easy to detect BTreeFolders.


Cheers,

Yuppie