TeX and CSS tweaks.

Sync with latest Instiki Trunk
(Updates Rails to 1.2.2)
This commit is contained in:
Jacques Distler 2007-02-09 02:04:31 -06:00
parent 0ac586ee25
commit c358389f25
443 changed files with 24218 additions and 9823 deletions

View file

@ -5,8 +5,7 @@ module ActionWebService # :nodoc:
class DispatcherError < ActionWebService::ActionWebServiceError # :nodoc:
end
def self.append_features(base) # :nodoc:
super
def self.included(base) # :nodoc:
base.class_inheritable_option(:web_service_dispatching_mode, :direct)
base.class_inheritable_option(:web_service_exception_reporting, true)
base.send(:include, ActionWebService::Dispatcher::InstanceMethods)
@ -63,7 +62,7 @@ module ActionWebService # :nodoc:
responses = []
invocations.each do |invocation|
if invocation.is_a?(Hash)
responses << invocation
responses << [invocation, nil]
next
end
begin
@ -75,15 +74,18 @@ module ActionWebService # :nodoc:
end
api_method = invocation.api_method
if invocation.api.has_api_method?(api_method.name)
response_type = (api_method.returns ? api_method.returns[0] : nil)
return_value = api_method.cast_returns(return_value)
else
response_type = ActionWebService::SignatureTypes.canonical_signature_entry(return_value.class, 0)
end
responses << [return_value]
responses << [return_value, response_type]
rescue Exception => e
responses << { 'faultCode' => 3, 'faultString' => e.message }
responses << [{ 'faultCode' => 3, 'faultString' => e.message }, nil]
end
end
invocation = invocations[0]
invocation.protocol.encode_response('system.multicall', responses, nil, invocation.protocol_options)
invocation.protocol.encode_multicall_response(responses, invocation.protocol_options)
end
def web_service_invocation(request, level = 0)

View file

@ -4,12 +4,10 @@ require 'builder/xmlmarkup'
module ActionWebService # :nodoc:
module Dispatcher # :nodoc:
module ActionController # :nodoc:
def self.append_features(base) # :nodoc:
super
def self.included(base) # :nodoc:
class << base
include ClassMethods
alias_method :inherited_without_action_controller, :inherited
alias_method :inherited, :inherited_with_action_controller
alias_method_chain :inherited, :action_controller
end
base.class_eval do
alias_method :web_service_direct_invoke_without_controller, :web_service_direct_invoke
@ -39,6 +37,10 @@ module ActionWebService # :nodoc:
module InstanceMethods # :nodoc:
private
def dispatch_web_service_request
if request.get?
render_text('GET not supported', '500 GET not supported')
return
end
exception = nil
begin
ws_request = discover_web_service_request(request)
@ -104,13 +106,7 @@ module ActionWebService # :nodoc:
invocation.method_named_params.each do |name, value|
params[name] = value
end
params['action'] = invocation.api_method.name.to_s
if before_action == false
raise(DispatcherError, "Method filtered")
end
return_value = web_service_direct_invoke_without_controller(invocation)
after_action
return_value
web_service_direct_invoke_without_controller(invocation)
end
def log_request(ws_request, body)
@ -165,7 +161,7 @@ module ActionWebService # :nodoc:
private
def base_uri
host = request.env['HTTP_HOST'] || request.env['SERVER_NAME'] || 'localhost'
host = request.host_with_port
relative_url_root = request.relative_url_root
scheme = request.ssl? ? 'https' : 'http'
'%s://%s%s/%s/' % [scheme, host, relative_url_root, self.class.controller_path]