Dear Jose,
thank you very much for your input!
In my config-summary.xml there was already the facet 'category' since I added it to have in the search page the filter by category, and it works.
However, at the level <summaryType name="details" format="DIMENSION">
I have added the line you suggested:
<item dimension="category" plural="categories" indexKey="_cat" max="45" translator="db:org.fao.geonet.repository.MetadataCategoryRepository:findOneByName"/>
which is a bit different (see after item once I have dimension, once facet) from what I had already:
<item facet="category" max="99" sortBy="value" translator="db:org.fao.geonet.repository.MetadataCategoryRepository:findOneByName"/>
After the addiction of this line I restarted tomcat, but I had problems (fatal errors) and geonetwork didn't restart. Once I removed the line It started again.
I checked also the url you suggested me, which it gave me the json as you announced, without the categories statements.
Could you give me some more hints?
Best
Eugenio
________________________________
Da: Jose Garcia <jose.garcia@anonymised.com>
Inviato: mercoledì 20 giugno 2018 10:16
A: frippe12573
Cc: Geonetwork-Users@anonymised.com
Oggetto: Re: [GeoNetwork-users] Browse by category
Hi
I think the issue is that the current search summary doesn't return a facet
for the GeoNetwork categories, you'll need to update
https://github.com/geonetwork/core-geonetwork/blob/3.4.x/web/src/main/webapp/WEB-INF/config-summary.xml#L133
[https://avatars3.githubusercontent.com/u/1842442?s=400&v=4]<https://github.com/geonetwork/core-geonetwork/blob/3.4.x/web/src/main/webapp/WEB-INF/config-summary.xml#L133>
geonetwork/core-geonetwork<https://github.com/geonetwork/core-geonetwork/blob/3.4.x/web/src/main/webapp/WEB-INF/config-summary.xml#L133>
github.com
core-geonetwork - GeoNetwork repository
to add the category facet to that summary:
<item dimension="category" plural="categories" indexKey="_cat"
max="45"
translator="db:org.fao.geonet.repository.MetadataCategoryRepository:findOneByName"/>
After that restart GeoNetwork (maybe is required also a reindex, but not
sure). You can check in the browser the following request that should be
the one send by the panel:
http://SERVER/geonetwork/srv/eng/qi?_content_type=json&summaryOnly=true
You should get a json with that has an element like this:
...
"categories": [
]
...
Then you can use in your code the categories element to use it in the panel.
Regards,
Jose García
On Tue, Jun 19, 2018 at 4:39 PM, frippe12573 <frippe12573@anonymised.com>
wrote:
Hi everyone,
I would like to raise again the problem I have on changing in the home page
the option available with the radio button 'Browse by'. By default it is
available INSPIRE categories and Topic categories.
I want to change INSPIRE categories into Geonetwork Categories including
those created by me.
I googled with any reasonable results. The only item is this thread,
however
without pointing out any solution.
I modified a bit the file:
/var/lib/tomcat7/webapps/geonetwork/catalog/views/default/templates/home.html
as follow:
<div class="row" data-ng-show="searchInfo.count > 0">
<div class="col-sm-8" data-ng-show="browse !== ''">
browseBy
0 && searchInfo.facet['topicCats'].length > 0">
<label data-ng-show="searchInfo.facet['inspireThemes'].length >
0">
<input type="radio" name="browse" value="inspire"
data-ng-model="browse"/>
inspireThemes
</label>
<label data-ng-show="searchInfo.facet['categories'].length > 0">
<input type="radio" name="browse" value="cat"
data-ng-model="browse"/>
categories
</label>
<label
data-ng-show="searchInfo.facet['inspireThemes'].length > 0 &&
searchInfo.facet['topicCats'].length == 0">inspireThemes</label>
<label
data-ng-show="searchInfo.facet['categories'].length > 0 &&
searchInfo.facet['inspireTheme'].length == 0">categories</label>
<div class="row">
<div class="badge-icon">
//
</div>
<div class="badge-text">
{{facet['@label']}}<br>
{{facet['@count']}}
</div>
<div class="badge-icon col-xs-3">
//
</div>
<div class="badge-text col-xs-9">
{{facet['@label']}}<br>
{{facet['@count']}}
</div>
</code>
Any hints are very welcome.
Eugenio
--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-
f3860293.html
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/
projects/geonetwork
--
*Vriendelijke groeten / Kind regards,Jose García
<http://www.geocat.net/>Veenderweg 136721 WD BennekomThe NetherlandsT: +31
(0)318 416664 <+31318416664> <https://www.facebook.com/geocatbv>
<https://twitter.com/geocat_bv>
<https://plus.google.com/u/1/+GeocatNetbv/posts>Please consider the
environment before printing this email.*