Giter Club home page Giter Club logo

performant-software / annotation-studio Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hyperstudio/annotation-studio

5.0 11.0 1.0 88.38 MB

An online annotation platform for teaching and learning in the humanities.

Home Page: http://www.annotationstudio.org

License: GNU General Public License v2.0

Ruby 37.47% JavaScript 14.93% HTML 41.41% CoffeeScript 0.52% CSS 0.96% Shell 0.60% SCSS 4.10% Procfile 0.01%
teaching digital-humanities annotation rails ruby javascript

annotation-studio's Introduction

Annotation Studio

An annotation platform designed for teaching and learning in the humanities, and with aspirations to more general use.

Works with: MIT Annotation Data Store

There are two servers required to run this application. This one, and the MIT Annotation Data Store.

You MUST get the Annotation server running to be able to create or view annotations.

Getting Started

Things to install

Annotation Studio uses PostgreSQL

The MIT Annotation Data Store requires Node.js (0.10.21), NPM (1.3.11) and MongoDB

General Installation

Set up Rails (if you haven't yet, try: [thoughtbot's Laptop repo] (https://github.com/thoughtbot/laptop))

annotation-studio```

  • cd annotation-studio
  • ./bin/setup

which will:

  • Drop existing databases
  • Run migrations and prepare the test database
  • Seed the application
  • Install the MIT Annotation Data Store under ./tmp/annotation_data_store
  • Create an example application.yml

After setting up the app, run:

bundle exec foreman start -f Procfile.dev

to spin up development dependencies. You can exist the development daemons by hitting ctrl-c, per normal unix semantics.

Installation on Heroku

If you would like to run the application on Heroku (recommended), do the following

  • Create a Heroku app heroku apps:create $APPNAME
  • Add the Heroku PostgreSQL add-on heroku addons:add heroku-postgresql
  • Use Figaro to load your application.yml into environment variables and communicate them to Heroku
    • rake figaro:heroku[$APPNAME]

Multitenancy

This app uses the apartment gem to allow multiple domains to be hosted in a single instance.

To create a new tenant:

Requirements

  • Tenant banner image
  • Tenant accent color (hex code)

Rails config

  • Upload banner image to app/assets/images/
    • A lot of tenants provide large banner images (3MB+) - in these cases, it's a good idea to resize the image by 50% or so.
  • Create tenant metadata file in app/views/saml/ (use an existing tenant metadata file as a guide)
  • Create tenant brand file in app/views/shared/ (use an existing tenant brand file as a guide)
  • Add entry for new tenant to config/domain_specific/config.yml (use an existing tenant entry as a guide)
  • Precompile assets: RAILS_ENV=production bundle exec rake assets:precompile && git add public/assets/ && git commit -m "Add precompiled assets"

Add Google Analytics code

  • Create property for new tenant at Admin > Create Property, then create data stream for newly created tenant property
    • Data stream platform: Web
    • Note the created Measurement ID (“G-XXXXXXXX”) — this will be used when creating a tenant record in the admin dashboard

Admin dashboard config

Add DNS listing to Heroku

  • @jamiefolsom typically creates a CNAME record for the new tenant; once this is done, add the new domain to the cove-studio app in Heroku under Settings > Domains

Copy over vetted documents

  • Run the copy_vetted_documents rake task through the Heroku CLI:
    • heroku run rake copy_vetted_documents[source-db,destination-db] -a cove-studio
  • source-db value is usually cove-studio

Add initial user

  • Using rails console, create a new User for Dino Felluga ([email protected])
  • Be sure to switch over to new tenant database first (Apartment::Tenant.switch!(‘name-of-tenant-db)
  • Add admin role to user (User.find(1).set_roles = [“admin”])

Add roles

  • In the Rails console, check the list of roles with Role.all
  • There should be student, teacher, and admin
  • Create any that don't already exist

Deploy to production

SAML integration

You will need to integrate COVE with the new tenant's SAML system. There are certain requirements for the settings:

  • encryptAssertions should be set to false
  • X509 fingerprint (usually the client provides a full certificate - you can Google for a website that converts it to a fingerprint)
  • Attributes that need to be released by the client:
    • email: 'urn:oid:0.9.2342.19200300.100.1.3'
    • firstname: 'urn:oid:2.5.4.42'
    • lastname: 'urn:oid:2.5.4.4'

There will still be issues, because every school's system is just a little bit different.

A common issue is that the school forgets to disable encryptAssertions - when there are login issues, always double-check for this first. A typical sign of encryptAssertions being set incorrectly is when the user seems to sign in successfully, but is kicked back to the homepage. If you watch the server logs, you'll see Authentication failure! invalid_ticket: OneLogin::RubySaml::ValidationError, An EncryptedAssertion found and no SP private key found on the settings to decrypt it., confirming that the setting is incorrect on the tenant's end.

Microsoft Azure

If the school uses Microsoft Azure, releasing the correct attributes in a way that COVE understands is a bit counterintuitive. For each attribute, the name field should be the "urn:oid" identifier from above.

The setup that Azure requires is:

Name Source Attribute
urn:oid:2.5.4.42 user.givenname
urn:oid:2.5.4.4 user.surname
urn:oid:0.9.2342.19200300.100.1.3 user.mail

The "namespace" field on the names should be kept empty (there may be something there by default).

OpenAthens

As of this writing, two COVE tenants use OpenAthens.

OpenAthens requires a slightly different metadata file. In each of the two cases, the tenant had to do some special setup on their side.

Take a look at doc/openathens_example_metadata.xml for an example - this tenant reached out to OpenAthens support after lots of back-and-forth with us, and they provided the tenant with this working metadata file.

Especially note the wantsAssertionsSigned="false". Turning off encrypted assertions tends to be a pain point for new tenants, and OpenAthens makes it especially challenging.

Caveats

  1. If a domain does not have a matching Tenant, the default "public" tenant will be used.
  2. Admin users are shared across all tenants, and therefore shouldn't be created and granted to single-tenant users

Tenant Name Changes

For future reference, the Mongo query for updating annotations when a tenant changes their name/email is available at doc/torontomu_annotations_mongo_query.

User Support and Developer forum

http://support.annotationstudio.org

Thanks

Thanks to:

Contributors

Lab

Developers

License

GPL2: http://www.gnu.org/licenses/gpl-2.0.html

annotation-studio's People

Contributors

ajolipa avatar akstuhl avatar andrewmagliozzi avatar camdendotlol avatar djcp avatar dleadbetter avatar gursoy avatar jamiefolsom avatar jhilker avatar lwjameson avatar mailbackwards avatar mattmsumner avatar nicklaiacona avatar paulrosen avatar performantdave avatar raschnepper avatar sarastanton avatar sethwoodworth avatar timdunn22 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

cdrh

annotation-studio's Issues

Improper closure when both side panels are opened.

When you are in document view, and open both side panels simultaneously, when you click within the document body, both panels close. However, the one that was opened first has a kind of "precedence", and when it slides closed, it drags the other closed in the same direction. Thus, if I open the right panel first, and then the left, when I click in the document body, the right panel closes by sliding off to the right properly, but the left panel closes by sliding into the center of the screen, as it is "dragged" off by the closing left panel. Once dragged into the center of the screen, the panel closes, so there is not a functionality bug here, just an aesthetic one.
sidebar_center

As an editor, I want to import texts and make them available to annotators of my choosing

I want to:

  • Upload word documents, PDFs, text files, HTML, etc
  • Convert them to a common annotatable format (HTML)
  • Continue to edit them to add in chapters, sections, formatting, media, etc
  • Store them and mark them as visible to specific groups of annotators
  • Optionally mark them as publicly visible without login
  • Temporarily archive or permanently delete them if I no longer want to use them

As a NAVSA member, I want to sign into navsa.org and get access to ANS

  • navsa.org is a wordpress site -- it would be the OAuth provider in this case.
  • studio.covecollective.org is the rails app running on heroku -- it would be a client.
  • accounts only exist in navsa -- can we offer a "Sign up with navsa account" option that creates an AS user account?
  • Wildcard cert for covecollective.org has been purchased -- need to verify same cert can be used with www.covecollective.org as well (Drupal app on pantheon).

document conversion requires a refresh

When I have uploaded a new document, and open it for the first time to annotate it, I am given the message: "Please wait. The document is being converted." That's all good, but the message never goes away. It requires a manual refresh by the user to see the document. If the document is not going to refresh automatically when the conversion is done, the page should at least advise the user "Please refresh the screen after a few moments."

Not authorized to view my preview

When I take a snapshot of my document, and attempt to preview it, I am returned to my dashboard and told that I am not authorized to access this page.

As a reader, I want to filter annotations

By metadata fields:

  • Author
  • Category
  • Tag

This requires:

  • Updating the annotations API to support plucking fields from annotations.
  • Updating the annotations controller, to supply an endpoint for loading them.
  • Updating the snapshot to include them.
  • Then the document viewer can incorporate support for filtering across these values.

As a user, I want some training on AS

General

  • Task: Record screencast(s) about COVE components: AS, COVE, NAVSA.
  • Audience includes both technical and non-technical folks.
  • Aim is both to explain the use of the tools, and to sell the approach.
  • Keep screencasts 3 min or so.

As a reader, I want important content from annotation text included in the snapshot

Like comments, links, images and image attributes, etc, e.g: <p><a class="catalog-popup" href="catalog/image/event:26" data-parent="" data-gallery="remoteload" data-title="Battle of Hampton Roads"><img src="http://s3.amazonaws.com/sites-mel-catalog.herokuapp.com/images/images/000/002/569/thumb/1280px-The_Monitor_and_Merrimac.jpg?1468592161" alt="" /></a></p>

As an annotator, I want to annotate texts

I want to:

  • Select part of the document
  • Save that selection as an empty highlight or:
  • Save that selection with a comment as an annotation
  • Add links, images or other media to a comment
  • Add pre-existing categories to an annotation
  • Create and add my own tags to an annotation
  • Mark an annotation as private or shared with any group (see #5)
  • Edit an annotation
  • Delete an annotation
  • View all my annotations on a single document
  • View all my annotations across documents
  • Filter annotations (see #1)
  • Delete an annotation

Document annotation and export

Overview

The main point of "integration" between Annotation Studio and the COVE is that it will be possible to take a static copy of an edition from Annotation Studio, and bring it into the COVE website, for viewing there.

For the purposes of COVE, an edition will be defined as a container for resources, including text documents, annotated or not, images, maps, timelines, etc, and meta-information about them, including how they are to be ordered, and other metadata.

Export

Exporting an edition is a one-way trip. Once created, an edition may be exported and viewed outside of Annotation Studio using a dedicated viewer, but that file may not be changed; only replaced with a new version.

Annotations

Annotations to be included in the edition must be selected by the editor in the annotation environment, prior to creating the edition. Once the desired set of annotations is created, the editor will invoke the export feature, which will store the edition in a format suitable for export.

At that point, the Annotations will be inserted into the document, and a snapshot of the document taken. For a given snapshot, this is a non-reversible process, although editions can be deleted without affecting the source text or annotations, and new ones created, on the basis of the same document, and the same, or another set of annotations.

Viewing

This Epic doesn't concern itself with the viewing of the final document, although Annotation Studio will allow a document to be previewed.

Site does not redirect when not logged in

If I try to navigate to a bookmarked page within the site without having logged in already, I am told the page does not exist, instead of being redirected to login.

As an annotator, I want to link to COVE and BRANCH resources from annotations

Note that there is some question about how best to manage and link to media assets (images, video, audio, etc). Currently AS allows for insertion of existing web-accessible media, but not upload and storage. Either we could use COVE for storage, or we could stand up MEL Catalog for storage purposes. The latter would have the advantage of allowing future tenants of the edition pipeline to move documents to sites which are not capable of media storage, without losing that capacity.

Remove figaro

Since heroku now provides config:push and config:pull, we should remove figaro.

UI changes for COVE

  • Class/group nomenclature
  • Document editing phase nomenclature
  • Publishing process

As a reader, I want to read documents within COVE

Documents created and/or annotated within COVE, within Annotation Studio, or elsewhere, should be stored with the COVE website, independently of any external tool, and viewable within the edition section of the COVE website.

Selections from MEL catalog are not attaching text

If I select a book from the catalog, the document creation fields are filled out for me, but the main body text is not attached to the document. When I create, it says the document was created, but there is no text.

Document import and reading

Overview

The second main piece of functionality to allow for Annotated editions produced in Annotation Studio to be viewed on the COVE website is an edition viewer, which will act as a way to present editions along with their annotations.

Controls

The viewer will offer several features to facilitate reading.

  • It will be responsive, meaning that it will allow viewing of the edition on mobile devices such as smart phones and tablets, with smaller screens, and using touch rather than keyboard or mouse controls.
  • A "page turner" will offer a pagination mechanism, allowing a reader to move through a text in familiar, evenly sized steps, each presenting a chunk of the text that fits within the viewport.
  • An annotation viewer will allow each annotation to be shown with some of its relevant metadata, and hidden when it's not needed.

Documents annotated within COVE

Editions created within the COVE annotation environment will be converted to use this reader as well, so that they render in the same way as documents annotated within Annotation Studio.

As a NAVSA member I want to sign into navsa.org, and get access to covecollective.org

How to test:

Assumptions:

  • You have an account on navsa.org, using an email address that's not yet associated with an account on http://dev-rc-distro.pantheonsite.io (if not, ask me to set that up for you).

Steps:

  1. If you're logged in to navsa.org with an account other than the one mentioned above, go there and log out.
  2. Go to http://dev-rc-distro.pantheonsite.io and click log in, and wait for login to complete
  3. If you're logged into navsa.org with the correct account, you'll now be logged into http://dev-rc-distro.pantheonsite.io, if you're not yet logged in, you'll be prompted to log in to navsa.org, then redirected to http://dev-rc-distro.pantheonsite.io and logged in.

Background:

  • navsa.org is a wordpress site -- it would be the OAuth provider in this case.
  • covecollective.org is a drupal site on pantheon.io -- it would be a client.
  • accounts already exist in both places -- can we offer a "Sign in with navsa account" option?
  • Wildcard cert for covecollective.org has been purchased -- need to verify same cert can be used with studio.covecollective.org as well (Rails app on heroku).
  • Related to #62
  • @akstuhl is going to lead on this; @daverett can help

Single Sign On

Overview

To use COVE tools, you must have a membership in NAVSA.

Members shouldn't have to sign in to (authenticate themselves with) two or more websites to be authorized to use those two or more different sites. We should provide them with a "single sign on" feature (SSO).

Scope

This Epic is concerned only with Authentication, that is: confirming that users have NAVSA accounts, which is the criterion for access to the COVE toolset, as a precursor to granting them access to the two COVE sites: COVE (Editions) and COVE Studio.

Out of scope for this Epic and the user stories it contains is Authorization, which concerns what specifically given users, whether by virtue of having access, or by virtue of being members of groups or roles, should be able to do within those tools.

Also, not in scope for this epic is and synchronization of user data between systems.

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.