Class: Viewpoint::SPWSClient
- Inherits:
-
Object
- Object
- Viewpoint::SPWSClient
- Includes:
- SPWS
- Defined in:
- lib/viewpoint/spws/spws_client.rb
Overview
This class is the glue between the Models and the Web Service.
Constant Summary collapse
- LIST_TYPES =
Available list types that can be used for #add_list
{ :custom_list => 100, :document_library => 101, :survey => 102, :links => 103, :announcements => 104, :contacts => 105, :events => 106, :tasks => 107, :discussion_board => 108, :picture_library => 109, :datasources => 110, :form_library => 115, :issues => 1100, :custom_list_for_datasheet => 120, }
Constants included from SPWS
Instance Attribute Summary
Attributes included from SPWS
Instance Method Summary collapse
-
#add_list(name, desc, list_type) ⇒ Object
Add a List to this site.
- #copy_ws ⇒ Object
-
#delete_list(list) ⇒ Object
Delete a list from this site.
-
#get_list(list) ⇒ Object
Retrieve a List object.
-
#get_lists ⇒ Object
Retrieve all of the viewable lists for this site.
-
#get_user(user) ⇒ Viewpoint::SPWS::Types::User
Retrieve a user by e-mail.
-
#initialize(endpoint, user = nil, pass = nil) ⇒ SPWSClient
constructor
Initialize the SPWSClient instance.
- #lists_ws ⇒ Object
- #usergroup_ws ⇒ Object
Methods included from SPWS
Constructor Details
#initialize(endpoint, user = nil, pass = nil) ⇒ SPWSClient
Initialize the SPWSClient instance.
29 30 31 32 |
# File 'lib/viewpoint/spws/spws_client.rb', line 29 def initialize(endpoint, user = nil, pass = nil) @con = Connection.new(endpoint) @con.set_auth(user,pass) if(user && pass) end |
Instance Method Details
#add_list(name, desc, list_type) ⇒ Object
Add a List to this site
82 83 84 |
# File 'lib/viewpoint/spws/spws_client.rb', line 82 def add_list(name, desc, list_type) lists_ws.add_list(name, desc, list_type) end |
#copy_ws ⇒ Object
34 35 36 |
# File 'lib/viewpoint/spws/spws_client.rb', line 34 def copy_ws @copyws ||= Websvc::Copy.new(@con) end |
#delete_list(list) ⇒ Object
Delete a list from this site.
88 89 90 |
# File 'lib/viewpoint/spws/spws_client.rb', line 88 def delete_list(list) lists_ws.delete_list(list) end |
#get_list(list) ⇒ Object
Retrieve a List object
74 75 76 |
# File 'lib/viewpoint/spws/spws_client.rb', line 74 def get_list(list) lists_ws.get_list(list) end |
#get_lists ⇒ Object
Retrieve all of the viewable lists for this site.
68 69 70 |
# File 'lib/viewpoint/spws/spws_client.rb', line 68 def get_lists lists_ws.get_list_collection end |
#get_user(user) ⇒ Viewpoint::SPWS::Types::User
Retrieve a user by e-mail
100 101 102 103 104 105 106 |
# File 'lib/viewpoint/spws/spws_client.rb', line 100 def get_user(user) if user =~ /@/ ulh = usergroup_ws.get_user_login_from_email [user] user = ulh[user] end usergroup_ws.get_user_info user end |