[Dev] automatically hooking into the sidebar

Alec Flett alecf at osafoundation.org
Wed Feb 2 11:56:32 PST 2005


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


More information about the Dev mailing list