Project

nolij_web

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
A Ruby wrapper for the Nolij Web API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 5.0.0
>= 0
~> 1.13

Runtime

 Project Readme

Reed longer maintains this gem¶ ↑

NolijWeb¶ ↑

Talk to the Nolij Web API. This gem contains a subset of available API methods for the Nolij Web API. Document submission/printing(retrieval) are the main focus. Methods for folder listings, work flow request, and generated urls for the viewer are provided.

The raw connection can be used to execute other types of requests.

Installation¶ ↑

Add this line to your application’s Gemfile:

gem 'nolij_web'

And then execute:

$ bundle

Or install it yourself as:

$ gem install nolij_web

Basic Usage¶ ↑

You should be able to use the handler for basic requests. Handler method options are based on the options from the Nolij Web API documentation. Underscores have been added to the option names.

require 'nolij_web'

handler = NolijWeb::Handler.new(config_hash_or_path_to_config_yaml)

handler.folder_info({:folder_id => '1111111'})

Configuration¶ ↑

Configuration can be passed as an assigned hash

config = {
          :username => 'username',
          :password => 'password',
          :base_url => 'https://somedomain.com/NolijWeb',
          :verify_ssl => true # optional, defaults to true
         }

Configuration can be read from a YAML file by passing the file path. The file should contain a hash structure:

---
:username: 'username'
:password: 'password'
:base_url: 'https://somedomain.com/NolijWeb'
:verify_ssl: true # optional, defaults to true

Passing a block to NolijWeb::Handler methods¶ ↑

You may pass a custom block to handler methods. Please note that your block should return the response for successful request. Some of the methods rely on parsing XML responses from the server.

Using the Connection Directly¶ ↑

You can use the handler’s connection directly. An execute method has been provided to handle opening and closing of sessions. See NolijWeb::Connection for more info.

conn = NolijWeb::Connection.new(config_hash_or_path_to_config_yaml)
conn.execute() {
  @folder_info = conn.get_custom_connection([conn.base_url, 'handler', 'api', 'docs', '1_1'].join('/'), conn.headers)
  @doc_meta = conn.get_custom_connection([conn.base_url, 'handler', 'api', 'docs', '1_1', 123, 'documentmeta'].join('/'), conn.headers)
}

You can also manually open and close connections if necessary:

conn = NolijWeb::Connection.new(config_hash_or_path_to_config_yaml)
conn.establish_connection
  ... do some stuff with custom connection methods.
conn.close_connection

Contributing¶ ↑

  1. Fork it

  2. Create your feature branch (‘git checkout -b my-new-feature`)

  3. Commit your changes (‘git commit -am ’Add some feature’‘)

  4. Push to the branch (‘git push origin my-new-feature`)

  5. Create new Pull Request