[ckan-dev] IFacets plugin interface

Toby Dacre toby.okfn at gmail.com
Fri Feb 15 17:55:55 UTC 2013


On 15 February 2013 17:47, Adrià Mercader <adria.mercader at okfn.org> wrote:

> Sounds good
>
> What config options are you referring to?
>
> 1. search.facets = groups tags res_format responsible-party frequency
> source_type
> 2. search.facets.responsible-party.title = Organizations
>
> Perhaps I would keep 1. making clear that these affect to all searches
> made, and that if you want a more efficient handlint you should use
> IFacets
>
I'm happy to keep this but for it to be overridden if IFacet exists - is
that acceptable?


> I'm happy to drop 2.
>
yeah this is broken for i18n purposes

>
> Will there be a way for defining facets for a particular dataset type?
> My use case: the harvester extension has a custom dataset type for
> harvest sources and on the listing page you can facet by frequency or
> type (two extras). How would I add these only to the harvest_source
> type and not the default dataset (or I can't)
>
hmm,

I suppose we could do something like

IFacet.dataset_facets(dataset_type):

that would let you do what you want but maybe it is not flexible enough - I
think you want something in the harvester extension that adds them for this
type.  Maybe we need a way to say I want to be called for datasets of this
type.  Lets's think about this.
What would work well/seems sensible for you?

good feedback - thanks

>
> On 15 February 2013 12:24, Toby Dacre <toby.okfn at gmail.com> wrote:
> > Facets are a problem in ckan.
> >
> > Currently they are changed via config options and the
> > IPackageController.update_facet_titles() translation of facet names is
> not
> > fully supported
> >
> > The plan is to add a IFacet plugin interface to allow greater
> flexibility so
> > that facets can be defined for
> >
> > Datasets
> > Groups
> > Organizations
> > Bulk Updates
> >
> > a function would be called on the interface for each of these to get the
> > facets and the display name
> >
> > eg
> >
> > def facets_datasets():
> >     return {'tags': _('Tags'),
> >               'groups': _('Groups'),}
> >
> >
> > the list may expand later if needed
> >
> > IPackageController.update_facet_titles() will be removed - this was
> added in
> > 2.0 and I think Sven is the only current user and switching to the new
> > interface would be trivial.
> >
> > Do we also want to remove all the config options and just do things via
> an
> > Extension?
> >
> > the issue is https://github.com/okfn/ckan/issues/400
> >
> > feedback?  I plan to do this over the next week.
> >
> > cheers
> > Toby
> >
> > _______________________________________________
> > ckan-dev mailing list
> > ckan-dev at lists.okfn.org
> > http://lists.okfn.org/mailman/listinfo/ckan-dev
> > Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
> >
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130215/20cecbf0/attachment-0001.html>


More information about the ckan-dev mailing list