Skip to content

tomasc/extensis_portfolio

Repository files navigation

Extensis Portfolio

Build Status Gem Version

A simple wrapper for the Extensis Portfolio API, which uses both SOAP and HTTP.

Installation

Add this line to your application's Gemfile:

gem 'extensis_portfolio'

And then run:

$ bundle

Or install it yourself as:

$ gem install extensis_portfolio

Usage

Create a connection to the Extensis Portfolio API:

connection = ExtensisPortfolio::Connection.new(server, username, password)

Where server is the url including port, without any suffixes e.g. http://demo.extensis.com:8090

Get a list of available SOAP operations:

connection.get_soap_operations

Downloading an asset

Download an asset:

ExtensisPortfolio::AssetDownloader.new(connection, asset_id, catalog_id).download_file

Querying

You can query for assets on a connection with the get_assets method. The query is built in two steps.

First you create an ExtensisPortfolio::AssetQueryTerm:

# AssetQueryTerm takes three parameters: "field_name", "operator" and "values"
# this query is for an asset where the "asset_id" field is equal to 1234
query_term = ExtensisPortfolio::AssetQueryTerm.new("asset_id", "equalValue", 1234)

Available value operators

The asset_query_term is then used to build a new instance of ExtensisPortfolio::AssetQuery:

query = ExtensisPortfolio::AssetQuery.new(query_term)

Which is finally used in the get_assets call:

# get_assets takes three parameters: catalog_id, query and an optional options hash
connection.get_assets(catalog_id, query)

Testing

The gem comes with a MiniTest / Guard test suite, simply run:

$ bundle install

Followed by:

$ bundle exec guard

Development

After checking out the repo, run bin/setup to install dependencies. Then, run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release to create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Notes

API fails:

  • getJobIDs should be getJobIds, this is the only place where id is with capital D... Means that Savon call has to be get_job_i_ds

Contributing

  1. Fork it ( https://github.com/tomasc/extensis_portfolio/fork )
  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 a new Pull Request

About

Extensis Portfolio API helper classes.

Resources

Stars

Watchers

Forks

Packages

No packages published