david at kineticode
Apr 20, 2011, 7:49 PM
On Apr 20, 2011, at 7:13 PM, Dawn Buie wrote:
> Yes you said that today on IRC. Greg and I looked at keyword groups in the API and a solution didn't leap out at us.
> So would we make a parent group for the keyword group? Could you have groups of keywords that have groups of child keywords?
> my $parent_id = $grp->get_parent_id;
> $grp = $grp->set_parent_id($parent_id);
I was going to say “no,” but now I'll say “maybe.” I’m not sure the parent_id stuff is actually used. I think it was included in the original design of the API and never used. Might work. I don’t know.
> Or what is a member collection? It's a private method. Should we use that?
A collection is just an abstract way of grouping things together. So yes, maybe you’d want to create a collection subclass instead of a group subclass. In fact, I’d say that’s probably the way to go (I forgot all about collections).
> my $memb_coll = $get_memb_coll->($self)
> Returns the collection of members for this group. The collection is a Bric::Util::Coll::Member object. See that class and its parent, Bric::Util::Coll, for interface details.
Yeah, but you can use collections directly in the Asset class and ignore groups, I think. I’d have to look at the API again to see how it works, but I believe there are other parts of the API that use collections…Ah, yes, Contacts are managed as collections. IIRC, there is a collection object for contacts associated with the Person class. No Grp required.
> Or woud you uses classes of the keyword groups?
> my $class_id = Bric::Util::Grp::Keyword->get_class_id;
> Returns the Bric::Util::Class object ID representing this class.
That’s what I was saying initially, but now I think using a collection subclass (for which you’d have to add a table, IIRC), is a better idea.
> I don't dig into the guts of Bricolage normally so I don't know what the first step would be.
Just lots of poking, really. The code is more important to read than the docs, as the docs are written more for templating and less for application design.