Giter VIP home page Giter VIP logo

islandora_web_annotations's Introduction

Islandora Web Annotations

Build Status DOI

An Islandora module that enables annotation on Islandora objects, following the W3C Web annotation model.

Status

This module is under active development. Please see the latest release. Currently, only Firefox and Chrome browsers are supported.

Requirements

This module requires the following modules/libraries:

Installation

Install as usual, see this for further information.

Configuration

After enabling the module, set the namespace for the annotation objects by going here: /admin/islandora/tools/web_annotations.

This module requires specific configurations for different content models and solution packs. Please see the project wiki documentation for guides on how to configure for specific content models and solution packs as well as how to index annotation content.

What is Different About This module?

This module can be considered an Islandora utility module; However, like solution packs, it installs content models into the Fedora repository to facilite the creation of annotation objects. The two content models that are installed are the Annotation content model and Annotation Container Content model. These content models are not relevant for collection policies at this time. By default, all content models become available in certain administration interfaces such as the collection management interface. Selecting these content models through these interfaces has no discernable effect, though we recommend avoiding selecting these content models.

Maintainers/Sponsors

Software leads:

Sponsors:

License

GNU General Public License, version 3 or later.

islandora_web_annotations's People

Contributors

kayakr avatar kimpham54 avatar kstapelfeldt avatar marcusbarnes avatar natkeeran avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

islandora_web_annotations's Issues

Review islandora_context to see if it can be used for annotations

Ideally, we want annotations to be displayed as add-ons to existing objects such as an image, video, audio or pdf.

We need to look at ways to manipulate an object's display without having a custom content model or custom viewer. We also want to add controls to the object that user can interact with.

@MarcusBarnes pointed out that https://github.com/mjordan/islandora_context could be useful. This ticket is to review that module and see if it can be used for the above stated purposes.

Add basic drush support

Create islandora_web_annotations.drush.inc to add basic drush support such as disable and enable.

Admin Form: Debug Flag for Verbose Messages

Tasks:

  1. Create admin form
  2. Provide option for a verbose (debug) notification text that will include verbose output for confirmation messages. Default to simple, non-verbose messages.
  3. Check for flag and change alert box text on annotation creation, save (and edit) appropriately.

Documentation: Permissions

Create a wiki page that details how to set up permissions for using Islandora Web Annotations for various known and anticipated use cases.

Implement basic permissions for annotaitons

Implement basic drupal based permissions:

  • Edit all annotations

  • Create annotations

  • View annotations

  • Delete all annotations

  • Delete own annotations

  • Edit own annotations

Also need to review how these interact with Islandora permissions like view datastream.

Interation 1 php refactoring/code cleanup

  • Re-factor to extract constants
  • Add UUID to annotation and annotationContainer
  • Add error handling
  • Improve return json to conform more to the Annotation Protocol
  • Add comments
  • Add a Util class to handle static methods
  • Clean up controller and method signatures

Working with Islandora core permissions

As currently written, the module allows roles that have the appropriate web annotation permissions to perform CRUD operations on annotations. The only currently required Islandora permission is "View repository objects." This means that, using the Web Annotation model, users can perform CRUD operations on annotations (which are Islandora objects). This means users can "Add datastreams to repository objects, Edit metadata, Create new repository objects, Permanently remove objects from the repository" (language from Islandora core permissions) without having been granted these permissions explicitly. There is a use case for this, as administrators may wish to grant only the option to create web annotations. However, will it cause a problem if we wish to contribute this module to core Islandora? Kirsta to raise -

Blue Box surrounding number fails to scale?

Created an annotation and blue box with number exceeds box drawn for annotation. Firefox 50.1.0. Seems to happen when an annotation is created with the image zoomed. All the blue boxes seem to be the same size.
screen shot 2017-01-23 at 12 36 29 pm

screen shot 2017-01-23 at 12 40 08 pm

Create an abstraction layer to make ajax calls to backend

Currently, the initial prototype has the create, update, delete and load/get ajax calls in the large_image.js. These ajax calls will be similar or same for other content types as well. These calls can be abstracted out into its own js so it can be used by other content types to interact with the backend.

Setting the namespace for annotations

We have to which namespace is appropriate for annotation objects. We have 3 options:

  • use default islandora namespace
  • use the object's namespace (could be difficult to determine!)
  • provide config option to specify a namespace

Annotations list block

Display all annotations as a list in a block or div. A specific annotation text in the list and the cross-ponding annotation needs to be related.

  • Number the annotation boxes and the cross-ponding texts in the list
  • If the user hover over a text in the list, highlight that annotation box

Ordering CSS/JS files

Sometimes the order in which JS files are loaded are important, but indicating the order is not yet possible in Context.

Description: Experiencing interface issues if JS files for video are loaded in the order they are presented in Islandora context.
Steps to reproduce: Add context JS from modules and select all of the JS files required
Platform: php 5.5.9, islandora 7.x-1.7 on firefox and chrome
Actual: Error message that says undefined variables, like openvideoannotation and annotator, interface for video annotations does not load correctly
Expected behaviour: No error dialogs, interface loads and you're able to add annotations

This context works:

$context = new stdClass();
$context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */
$context->api_version = 3;
$context->name = 'video4';
$context->description = '';
$context->tag = '';
$context->conditions = array(
'islandora_context_condition_collection_member' => array(
'values' => array(
0 => TRUE,
),
'options' => array(
'islandora_collection_membership' => array(
'islandora:audio_collection' => 'islandora:audio_collection',
'islandora:video_collection' => 'islandora:video_collection',
'islandora:testing1' => 'islandora:testing1',
'islandora:entity_collection' => 0,
'islandora:bookCollection' => 0,
'islandora:sp_disk_image_collection' => 0,
'islandora:newspaper_collection' => 0,
'islandora:compound_collection' => 0,
'islandora:sp_large_image_collection' => 0,
'islandora:sp_web_archive_collection' => 0,
'islandora:sp_basic_image_collection' => 0,
'islandora:sp_pdf_collection' => 0,
'ir:citationCollection' => 0,
'islandora:kim' => 0,
'crudmix:collection' => 0,
),
),
),
);
$context->reactions = array(
'css_module' => array(
'sites/all/modules/islandora_web_annotations' => array(
'sites/all/modules/islandora_web_annotations/lib/css/video-js/video-js.css' => 'sites/all/modules/islandora_web_annotations/lib/css/video-js/video-js.css',
'sites/all/modules/islandora_web_annotations/lib/css/annotator.min.css' => 'sites/all/modules/islandora_web_annotations/lib/css/annotator.min.css',
'sites/all/modules/islandora_web_annotations/lib/css/ova.css' => 'sites/all/modules/islandora_web_annotations/lib/css/ova.css',
'sites/all/modules/islandora_web_annotations/lib/css/rangeslider.min.css' => 'sites/all/modules/islandora_web_annotations/lib/css/rangeslider.min.css',
'sites/all/modules/islandora_web_annotations/lib/css/richText-annotator.min.css' => 'sites/all/modules/islandora_web_annotations/lib/css/richText-annotator.min.css',
),
),
'js_module' => array(
'sites/all/modules/islandora_web_annotations' => array(
'sites/all/modules/islandora_web_annotations/lib/js/annotator-full.min.js' => 'sites/all/modules/islandora_web_annotations/lib/js/annotator-full.min.js',
'sites/all/modules/islandora_web_annotations/js/video/video.js' => 'sites/all/modules/islandora_web_annotations/js/video/video.js',
),
),
'js_path' => array(
'sites/all/modules/islandora_web_annotations/lib/js' => array(
'sites/all/modules/islandora_web_annotations/lib/js/ova.js' => 'sites/all/modules/islandora_web_annotations/lib/js/ova.js',
'sites/all/modules/islandora_web_annotations/lib/js/tinymce.min.js' => 'sites/all/modules/islandora_web_annotations/lib/js/tinymce.min.js',
'sites/all/modules/islandora_web_annotations/lib/js/richText-annotator.min.js' => 'sites/all/modules/islandora_web_annotations/lib/js/richText-annotator.min.js',
'sites/all/modules/islandora_web_annotations/lib/js/rangeslider.min.js' => 'sites/all/modules/islandora_web_annotations/lib/js/rangeslider.min.js',
),
),
);
$context->condition_mode = 0;

File path to add: sites/all/modules/islandora_web_annotations/lib/js

Update basic image documentation

Move documentation to the Wiki. For this issue, update the setup for adding annotation capabilities to basic image collections.

Review using Annotorious as a plugin for AnnotatorJs

AnnotatorJs is a generic solution for web annotations. Well supported projects such as Hypothesis use AnnotatorJs. Annotorious can plugin to AnnotatorJs: http://annotorious.github.io/plug-outs/okfn-annotator.html.

Additional features could be implemented by using Annotorious as a plugin for AnnotatorJs. We also want to consider using Hypothesis for the front end. This ticket is to review the pros and cons of using Annotorious as plugin for AnnotatorJs.

Size limit of annotation

If an annotation with a lot of text is created (entire first page from here) then the edit and delete tools become unavailable to the user.
screen shot 2017-01-16 at 1 50 54 pm

An annotation does not load in the interface and exists in Fedora. Can make multiple annotation containers.

  1. Created a new large image object as admin
  2. Masqueraded as an authenticated user with permission to create web annotations (user has been successfully used to create annotations in this instance) and created an annotation. I received confirmation that annotation was created. (I did not check to see if the block underneath was updated. I'm sorry for that.)
  3. Switched to a different authenticated user and attempt to load annotations. Annotation does not load.
  4. Switched to admin account and verified that annotation won't load for this user either. Also verify that the annotation and annotation container was created (by directly navigating to expected PID via URL)
  5. As Admin, created an annotation successfully. Other test users can load the annotation.
  6. Navigate to expected PID using the browser URL as admin. Discover that a second annotation container has been created at expected PID. Verified that two annotation containers were created for a single islandora object.

#s are a little arbitrary here - criticize my reporting technique! Happy to provide additional details/reformat.

Update large image documentation

Move documentation to the Wiki. For this issue, update the setup for adding annotation capabilities to large image collections.

Feature request: indicating the parent in an Annotation object, having that be an indexable field

Feature request: indicating the parent in an Annotation object, having that be an indexable field

Solr currently indexes an annotation value and annotation title (which has the parent PID listed in the title). Although the annotation currently indicates the parent, you cannot easily navigate back to the parent in the search results.

If we isolate the parent pid and index that, when we do a search for annotations we can link back to the parent by configuring the display Solr settings.

@kstapelfeldt let me know what you think of this as an additional task for development
@Natkeeran how long do you think this would take in terms of development time?

Basic image - some times annotations are not loading

Steps to reproduce:
Some times, when navigating to a basic image and click to load the annotations. Those annotations do not get loaded. If you refresh the page and load it, it will.

Expected result:
It should load the basic image annotations.

Create End to End/User Acceptance (manual) test plan

Create a test plan with sanity and extended test cases for manual end to end testing. This test plan should cover range of common use cases.

A typical format for test case is as below:

  • Test Case Info: #, Name/Description, System, Subsystem, Executed By, Executed Date,
  • Use Cases/Requirements Tested
  • Steps
  • Expected Results
  • Actual Results or Pass/Fail

A sample template: https://images.template.net/wp-content/uploads/2015/12/29053639/Test-Case-Template-PDF.pdf

Implement ETag/If-Match based check before update/delete

Web Annotation Protocol requires an ETag to be checked before updating or deleting an annotation. ETag is generated by the server (https://tools.ietf.org/html/rfc7232#section-2.3.1). Checksum, version or timestamp could be used an as ETag. The request must include the ETag in the "If-Match" header parameter when making the request. Example from https://www.w3.org/TR/annotation-protocol/#update-an-existing-annotation.

PUT /annotations/anno1 HTTP/1.1
Host: example.org
Accept: application/ld+json; profile="http://www.w3.org/ns/anno.jsonld"
Content-Type: application/ld+json; profile="http://www.w3.org/ns/anno.jsonld"
Content-Length: 294
If-Match: "_87e52ce126126"

{
  "@context": "http://www.w3.org/ns/anno.jsonld",
  "id": "http://example.org/annotations/anno1",
  "type": "Annotation",
  "created": "2015-02-01T10:13:40Z",
  "body": {
    "type": "TextualBody",
    "value": "I REALLY like this page!"
  },
  "target": "http://www.example.com/index.html"
}

If the ETag has changed, then the request should not be processed. An appropriate message should be returned tot the user. User can choose to reload all annotations and try to preform the operation again.

Implement Solr search of the annotations

Annotations are fedora objects with WADM Content Model. Currently, they are being created as JsonLD data-stream with application/ld+json MIME type. GSearch does not support indexing of application/ld+json datastreams. We have two options:

  • Change the Annotation MIME type to xml for storage purposes. Use that for indexing. When, retrieving, convert it back to json-ld.
  • Create a derivative xml for search purposes.

Large image (openseadragon) - annotations position issue

Steps to reproduce:

  1. Go to a large image page
  2. Scroll down on the page
  3. Create an annotation

Actual:
The annotations are positioned below the selected selection area.

Expected:
The annotations should be positioned in the selected selection area.

Developer Notes:
It appears that when the user scrolls, the annotations are placed down the image at a distance proportional to the scrolling distance.

Can create annotation without annotation container

When the content models are ingested for the Web Annotation solution pack, they become available in a number of default locations (including the collection management interface). Using this, it is possible to select the content models in the collection policy and ingest objects. One can ingest an annotation without an annotation container. Explore options for removing the content models from the collection policy list.

Let me know if you guys want more details/steps to reproduce

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.