Customize search results with a 'Share' link for sharing metadata records directly from search pages

Last Published: April 25, 2020


Instructions provided describe how to customize search results with a 'Share' link for sharing records that appear in the search results page. The Share link allows users to bookmark (i.e., Add to Favorites) or share (i.e., through Digg, MySpace, Google, etc.) a particular metadata record directly from the search results page using technology from AddThis.
[O-Image] Share Button


Follow the steps below to add the 'Share' link to the Portal Implementation. To perform this customization, access to the Portal .jsp files on the GPT9 Web application server are necessary.

  1. Navigate to the <TOMCAT>\webapps\GPT9\catalog\search folder.
  2. Open the 'results.jsp' file in a text editor.
  3. At the top of the file, add some javascript tags. Find where it says “<% // scripting functions %>" and paste the following just underneath the "<f:verbatim>" tag:
    <script type="text/javascript" src="">
    <script type="text/javascript">
    var addthis_pub=" ";

  4. Now, find in the 'results.jsp' file where the "<% // Resource links %><h:panelGroup>" output links are defined. Add a new "< h:outputLink>" section, right above the line that says, “<% // Zoom map”.

    Paste the following code:
    <% // Share result %>
    <h:outputLink id="_lnkShare" rendered="#{record.viewMetadataUrl != ''}"
    value="" styleClass="resultsLink"
    onmouseover="return addthis_open(this, '', '#{record.viewMetadataUrl}', '#{record.title}')"
    onmouseout="addthis_close()" onclick="return addthis_sendto()">
    <h:outputText id="_txtShareThis" value="#{gptMsg['']}" />

  5. Save the 'results.jsp' file and close it.
  6. Navigate to the <TOMCAT>\webapps\GPT9\WEB-INF\classes\gpt\resources folder. Open the '' file in a text editor.
  7. Add the following resource key under the "# search related pages" heading. The resource key is the name of the link that appears in the search results user interface. To have it say something besides 'Share', replace the text after the equals sign with a title for the link:
    Code: = Share

  8. Save the '' file and close it.
  9. Restart Tomcat, and do a search to see the new 'Share' link in each search result.

Article ID:000010529

  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic