Integrate with a Content Management System

Integrate the Geoportal with a Content Management System

A Content Management System (CMS) is software that allows users to enter and change content on a website. There are a number of CMS available, and the Geoportal can be integrated within a CMS, or a CMS can be integrated within the Geoportal as a new tab. A CMS is not a requirement of the Geoportal, but integrating one can give a more directed view of the content of the geographic metadata catalog. CMS pages can highlight sets of geographic data and services that are applicable to certain user groups or topics. Several options are available for CMS integration, as illustrated in the figure below:

The methodology for rendering the response within a CMS page can vary. Some systems have inherent capability to render one or more of the response formats provided by the Geoportal. Another approach involves transforming a response using XSL technology; this gives full control over the look and feel of the rendered response content. Implementing this approach will depend upon the capabilities of the CMS. Many content management systems also provide the ability to plug-in customized rendering adapters. This approach would involve developing a custom component. This topic provides an example for integrating the Geoportal with a freely available CMS called JSP Wiki. There are two parts to this topic:
  1. Using JSPWiki with Geoportal GeoRSS feeds
  2. Using JSPWiki with the Geoportal REST API
After you have configured your JSPWiki page, integrate it into a new tab in your Geoportal by following instructions at Add Another Tab to the Geoportal Interface.

Using JSPWiki with Geoportal GeoRSS feeds

In this example, you will install JSP Wiki from the JSP Wiki site. After installing JSP Wiki, you will need to install an RSS plugin, located at http://www.jspwiki.org/wiki/RssViewerPlugin. Remember to restart your geoportal web application after installing the plugin jar files. Steps to create JSP Wiki page to fetch Geoportal RSS feeds are below:

  1. Install JSP Wiki.
  2. Create a new page in JSP Wiki into which you will insert GeoRSS feeds.
  3. Go to the edit mode of the page, and paste the string below into it. This change will insert GeoRSS feeds from your Geoportal. In the string, the url attribute should reference the REST result string for the search you want to display on the wiki page. For example, if you want the wiki page to display wildfire-related resources, the url parameter would look like the one in the example below. The parameters such as "detail", "ttl", "date", and "maxitems" are parameters defined by the plugin, and can be adjusted according to the syntax documentation on the RssViewerPlugin page:
    [{fr.univ.reunion.iremia.rss.RssViewer url='http://yourGeoportalserver/geoportal/rest/find/document?searchText=wildfire' detail='1' ttl='120' date='1' maxitems='20'}]
    
  4. You can define more complex search results by using the REST syntax to specify extent, topic categories, dates, and more.
  5. Save the wiki page, exit the edit mode, and you will see a page displaying results corresponding to the search criteria you specified with the RssViewer url.

Using JSPWiki with Geoportal REST API

It is also possible to display your REST results using the Geoportal REST API. In this example, you will need to install an xslt-plugin.jar, and publish an xsl called IdentityTransform.xsl so that JSPWiki may have access to the xsl file. Steps are below:

  1. Install JSP Wiki.
  2. Install the xslt_plugin.jar, available at http://www.jspwiki.org/wiki/XSLTPlugin:
    • Go to the Attach tab on the website, and copy the xslt_plugin.jar file into your \\JSPwiki\WEB-INF\lib folder.
    • Add the following entry to your jspwiki.properties file in the Plugin search paths section:
      #############################################################################
      #
      #  Plugin search paths.
      #
      #  Define here the packages you want to use for searching plugins, 
      #  separated with commas.
      #  For example, use the following command to add "org.myorganisation.jspwiki.myplugins"
      #  and "com.foobar.myplugins" to the search path.
      #
      #  The default path is "com.ecyrd.jspwiki.plugins", and it will be always
      #  the last item on the path.  This allows you to override JSPWiki default
      #  plugins.  Note that you are only adding to the path, not replacing it (ie.
      #  the default path is never removed.)
      #
      #  jspwiki.plugin.searchPath = org.myorganisation.jspwiki.myplugins,com.foobar.myplugins
      #
      jspwiki.plugin.searchPath =net.panonet.XSLTPlugin
      
  3. Create the IdentityTransform.xsl file, and save it to your JSPWiki folder. You can name the file whatever you want, as long as you reference it in your JSPWiki. The text for the file is:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
    	<xsl:output method="text"/>
    	<xsl:template match="/">
    		<xsl:for-each select="//item">
    			<div>
    				<xsl:text>&lt;a </xsl:text> href="<xsl:value-of select="link/@href"/>" target="_blank"<xsl:text> &gt;</xsl:text>
    				<xsl:text>&lt;h4&gt;</xsl:text>
    					<xsl:value-of select="title"/>
    				<xsl:text>&lt;/h4&gt;</xsl:text>
    				<xsl:text>&lt;/a&gt;</xsl:text>
    				<p>
    					<xsl:value-of select="description"/>
    				</p>
    				<xsl:text>&lt;br&gt;</xsl:text>
    			</div>
    		</xsl:for-each>
    	</xsl:template>
    </xsl:stylesheet>
    
  4. Now you will create a new JSP wiki page, and integrate the Geoportal REST API results within it.
    • Create the JSP wiki page.
    • Go to the edit mode of the page.
    • Paste the string below into it. The xml= parameter will need to have the URL of your search result page for the Geoportal REST API results, and the xsl= parameter will need to reference the URL to your published IdentityTransform.xsl.
      [{INSERT net.panonet.XSLTPlugin WHERE xml='{url to document (or search result page) of Geoportal REST API}', xsl='{url to IdentityTransform.xsl}'}]
      
      For example:Wildfire Metadata
      [{INSERT net.panonet.XSLTPlugin WHERE xml='http:// yourGeoportalServer /geoportal/rest/find/document?searchText=wildfire*', xsl='C:/Tomcat/webapps/JSPWiki/channelPage.xsl'}]
      
  5. Save the page, exit the edit mode, and you will see search results in the page that correspond to the REST url you input to the XSLTPlugin.

1/29/2014