sul-dlss/libsys-webforms

Name: libsys-webforms

Owner: Stanford University Digital Library

Description: Rails applications for various Symphony reporting & updating tools.

Created: 2016-01-25 22:50:20.0

Updated: 2018-04-11 16:52:24.0

Pushed: 2018-05-22 23:34:46.0

Homepage:

Size: 914

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status | Coverage Status | Dependency Status

Library Systems Webforms App

This is a Rails application to be a front-end for various Symphony reporting & updating tools. Intended to replace the web forms generated from the 'sulohs' servers.

Requirements
  1. Ruby (2.1.1 or greater)
  2. Rails (4.2.0 or greater)
  3. An Instance of Symphony to connect to
  4. Oracle client
Installation

Clone the repository

clone https://github.com/sul-dlss/libsys-webforms.git

Change directories into the app and install dependencies

le install
Development

Libsys-Webforms depends on a backing Oracle production database, so when running the project in development, you will need to run the ruby-oci8 gem and the activerecord-oracle_enhanced-adapter as a pass-through to the development sqlite database. If you get a ConnectionAdapters::OracleEnhancedAdapter error when running a rails or rake task, temporarily add :development to the group that contains the oracle gems:

p :production, :development do
m 'activerecord-oracle_enhanced-adapter', '~> 1.6.0'
m 'ruby-oci8'

…but do not commit this change, and revert it before deployment!

The various oracle gems (including the plsql gem) use an initializer (config/initializers/oracle.rb) to configure the oracle emulations. See that file for more information about the configuration.

Setting up fixtures for development

In order to have the tables populated for testing the app in development you should load the fixture data into the tables with:

S_ENV=development rake db:seed

You should also set up a user for you to use when testing the app in development. Do this in the Rails Console:

ils c

4 :001 > au=AuthorizedUser.new
4 :002 > au.user_id = 'some-user'
4 :003 > au.user_name = 'Some User'
4 :004 > au.mgt_rpts = 'Y'
4 :005 > au.unicorn_updates = 'Y'
4 :006 > au.sal3_batch_req = 'Y'
4 :007 > au.sal3_breq_edit = 'Y'
4 :008 > au.save

Start the development server

TE_USER=some-user rails s
Testing
Running the migrations for test

Before running the tests with rake you should run the migrations in the test environment by running:

S_ENV=test rake db:test:prepare
S_ENV=test rake db:seed

NOTE: Travis uses db:test:prepare rather than db:migrate

Rake, etc.

The test suite (with RuboCop style enforcement) will be run with the default rake task (also run on travis)

$ rake

The specs can be run without RuboCop enforcement

$ rake spec

The RuboCop style enforcement can be run without running the tests

$ rake rubocop
Deployment

To deploy to development:

$ cap dev deploy
Command-line tasks

There are some command-line tools the application provides. For example, to upload and delete batches:

$ bundle exec rake webforms:change_current_location[:path_to_file,:current_lib,:new_curloc,:email, :comments]
$ bundle exec rake webforms:delete_batch[batch_id]    
Ckey2Bibframe Webform

The “Ckey2Bibframe” webform allows you to enter a Symphony ckey and view marc21-to-xml and marcxml-to-bibframe2 results in the browser. In order for this functionality to work you must install the LOC Marc2Bibframe2 Converter and place it under this application's root. Running the LOC marc2bibframe2 converter via libsys-webforms requires the xsltproc command-line tool be installed on your system (see http://www.xmlsoft.org). After cloning this project, simply cd libsys-webforms and then git clone https://github.com/lcnetdev/marc2bibframe2.git. If it is not already there, you must also create a lib/xform-marc21-to-xml-jar-with-dependencies.jar file that is compiled from https://github.com/sul-dlss/ld4p-marc21-to-xml (see https://github.com/sul-dlss/ld4p-marc21-to-xml#compiling-and-executing, it should be placed in this app's lib folder as well).

PL/SQL Jobs

Based on the configuration of a pl_sql_job in the settings/{environment}.yml file, e.g.:

ql_jobs:
rc_stats_job:
text: 'Circ stats report daily processing'
command: 'circ_stats_rpt.daily_processing'
sunet_ids:
  - 'usera'
  - 'userb'

links with collapsed “Run” buttons will automatically be created on the home page and will only appear for people who are logged in and listed in the sunet_ids section of the config. Clicking the “Run” link will execute the configured PL/SQL command via the already configured OCI8 connection gem (using the environment's database.yml connection details). If more jobs need to be added in the future, just fill out a new section under the pl_sql_jobs section in the https://github.com/sul-dlss/shared_configs repository and follow the instructions there for deploying to the application server.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.