On Jun 23, 2005, at 2:31 PM, Alec Flett wrote:

One general concern that I'm having is that the ItemCollection spec seems to be very focused on rules and setting attributes on items as a way of including them in collections...  Chandler, as an end user application, deals primarily with ItemCollections of arbitrary items, created by the user, with no particular "rule" binding them together. i.e. a user creates an item, or drags it from one collection to another. There's no "rule" per say on most collections - we need to be thinking more about the use cases of inclusions, not rules.

Today there are no rules on most collections, but the future direction is definitely to be able to define collections in terms of attributes on items.  The problem with inclusions is that you have to know a priori of the existence of a collection so that you can remember to call add on it.  But this is not going to work for collections defined by third party extensions.  


The only collections focused primarily on rules are "All" and maybe this "Mine/Not-Mine" bit. Yes, you can imagine others, but its not the common case.

The out of the box collections are the ones that are not focused on rules.  But many other collections will be defined by rules.  Think of attributes of items as defining facets, and rules as a way of assembling a faceted classification system.   If you want to explicitly add items to a collection we can do that, but I don't think that supports the virtuality requirements that we have.


Ted Leung wrote:
Mine/Not Mine is a feature of the sidebar.  See section 5 of <http://svn.osafoundation.org/docs/trunk/docs/specs/rel0_6/Sidebar-0.6.html>  
(cool, so it might be useful to at least x-reference & link this in the IC spec so readers understand its purpose)

Um, it is linked.  See the end of the background section.

When you filter, you apply a boolean condition to each element of a  set, " retaining" those items which match the collection.   You  filter a set by creating a filtered set, just like creating a union  or intersection.
except that the filter seems to be applied after the inclusions has been processed, whereas rules seem to be applied before the inclusions are processed. Do I have that right? This has implications, see below..

The items satisfying the rules and the items in inclusion are unioned.  There's no precedence other than the elimination of duplicates.   If we wanted a different definition of what an item collection is, it should be easy to do with the new set stuff.

That filtered set is then the thing that you interact with.  You  still have access to the set that the filtered set is based on.  The  filtered set is dependent on the original set, and changes to the  original set will cause the contents of the filtered set to update.   If the app wants to turn off the filter, it can go back to  referencing the original set.

Right, I guess the use case you describe conflicts with how Chandler uses filters today, and I'm not sure which model is the expected one for Chandler going forward. Today, Chandler creates a sort of "child" collection which is a filtered version of an existing collection. You can get to the original collection via the .source attribute on the filtered collection. How should this be implemented going forward?

A filtered collection will be created with an existing collection as its source/child.  What you said and what I said are the same thing.


When you say you're "interacting" with the filtered set, I'm trying to understand the actual implications of each operation (add/remove/etc) when the filter itself is added and removed.

Here's a real world example: if a ItemCollection has a "Task" filter on it, but I call ic.add(event) where event is not a task, what is the result? Does the add() fail, or does the event get added to inclusions, but not actually show up as a member of the collection since its not a task?

Today when you call add, the item is added to the inclusions and the result set.   If we want to preserve that behavior (having an ItemCollection kind versus not) it is no problem to do that.


Or what if I .remove() an item that's in inclusions, but doesn't match the filter?

If you remove an item from inclusions (and it's not excluded) then it will be in the contents of the item collection.  If you create a filter using the ItemCollection as source, then the filter will drop items that don't match its criteria.




What are the implications when adding new items such as when you  create a new item and put it in the collection? If it doesn't match  the filter (i.e. adding a CalendarEvent to an ItemCollection  filtered on Tasks) does it get added to "inclusions"? does it  appear to be in the filtered collection or not?
If you want to add an item which doesn't match the rule then you will  need to add it to inclusions explicitly.
do you mean via .add() or via some other mechanism? It sounds like filters trump inclusions, and inclusions trump rules.

see above.


If you have a collection based on a rule/filter then creating items  that match the rule is sufficient to get them into the collection.    Most of the time, you shouldn't need to worry about where to add  stuff, you should let the rules and extents do that work for you. 
This is what I'm talking about : Most of the time, the app does care where to add the stuff. Most of the time, the user is creating or deleting an event in a specific collection, not writing rules.

How can you know all the places where that item should appear, according to virtuality rules.   If you define the collection correctly, creating and removing events will just happen.  This has always been the  
model for how we do things -- look at the Item Collection section of <http://viewcvs.o11n.org/chandler/trunk/chandler/parcels/osaf/views/main/parcel.xml>.   Most of those collections have a rule.  Today when you create items of a particular kind, those items automatically appear in collections whose base rule is set up to include items of a particular kind.  Users will write rules (if they want to) when creating collections, not when creating or deleting items.    This is not a change from the way we do it today. 


If you want to associate metadata with ItemCollection then we should  have an Item Collection kind where that data can live.   If you add  the metadata as attribute of the ItemCollection kind, then the usual  sharing mechanisms (clouds, etc) apply.   I'd be interested in seeing  your ideas for how to do this.  I've been focusing mostly on  straightening out the basic semantics, and I haven't gotten any other  feedback about metadata.

Its not that I want to associate specific metadata with ItemCollection. Its that we need a generic way to associate ANY meta data with any specific item collection.

Well, you could just create an attribute on the specific ItemCollection instance, but that attribute won't persist.   It sounds to me like you want some kind of persistent dict that you can shove the metadata into.

Ted

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Open Source Applications Foundation "Dev" mailing list
http://lists.osafoundation.org/mailman/listinfo/dev

Reply via email to