Changeset 1906
- Timestamp:
- 07/23/07 23:53:17 (10 months ago)
- Files:
-
- trunk/lib/wsdl/definitions.rb (modified) (1 diff)
- trunk/lib/wsdl/soap/classDefCreator.rb (modified) (4 diffs)
- trunk/lib/wsdl/soap/mappingRegistryCreatorSupport.rb (modified) (1 diff)
- trunk/lib/wsdl/xmlSchema/choice.rb (modified) (1 diff)
- trunk/lib/wsdl/xmlSchema/complexType.rb (modified) (1 diff)
- trunk/lib/wsdl/xmlSchema/data.rb (modified) (2 diffs)
- trunk/lib/wsdl/xmlSchema/element.rb (modified) (1 diff)
- trunk/lib/wsdl/xmlSchema/group.rb (added)
- trunk/lib/wsdl/xmlSchema/schema.rb (modified) (4 diffs)
- trunk/lib/wsdl/xmlSchema/sequence.rb (modified) (1 diff)
- trunk/test/wsdl/group (added)
- trunk/test/wsdl/group/expectedClassdef.rb (added)
- trunk/test/wsdl/group/expectedDriver.rb (added)
- trunk/test/wsdl/group/expectedMappingRegistry.rb (added)
- trunk/test/wsdl/group/group.wsdl (added)
- trunk/test/wsdl/group/test_rpc.rb (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/wsdl/definitions.rb
r1824 r1906 60 60 @imports.each do |import| 61 61 result.concat(import.content.collect_attributes) 62 end 63 result 64 end 65 66 def collect_modelgroups 67 result = XSD::NamedElements.new 68 if @types 69 @types.schemas.each do |schema| 70 result.concat(schema.collect_modelgroups) 71 end 72 end 73 @imports.each do |import| 74 result.concat(import.content.collect_modelgroups) 62 75 end 63 76 result trunk/lib/wsdl/soap/classDefCreator.rb
r1899 r1906 32 32 @complextypes = definitions.collect_complextypes 33 33 @complextypes.uniq! 34 @modelgroups = definitions.collect_modelgroups 35 @modelgroups.uniq! 34 36 @faulttypes = nil 35 37 if definitions.respond_to?(:collect_faulttypes) … … 49 51 result << dump_classdef(type.name, type) 50 52 else 53 str = dump_group 54 unless str.empty? 55 result << "\n" unless result.empty? 56 result << str 57 end 51 58 str = dump_complextype 52 59 unless str.empty? … … 112 119 definitions = sort_dependency(@complextypes).collect { |type| 113 120 dump_complextypedef(type.name, type) 121 }.compact.join("\n") 122 end 123 124 def dump_group 125 definitions = @modelgroups.collect { |group| 126 # ??? 114 127 }.compact.join("\n") 115 128 end … … 298 311 init_lines.concat(child_init_lines) 299 312 init_params.concat(child_init_params) 313 when WSDL::XMLSchema::Group 314 if element.content.nil? 315 warn("no group definition found: #{element}") 316 next 317 end 318 child_init_lines, child_init_params = 319 parse_elements(c, element.content.elements, base_namespace) 320 init_lines.concat(child_init_lines) 321 init_params.concat(child_init_params) 300 322 else 301 323 raise RuntimeError.new("unknown type: #{element}") trunk/lib/wsdl/soap/mappingRegistryCreatorSupport.rb
r1895 r1906 104 104 child_schema_element.unshift(:choice) 105 105 schema_element << child_schema_element 106 when WSDL::XMLSchema::Group 107 if element.content.nil? 108 warn("no group definition found: #{element}") 109 next 110 end 111 child_schema_element = parse_elements(element.content.elements, base_namespace) 112 schema_element.concat(child_schema_element) 106 113 else 107 114 raise RuntimeError.new("unknown type: #{element}") trunk/lib/wsdl/xmlSchema/choice.rb
r1824 r1906 40 40 @elements << o 41 41 o 42 when GroupName 43 o = Group.new 44 @elements << o 45 o 42 46 when AnyName 43 47 raise ElementConstraintError.new("duplicated element: any") if @any trunk/lib/wsdl/xmlSchema/complexType.rb
r1905 r1906 129 129 when ChoiceName 130 130 @content = Choice.new 131 when GroupName 132 @content = Group.new 131 133 when ComplexContentName 132 134 @complexcontent = ComplexContent.new trunk/lib/wsdl/xmlSchema/data.rb
r1905 r1906 30 30 require 'wsdl/xmlSchema/union' 31 31 require 'wsdl/xmlSchema/unique' 32 require 'wsdl/xmlSchema/group' 32 33 33 34 require 'wsdl/xmlSchema/length' … … 58 59 ElementName = XSD::QName.new(XSD::Namespace, 'element') 59 60 ExtensionName = XSD::QName.new(XSD::Namespace, 'extension') 61 GroupName = XSD::QName.new(XSD::Namespace, 'group') 60 62 ImportName = XSD::QName.new(XSD::Namespace, 'import') 61 63 IncludeName = XSD::QName.new(XSD::Namespace, 'include') trunk/lib/wsdl/xmlSchema/element.rb
r1905 r1906 1 # WSDL4R - XMLSchema element definition for WSDL.1 # WSDL4R - XMLSchema element definition. 2 2 # Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>. 3 3 trunk/lib/wsdl/xmlSchema/schema.rb
r1905 r1906 21 21 attr_reader :elements 22 22 attr_reader :attributes 23 attr_reader :modelgroups 23 24 attr_reader :imports 24 25 attr_accessor :attributeformdefault … … 35 36 @elements = XSD::NamedElements.new 36 37 @attributes = XSD::NamedElements.new 38 @modelgroups = XSD::NamedElements.new 37 39 @imports = [] 38 40 @attributeformdefault = "unqualified" … … 79 81 @attributes << o 80 82 o 83 when GroupName 84 o = Group.new 85 @modelgroups << o 86 o 81 87 else 82 88 nil … … 104 110 @imports.each do |import| 105 111 result.concat(import.content.collect_attributes) if import.content 112 end 113 result 114 end 115 116 def collect_modelgroups 117 result = XSD::NamedElements.new 118 result.concat(@modelgroups) 119 @imports.each do |import| 120 result.concat(import.content.collect_modelgroups) if import.content 106 121 end 107 122 result trunk/lib/wsdl/xmlSchema/sequence.rb
r1824 r1906 36 36 @elements << o 37 37 o 38 when GroupName 39 o = Group.new 40 @elements << o 41 o 38 42 when AnyName 39 43 raise ElementConstraintError.new("duplicated element: any") if @any