[Dev] automatically hooking into the sidebar

Ted Leung twl at osafoundation.org
Wed Feb 2 13:40:27 PST 2005


Why do you need to subclass ItemCollection in this case?

Ted

On Feb 2, 2005, at 11:56 AM, Alec Flett wrote:

> So I've been working on a system for chandler extensions to "plug in" 
> to the sidebar and I'm curious what people think of my scheme. Here's 
> how it works:
>
>    * I added a new Kind, <SidebarCollection> that derives directly from
>      <ItemCollection>
>    * I added a rule to the <ItemCollection
>      itsName="sidebarItemCollection"> - see below....
>
>  <contentModel:ItemCollection itsName="sidebarItemCollection">
>    <_inclusions itemref="content:allItemCollection"/>
>    <_inclusions itemref="content:inItemCollection"/>
>    <_inclusions itemref="content:outItemCollection"/>
>    <_inclusions itemref="content:CalendarView"/>
> /    *<!-- this allows extensions to hook into the sidebar -->
>    <_rule value="for i inevery 
> '//parcels/osaf/framework/blocks/SidebarCollection' where True"/>*
> /  </contentModel:ItemCollection>
>
>    * For ZaoBao, what I was able to do was make its type derive from
>      <SidebarCollection> as follows:
>
>  <Kind itsName="RSSChannel">
>    <superKinds itemref="content:ContentItem"/>
> /*    <superKinds itemref="docSchema:SidebarCollection"/>*/
>   ...
>
> Now, every time ZaoBao makes an RSSChannel, that object is also a 
> SidebarCollection. the RSS Channel need only populate itself as though 
> it were an ItemCollection, and its items will appear in the summary 
> view.
>
> Now I don't know enough about queries to know if this is really a 
> smart way of searching the repository for items that want to hook into 
> the UI... is there a better way than creating a new Kind?
>
> Alec
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> Open Source Applications Foundation "Dev" mailing list
> http://lists.osafoundation.org/mailman/listinfo/dev
>
----
Ted Leung                 Open Source Applications Foundation (OSAF)
PGP Fingerprint: 1003 7870 251F FA71 A59A  CEE3 BEBA 2B87 F5FC 4B42



More information about the Dev mailing list