diff options
author | Leon Breedt <bitserf@gmail.com> | 2005-03-29 12:31:39 +0000 |
---|---|---|
committer | Leon Breedt <bitserf@gmail.com> | 2005-03-29 12:31:39 +0000 |
commit | b94bd32f3116b469b48400382dbc964bf17994d1 (patch) | |
tree | 91752d7e0f49916e5ed2b9e015815c6dc06b4366 /actionwebservice/lib/action_web_service/templates/scaffolds | |
parent | 715715aed443a027fccbac995cd5404eaeabaf53 (diff) | |
download | rails-b94bd32f3116b469b48400382dbc964bf17994d1.tar.gz rails-b94bd32f3116b469b48400382dbc964bf17994d1.tar.bz2 rails-b94bd32f3116b469b48400382dbc964bf17994d1.zip |
first pass of web service scaffolding. add ability to quickly generate an
action pack request for a protocol, add missing log_error when we fail to parse
protocol messages. add RDoc for scaffolding and functional testing.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1037 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/lib/action_web_service/templates/scaffolds')
4 files changed, 117 insertions, 0 deletions
diff --git a/actionwebservice/lib/action_web_service/templates/scaffolds/layout.rhtml b/actionwebservice/lib/action_web_service/templates/scaffolds/layout.rhtml new file mode 100644 index 0000000000..1cd2e3042a --- /dev/null +++ b/actionwebservice/lib/action_web_service/templates/scaffolds/layout.rhtml @@ -0,0 +1,65 @@ +<html> +<head> + <title><%= @scaffold_class.wsdl_service_name %> Web Service</title> + <style> + body { background-color: #fff; color: #333; } + + body, p, ol, ul, td { + font-family: verdana, arial, helvetica, sans-serif; + font-size: 13px; + line-height: 18px; + } + + pre { + background-color: #eee; + padding: 10px; + font-size: 11px; + } + + a { color: #000; } + a:visited { color: #666; } + a:hover { color: #fff; background-color:#000; } + + .fieldWithErrors { + padding: 2px; + background-color: red; + display: table; + } + + #ErrorExplanation { + width: 400px; + border: 2px solid #red; + padding: 7px; + padding-bottom: 12px; + margin-bottom: 20px; + background-color: #f0f0f0; + } + + #ErrorExplanation h2 { + text-align: left; + font-weight: bold; + padding: 5px 5px 5px 15px; + font-size: 12px; + margin: -7px; + background-color: #c00; + color: #fff; + } + + #ErrorExplanation p { + color: #333; + margin-bottom: 0; + padding: 5px; + } + + #ErrorExplanation ul li { + font-size: 12px; + list-style: square; + } + </style> +</head> +<body> + +<%= @content_for_layout %> + +</body> +</html> diff --git a/actionwebservice/lib/action_web_service/templates/scaffolds/methods.rhtml b/actionwebservice/lib/action_web_service/templates/scaffolds/methods.rhtml new file mode 100644 index 0000000000..60dfe23f07 --- /dev/null +++ b/actionwebservice/lib/action_web_service/templates/scaffolds/methods.rhtml @@ -0,0 +1,6 @@ +<% @scaffold_container.services.each do |service| %> + + <h4>API Methods for <%= service %></h4> + <%= service_method_list(service) %> + +<% end %> diff --git a/actionwebservice/lib/action_web_service/templates/scaffolds/parameters.rhtml b/actionwebservice/lib/action_web_service/templates/scaffolds/parameters.rhtml new file mode 100644 index 0000000000..0516738da6 --- /dev/null +++ b/actionwebservice/lib/action_web_service/templates/scaffolds/parameters.rhtml @@ -0,0 +1,20 @@ +<h4>Method Parameters for <em><%= @scaffold_service %>#<%= @scaffold_method.public_name %></em></h4> + +<%= form_tag :action => @scaffold_action_name + '_submit' %> +<%= hidden_field_tag "service", @scaffold_service.name %> +<%= hidden_field_tag "method", @scaffold_method.public_name %> + +<% i = 0 %> +<% @scaffold_method.expects.each do |spec| %> + <p> + <label for="method_params[]"><%= @scaffold_method.param_name(spec, i).camelize %></label><br /> + <%= method_parameter_input_fields(@scaffold_method, spec, i) %> + </p> + <% i += 1 %> +<% end %> + +<%= submit_tag "Invoke" %> + +<p> +<%= link_to "Back", :action => @scaffold_action_name %> +</p> diff --git a/actionwebservice/lib/action_web_service/templates/scaffolds/result.rhtml b/actionwebservice/lib/action_web_service/templates/scaffolds/result.rhtml new file mode 100644 index 0000000000..4475abff4a --- /dev/null +++ b/actionwebservice/lib/action_web_service/templates/scaffolds/result.rhtml @@ -0,0 +1,26 @@ +<h4>Method Invocation Result for <em><%= @scaffold_service %>#<%= @scaffold_method.public_name %></em></h4> + +<p> +<strong>Return Value:</strong><br /> +<pre> +<%= h @method_return_value.inspect %> +</pre> +</p> + +<p> +<strong>Request XML:</strong><br /> +<pre> +<%= h @method_request_xml %> +</pre> +</p> + +<p> +<strong>Response XML:</strong><br /> +<pre> +<%= h @method_response_xml %> +</pre> +</p> + +<p> +<%= link_to "Back", :action => @scaffold_action_name + '_method_params', :method => @scaffold_method.public_name, :service => @scaffold_service.name %> +</p> |