-
Notifications
You must be signed in to change notification settings - Fork 5
Basic Image
The following instructions assume you have installed the Web Annotations module and all of its dependencies, and have successfully made the required changes to Solr. It also assumes a working Islandora installation with the Simple Image Solution Pack installed and configured. In these instructions, you will learn to add annotation capabilities to basic image objects.
In the Drupal administration interface got to Structure > Context > Assets. Click the Index Module Assets header link, then select the Islandora Web Annotations checkbox. Click "Save configuration" so that the CSS and JavaScript assets distributed with Islandora Web Annotations will be available to select when configuring reactions in the steps that follow.
Go to Structure > Context > Import. Copy the code below and past into the "Context code" box.
$context = new stdClass();
$context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */
$context->api_version = 3;
$context->name = 'basic_image';
$context->description = '';
$context->tag = '';
$context->conditions = array(
'islandora_context_condition_content_models' => array(
'values' => array(
0 => TRUE,
),
'options' => array(
'islandora_cmodels' => array(
'islandora:sp_basic_image' => 'islandora:sp_basic_image',
),
),
),
);
$context->reactions = array(
'block' => array(
'blocks' => array(
'views-2311609f0bf3cb72feb08a3542345a82' => array(
'module' => 'views',
'delta' => '2311609f0bf3cb72feb08a3542345a82',
'region' => 'content',
'weight' => '-10',
),
),
),
'css_module' => array(
'sites/all/modules/islandora_web_annotations' => array(
'sites/all/modules/islandora_web_annotations/css/base/base.css' => 'sites/all/modules/islandora_web_annotations/css/base/base.css',
'sites/all/modules/islandora_web_annotations/css/basic_image/basic_image.css' => 'sites/all/modules/islandora_web_annotations/css/basic_image/basic_image.css',
'sites/all/modules/islandora_web_annotations/lib/css/theme-dark/annotorious-dark.css' => 'sites/all/modules/islandora_web_annotations/lib/css/theme-dark/annotorious-dark.css',
),
),
'js_module' => array(
'sites/all/modules/islandora_web_annotations' => array(
'sites/all/modules/islandora_web_annotations/js/base/base.js' => 'sites/all/modules/islandora_web_annotations/js/base/base.js',
'sites/all/modules/islandora_web_annotations/js/basic_image/basic_image.js' => 'sites/all/modules/islandora_web_annotations/js/basic_image/basic_image.js',
'sites/all/modules/islandora_web_annotations/lib/js/tinymce/js/tinymce/tinymce.min.js' => 'sites/all/modules/islandora_web_annotations/lib/js/tinymce/js/tinymce/tinymce.min.js',
'sites/all/modules/islandora_web_annotations/lib/js/jquery.blockUI.js' => 'sites/all/modules/islandora_web_annotations/lib/js/jquery.blockUI.js',
'sites/all/modules/islandora_web_annotations/lib/js/annotorious.min.js' => 'sites/all/modules/islandora_web_annotations/lib/js/annotorious.min.js',
),
),
);
$context->condition_mode = 0;
In the Drupal administration interface got to Structure > Context > Add. In the name field, provide your context with a name - we will use basic_image.
Under the Conditions heading, in the drop-down box, select "Islandora Content Models". When you select "Islandora Content Models", you should see a list of content modules under the "Content models to activate this condition". Check the checkbox with the "Islandora Basic Image Content Model" label.
Under the Reactions heading in the drop-down box, select "CSS from Modules". You will see a list of paths to CSS assets with checkboxes. Check the checkboxes for the following paths:
sites/all/modules/islandora_web_annotations/lib/css/annotorious.css
sites/all/modules/islandora_web_annotations/css/basic_image/basic_image.css
sites/all/modules/islandora_web_annotations/css/base/base.css
Under the Reactions heading in the drop-down box, select "JS from Modules". You will see a list of paths to JS assets with checkboxes. Check the checkboxes for the following paths:
sites/all/modules/islandora_web_annotations/lib/js/annotorious.min.js
sites/all/modules/islandora_web_annotations/js/basic_image/basic_image.js
sites/all/modules/islandora_web_annotations/js/base/base.js
sites/all/modules/islandora_web_annotations/lib/js/jquery.blockUI.js
Scroll to the bottom of the page and click save. On save, you will be brought to the list of available contexts. You should see basic_image in the list. Should you need to edit or make any other modifications to this context reaction, you can click the edit link.
It is advised that you clear your sites cache (if possible) to insure that all the CSS and JS assets included in the basic_image context are properly loaded and served.
When you load simple images, if you have the appropriate permissions set, you should now see the buttons for annotation.