Esri / geoportal-server

Geoportal Server is a standards-based, open source product that enables discovery and use of geospatial resources including data and services.
https://gptogc.esri.com/geoportal
Apache License 2.0
245 stars 149 forks source link

Geoportal "Help" Link & Custom Tabs #259

Open rmbradley opened 7 years ago

rmbradley commented 7 years ago

We've come across a small issue with Geoportal's (1.2.5) "help" link at the top right tertiary navigator. We have customized the primary Navigator bar to contain custom tabs as described in

https://github.com/Esri/geoportal-server/wiki/Add-Another-Tab-to-the-Geoportal-Interface

While the steps are clear and work very well for what we have accomplished, we noticed that: If you are on a custom tab's page and click the Help link at the top right (tertiary navigator in banner):

image

...we get the following response:

image

This only occurs when clicking the "Help" link when on a custom page; it doesn't happen with out-of-the-box pages. We think there may be dependencies on the content of the "..\webhelp\en\geoportal\cxhelp.xml" and the "..\webhelp\index.jsp" files at least. There may be additional dependent configuration files.

Also, there is a hint at: https://github.com/Esri/geoportal-server/wiki/Localization#Localize_the_geoportal_webhelp

...but it seems to focus on language localization.

Our goal is to configure existing files in "..\webhelp" (or other locations) to point to our own help files.

Any other hints are welcome.

Thanks,

Rick Bradley BLM National Operations Center/ Division of Resource Services

ericgibson commented 7 years ago

Here is a solution that worked for me. Any suggestions or corrections is welcomed!

Hosting your own help files for Geoportal.

The geoportal help button opens up github wiki docs. The base url for the external website that hosts the help documents is located in the geoportal/webhelp/index.jsp file. Look for the ‘private static final String REMOTE_HELP_SYSTEM’ line (should be around 59). Set this string to the url you want to use for your help files, like this:

private static final String REMOTE_HELP_SYSTEM = "http://website/file/webhelp/helpfiles";

This is the path where you will create and save your help files in .html format. Now find the ‘private static String INIT[][]’ in the same index.jsp file somewhere around line 69. You need to add parameters in the String INIT for the page(s) you want a specific help topic to open from, for instance:

{"catalog.main.home", "", "/home-page-help-page.html"}

The first parameter is the page the user is on, the second parameter we don’t need to use (it corresponds to the cxhelp.xml file to create mapping to git-hub wiki help files), the third parameter is the page we want to open at the REMOTE_HELP_SYSTEM url above. When a user is on the Home page and clicks on help, the http://website/file/webhelp/helpfiles/home-page-help-page.html will open.

zguo commented 7 years ago

The current help system works either with github wiki help pages or a local webhelp as discussed above, but not both at the same time.

In your case, when clicking on the help link while on the custom tab, the help system try to find the help page on github for that custom tab but unable to find thus the 404 error.

You may achieve desired behavior through code modification by adding the logic to webhelp/index.jsp page to handle your custom help scenario.

For example you may try to add an if statement at line 230 which will send redirect to your custom help page depending on the value of "cmd" variable. the value of the cmd should come from id of page declared by (e.g. )