<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Richard Hughes wrote:
<blockquote cite="mid:1223243589.16909.16.camel@hughsie-laptop"
 type="cite">
  <pre wrap="">On Fri, 2008-10-03 at 14:07 +0200, Tim Lauridsen wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Thanks, i will wait.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Cool, some comments:

* Tons of trailing whitespace - pet hate of mine
  </pre>
</blockquote>
I will clean it up<br>
<blockquote cite="mid:1223243589.16909.16.camel@hughsie-laptop"
 type="cite">
  <pre wrap="">* We're already using collection for a meta-group -- can you use
  Categories and SubCategories? as method names?
  </pre>
</blockquote>
but the meta-packages is the same as a collection, this is why i use
GetCollections.<br>
'seach-group none collection' will return all collections as meta
packages.<br>
GetCollections(cat_id) will return all collections in a given Category.<br>
GetCollections("") will return all collections as collections.<br>
I might fell a little clumsy to have 2 way to get the same stuff, but
it was because i dont want to brake the current api.<br>
So you can say that metapackages is uncategorized collections
(search-group) "groupid;;;meta" and<br>
the a collection is a categorized collection "@groupid;;;".<br>
One other difference is that you can do a "search-group none @groupid"
to get the packages in the group, you cant do that with<br>
the 'groupid;;;meta".<br>
you can to both InstallPackages('groupid;;;meta") and
InstallPackages(''@groupid;;;')<br>
<br>
<blockquote cite="mid:1223243589.16909.16.camel@hughsie-laptop"
 type="cite">
  <pre wrap="">* I'm still not convinced you need two methods and signals to populate a
tree. What if the tree is four layers deep, or one layer deep?
  </pre>
</blockquote>
in comps, you only have 2 levels<br>
1. level categories. (a group of groups)<br>
2. level groups (a group of packages)<br>
<br>
I other package backends in might be different.<br>
<blockquote cite="mid:1223243589.16909.16.camel@hughsie-laptop"
 type="cite">
  <pre wrap="">
Couldn't you do something like this:

GetCategoryTree()
  </pre>
</blockquote>
<blockquote cite="mid:1223243589.16909.16.camel@hughsie-laptop"
 type="cite">
  <pre wrap="">CategoryNode(s=parent, s=id, s=icon, s=name)
  </pre>
</blockquote>
i dont see the need of the parent.<br>
C:GetCategories()<br>
<pre wrap="">S:Category("apps", "cat-apps", "Applications")
S:Category("games", "accessories-games", "Games")
S:Category("games;board", "board-games", "Board Games")
S:Category("games;action", "action-games", "Action Games")
S:Category("games;action;quake", "quake", "Quake games")
S:Category("system-tools", "media-system", "System tools")
S:Finished ()

Could deliver the same infomation, i dont see the need send to much redundant information.
</pre>
<blockquote cite="mid:1223243589.16909.16.camel@hughsie-laptop"
 type="cite">
  <pre wrap="">
C:GetCategoryTree()
S:CategoryNode("", "apps", "cat-apps", "Applications")
S:CategoryNode("", "games", "accessories-games", "Games")
S:CategoryNode("games", "games;board", "board-games", "Board Games")
S:CategoryNode("games", "games;action", "action-games", "Action Games")
S:CategoryNode("games;action", "games;action;quake", "quake", "Quake games")
S:CategoryNode("", "system-tools", "media-system", "System tools")
S:Finished ()

Then you only need to send one request to the server, and you get one
set of requests back, and you get an n-deep tree without hardcoding lots
of policy in the API.

It would be trivial to handle in python, and slightly trickier to do in
C.
  </pre>
</blockquote>
We could limit the tree to 4 levels and always send 4 level categories
to make it easier to decode in C :)<br>
catid:<br>
apps;;;<br>
apps;desktops-system;;<br>
games;action;firstperson-shooter;<br>
<br>
GetCategories() return the Categories as a 4 level tree.<br>
GetCollections(catid) returns the collections in a given level in the
tree.<br>
SearchGroup(filter,'@groupid') returns the packages in the group
(mandatory,default, optional and conditional)<br>
InstallPackages('@groupid') install the group (only the mandatory and
default packages)<br>
<br>
in time we can replace the use of SearchGroup(filters,'collections')
with GetCollections("") and deprecate the 'collections' group enum.<br>
the '@' prefix it the indicator for a dynamic group (collection) , so
we can separate group enums and dynamic group (collection)<br>
<br>
Tim<br>
<br>
<br>
<br>
</body>
</html>