Git Product home page Git Product logo

viewpoint-spws's Introduction

Viewpoint for Sharepoint Web Services

This is a Ruby client library for Sharepoint Web Services. If you've used my Viewpoint library for Exchange Web Services you will no doubt notice a similar feel to this library. It however cannot be a one-for-one do to the way Sharepoint splits its web services among many different services.

There is still quite a lot that needs to be done with the model layer. However, if you are a more daring personality the web service back-end is fairly complete for the web services I've chosen to expose thus far. I've also tried to document each back-end method to its fullest and to provide links to the Microsoft docs where I fall short. Documentation should be up to date on rubydoc.info.

Example Usage

Connecting

require 'viewpoint/spws'
site = 'https://myspsite/site_a/Default.aspx'
# If using GSSAPI and the 'gssapi' gem you do not need to specify a user/pass
scli = Viewpoint::SPWSClient.new(site)
# Otherwise you can specify a user/pass
scli = Viewpoint::SPWSClient.new(site, user, pass)

Getting Lists

# Retrieve all Lists for this site
lists = scli.get_lists
# Retrieve a specific list
taskl = scli.get_list('Task List')
# Retrieve a specific list by GUID
mylist = scli.get_list('{9202CCD0-2EA7-012F-0C9A-58D3859A6B00}')

Information about a List

taskl.title
# => "Task List" 
taskl.description
# => "Test Task List" 
taskl.created
# => #<DateTime: 2010-02-17T04:44:28+00:00 ((2455245j,17068s,0n),+0s,2299161j)> 
taskl.modified 
# => #<DateTime: 2012-01-09T06:03:25+00:00 ((2455936j,21805s,0n),+0s,2299161j)> 

Retrieving Items

# Retrieves an Array of Items
tasks = taskl.items

Creating/Renaming/Deleting a Task (other types of ListItems are forthcoming)

t1 = taskl.add_item!(:title => "New Task")
# Set and call #save!
t1.rename  'My New Task'
t1.save!
# or use the autosave method
t1.rename! "My Really New Task"
# or use an auto-saving transaction
t1.update! do |l|
  l.rename 'New Name'
  l.set_priority :low
  l.set_status :waiting
end
t1.delete!

Upload a file to a DocumentLibrary List

doclib = scli.get_list 'Personal Documents'
doclib.add_file! :file => '/path/to/file'

My Links

viewpoint-spws's People

Contributors

zenchild avatar kalys avatar

Watchers

 avatar Sytchev Mikhail avatar Adilet Abylov avatar James Cloos avatar Rustam Sharshenov avatar

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.