Skip to content

Commit 1834766

Browse files
author
attdevsupport
committed
Production fixes - 10/18/2013
1 parent 3fd0059 commit 1834766

File tree

179 files changed

+4629
-1903
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+4629
-1903
lines changed

RESTFul/ADS/Java/app1/src/main/webapp/WEB-INF/ADS.jsp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,14 @@ For more information contact developer.support@att.com
175175
${content}
176176
</c:if>
177177
</c:if>
178+
179+
<c:if test="${not empty error}">
180+
<div class="errorWide">
181+
<strong>ERROR:</strong><br>
182+
<c:out value="${error}" />
183+
</div>
184+
</c:if>
185+
178186
<!-- SAMPLE APP CONTENT ENDS HERE! -->
179187
</div> <!-- end of formContainer -->
180188
</div> <!-- end of formBox -->

RESTFul/ADS/PHP/app1/lib/Controller/APIController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,10 @@ protected function __construct()
222222

223223
// set any RESTFul environmental settings
224224
if (isset($proxy_host) && isset($proxy_port))
225-
RestfulEnvironment::setProxy($proxyHost, $proxyPort);
225+
RestfulEnvironment::setProxy($proxy_host, $proxy_port);
226226

227-
if (isset($trustAllCerts))
228-
RestfulEnvironment::setAcceptAllCerts($trustAllCerts);
227+
if (isset($accept_all_certs))
228+
RestfulEnvironment::setAcceptAllCerts($accept_all_certs);
229229
}
230230

231231
/**

RESTFul/ADS/Ruby/app1/Gemfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# include common source and gems
2+
source "https://rubygems.org"
3+
4+
gem 'sinatra', '~>1.4'
5+
gem 'sinatra-contrib'
6+
gem 'json', '~>1.8'
7+
gem 'thin', '~>1.6'
8+
gem 'rack', '~>1.5'
9+
gem 'rest-client', '~>1.6'
10+
11+
12+
# include codekit source and gem
13+
source "http://ldev.code-api-att.com:8808"
14+
gem 'att-codekit', '~>3.0', :require => 'att/codekit'

RESTFul/ADS/Ruby/app1/Gemfile.lock

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
remote: http://ldev.code-api-att.com:8808/
4+
specs:
5+
att-codekit (3.0.2)
6+
bundler (~> 1.3)
7+
immutable_struct
8+
json
9+
rake
10+
rest-client
11+
backports (3.3.5)
12+
daemons (1.1.9)
13+
eventmachine (1.0.3)
14+
immutable_struct (1.1.1)
15+
json (1.8.0)
16+
mime-types (1.25)
17+
multi_json (1.8.1)
18+
rack (1.5.2)
19+
rack-protection (1.5.0)
20+
rack
21+
rack-test (0.6.2)
22+
rack (>= 1.0)
23+
rake (10.1.0)
24+
rest-client (1.6.7)
25+
mime-types (>= 1.16)
26+
sinatra (1.4.3)
27+
rack (~> 1.4)
28+
rack-protection (~> 1.4)
29+
tilt (~> 1.3, >= 1.3.4)
30+
sinatra-contrib (1.4.1)
31+
backports (>= 2.0)
32+
multi_json
33+
rack-protection
34+
rack-test
35+
sinatra (~> 1.4.0)
36+
tilt (~> 1.3)
37+
thin (1.6.0)
38+
daemons (>= 1.0.9)
39+
eventmachine (>= 1.0.0)
40+
rack (>= 1.5.0)
41+
tilt (1.4.1)
42+
43+
PLATFORMS
44+
ruby
45+
46+
DEPENDENCIES
47+
att-codekit (~> 3.0)
48+
json (~> 1.8)
49+
rack (~> 1.5)
50+
rest-client (~> 1.6)
51+
sinatra (~> 1.4)
52+
sinatra-contrib
53+
thin (~> 1.6)

RESTFul/ADS/Ruby/app1/README

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,23 +83,27 @@
8383
- rake: compiling tool used to make att-codekit
8484
- yard: documentation tool used by att-codekit
8585

86-
To install these gems open up a terminal window and invoke:
87-
88-
gem install sinatra sinatra-contrib rest-client json rake yard
86+
The easiest way to install the required gems is to use bundler.
87+
88+
First make sure you have bundler installed:
89+
gem install bundler
90+
91+
Then inside the directory which this README resides run:
92+
bundle install
8993

9094
On a *nix based system you may need to raise your access privliges, such as
9195
prefixing the command with sudo or logging in as root by running su.
9296

9397
** Installing the att-codekit library
94-
Note: required for ruby 1.9+ and suggested for 1.8
98+
Note: this is only required if you are **not** using bundler and are using ruby 1.9+
9599

96100
The code kit library can be installed by using our hosted gem file.
97101

98102
gem sources --add http://ldev.code-api-att.com:8808
99103
gem install att-codekit
100104

101105
Note that the codekit is under heavy development and is using a semantic
102-
versioning scheme. Non-backwards compatible changes _will_ increase the
106+
versioning scheme. Non-backwards compatible changes **will** increase the
103107
major version number.
104108

105109

RESTFul/ADS/Ruby/app1/ads.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,18 @@
3333
OAuth = Auth::ClientCred.new(settings.FQDN,
3434
settings.api_key,
3535
settings.secret_key)
36-
37-
@@token = OAuth.createToken(SCOPE)
36+
@@token = nil
3837
rescue Exception => e
3938
@error = e.message
4039
end
4140
end
4241

43-
# Setup filter for refreshing the token
42+
# Setup filter for token handling
4443
[ '/getAds' ].each do |action|
4544
before action do
45+
if @@token.nil?
46+
@@token = OAuth.createToken(SCOPE)
47+
end
4648
if @@token.expired?
4749
@@token = OAuth.refreshToken(@@token)
4850
end
@@ -63,7 +65,7 @@
6365
optional[p] = params[p].strip unless params[p].nil? or params[p].strip.empty?
6466
end
6567

66-
category = params[:category]
68+
category = params[:Category]
6769
user_agent = @env["HTTP_USER_AGENT"].to_s
6870
udid = "012266005922565000000000000000"
6971

RESTFul/ADS/Ruby/app1/att/codekit/model/mms.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def self.createFromParsedJson(json)
3131

3232
id = root["messageId"]
3333
ref = root["resourceReference"]
34-
url = ref["resourceURL"]
34+
url = ref["resourceURL"] rescue nil
3535

3636
new(id, url)
3737
end

RESTFul/ADS/Ruby/app1/att/codekit/model/sms.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def self.createFromParsedJson(json)
3131

3232
id = root["messageId"]
3333
ref = root["resourceReference"]
34-
url = ref["resourceURL"]
34+
url = ref["resourceURL"] rescue nil
3535

3636
new(id, url)
3737
end

RESTFul/ADS/Ruby/app1/att/codekit/service/speech.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def customSpeechToText(audio_file, dictionary, grammar, opts={})
9696
filename = File.basename(audio_file)
9797

9898
dheaders = {
99-
"Content-Disposition" => %(form-data; name="x-dictionary"; filename="#{dictionary}"),
99+
"Content-Disposition" => %(form-data; name="x-dictionary"; filename="#{dictionary_name}"),
100100
"Content-Type" => "application/pls+xml"
101101
}
102102
dict_part = {
@@ -132,7 +132,7 @@ def customSpeechToText(audio_file, dictionary, grammar, opts={})
132132

133133
headers = {
134134
:X_arg => "#{x_arg_val}",
135-
:X_SpeechContext => "#{context},
135+
:X_SpeechContext => "#{context}",
136136
:Content_Type => %(multipart/x-srgs-audio; boundary="#{boundary}"),
137137
}
138138

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Att
22
module Codekit
3-
VERSION = "3.0.0"
3+
VERSION = "3.0.2"
44
end
55
end

0 commit comments

Comments
 (0)