Calais Marmoset

Last updated on
30 April 2025

Calais Marmoset is provided by Thomson Reuters' Calais. From Marmoset's home page, "Calais Marmoset is a simple yet powerful tool that makes it easy for you to generate and embed metadata in your content in preparation for Yahoo! Search's new open developer platform, SearchMonkey, as well as other metacrawlers and semantic applications."

This module requires the use of the Marmoset Package which you can obtain from http://www.opencalais.com/Crawler at the bottom of the page.

Installation

  • You will need an API key from opencalais for this, so register on their site, http://www.opencalais.com/apps/register
  • Download and extract the Marmoset Package into the calais_marmoset module directory to the included marmoset_package directory. (MODULES_DIR/calais_marmoset/marmoset_package/extract-package-here). You should create the 'marmoset_package directory for now. I'll include in the next minor-release. ** Make sure the package directories are executable, they were not in the latest release can could cause errors.
  • Visit the Settings page, admin/settings/calais_marmoset, and fill in the fields, the "Tag Base URL" is the path to the included default view that is included with the module.

Now we are done with the usual module setup, here's where it gets a little 'hands on'. You will need to edit the page.tpl.php file to include some special php code so marmoset works correctly.
On your page.tpl.php file, add

  if(module_exists('calais_marmoset'))
    require_once (CALAISMF_INCLUDE_DIR . "header.php");

before the doctype declaration.

And after the closing html tag add

  if(module_exists('calais_marmoset'))
    require_once (constant("CALAISMF_INCLUDE_DIR") . "footer.php"); 

The CALAISMF_INCLUDE_DIR constant is set up by a hook_boot override in the module.

For right now, I haven't decided whether or not to include the marmoset package. So, since it's not included we also need to set some variables in the config file. (MODULES_DIR
/calais_marmoset/marmoset_package/public/calaismf/conf.php)

Change

  • $calaismf_APIKey = "your-api-key-goes-here";
    to
     $GLOBALS ['calaismf_APIKey'] = variable_get('calais_marmoset_api_key', '');
    global $calaismf_APIKey;
  • $calaismf_InvokeEnlightenTimeout = 60;
    becomes
     $GLOBALS['calaismf_InvokeEnlightenTimeout'] = 60;
    global $calaismf_InvokeEnlightenTimeout;
     
  • $calaismf_UserAgentSubstringList = array("Slurp");
    becomes
     $u_agent_string = variable_get('calais_marmoset_UserAgentSubstringList', 'Slurp');
    $u_agents = explode("\n", trim($u_agent_string));
    $GLOBALS['calaismf_UserAgentSubstringList'] = $u_agents;
    global $calaismf_UserAgentSubstringList;
     
  • $calaismf_LogIdentity = "CalaisMFInjector";
    becomes
     $GLOBALS['calaismf_LogIdentity'] = "CalaisMFInjector";
    global $calaismf_LogIdentity;
    
  • $calaismf_ReltagBaseURL = "";
    becomes
     $site_base_url = variable_get('calais_marmoset_base_url', url('<front>', array('absolute'=> true)));
    $GLOBALS['calaismf_ReltagBaseURL'] = $site_base_url;
    global $calaismf_ReltagBaseURL;
    
  • and finally,
    $calaismf_OverrideDefaultURL = false;
    $calaismf_CalaisWebServiceURL = "";
    $calaismf_VerifySSLCertificates = true;

    becomes

     $GLOBALS['calaismf_OverrideDefaultURL'] = false;
    global $calaismf_OverrideDefaultURL;
    
    $GLOBALS['calaismf_CalaisWebServiceURL'] = "";
    global $calaismf_CalaisWebServiceURL;
    
    $GLOBALS['calaismf_VerifySSLCertificates'] = true;
    global $calaismf_VerifySSLCertificates;

Now we also need to change some variables in the footer.php file (calais_marmoset/marmoset_package/public/calaismf/footer.php)

  • $calaismf_inject_arr = array();
    $calaismf_level     = 0;
    $calaismf_l2_tag    = "";
    $calaismf_l3_tag    = "";   // for future use
    $calaismf_parse_err   = false;

    to

     global $calaismf_inject_arr;
    $calaismf_inject_arr = array();
    
    global $calaismf_level;
    $calaismf_level     = 0;
    
    global $calaismf_l2_tag;
    $calaismf_l2_tag    = "";
    
    global $calaismf_l3_tag;
    $calaismf_l3_tag    = "";   // for future use
    
    global $calaismf_parse_err;
    $calaismf_parse_err   = false; 

We have to make these changes since Drupal is a framework. You can find more information about the why they had to be globals from this thread.

Help improve this page

Page status: Not set

You can: