Code Monkey home page Code Monkey logo

annotorious-elasticsearch-plugin's Introduction

Annotorious ElasticSearch Plugin

A simple Annotorious plugin that stores annotations on an ElasticSearch server. This plugin is meant primarily for demo purposes, and as an example for those interested in building their own storage plugins. I strongly advise against using this plugin in any kind of production environment. (Contributions to make it production ready are always welcome though ;-)

This plugin is licensed under the WTFPL.

Using this Plugin

Simply download the script, copy it to your server/Webspace and set it up with your page as described below.

  1. The plugin uses jQuery. Therefore you need to import jQuery before importing the plugin script.
  2. Add the plugin script to your page just like any other Annotorious plugin. Make sure the plugin script is loaded after the main Annotorious script.
  3. Attach the plugin to Annotorious using the anno.addPlugin API method.
  4. Specify the base URL of the ElasticSearch server using a base_url config param.

Example

....
  <head>
    <!-- Import main Annotorious script and CSS -->
    <link rel="stylesheet" href="http://annotorious.github.com/latest/annotorious.css" type="text/css" />
    <script src="http://annotorious.github.com/latest/annotorious.min.js"></script>
    
    <!-- Import jQuery - the ElasticSearch plugin depends on it! -->
    <script src="jquery-1.9.0.min.js"></script>
    
    <!-- Import the plugin script -->
    <script src="my-scripts/anno-elasticsearch-plugin.js"></script>
    
    <!-- Use Annotorious' JavaScript API to attach and activate the plugin -->
    <script>
      anno.addPlugin('ElasticSearch', { base_url: 'http://www.my-es-server.com/annotations/' });
    </script>
  <head>
....

Hacking on this Plugin

There is a test page in this project at /test/test.html. Simply open this test page in your browser and you're ready to go.

A word of caution: the test page points to my dev ElasticSearch server. Feel free to use that to hack & test away. But be aware that I'm not making any guarantees in terms of uptime and availability. Also, I'm occasionally flushing the server which means annotations will be lost without notice.

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.