zenchild/viewpoint-spws — pull request #9 by marek-veber (2014-08-04 22:12:27+00:00)
Title: Add Views WebServices to enable list of fields in View::view_fields

I'd like to read list_items from SharePonit with custom fields:
1) there is need to read list of fields from View
a) so we need to get View::name
b) a than to get View::view_fields
2) use view_fields !!! don't change name by camel_case notation !!! to read the values in list_items

see my example:
require 'rubygems'
require 'viewpoint/spws'
site = 'http://example.site.com/ProjectZone/default.aspx'
user = 'DOMAIN\user'
pass = 'UserPassword'
# 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)

require 'pp'
list_name = 'ListOfProjects'
view_name = scli.get_view_collection(list_name).first.name
view = scli.get_view(list_name, view_name)
i = scli.get_list_items('ListOfProjects', :view_name => view_name, :view_fields => view.view_fields).first
pp i.fields