Coder Social home page Coder Social logo

extensis_portfolio's Introduction

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

extensis_portfolio's People

Contributors

tomasc avatar

Watchers

 avatar  avatar

Forkers

patbreault

extensis_portfolio's Issues

Extending the scope

Luck is playing into our cards. Originally we were going to import XML from TMS and then pull related images from Extensis. MCA however decided to make it easier for us: they will import them XML themselves to Extensis, so the only thing we need to do is to get everything from the Extensis Portfolio via the API. This means we need to extend the scope of this gem, to support pulling information about collection items. I will upload to Basecamp list of all fields in the Extensis, MCA will let as know as soon as they figure out which fields we should use. For now, it would be good to test how we pull other data than images from the Extensis.

Sharing session id

How can we nicely share the session id, so we don't need to login multiple times.

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.