Giter VIP home page Giter VIP logo

leaf_addons's Introduction

LeafAddons

Build Status Coverage Status Maintainability Test Coverage Inline docs

LeafAddons provide additional functionality for Hyrax or Hyku repositories via a set of generators / plugins / tasks

Importers

Importers for EPrints JSON, MARC, and directories of files.

Please see the wiki for further info:

Install with:

rails g leaf_addons:importers

Devise Invitible

Adds and enables invitation only login with Devise invitible.

Install with:

rails g leaf_addons:invitible

Coversheets

Adds and enables creation of coversheets on download for PDF and office document formats.

Install with:

rails g leaf_addons:coversheet

OAI-PMH

Adds and enables an oai-pmh interface.

Install with:

rails g leaf_addons:oai_pmh

Tasks

Delete unused access control policies:

rake leaf_addons:cleanup_accesscontrol

User accounts tasks:

List them with rake -T leaf_addons

Including:

rake leaf_addons:make_me_admin[[email protected]]
rake leaf_addons:invite_user[[email protected]] # if devise invitible is enabled
rake leaf_addons:invite_users['/tmp/my_file.csv'] # CSV file must contain a header row and three columns: email, display name, admin; admin column should contain the word true to indicate that the given user should be an admin

leaf_addons's People

Contributors

cziaarm avatar waffle-iron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

leaf_addons's Issues

CreateDerivatives and mini_magic

CreateDerivatives is really slow. I'm also seeing LOADS of mini_magick* and magick* temp files in /tmp. Uploading 17 PDFs took ages.

Index 'indexcodes'

When we have an 'index codes' txt file from eprints, this is a compressed version of all words in the extracted text, so it should be indexed in solr to complement and enhance anything we get from the full-text extraction in solr.

Make manifest metadata configurable

at the moment it's tied to required fields, but if this were a config then it would be easy to change without overriding code

(this would be a PR to Hyku)

Image-ify Generator

  • Model: include HasRendering and add rendering_ids to terms
  • Form: def secondary_terms super - [:rendering_ids] end
  • Presenter: < Hyku::ManifestEnabledWorkShowPresenter
  • Controller: include Hyku::IIIFManifest

UV / IIIF Improvements 1-5

  • 1. Only include public resources in public manifest (cf Hyku issue 1170)
  • 2. Manifest should include (cf Hyku issue 1171):
    • 2.1 images only (phase one) - Hyku PR
    • 2.2 all UV-able resources (phase two)
    • 2.3 user configuration of manifest contents (phase three)
  • 3. Expose more metadata in More Information - IN PROGRESS, see Hyku PR and iiif_manifest PR
  • 4. Download whole PDF for an image-based object - IN PROGRESS, see Hyku issue 1372
  • 5. Downloads not currently fully working (cf UV Issue 464) FIXED IN NEXT UV

Hyku uses iiif_manifest: https://github.com/samvera-labs/iiif_manifest

Gem-ify it

Turn HykuLeaf into a gem containing:

  • base eprints importer
  • some general purpose rake tasks
  • generator for making a model into one that uses Universal Viewer

Investigate replacing RIIIF with IIP

Would be nice (possibly necessary!) to be able to swap out RIIF and use IIP. Look at how to do this and see if it would be easy to add as a configuration option.

Q. in terms of IIP pointing to files, is there any reason why IIP couldn't just point at fcrepo.object.directory ? after all, it's easy to find the file using the UUID (and via FileSet from solr using the digest)

Hyku uses RIIIF and so makes certain assumptions, eg. the path to images (/images/fileset/files/file) and the hostname for the IIIF image service (same as the app).

Files to look at in Hyku:

Empty values being added to Fcrepo

Single-value elements are adding 'empty' values to Fcrepo, and then showing up in the display interface.

Two solutions:

  1. Fix it, eg. add something to the actor to delete any attributes that equal "" (or " ") before save.
  2. Use multi-valued for everything

500 error in FCREPO when attempting to add extracted_text to an existing object

When updating the extracted text, I'm seeing the following error. This happens when the original file is TXT. I have observed it when adding to a PDF original_file, but this works more consistently than not.

No problem when I do a direct add of file into 'files' container via GUI and via CURL (as expected)

This is the code:

local_file = Hydra::Derivatives::IoDecorator.new(File.open(path, "rb"))
          local_file.original_name = path.split('/').last
          local_file.mime_type = Hydra::Works::DetermineMimeType.call(local_file, local_file.original_name)
          Hydra::Works::AddFileToFileSet.call(fileset,
                                              local_file,
                                              type.to_sym,
                                              versioning: false)

It works via this very manual method:

  • fileset.association(:extracted_text).build
  • PUT the file to the generated uri with curl using the FCR REST API
  • add the ExtractedText rdf:type via api or gui

I've ruled out the being the file itself and also that it's a Fedora problem proper.

I can add this file to one fileset, but not the other, which hints at something to do with the original_file file in the fileset, which is a plain text file. It seems like it's something the AF / LDP are trying to do but I'm struggling to figure out is WHAT AF / LDP are doing ... I get nothing in the logs for any of this.

In FCRepo logs:

INFO 15:06:37.142 (FedoraLdp) PUT resource 'dev/6d/9c/fd/d2/6d9cfdd2-a775-4eb7-9575-f53f816f33f0/files/24eee720-d0a4-4ab3-a345-4d32bcdba79d'
DEBUG 15:06:37.142 (FedoraBinaryImpl) Created content node at path: /dev/6d/9c/fd/d2/6d9cfdd2-a775-4eb7-9575-f53f816f33f0/files/24eee720-d0a4-4ab3-a345-4d32bcdba79d/jcr:content
ERROR 15:06:57.163 (RepositoryExceptionMapper) Caught a repository exception: java.net.SocketTimeoutException: Read timed out

In Hyku logs:

Ldp::HttpError: STATUS: 500 org.modeshape.jcr.value.binary.BinaryStoreException: java.net.SocketTimeoutException: Read timed out
	at org.modeshape.jcr.value.binary.FileSystemBinaryStore.storeValue(FileSystemBinaryStore.java:128)
	at org.modeshape.jcr.value.binary.AbstractBinaryStore.storeValue(AbstractBinaryStore.java:251)
	at org.modeshape.jcr.value.binary.BinaryStoreValueFactory.create(BinaryStoreValueFactory.java:257)
	at org.modeshape.jcr.value.binary.BinaryStoreValueFactory.create(BinaryStoreValueFactory.java:49)
	at org.modeshape.jcr.JcrValueFactory.createBinary(JcrValueFactory.java:149)
	at org.modeshape.jcr.JcrValueFactory.createBinary(JcrValueFactory.java:41)
	at org.fcrepo.kernel.modeshape.FedoraBinaryImpl.setContent(FedoraBinaryImpl.java:178)
	at org.fcrepo.http.api.ContentExposingResource.replaceResourceBinaryWithStream(ContentExposingResource.java:612)
	at org.fcrepo.http.api.FedoraLdp.createOrReplaceObjectRdf(FedoraLdp.java:361)

See samvera-tech post

Lowercase the emails in make_me_admin and add_users

The invitation link will lowercase the email in the background, so running 'make me admin' will fail to find the user if the email has capitals in it. So ... lowercase the input.

Check the add users script and make sure those get invited as lowercase (I suspect they will).

Review shib auth work against new invitible Hyku code

Currently I have a conflict in the new migration added for shib with a duplicate column. This is caused (I believe) by the new invitible Hyku code, and should be easily resolved.

Also need to test out invitible and see if it plays with shib work.

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.