[ZDP] Re: Ordering objects and ZDP Tools (again)

Maik Roeder roeder@berg.net
Tue, 14 Mar 2000 14:46:11 +0100


Hi Rik !


> about the acquisition problem: the content and whatever other folder
> specific dtml documents do not have such a property but acquire one from
> their container folder. This can be overcome by checking the order
> property of a DTML Method != container. Or is there a generic way to
> test if something is a ZClass instance, or I should make a list of
> allowed meta-types. All of these are clumsy, but the problem may be
> overcome.

I don't mind anything aquiring properties from a ZClass instance. 
In what case would this be problematic ?
 
> > It is up to the user to decide if he wants to change the order of
> > the items. This will not happen too often, I would think.
> 
> ? why not, depends on the type of documents (faq order for instance may
> change quite often)

It is just an observation. I think it was you who wanted to change
the order of an easy question to a higher position. We will see how
often this is actually needed.
 
> > It is up to the views to decide whether they want to respect the order
> > provided. Views can also decide what to do with the orders with a value
> > of 0. Views also don't have to worry about different naming schemes
> > and also the Catalog can now sort on the order, which may be needed.
> 
> yes, that _may_ be an advantage. Although.... A use case:
> we have two documents, one a snippet and the other a FAQ, both with a
> keyword dtml. The FAQ in the faq is unimportant and has an order
> property of value 2000 (which will keep it at the end of the faq list
> and there are more than 50 faqs about dtml). The snippet, however, is
> also unimportant and has an order of 50 (keeping it down at its list
> which is maintained by another maintainer). Now the Catalog sorted on
> order will keep the snippet above the faq, for no obvious reason.

If this is a desired feature, then the catalog search should take
into account the total number of snippets/questions, and the absolute
position of the objects.

Say, we have 

200 Questions
40 Snippets

The catalog returns a Snippet on DTML and a Question on DTML

Absolute position:

Question: 14
Snippet:  32

So, in a combined list, we have the following order:

14/200 * 100 = 7
32/40  * 100 = 80

This means that given a range from 0 to 100, the Question should
be listed before the Snippet, because relative to the absolute 
position in the base set of questions, the question is at
position 7 of 100 and the Snippet is at position 80 of 100
relative to the absolute position in the base set of Snippets.

This does not take into account that the Snippets and Questions
can indeed come from different folders, which would complicate
things, because you would have to decide the base set cardinality
by looking at the folder from which a Snippet/Question comes
every time instead of doing so once.

> Now this is not very important, but the order property when used
> generically will lead to strange orderings.

The numbers have no special meaning. They are only to keep the order
relative to one meta_type. As you have stated above, you can't compare
an order property in 50 FAQ Questions and an order in 20 Snippets.
Also, a number of 2000 does not mean that a Question is unimportant
or obsolete, in which case it should be removed or moved to another
place anyway, but the order just signifies that this question makes
most _sense_ after all the questions before and before all the questions
after it.

> This said, I really do not mind adding the generic order to the Document
> Folder class. Shall I proceed like that then?

Just set the default value of the order property to 0. Maybe
you should take a name of "contextorder" so it is clear that
we are not speaking about a ranking order, difficulty order
or quality order, which could be added later or in a different
way.

Greetings,

Maik