[ckan-dev] List of all datasets from sub-organizations for the parent organization

von Waldow, Harald Harald.vonWaldow at eawag.ch
Wed Aug 28 07:59:56 UTC 2019


Hi Mandana

Happy to hear that. Some info for the record:

I forked ckanext-hierarchy because there was heavy refactoring involved
and also I lost some features on the way and added a bit:

+ Search for organizations doesn't work (just not implemented). This is
  because I could not come up with a satisfactory way to display search
results for organizations while keeping the hierarchical display. If
there are not too many organizations this might not be an issue (my
case). Also we are dealing with two fundamentally different search
paradigms.

+ I kicked out pagination. But that should be easy to re-insert.

+ I re-implemented (much more robustly, I hope) the modification of the
search string necessary to include child-packages
(IPackageController:before_search). In the original ckanext-hierarchy
this is implemented in a more ad-hoc fashion and will break if the
input-search-string is not of a special (simple) form. To do that more
generally, I am using my "lucparser module (https://github.com/eawag-rd
m/lucparser), which is pulled in as requirement. Without having looked
into it, this might be also the reason that the original ckanext-
hierarchy doesn't work for for you. Maybe other extensions modify the
search-string, or CKAN core has changed it, so that it has a form that
the original implementation can't deal with.

PS: If you fixed a bug (related to a unicode issue?) I'd be happy about
a PR or an Issue.


Best,
Harald




On Mon, 2019-08-26 at 16:48 +0000, mane moshref wrote:
> 
> Many thanks Harald.
> 
> Your code / fork works perfectly (except a tiny problem related to
> encoding Ü/Ö/Ä which is already solved).
> 
> I just wondered why the original one doesn't work. I read from the
> code that "inlcude-children" should do the job, however, it didn't
> work neither in UI nor by manipulating the could and set it to
> "True".
> If it works for others then probably my own problem.
> 
> Anyway, you saved my day. Thanks a lot
> Mandana
> On Monday, August 26, 2019, 04:17:31 PM GMT+2, von Waldow, Harald <Ha
> rald.vonWaldow at eawag.ch> wrote:
> 
> 
> Hi Mandana
> 
> ckanext-hierarchy implements a field 'include_children' in
> snippets/search_form.html. When this is checked desired behaviour
> should result.
> 
> Maybe you want to try out my fork:
> https://github.com/eawag-rdm/ckanext-hierarchy_s
> 
> I refactored some stuff but also including datasets from child-
> organizations is the default there.
> 
> Best,
> Harald
> 
> 
> On Mon, 2019-08-26 at 11:00 +0000, mane moshref wrote:
> > Hello all,
>>> > I am using the ckanext-hierarchy plugin.
> > I have some parent organizations which are basically only name
> > (without datasets) and under each couple of sub-organizations or
> > children.
> > my use case is that I would like to open a parent organization page
> > and there I see the list of all datasets from all sub-
> organizations.
>> > Question:
> > Does anyone know which part of the code I should modify? or in
> > general how this works in CKAN?
>>> > Best regards
> > Mandana
> 
> > _______________________________________________
> > ckan-dev mailing list
> > ckan-dev at lists.okfn.org
> > https://lists.okfn.org/mailman/listinfo/ckan-dev
> > Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
> -- 
> Harald von Waldow
> Eawag
> ICT Services
> Research Data Management
> Ueberlandstrasse 133
> 8600 Duebendorf
> http://www.eawag.ch
> https://opendata.eawag.ch
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
> 
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
-- 
Harald von Waldow
Eawag
ICT Services
Research Data Management
Ueberlandstrasse 133
8600 Duebendorf
http://www.eawag.ch
https://opendata.eawag.ch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20190828/e04e7944/attachment-0002.sig>


More information about the ckan-dev mailing list