stxt-viewpoint 1.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +15 -189
- metadata +2 -2
data/README.md
CHANGED
@@ -1,201 +1,27 @@
|
|
1
|
-
|
1
|
+
# STXT-VIEWPOINT
|
2
|
+
## How to build this gem
|
3
|
+
If you want to change something in this gem, you should first make a new branch. Implement, test it etc. and before you push it to the `master`-branch, make sure to up the number in the `VERSION`-File. The moment something changes in the `master`-branch, Jenkins is going to build the gem and automatically upload it to https://rubygems.org/gems/stxt-viewpoint
|
2
4
|
|
3
|
-
|
4
|
-
|
5
|
+
## Problems with pushing to RubyGems.org?
|
6
|
+
Things you have to do in order to automatically push the gem;
|
7
|
+
On the `buildslave-01.stxt.media.int` you'll have to do some things. **BUT ONLY IF THE AUTOMATIC PUSH TO RUBYGEMS IS BROKEN!!!**
|
5
8
|
|
6
|
-
|
7
|
-
Web Services(EWS). It also includes a bunch of model classes that add an
|
8
|
-
additional layer of abstraction on top of EWS for use in implementing
|
9
|
-
programs with Viewpoint.
|
10
|
-
|
11
|
-
BLOG: http://distributed-frostbite.blogspot.com/
|
12
|
-
|
13
|
-
Add me in LinkedIn: http://www.linkedin.com/in/danwanek
|
14
|
-
|
15
|
-
Find me on irc.freenode.net in #ruby-lang (zenChild)
|
16
|
-
|
17
|
-
# Features
|
18
|
-
|
19
|
-
## New in 1.0
|
20
|
-
|
21
|
-
* SOAP backend is now only dependant on Nokogiri. Before version 1.0 Viewpoint
|
22
|
-
went through a number of iterations in backends including SOAP4r and Handsoap.
|
23
|
-
Each of these approaches had major issues so in the end I decided it was
|
24
|
-
easiest to just build the SOAP messages with Nokogiri since I was using it as
|
25
|
-
the parser for response messages already.
|
26
|
-
|
27
|
-
* Viewpoint is no longer built on a Singleton pattern. The reason it was
|
28
|
-
previously is because of the Handsoap backend. Handsoap itself uses a
|
29
|
-
Singleton pattern for connection to the SOAP endpoint so with authentication
|
30
|
-
I was forced to implement Viewpoint as a Singleton as well. Now with Handsoap
|
31
|
-
out of the picture this is no longer required. Go crazy ;)
|
32
|
-
|
33
|
-
## Enhanced in 1.0
|
34
|
-
|
35
|
-
* *Delegate access is supported*
|
36
|
-
One thing that was often asked for, but missing from the previous version was delegate access to mailboxes and calendars. This is now supported via the 'act_as' parameter to the GenericFolder::get_folder method.
|
37
|
-
|
38
|
-
>> Inbox example:
|
39
|
-
```ofolder = Folder.get_folder(:inbox, opts = {act_as: "user@host.com"})```
|
40
|
-
|
41
|
-
>> If your user has delegate access to the Inbox for user@host.com this operation will retrieve their inbox and allow you to manipulate it as you would with your own Inbox.
|
42
|
-
|
43
|
-
>> Calendar example:
|
44
|
-
```oCalendar = cli.get_folder(:calendar, opts = {act_as: "user@host.com"})```
|
45
|
-
|
46
|
-
>> If your user has delegate access to the Calendar for user@host.com this operation will retrieve their calendar and allow you to manipulate it as you would with your own Calendar, depending on the permissions the other user has granted you.
|
47
|
-
|
48
|
-
|
49
|
-
* There is also some support for manipulation of delegate access itself via
|
50
|
-
the methods MailboxUser#add_delegate!, MailboxUser#update_delegate!, and
|
51
|
-
MailboxUser#get_delegate_info.
|
52
|
-
|
53
|
-
|
54
|
-
# Using Viewpoint
|
55
|
-
|
56
|
-
The version 1.0 API is quite a departure from the 0.1.x code base. If you have a lot of legacy code and aren't suffering from performance issues, think twice about upgrading. That said, I hope you'll find the new API much clean and more intuitive than previous versions.
|
57
|
-
|
58
|
-
I also try and document the code to the base of my ability. Included in that code are links to the official Microsoft EWS documentation that might be helpful when troubleshooting "interesting" issues. You can either generate the documentation yourself with yard or check it out on [rdoc.info](http://rdoc.info/github/zenchild/Viewpoint/frames).
|
59
|
-
|
60
|
-
Note the `cli` variable in the setup code directly below. I will use that variable throughout without the setup code.
|
61
|
-
|
62
|
-
## The Setup
|
63
|
-
```ruby
|
64
|
-
require 'viewpoint'
|
65
|
-
include Viewpoint::EWS
|
66
|
-
|
67
|
-
endpoint = 'https://example.com/ews/Exchange.asmx'
|
68
|
-
user = 'username'
|
69
|
-
pass = 'password'
|
70
|
-
|
71
|
-
cli = Viewpoint::EWSClient.new endpoint, user, pass
|
72
|
-
```
|
73
|
-
|
74
|
-
There are also various options you can pass to EWSClient.
|
75
|
-
|
76
|
-
If you are testing in an environment using a self-signed certificate you can pass a connection parameter to ignore SSL verification by passing `http_opts: {ssl_verify_mode: 0}`.
|
77
|
-
|
78
|
-
If you want to target a specific version of Exchange you can pass `server_version: SOAP::ExchangeWebService::VERSION_2010_SP1`. You really shouldn't have to use this unless you know why.
|
79
|
-
|
80
|
-
## Accessors
|
81
|
-
|
82
|
-
There are some basic accessors available on the Viewpoint::EWSClient instance. In prior versions these were typically class methods off of the models themselves (ex: Folder.get_folder(id)). Now all accessors are available through EWSClient.
|
83
|
-
|
84
|
-
### Folder Accessors
|
85
|
-
|
86
|
-
#### Listing Folders
|
87
|
-
```ruby
|
88
|
-
# Find all folders under :msgfolderroot
|
89
|
-
folders = cli.folders
|
90
|
-
|
91
|
-
# Find all folders under Inbox
|
92
|
-
inbox_folders = cli.folders root: :inbox
|
93
|
-
|
94
|
-
# Find all folders under :root and do a Deep search
|
95
|
-
all_folders = cli.folders root: :root, traversal: :deep
|
9
|
+
* Step 1: **Connect to the Build-Slave**
|
96
10
|
```
|
97
|
-
|
98
|
-
#### Finding single folders
|
99
|
-
```ruby
|
100
|
-
# If you know the EWS id
|
101
|
-
cli.get_folder <folder_id>
|
102
|
-
# ... or if it's a standard folder pass its symbol
|
103
|
-
cli.get_folder :index
|
104
|
-
# or by name
|
105
|
-
cli.get_folder_by_name 'test'
|
106
|
-
# by name as a subfolder under "Inbox"
|
107
|
-
cli.get_folder_by_name 'test', parent: :inbox
|
11
|
+
ssh root@buildslave-01.stxt.media.int
|
108
12
|
```
|
109
13
|
|
110
|
-
|
111
|
-
```ruby
|
112
|
-
# make a folder under :msgfolderroot
|
113
|
-
cli.make_folder 'myfolder'
|
114
|
-
|
115
|
-
# make a folder under Inbox
|
116
|
-
my_folder = cli.make_folder 'My Stuff', parent: :inbox
|
117
|
-
|
118
|
-
# make a new Tasks folder
|
119
|
-
tasks = cli.make_folder 'New Tasks', type: :tasks
|
120
|
-
|
121
|
-
# delete a folder
|
122
|
-
my_folder.delete!
|
14
|
+
* Step 2: **Change to the Jenkins-User**
|
123
15
|
```
|
124
|
-
|
125
|
-
### Item Accessors
|
126
|
-
|
127
|
-
#### Finding items
|
128
|
-
```ruby
|
129
|
-
items = inbox.items
|
130
|
-
|
131
|
-
# for today
|
132
|
-
inbox.todays_items
|
133
|
-
|
134
|
-
# since a specific date
|
135
|
-
sd = Date.iso8601 '2013-01-01'
|
136
|
-
inbox.items_since sd
|
137
|
-
|
138
|
-
# between 2 dates
|
139
|
-
sd = Date.iso8601 '2013-01-01'
|
140
|
-
ed = Date.iso8601 '2013-02-01'
|
141
|
-
inbox.items_between sd, ed
|
16
|
+
sudo - jenkins
|
142
17
|
```
|
143
|
-
### Free/Busy Calendar Accessors
|
144
|
-
|
145
|
-
```ruby
|
146
|
-
# Find when a user is busy
|
147
|
-
require 'time'
|
148
|
-
start_time = DateTime.parse("2013-02-19").iso8601
|
149
|
-
end_time = DateTime.parse("2013-02-20").iso8601
|
150
|
-
user_free_busy = cli.get_user_availability(['joe.user@exchange.site.com'],
|
151
|
-
start_time: start_time,
|
152
|
-
end_time: end_time,
|
153
|
-
requested_view: :free_busy)
|
154
|
-
busy_times = user_free_busy.calendar_event_array
|
155
|
-
|
156
|
-
# Parse events from the calendar event array for start/end times and type
|
157
|
-
busy_times.each { | event |
|
158
|
-
cli.event_busy_type(event)
|
159
|
-
cli.event_start_time(event)
|
160
|
-
cli.event_end_time(event)
|
161
|
-
}
|
162
18
|
|
163
|
-
|
164
|
-
user_free_busy.working_hours
|
19
|
+
* Step 3: **Download the API-Key for RubyGems.org**
|
165
20
|
```
|
166
|
-
|
167
|
-
|
168
|
-
### Mailbox Accessors
|
169
|
-
### Message Accessors
|
170
|
-
```ruby
|
171
|
-
cli.send_message subject: "Test", body: "Test", to_recipients: ['test@example.com']
|
172
|
-
|
173
|
-
# or
|
174
|
-
cli.send_message do |m|
|
175
|
-
m.subject = "Test"
|
176
|
-
m.body = "Test"
|
177
|
-
m.to_recipients << 'test@example.com'
|
178
|
-
m.to_recipients << 'test2@example.com'
|
179
|
-
end
|
180
|
-
|
181
|
-
# set :draft => true or use cli.draft_message to only create a draft and not send.
|
21
|
+
curl -u SwissTXT https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials
|
182
22
|
```
|
23
|
+
You will have to type in the password for the SwissTXT-User. You'll find that in the STXT-PW-Tool, just search for **RubyGemsPW**
|
24
|
+
Now the automatic build and push process should work again!
|
25
|
+
/ mostkopf
|
183
26
|
|
184
|
-
## Thanks go out to...
|
185
|
-
|
186
|
-
* Handl.it for sponsoring a good portion of the development effort.
|
187
|
-
** https://www.handle.com/
|
188
|
-
* The National Association of REALTORS® for providing a testing account
|
189
|
-
and much appreciated input and support.
|
190
|
-
* The Holmes Group Limited for providing Exchange 2013 test accounts.
|
191
|
-
|
192
|
-
---
|
193
|
-
DISCLAIMER: If you see something that could be done better or would like
|
194
|
-
to help out in the development of this code please feel free to clone the
|
195
|
-
'git' repository and send me patches:
|
196
|
-
git clone git://github.com/zenchild/Viewpoint.git
|
197
|
-
or add an issue on GitHub:
|
198
|
-
http://github.com/zenchild/Viewpoint/issues
|
199
27
|
|
200
|
-
Cheers!
|
201
|
-
---
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stxt-viewpoint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-12-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|