Skip to content

Geonetwork Branding

Angus Scheibner edited this page Apr 26, 2017 · 2 revisions

This guide assumes that you have set up your AODN stack as per https://github.com/aodn/aodn-portal/wiki/Setting-up-AODN-stack-without-Chef

Geonetwork webapp is running in /usr/share/tomcat/webapps/geonetwork.

Go to /usr/share/tomcat/geonetwork_config and create the file config-overrides.xml.

Set permissions on the file:

chmod 755 config-overrides.xml chown tomcat.tomcat config-overrides.xml

Edit the file with the following:

<overrides>
<!-- branding overrides -->
    <file name=".*WEB-INF/config-gui\.xml">
        <addXml xpath=".">
            <banner>
                <headerLeftImage>path-or-url-to-left-image.png</headerLeftImage>
                <headerRightImage>path-or-url-to-right-image.png</headerRightImage>
            </banner>
        </addXml>
    </file>
</overrides>

To configure geoserver baselayers for geonetwork, add the following lines within the overrides tag:

    <file name=".*WEB-INF/config-gui\.xml">
        <replaceXML xpath="mapSearch/layers">
            <layer server="https://my_geoserver/geoserver/wms" tocName="Borders"  params="{layers: 'gn:ne_50m_boundary_da,gn:ne_50m_boundary_lines_land,gn:ne_50m_coastline', transparent: 'true', format: 'image/png'}"  options="{}" />
            <layer server="https://my_geoserver/geoserver/wms" tocName="Ortophoto" params="{layers: 'gn:world', format: 'image/jpeg'}" options="{isBaseLayer: true}" />
        </replaceXML>
        <replaceXML xpath="mapViewer/layers">
            <layer server="https://my_geoserver/geoserver/wms" tocName="Borders"  params="{layers: 'gn:ne_50m_boundary_da,gn:ne_50m_boundary_lines_land,gn:ne_50m_coastline', transparent: 'true', format: 'image/png'}"  options="{}" />
            <layer server="https://my_geoserver/geoserver/wms" tocName="Ortophoto" params="{layers: 'gn:world', format: 'image/jpeg'}" options="{isBaseLayer: true}" />
        </replaceXML>
    </file>

Restart tomcat to pick up the config changes sudo systemctl restart tomcat