Skip to content

Configure Searching of YouTube

mhogeweg edited this page Dec 24, 2012 · 2 revisions

It is possible to configure the geoportal for searching YouTube from the "Search In" dialogue on the Search Page. On the backend, what happens is the geoportal uses a set of transformations to communicate with the YouTube endpoint, to request and the transform responses from that site. Responses retrieved from YouTube will display the following information in the search result: title, description, thumbnail of the video, an Open link that opens the YouTube page, and a Preview link that will open the Geoportal preview window with the YouTube video. Metadata XML is not available for the result; neither is a 'details' page view or a geographic bounding box.

To configure the geoportal to search YouTube, do the following:

  • Navigate to the \\geoportal\WEB-INF\classes\gpt\search\profiles folder and verify that the YouTubeSearch_GetRecordByID_Response.xslt, YouTubeSearch_GetRecords_Request.xslt, and YouTubeSearch_GetRecords_Response.xslt files are present. If not, then you should download the latest geoportal.zip file available from sourceforge, unzip the geoportal.war file, and copy the files from that unzipped directory to your geoportal's \\geoportal\WEB-INF\classes\gpt\search\profiles folder.
  • Once you've confirmed the presence of the files, open the \\geoportal\WEB-INF\classes\gpt\config\gpt.xml file.
  • Find the <repositories> element within the gpt.xml file.
  • Under the last closing &lt;/repository&gt;</repositories> tag, add another <repository></repository> section, as shown below - NOTE, you will need to escape the ampersands, e.g., use the ampersand symbol and 'amp' with a semicolon:
<repository key="YouTube" 
 class="com.esri.gpt.catalog.search.SearchEngineRest" 
 labelResourceKey="catalog.search.searchSite.youtubesearch" 
 abstractResourceKey="catalog.search.searchSite.youtubesearch.abstract"> 
  <parameter key="endPointSearchUrl" 
   value="http://gdata.youtube.com/feeds/api/videos?v=2&amp;safeSearch=moderate&amp;q={searchTerms}&amp;start-index={startIndex}&amp;max-results={count}"/> 
  <parameter key="profileId" 
   value="urn:esri:gpt:HTTP:XML:GOOGLE:YOUTUBE" />
</repository>
  • Save the gpt.xml file, and restart the geoportal web application in your web app server (e.g., Tomcat)
  • Test on the Search page if YouTube now shows up as an option in the "Search In:" section.

Back to Customizations
Clone this wiki locally