Projects
XAOP Labs 
ActiveSP
The
ActiveSP library provides an object_oriented Ruby
interface to SharePoint. ActiveSP accesses SharePoint through its web
services
and thus does not rely on the Windows or .NET platform. ActiveSP is
fully
tested and supports SharePoint2007 and SharePoint2010.
ActiveSP represents concepts such as sites, lists, documents, list items, folders, columns (or fields), content types, users, groups, roles, permissions as Ruby objects that can be used to inspect and modify the data in a SharePoint repository in the good old Ruby way.
To get started with ActiveSP, you first need to install the gem:
gem install activespThis also installs the dependencies. Once everything is installed, you should be ready to go.
Create a file called test.rb with these contents:
require 'rubygems'
require 'activesp'
def browse(item, indentation = 0)
puts " " * indentation + "- " + item.class.to_s + " : " + item.url
case item
when ActiveSP::Site
puts " " * indentation + " Title = #{item.Title}, Description = #{item.Description}"
item.sites.each { |site| browse(site, indentation + 1) }
item.lists.each { |list| browse(list, indentation + 1) }
when ActiveSP::List
puts " " * indentation + " Description = #{item.Description}, Hidden = #{item.Hidden}"
item.items.each { |item| browse(item, indentation + 1) }
when ActiveSP::Folder
item.items.each { |item| browse(item, indentation + 1) }
when ActiveSP::Item
item.content_urls.each do |url|
puts " " * indentation + " Content URL = #{url}"
end
end
end
c = ActiveSP::Connection.new(:login => "your login", :password => "your password", :root => "URL of root site")
browse(c.root)Run this program with ruby test.rb. This will print out the structure of your SharePoint together with a few attributes of the objects in there.
Extensive documentation is available on GitHub.
