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.

Comments

SocialNicheGuru’s picture

There is different documentation for this module in the README, in doc directory, and on this page. Can you specify which we should be looking at?

A few things to note:
1. Create marmoset not marmoset_package

the module asks for
/sites/all/modules/calais_marmoset/marmoset/header.php once you add the lines of php to page.tpl.php

so the directory created should be marmoset not marmoset_package

2. If I fill in the module settings, do we need to touch the config file at all?

3. If we have opencalais installed do we have to make the additional changes specified above?

4. The downloaded version of Calais Marmoset files seem to already be included in the module directory. Are both needed?

Thanks,
Chris

http://SocialNicheGuru.com
Delivering inSITE(TM), we empower you to deliver the right product and the right message to the right NICHE at the right time across all product, marketing, and sales channels.

emackn’s picture

Yes.

They are the docs to follow. Marmoset is NOT included with the module.

Webster619’s picture

Is it also true that people need to remove the at the begging and ending from the conf.php file. Mine wouldn't work until I did that.

______________________________________________________

Follow me at http://www.twitter.com/WebsterJ

WildBill’s picture

I had the same experience. In the instructions above for modifying conf.php and footer.php:

 // the line above is unnecessary and may cause errors

[modifications listed above, which of course _are_ necessary]

// the line below is unnecessary and may cause errors