iab-InsuranceBizLogic 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/lib/bizLogic/xquery2 CHANGED
@@ -1,5 +1,5 @@
1
1
  declare namespace xupdate="http://www.xmldb.org/xupdate";
2
2
  for $result in collection("quotes.dbxml")/Telenexus
3
- where $result//Profile/PersonalDetails/Person/ContactDetail/Email = "EMAIL"
3
+ where $result//Profile/PersonalDetails/Client/Contact/Email = "EMAIL"
4
4
  return
5
5
  $result
@@ -132,11 +132,18 @@ class PEngine
132
132
  prepareModels(session[:product],xml)
133
133
 
134
134
  when "Authenticate"
135
- session[:user_email] = params[:User][:User] if params[:User] and params[:User][:User]
136
- eval(deriveActiveRecordDefinitionOfProduct(session[:product]))
137
- open("#{File.dirname(__FILE__)}/../bizLogic/xquery2") {|f| @query = f.read }
138
- results = persist.find(@query.gsub('EMAIL',session[:user_email]))
139
- prepareModels(session[:product],results[0]) if results and results[0]
135
+ begin
136
+ session[:user_email] = params[:User][:User] if params[:User] and params[:User][:User]
137
+ eval(deriveActiveRecordDefinitionOfProduct(session[:product]))
138
+ open("#{File.dirname(__FILE__)}/../bizLogic/xquery2") {|f| @query = f.read }
139
+ results = persist.find(@query.gsub('EMAIL',session[:user_email]))
140
+ prepareModels(session[:product],results[0]) if results and results[0]
141
+ rescue
142
+ if !session[:user_email]
143
+ raise "Credentials missing - you have not logged in"
144
+ end
145
+ raise "An error occurred during the authentication process"
146
+ end
140
147
 
141
148
  when "SectionRating"
142
149
  "1553.25"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iab-InsuranceBizLogic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gary Mawdsley