Skip to content

Logo improvements#9322

Open
fxprunayre wants to merge 9 commits into
mainfrom
44-logoapi
Open

Logo improvements#9322
fxprunayre wants to merge 9 commits into
mainfrom
44-logoapi

Conversation

@fxprunayre

@fxprunayre fxprunayre commented Jun 9, 2026

Copy link
Copy Markdown
Member

Add an API to retrieve logo (instead of building path to images with hard coded extension):

New API

GET operation /logo added for:

  • group(existing)
  • sources
image
  • site
image
  • harvester
image

Note: Accessing logo using previous mechanism (ie. an hardcoded path to images or logo folder) still works - as far as you don't use logo not in PNG format.

Migration

Instead of accessing logo with folder path 'images/logos/' + $source + '.png', use the API 'srv/api/sources/' + $source + '/logo'.

Logo references

In database,

  • Source table contains the reference to the logo for the main catalogue, portal and harvester
  • Group table contains the reference to the group logo

Improvements

  • Refactor to have a single utility to return the logo
  • Allow using SVG for logo
  • On startup register the catalogue logo in source table
  • Fix hard coded path to logo in index document (which may be wrong if group logo change after indexing)
  • More consistent layout of logo in list for groups/harvesters/sources
image

Previous related work

Follow up of #1565

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

Funded by Ifremer

* Add an API to retrieve group(existing)/sources/site/harvester logo (instead of building path to images)
* Source table contains the reference to the logo for the main catalogue, portal and harvester
* Group table contains the reference to the group logo
* Refactor to have a single utility to return the logo
* Allow using SVG for logo

Follow up of #1565
@fxprunayre fxprunayre added this to the 4.4.12 milestone Jun 9, 2026
@fxprunayre
fxprunayre requested a review from josegar74 June 9, 2026 10:39
@fxprunayre fxprunayre added the api change Indicate a change in the API label Jun 9, 2026

@josegar74 josegar74 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some places that have images/logos to review:

There are some additional ones, please check if are required to be updated.

Comment thread core/src/main/java/org/fao/geonet/resources/ResourceFilter.java Outdated
Comment thread core/src/main/java/org/fao/geonet/resources/ResourceFilter.java Outdated
Comment thread services/src/main/java/org/fao/geonet/api/groups/GroupsApi.java Outdated
Comment thread core/src/main/java/org/fao/geonet/resources/ResourceFilter.java Outdated
Comment thread core/src/main/java/org/fao/geonet/resources/ResourceFilter.java Outdated
Comment thread services/src/main/java/org/fao/geonet/api/site/LogosApi.java Outdated
@josegar74

Copy link
Copy Markdown
Member

Using a SVG file as a catalog logo, it doesn't render fine with the name of the catalog. Tested with 2 SVG files with the same result:

image

@josegar74

Copy link
Copy Markdown
Member

Changing a logo in a source / group, doesn't update the logo in the list, even when reloading the full page.

@fxprunayre

Copy link
Copy Markdown
Member Author

Thanks for checking @josegar74

core-geonetwork/web/src/main/webapp/xslt/base-layout.xsl
core-geonetwork/web/src/main/webapp/xslt/common/render-html.xsl

favicon is not modified by the PR. So this does not change.

core-geonetwork/core/src/main/java/org/fao/geonet/kernel/datamanager/base/BaseMetadataIndexer.java
core-geonetwork/web/src/main/webapp/WEB-INF/data/data/formatter/xslt/render-layout.xsl
core-geonetwork/web/src/main/webapp/xslt/skin/default/skin.xsl

Updated (including some other files which were missing).

Using a SVG file as a catalog logo, it doesn't render fine with the name of the catalog. Tested with 2 SVG files with the same result:

Fixed.

Changing a logo in a source / group, doesn't update the logo in the list, even when reloading the full page.

This is is due to the cache that was added in group logo API https://github.com/geonetwork/core-geonetwork/pull/1565/changes#diff-9559f3495b07382fa74aaac41b6e686a04e5268c57edfb7210e82f1c46be1256R192 I think. I'm not sure how to avoid that? Are we using the group logo API somewhere already? One option is to turn off this cache. What do you think?

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
E Security Rating on New Code (required ≥ A)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@fxprunayre fxprunayre modified the milestones: 4.4.12, 4.4.13 Jul 8, 2026
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

💡 Need a hand with PR review? Try Gitar by Sonar!

throw new ResourceNotFoundException(String.format(
"Harvester with UUID '%s' not found.",
harvesterUuid));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api change Indicate a change in the API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants