Module: Templates
- Included in:
- WindowsLiveAdmin
- Defined in:
- lib/windows_live_admin/templates.rb
Overview
This module contains various template methods which return the XML request that needs to be sent to the server to perform corresponding tasks. This module is mixed into the WindowsLiveAdmin class. Hence all the methods defined here can be invoked directly on the objects of WindowsLiveAdmin class
Instance Method Summary collapse
-
#create_member_xml(member_name, password, reset_password, first_name, last_name, lcid) ⇒ String
Generates the XML required by the create_member method.
-
#delete_member_xml(member_name) ⇒ String
Generates the XML required by the delete_member method.
-
#get_login_data_template_xml ⇒ String
Generates the XML required by the get_login_data_template method.
-
#get_login_url_xml ⇒ String
Generates the XML required by the get_login_url method.
-
#verify_auth_data_xml ⇒ String
Generates the XML required by the verify_auth_data method.
Instance Method Details
#create_member_xml(member_name, password, reset_password, first_name, last_name, lcid) ⇒ String
Generates the XML required by the create_member method. This is a helper function.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/windows_live_admin/templates.rb', line 60 def create_member_xml(member_name, password, reset_password, first_name, last_name, lcid) str = <<-eos <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <ManageDomain2Authorization xmlns="http://domains.live.com/Service/ManageDomain/V1.0"> <authorizationType>PassportTicket</authorizationType> <authorizationData>#{@auth_data}</authorizationData> </ManageDomain2Authorization> </soap:Header> <soap:Body> <CreateMember xmlns="http://domains.live.com/Service/ManageDomain/V1.0"> <memberNameIn>#{member_name}</memberNameIn> <password>#{password}</password> <resetPassword>#{reset_password}</resetPassword> <firstName>#{first_name}</firstName> <lastName>#{last_name}</lastName> <lcid>#{lcid}</lcid> </CreateMember> </soap:Body> </soap:Envelope> eos end |
#delete_member_xml(member_name) ⇒ String
Generates the XML required by the delete_member method. This is a helper function.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/windows_live_admin/templates.rb', line 88 def delete_member_xml(member_name) str = <<-eos <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <ManageDomain2Authorization xmlns="http://domains.live.com/Service/ManageDomain/V1.0"> <authorizationType>PassportTicket</authorizationType> <authorizationData>#{@auth_data}</authorizationData> </ManageDomain2Authorization> </soap:Header> <soap:Body> <DeleteMember xmlns="http://domains.live.com/Service/ManageDomain/V1.0"> <memberNameIn>#{member_name}</memberNameIn> </DeleteMember> </soap:Body> </soap:Envelope> eos end |
#get_login_data_template_xml ⇒ String
Generates the XML required by the get_login_data_template method.
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/windows_live_admin/templates.rb', line 24 def get_login_data_template_xml str = <<-eos <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetLoginDataTemplate xmlns="http://domains.live.com/Service/ManageDomain/V1.0" /> </soap:Body> </soap:Envelope> eos end |
#get_login_url_xml ⇒ String
Generates the XML required by the get_login_url method.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/windows_live_admin/templates.rb', line 9 def get_login_url_xml str = <<-eos <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetLoginUrl xmlns="http://domains.live.com/Service/ManageDomain/V1.0"> <memberNameIn>#{@username}</memberNameIn> </GetLoginUrl> </soap:Body> </soap:Envelope> eos end |
#verify_auth_data_xml ⇒ String
Generates the XML required by the verify_auth_data method.
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/windows_live_admin/templates.rb', line 37 def verify_auth_data_xml str = <<-eos <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <VerifyAuthData xmlns="http://domains.live.com/Service/ManageDomain/V1.0"> <authData>#{@auth_data}</authData> </VerifyAuthData> </soap:Body> </soap:Envelope> eos end |