diff --git a/wst/trunk/tests/test_suite/files/complex_record.WSDL b/wst/trunk/tests/test_suite/files/complex_record.WSDL index a89b662e5..9e9ff722d 100644 --- a/wst/trunk/tests/test_suite/files/complex_record.WSDL +++ b/wst/trunk/tests/test_suite/files/complex_record.WSDL @@ -7,12 +7,9 @@ targetNamespace="urn:wst-test"> - + - - - - + @@ -27,10 +24,7 @@ - - - - + diff --git a/wst/trunk/tests/test_suite/files/complex_record.xsd b/wst/trunk/tests/test_suite/files/complex_record.xsd index 9335a704d..597618f61 100644 --- a/wst/trunk/tests/test_suite/files/complex_record.xsd +++ b/wst/trunk/tests/test_suite/files/complex_record.xsd @@ -3,8 +3,7 @@ xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:wst-test"> - - + @@ -19,8 +18,7 @@ - - + @@ -29,7 +27,7 @@ - + diff --git a/wst/trunk/tests/test_suite/files/complex_record_embedded.WSDL b/wst/trunk/tests/test_suite/files/complex_record_embedded.WSDL new file mode 100644 index 000000000..45821de1e --- /dev/null +++ b/wst/trunk/tests/test_suite/files/complex_record_embedded.WSDL @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/trunk/tests/test_suite/files/complex_record_embedded.xsd b/wst/trunk/tests/test_suite/files/complex_record_embedded.xsd new file mode 100644 index 000000000..7c97119f8 --- /dev/null +++ b/wst/trunk/tests/test_suite/files/complex_record_embedded.xsd @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/trunk/tests/test_suite/test_parsers.pas b/wst/trunk/tests/test_suite/test_parsers.pas index b3192d7d2..933e9ed64 100644 --- a/wst/trunk/tests/test_suite/test_parsers.pas +++ b/wst/trunk/tests/test_suite/test_parsers.pas @@ -37,6 +37,7 @@ type function LoadComplexType_Class_Embedded_Schema() : TwstPasTreeContainer;virtual;abstract; function LoadComplexType_Record_Schema() : TwstPasTreeContainer;virtual;abstract; + function LoadComplexType_Record_Embedded_Schema() : TwstPasTreeContainer;virtual;abstract; function LoadComplexType_ArraySequence_Schema() : TwstPasTreeContainer;virtual;abstract; function LoadComplexType_ArraySequence_Embedded_Schema() : TwstPasTreeContainer;virtual;abstract; @@ -50,6 +51,7 @@ type procedure ComplexType_Class_Embedded(); procedure ComplexType_Record(); + procedure ComplexType_Record_Embedded(); procedure ComplexType_ArraySequence(); procedure ComplexType_ArraySequence_Embedded(); @@ -70,6 +72,7 @@ type function LoadComplexType_Class_Embedded_Schema() : TwstPasTreeContainer;override; function LoadComplexType_Record_Schema() : TwstPasTreeContainer;override; + function LoadComplexType_Record_Embedded_Schema() : TwstPasTreeContainer;override; function LoadComplexType_ArraySequence_Schema() : TwstPasTreeContainer;override; function LoadComplexType_ArraySequence_Embedded_Schema() : TwstPasTreeContainer;override; @@ -90,6 +93,7 @@ type function LoadComplexType_Class_Embedded_Schema() : TwstPasTreeContainer;override; function LoadComplexType_Record_Schema() : TwstPasTreeContainer;override; + function LoadComplexType_Record_Embedded_Schema() : TwstPasTreeContainer;override; function LoadComplexType_ArraySequence_Schema() : TwstPasTreeContainer;override; function LoadComplexType_ArraySequence_Embedded_Schema() : TwstPasTreeContainer;override; @@ -510,7 +514,7 @@ var CheckEquals(AName,tr.GetExternalName(prp)); CheckNotNull(prp.VarType); CheckEquals(ATypeName,tr.GetExternalName(prp.VarType)); - CheckEquals(PropertyType_Att[AFieldType],tr.IsAttributeProperty(prp)); + CheckEquals(PropertyType_Att[AFieldType],tr.IsAttributeProperty(prp),Format('IsAttributeProperty("%s.%s")',[recType.Name, AName])); end; var @@ -588,6 +592,90 @@ begin end; end; +procedure TTest_CustomXsdParser.ComplexType_Record_Embedded(); +var + tr : TwstPasTreeContainer; + recType : TPasRecordType; + + procedure CheckProperty(const AName,ATypeName : string; const AFieldType : TPropertyType); + var + prp : TPasVariable; + begin + prp := FindMember(recType,AName) as TPasVariable; + CheckNotNull(prp); + CheckEquals(AName,prp.Name); + CheckEquals(AName,tr.GetExternalName(prp)); + CheckNotNull(prp.VarType); + CheckEquals(ATypeName,tr.GetExternalName(prp.VarType)); + CheckEquals(PropertyType_Att[AFieldType],tr.IsAttributeProperty(prp),Format('IsAttributeProperty("%s.%s")',[recType.Name, AName])); + end; + +var + mdl : TPasModule; + ls : TList; + elt : TPasElement; + aliasType : TPasAliasType; + i : Integer; + prpLs : TList; +begin + prpLs := TList.Create(); + try + tr := LoadComplexType_Record_Embedded_Schema(); + + mdl := tr.FindModule(x_targetNamespace); + CheckNotNull(mdl); + CheckEquals(x_complexType_record_embedded,mdl.Name); + CheckEquals(x_targetNamespace,tr.GetExternalName(mdl)); + ls := mdl.InterfaceSection.Declarations; + CheckEquals(2,ls.Count); + elt := tr.FindElement(x_complexType_SampleRecordType); + CheckNotNull(elt,x_complexType_SampleRecordType); + CheckEquals(x_complexType_SampleRecordType,elt.Name); + CheckEquals(x_complexType_SampleRecordType,tr.GetExternalName(elt)); + CheckIs(elt,TPasRecordType,'Element Type'); + recType := elt as TPasRecordType; + prpLs.Clear(); + for i := 0 to Pred(recType.Members.Count) do begin + if TPasElement(recType.Members[i]).InheritsFrom(TPasVariable) then + prpLs.Add(recType.Members[i]); + end; + CheckEquals(8,prpLs.Count); + CheckProperty(x_intField,'int',ptField); + CheckProperty(x_strField,'string',ptField); + CheckProperty(x_floatField,'float',ptField); + CheckProperty(x_byteField,'byte',ptField); + CheckProperty(x_charField,'char',ptField); + CheckProperty(x_longField,'long',ptField); + CheckProperty(x_strAtt,'string',ptAttribute); + CheckProperty(x_intAtt,'int',ptAttribute); + + + elt := tr.FindElement(x_complexType_SampleRecordTypeAll); + CheckNotNull(elt,x_complexType_SampleRecordTypeAll); + CheckEquals(x_complexType_SampleRecordTypeAll,elt.Name); + CheckEquals(x_complexType_SampleRecordTypeAll,tr.GetExternalName(elt)); + CheckIs(elt,TPasRecordType,'Element type'); + recType := elt as TPasRecordType; + prpLs.Clear(); + for i := 0 to Pred(recType.Members.Count) do begin + if TPasElement(recType.Members[i]).InheritsFrom(TPasVariable) then + prpLs.Add(recType.Members[i]); + end; + CheckEquals(8,prpLs.Count); + CheckProperty(x_intField,'int',ptField); + CheckProperty(x_strField,'string',ptField); + CheckProperty(x_floatField,'float',ptField); + CheckProperty(x_byteField,'byte',ptField); + CheckProperty(x_charField,'char',ptField); + CheckProperty(x_longField,'long',ptField); + CheckProperty(x_strAtt,'string',ptAttribute); + CheckProperty(x_intAtt,'int',ptAttribute); + + finally + FreeAndNil(prpLs); + end; +end; + procedure TTest_CustomXsdParser.ComplexType_ArraySequence(); var tr : TwstPasTreeContainer; @@ -817,6 +905,11 @@ begin Result := ParseDoc(x_complexType_record); end; +function TTest_XsdParser.LoadComplexType_Record_Embedded_Schema(): TwstPasTreeContainer; +begin + Result := ParseDoc(x_complexType_record_embedded); +end; + function TTest_XsdParser.LoadComplexType_ArraySequence_Schema(): TwstPasTreeContainer; begin Result := ParseDoc(x_complexType_array_sequence); @@ -880,6 +973,11 @@ begin Result := ParseDoc(x_complexType_record); end; +function TTest_WsdlParser.LoadComplexType_Record_Embedded_Schema(): TwstPasTreeContainer; +begin + Result := ParseDoc(x_complexType_record_embedded); +end; + function TTest_WsdlParser.LoadComplexType_ArraySequence_Schema(): TwstPasTreeContainer; begin Result := ParseDoc(x_complexType_array_sequence); diff --git a/wst/trunk/tests/test_suite/wst_test_suite.lpi b/wst/trunk/tests/test_suite/wst_test_suite.lpi index 47d86d603..510c153f0 100644 --- a/wst/trunk/tests/test_suite/wst_test_suite.lpi +++ b/wst/trunk/tests/test_suite/wst_test_suite.lpi @@ -7,7 +7,7 @@ - + @@ -27,23 +27,21 @@ - + - - - - + + @@ -65,9 +63,7 @@ - - @@ -81,15 +77,13 @@ - + - - @@ -97,9 +91,7 @@ - - @@ -107,9 +99,7 @@ - - @@ -158,14 +148,12 @@ - + - - @@ -180,13 +168,13 @@ - + - + @@ -201,38 +189,38 @@ - + - + - + - + - + - + @@ -241,272 +229,233 @@ - + - - - - - - - - - - + + + - - - + + + - - - - - - - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - + + - - - - - + + + + + - - - + + + - - - + + + - - - + + + - - - - - - - - - - - - - - - + + + - - - + + + - - - - - + + + + + - - - + + + - - - - - + + + + + - - - - - - - - - - + + + - - - + + + - - - + + + - - - + + + - - - - - - - - - - + + + - + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + @@ -514,9 +463,9 @@ - - - + + + @@ -524,9 +473,9 @@ - - - + + + @@ -534,9 +483,9 @@ - - - + + + @@ -544,9 +493,9 @@ - - - + + + @@ -554,236 +503,300 @@ - - - + + + - - - + + + - - - + + + - - - + + + - - - - - + + + - - - + + + - - - + + + - - + + - + - - + + - - - - + + + + - - + + - - - - + + + + - - + + - - - + + + - - - + + + - - - - - - - + + + + + - - - + + + - - - - + + + + - - + + - - - - - + + + + + - - + + - + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -822,23 +835,11 @@ - + - - - - - - - - - - - - - + diff --git a/wst/trunk/tests/test_suite/wst_test_suite.lpr b/wst/trunk/tests/test_suite/wst_test_suite.lpr index fa07d484d..474fc6da5 100644 --- a/wst/trunk/tests/test_suite/wst_test_suite.lpr +++ b/wst/trunk/tests/test_suite/wst_test_suite.lpr @@ -16,7 +16,8 @@ uses server_binary_formatter, metadata_repository, metadata_generator, parserdefs, server_service_intf, metadata_wsdl, test_parserdef, base_xmlrpc_formatter, wst_fpc_xml, test_utilities, - server_service_xmlrpc, test_parsers, wsdl_generator; + server_service_xmlrpc, test_parsers, wsdl_generator, xsd_generator, +xsd_consts; Const ShortOpts = 'alh'; diff --git a/wst/trunk/type_lib_edtr/typ_lib_edtr.lpi b/wst/trunk/type_lib_edtr/typ_lib_edtr.lpi index c8ecea460..a0ed71bdd 100644 --- a/wst/trunk/type_lib_edtr/typ_lib_edtr.lpi +++ b/wst/trunk/type_lib_edtr/typ_lib_edtr.lpi @@ -7,7 +7,7 @@ - + @@ -36,7 +36,7 @@ - + @@ -49,8 +49,8 @@ - - + + @@ -688,8 +688,8 @@ - - + + @@ -750,7 +750,20 @@ - + + + + + + + + + + + + + + diff --git a/wst/trunk/type_lib_edtr/uwsttypelibraryedit.lfm b/wst/trunk/type_lib_edtr/uwsttypelibraryedit.lfm index 5ece4319b..0dde68c23 100644 --- a/wst/trunk/type_lib_edtr/uwsttypelibraryedit.lfm +++ b/wst/trunk/type_lib_edtr/uwsttypelibraryedit.lfm @@ -78,9 +78,11 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit PopupMenu = PopupMenu2 TabOrder = 0 BookMarkOptions.Xoffset = 81 + BookMarkOptions.OnChange = nil Gutter.DigitCount = 5 Gutter.ShowLineNumbers = True Gutter.ShowCodeFolding = True + Gutter.OnChange = nil Gutter.CodeFoldingWidth = 14 Highlighter = SynPasSyn1 Keystrokes = < @@ -405,6 +407,7 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit ShortCut = 24642 end> ReadOnly = True + SelectedColor.OnChange = nil end end object tsWSDL: TTabSheet @@ -424,7 +427,9 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit PopupMenu = PopupMenu2 TabOrder = 0 BookMarkOptions.Xoffset = 54 + BookMarkOptions.OnChange = nil Gutter.ShowLineNumbers = True + Gutter.OnChange = nil Gutter.CodeFoldingWidth = 14 Highlighter = SynXMLSyn1 Keystrokes = < @@ -749,6 +754,7 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit ShortCut = 24642 end> ReadOnly = True + SelectedColor.OnChange = nil end end object tsProxy: TTabSheet @@ -768,11 +774,9 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit PopupMenu = PopupMenu2 TabOrder = 0 BookMarkOptions.Xoffset = 81 - BookMarkOptions.OnChange = nil Gutter.DigitCount = 5 Gutter.ShowLineNumbers = True Gutter.ShowCodeFolding = True - Gutter.OnChange = nil Gutter.CodeFoldingWidth = 14 Highlighter = SynPasSyn1 Keystrokes = < @@ -1097,7 +1101,6 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit ShortCut = 24642 end> ReadOnly = True - SelectedColor.OnChange = nil end end object tsImp: TTabSheet @@ -1117,11 +1120,9 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit PopupMenu = PopupMenu2 TabOrder = 0 BookMarkOptions.Xoffset = 81 - BookMarkOptions.OnChange = nil Gutter.DigitCount = 5 Gutter.ShowLineNumbers = True Gutter.ShowCodeFolding = True - Gutter.OnChange = nil Gutter.CodeFoldingWidth = 14 Highlighter = SynPasSyn1 Keystrokes = < @@ -1446,7 +1447,6 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit ShortCut = 24642 end> ReadOnly = True - SelectedColor.OnChange = nil end end object tsBinder: TTabSheet @@ -1466,12 +1466,10 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit PopupMenu = PopupMenu2 TabOrder = 0 BookMarkOptions.Xoffset = 81 - BookMarkOptions.OnChange = nil Gutter.AutoSize = True Gutter.DigitCount = 5 Gutter.ShowLineNumbers = True Gutter.ShowCodeFolding = True - Gutter.OnChange = nil Gutter.CodeFoldingWidth = 14 Highlighter = SynPasSyn1 Keystrokes = < @@ -1796,7 +1794,6 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit ShortCut = 24642 end> ReadOnly = True - SelectedColor.OnChange = nil end end object tsLog: TTabSheet diff --git a/wst/trunk/type_lib_edtr/uwsttypelibraryedit.lrs b/wst/trunk/type_lib_edtr/uwsttypelibraryedit.lrs index 2611f08f5..ec4054c52 100644 --- a/wst/trunk/type_lib_edtr/uwsttypelibraryedit.lrs +++ b/wst/trunk/type_lib_edtr/uwsttypelibraryedit.lrs @@ -22,61 +22,63 @@ LazarusResources.Add('TfWstTypeLibraryEdit','FORMDATA',[ +'='#2#5'Width'#3#245#1#5'Align'#7#8'alClient'#12'Font.CharSet'#7#12'ANSI_CHA' +'RSET'#10'Font.Color'#7#7'clBlack'#11'Font.Height'#2#236#9'Font.Name'#6#7'Co' +'urier'#10'Font.Pitch'#7#7'fpFixed'#11'ParentColor'#8#9'PopupMenu'#7#10'Popu' - +'pMenu2'#8'TabOrder'#2#0#23'BookMarkOptions.Xoffset'#2'Q'#17'Gutter.DigitCou' - +'nt'#2#5#22'Gutter.ShowLineNumbers'#9#22'Gutter.ShowCodeFolding'#9#23'Gutter' - +'.CodeFoldingWidth'#2#14#11'Highlighter'#7#10'SynPasSyn1'#10'Keystrokes'#14#1 - +#7'Command'#2#3#8'ShortCut'#2'&'#0#1#7'Command'#2'g'#8'ShortCut'#3'& '#0#1#7 - +'Command'#3#211#0#8'ShortCut'#3'&@'#0#1#7'Command'#2#4#8'ShortCut'#2'('#0#1#7 - +'Command'#2'h'#8'ShortCut'#3'( '#0#1#7'Command'#3#212#0#8'ShortCut'#3'(@'#0#1 - +#7'Command'#2#1#8'ShortCut'#2'%'#0#1#7'Command'#2'e'#8'ShortCut'#3'% '#0#1#7 - +'Command'#2#5#8'ShortCut'#3'%@'#0#1#7'Command'#2'i'#8'ShortCut'#3'%`'#0#1#7 - +'Command'#2#2#8'ShortCut'#2''''#0#1#7'Command'#2'f'#8'ShortCut'#3''' '#0#1#7 - +'Command'#2#6#8'ShortCut'#3'''@'#0#1#7'Command'#2'j'#8'ShortCut'#3'''`'#0#1#7 - +'Command'#2#10#8'ShortCut'#2'"'#0#1#7'Command'#2'n'#8'ShortCut'#3'" '#0#1#7 - +'Command'#2#14#8'ShortCut'#3'"@'#0#1#7'Command'#2'r'#8'ShortCut'#3'"`'#0#1#7 - +'Command'#2#9#8'ShortCut'#2'!'#0#1#7'Command'#2'm'#8'ShortCut'#3'! '#0#1#7'C' - +'ommand'#2#13#8'ShortCut'#3'!@'#0#1#7'Command'#2'q'#8'ShortCut'#3'!`'#0#1#7 - +'Command'#2#7#8'ShortCut'#2'$'#0#1#7'Command'#2'k'#8'ShortCut'#3'$ '#0#1#7'C' - +'ommand'#2#15#8'ShortCut'#3'$@'#0#1#7'Command'#2's'#8'ShortCut'#3'$`'#0#1#7 - +'Command'#2#8#8'ShortCut'#2'#'#0#1#7'Command'#2'l'#8'ShortCut'#3'# '#0#1#7'C' - +'ommand'#2#16#8'ShortCut'#3'#@'#0#1#7'Command'#2't'#8'ShortCut'#3'#`'#0#1#7 - +'Command'#3#223#0#8'ShortCut'#2'-'#0#1#7'Command'#3#201#0#8'ShortCut'#3'-@'#0 - +#1#7'Command'#3'\'#2#8'ShortCut'#3'- '#0#1#7'Command'#3#246#1#8'ShortCut'#2 - +'.'#0#1#7'Command'#3'['#2#8'ShortCut'#3'. '#0#1#7'Command'#3#245#1#8'ShortCu' - +'t'#2#8#0#1#7'Command'#3#245#1#8'ShortCut'#3#8' '#0#1#7'Command'#3#248#1#8'S' - +'hortCut'#3#8'@'#0#1#7'Command'#3'Y'#2#8'ShortCut'#4#8#128#0#0#0#1#7'Command' - +#3'Z'#2#8'ShortCut'#4#8#160#0#0#0#1#7'Command'#3#253#1#8'ShortCut'#2#13#0#1#7 - +'Command'#3#199#0#8'ShortCut'#3'A@'#0#1#7'Command'#3#201#0#8'ShortCut'#3'C@' - +#0#1#7'Command'#3'b'#2#8'ShortCut'#3'I`'#0#1#7'Command'#3#253#1#8'ShortCut'#3 - +'M@'#0#1#7'Command'#3#254#1#8'ShortCut'#3'N@'#0#1#7'Command'#3#247#1#8'Short' - +'Cut'#3'T@'#0#1#7'Command'#3'c'#2#8'ShortCut'#3'U`'#0#1#7'Command'#3'\'#2#8 - +'ShortCut'#3'V@'#0#1#7'Command'#3'['#2#8'ShortCut'#3'X@'#0#1#7'Command'#3#251 - +#1#8'ShortCut'#3'Y@'#0#1#7'Command'#3#250#1#8'ShortCut'#3'Y`'#0#1#7'Command' - +#3'Y'#2#8'ShortCut'#3'Z@'#0#1#7'Command'#3'Z'#2#8'ShortCut'#3'Z`'#0#1#7'Comm' - +'and'#3'-'#1#8'ShortCut'#3'0@'#0#1#7'Command'#3'.'#1#8'ShortCut'#3'1@'#0#1#7 - +'Command'#3'/'#1#8'ShortCut'#3'2@'#0#1#7'Command'#3'0'#1#8'ShortCut'#3'3@'#0 - +#1#7'Command'#3'1'#1#8'ShortCut'#3'4@'#0#1#7'Command'#3'2'#1#8'ShortCut'#3'5' - +'@'#0#1#7'Command'#3'3'#1#8'ShortCut'#3'6@'#0#1#7'Command'#3'4'#1#8'ShortCut' - +#3'7@'#0#1#7'Command'#3'5'#1#8'ShortCut'#3'8@'#0#1#7'Command'#3'6'#1#8'Short' - +'Cut'#3'9@'#0#1#7'Command'#3'_'#1#8'ShortCut'#3'0`'#0#1#7'Command'#3'`'#1#8 - +'ShortCut'#3'1`'#0#1#7'Command'#3'a'#1#8'ShortCut'#3'2`'#0#1#7'Command'#3'b' - +#1#8'ShortCut'#3'3`'#0#1#7'Command'#3'c'#1#8'ShortCut'#3'4`'#0#1#7'Command'#3 - +'d'#1#8'ShortCut'#3'5`'#0#1#7'Command'#3'e'#1#8'ShortCut'#3'6`'#0#1#7'Comman' - +'d'#3'f'#1#8'ShortCut'#3'7`'#0#1#7'Command'#3'g'#1#8'ShortCut'#3'8`'#0#1#7'C' - +'ommand'#3'h'#1#8'ShortCut'#3'9`'#0#1#7'Command'#3#231#0#8'ShortCut'#3'N`'#0 - +#1#7'Command'#3#232#0#8'ShortCut'#3'C`'#0#1#7'Command'#3#233#0#8'ShortCut'#3 - ,'L`'#0#1#7'Command'#3'd'#2#8'ShortCut'#2#9#0#1#7'Command'#3'e'#2#8'ShortCut' - +#3#9' '#0#1#7'Command'#3#250#0#8'ShortCut'#3'B`'#0#0#8'ReadOnly'#9#0#0#0#9'T' - +'TabSheet'#6'tsWSDL'#7'Caption'#6#5'&WSDL'#12'ClientHeight'#3'='#2#11'Client' - +'Width'#3#245#1#0#8'TSynEdit'#7'srcWSDL'#6'Height'#3'='#2#5'Width'#3#245#1#5 - +'Align'#7#8'alClient'#12'Font.CharSet'#7#12'ANSI_CHARSET'#10'Font.Color'#7#7 - +'clBlack'#11'Font.Height'#2#233#9'Font.Name'#6#7'Courier'#10'Font.Pitch'#7#7 - +'fpFixed'#11'ParentColor'#8#9'PopupMenu'#7#10'PopupMenu2'#8'TabOrder'#2#0#23 - +'BookMarkOptions.Xoffset'#2'6'#22'Gutter.ShowLineNumbers'#9#23'Gutter.CodeFo' - +'ldingWidth'#2#14#11'Highlighter'#7#10'SynXMLSyn1'#10'Keystrokes'#14#1#7'Com' - +'mand'#2#3#8'ShortCut'#2'&'#0#1#7'Command'#2'g'#8'ShortCut'#3'& '#0#1#7'Comm' - +'and'#3#211#0#8'ShortCut'#3'&@'#0#1#7'Command'#2#4#8'ShortCut'#2'('#0#1#7'Co' - +'mmand'#2'h'#8'ShortCut'#3'( '#0#1#7'Command'#3#212#0#8'ShortCut'#3'(@'#0#1#7 + +'pMenu2'#8'TabOrder'#2#0#23'BookMarkOptions.Xoffset'#2'Q'#24'BookMarkOptions' + +'.OnChange'#13#17'Gutter.DigitCount'#2#5#22'Gutter.ShowLineNumbers'#9#22'Gut' + +'ter.ShowCodeFolding'#9#15'Gutter.OnChange'#13#23'Gutter.CodeFoldingWidth'#2 + +#14#11'Highlighter'#7#10'SynPasSyn1'#10'Keystrokes'#14#1#7'Command'#2#3#8'Sh' + +'ortCut'#2'&'#0#1#7'Command'#2'g'#8'ShortCut'#3'& '#0#1#7'Command'#3#211#0#8 + +'ShortCut'#3'&@'#0#1#7'Command'#2#4#8'ShortCut'#2'('#0#1#7'Command'#2'h'#8'S' + +'hortCut'#3'( '#0#1#7'Command'#3#212#0#8'ShortCut'#3'(@'#0#1#7'Command'#2#1#8 + +'ShortCut'#2'%'#0#1#7'Command'#2'e'#8'ShortCut'#3'% '#0#1#7'Command'#2#5#8'S' + +'hortCut'#3'%@'#0#1#7'Command'#2'i'#8'ShortCut'#3'%`'#0#1#7'Command'#2#2#8'S' + +'hortCut'#2''''#0#1#7'Command'#2'f'#8'ShortCut'#3''' '#0#1#7'Command'#2#6#8 + +'ShortCut'#3'''@'#0#1#7'Command'#2'j'#8'ShortCut'#3'''`'#0#1#7'Command'#2#10 + +#8'ShortCut'#2'"'#0#1#7'Command'#2'n'#8'ShortCut'#3'" '#0#1#7'Command'#2#14#8 + +'ShortCut'#3'"@'#0#1#7'Command'#2'r'#8'ShortCut'#3'"`'#0#1#7'Command'#2#9#8 + +'ShortCut'#2'!'#0#1#7'Command'#2'm'#8'ShortCut'#3'! '#0#1#7'Command'#2#13#8 + +'ShortCut'#3'!@'#0#1#7'Command'#2'q'#8'ShortCut'#3'!`'#0#1#7'Command'#2#7#8 + +'ShortCut'#2'$'#0#1#7'Command'#2'k'#8'ShortCut'#3'$ '#0#1#7'Command'#2#15#8 + +'ShortCut'#3'$@'#0#1#7'Command'#2's'#8'ShortCut'#3'$`'#0#1#7'Command'#2#8#8 + +'ShortCut'#2'#'#0#1#7'Command'#2'l'#8'ShortCut'#3'# '#0#1#7'Command'#2#16#8 + +'ShortCut'#3'#@'#0#1#7'Command'#2't'#8'ShortCut'#3'#`'#0#1#7'Command'#3#223#0 + +#8'ShortCut'#2'-'#0#1#7'Command'#3#201#0#8'ShortCut'#3'-@'#0#1#7'Command'#3 + +'\'#2#8'ShortCut'#3'- '#0#1#7'Command'#3#246#1#8'ShortCut'#2'.'#0#1#7'Comman' + +'d'#3'['#2#8'ShortCut'#3'. '#0#1#7'Command'#3#245#1#8'ShortCut'#2#8#0#1#7'Co' + +'mmand'#3#245#1#8'ShortCut'#3#8' '#0#1#7'Command'#3#248#1#8'ShortCut'#3#8'@' + +#0#1#7'Command'#3'Y'#2#8'ShortCut'#4#8#128#0#0#0#1#7'Command'#3'Z'#2#8'Short' + +'Cut'#4#8#160#0#0#0#1#7'Command'#3#253#1#8'ShortCut'#2#13#0#1#7'Command'#3 + +#199#0#8'ShortCut'#3'A@'#0#1#7'Command'#3#201#0#8'ShortCut'#3'C@'#0#1#7'Comm' + +'and'#3'b'#2#8'ShortCut'#3'I`'#0#1#7'Command'#3#253#1#8'ShortCut'#3'M@'#0#1#7 + +'Command'#3#254#1#8'ShortCut'#3'N@'#0#1#7'Command'#3#247#1#8'ShortCut'#3'T@' + +#0#1#7'Command'#3'c'#2#8'ShortCut'#3'U`'#0#1#7'Command'#3'\'#2#8'ShortCut'#3 + +'V@'#0#1#7'Command'#3'['#2#8'ShortCut'#3'X@'#0#1#7'Command'#3#251#1#8'ShortC' + +'ut'#3'Y@'#0#1#7'Command'#3#250#1#8'ShortCut'#3'Y`'#0#1#7'Command'#3'Y'#2#8 + +'ShortCut'#3'Z@'#0#1#7'Command'#3'Z'#2#8'ShortCut'#3'Z`'#0#1#7'Command'#3'-' + +#1#8'ShortCut'#3'0@'#0#1#7'Command'#3'.'#1#8'ShortCut'#3'1@'#0#1#7'Command'#3 + +'/'#1#8'ShortCut'#3'2@'#0#1#7'Command'#3'0'#1#8'ShortCut'#3'3@'#0#1#7'Comman' + +'d'#3'1'#1#8'ShortCut'#3'4@'#0#1#7'Command'#3'2'#1#8'ShortCut'#3'5@'#0#1#7'C' + +'ommand'#3'3'#1#8'ShortCut'#3'6@'#0#1#7'Command'#3'4'#1#8'ShortCut'#3'7@'#0#1 + +#7'Command'#3'5'#1#8'ShortCut'#3'8@'#0#1#7'Command'#3'6'#1#8'ShortCut'#3'9@' + +#0#1#7'Command'#3'_'#1#8'ShortCut'#3'0`'#0#1#7'Command'#3'`'#1#8'ShortCut'#3 + +'1`'#0#1#7'Command'#3'a'#1#8'ShortCut'#3'2`'#0#1#7'Command'#3'b'#1#8'ShortCu' + +'t'#3'3`'#0#1#7'Command'#3'c'#1#8'ShortCut'#3'4`'#0#1#7'Command'#3'd'#1#8'Sh' + +'ortCut'#3'5`'#0#1#7'Command'#3'e'#1#8'ShortCut'#3'6`'#0#1#7'Command'#3'f'#1 + +#8'ShortCut'#3'7`'#0#1#7'Command'#3'g'#1#8'ShortCut'#3'8`'#0#1#7'Command'#3 + +'h'#1#8'ShortCut'#3'9`'#0#1#7'Command'#3#231#0#8'ShortCut'#3'N`'#0#1#7'Comma' + ,'nd'#3#232#0#8'ShortCut'#3'C`'#0#1#7'Command'#3#233#0#8'ShortCut'#3'L`'#0#1#7 + +'Command'#3'd'#2#8'ShortCut'#2#9#0#1#7'Command'#3'e'#2#8'ShortCut'#3#9' '#0#1 + +#7'Command'#3#250#0#8'ShortCut'#3'B`'#0#0#8'ReadOnly'#9#22'SelectedColor.OnC' + +'hange'#13#0#0#0#9'TTabSheet'#6'tsWSDL'#7'Caption'#6#5'&WSDL'#12'ClientHeigh' + +'t'#3'='#2#11'ClientWidth'#3#245#1#0#8'TSynEdit'#7'srcWSDL'#6'Height'#3'='#2 + +#5'Width'#3#245#1#5'Align'#7#8'alClient'#12'Font.CharSet'#7#12'ANSI_CHARSET' + +#10'Font.Color'#7#7'clBlack'#11'Font.Height'#2#233#9'Font.Name'#6#7'Courier' + +#10'Font.Pitch'#7#7'fpFixed'#11'ParentColor'#8#9'PopupMenu'#7#10'PopupMenu2' + +#8'TabOrder'#2#0#23'BookMarkOptions.Xoffset'#2'6'#24'BookMarkOptions.OnChang' + +'e'#13#22'Gutter.ShowLineNumbers'#9#15'Gutter.OnChange'#13#23'Gutter.CodeFol' + +'dingWidth'#2#14#11'Highlighter'#7#10'SynXMLSyn1'#10'Keystrokes'#14#1#7'Comm' + +'and'#2#3#8'ShortCut'#2'&'#0#1#7'Command'#2'g'#8'ShortCut'#3'& '#0#1#7'Comma' + +'nd'#3#211#0#8'ShortCut'#3'&@'#0#1#7'Command'#2#4#8'ShortCut'#2'('#0#1#7'Com' + +'mand'#2'h'#8'ShortCut'#3'( '#0#1#7'Command'#3#212#0#8'ShortCut'#3'(@'#0#1#7 +'Command'#2#1#8'ShortCut'#2'%'#0#1#7'Command'#2'e'#8'ShortCut'#3'% '#0#1#7'C' +'ommand'#2#5#8'ShortCut'#3'%@'#0#1#7'Command'#2'i'#8'ShortCut'#3'%`'#0#1#7'C' +'ommand'#2#2#8'ShortCut'#2''''#0#1#7'Command'#2'f'#8'ShortCut'#3''' '#0#1#7 @@ -115,271 +117,267 @@ LazarusResources.Add('TfWstTypeLibraryEdit','FORMDATA',[ +'ommand'#3'h'#1#8'ShortCut'#3'9`'#0#1#7'Command'#3#231#0#8'ShortCut'#3'N`'#0 +#1#7'Command'#3#232#0#8'ShortCut'#3'C`'#0#1#7'Command'#3#233#0#8'ShortCut'#3 +'L`'#0#1#7'Command'#3'd'#2#8'ShortCut'#2#9#0#1#7'Command'#3'e'#2#8'ShortCut' - +#3#9' '#0#1#7'Command'#3#250#0#8'ShortCut'#3'B`'#0#0#8'ReadOnly'#9#0#0#0#9'T' - +'TabSheet'#7'tsProxy'#7'Caption'#6#6'&Proxy'#12'ClientHeight'#3'='#2#11'Clie' - +'ntWidth'#3#245#1#0#8'TSynEdit'#8'srcProxy'#6'Height'#3'='#2#5'Width'#3#245#1 - +#5'Align'#7#8'alClient'#12'Font.CharSet'#7#12'ANSI_CHARSET'#10'Font.Color'#7 - +#7'clBlack'#11'Font.Height'#2#236#9'Font.Name'#6#7'Courier'#10'Font.Pitch'#7 - +#7'fpFixed'#11'ParentColor'#8#9'PopupMenu'#7#10'PopupMenu2'#8'TabOrder'#2#0 - +#23'BookMarkOptions.Xoffset'#2'Q'#24'BookMarkOptions.OnChange'#13#17'Gutter.' - +'DigitCount'#2#5#22'Gutter.ShowLineNumbers'#9#22'Gutter.ShowCodeFolding'#9#15 - +'Gutter.OnChange'#13#23'Gutter.CodeFoldingWidth'#2#14#11'Highlighter'#7#10'S' - +'ynPasSyn1'#10'Keystrokes'#14#1#7'Command'#2#3#8'ShortCut'#2'&'#0#1#7'Comman' - +'d'#2'g'#8'ShortCut'#3'& '#0#1#7'Command'#3#211#0#8'ShortCut'#3'&@'#0#1#7'Co' - +'mmand'#2#4#8'ShortCut'#2'('#0#1#7'Command'#2'h'#8'ShortCut'#3'( '#0#1#7'Com' - +'mand'#3#212#0#8'ShortCut'#3'(@'#0#1#7'Command'#2#1#8'ShortCut'#2'%'#0#1#7'C' - +'ommand'#2'e'#8'ShortCut'#3'% '#0#1#7'Command'#2#5#8'ShortCut'#3'%@'#0#1#7'C' - ,'ommand'#2'i'#8'ShortCut'#3'%`'#0#1#7'Command'#2#2#8'ShortCut'#2''''#0#1#7'C' - +'ommand'#2'f'#8'ShortCut'#3''' '#0#1#7'Command'#2#6#8'ShortCut'#3'''@'#0#1#7 - +'Command'#2'j'#8'ShortCut'#3'''`'#0#1#7'Command'#2#10#8'ShortCut'#2'"'#0#1#7 - +'Command'#2'n'#8'ShortCut'#3'" '#0#1#7'Command'#2#14#8'ShortCut'#3'"@'#0#1#7 - +'Command'#2'r'#8'ShortCut'#3'"`'#0#1#7'Command'#2#9#8'ShortCut'#2'!'#0#1#7'C' - +'ommand'#2'm'#8'ShortCut'#3'! '#0#1#7'Command'#2#13#8'ShortCut'#3'!@'#0#1#7 - +'Command'#2'q'#8'ShortCut'#3'!`'#0#1#7'Command'#2#7#8'ShortCut'#2'$'#0#1#7'C' - +'ommand'#2'k'#8'ShortCut'#3'$ '#0#1#7'Command'#2#15#8'ShortCut'#3'$@'#0#1#7 - +'Command'#2's'#8'ShortCut'#3'$`'#0#1#7'Command'#2#8#8'ShortCut'#2'#'#0#1#7'C' - +'ommand'#2'l'#8'ShortCut'#3'# '#0#1#7'Command'#2#16#8'ShortCut'#3'#@'#0#1#7 - +'Command'#2't'#8'ShortCut'#3'#`'#0#1#7'Command'#3#223#0#8'ShortCut'#2'-'#0#1 - +#7'Command'#3#201#0#8'ShortCut'#3'-@'#0#1#7'Command'#3'\'#2#8'ShortCut'#3'- ' - +#0#1#7'Command'#3#246#1#8'ShortCut'#2'.'#0#1#7'Command'#3'['#2#8'ShortCut'#3 - +'. '#0#1#7'Command'#3#245#1#8'ShortCut'#2#8#0#1#7'Command'#3#245#1#8'ShortCu' - +'t'#3#8' '#0#1#7'Command'#3#248#1#8'ShortCut'#3#8'@'#0#1#7'Command'#3'Y'#2#8 - +'ShortCut'#4#8#128#0#0#0#1#7'Command'#3'Z'#2#8'ShortCut'#4#8#160#0#0#0#1#7'C' - +'ommand'#3#253#1#8'ShortCut'#2#13#0#1#7'Command'#3#199#0#8'ShortCut'#3'A@'#0 - +#1#7'Command'#3#201#0#8'ShortCut'#3'C@'#0#1#7'Command'#3'b'#2#8'ShortCut'#3 - +'I`'#0#1#7'Command'#3#253#1#8'ShortCut'#3'M@'#0#1#7'Command'#3#254#1#8'Short' - +'Cut'#3'N@'#0#1#7'Command'#3#247#1#8'ShortCut'#3'T@'#0#1#7'Command'#3'c'#2#8 - +'ShortCut'#3'U`'#0#1#7'Command'#3'\'#2#8'ShortCut'#3'V@'#0#1#7'Command'#3'[' - +#2#8'ShortCut'#3'X@'#0#1#7'Command'#3#251#1#8'ShortCut'#3'Y@'#0#1#7'Command' - +#3#250#1#8'ShortCut'#3'Y`'#0#1#7'Command'#3'Y'#2#8'ShortCut'#3'Z@'#0#1#7'Com' - +'mand'#3'Z'#2#8'ShortCut'#3'Z`'#0#1#7'Command'#3'-'#1#8'ShortCut'#3'0@'#0#1#7 - +'Command'#3'.'#1#8'ShortCut'#3'1@'#0#1#7'Command'#3'/'#1#8'ShortCut'#3'2@'#0 - +#1#7'Command'#3'0'#1#8'ShortCut'#3'3@'#0#1#7'Command'#3'1'#1#8'ShortCut'#3'4' - +'@'#0#1#7'Command'#3'2'#1#8'ShortCut'#3'5@'#0#1#7'Command'#3'3'#1#8'ShortCut' - +#3'6@'#0#1#7'Command'#3'4'#1#8'ShortCut'#3'7@'#0#1#7'Command'#3'5'#1#8'Short' - +'Cut'#3'8@'#0#1#7'Command'#3'6'#1#8'ShortCut'#3'9@'#0#1#7'Command'#3'_'#1#8 - +'ShortCut'#3'0`'#0#1#7'Command'#3'`'#1#8'ShortCut'#3'1`'#0#1#7'Command'#3'a' - +#1#8'ShortCut'#3'2`'#0#1#7'Command'#3'b'#1#8'ShortCut'#3'3`'#0#1#7'Command'#3 - +'c'#1#8'ShortCut'#3'4`'#0#1#7'Command'#3'd'#1#8'ShortCut'#3'5`'#0#1#7'Comman' - +'d'#3'e'#1#8'ShortCut'#3'6`'#0#1#7'Command'#3'f'#1#8'ShortCut'#3'7`'#0#1#7'C' - +'ommand'#3'g'#1#8'ShortCut'#3'8`'#0#1#7'Command'#3'h'#1#8'ShortCut'#3'9`'#0#1 - +#7'Command'#3#231#0#8'ShortCut'#3'N`'#0#1#7'Command'#3#232#0#8'ShortCut'#3'C' - +'`'#0#1#7'Command'#3#233#0#8'ShortCut'#3'L`'#0#1#7'Command'#3'd'#2#8'ShortCu' - +'t'#2#9#0#1#7'Command'#3'e'#2#8'ShortCut'#3#9' '#0#1#7'Command'#3#250#0#8'Sh' - +'ortCut'#3'B`'#0#0#8'ReadOnly'#9#22'SelectedColor.OnChange'#13#0#0#0#9'TTabS' - +'heet'#5'tsImp'#7'Caption'#6#24'Im&plementation Skeleton'#12'ClientHeight'#3 - +'='#2#11'ClientWidth'#3#245#1#0#8'TSynEdit'#6'srcImp'#6'Height'#3'='#2#5'Wid' - +'th'#3#245#1#5'Align'#7#8'alClient'#12'Font.CharSet'#7#12'ANSI_CHARSET'#10'F' - +'ont.Color'#7#7'clBlack'#11'Font.Height'#2#236#9'Font.Name'#6#7'Courier'#10 - +'Font.Pitch'#7#7'fpFixed'#11'ParentColor'#8#9'PopupMenu'#7#10'PopupMenu2'#8 - +'TabOrder'#2#0#23'BookMarkOptions.Xoffset'#2'Q'#24'BookMarkOptions.OnChange' - +#13#17'Gutter.DigitCount'#2#5#22'Gutter.ShowLineNumbers'#9#22'Gutter.ShowCod' - +'eFolding'#9#15'Gutter.OnChange'#13#23'Gutter.CodeFoldingWidth'#2#14#11'High' - +'lighter'#7#10'SynPasSyn1'#10'Keystrokes'#14#1#7'Command'#2#3#8'ShortCut'#2 - +'&'#0#1#7'Command'#2'g'#8'ShortCut'#3'& '#0#1#7'Command'#3#211#0#8'ShortCut' - +#3'&@'#0#1#7'Command'#2#4#8'ShortCut'#2'('#0#1#7'Command'#2'h'#8'ShortCut'#3 - +'( '#0#1#7'Command'#3#212#0#8'ShortCut'#3'(@'#0#1#7'Command'#2#1#8'ShortCut' - +#2'%'#0#1#7'Command'#2'e'#8'ShortCut'#3'% '#0#1#7'Command'#2#5#8'ShortCut'#3 - +'%@'#0#1#7'Command'#2'i'#8'ShortCut'#3'%`'#0#1#7'Command'#2#2#8'ShortCut'#2 - +''''#0#1#7'Command'#2'f'#8'ShortCut'#3''' '#0#1#7'Command'#2#6#8'ShortCut'#3 - +'''@'#0#1#7'Command'#2'j'#8'ShortCut'#3'''`'#0#1#7'Command'#2#10#8'ShortCut' - +#2'"'#0#1#7'Command'#2'n'#8'ShortCut'#3'" '#0#1#7'Command'#2#14#8'ShortCut'#3 - +'"@'#0#1#7'Command'#2'r'#8'ShortCut'#3'"`'#0#1#7'Command'#2#9#8'ShortCut'#2 - +'!'#0#1#7'Command'#2'm'#8'ShortCut'#3'! '#0#1#7'Command'#2#13#8'ShortCut'#3 - +'!@'#0#1#7'Command'#2'q'#8'ShortCut'#3'!`'#0#1#7'Command'#2#7#8'ShortCut'#2 - +'$'#0#1#7'Command'#2'k'#8'ShortCut'#3'$ '#0#1#7'Command'#2#15#8'ShortCut'#3 - +'$@'#0#1#7'Command'#2's'#8'ShortCut'#3'$`'#0#1#7'Command'#2#8#8'ShortCut'#2 - +'#'#0#1#7'Command'#2'l'#8'ShortCut'#3'# '#0#1#7'Command'#2#16#8'ShortCut'#3 - +'#@'#0#1#7'Command'#2't'#8'ShortCut'#3'#`'#0#1#7'Command'#3#223#0#8'ShortCut' - +#2'-'#0#1#7'Command'#3#201#0#8'ShortCut'#3'-@'#0#1#7'Command'#3'\'#2#8'Short' - +'Cut'#3'- '#0#1#7'Command'#3#246#1#8'ShortCut'#2'.'#0#1#7'Command'#3'['#2#8 - ,'ShortCut'#3'. '#0#1#7'Command'#3#245#1#8'ShortCut'#2#8#0#1#7'Command'#3#245 - +#1#8'ShortCut'#3#8' '#0#1#7'Command'#3#248#1#8'ShortCut'#3#8'@'#0#1#7'Comman' - +'d'#3'Y'#2#8'ShortCut'#4#8#128#0#0#0#1#7'Command'#3'Z'#2#8'ShortCut'#4#8#160 - +#0#0#0#1#7'Command'#3#253#1#8'ShortCut'#2#13#0#1#7'Command'#3#199#0#8'ShortC' - +'ut'#3'A@'#0#1#7'Command'#3#201#0#8'ShortCut'#3'C@'#0#1#7'Command'#3'b'#2#8 - +'ShortCut'#3'I`'#0#1#7'Command'#3#253#1#8'ShortCut'#3'M@'#0#1#7'Command'#3 - +#254#1#8'ShortCut'#3'N@'#0#1#7'Command'#3#247#1#8'ShortCut'#3'T@'#0#1#7'Comm' - +'and'#3'c'#2#8'ShortCut'#3'U`'#0#1#7'Command'#3'\'#2#8'ShortCut'#3'V@'#0#1#7 - +'Command'#3'['#2#8'ShortCut'#3'X@'#0#1#7'Command'#3#251#1#8'ShortCut'#3'Y@'#0 - +#1#7'Command'#3#250#1#8'ShortCut'#3'Y`'#0#1#7'Command'#3'Y'#2#8'ShortCut'#3 - +'Z@'#0#1#7'Command'#3'Z'#2#8'ShortCut'#3'Z`'#0#1#7'Command'#3'-'#1#8'ShortCu' - +'t'#3'0@'#0#1#7'Command'#3'.'#1#8'ShortCut'#3'1@'#0#1#7'Command'#3'/'#1#8'Sh' - +'ortCut'#3'2@'#0#1#7'Command'#3'0'#1#8'ShortCut'#3'3@'#0#1#7'Command'#3'1'#1 - +#8'ShortCut'#3'4@'#0#1#7'Command'#3'2'#1#8'ShortCut'#3'5@'#0#1#7'Command'#3 - +'3'#1#8'ShortCut'#3'6@'#0#1#7'Command'#3'4'#1#8'ShortCut'#3'7@'#0#1#7'Comman' - +'d'#3'5'#1#8'ShortCut'#3'8@'#0#1#7'Command'#3'6'#1#8'ShortCut'#3'9@'#0#1#7'C' - +'ommand'#3'_'#1#8'ShortCut'#3'0`'#0#1#7'Command'#3'`'#1#8'ShortCut'#3'1`'#0#1 - +#7'Command'#3'a'#1#8'ShortCut'#3'2`'#0#1#7'Command'#3'b'#1#8'ShortCut'#3'3`' - +#0#1#7'Command'#3'c'#1#8'ShortCut'#3'4`'#0#1#7'Command'#3'd'#1#8'ShortCut'#3 - +'5`'#0#1#7'Command'#3'e'#1#8'ShortCut'#3'6`'#0#1#7'Command'#3'f'#1#8'ShortCu' - +'t'#3'7`'#0#1#7'Command'#3'g'#1#8'ShortCut'#3'8`'#0#1#7'Command'#3'h'#1#8'Sh' - +'ortCut'#3'9`'#0#1#7'Command'#3#231#0#8'ShortCut'#3'N`'#0#1#7'Command'#3#232 - +#0#8'ShortCut'#3'C`'#0#1#7'Command'#3#233#0#8'ShortCut'#3'L`'#0#1#7'Command' - +#3'd'#2#8'ShortCut'#2#9#0#1#7'Command'#3'e'#2#8'ShortCut'#3#9' '#0#1#7'Comma' - +'nd'#3#250#0#8'ShortCut'#3'B`'#0#0#8'ReadOnly'#9#22'SelectedColor.OnChange' - +#13#0#0#0#9'TTabSheet'#8'tsBinder'#7'Caption'#6#7'&Binder'#12'ClientHeight'#3 - +'='#2#11'ClientWidth'#3#245#1#0#8'TSynEdit'#9'srcBinder'#6'Height'#3'='#2#5 - +'Width'#3#245#1#5'Align'#7#8'alClient'#12'Font.CharSet'#7#12'ANSI_CHARSET'#10 - +'Font.Color'#7#7'clBlack'#11'Font.Height'#2#236#9'Font.Name'#6#7'Courier'#10 - +'Font.Pitch'#7#7'fpFixed'#11'ParentColor'#8#9'PopupMenu'#7#10'PopupMenu2'#8 - +'TabOrder'#2#0#23'BookMarkOptions.Xoffset'#2'Q'#24'BookMarkOptions.OnChange' - +#13#15'Gutter.AutoSize'#9#17'Gutter.DigitCount'#2#5#22'Gutter.ShowLineNumber' - +'s'#9#22'Gutter.ShowCodeFolding'#9#15'Gutter.OnChange'#13#23'Gutter.CodeFold' - +'ingWidth'#2#14#11'Highlighter'#7#10'SynPasSyn1'#10'Keystrokes'#14#1#7'Comma' - +'nd'#2#3#8'ShortCut'#2'&'#0#1#7'Command'#2'g'#8'ShortCut'#3'& '#0#1#7'Comman' - +'d'#3#211#0#8'ShortCut'#3'&@'#0#1#7'Command'#2#4#8'ShortCut'#2'('#0#1#7'Comm' - +'and'#2'h'#8'ShortCut'#3'( '#0#1#7'Command'#3#212#0#8'ShortCut'#3'(@'#0#1#7 - +'Command'#2#1#8'ShortCut'#2'%'#0#1#7'Command'#2'e'#8'ShortCut'#3'% '#0#1#7'C' - +'ommand'#2#5#8'ShortCut'#3'%@'#0#1#7'Command'#2'i'#8'ShortCut'#3'%`'#0#1#7'C' - +'ommand'#2#2#8'ShortCut'#2''''#0#1#7'Command'#2'f'#8'ShortCut'#3''' '#0#1#7 - +'Command'#2#6#8'ShortCut'#3'''@'#0#1#7'Command'#2'j'#8'ShortCut'#3'''`'#0#1#7 - +'Command'#2#10#8'ShortCut'#2'"'#0#1#7'Command'#2'n'#8'ShortCut'#3'" '#0#1#7 - +'Command'#2#14#8'ShortCut'#3'"@'#0#1#7'Command'#2'r'#8'ShortCut'#3'"`'#0#1#7 - +'Command'#2#9#8'ShortCut'#2'!'#0#1#7'Command'#2'm'#8'ShortCut'#3'! '#0#1#7'C' - +'ommand'#2#13#8'ShortCut'#3'!@'#0#1#7'Command'#2'q'#8'ShortCut'#3'!`'#0#1#7 - +'Command'#2#7#8'ShortCut'#2'$'#0#1#7'Command'#2'k'#8'ShortCut'#3'$ '#0#1#7'C' - +'ommand'#2#15#8'ShortCut'#3'$@'#0#1#7'Command'#2's'#8'ShortCut'#3'$`'#0#1#7 - +'Command'#2#8#8'ShortCut'#2'#'#0#1#7'Command'#2'l'#8'ShortCut'#3'# '#0#1#7'C' - +'ommand'#2#16#8'ShortCut'#3'#@'#0#1#7'Command'#2't'#8'ShortCut'#3'#`'#0#1#7 - +'Command'#3#223#0#8'ShortCut'#2'-'#0#1#7'Command'#3#201#0#8'ShortCut'#3'-@'#0 - +#1#7'Command'#3'\'#2#8'ShortCut'#3'- '#0#1#7'Command'#3#246#1#8'ShortCut'#2 - +'.'#0#1#7'Command'#3'['#2#8'ShortCut'#3'. '#0#1#7'Command'#3#245#1#8'ShortCu' - +'t'#2#8#0#1#7'Command'#3#245#1#8'ShortCut'#3#8' '#0#1#7'Command'#3#248#1#8'S' - +'hortCut'#3#8'@'#0#1#7'Command'#3'Y'#2#8'ShortCut'#4#8#128#0#0#0#1#7'Command' - +#3'Z'#2#8'ShortCut'#4#8#160#0#0#0#1#7'Command'#3#253#1#8'ShortCut'#2#13#0#1#7 - +'Command'#3#199#0#8'ShortCut'#3'A@'#0#1#7'Command'#3#201#0#8'ShortCut'#3'C@' - +#0#1#7'Command'#3'b'#2#8'ShortCut'#3'I`'#0#1#7'Command'#3#253#1#8'ShortCut'#3 - +'M@'#0#1#7'Command'#3#254#1#8'ShortCut'#3'N@'#0#1#7'Command'#3#247#1#8'Short' - +'Cut'#3'T@'#0#1#7'Command'#3'c'#2#8'ShortCut'#3'U`'#0#1#7'Command'#3'\'#2#8 - +'ShortCut'#3'V@'#0#1#7'Command'#3'['#2#8'ShortCut'#3'X@'#0#1#7'Command'#3#251 - +#1#8'ShortCut'#3'Y@'#0#1#7'Command'#3#250#1#8'ShortCut'#3'Y`'#0#1#7'Command' - +#3'Y'#2#8'ShortCut'#3'Z@'#0#1#7'Command'#3'Z'#2#8'ShortCut'#3'Z`'#0#1#7'Comm' - +'and'#3'-'#1#8'ShortCut'#3'0@'#0#1#7'Command'#3'.'#1#8'ShortCut'#3'1@'#0#1#7 - +'Command'#3'/'#1#8'ShortCut'#3'2@'#0#1#7'Command'#3'0'#1#8'ShortCut'#3'3@'#0 - ,#1#7'Command'#3'1'#1#8'ShortCut'#3'4@'#0#1#7'Command'#3'2'#1#8'ShortCut'#3'5' - +'@'#0#1#7'Command'#3'3'#1#8'ShortCut'#3'6@'#0#1#7'Command'#3'4'#1#8'ShortCut' - +#3'7@'#0#1#7'Command'#3'5'#1#8'ShortCut'#3'8@'#0#1#7'Command'#3'6'#1#8'Short' - +'Cut'#3'9@'#0#1#7'Command'#3'_'#1#8'ShortCut'#3'0`'#0#1#7'Command'#3'`'#1#8 - +'ShortCut'#3'1`'#0#1#7'Command'#3'a'#1#8'ShortCut'#3'2`'#0#1#7'Command'#3'b' - +#1#8'ShortCut'#3'3`'#0#1#7'Command'#3'c'#1#8'ShortCut'#3'4`'#0#1#7'Command'#3 - +'d'#1#8'ShortCut'#3'5`'#0#1#7'Command'#3'e'#1#8'ShortCut'#3'6`'#0#1#7'Comman' - +'d'#3'f'#1#8'ShortCut'#3'7`'#0#1#7'Command'#3'g'#1#8'ShortCut'#3'8`'#0#1#7'C' - +'ommand'#3'h'#1#8'ShortCut'#3'9`'#0#1#7'Command'#3#231#0#8'ShortCut'#3'N`'#0 - +#1#7'Command'#3#232#0#8'ShortCut'#3'C`'#0#1#7'Command'#3#233#0#8'ShortCut'#3 - +'L`'#0#1#7'Command'#3'd'#2#8'ShortCut'#2#9#0#1#7'Command'#3'e'#2#8'ShortCut' +#3#9' '#0#1#7'Command'#3#250#0#8'ShortCut'#3'B`'#0#0#8'ReadOnly'#9#22'Select' - +'edColor.OnChange'#13#0#0#0#9'TTabSheet'#5'tsLog'#7'Caption'#6#4'&Log'#12'Cl' - +'ientHeight'#3'='#2#11'ClientWidth'#3#245#1#0#5'TMemo'#6'mmoLog'#6'Height'#3 - +'='#2#5'Width'#3#245#1#5'Align'#7#8'alClient'#13'Lines.Strings'#1#6#0#0#10'S' - +'crollBars'#7#6'ssBoth'#8'TabOrder'#2#0#0#0#0#0#0#9'TSplitter'#9'Splitter1'#4 - +'Left'#3':'#1#6'Height'#3'Y'#2#5'Width'#2#8#5'Color'#7#7'clBlack'#11'ParentC' - +'olor'#8#0#0#9'TMainMenu'#9'MainMenu1'#4'left'#3'`'#1#3'top'#2'p'#0#9'TMenuI' - +'tem'#9'MenuItem1'#7'Caption'#6#6'&Files'#0#9'TMenuItem'#10'MenuItem16'#6'Ac' - +'tion'#7#10'actNewFile'#7'OnClick'#7#17'actNewFileExecute'#0#0#9'TMenuItem'#9 - +'MenuItem2'#7'Caption'#6#1'-'#0#0#9'TMenuItem'#9'MenuItem5'#6'Action'#7#11'a' - +'ctOpenFile'#7'OnClick'#7#18'actOpenFileExecute'#0#0#9'TMenuItem'#9'MenuItem' - +'3'#6'Action'#7#9'actExport'#7'OnClick'#7#16'actExportExecute'#0#0#9'TMenuIt' - +'em'#9'MenuItem7'#6'Action'#7#7'actSave'#7'OnClick'#7#14'actSaveExecute'#0#0 - +#9'TMenuItem'#10'MenuItem32'#6'Action'#7#9'actSaveAs'#7'OnClick'#7#16'actSav' - +'eAsExecute'#0#0#9'TMenuItem'#10'MenuItem17'#7'Caption'#6#1'-'#0#0#9'TMenuIt' - +'em'#9'MenuItem4'#6'Action'#7#7'actExit'#7'OnClick'#7#14'actExitExecute'#0#0 - +#0#9'TMenuItem'#10'MenuItem14'#7'Caption'#6#5'&View'#0#9'TMenuItem'#10'MenuI' - +'tem15'#6'Action'#7#14'actRefreshView'#7'OnClick'#7#21'actRefreshViewExecute' - +#0#0#9'TMenuItem'#10'MenuItem29'#7'Caption'#6#1'-'#0#0#9'TMenuItem'#10'MenuI' - +'tem30'#6'Action'#7#13'actFullExpand'#7'OnClick'#7#20'actFullExpandExecute'#0 - +#0#9'TMenuItem'#10'MenuItem31'#6'Action'#7#15'actFullCollapse'#7'OnClick'#7 - +#22'actFullCollapseExecute'#0#0#0#9'TMenuItem'#10'MenuItem10'#7'Caption'#6#8 - +'&Edition'#0#9'TMenuItem'#10'MenuItem11'#6'Action'#7#13'actEnumCreate'#7'OnC' - +'lick'#7#20'actEnumCreateExecute'#0#0#9'TMenuItem'#10'MenuItem23'#6'Action'#7 - +#17'actCompoundCreate'#7'OnClick'#7#24'actCompoundCreateExecute'#0#0#9'TMenu' - +'Item'#10'MenuItem48'#6'Action'#7#15'actRecordCreate'#7'OnClick'#7#22'actRec' - +'ordCreateExecute'#0#0#9'TMenuItem'#10'MenuItem25'#6'Action'#7#13'actIntfCre' - +'ate'#7'OnClick'#7#20'actIntfCreateExecute'#0#0#9'TMenuItem'#10'MenuItem35'#6 - +'Action'#7#14'actArrayCreate'#7'OnClick'#7#21'actArrayCreateExecute'#0#0#9'T' - +'MenuItem'#10'MenuItem36'#6'Action'#7#18'actTypeALiasCreate'#7'OnClick'#7#25 - +'actTypeALiasCreateExecute'#0#0#9'TMenuItem'#10'MenuItem12'#7'Caption'#6#1'-' - +#0#0#9'TMenuItem'#10'MenuItem13'#6'Action'#7#15'actUpdateObject'#7'Caption'#6 - +#13'Update Object'#7'OnClick'#7#22'actUpdateObjectExecute'#0#0#9'TMenuItem' - +#10'MenuItem34'#6'Action'#7#9'actDelete'#7'OnClick'#7#16'actDeleteExecute'#0 - +#0#0#9'TMenuItem'#9'MenuItem6'#6'Action'#7#8'actAbout'#7'Caption'#6#6'&About' - +#7'OnClick'#7#15'actAboutExecute'#0#0#0#11'TActionList'#2'AL'#4'left'#3'X'#1 - +#3'top'#2'8'#0#7'TAction'#11'actOpenFile'#7'Caption'#6#9'Open File'#18'Disab' - +'leIfNoHandler'#9#9'OnExecute'#7#18'actOpenFileExecute'#0#0#7'TAction'#7'act' - +'Exit'#7'Caption'#6#4'Exit'#18'DisableIfNoHandler'#9#9'OnExecute'#7#14'actEx' - +'itExecute'#0#0#7'TAction'#9'actExport'#7'Caption'#6#24'Save generated files' - +' ...'#18'DisableIfNoHandler'#9#9'OnExecute'#7#16'actExportExecute'#8'OnUpda' - +'te'#7#15'actExportUpdate'#0#0#7'TAction'#8'actAbout'#7'Caption'#6#5'About' - +#18'DisableIfNoHandler'#9#9'OnExecute'#7#15'actAboutExecute'#0#0#7'TAction'#9 - +'actSaveAs'#7'Caption'#6#11'Save As ...'#18'DisableIfNoHandler'#9#9'OnExecut' - +'e'#7#16'actSaveAsExecute'#8'OnUpdate'#7#15'actExportUpdate'#0#0#7'TAction' - +#13'actEnumCreate'#7'Caption'#6#18'Create Enumeration'#18'DisableIfNoHandler' - +#9#9'OnExecute'#7#20'actEnumCreateExecute'#0#0#7'TAction'#15'actUpdateObject' - +#7'Caption'#6#6'Update'#18'DisableIfNoHandler'#9#9'OnExecute'#7#22'actUpdate' - +'ObjectExecute'#8'OnUpdate'#7#21'actUpdateObjectUpdate'#0#0#7'TAction'#14'ac' - +'tRefreshView'#7'Caption'#6#14'&Refresh Views'#18'DisableIfNoHandler'#9#9'On' - +'Execute'#7#21'actRefreshViewExecute'#0#0#7'TAction'#10'actNewFile'#7'Captio' - +'n'#6#8'New File'#18'DisableIfNoHandler'#9#9'OnExecute'#7#17'actNewFileExecu' - +'te'#0#0#7'TAction'#17'actCompoundCreate'#7'Caption'#6#17'Create Class Type' - ,#18'DisableIfNoHandler'#9#9'OnExecute'#7#24'actCompoundCreateExecute'#0#0#7 - +'TAction'#13'actIntfCreate'#7'Caption'#6#16'Create Interface'#18'DisableIfNo' - +'Handler'#9#9'OnExecute'#7#20'actIntfCreateExecute'#0#0#7'TAction'#13'actFul' - +'lExpand'#7'Caption'#6#11'Full expand'#18'DisableIfNoHandler'#9#9'OnExecute' - +#7#20'actFullExpandExecute'#0#0#7'TAction'#15'actFullCollapse'#7'Caption'#6 - +#13'Full Collapse'#18'DisableIfNoHandler'#9#9'OnExecute'#7#22'actFullCollaps' - +'eExecute'#0#0#7'TAction'#7'actSave'#7'Caption'#6#4'Save'#18'DisableIfNoHand' - +'ler'#9#9'OnExecute'#7#14'actSaveExecute'#0#0#7'TAction'#9'actDelete'#7'Capt' - +'ion'#6#6'Delete'#18'DisableIfNoHandler'#9#9'OnExecute'#7#16'actDeleteExecut' - +'e'#8'OnUpdate'#7#21'actUpdateObjectUpdate'#0#0#7'TAction'#14'actArrayCreate' - +#7'Caption'#6#12'Create Array'#18'DisableIfNoHandler'#9#9'OnExecute'#7#21'ac' - +'tArrayCreateExecute'#0#0#7'TAction'#18'actTypeALiasCreate'#7'Caption'#6#17 - +'Create Type ALias'#18'DisableIfNoHandler'#9#9'OnExecute'#7#25'actTypeALiasC' - +'reateExecute'#0#0#7'TAction'#15'actRecordCreate'#7'Caption'#6#13'Create Rec' - +'ord'#18'DisableIfNoHandler'#9#9'OnExecute'#7#22'actRecordCreateExecute'#0#0 - +#0#11'TOpenDialog'#2'OD'#5'Title'#6#26'Ouvrir un fichier existant'#6'Filter' - +#6'3WDSL files(*.WSDL)|*.WSDL|Pascal file (*.pas)|*.pas'#11'FilterIndex'#2#0 - +#10'InitialDir'#6#2'.\'#7'Options'#11#15'ofPathMustExist'#15'ofFileMustExist' - +#14'ofEnableSizing'#12'ofViewDetail'#0#4'left'#3#153#1#3'top'#2'X'#0#0#10'TS' - +'ynPasSyn'#10'SynPasSyn1'#7'Enabled'#8#23'CommentAttri.Foreground'#7#6'clBlu' - +'e'#18'CommentAttri.Style'#11#6'fsBold'#0#22'StringAttri.Foreground'#7#8'clM' - +'aroon'#17'SymbolAttri.Style'#11#6'fsBold'#0#25'DirectiveAttri.Foreground'#7 - +#7'clGreen'#20'DirectiveAttri.Style'#11#6'fsBold'#0#14'NestedComments'#9#4'l' - +'eft'#3#183#1#3'top'#2'h'#0#0#11'TSaveDialog'#2'SD'#5'Title'#6#27'Enregistre' - +'r le fichier sous'#10'DefaultExt'#6#5'.WSDL'#6'Filter'#6#25'WDSL files(*.WS' - +'DL)|*.WSDL'#11'FilterIndex'#2#0#7'Options'#11#15'ofPathMustExist'#14'ofEnab' - +'leSizing'#12'ofViewDetail'#0#4'left'#3#242#1#3'top'#3#176#0#0#0#10'TPopupMe' - +'nu'#10'PopupMenu1'#4'left'#3#152#0#3'top'#3#152#0#0#9'TMenuItem'#10'MenuIte' - +'m28'#6'Action'#7#13'actFullExpand'#7'OnClick'#7#20'actFullExpandExecute'#0#0 - +#9'TMenuItem'#10'MenuItem27'#6'Action'#7#15'actFullCollapse'#7'OnClick'#7#22 - +'actFullCollapseExecute'#0#0#9'TMenuItem'#10'MenuItem39'#6'Action'#7#14'actR' - +'efreshView'#7'OnClick'#7#21'actRefreshViewExecute'#0#0#9'TMenuItem'#10'Menu' - +'Item26'#7'Caption'#6#1'-'#0#0#9'TMenuItem'#9'MenuItem8'#6'Action'#7#13'actE' - +'numCreate'#7'OnClick'#7#20'actEnumCreateExecute'#0#0#9'TMenuItem'#10'MenuIt' - +'em21'#6'Action'#7#17'actCompoundCreate'#7'OnClick'#7#24'actCompoundCreateEx' - +'ecute'#0#0#9'TMenuItem'#10'MenuItem46'#6'Action'#7#15'actRecordCreate'#7'On' - +'Click'#7#22'actRecordCreateExecute'#0#0#9'TMenuItem'#10'MenuItem24'#6'Actio' - +'n'#7#13'actIntfCreate'#7'OnClick'#7#20'actIntfCreateExecute'#0#0#9'TMenuIte' - +'m'#10'MenuItem37'#6'Action'#7#14'actArrayCreate'#7'OnClick'#7#21'actArrayCr' - +'eateExecute'#0#0#9'TMenuItem'#10'MenuItem38'#6'Action'#7#18'actTypeALiasCre' - +'ate'#7'OnClick'#7#25'actTypeALiasCreateExecute'#0#0#9'TMenuItem'#10'MenuIte' - +'m22'#7'Caption'#6#1'-'#0#0#9'TMenuItem'#9'MenuItem9'#6'Action'#7#15'actUpda' - +'teObject'#7'OnClick'#7#22'actUpdateObjectExecute'#0#0#9'TMenuItem'#10'MenuI' - +'tem33'#6'Action'#7#9'actDelete'#7'OnClick'#7#16'actDeleteExecute'#0#0#0#10 - +'TPopupMenu'#10'PopupMenu2'#4'left'#3#16#2#3'top'#3#235#0#0#9'TMenuItem'#10 - +'MenuItem18'#6'Action'#7#14'actRefreshView'#7'OnClick'#7#21'actRefreshViewEx' - +'ecute'#0#0#9'TMenuItem'#10'MenuItem19'#7'Caption'#6#1'-'#0#0#9'TMenuItem'#10 - +'MenuItem20'#6'Action'#7#9'actExport'#7'OnClick'#7#16'actExportExecute'#0#0#9 - +'TMenuItem'#10'MenuItem40'#7'Caption'#6#1'-'#0#0#9'TMenuItem'#10'MenuItem41' - +#6'Action'#7#14'actArrayCreate'#7'OnClick'#7#21'actArrayCreateExecute'#0#0#9 - +'TMenuItem'#10'MenuItem45'#6'Action'#7#17'actCompoundCreate'#7'OnClick'#7#24 - +'actCompoundCreateExecute'#0#0#9'TMenuItem'#10'MenuItem47'#6'Action'#7#15'ac' - +'tRecordCreate'#7'OnClick'#7#22'actRecordCreateExecute'#0#0#9'TMenuItem'#10 - +'MenuItem44'#6'Action'#7#13'actEnumCreate'#7'OnClick'#7#20'actEnumCreateExec' - +'ute'#0#0#9'TMenuItem'#10'MenuItem43'#6'Action'#7#13'actIntfCreate'#7'OnClic' - +'k'#7#20'actIntfCreateExecute'#0#0#9'TMenuItem'#10'MenuItem42'#6'Action'#7#18 - +'actTypeALiasCreate'#7'OnClick'#7#25'actTypeALiasCreateExecute'#0#0#0#10'TSy' - +'nXMLSyn'#10'SynXMLSyn1'#13'DefaultFilter'#6#30'Documents WSDL (*.wsdl)|*.ws' - +'dl'#7'Enabled'#8#23'ElementAttri.Foreground'#7#6'clNavy'#30'AttributeValueA' - +'ttri.Foreground'#7#8'clPurple'#16'WantBracesParsed'#8#4'left'#3#210#1#3'top' - +#3#252#0#0#0#0 + +'edColor.OnChange'#13#0#0#0#9'TTabSheet'#7'tsProxy'#7'Caption'#6#6'&Proxy'#12 + +'ClientHeight'#3'='#2#11'ClientWidth'#3#245#1#0#8'TSynEdit'#8'srcProxy'#6'He' + +'ight'#3'='#2#5'Width'#3#245#1#5'Align'#7#8'alClient'#12'Font.CharSet'#7#12 + +'ANSI_CHARSET'#10'Font.Color'#7#7'clBlack'#11'Font.Height'#2#236#9'Font.Name' + +#6#7'Courier'#10'Font.Pitch'#7#7'fpFixed'#11'ParentColor'#8#9'PopupMenu'#7#10 + +'PopupMenu2'#8'TabOrder'#2#0#23'BookMarkOptions.Xoffset'#2'Q'#17'Gutter.Digi' + +'tCount'#2#5#22'Gutter.ShowLineNumbers'#9#22'Gutter.ShowCodeFolding'#9#23'Gu' + +'tter.CodeFoldingWidth'#2#14#11'Highlighter'#7#10'SynPasSyn1'#10'Keystrokes' + +#14#1#7'Command'#2#3#8'ShortCut'#2'&'#0#1#7'Command'#2'g'#8'ShortCut'#3'& '#0 + +#1#7'Command'#3#211#0#8'ShortCut'#3'&@'#0#1#7'Command'#2#4#8'ShortCut'#2'('#0 + +#1#7'Command'#2'h'#8'ShortCut'#3'( '#0#1#7'Command'#3#212#0#8'ShortCut'#3'(@' + ,#0#1#7'Command'#2#1#8'ShortCut'#2'%'#0#1#7'Command'#2'e'#8'ShortCut'#3'% '#0 + +#1#7'Command'#2#5#8'ShortCut'#3'%@'#0#1#7'Command'#2'i'#8'ShortCut'#3'%`'#0#1 + +#7'Command'#2#2#8'ShortCut'#2''''#0#1#7'Command'#2'f'#8'ShortCut'#3''' '#0#1 + +#7'Command'#2#6#8'ShortCut'#3'''@'#0#1#7'Command'#2'j'#8'ShortCut'#3'''`'#0#1 + +#7'Command'#2#10#8'ShortCut'#2'"'#0#1#7'Command'#2'n'#8'ShortCut'#3'" '#0#1#7 + +'Command'#2#14#8'ShortCut'#3'"@'#0#1#7'Command'#2'r'#8'ShortCut'#3'"`'#0#1#7 + +'Command'#2#9#8'ShortCut'#2'!'#0#1#7'Command'#2'm'#8'ShortCut'#3'! '#0#1#7'C' + +'ommand'#2#13#8'ShortCut'#3'!@'#0#1#7'Command'#2'q'#8'ShortCut'#3'!`'#0#1#7 + +'Command'#2#7#8'ShortCut'#2'$'#0#1#7'Command'#2'k'#8'ShortCut'#3'$ '#0#1#7'C' + +'ommand'#2#15#8'ShortCut'#3'$@'#0#1#7'Command'#2's'#8'ShortCut'#3'$`'#0#1#7 + +'Command'#2#8#8'ShortCut'#2'#'#0#1#7'Command'#2'l'#8'ShortCut'#3'# '#0#1#7'C' + +'ommand'#2#16#8'ShortCut'#3'#@'#0#1#7'Command'#2't'#8'ShortCut'#3'#`'#0#1#7 + +'Command'#3#223#0#8'ShortCut'#2'-'#0#1#7'Command'#3#201#0#8'ShortCut'#3'-@'#0 + +#1#7'Command'#3'\'#2#8'ShortCut'#3'- '#0#1#7'Command'#3#246#1#8'ShortCut'#2 + +'.'#0#1#7'Command'#3'['#2#8'ShortCut'#3'. '#0#1#7'Command'#3#245#1#8'ShortCu' + +'t'#2#8#0#1#7'Command'#3#245#1#8'ShortCut'#3#8' '#0#1#7'Command'#3#248#1#8'S' + +'hortCut'#3#8'@'#0#1#7'Command'#3'Y'#2#8'ShortCut'#4#8#128#0#0#0#1#7'Command' + +#3'Z'#2#8'ShortCut'#4#8#160#0#0#0#1#7'Command'#3#253#1#8'ShortCut'#2#13#0#1#7 + +'Command'#3#199#0#8'ShortCut'#3'A@'#0#1#7'Command'#3#201#0#8'ShortCut'#3'C@' + +#0#1#7'Command'#3'b'#2#8'ShortCut'#3'I`'#0#1#7'Command'#3#253#1#8'ShortCut'#3 + +'M@'#0#1#7'Command'#3#254#1#8'ShortCut'#3'N@'#0#1#7'Command'#3#247#1#8'Short' + +'Cut'#3'T@'#0#1#7'Command'#3'c'#2#8'ShortCut'#3'U`'#0#1#7'Command'#3'\'#2#8 + +'ShortCut'#3'V@'#0#1#7'Command'#3'['#2#8'ShortCut'#3'X@'#0#1#7'Command'#3#251 + +#1#8'ShortCut'#3'Y@'#0#1#7'Command'#3#250#1#8'ShortCut'#3'Y`'#0#1#7'Command' + +#3'Y'#2#8'ShortCut'#3'Z@'#0#1#7'Command'#3'Z'#2#8'ShortCut'#3'Z`'#0#1#7'Comm' + +'and'#3'-'#1#8'ShortCut'#3'0@'#0#1#7'Command'#3'.'#1#8'ShortCut'#3'1@'#0#1#7 + +'Command'#3'/'#1#8'ShortCut'#3'2@'#0#1#7'Command'#3'0'#1#8'ShortCut'#3'3@'#0 + +#1#7'Command'#3'1'#1#8'ShortCut'#3'4@'#0#1#7'Command'#3'2'#1#8'ShortCut'#3'5' + +'@'#0#1#7'Command'#3'3'#1#8'ShortCut'#3'6@'#0#1#7'Command'#3'4'#1#8'ShortCut' + +#3'7@'#0#1#7'Command'#3'5'#1#8'ShortCut'#3'8@'#0#1#7'Command'#3'6'#1#8'Short' + +'Cut'#3'9@'#0#1#7'Command'#3'_'#1#8'ShortCut'#3'0`'#0#1#7'Command'#3'`'#1#8 + +'ShortCut'#3'1`'#0#1#7'Command'#3'a'#1#8'ShortCut'#3'2`'#0#1#7'Command'#3'b' + +#1#8'ShortCut'#3'3`'#0#1#7'Command'#3'c'#1#8'ShortCut'#3'4`'#0#1#7'Command'#3 + +'d'#1#8'ShortCut'#3'5`'#0#1#7'Command'#3'e'#1#8'ShortCut'#3'6`'#0#1#7'Comman' + +'d'#3'f'#1#8'ShortCut'#3'7`'#0#1#7'Command'#3'g'#1#8'ShortCut'#3'8`'#0#1#7'C' + +'ommand'#3'h'#1#8'ShortCut'#3'9`'#0#1#7'Command'#3#231#0#8'ShortCut'#3'N`'#0 + +#1#7'Command'#3#232#0#8'ShortCut'#3'C`'#0#1#7'Command'#3#233#0#8'ShortCut'#3 + +'L`'#0#1#7'Command'#3'd'#2#8'ShortCut'#2#9#0#1#7'Command'#3'e'#2#8'ShortCut' + +#3#9' '#0#1#7'Command'#3#250#0#8'ShortCut'#3'B`'#0#0#8'ReadOnly'#9#0#0#0#9'T' + +'TabSheet'#5'tsImp'#7'Caption'#6#24'Im&plementation Skeleton'#12'ClientHeigh' + +'t'#3'='#2#11'ClientWidth'#3#245#1#0#8'TSynEdit'#6'srcImp'#6'Height'#3'='#2#5 + +'Width'#3#245#1#5'Align'#7#8'alClient'#12'Font.CharSet'#7#12'ANSI_CHARSET'#10 + +'Font.Color'#7#7'clBlack'#11'Font.Height'#2#236#9'Font.Name'#6#7'Courier'#10 + +'Font.Pitch'#7#7'fpFixed'#11'ParentColor'#8#9'PopupMenu'#7#10'PopupMenu2'#8 + +'TabOrder'#2#0#23'BookMarkOptions.Xoffset'#2'Q'#17'Gutter.DigitCount'#2#5#22 + +'Gutter.ShowLineNumbers'#9#22'Gutter.ShowCodeFolding'#9#23'Gutter.CodeFoldin' + +'gWidth'#2#14#11'Highlighter'#7#10'SynPasSyn1'#10'Keystrokes'#14#1#7'Command' + +#2#3#8'ShortCut'#2'&'#0#1#7'Command'#2'g'#8'ShortCut'#3'& '#0#1#7'Command'#3 + +#211#0#8'ShortCut'#3'&@'#0#1#7'Command'#2#4#8'ShortCut'#2'('#0#1#7'Command'#2 + +'h'#8'ShortCut'#3'( '#0#1#7'Command'#3#212#0#8'ShortCut'#3'(@'#0#1#7'Command' + +#2#1#8'ShortCut'#2'%'#0#1#7'Command'#2'e'#8'ShortCut'#3'% '#0#1#7'Command'#2 + +#5#8'ShortCut'#3'%@'#0#1#7'Command'#2'i'#8'ShortCut'#3'%`'#0#1#7'Command'#2#2 + +#8'ShortCut'#2''''#0#1#7'Command'#2'f'#8'ShortCut'#3''' '#0#1#7'Command'#2#6 + +#8'ShortCut'#3'''@'#0#1#7'Command'#2'j'#8'ShortCut'#3'''`'#0#1#7'Command'#2 + +#10#8'ShortCut'#2'"'#0#1#7'Command'#2'n'#8'ShortCut'#3'" '#0#1#7'Command'#2 + +#14#8'ShortCut'#3'"@'#0#1#7'Command'#2'r'#8'ShortCut'#3'"`'#0#1#7'Command'#2 + +#9#8'ShortCut'#2'!'#0#1#7'Command'#2'm'#8'ShortCut'#3'! '#0#1#7'Command'#2#13 + +#8'ShortCut'#3'!@'#0#1#7'Command'#2'q'#8'ShortCut'#3'!`'#0#1#7'Command'#2#7#8 + +'ShortCut'#2'$'#0#1#7'Command'#2'k'#8'ShortCut'#3'$ '#0#1#7'Command'#2#15#8 + +'ShortCut'#3'$@'#0#1#7'Command'#2's'#8'ShortCut'#3'$`'#0#1#7'Command'#2#8#8 + +'ShortCut'#2'#'#0#1#7'Command'#2'l'#8'ShortCut'#3'# '#0#1#7'Command'#2#16#8 + +'ShortCut'#3'#@'#0#1#7'Command'#2't'#8'ShortCut'#3'#`'#0#1#7'Command'#3#223#0 + +#8'ShortCut'#2'-'#0#1#7'Command'#3#201#0#8'ShortCut'#3'-@'#0#1#7'Command'#3 + +'\'#2#8'ShortCut'#3'- '#0#1#7'Command'#3#246#1#8'ShortCut'#2'.'#0#1#7'Comman' + ,'d'#3'['#2#8'ShortCut'#3'. '#0#1#7'Command'#3#245#1#8'ShortCut'#2#8#0#1#7'Co' + +'mmand'#3#245#1#8'ShortCut'#3#8' '#0#1#7'Command'#3#248#1#8'ShortCut'#3#8'@' + +#0#1#7'Command'#3'Y'#2#8'ShortCut'#4#8#128#0#0#0#1#7'Command'#3'Z'#2#8'Short' + +'Cut'#4#8#160#0#0#0#1#7'Command'#3#253#1#8'ShortCut'#2#13#0#1#7'Command'#3 + +#199#0#8'ShortCut'#3'A@'#0#1#7'Command'#3#201#0#8'ShortCut'#3'C@'#0#1#7'Comm' + +'and'#3'b'#2#8'ShortCut'#3'I`'#0#1#7'Command'#3#253#1#8'ShortCut'#3'M@'#0#1#7 + +'Command'#3#254#1#8'ShortCut'#3'N@'#0#1#7'Command'#3#247#1#8'ShortCut'#3'T@' + +#0#1#7'Command'#3'c'#2#8'ShortCut'#3'U`'#0#1#7'Command'#3'\'#2#8'ShortCut'#3 + +'V@'#0#1#7'Command'#3'['#2#8'ShortCut'#3'X@'#0#1#7'Command'#3#251#1#8'ShortC' + +'ut'#3'Y@'#0#1#7'Command'#3#250#1#8'ShortCut'#3'Y`'#0#1#7'Command'#3'Y'#2#8 + +'ShortCut'#3'Z@'#0#1#7'Command'#3'Z'#2#8'ShortCut'#3'Z`'#0#1#7'Command'#3'-' + +#1#8'ShortCut'#3'0@'#0#1#7'Command'#3'.'#1#8'ShortCut'#3'1@'#0#1#7'Command'#3 + +'/'#1#8'ShortCut'#3'2@'#0#1#7'Command'#3'0'#1#8'ShortCut'#3'3@'#0#1#7'Comman' + +'d'#3'1'#1#8'ShortCut'#3'4@'#0#1#7'Command'#3'2'#1#8'ShortCut'#3'5@'#0#1#7'C' + +'ommand'#3'3'#1#8'ShortCut'#3'6@'#0#1#7'Command'#3'4'#1#8'ShortCut'#3'7@'#0#1 + +#7'Command'#3'5'#1#8'ShortCut'#3'8@'#0#1#7'Command'#3'6'#1#8'ShortCut'#3'9@' + +#0#1#7'Command'#3'_'#1#8'ShortCut'#3'0`'#0#1#7'Command'#3'`'#1#8'ShortCut'#3 + +'1`'#0#1#7'Command'#3'a'#1#8'ShortCut'#3'2`'#0#1#7'Command'#3'b'#1#8'ShortCu' + +'t'#3'3`'#0#1#7'Command'#3'c'#1#8'ShortCut'#3'4`'#0#1#7'Command'#3'd'#1#8'Sh' + +'ortCut'#3'5`'#0#1#7'Command'#3'e'#1#8'ShortCut'#3'6`'#0#1#7'Command'#3'f'#1 + +#8'ShortCut'#3'7`'#0#1#7'Command'#3'g'#1#8'ShortCut'#3'8`'#0#1#7'Command'#3 + +'h'#1#8'ShortCut'#3'9`'#0#1#7'Command'#3#231#0#8'ShortCut'#3'N`'#0#1#7'Comma' + +'nd'#3#232#0#8'ShortCut'#3'C`'#0#1#7'Command'#3#233#0#8'ShortCut'#3'L`'#0#1#7 + +'Command'#3'd'#2#8'ShortCut'#2#9#0#1#7'Command'#3'e'#2#8'ShortCut'#3#9' '#0#1 + +#7'Command'#3#250#0#8'ShortCut'#3'B`'#0#0#8'ReadOnly'#9#0#0#0#9'TTabSheet'#8 + +'tsBinder'#7'Caption'#6#7'&Binder'#12'ClientHeight'#3'='#2#11'ClientWidth'#3 + +#245#1#0#8'TSynEdit'#9'srcBinder'#6'Height'#3'='#2#5'Width'#3#245#1#5'Align' + +#7#8'alClient'#12'Font.CharSet'#7#12'ANSI_CHARSET'#10'Font.Color'#7#7'clBlac' + +'k'#11'Font.Height'#2#236#9'Font.Name'#6#7'Courier'#10'Font.Pitch'#7#7'fpFix' + +'ed'#11'ParentColor'#8#9'PopupMenu'#7#10'PopupMenu2'#8'TabOrder'#2#0#23'Book' + +'MarkOptions.Xoffset'#2'Q'#15'Gutter.AutoSize'#9#17'Gutter.DigitCount'#2#5#22 + +'Gutter.ShowLineNumbers'#9#22'Gutter.ShowCodeFolding'#9#23'Gutter.CodeFoldin' + +'gWidth'#2#14#11'Highlighter'#7#10'SynPasSyn1'#10'Keystrokes'#14#1#7'Command' + +#2#3#8'ShortCut'#2'&'#0#1#7'Command'#2'g'#8'ShortCut'#3'& '#0#1#7'Command'#3 + +#211#0#8'ShortCut'#3'&@'#0#1#7'Command'#2#4#8'ShortCut'#2'('#0#1#7'Command'#2 + +'h'#8'ShortCut'#3'( '#0#1#7'Command'#3#212#0#8'ShortCut'#3'(@'#0#1#7'Command' + +#2#1#8'ShortCut'#2'%'#0#1#7'Command'#2'e'#8'ShortCut'#3'% '#0#1#7'Command'#2 + +#5#8'ShortCut'#3'%@'#0#1#7'Command'#2'i'#8'ShortCut'#3'%`'#0#1#7'Command'#2#2 + +#8'ShortCut'#2''''#0#1#7'Command'#2'f'#8'ShortCut'#3''' '#0#1#7'Command'#2#6 + +#8'ShortCut'#3'''@'#0#1#7'Command'#2'j'#8'ShortCut'#3'''`'#0#1#7'Command'#2 + +#10#8'ShortCut'#2'"'#0#1#7'Command'#2'n'#8'ShortCut'#3'" '#0#1#7'Command'#2 + +#14#8'ShortCut'#3'"@'#0#1#7'Command'#2'r'#8'ShortCut'#3'"`'#0#1#7'Command'#2 + +#9#8'ShortCut'#2'!'#0#1#7'Command'#2'm'#8'ShortCut'#3'! '#0#1#7'Command'#2#13 + +#8'ShortCut'#3'!@'#0#1#7'Command'#2'q'#8'ShortCut'#3'!`'#0#1#7'Command'#2#7#8 + +'ShortCut'#2'$'#0#1#7'Command'#2'k'#8'ShortCut'#3'$ '#0#1#7'Command'#2#15#8 + +'ShortCut'#3'$@'#0#1#7'Command'#2's'#8'ShortCut'#3'$`'#0#1#7'Command'#2#8#8 + +'ShortCut'#2'#'#0#1#7'Command'#2'l'#8'ShortCut'#3'# '#0#1#7'Command'#2#16#8 + +'ShortCut'#3'#@'#0#1#7'Command'#2't'#8'ShortCut'#3'#`'#0#1#7'Command'#3#223#0 + +#8'ShortCut'#2'-'#0#1#7'Command'#3#201#0#8'ShortCut'#3'-@'#0#1#7'Command'#3 + +'\'#2#8'ShortCut'#3'- '#0#1#7'Command'#3#246#1#8'ShortCut'#2'.'#0#1#7'Comman' + +'d'#3'['#2#8'ShortCut'#3'. '#0#1#7'Command'#3#245#1#8'ShortCut'#2#8#0#1#7'Co' + +'mmand'#3#245#1#8'ShortCut'#3#8' '#0#1#7'Command'#3#248#1#8'ShortCut'#3#8'@' + +#0#1#7'Command'#3'Y'#2#8'ShortCut'#4#8#128#0#0#0#1#7'Command'#3'Z'#2#8'Short' + +'Cut'#4#8#160#0#0#0#1#7'Command'#3#253#1#8'ShortCut'#2#13#0#1#7'Command'#3 + +#199#0#8'ShortCut'#3'A@'#0#1#7'Command'#3#201#0#8'ShortCut'#3'C@'#0#1#7'Comm' + +'and'#3'b'#2#8'ShortCut'#3'I`'#0#1#7'Command'#3#253#1#8'ShortCut'#3'M@'#0#1#7 + +'Command'#3#254#1#8'ShortCut'#3'N@'#0#1#7'Command'#3#247#1#8'ShortCut'#3'T@' + +#0#1#7'Command'#3'c'#2#8'ShortCut'#3'U`'#0#1#7'Command'#3'\'#2#8'ShortCut'#3 + +'V@'#0#1#7'Command'#3'['#2#8'ShortCut'#3'X@'#0#1#7'Command'#3#251#1#8'ShortC' + +'ut'#3'Y@'#0#1#7'Command'#3#250#1#8'ShortCut'#3'Y`'#0#1#7'Command'#3'Y'#2#8 + +'ShortCut'#3'Z@'#0#1#7'Command'#3'Z'#2#8'ShortCut'#3'Z`'#0#1#7'Command'#3'-' + +#1#8'ShortCut'#3'0@'#0#1#7'Command'#3'.'#1#8'ShortCut'#3'1@'#0#1#7'Command'#3 + +'/'#1#8'ShortCut'#3'2@'#0#1#7'Command'#3'0'#1#8'ShortCut'#3'3@'#0#1#7'Comman' + +'d'#3'1'#1#8'ShortCut'#3'4@'#0#1#7'Command'#3'2'#1#8'ShortCut'#3'5@'#0#1#7'C' + ,'ommand'#3'3'#1#8'ShortCut'#3'6@'#0#1#7'Command'#3'4'#1#8'ShortCut'#3'7@'#0#1 + +#7'Command'#3'5'#1#8'ShortCut'#3'8@'#0#1#7'Command'#3'6'#1#8'ShortCut'#3'9@' + +#0#1#7'Command'#3'_'#1#8'ShortCut'#3'0`'#0#1#7'Command'#3'`'#1#8'ShortCut'#3 + +'1`'#0#1#7'Command'#3'a'#1#8'ShortCut'#3'2`'#0#1#7'Command'#3'b'#1#8'ShortCu' + +'t'#3'3`'#0#1#7'Command'#3'c'#1#8'ShortCut'#3'4`'#0#1#7'Command'#3'd'#1#8'Sh' + +'ortCut'#3'5`'#0#1#7'Command'#3'e'#1#8'ShortCut'#3'6`'#0#1#7'Command'#3'f'#1 + +#8'ShortCut'#3'7`'#0#1#7'Command'#3'g'#1#8'ShortCut'#3'8`'#0#1#7'Command'#3 + +'h'#1#8'ShortCut'#3'9`'#0#1#7'Command'#3#231#0#8'ShortCut'#3'N`'#0#1#7'Comma' + +'nd'#3#232#0#8'ShortCut'#3'C`'#0#1#7'Command'#3#233#0#8'ShortCut'#3'L`'#0#1#7 + +'Command'#3'd'#2#8'ShortCut'#2#9#0#1#7'Command'#3'e'#2#8'ShortCut'#3#9' '#0#1 + +#7'Command'#3#250#0#8'ShortCut'#3'B`'#0#0#8'ReadOnly'#9#0#0#0#9'TTabSheet'#5 + +'tsLog'#7'Caption'#6#4'&Log'#12'ClientHeight'#3'='#2#11'ClientWidth'#3#245#1 + +#0#5'TMemo'#6'mmoLog'#6'Height'#3'='#2#5'Width'#3#245#1#5'Align'#7#8'alClien' + +'t'#13'Lines.Strings'#1#6#0#0#10'ScrollBars'#7#6'ssBoth'#8'TabOrder'#2#0#0#0 + +#0#0#0#9'TSplitter'#9'Splitter1'#4'Left'#3':'#1#6'Height'#3'Y'#2#5'Width'#2#8 + +#5'Color'#7#7'clBlack'#11'ParentColor'#8#0#0#9'TMainMenu'#9'MainMenu1'#4'lef' + +'t'#3'`'#1#3'top'#2'p'#0#9'TMenuItem'#9'MenuItem1'#7'Caption'#6#6'&Files'#0#9 + +'TMenuItem'#10'MenuItem16'#6'Action'#7#10'actNewFile'#7'OnClick'#7#17'actNew' + +'FileExecute'#0#0#9'TMenuItem'#9'MenuItem2'#7'Caption'#6#1'-'#0#0#9'TMenuIte' + +'m'#9'MenuItem5'#6'Action'#7#11'actOpenFile'#7'OnClick'#7#18'actOpenFileExec' + +'ute'#0#0#9'TMenuItem'#9'MenuItem3'#6'Action'#7#9'actExport'#7'OnClick'#7#16 + +'actExportExecute'#0#0#9'TMenuItem'#9'MenuItem7'#6'Action'#7#7'actSave'#7'On' + +'Click'#7#14'actSaveExecute'#0#0#9'TMenuItem'#10'MenuItem32'#6'Action'#7#9'a' + +'ctSaveAs'#7'OnClick'#7#16'actSaveAsExecute'#0#0#9'TMenuItem'#10'MenuItem17' + +#7'Caption'#6#1'-'#0#0#9'TMenuItem'#9'MenuItem4'#6'Action'#7#7'actExit'#7'On' + +'Click'#7#14'actExitExecute'#0#0#0#9'TMenuItem'#10'MenuItem14'#7'Caption'#6#5 + +'&View'#0#9'TMenuItem'#10'MenuItem15'#6'Action'#7#14'actRefreshView'#7'OnCli' + +'ck'#7#21'actRefreshViewExecute'#0#0#9'TMenuItem'#10'MenuItem29'#7'Caption'#6 + +#1'-'#0#0#9'TMenuItem'#10'MenuItem30'#6'Action'#7#13'actFullExpand'#7'OnClic' + +'k'#7#20'actFullExpandExecute'#0#0#9'TMenuItem'#10'MenuItem31'#6'Action'#7#15 + +'actFullCollapse'#7'OnClick'#7#22'actFullCollapseExecute'#0#0#0#9'TMenuItem' + +#10'MenuItem10'#7'Caption'#6#8'&Edition'#0#9'TMenuItem'#10'MenuItem11'#6'Act' + +'ion'#7#13'actEnumCreate'#7'OnClick'#7#20'actEnumCreateExecute'#0#0#9'TMenuI' + +'tem'#10'MenuItem23'#6'Action'#7#17'actCompoundCreate'#7'OnClick'#7#24'actCo' + +'mpoundCreateExecute'#0#0#9'TMenuItem'#10'MenuItem48'#6'Action'#7#15'actReco' + +'rdCreate'#7'OnClick'#7#22'actRecordCreateExecute'#0#0#9'TMenuItem'#10'MenuI' + +'tem25'#6'Action'#7#13'actIntfCreate'#7'OnClick'#7#20'actIntfCreateExecute'#0 + +#0#9'TMenuItem'#10'MenuItem35'#6'Action'#7#14'actArrayCreate'#7'OnClick'#7#21 + +'actArrayCreateExecute'#0#0#9'TMenuItem'#10'MenuItem36'#6'Action'#7#18'actTy' + +'peALiasCreate'#7'OnClick'#7#25'actTypeALiasCreateExecute'#0#0#9'TMenuItem' + +#10'MenuItem12'#7'Caption'#6#1'-'#0#0#9'TMenuItem'#10'MenuItem13'#6'Action'#7 + +#15'actUpdateObject'#7'Caption'#6#13'Update Object'#7'OnClick'#7#22'actUpdat' + +'eObjectExecute'#0#0#9'TMenuItem'#10'MenuItem34'#6'Action'#7#9'actDelete'#7 + +'OnClick'#7#16'actDeleteExecute'#0#0#0#9'TMenuItem'#9'MenuItem6'#6'Action'#7 + +#8'actAbout'#7'Caption'#6#6'&About'#7'OnClick'#7#15'actAboutExecute'#0#0#0#11 + +'TActionList'#2'AL'#4'left'#3'X'#1#3'top'#2'8'#0#7'TAction'#11'actOpenFile'#7 + +'Caption'#6#9'Open File'#18'DisableIfNoHandler'#9#9'OnExecute'#7#18'actOpenF' + +'ileExecute'#0#0#7'TAction'#7'actExit'#7'Caption'#6#4'Exit'#18'DisableIfNoHa' + +'ndler'#9#9'OnExecute'#7#14'actExitExecute'#0#0#7'TAction'#9'actExport'#7'Ca' + +'ption'#6#24'Save generated files ...'#18'DisableIfNoHandler'#9#9'OnExecute' + +#7#16'actExportExecute'#8'OnUpdate'#7#15'actExportUpdate'#0#0#7'TAction'#8'a' + +'ctAbout'#7'Caption'#6#5'About'#18'DisableIfNoHandler'#9#9'OnExecute'#7#15'a' + +'ctAboutExecute'#0#0#7'TAction'#9'actSaveAs'#7'Caption'#6#11'Save As ...'#18 + +'DisableIfNoHandler'#9#9'OnExecute'#7#16'actSaveAsExecute'#8'OnUpdate'#7#15 + +'actExportUpdate'#0#0#7'TAction'#13'actEnumCreate'#7'Caption'#6#18'Create En' + +'umeration'#18'DisableIfNoHandler'#9#9'OnExecute'#7#20'actEnumCreateExecute' + +#0#0#7'TAction'#15'actUpdateObject'#7'Caption'#6#6'Update'#18'DisableIfNoHan' + +'dler'#9#9'OnExecute'#7#22'actUpdateObjectExecute'#8'OnUpdate'#7#21'actUpdat' + +'eObjectUpdate'#0#0#7'TAction'#14'actRefreshView'#7'Caption'#6#14'&Refresh V' + +'iews'#18'DisableIfNoHandler'#9#9'OnExecute'#7#21'actRefreshViewExecute'#0#0 + +#7'TAction'#10'actNewFile'#7'Caption'#6#8'New File'#18'DisableIfNoHandler'#9 + +#9'OnExecute'#7#17'actNewFileExecute'#0#0#7'TAction'#17'actCompoundCreate'#7 + +'Caption'#6#17'Create Class Type'#18'DisableIfNoHandler'#9#9'OnExecute'#7#24 + +'actCompoundCreateExecute'#0#0#7'TAction'#13'actIntfCreate'#7'Caption'#6#16 + ,'Create Interface'#18'DisableIfNoHandler'#9#9'OnExecute'#7#20'actIntfCreateE' + +'xecute'#0#0#7'TAction'#13'actFullExpand'#7'Caption'#6#11'Full expand'#18'Di' + +'sableIfNoHandler'#9#9'OnExecute'#7#20'actFullExpandExecute'#0#0#7'TAction' + +#15'actFullCollapse'#7'Caption'#6#13'Full Collapse'#18'DisableIfNoHandler'#9 + +#9'OnExecute'#7#22'actFullCollapseExecute'#0#0#7'TAction'#7'actSave'#7'Capti' + +'on'#6#4'Save'#18'DisableIfNoHandler'#9#9'OnExecute'#7#14'actSaveExecute'#0#0 + +#7'TAction'#9'actDelete'#7'Caption'#6#6'Delete'#18'DisableIfNoHandler'#9#9'O' + +'nExecute'#7#16'actDeleteExecute'#8'OnUpdate'#7#21'actUpdateObjectUpdate'#0#0 + +#7'TAction'#14'actArrayCreate'#7'Caption'#6#12'Create Array'#18'DisableIfNoH' + +'andler'#9#9'OnExecute'#7#21'actArrayCreateExecute'#0#0#7'TAction'#18'actTyp' + +'eALiasCreate'#7'Caption'#6#17'Create Type ALias'#18'DisableIfNoHandler'#9#9 + +'OnExecute'#7#25'actTypeALiasCreateExecute'#0#0#7'TAction'#15'actRecordCreat' + +'e'#7'Caption'#6#13'Create Record'#18'DisableIfNoHandler'#9#9'OnExecute'#7#22 + +'actRecordCreateExecute'#0#0#0#11'TOpenDialog'#2'OD'#5'Title'#6#26'Ouvrir un' + +' fichier existant'#6'Filter'#6'3WDSL files(*.WSDL)|*.WSDL|Pascal file (*.pa' + +'s)|*.pas'#11'FilterIndex'#2#0#10'InitialDir'#6#2'.\'#7'Options'#11#15'ofPat' + +'hMustExist'#15'ofFileMustExist'#14'ofEnableSizing'#12'ofViewDetail'#0#4'lef' + +'t'#3#153#1#3'top'#2'X'#0#0#10'TSynPasSyn'#10'SynPasSyn1'#7'Enabled'#8#23'Co' + +'mmentAttri.Foreground'#7#6'clBlue'#18'CommentAttri.Style'#11#6'fsBold'#0#22 + +'StringAttri.Foreground'#7#8'clMaroon'#17'SymbolAttri.Style'#11#6'fsBold'#0 + +#25'DirectiveAttri.Foreground'#7#7'clGreen'#20'DirectiveAttri.Style'#11#6'fs' + +'Bold'#0#14'NestedComments'#9#4'left'#3#183#1#3'top'#2'h'#0#0#11'TSaveDialog' + +#2'SD'#5'Title'#6#27'Enregistrer le fichier sous'#10'DefaultExt'#6#5'.WSDL'#6 + +'Filter'#6#25'WDSL files(*.WSDL)|*.WSDL'#11'FilterIndex'#2#0#7'Options'#11#15 + +'ofPathMustExist'#14'ofEnableSizing'#12'ofViewDetail'#0#4'left'#3#242#1#3'to' + +'p'#3#176#0#0#0#10'TPopupMenu'#10'PopupMenu1'#4'left'#3#152#0#3'top'#3#152#0 + +#0#9'TMenuItem'#10'MenuItem28'#6'Action'#7#13'actFullExpand'#7'OnClick'#7#20 + +'actFullExpandExecute'#0#0#9'TMenuItem'#10'MenuItem27'#6'Action'#7#15'actFul' + +'lCollapse'#7'OnClick'#7#22'actFullCollapseExecute'#0#0#9'TMenuItem'#10'Menu' + +'Item39'#6'Action'#7#14'actRefreshView'#7'OnClick'#7#21'actRefreshViewExecut' + +'e'#0#0#9'TMenuItem'#10'MenuItem26'#7'Caption'#6#1'-'#0#0#9'TMenuItem'#9'Men' + +'uItem8'#6'Action'#7#13'actEnumCreate'#7'OnClick'#7#20'actEnumCreateExecute' + +#0#0#9'TMenuItem'#10'MenuItem21'#6'Action'#7#17'actCompoundCreate'#7'OnClick' + +#7#24'actCompoundCreateExecute'#0#0#9'TMenuItem'#10'MenuItem46'#6'Action'#7 + +#15'actRecordCreate'#7'OnClick'#7#22'actRecordCreateExecute'#0#0#9'TMenuItem' + +#10'MenuItem24'#6'Action'#7#13'actIntfCreate'#7'OnClick'#7#20'actIntfCreateE' + +'xecute'#0#0#9'TMenuItem'#10'MenuItem37'#6'Action'#7#14'actArrayCreate'#7'On' + +'Click'#7#21'actArrayCreateExecute'#0#0#9'TMenuItem'#10'MenuItem38'#6'Action' + +#7#18'actTypeALiasCreate'#7'OnClick'#7#25'actTypeALiasCreateExecute'#0#0#9'T' + +'MenuItem'#10'MenuItem22'#7'Caption'#6#1'-'#0#0#9'TMenuItem'#9'MenuItem9'#6 + +'Action'#7#15'actUpdateObject'#7'OnClick'#7#22'actUpdateObjectExecute'#0#0#9 + +'TMenuItem'#10'MenuItem33'#6'Action'#7#9'actDelete'#7'OnClick'#7#16'actDelet' + +'eExecute'#0#0#0#10'TPopupMenu'#10'PopupMenu2'#4'left'#3#16#2#3'top'#3#235#0 + +#0#9'TMenuItem'#10'MenuItem18'#6'Action'#7#14'actRefreshView'#7'OnClick'#7#21 + +'actRefreshViewExecute'#0#0#9'TMenuItem'#10'MenuItem19'#7'Caption'#6#1'-'#0#0 + +#9'TMenuItem'#10'MenuItem20'#6'Action'#7#9'actExport'#7'OnClick'#7#16'actExp' + +'ortExecute'#0#0#9'TMenuItem'#10'MenuItem40'#7'Caption'#6#1'-'#0#0#9'TMenuIt' + +'em'#10'MenuItem41'#6'Action'#7#14'actArrayCreate'#7'OnClick'#7#21'actArrayC' + +'reateExecute'#0#0#9'TMenuItem'#10'MenuItem45'#6'Action'#7#17'actCompoundCre' + +'ate'#7'OnClick'#7#24'actCompoundCreateExecute'#0#0#9'TMenuItem'#10'MenuItem' + +'47'#6'Action'#7#15'actRecordCreate'#7'OnClick'#7#22'actRecordCreateExecute' + +#0#0#9'TMenuItem'#10'MenuItem44'#6'Action'#7#13'actEnumCreate'#7'OnClick'#7 + +#20'actEnumCreateExecute'#0#0#9'TMenuItem'#10'MenuItem43'#6'Action'#7#13'act' + +'IntfCreate'#7'OnClick'#7#20'actIntfCreateExecute'#0#0#9'TMenuItem'#10'MenuI' + +'tem42'#6'Action'#7#18'actTypeALiasCreate'#7'OnClick'#7#25'actTypeALiasCreat' + +'eExecute'#0#0#0#10'TSynXMLSyn'#10'SynXMLSyn1'#13'DefaultFilter'#6#30'Docume' + +'nts WSDL (*.wsdl)|*.wsdl'#7'Enabled'#8#23'ElementAttri.Foreground'#7#6'clNa' + +'vy'#30'AttributeValueAttri.Foreground'#7#8'clPurple'#16'WantBracesParsed'#8 + +#4'left'#3#210#1#3'top'#3#252#0#0#0#0 ]); diff --git a/wst/trunk/type_lib_edtr/uwsttypelibraryedit.pas b/wst/trunk/type_lib_edtr/uwsttypelibraryedit.pas index 1af5302cf..8631c078d 100644 --- a/wst/trunk/type_lib_edtr/uwsttypelibraryedit.pas +++ b/wst/trunk/type_lib_edtr/uwsttypelibraryedit.pas @@ -169,7 +169,7 @@ var implementation uses view_helper, DOM, XMLRead, XMLWrite, //HeapTrc, xsd_parser, wsdl_parser, source_utils, command_line_parser, generator, metadata_generator, - binary_streamer, wst_resources_utils, wsdl_generator, + binary_streamer, wst_resources_utils, xsd_generator, wsdl_generator, uabout, edit_helper, udm, ufrmsaveoption, pparser {$IFDEF WST_IDE},LazIDEIntf,IDEMsgIntf{$ENDIF}; @@ -375,11 +375,13 @@ end; procedure GenerateWSDL_ToStream(ASymbol : TwstPasTreeContainer; ADest : TStream); var + g : IGenerator; doc : TXMLDocument; begin doc := TXMLDocument.Create(); try - GenerateWSDL(ASymbol,doc); + g := TWsdlGenerator.Create(doc); + g.Execute(ASymbol,ASymbol.CurrentModule.Name); WriteXML(doc,ADest); finally FreeAndNil(doc); diff --git a/wst/trunk/ws_helper/command_line_parser.pas b/wst/trunk/ws_helper/command_line_parser.pas index df6eda388..6fa1585bb 100644 --- a/wst/trunk/ws_helper/command_line_parser.pas +++ b/wst/trunk/ws_helper/command_line_parser.pas @@ -27,7 +27,7 @@ uses Type TComandLineOption = ( - cloInterface, cloProxy, cloImp, cloBinder, cloWsdl, + cloInterface, cloProxy, cloImp, cloBinder, cloWsdl, cloXsd, cloOutPutDirRelative, cloOutPutDirAbsolute ); TComandLineOptions = set of TComandLineOption; @@ -53,7 +53,7 @@ begin AAppOptions := []; c := #0; repeat - c := GetOpt('u:pibo:a:w'); + c := GetOpt('u:pibo:a:wx'); case c of 'u' : begin @@ -74,6 +74,7 @@ begin OptionsArgsMAP[cloOutPutDirAbsolute] := OptArg; End; 'w' : Include(AAppOptions,cloWsdl); + 'x' : Include(AAppOptions,cloXsd); end; until ( c = EndOfOptions ); Result := OptInd; diff --git a/wst/trunk/ws_helper/delphi/test_amazon.bat b/wst/trunk/ws_helper/delphi/test_amazon.bat index 4224d02b1..28723c68e 100644 --- a/wst/trunk/ws_helper/delphi/test_amazon.bat +++ b/wst/trunk/ws_helper/delphi/test_amazon.bat @@ -1 +1 @@ -ws_helper -uA -i -p -b -a"C:\Programmes\lazarus\wst\trunk\tests\files" "C:\Programmes\lazarus\utils\amazon\AWSECommerceService.wsdl" >test_amazon_res.txt \ No newline at end of file +ws_helper -uA -i -p -b -w -x -a"C:\Programmes\lazarus\wst\trunk\tests\files" "C:\Programmes\lazarus\utils\amazon\AWSECommerceService.wsdl" >test_amazon_res.txt \ No newline at end of file diff --git a/wst/trunk/ws_helper/delphi/ws_helper.dof b/wst/trunk/ws_helper/delphi/ws_helper.dof index 2b1d9c816..b5488a7c1 100644 --- a/wst/trunk/ws_helper/delphi/ws_helper.dof +++ b/wst/trunk/ws_helper/delphi/ws_helper.dof @@ -100,7 +100,7 @@ Conditionals= DebugSourceDirs=C:\Programmes\lazarus\wst\trunk\fcl-units\rtl\;C:\Programmes\lazarus\wst\trunk\;C:\Programmes\lazarus\wst\trunk\fcl-units\fcl-passrc\src\ UsePackages=0 [Parameters] -RunParams=-uA -i -p -b -a"C:\Programmes\lazarus\wst\trunk\tests\files" "C:\Programmes\lazarus\wst\trunk\type_lib_edtr\files\company.xsd" +RunParams=-uA -i -p -b -x -a"C:\Programmes\lazarus\wst\trunk\tests\files" "C:\Programmes\lazarus\utils\amazon\AWSECommerceService.wsdl" HostApplication= Launcher= UseLauncher=0 diff --git a/wst/trunk/ws_helper/delphi/ws_helper.dpr b/wst/trunk/ws_helper/delphi/ws_helper.dpr index 8bee48eb8..1f4bdbfe5 100644 --- a/wst/trunk/ws_helper/delphi/ws_helper.dpr +++ b/wst/trunk/ws_helper/delphi/ws_helper.dpr @@ -41,7 +41,8 @@ uses logger_intf, xsd_parser, ws_parser_imp, - wsdl_parser; + wsdl_parser, + xsd_generator; {$INCLUDE ws_helper_prog.inc} diff --git a/wst/trunk/ws_helper/parserutils.pas b/wst/trunk/ws_helper/parserutils.pas index b90d01123..69d78e019 100644 --- a/wst/trunk/ws_helper/parserutils.pas +++ b/wst/trunk/ws_helper/parserutils.pas @@ -24,71 +24,9 @@ interface uses SysUtils, Classes {$IFNDEF FPC}, xmldom, wst_delphi_xml{$ELSE},DOM{$ENDIF} - , cursor_intf, dom_cursors + , cursor_intf, dom_cursors, xsd_consts ; -const - s_address : WideString = 'address'; - s_all : WideString = 'all'; - //s_any : WideString = 'any'; - s_annotation : WideString = 'annotation'; - s_appinfo : WideString = 'appinfo'; - s_array : WideString = 'array'; - s_arrayType : WideString = 'arrayType'; - s_attribute : WideString = 'attribute'; - s_base : WideString = 'base'; - s_binding : WideString = 'binding'; - s_body : WideString = 'body'; - s_complexContent : WideString = 'complexContent'; - s_complexType : WideString = 'complexType'; - s_customAttributes : WideString = 'customAttributes'; - s_document : WideString = 'document'; - s_element : WideString = 'element'; - s_enumeration : WideString = 'enumeration'; - s_extension : WideString = 'extension'; - s_guid : WideString = 'GUID'; - s_headerBlock : WideString = 'headerBlock'; - s_input : WideString = 'input'; - s_item : WideString = 'item'; - s_location : WideString = 'location'; - s_message : WideString = 'message'; - s_maxOccurs : WideString = 'maxOccurs'; - s_minOccurs : WideString = 'minOccurs'; - s_name : WideString = 'name'; - s_operation : WideString = 'operation'; - s_optional : WideString = 'optional'; - s_output : WideString = 'output'; - s_part : WideString = 'part'; - s_port : WideString = 'port'; - s_portType : WideString = 'portType'; - s_prohibited : WideString = 'prohibited'; - s_record : WideString = 'record'; - s_ref : WideString = 'ref'; - s_required : WideString = 'required'; - s_restriction : WideString = 'restriction'; - //s_return : WideString = 'return'; - s_rpc : WideString = 'rpc'; - s_schema : WideString = 'schema'; - s_xs : WideString = 'http://www.w3.org/2001/XMLSchema'; - s_sequence : WideString = 'sequence'; - s_service : WideString = 'service'; - s_simpleContent : WideString = 'simpleContent'; - s_simpleType : WideString = 'simpleType'; - s_soap : WideString = 'http://schemas.xmlsoap.org/wsdl/soap/'; - s_soapAction : WideString = 'soapAction'; - s_soapInputEncoding : WideString = 'Input_EncodingStyle'; - s_soapOutputEncoding : WideString = 'OutputEncodingStyle'; - s_soapStyle : WideString = 'style'; - s_style : WideString = 'style'; - s_targetNamespace : WideString = 'targetNamespace'; - s_type : WideString = 'type'; - s_types : WideString = 'types'; - s_unbounded : WideString = 'unbounded'; - s_use : WideString = 'use'; - s_value : WideString = 'value'; - s_wsdl : WideString = 'http://schemas.xmlsoap.org/wsdl/'; - s_xmlns : WideString = 'xmlns'; - type TNotFoundAction = ( nfaNone, nfaRaiseException ); @@ -341,32 +279,13 @@ function wst_findCustomAttributeXsd( ) : Boolean; var nd : TDOMNode; - tmpCrs : IObjectCursor; begin Result := False; - tmpCrs := CreateCursorOn( - CreateChildrenCursor(ANode,cetRttiNode), - ParseFilter(CreateQualifiedNameFilterStr(s_annotation,AXsdShortNames),TDOMNodeRttiExposer) - ); - tmpCrs.Reset(); - if tmpCrs.MoveNext() then begin - nd := (tmpCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; - if nd.HasChildNodes() then begin - tmpCrs := CreateCursorOn( - CreateChildrenCursor(nd,cetRttiNode), - ParseFilter(Format('%s=%s',[s_NODE_NAME,QuotedStr(s_appinfo)]),TDOMNodeRttiExposer) - ); - tmpCrs.Reset(); - if tmpCrs.MoveNext() then begin - nd := (tmpCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; - if ( nd.Attributes <> nil ) then begin - nd := nd.Attributes.GetNamedItem(AAttribute); - if Assigned(nd) then begin - Result := True; - AValue := nd.NodeValue; - end; - end; - end; + if Assigned(ANode) and ( ANode.Attributes <> nil ) then begin + nd := ANode.Attributes.GetNamedItem(AAttribute); + if Assigned(nd) then begin + Result := True; + AValue := nd.NodeValue; end; end; end; diff --git a/wst/trunk/ws_helper/pascal_parser_intf.pas b/wst/trunk/ws_helper/pascal_parser_intf.pas index 6df826561..20877cebc 100644 --- a/wst/trunk/ws_helper/pascal_parser_intf.pas +++ b/wst/trunk/ws_helper/pascal_parser_intf.pas @@ -68,6 +68,7 @@ type FObjects : TObjectList; FProps : TObjectList; private + procedure FreeList(AObject : TObject); public constructor Create(); destructor Destroy();override; @@ -127,6 +128,7 @@ type property Binding[AIndex : Integer] : TwstBinding read GetBinding; property Properties : TPropertyHolder read FProperties; + procedure FreeProperties(AObject : TPasElement); procedure RegisterExternalAlias(AObject : TPasElement; const AExternalName : String); function SameName(AObject : TPasElement; const AName : string) : Boolean; function GetExternalName(AObject : TPasElement) : string; @@ -176,7 +178,7 @@ type function CreateWstInterfaceSymbolTable(AContainer : TwstPasTreeContainer) : TPasModule; implementation -uses parserutils; +uses parserutils, wst_types; const SIMPLE_TYPES_COUNT = 15; @@ -715,6 +717,40 @@ begin Result := nil; end; +procedure TwstPasTreeContainer.FreeProperties(AObject: TPasElement); + + procedure FreeClassProps(AObj : TPasClassType); + var + ls : TList; + k : PtrInt; + begin + ls := AObj.Members; + for k := 0 to Pred(ls.Count) do begin + FProperties.FreeList(TPasElement(ls[k])); + end; + end; + + procedure FreeRecordFields(AObj : TPasRecordType); + var + ls : TList; + k : PtrInt; + begin + ls := AObj.Members; + for k := 0 to Pred(ls.Count) do begin + FProperties.FreeList(TPasElement(ls[k])); + end; + end; + +begin + if Assigned(AObject) then begin + FProperties.FreeList(AObject); + if AObject.InheritsFrom(TPasClassType) then + FreeClassProps(AObject as TPasClassType) + else if AObject.InheritsFrom(TPasRecordType) then + FreeRecordFields(AObject as TPasRecordType); + end; +end; + procedure TwstPasTreeContainer.RegisterExternalAlias( AObject : TPasElement; const AExternalName : String @@ -813,6 +849,17 @@ begin end; end; +procedure TPropertyHolder.FreeList(AObject: TObject); +var + i : PtrInt; +begin + i := FObjects.IndexOf(AObject); + if ( i >= 0 ) then begin + FObjects.Delete(i); + FProps.Delete(i); + end; +end; + constructor TPropertyHolder.Create(); begin FObjects := TObjectList.Create(False); diff --git a/wst/trunk/ws_helper/ws_helper.lpi b/wst/trunk/ws_helper/ws_helper.lpi index fbc3b00f6..05fe525f7 100644 --- a/wst/trunk/ws_helper/ws_helper.lpi +++ b/wst/trunk/ws_helper/ws_helper.lpi @@ -12,7 +12,7 @@ - + @@ -24,7 +24,7 @@ - + @@ -33,13 +33,13 @@ - + - - + + @@ -50,7 +50,7 @@ - + @@ -60,7 +60,7 @@ - + @@ -84,9 +84,9 @@ - - - + + + @@ -96,35 +96,33 @@ - - - + - + - + - - + + @@ -133,9 +131,7 @@ - - @@ -166,44 +162,40 @@ - + - - - + - - - + - + - + - + @@ -214,83 +206,83 @@ - + - + - + - + - + - + - + - + - + - + - + - - - + + + @@ -299,131 +291,131 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -431,160 +423,158 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - - - + + + - + - + - + - + - + - + - + - - - + - - - - + + + + @@ -592,16 +582,16 @@ - + - - - - + + + + @@ -609,26 +599,26 @@ - + - - + + - + - - + + - + @@ -636,183 +626,80 @@ - + - + - - - + - - - + - - - + - - - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -852,11 +739,15 @@ - + + + + + diff --git a/wst/trunk/ws_helper/ws_helper.pas b/wst/trunk/ws_helper/ws_helper.pas index 504a2c6e2..2ac741dd6 100644 --- a/wst/trunk/ws_helper/ws_helper.pas +++ b/wst/trunk/ws_helper/ws_helper.pas @@ -27,7 +27,6 @@ uses SysUtils, wst_resources_utils, generator, - wsdl_generator, parserutils, source_utils, command_line_parser, @@ -43,7 +42,8 @@ uses logger_intf, xsd_parser, ws_parser_imp, - wsdl_parser; + wsdl_parser, + xsd_generator, wsdl_generator; {$INCLUDE ws_helper_prog.inc} diff --git a/wst/trunk/ws_helper/ws_helper_prog.inc b/wst/trunk/ws_helper/ws_helper_prog.inc index b3db37d3b..253ff4bdb 100644 --- a/wst/trunk/ws_helper/ws_helper_prog.inc +++ b/wst/trunk/ws_helper/ws_helper_prog.inc @@ -8,7 +8,8 @@ resourcestring ' -i Generate service minimal implementation' + sNEW_LINE + ' -o PATH Relative output directory' + sNEW_LINE + ' -a PATH Absolute output directory' + sNEW_LINE + - ' -w Generate WSDL file; Can be used to get wsdl from pascal' + sNEW_LINE; + ' -w Generate WSDL file; Can be used to get wsdl from pascal' + sNEW_LINE + + ' -x Generate XSD file; Can be used to get xsd from pascal' + sNEW_LINE; sCOPYRIGHT = 'ws_helper, Web Service Toolkit 0.5 Copyright (c) 2006, 2007 by Inoussa OUEDRAOGO'; const @@ -135,16 +136,33 @@ var procedure GenerateWSDLFromTree(ASymbol : TwstPasTreeContainer; ADest : TStream); var doc : TXMLDocument; + g : IGenerator; begin - doc := CreateDoc();// TXMLDocument.Create(); + doc := CreateDoc(); try - GenerateWSDL(ASymbol,doc); + g := TWsdlGenerator.Create(doc); + g.Execute(ASymbol,ASymbol.CurrentModule.Name); WriteXML(doc,ADest); finally ReleaseDomNode(doc); end; end; + procedure GenerateXsdFromTree(ASymbol : TwstPasTreeContainer; ADest : TStream); + var + doc : TXMLDocument; + gnrtr : IGenerator; + begin + doc := CreateDoc(); + try + gnrtr := TXsdGenerator.Create(doc); + gnrtr.Execute(ASymbol,ASymbol.CurrentModule.Name); + WriteXML(doc,ADest); + finally + ReleaseDomNode(doc); + end; + end; + function ProcessFile():Boolean; Var mtdaFS: TMemoryStream; @@ -209,6 +227,15 @@ var srcMngr.CreateItem(ChangeFileExt(ExtractFileName(inFileName),'.wsdl')).Write(strStream.DataString); end; end; + + if ( cloXsd in AppOptions ) then begin + strStream := TStringStream.Create(''); + GenerateXsdFromTree(symtable,strStream); + if not IsStrEmpty(strStream.DataString) then begin + strStream.Position := 0; + srcMngr.CreateItem(ChangeFileExt(ExtractFileName(inFileName),'.xsd')).Write(strStream.DataString); + end; + end; Result := True; except diff --git a/wst/trunk/ws_helper/ws_parser_imp.pas b/wst/trunk/ws_helper/ws_parser_imp.pas index 0071b2e68..6716aa709 100644 --- a/wst/trunk/ws_helper/ws_parser_imp.pas +++ b/wst/trunk/ws_helper/ws_parser_imp.pas @@ -119,7 +119,7 @@ type SResolveError = 'Unable to resolve this namespace : "%s".'; implementation -uses dom_cursors, parserutils, StrUtils, Contnrs; +uses dom_cursors, parserutils, StrUtils, Contnrs, xsd_consts; { TAbstractTypeParser } @@ -555,19 +555,40 @@ var TPasEmentCrack(locType).SetName(locType.Name + '_Type'); end;} - locMinOccur := 1; - locPartCursor := CreateCursorOn(locAttCursor.Clone() as IObjectCursor,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_minOccurs)]),TDOMNodeRttiExposer)); - locPartCursor.Reset(); - if locPartCursor.MoveNext() then begin - if not TryStrToInt((locPartCursor.GetCurrent() as TDOMNodeRttiExposer).NodeValue,locMinOccur) then - raise EXsdParserException.CreateFmt('Invalid "minOccurs" value : "%s.%s".',[FTypeName,locName]); - if ( locMinOccur < 0 ) then - raise EXsdParserException.CreateFmt('Invalid "minOccurs" value : "%s.%s".',[FTypeName,locName]); + if AnsiSameText(s_attribute,ExtractNameFromQName(AElement.NodeName)) then begin + locPartCursor := CreateCursorOn(locAttCursor.Clone() as IObjectCursor,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_use)]),TDOMNodeRttiExposer)); + locPartCursor.Reset(); + if locPartCursor.MoveNext() then begin + locStrBuffer := ExtractNameFromQName((locPartCursor.GetCurrent() as TDOMNodeRttiExposer).NodeValue); + if IsStrEmpty(locStrBuffer) then + raise EXsdInvalidDefinitionException.CreateFmt('Invalid <%s> definition : empty "use".',[s_attribute]); + case AnsiIndexText(locStrBuffer,[s_required,s_optional,s_prohibited]) of + 0 : locMinOccur := 1; + 1 : locMinOccur := 0; + 2 : locMinOccur := -1; + else + raise EXsdInvalidDefinitionException.CreateFmt('Invalid <%s> definition : invalid "use" value "%s".',[s_attribute,locStrBuffer]); + end; + end else begin + locMinOccur := 0; + end; + end else begin + locMinOccur := 1; + locPartCursor := CreateCursorOn(locAttCursor.Clone() as IObjectCursor,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_minOccurs)]),TDOMNodeRttiExposer)); + locPartCursor.Reset(); + if locPartCursor.MoveNext() then begin + if not TryStrToInt((locPartCursor.GetCurrent() as TDOMNodeRttiExposer).NodeValue,locMinOccur) then + raise EXsdParserException.CreateFmt('Invalid "minOccurs" value : "%s.%s".',[FTypeName,locName]); + if ( locMinOccur < 0 ) then + raise EXsdParserException.CreateFmt('Invalid "minOccurs" value : "%s.%s".',[FTypeName,locName]); + end; end; locProp.ReadAccessorName := 'F' + locProp.Name; locProp.WriteAccessorName := 'F' + locProp.Name; if ( locMinOccur = 0 ) then begin locProp.StoredAccessorName := 'Has' + locProp.Name; + end else if ( locMinOccur = -1 ) then begin + locProp.StoredAccessorName := 'False'; end else begin locProp.StoredAccessorName := 'True'; end; @@ -693,14 +714,14 @@ var var strBuffer : string; begin - Result := wst_findCustomAttributeXsd(FContext.GetXsShortNames(),FTypeNode,s_headerBlock,strBuffer) and AnsiSameText('true',Trim(strBuffer)); + Result := wst_findCustomAttributeXsd(FContext.GetXsShortNames(),FTypeNode,s_WST_headerBlock,strBuffer) and AnsiSameText('true',Trim(strBuffer)); end; function IsRecordType() : Boolean; var strBuffer : string; begin - Result := wst_findCustomAttributeXsd(FContext.GetXsShortNames(),FTypeNode,s_record,strBuffer) and AnsiSameText('true',Trim(strBuffer)); + Result := wst_findCustomAttributeXsd(FContext.GetXsShortNames(),FTypeNode,s_WST_record,strBuffer) and AnsiSameText('true',Trim(strBuffer)); end; procedure ParseElementsAndAttributes(AEltCrs, AEltAttCrs : IObjectCursor); @@ -729,10 +750,11 @@ var i : Integer; recordType : TPasRecordType; tmpRecVar : TPasVariable; + locStrBuffer : string; begin ExtractBaseType(); eltCrs := ExtractElementCursor(eltAttCrs); - + internalName := ExtractIdentifier(ATypeName); hasInternalName := IsReservedKeyWord(internalName) or ( not IsValidIdent(internalName) ) or @@ -771,6 +793,7 @@ begin Result := nil; propTyp := arrayItems[0] as TPasProperty; arrayDef := FSymbols.CreateArray(internalName,propTyp.VarType,propTyp.Name,FSymbols.GetExternalName(propTyp),asScoped); + FSymbols.FreeProperties(classDef); FreeAndNil(classDef); Result := arrayDef; if hasInternalName then @@ -808,11 +831,12 @@ begin end; end; end; + FSymbols.FreeProperties(tmpClassDef); FreeAndNil(tmpClassDef); end; end; end; - + //check for record if ( FDerivationMode = dmNone ) and Result.InheritsFrom(TPasClassType) and @@ -835,11 +859,20 @@ begin if FSymbols.IsAttributeProperty(propTyp) then begin FSymbols.SetPropertyAsAttribute(tmpRecVar,True); end; + if AnsiSameText(propTyp.StoredAccessorName,'False') then + locStrBuffer := s_prohibited + else if AnsiSameText(Copy(propTyp.StoredAccessorName,1,3),'Has') then + locStrBuffer := s_optional + else + locStrBuffer := s_required; + FSymbols.Properties.SetValue(tmpRecVar,s_WST_storeType,locStrBuffer); end; end; + FSymbols.FreeProperties(tmpClassDef); FreeAndNil(tmpClassDef); end; except + FSymbols.FreeProperties(Result); FreeAndNil(Result); raise; end; @@ -931,7 +964,7 @@ var if ( locStoreOptIdx < 0 ) then raise EXsdInvalidDefinitionException.CreateFmt('Invalid <%s> definition : invalid "use" value "%s".',[s_attribute,locStoreOpt]); end else begin - locStoreOptIdx := 0; + locStoreOptIdx := 1{optional by default!}; //0; end; locInternalEltName := locName; @@ -990,6 +1023,7 @@ begin end; end; except + FSymbols.FreeProperties(Result); FreeAndNil(Result); raise; end; @@ -1212,6 +1246,7 @@ begin ParseEnumItem((locEnumCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject); end; except + FSymbols.FreeProperties(Result); FreeAndNil(Result); raise; end; diff --git a/wst/trunk/ws_helper/wsdl_generator.pas b/wst/trunk/ws_helper/wsdl_generator.pas index 8d12dbcf0..61d8cd722 100644 --- a/wst/trunk/ws_helper/wsdl_generator.pas +++ b/wst/trunk/ws_helper/wsdl_generator.pas @@ -18,370 +18,175 @@ interface uses Classes, SysUtils, TypInfo, {$IFNDEF FPC}xmldom, wst_delphi_xml{$ELSE}DOM{$ENDIF}, - pastree, pascal_parser_intf; - + pastree, pascal_parser_intf, xsd_generator; + type - EWsdlGeneratorException = class(Exception) end; - TBaseTypeHandler = class; - TBaseTypeHandlerClass = class of TBaseTypeHandler; + EWsdlGeneratorException = class(EXsdGeneratorException) end; - IWsdlTypeHandler = interface - ['{541EA377-4F70-49B1-AFB4-FC62B24F567B}'] - procedure Generate( - AContainer : TwstPasTreeContainer; - const ASymbol : TPasElement; - AWsdlDocument : TDOMDocument + { TWsdlTypechemaGenerator } + + TWsdlTypechemaGenerator = class(TCustomXsdGenerator) + private + FSchemaNode : TDOMElement; + FTypesNode : TDOMElement; + protected + function GetSchemaNode(ADocument : TDOMDocument) : TDOMNode;override; + procedure Prepare(ASymTable : TwstPasTreeContainer; AModule : TPasModule);override; + end; + + { TWsdlGenerator } + + TWsdlGenerator = class(TInterfacedObject, IInterface, IGenerator) + private + FDocument : TDOMDocument; + FTypesNode : TDOMElement; + FDefinitionsNode : TDOMElement; + private + procedure GenerateTypes(ASymTable : TwstPasTreeContainer); + procedure GenerateServiceMessages( + ASymTable : TwstPasTreeContainer; + AModule : TPasModule; + AContract : TPasClassType; + ARootNode : TDOMElement + ); + procedure GenerateServicePortType( + ASymTable : TwstPasTreeContainer; + AModule : TPasModule; + AContract : TPasClassType; + ARootNode : TDOMElement + ); + procedure GenerateServiceBinding( + ASymTable : TwstPasTreeContainer; + AModule : TPasModule; + ABinding : TwstBinding; + ARootNode : TDOMElement + ); + procedure GenerateServicePublication( + ASymTable : TwstPasTreeContainer; + AModule : TPasModule; + ABinding : TwstBinding; + ARootNode : TDOMElement ); - end; - - IWsdlTypeHandlerRegistry = Interface - ['{C5666646-3426-4696-93EE-AFA8EE7CAE53}'] - function Find( - ASymbol : TPasElement; - out AHandler : IWsdlTypeHandler - ) : Boolean; - procedure Register(AFactory : TBaseTypeHandlerClass); - End; - - TBaseTypeHandler = class(TInterfacedObject,IWsdlTypeHandler) protected - procedure Generate( - AContainer : TwstPasTreeContainer; - const ASymbol : TPasElement; - AWsdlDocument : TDOMDocument - );virtual;abstract; - class function CanHandle(ASymbol : TObject) : Boolean;virtual;abstract; - end; - - { TTypeDefinition_TypeHandler } - - TTypeDefinition_TypeHandler = class(TBaseTypeHandler) - protected - procedure Generate( - AContainer : TwstPasTreeContainer; - const ASymbol : TPasElement; - AWsdlDocument : TDOMDocument - );override; - class function CanHandle(ASymbol : TObject) : Boolean;override; - end; - - { TTypeAliasDefinition_TypeHandler } - - TTypeAliasDefinition_TypeHandler = class(TBaseTypeHandler) - protected - procedure Generate( - AContainer : TwstPasTreeContainer; - const ASymbol : TPasElement; - AWsdlDocument : TDOMDocument - );override; - class function CanHandle(ASymbol : TObject) : Boolean;override; - end; - - { TEnumTypeHandler } - - TEnumTypeHandler = class(TTypeDefinition_TypeHandler) - protected - procedure Generate( - AContainer : TwstPasTreeContainer; - const ASymbol : TPasElement; - AWsdlDocument : TDOMDocument - );override; - class function CanHandle(ASymbol : TObject) : Boolean;override; - end; - - { TClassTypeDefinition_TypeHandler } - - TClassTypeDefinition_TypeHandler = class(TTypeDefinition_TypeHandler) - protected - procedure Generate( - AContainer : TwstPasTreeContainer; - const ASymbol : TPasElement; - AWsdlDocument : TDOMDocument - );override; - class function CanHandle(ASymbol : TObject) : Boolean;override; - end; - - { TPasRecordType_TypeHandler } - - TPasRecordType_TypeHandler = class(TTypeDefinition_TypeHandler) - protected - procedure Generate( - AContainer : TwstPasTreeContainer; - const ASymbol : TPasElement; - AWsdlDocument : TDOMDocument - );override; - class function CanHandle(ASymbol : TObject) : Boolean;override; - end; - - { TBaseArrayRemotable_TypeHandler } - - TBaseArrayRemotable_TypeHandler = class(TTypeDefinition_TypeHandler) - protected - procedure Generate( - AContainer : TwstPasTreeContainer; - const ASymbol : TPasElement; - AWsdlDocument : TDOMDocument - );override; - class function CanHandle(ASymbol : TObject) : Boolean;override; - end; - - procedure GenerateWSDL(ASymbolTable : TwstPasTreeContainer; ADoc : TDOMDocument); - - function GetWsdlTypeHandlerRegistry():IWsdlTypeHandlerRegistry; - -implementation -uses - {$IFDEF FPC}wst_fpc_xml,{$ENDIF} - Contnrs ; - -const - sWSDL_NS = 'http://schemas.xmlsoap.org/wsdl/'; - sSOAP_NS = 'http://schemas.xmlsoap.org/wsdl/soap/'; - sSOAP = 'soap'; - //sSOAP_ENC_NS = 'http://schemas.xmlsoap.org/soap/encoding/'; - sXMLNS = 'xmlns'; - sXSD_NS = 'http://www.w3.org/2001/XMLSchema'; - sXSD = 'xsd'; - sTNS = 'tns'; - - sSOAP_ACTION = 'soapAction'; - //sSOAP_ENCODED = 'encoded'; - //sSOAP_ENCODING_STYLE = 'encodingStyle'; - sSOAP_RPC = 'rpc'; - sSOAP_TRANSPORT = 'http://schemas.xmlsoap.org/soap/http'; - sSOAP_USE = 'use'; - - sADDRESS = 'address'; - sANNOTATION = 'annotation'; - sAPPINFO = 'appinfo'; - sATTRIBUTE = 'attribute'; - sBASE = 'base'; - sBINDING = 'binding'; - sBODY = 'body'; - sCOMPLEX_TYPE = 'complexType'; - sCUSTOM_ATTRIBUTE = 'customAttributes'; - sDOCUMENT = 'document'; - sELEMENT = 'element'; - sENUMERATION = 'enumeration'; - sEXTENSION = 'extension'; - sGUID = 'GUID'; - sHEADER_Block = 'headerBlock'; - sITEM = 'item'; - sLOCATION = 'location'; - sMIN_OCCURS = 'minOccurs'; - sMAX_OCCURS = 'maxOccurs'; - sNAME = 'name'; - sNAME_SPACE = 'namespace'; - sPORT_TYPE = 'portType'; - sRECORD = 'record'; - sRESTRICTION = 'restriction'; - sSEQUENCE = 'sequence'; - sSERVICE = 'service'; - sSIMPLE_TYPE = 'simpleType'; - sSTYLE = 'style'; - sTRANSPORT = 'transport'; - sTYPE = 'type'; - sUNBOUNDED = 'unbounded'; - //sUSE = 'use'; - sVALUE = 'value'; - - sWSDL_DEFINITIONS = 'definitions'; - sWSDL_INPUT = 'input'; - sWSDL_MESSAGE = 'message'; - sWSDL_NAME = 'name'; - sWSDL_OPERATION = 'operation'; - sWSDL_OUTPUT = 'output'; - sWSDL_PART = 'part'; - sWSDL_PORT = 'port'; - sWSDL_PORT_TYPE = sPORT_TYPE; - sWSDL_SCHEMA = 'schema'; - sWSDL_TARGET_NS = 'targetNamespace'; - sWSDL_TYPE = sTYPE; - sWSDL_TYPES = 'types'; - -var - WsdlTypeHandlerRegistryInst : IWsdlTypeHandlerRegistry = nil; - - -function GetTypeNameSpace( - AContainer : TwstPasTreeContainer; - AType : TPasElement -) : string; -var - locElt : TPasElement; -begin - Result := ''; - locElt := AType; - if ( locElt <> nil ) then begin - if locElt.InheritsFrom(TPasUnresolvedTypeRef) then - locElt := AContainer.FindElement(AContainer.GetExternalName(locElt)); - if ( locElt <> nil ) and - ( not locElt.InheritsFrom(TPasUnresolvedTypeRef) ) and - //locElt.InheritsFrom(TPasType) and - ( locElt.Parent <> nil ) and - ( locElt.Parent.Parent <> nil ) - then begin - Result := AContainer.GetExternalName(locElt.Parent.Parent); - end; - end; - Result := Trim(Result); - if ( Length(Result) = 0 ) then - Result := AContainer.GetExternalName(AContainer.CurrentModule); -end; - - -type - - { TWsdlTypeHandlerRegistry } - - TWsdlTypeHandlerRegistry = class(TInterfacedObject,IInterface,IWsdlTypeHandlerRegistry) - private - FList : TClassList; - private - function FindIndexOfHandler(ASymbol : TPasElement) : Integer; - protected - function Find( - ASymbol : TPasElement; - out AHandler : IWsdlTypeHandler - ) : Boolean; - procedure Register(AFactory : TBaseTypeHandlerClass); + procedure Prepare(ASymTable : TwstPasTreeContainer; AModule : TPasModule); + procedure Execute( + ASymTable : TwstPasTreeContainer; + AModuleName : string + ); + property Document : TDOMDocument read FDocument; public - constructor Create(); - destructor Destroy();override; + constructor Create(ADocument : TDOMDocument); end; + +implementation +uses xsd_consts, wst_types; -{ TWsdlTypeHandlerRegistry } +{ TWsdlTypechemaGenerator } -function TWsdlTypeHandlerRegistry.FindIndexOfHandler(ASymbol: TPasElement): Integer; -Var - i, c : Integer; +function TWsdlTypechemaGenerator.GetSchemaNode(ADocument : TDOMDocument) : TDOMNode; begin - Result := -1; - c := FList.Count; - for i := 0 to Pred(c) do begin - if TBaseTypeHandlerClass(FList[i]).CanHandle(ASymbol) then begin - Result := i; - Break; + Result := FSchemaNode; +end; + +procedure TWsdlTypechemaGenerator.Prepare(ASymTable : TwstPasTreeContainer; AModule : TPasModule); + + function FindNode(AParent : TDOMNode; const ANodeName : string) : TDOMNode; + var + nd : TDOMNode; + begin + Result := nil; + nd := AParent.FirstChild; + while Assigned(nd) do begin + if AnsiSameText(ANodeName,nd.NodeName) then begin + Result := nd; + Break; + end; + nd := nd.NextSibling; + end; + end; + + function FindNamedNode(AParent : TDOMNode; const AElementName, ANodeName : string) : TDOMNode; + var + ndE, nd : TDOMNode; + begin + Result := nil; + ndE := AParent.FirstChild; + while Assigned(ndE) do begin + if AnsiSameText(AElementName,ndE.NodeName) and Assigned(ndE.Attributes) then begin + nd := ndE.Attributes.GetNamedItem(s_name); + if Assigned(nd) and AnsiSameText(ANodeName,nd.NodeValue) then begin + Result := nd; + Break; + end; + end; + ndE := ndE.NextSibling; end; end; -end; -function TWsdlTypeHandlerRegistry.Find( - ASymbol : TPasElement; - out AHandler : IWsdlTypeHandler -) : Boolean; var - fct : TBaseTypeHandlerClass; - i : Integer; + unitNamespace : string; begin - i := FindIndexOfHandler(ASymbol); - Result := ( i >= 0 ); - if Result then begin - fct := TBaseTypeHandlerClass(FList[i]); - AHandler := fct.Create() as IWsdlTypeHandler; + inherited Prepare(ASymTable, AModule); + FTypesNode := FindNode(Document.DocumentElement,s_types) as TDOMElement; + if ( FTypesNode = nil ) then + raise EWsdlGeneratorException.Create('Unable to find "types" node.'); + unitNamespace := ASymTable.GetExternalName(AModule); + FSchemaNode := FindNamedNode(FTypesNode,s_xs_short,unitNamespace) as TDOMElement; + if ( FSchemaNode = nil ) then begin + FSchemaNode := CreateElement(s_xs_short + ':' + s_schema,FTypesNode,Document); + FSchemaNode.SetAttribute(s_xmlns,s_xs); + FSchemaNode.SetAttribute(s_targetNamespace,unitNamespace); + FSchemaNode.SetAttribute(Format('%s:%s',[s_xmlns,s_tns]),unitNamespace); end; end; -procedure TWsdlTypeHandlerRegistry.Register(AFactory: TBaseTypeHandlerClass); -begin - if ( FList.IndexOf(AFactory) = -1 ) then begin - FList.Add(AFactory); - end; -end; +{ TWsdlGenerator } -constructor TWsdlTypeHandlerRegistry.Create(); -begin - FList := TClassList.Create(); -end; - -destructor TWsdlTypeHandlerRegistry.Destroy(); -begin - FreeAndNil(FList); - inherited Destroy(); -end; - -function CreateElement(const ANodeName : DOMString; AParent : TDOMNode; ADoc : TDOMDocument):TDOMElement;//inline; -begin - Result := ADoc.CreateElement(ANodeName); - AParent.AppendChild(Result); -end; - -function FindAttributeByValueInNode( - const AAttValue : string; - const ANode : TDOMNode; - out AResAtt : string; - const AStartIndex : Integer = 0; - const AStartingWith : string = '' -):boolean; +procedure TWsdlGenerator.GenerateTypes(ASymTable : TwstPasTreeContainer); var - i,c : Integer; - b : Boolean; + i : PtrInt; + mdl : TPasModule; + mdlLs : TList; + g : IGenerator; begin - AResAtt := ''; - if Assigned(ANode) and Assigned(ANode.Attributes) then begin - b := ( Length(AStartingWith) = 0); - c := Pred(ANode.Attributes.Length); - if ( AStartIndex >= 0 ) then - i := AStartIndex; - for i := 0 to c do begin - if AnsiSameText(AAttValue,ANode.Attributes.Item[i].NodeValue) and - ( b or ( Pos(AStartingWith,ANode.Attributes.Item[i].NodeName) = 1 )) - then begin - AResAtt := ANode.Attributes.Item[i].NodeName; - Result := True; - Exit; + mdlLs := ASymTable.Package.Modules; + if ( mdlLs.Count > 0 ) then begin + g := TWsdlTypechemaGenerator.Create(Document) as IGenerator; + for i := 0 to Pred(mdlLs.Count) do begin + mdl := TPasModule(mdlLs[i]); + if not mdl.InheritsFrom(TPasNativeModule) then begin + g.Execute(ASymTable,mdl.Name); end; end; end; - Result := False; end; -function GetNameSpaceShortName( - const ANameSpace : string; - AWsdlDocument : TDOMDocument -):string;//inline; -begin - if FindAttributeByValueInNode(ANameSpace,AWsdlDocument.DocumentElement,Result,0,sXMLNS) then begin - Result := Copy(Result,Length(sXMLNS+':')+1,MaxInt); - end else begin - Result := Format('ns%d',[GetNodeListCount(AWsdlDocument.DocumentElement.Attributes)]) ; - AWsdlDocument.DocumentElement.SetAttribute(Format('%s:%s',[sXMLNS,Result]),ANameSpace); - end; -end; +procedure TWsdlGenerator.GenerateServiceMessages( + ASymTable : TwstPasTreeContainer; + AModule : TPasModule; + AContract : TPasClassType; + ARootNode : TDOMElement +); -type TServiceElementType = ( setPortType, setBinding, setPort, setService,setAddress ); -function GetServicePartName(AContainer : TwstPasTreeContainer; AService : TPasClassType; const AServicePart : TServiceElementType):string; -const PART_NAME_MAP : array[TServiceElementType] of shortstring = ('', 'Binding', 'Port', '',''); -begin - Result := AContainer.GetExternalName(AService) + PART_NAME_MAP[AServicePart]; -end; - -procedure GenerateWSDL(ASymbolTable : TwstPasTreeContainer; ADoc : TDOMDocument); - - procedure GenerateServiceMessages( - AContract : TPasClassType; - ARootNode : TDOMElement - ); - procedure GenerateOperationMessage(AOperation : TPasProcedure); - + procedure GenerateParam(APrm : TPasArgument; AMsgNode : TDOMElement); var tmpNode : TDOMElement; ns_shortName, s : string; typItm : TPasType; begin - tmpNode := CreateElement(sWSDL_PART,AMsgNode,ADoc); - tmpNode.SetAttribute(sWSDL_NAME,ASymbolTable.GetExternalName(APrm)); + tmpNode := CreateElement(s_part,AMsgNode,Document); + tmpNode.SetAttribute(s_name,ASymTable.GetExternalName(APrm)); typItm := APrm.ArgType; if Assigned(typItm.Parent) and Assigned(typItm.Parent.Parent) then - s := ASymbolTable.GetExternalName(typItm.Parent.Parent) + s := ASymTable.GetExternalName(typItm.Parent.Parent) else - s := ASymbolTable.GetExternalName(ASymbolTable.CurrentModule); - ns_shortName := GetNameSpaceShortName(s,ADoc); - s := Format('%s:%s',[ns_shortName,ASymbolTable.GetExternalName(typItm)]); - tmpNode.SetAttribute(sWSDL_TYPE,s); + s := ASymTable.GetExternalName(AModule); + ns_shortName := GetNameSpaceShortName(s,Document); + s := Format('%s:%s',[ns_shortName,ASymTable.GetExternalName(typItm)]); + tmpNode.SetAttribute(s_type,s); end; procedure GenerateResultParam(APrm : TPasResultElement; AMsgNode : TDOMElement); @@ -390,16 +195,16 @@ procedure GenerateWSDL(ASymbolTable : TwstPasTreeContainer; ADoc : TDOMDocument) ns_shortName, s : string; typItm : TPasType; begin - tmpNode := CreateElement(sWSDL_PART,AMsgNode,ADoc); - tmpNode.SetAttribute(sWSDL_NAME,ASymbolTable.GetExternalName(APrm)); + tmpNode := CreateElement(s_part,AMsgNode,Document); + tmpNode.SetAttribute(s_name,ASymTable.GetExternalName(APrm)); typItm := APrm.ResultType; if Assigned(typItm.Parent) and Assigned(typItm.Parent.Parent) then - s := ASymbolTable.GetExternalName(typItm.Parent.Parent) + s := ASymTable.GetExternalName(typItm.Parent.Parent) else - s := ASymbolTable.GetExternalName(ASymbolTable.CurrentModule); - ns_shortName := GetNameSpaceShortName(s,ADoc); - s := Format('%s:%s',[ns_shortName,ASymbolTable.GetExternalName(typItm)]); - tmpNode.SetAttribute(sWSDL_TYPE,s); + s := ASymTable.GetExternalName(AModule); + ns_shortName := GetNameSpaceShortName(s,Document); + s := Format('%s:%s',[ns_shortName,ASymTable.GetExternalName(typItm)]); + tmpNode.SetAttribute(s_type,s); end; var @@ -407,10 +212,10 @@ procedure GenerateWSDL(ASymbolTable : TwstPasTreeContainer; ADoc : TDOMDocument) ii, cc : Integer; pp : TPasArgument; begin - qryNode := CreateElement(sWSDL_MESSAGE,ARootNode,ADoc); - qryNode.SetAttribute(sWSDL_NAME,Format('%s',[ASymbolTable.GetExternalName(AOperation)])); - rspNode := CreateElement(sWSDL_MESSAGE,ARootNode,ADoc); - rspNode.SetAttribute(sWSDL_NAME,Format('%sResponse',[ASymbolTable.GetExternalName(AOperation)])); + qryNode := CreateElement(s_message,ARootNode,Document); + qryNode.SetAttribute(s_name,Format('%s',[ASymTable.GetExternalName(AOperation)])); + rspNode := CreateElement(s_message,ARootNode,Document); + rspNode.SetAttribute(s_name,Format('%sResponse',[ASymTable.GetExternalName(AOperation)])); cc := AOperation.ProcType.Args.Count; for ii := 0 to Pred(cc) do begin pp := TPasArgument(AOperation.ProcType.Args[ii]); @@ -423,674 +228,230 @@ procedure GenerateWSDL(ASymbolTable : TwstPasTreeContainer; ADoc : TDOMDocument) GenerateResultParam(TPasFunctionType(AOperation.ProcType).ResultEl,rspNode); end; end; - - Var - j, k : Integer; - po : TPasProcedure; - begin - k := AContract.Members.Count; - if ( k > 0 ) then begin - for j := 0 to pred(k) do begin - if TPasElement(AContract.Members[j]).InheritsFrom(TPasProcedure) then begin - po := TPasProcedure(AContract.Members[j]); - GenerateOperationMessage(po); - end; + +Var + j, k : Integer; + po : TPasProcedure; +begin + k := AContract.Members.Count; + if ( k > 0 ) then begin + for j := 0 to pred(k) do begin + if TPasElement(AContract.Members[j]).InheritsFrom(TPasProcedure) then begin + po := TPasProcedure(AContract.Members[j]); + GenerateOperationMessage(po); end; end; end; +end; - procedure GenerateServicePortType(AContract : TPasClassType; ARootNode : TDOMElement); - - procedure GenerateOperation(AOperation : TPasProcedure; APrtTypeNode : TDOMElement); - var - opNode, inNode, outNode : TDOMElement; - begin - opNode := CreateElement(sWSDL_OPERATION,APrtTypeNode,ADoc); - opNode.SetAttribute(sWSDL_NAME,ASymbolTable.GetExternalName(AOperation)); - inNode := CreateElement(sWSDL_INPUT,opNode,ADoc); - inNode.SetAttribute(sWSDL_MESSAGE,Format('%s:%s',[sTNS,ASymbolTable.GetExternalName(AOperation)])); - outNode := CreateElement(sWSDL_OUTPUT,opNode,ADoc); - outNode.SetAttribute(sWSDL_MESSAGE,Format('%s:%sResponse',[sTNS,ASymbolTable.GetExternalName(AOperation)])); - end; +procedure TWsdlGenerator.GenerateServicePortType( + ASymTable : TwstPasTreeContainer; + AModule : TPasModule; + AContract : TPasClassType; + ARootNode : TDOMElement +); + procedure GenerateOperation(AOperation : TPasProcedure; APrtTypeNode : TDOMElement); var - prtTypeNode, docNode : TDOMElement; - j, k : Integer; - po : TPasProcedure; + opNode, inNode, outNode : TDOMElement; begin - prtTypeNode := CreateElement(sWSDL_PORT_TYPE,ARootNode,ADoc); - if ( Length(AContract.InterfaceGUID) > 0 ) then begin - docNode := CreateElement(sDOCUMENT,prtTypeNode,ADoc); - CreateElement(sGUID,docNode,ADoc).SetAttribute(sVALUE,AContract.InterfaceGUID); - end else begin - docNode := nil; - end; - prtTypeNode.SetAttribute(sWSDL_NAME,ASymbolTable.GetExternalName(AContract)); - k := AContract.Members.Count; - if ( k > 0 ) then begin - for j := 0 to pred(k) do begin - if TPasElement(AContract.Members[j]).InheritsFrom(TPasProcedure) then begin - po := TPasProcedure(AContract.Members[j]); - GenerateOperation(po,prtTypeNode); - end; + opNode := CreateElement(s_operation,APrtTypeNode,Document); + opNode.SetAttribute(s_name,ASymTable.GetExternalName(AOperation)); + inNode := CreateElement(s_input,opNode,Document); + inNode.SetAttribute(s_message,Format('%s:%s',[s_tns,ASymTable.GetExternalName(AOperation)])); + outNode := CreateElement(s_output,opNode,Document); + outNode.SetAttribute(s_message,Format('%s:%sResponse',[s_tns,ASymTable.GetExternalName(AOperation)])); + end; + +var + prtTypeNode, docNode : TDOMElement; + j, k : Integer; + po : TPasProcedure; +begin + prtTypeNode := CreateElement(s_portType,ARootNode,Document); + if ( Length(AContract.InterfaceGUID) > 0 ) then begin + docNode := CreateElement(s_document,prtTypeNode,Document); + CreateElement(s_guid,docNode,Document).SetAttribute(s_value,AContract.InterfaceGUID); + end else begin + docNode := nil; + end; + prtTypeNode.SetAttribute(s_name,ASymTable.GetExternalName(AContract)); + k := AContract.Members.Count; + if ( k > 0 ) then begin + for j := 0 to pred(k) do begin + if TPasElement(AContract.Members[j]).InheritsFrom(TPasProcedure) then begin + po := TPasProcedure(AContract.Members[j]); + GenerateOperation(po,prtTypeNode); end; end; end; +end; - procedure GenerateServiceBinding(ABinding : TwstBinding; ARootNode : TDOMElement); - - procedure GenerateOperation(AOperation : TPasProcedure; ABndngNode : TDOMElement); - var - opNode, inNode, outNode, bdyNode : TDOMElement; - strBuff, strSoapActBuffer : string; - encdStyl{,encdStylURI} : string; - begin - strBuff := Format('%s:%s',[sSOAP,sWSDL_OPERATION]); - opNode := CreateElement(sWSDL_OPERATION,ABndngNode,ADoc); - opNode.SetAttribute(sWSDL_NAME,ASymbolTable.GetExternalName(AOperation)); - strSoapActBuffer := Trim(ASymbolTable.Properties.GetValue(AOperation,sTRANSPORT + '_' + sSOAP_ACTION)); - {if ( Length(strSoapActBuffer) = 0 ) then begin - strSoapActBuffer := Format('%s/%s/%s',[ASymbolTable.GetExternalName(ASymbolTable.CurrentModule),ASymbolTable.GetExternalName(ABinding.Intf),ASymbolTable.GetExternalName(AOperation)]); +procedure TWsdlGenerator.GenerateServiceBinding( + ASymTable : TwstPasTreeContainer; + AModule : TPasModule; + ABinding : TwstBinding; + ARootNode : TDOMElement +); + procedure GenerateOperation(AOperation : TPasProcedure; ABndngNode : TDOMElement); + var + opNode, inNode, outNode, bdyNode : TDOMElement; + strBuff, strSoapActBuffer : string; + encdStyl{,encdStylURI} : string; + begin + strBuff := Format('%s:%s',[s_soap_short_name,s_operation]); + opNode := CreateElement(s_operation,ABndngNode,Document); + opNode.SetAttribute(s_name,ASymTable.GetExternalName(AOperation)); + strSoapActBuffer := Trim(ASymTable.Properties.GetValue(AOperation,s_transport + '_' + s_soapAction)); + {if ( Length(strSoapActBuffer) = 0 ) then begin + strSoapActBuffer := Format('%s/%s/%s',[ASymbolTable.GetExternalName(ASymbolTable.CurrentModule),ASymbolTable.GetExternalName(ABinding.Intf),ASymbolTable.GetExternalName(AOperation)]); + end;} + CreateElement(strBuff,opNode,Document).SetAttribute(s_soapAction,strSoapActBuffer); + inNode := CreateElement(s_input,opNode,Document); + strBuff := Format('%s:%s',[s_soap_short_name,s_body]); + bdyNode := CreateElement(strBuff,inNode,Document); + encdStyl := s_literal; + {encdStylURI := ''; + propData := Find(AOperation^.Properties,sFORMAT_Input_EncodingStyle); + if Assigned(propData) and ( Length(Trim(propData^.Data)) > 0 ) then begin + encdStyl := Trim(propData^.Data); end;} - CreateElement(strBuff,opNode,ADoc).SetAttribute(sSOAP_ACTION,strSoapActBuffer); - inNode := CreateElement(sWSDL_INPUT,opNode,ADoc); - strBuff := Format('%s:%s',[sSOAP,sBODY]); - bdyNode := CreateElement(strBuff,inNode,ADoc); - encdStyl := 'literal'; - {encdStylURI := ''; - propData := Find(AOperation^.Properties,sFORMAT_Input_EncodingStyle); - if Assigned(propData) and ( Length(Trim(propData^.Data)) > 0 ) then begin - encdStyl := Trim(propData^.Data); - end;} - bdyNode.SetAttribute(sSOAP_USE,encdStyl); - bdyNode.SetAttribute(sNAME_SPACE,Format('%s',[ASymbolTable.GetExternalName(ASymbolTable.CurrentModule)])); - {propData := Find(AOperation^.Properties,sFORMAT_Input_EncodingStyleURI); - if Assigned(propData) and ( Length(Trim(propData^.Data)) > 0 ) then begin - encdStylURI := Trim(propData^.Data); - end; - if ( Length(encdStylURI) > 0 ) then - bdyNode.SetAttribute(sSOAP_ENCODING_STYLE,encdStylURI); } - - outNode := CreateElement(sWSDL_OUTPUT,opNode,ADoc); - strBuff := Format('%s:%s',[sSOAP,sBODY]); - bdyNode := CreateElement(strBuff,outNode,ADoc); - bdyNode.SetAttribute(sSOAP_USE,encdStyl); - bdyNode.SetAttribute(sNAME_SPACE,Format('%s',[ASymbolTable.GetExternalName(ASymbolTable.CurrentModule)])); - {if ( Length(encdStylURI) > 0 ) then - bdyNode.SetAttribute(sSOAP_ENCODING_STYLE,encdStylURI);} - end; - - var - bndgNode, soapbndgNode : TDOMElement; - j, k : Integer; - po : TPasProcedure; - strBuf : string; - begin - bndgNode := CreateElement(sBINDING,ARootNode,ADoc); - bndgNode.SetAttribute(sWSDL_NAME,ABinding.Name); - bndgNode.SetAttribute(sWSDL_TYPE,Format('%s:%s',[sTNS,ASymbolTable.GetExternalName(ABinding.Intf)])); - - strBuf := Format('%s:%s',[sSOAP,sBINDING]); - soapbndgNode := CreateElement(strBuf,bndgNode,ADoc); - soapbndgNode.SetAttribute(sSTYLE,sSOAP_RPC); - soapbndgNode.SetAttribute(sTRANSPORT,sSOAP_TRANSPORT); - - k := ABinding.Intf.Members.Count; - if ( k > 0 ) then begin - for j := 0 to pred(k) do begin - if TPasElement(ABinding.Intf.Members[j]).InheritsFrom(TPasProcedure) then begin - po := TPasProcedure(ABinding.Intf.Members[j]); - GenerateOperation(po,bndgNode); + bdyNode.SetAttribute(s_use,encdStyl); + bdyNode.SetAttribute(s_namespace,Format('%s',[ASymTable.GetExternalName(AModule)])); + {propData := Find(AOperation^.Properties,sFORMAT_Input_EncodingStyleURI); + if Assigned(propData) and ( Length(Trim(propData^.Data)) > 0 ) then begin + encdStylURI := Trim(propData^.Data); end; + if ( Length(encdStylURI) > 0 ) then + bdyNode.SetAttribute(sSOAP_ENCODING_STYLE,encdStylURI); } + + outNode := CreateElement(s_output,opNode,Document); + strBuff := Format('%s:%s',[s_soap_short_name,s_body]); + bdyNode := CreateElement(strBuff,outNode,Document); + bdyNode.SetAttribute(s_use,encdStyl); + bdyNode.SetAttribute(s_namespace,Format('%s',[ASymTable.GetExternalName(AModule)])); + {if ( Length(encdStylURI) > 0 ) then + bdyNode.SetAttribute(sSOAP_ENCODING_STYLE,encdStylURI);} + end; + +var + bndgNode, soapbndgNode : TDOMElement; + j, k : Integer; + po : TPasProcedure; + strBuf : string; +begin + bndgNode := CreateElement(s_binding,ARootNode,Document); + bndgNode.SetAttribute(s_name,ABinding.Name); + bndgNode.SetAttribute(s_type,Format('%s:%s',[s_tns,ASymTable.GetExternalName(ABinding.Intf)])); + + strBuf := Format('%s:%s',[s_soap_short_name,s_binding]); + soapbndgNode := CreateElement(strBuf,bndgNode,Document); + soapbndgNode.SetAttribute(s_style,s_rpc); + soapbndgNode.SetAttribute(s_transport,s_soapTransport); + + k := ABinding.Intf.Members.Count; + if ( k > 0 ) then begin + for j := 0 to pred(k) do begin + if TPasElement(ABinding.Intf.Members[j]).InheritsFrom(TPasProcedure) then begin + po := TPasProcedure(ABinding.Intf.Members[j]); + GenerateOperation(po,bndgNode); end; end; end; +end; - procedure GenerateServicePublication(ABinding : TwstBinding; ARootNode : TDOMElement); - var - srvcNode, portNode, soapAdrNode : TDOMElement; - strBuf : string; - begin - srvcNode := CreateElement(sSERVICE,ARootNode,ADoc); - srvcNode.SetAttribute(sWSDL_NAME,ASymbolTable.GetExternalName(ABinding.Intf)); +procedure TWsdlGenerator.GenerateServicePublication( + ASymTable : TwstPasTreeContainer; + AModule : TPasModule; + ABinding : TwstBinding; + ARootNode : TDOMElement +); +var + srvcNode, portNode, soapAdrNode : TDOMElement; + strBuf : string; +begin + srvcNode := CreateElement(s_service,ARootNode,Document); + srvcNode.SetAttribute(s_name,ASymTable.GetExternalName(ABinding.Intf)); - strBuf := Format('%s',[sWSDL_PORT]); - portNode := CreateElement(strBuf,srvcNode,ADoc); - portNode.SetAttribute(sWSDL_NAME,ASymbolTable.GetExternalName(ABinding.Intf) + 'Port'); - portNode.SetAttribute(sBINDING,Format('%s:%s',[sTNS,ABinding.Name])); + strBuf := Format('%s',[s_port]); + portNode := CreateElement(strBuf,srvcNode,Document); + portNode.SetAttribute(s_name,ASymTable.GetExternalName(ABinding.Intf) + 'Port'); + portNode.SetAttribute(s_binding,Format('%s:%s',[s_tns,ABinding.Name])); - strBuf := Format('%s:%s',[sSOAP,sADDRESS]); - soapAdrNode := CreateElement(strBuf,portNode,ADoc); - soapAdrNode.SetAttribute(sLOCATION,ABinding.Address); - end; - - procedure GenerateServiceTypes(); - var - j, k : Integer; - tri : TPasElement; - g : IWsdlTypeHandler; - gr : IWsdlTypeHandlerRegistry; - typeList : TList; - begin - gr := GetWsdlTypeHandlerRegistry(); - typeList := ASymbolTable.CurrentModule.InterfaceSection.Declarations; - k := typeList.Count; - for j := 0 to Pred(k) do begin - tri := TPasElement(typeList[j]); - if tri.InheritsFrom(TPasType) and - ( not tri.InheritsFrom(TPasNativeClassType) ) and - ( not tri.InheritsFrom(TPasNativeSimpleType) ) - then begin - if gr.Find(tri,g) then - g.Generate(ASymbolTable, tri,ADoc); - end; - end; - end; + strBuf := Format('%s:%s',[s_soap_short_name,s_address]); + soapAdrNode := CreateElement(strBuf,portNode,Document); + soapAdrNode.SetAttribute(s_location,ABinding.Address); +end; + +procedure TWsdlGenerator.Prepare(ASymTable : TwstPasTreeContainer; AModule : TPasModule); function CreateRootNode():TDOMElement; + var + extName : string; begin - Result := CreateElement(sWSDL_DEFINITIONS,ADoc,ADoc); - Result.SetAttribute(sWSDL_NAME,ASymbolTable.GetExternalName(ASymbolTable.CurrentModule)); - - Result.SetAttribute(sWSDL_TARGET_NS,ASymbolTable.GetExternalName(ASymbolTable.CurrentModule)); - Result.SetAttribute(Format('%s:%s',[sXMLNS,sSOAP]),sSOAP_NS); - Result.SetAttribute(Format('%s:%s',[sXMLNS,sXSD]),sXSD_NS); - Result.SetAttribute(Format('%s:%s',[sXMLNS,sTNS]),ASymbolTable.GetExternalName(ASymbolTable.CurrentModule)); - Result.SetAttribute(sXMLNS,sWSDL_NS); + extName := ASymTable.GetExternalName(AModule); + Result := CreateElement(s_definitions,Document,Document); + Result.SetAttribute(s_name,extName); + + Result.SetAttribute(s_targetNamespace,extName); + Result.SetAttribute(Format('%s:%s',[s_xmlns,s_soap_short_name]),s_soap); + Result.SetAttribute(Format('%s:%s',[s_xmlns,s_xs_short]),s_xs); + Result.SetAttribute(Format('%s:%s',[s_xmlns,s_tns]),extName); + Result.SetAttribute(s_xmlns,s_wsdl); end; - + function CreateTypesRootNode(ARootNode : TDOMNode):TDOMElement; begin - Result := CreateElement(sWSDL_TYPES,ARootNode,ADoc); + Result := CreateElement(s_types,ARootNode,Document); end; +begin + FDefinitionsNode := CreateRootNode(); + FTypesNode := CreateTypesRootNode(FDefinitionsNode); + +end; + +procedure TWsdlGenerator.Execute(ASymTable : TwstPasTreeContainer; AModuleName : string); var - defNode, typesNode, schNode : TDOMElement; - j, c : Integer; + locMainModule : TPasModule; + decList : TList; + j, c : PtrInt; sym : TPasElement; ps : TPasClassType; - decList : TList; bndg : TwstBinding; begin - if not ( Assigned(ASymbolTable) and Assigned(ADoc)) then - Exit; + locMainModule := ASymTable.FindModule(AModuleName); + if ( locMainModule = nil ) then + locMainModule := ASymTable.CurrentModule; + if ( locMainModule = nil ) then + raise EWsdlGeneratorException.Create('Invalid symbol table.'); + Prepare(ASymTable,locMainModule); - defNode := CreateRootNode(); - typesNode := CreateTypesRootNode(defNode); - schNode := CreateElement(sXSD + ':' + sWSDL_SCHEMA,typesNode,ADoc); - schNode.SetAttribute(sXMLNS,sXSD_NS); - schNode.SetAttribute(sWSDL_TARGET_NS,ASymbolTable.GetExternalName(ASymbolTable.CurrentModule)); - - GenerateServiceTypes(); - - decList := ASymbolTable.CurrentModule.InterfaceSection.Declarations; + GenerateTypes(ASymTable); + + decList := locMainModule.InterfaceSection.Declarations; c := decList.Count; for j := 0 to Pred(c) do begin sym := TPasElement(decList[j]); if sym.InheritsFrom(TPasClassType) and ( TPasClassType(sym).ObjKind = okInterface ) then begin ps := TPasClassType(sym); - GenerateServiceMessages(ps,defNode); - GenerateServicePortType(ps,defNode); - end; - end; - - for j := 0 to Pred(ASymbolTable.BindingCount) do begin - bndg := ASymbolTable.Binding[j]; - GenerateServiceBinding(bndg,defNode); - GenerateServicePublication(bndg,defNode); - end; -end; - -function GetWsdlTypeHandlerRegistry():IWsdlTypeHandlerRegistry; -begin - Result := WsdlTypeHandlerRegistryInst; -end; - -type - - { TFakeTypeHandler } - - TFakeTypeHandler = class(TBaseTypeHandler) - protected - procedure Generate( - AContainer : TwstPasTreeContainer; - const ASymbol : TPasElement; - AWsdlDocument : TDOMDocument - );override; - end; - -{ TClassTypeDefinition_TypeHandler } -type TTypeCategory = ( tcComplexContent, tcSimpleContent ); -procedure TClassTypeDefinition_TypeHandler.Generate( - AContainer : TwstPasTreeContainer; - const ASymbol : TPasElement; - AWsdlDocument : TDOMDocument -); -var - cplxNode, annNode : TDOMElement; - - procedure CreateDocNode(); - begin - if ( annNode = nil ) then begin - annNode := CreateElement(sDOCUMENT,cplxNode,AWsdlDocument); + GenerateServiceMessages(ASymTable, locMainModule, ps, FDefinitionsNode); + GenerateServicePortType(ASymTable, locMainModule, ps, FDefinitionsNode); end; end; -var - typItm : TPasClassType; - propTypItm : TPasType; - s, prop_ns_shortName : string; - defTypesNode, defSchemaNode, sqcNode, propNode, derivationNode : TDOMElement; - i : Integer; - p : TPasProperty; - typeCategory : TTypeCategory; - hasSequence : Boolean; - trueParent : TPasType; -begin - inherited; - annNode := nil; - typItm := ASymbol as TPasClassType; - if Assigned(typItm) then begin - GetNameSpaceShortName(AContainer.GetExternalName(AContainer.CurrentModule) ,AWsdlDocument); - defTypesNode := FindNode(AWsdlDocument.DocumentElement,sWSDL_TYPES) as TDOMElement; - Assert(Assigned(defTypesNode)); - defSchemaNode := defTypesNode.FirstChild as TDOMElement; - - s := Format('%s:%s',[sXSD,sCOMPLEX_TYPE]); - cplxNode := CreateElement(s,defSchemaNode,AWsdlDocument); - cplxNode.SetAttribute(sNAME, AContainer.GetExternalName(typItm)) ; - - typeCategory := tcComplexContent; - derivationNode := nil; - hasSequence := True; - if Assigned(typItm.AncestorType) then begin - trueParent := typItm.AncestorType; - - if trueParent.InheritsFrom(TPasNativeClassType) and AnsiSameText('THeaderBlock',trueParent.Name) then begin - CreateDocNode(); - CreateElement(sAPPINFO,annNode,AWsdlDocument).SetAttribute(sHEADER_Block,'true'); - end; - - if trueParent.InheritsFrom(TPasAliasType) then begin - trueParent := GetUltimeType(trueParent); - end; - if trueParent.InheritsFrom(TPasNativeSimpleContentClassType) or - trueParent.InheritsFrom(TPasNativeSimpleType) - then begin - typeCategory := tcSimpleContent; - derivationNode := CreateElement(Format('%s:%s',[sXSD,sEXTENSION]),cplxNode,AWsdlDocument); - s := Trim(GetNameSpaceShortName(GetTypeNameSpace(AContainer,trueParent),AWsdlDocument)); - if ( Length(s) > 0 ) then begin - s := s + ':'; - end; - s := s + AContainer.GetExternalName(trueParent); - derivationNode.SetAttribute(sBASE,s); - hasSequence := False; - end; - end; - for i := 0 to Pred(typItm.Members.Count) do begin - if TPasElement(typItm.Members[i]).InheritsFrom(TPasProperty) then begin - p := TPasProperty(typItm.Members[i]); - if not AContainer.IsAttributeProperty(p) then begin - if ( typeCategory = tcSimpleContent ) then begin - raise EWsdlGeneratorException.CreateFmt('Invalid type definition, a simple type cannot have "not attribute" properties : "%s"',[AContainer.GetExternalName(ASymbol)]); - end; - end; - hasSequence := True; - end; - end; - if hasSequence then begin - s := Format('%s:%s',[sXSD,sSEQUENCE]); - if Assigned(derivationNode) then begin - sqcNode := CreateElement(s,derivationNode,AWsdlDocument); - end else begin - sqcNode := CreateElement(s,cplxNode,AWsdlDocument); - end; - end else begin - sqcNode := nil; - end; - - - for i := 0 to Pred(typItm.Members.Count) do begin - if TPasElement(typItm.Members[i]).InheritsFrom(TPasProperty) then begin - p := TPasProperty(typItm.Members[i]); - if AnsiSameText('Has',Copy(p.StoredAccessorName,1,3)) or AnsiSameText('True',p.StoredAccessorName) then begin - if AContainer.IsAttributeProperty(p) then begin - s := Format('%s:%s',[sXSD,sATTRIBUTE]); - if Assigned(derivationNode) then - propNode := CreateElement(s,derivationNode,AWsdlDocument) - else - propNode := CreateElement(s,cplxNode,AWsdlDocument); - end else begin - s := Format('%s:%s',[sXSD,sELEMENT]); - propNode := CreateElement(s,sqcNode,AWsdlDocument); - end; - propNode.SetAttribute(sNAME,AContainer.GetExternalName(p)); - propTypItm := p.VarType; - if Assigned(propTypItm) then begin - prop_ns_shortName := GetNameSpaceShortName(GetTypeNameSpace(AContainer,propTypItm),AWsdlDocument); - propNode.SetAttribute(sTYPE,Format('%s:%s',[prop_ns_shortName,AContainer.GetExternalName(propTypItm)])); - if AContainer.IsAttributeProperty(p) then begin - if AnsiSameText('Has',Copy(p.StoredAccessorName,1,3)) then - propNode.SetAttribute(sATTRIBUTE,'optional') - else - propNode.SetAttribute(sATTRIBUTE,'required'); - end else begin - if AnsiSameText('Has',Copy(p.StoredAccessorName,1,3)) then - propNode.SetAttribute(sMIN_OCCURS,'0') - else - propNode.SetAttribute(sMIN_OCCURS,'1'); - propNode.SetAttribute(sMAX_OCCURS,'1'); - end; - end; - end; - end; - end; + for j := 0 to Pred(ASymTable.BindingCount) do begin + bndg := ASymTable.Binding[j]; + GenerateServiceBinding(ASymTable, locMainModule, bndg,FDefinitionsNode); + GenerateServicePublication(ASymTable, locMainModule, bndg, FDefinitionsNode); end; end; -class function TClassTypeDefinition_TypeHandler.CanHandle(ASymbol: TObject): Boolean; +constructor TWsdlGenerator.Create(ADocument : TDOMDocument); begin - Result := inherited CanHandle(ASymbol) and - ( ASymbol.InheritsFrom(TPasClassType) and ( TPasClassType(ASymbol).ObjKind = okClass )); -end; - -{ TEnumTypeHandler } - -procedure TEnumTypeHandler.Generate( - AContainer : TwstPasTreeContainer; - const ASymbol : TPasElement; - AWsdlDocument : TDOMDocument -); -var - typItm : TPasEnumType; - ns_shortName, s : string; - defTypesNode, defSchemaNode, resNode, restrictNode : TDOMElement; - i, c : Integer; - unitExternalName : string; -begin - typItm := ASymbol as TPasEnumType; - if Assigned(typItm) then begin - unitExternalName := GetTypeNameSpace(AContainer,ASymbol); - if FindAttributeByValueInNode(unitExternalName,AWsdlDocument.DocumentElement,ns_shortName) then begin - ns_shortName := Copy(ns_shortName,Length(sXMLNS+':')+1,MaxInt); - end else begin - ns_shortName := Format('ns%d',[GetNodeListCount(AWsdlDocument.DocumentElement.Attributes)]) ; - AWsdlDocument.DocumentElement.SetAttribute(Format('%s:%s',[sXMLNS,ns_shortName]),unitExternalName); - end; - defTypesNode := FindNode(AWsdlDocument.DocumentElement,sWSDL_TYPES) as TDOMElement; - Assert(Assigned(defTypesNode)); - defSchemaNode := defTypesNode.FirstChild as TDOMElement; - - //s := Format('%s:%s',[sXSD,sELEMENT]); - //eltNode := CreateElement(s,defSchemaNode,AWsdlDocument); - //eltNode.SetAttribute(sNAME, typItm.DeclaredName) ; - s := Format('%s:%s',[sXSD,sSIMPLE_TYPE]); - resNode := CreateElement(s,defSchemaNode,AWsdlDocument); - resNode.SetAttribute(sNAME, AContainer.GetExternalName(typItm)) ; - s := Format('%s:%s',[sXSD,sRESTRICTION]); - restrictNode := CreateElement(s,resNode,AWsdlDocument); - restrictNode.SetAttribute(sBASE,Format('%s:%s',[sXSD,'string'])) ; - c := typItm.Values.Count; - for i := 0 to pred(c) do begin - s := Format('%s:%s',[sXSD,sENUMERATION]); - CreateElement(s,restrictNode,AWsdlDocument).SetAttribute( - sVALUE, - AContainer.GetExternalName(TPasEnumValue(typItm.Values[i])) - ); - end; - end; + if ( ADocument = nil ) then + raise EWsdlGeneratorException.Create('Invalid not assigned.'); + FDocument := ADocument; end; -class function TEnumTypeHandler.CanHandle(ASymbol: TObject): Boolean; -begin - Result := inherited CanHandle(ASymbol) and ASymbol.InheritsFrom(TPasEnumType); -end; - - -{ TFakeTypeHandler } - -procedure TFakeTypeHandler.Generate( - AContainer : TwstPasTreeContainer; - const ASymbol : TPasElement; - AWsdlDocument : TDOMDocument -); -begin -end; - -{ TBaseArrayRemotable_TypeHandler } - -procedure TBaseArrayRemotable_TypeHandler.Generate( - AContainer : TwstPasTreeContainer; - const ASymbol : TPasElement; - AWsdlDocument : TDOMDocument -); - - function GetNameSpaceShortName(const ANameSpace : string):string;//inline; - begin - if FindAttributeByValueInNode(ANameSpace,AWsdlDocument.DocumentElement,Result,0,sXMLNS) then begin - Result := Copy(Result,Length(sXMLNS+':')+1,MaxInt); - end else begin - Result := Format('ns%d',[GetNodeListCount(AWsdlDocument.DocumentElement.Attributes)]) ; - AWsdlDocument.DocumentElement.SetAttribute(Format('%s:%s',[sXMLNS,Result]),ANameSpace); - end; - end; - -var - typItm : TPasArrayType; - propTypItm : TPasType; - s, prop_ns_shortName : string; - defTypesNode, defSchemaNode, cplxNode, sqcNode, propNode : TDOMElement; - unitExternalName : string; -begin - inherited; - typItm := ASymbol as TPasArrayType; - if not Assigned(typItm) then - Exit; - if Assigned(typItm) then begin - unitExternalName := GetTypeNameSpace(AContainer,typItm); - GetNameSpaceShortName(unitExternalName); - defTypesNode := FindNode(AWsdlDocument.DocumentElement,sWSDL_TYPES) as TDOMElement; - Assert(Assigned(defTypesNode)); - defSchemaNode := defTypesNode.FirstChild as TDOMElement; - - s := Format('%s:%s',[sXSD,sCOMPLEX_TYPE]); - cplxNode := CreateElement(s,defSchemaNode,AWsdlDocument); - cplxNode.SetAttribute(sNAME, AContainer.GetExternalName(typItm)) ; - - s := Format('%s:%s',[sXSD,sSEQUENCE]); - sqcNode := CreateElement(s,cplxNode,AWsdlDocument); - propTypItm := typItm.ElType; - s := Format('%s:%s',[sXSD,sELEMENT]); - propNode := CreateElement(s,sqcNode,AWsdlDocument); - propNode.SetAttribute(sNAME,sITEM); - if Assigned(propTypItm) then begin - prop_ns_shortName := GetNameSpaceShortName(GetTypeNameSpace(AContainer,propTypItm));// AContainer.GetExternalName(propTypItm.Parent.Parent)); - propNode.SetAttribute(sTYPE,Format('%s:%s',[prop_ns_shortName,AContainer.GetExternalName(propTypItm)])); - propNode.SetAttribute(sMIN_OCCURS,'0'); - propNode.SetAttribute(sMAX_OCCURS,sUNBOUNDED); - end; - end; -end; - -class function TBaseArrayRemotable_TypeHandler.CanHandle(ASymbol: TObject): Boolean; -begin - Result := inherited CanHandle(ASymbol) and ASymbol.InheritsFrom(TPasArrayType); -end; - -{ TTypeDefinition_TypeHandler } - -procedure TTypeDefinition_TypeHandler.Generate( - AContainer : TwstPasTreeContainer; - const ASymbol: TPasElement; - AWsdlDocument: TDOMDocument -); -begin - Assert(ASymbol.InheritsFrom(TPasType)); -end; - -class function TTypeDefinition_TypeHandler.CanHandle(ASymbol: TObject): Boolean; -begin - Result := Assigned(ASymbol) and ASymbol.InheritsFrom(TPasType); -end; - -procedure RegisterFondamentalTypes(); -var - r : IWsdlTypeHandlerRegistry; -begin - r := GetWsdlTypeHandlerRegistry(); - r.Register(TEnumTypeHandler); - r.Register(TClassTypeDefinition_TypeHandler); - r.Register(TPasRecordType_TypeHandler); - r.Register(TBaseArrayRemotable_TypeHandler); - r.Register(TTypeAliasDefinition_TypeHandler); -end; - -{ TTypeAliasDefinition_TypeHandler } - -procedure TTypeAliasDefinition_TypeHandler.Generate( - AContainer : TwstPasTreeContainer; - const ASymbol: TPasElement; - AWsdlDocument: TDOMDocument -); -var - typItm : TPasAliasType; - ns_shortName, s : string; - defTypesNode, defSchemaNode, resNode : TDOMElement; - unitExternalName, baseUnitExternalName : string; -begin - typItm := ASymbol as TPasAliasType; - if Assigned(typItm) then begin - unitExternalName := GetTypeNameSpace(AContainer,ASymbol); - if FindAttributeByValueInNode(unitExternalName,AWsdlDocument.DocumentElement,ns_shortName) then begin - ns_shortName := Copy(ns_shortName,Length(sXMLNS+':')+1,MaxInt); - end else begin - ns_shortName := Format('ns%d',[GetNodeListCount(AWsdlDocument.DocumentElement.Attributes)]) ; - AWsdlDocument.DocumentElement.SetAttribute(Format('%s:%s',[sXMLNS,ns_shortName]),unitExternalName); - end; - defTypesNode := FindNode(AWsdlDocument.DocumentElement,sWSDL_TYPES) as TDOMElement; - Assert(Assigned(defTypesNode)); - defSchemaNode := defTypesNode.FirstChild as TDOMElement; - - s := Format('%s:%s',[sXSD,sELEMENT]); - resNode := CreateElement(s,defSchemaNode,AWsdlDocument); - resNode.SetAttribute(sNAME, AContainer.GetExternalName(typItm)) ; - - baseUnitExternalName := GetTypeNameSpace(AContainer,typItm.DestType); - s := GetNameSpaceShortName(baseUnitExternalName,AWsdlDocument); - s := Format('%s:%s',[s,AContainer.GetExternalName(typItm.DestType)]); - resNode.SetAttribute(sTYPE,s) ; - end; -end; - -class function TTypeAliasDefinition_TypeHandler.CanHandle(ASymbol: TObject): Boolean; -begin - Result := Assigned(ASymbol) and ASymbol.InheritsFrom(TPasAliasType); -end; - -{ TPasRecordType_TypeHandler } - -procedure TPasRecordType_TypeHandler.Generate( - AContainer : TwstPasTreeContainer; - const ASymbol : TPasElement; - AWsdlDocument : TDOMDocument -); -var - cplxNode, annNode : TDOMElement; - - procedure CreateDocNode(); - begin - if ( annNode = nil ) then begin - annNode := CreateElement(Format('%s:%s',[sXSD,sANNOTATION]),cplxNode,AWsdlDocument); - end; - end; - -var - typItm : TPasRecordType; - propTypItm : TPasType; - s, prop_ns_shortName : string; - defTypesNode, defSchemaNode, sqcNode, propNode : TDOMElement; - i : Integer; - p : TPasVariable; - hasSequence : Boolean; -begin - inherited; - annNode := nil; - typItm := ASymbol as TPasRecordType; - if Assigned(typItm) then begin - GetNameSpaceShortName(AContainer.GetExternalName(AContainer.CurrentModule) ,AWsdlDocument); - defTypesNode := FindNode(AWsdlDocument.DocumentElement,sWSDL_TYPES) as TDOMElement; - Assert(Assigned(defTypesNode)); - defSchemaNode := defTypesNode.FirstChild as TDOMElement; - - s := Format('%s:%s',[sXSD,sCOMPLEX_TYPE]); - cplxNode := CreateElement(s,defSchemaNode,AWsdlDocument); - cplxNode.SetAttribute(sNAME, AContainer.GetExternalName(typItm)) ; - - CreateDocNode(); - CreateElement(Format('%s:%s',[sXSD,sAPPINFO]),annNode,AWsdlDocument).SetAttribute(sRECORD,'true'); - - hasSequence := False; - for i := 0 to Pred(typItm.Members.Count) do begin - if TPasElement(typItm.Members[i]).InheritsFrom(TPasVariable) then begin - p := TPasVariable(typItm.Members[i]); - if not AContainer.IsAttributeProperty(p) then begin - hasSequence := True; - Break; - end; - end; - end; - if hasSequence then begin - s := Format('%s:%s',[sXSD,sSEQUENCE]); - sqcNode := CreateElement(s,cplxNode,AWsdlDocument); - end else begin - sqcNode := nil; - end; - - - for i := 0 to Pred(typItm.Members.Count) do begin - if TPasElement(typItm.Members[i]).InheritsFrom(TPasVariable) then begin - p := TPasVariable(typItm.Members[i]); - if AContainer.IsAttributeProperty(p) then begin - s := Format('%s:%s',[sXSD,sATTRIBUTE]); - propNode := CreateElement(s,cplxNode,AWsdlDocument); - end else begin - s := Format('%s:%s',[sXSD,sELEMENT]); - propNode := CreateElement(s,sqcNode,AWsdlDocument); - end; - propNode.SetAttribute(sNAME,AContainer.GetExternalName(p)); - propTypItm := p.VarType; - if Assigned(propTypItm) then begin - prop_ns_shortName := GetNameSpaceShortName(GetTypeNameSpace(AContainer,propTypItm),AWsdlDocument); - propNode.SetAttribute(sTYPE,Format('%s:%s',[prop_ns_shortName,AContainer.GetExternalName(propTypItm)])); - {if AContainer.IsAttributeProperty(p) then begin - if AnsiSameText('Has',Copy(p.StoredAccessorName,1,3)) then - propNode.SetAttribute(sATTRIBUTE,'optional') - else - propNode.SetAttribute(sATTRIBUTE,'required'); - end else begin - if AnsiSameText('Has',Copy(p.StoredAccessorName,1,3)) then - propNode.SetAttribute(sMIN_OCCURS,'0') - else - propNode.SetAttribute(sMIN_OCCURS,'1'); - propNode.SetAttribute(sMAX_OCCURS,'1'); - end;} - end; - end; - end; - end; -end; - -class function TPasRecordType_TypeHandler.CanHandle(ASymbol : TObject) : Boolean; -begin - Result := inherited CanHandle(ASymbol) and ASymbol.InheritsFrom(TPasRecordType); -end; - -initialization - WsdlTypeHandlerRegistryInst := TWsdlTypeHandlerRegistry.Create() as IWsdlTypeHandlerRegistry; - RegisterFondamentalTypes(); - -finalization - WsdlTypeHandlerRegistryInst := nil; - end. diff --git a/wst/trunk/ws_helper/wsdl_parser.pas b/wst/trunk/ws_helper/wsdl_parser.pas index ba8b0316b..2b9beba27 100644 --- a/wst/trunk/ws_helper/wsdl_parser.pas +++ b/wst/trunk/ws_helper/wsdl_parser.pas @@ -98,7 +98,7 @@ type end; implementation -uses ws_parser_imp, dom_cursors, parserutils, StrUtils; +uses ws_parser_imp, dom_cursors, parserutils, StrUtils, xsd_consts; type diff --git a/wst/trunk/ws_helper/xsd_consts.pas b/wst/trunk/ws_helper/xsd_consts.pas new file mode 100644 index 000000000..a5bfe951a --- /dev/null +++ b/wst/trunk/ws_helper/xsd_consts.pas @@ -0,0 +1,101 @@ +{ + This unit is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +} +{$INCLUDE wst_global.inc} +unit xsd_consts; + +interface + +const + s_address : WideString = 'address'; + s_all : WideString = 'all'; + //s_any : WideString = 'any'; + s_annotation : WideString = 'annotation'; + s_appinfo : WideString = 'appinfo'; + s_array : WideString = 'array'; + s_arrayType : WideString = 'arrayType'; + s_attribute : WideString = 'attribute'; + s_base : WideString = 'base'; + s_binding : WideString = 'binding'; + s_body : WideString = 'body'; + s_complexContent : WideString = 'complexContent'; + s_complexType : WideString = 'complexType'; + s_customAttributes : WideString = 'customAttributes'; + s_definitions = 'definitions'; + s_document : WideString = 'document'; + s_element : WideString = 'element'; + s_enumeration : WideString = 'enumeration'; + s_extension : WideString = 'extension'; + s_guid : WideString = 'GUID'; + s_input : WideString = 'input'; + s_item : WideString = 'item'; + s_literal = 'literal'; + s_location : WideString = 'location'; + s_message : WideString = 'message'; + s_maxOccurs : WideString = 'maxOccurs'; + s_minOccurs : WideString = 'minOccurs'; + s_name : WideString = 'name'; + s_namespace = 'namespace'; + s_operation = 'operation'; + s_optional : WideString = 'optional'; + s_output : WideString = 'output'; + s_part : WideString = 'part'; + s_port : WideString = 'port'; + s_portType = 'portType'; + s_prohibited = 'prohibited'; + + s_ref : WideString = 'ref'; + s_required : WideString = 'required'; + s_restriction : WideString = 'restriction'; + //s_return : WideString = 'return'; + s_rpc = 'rpc'; + s_schema : WideString = 'schema'; + s_xs : WideString = 'http://www.w3.org/2001/XMLSchema'; + s_xs_short = 'xsd'; + s_sequence : WideString = 'sequence'; + s_service : WideString = 'service'; + s_simpleContent : WideString = 'simpleContent'; + s_simpleType : WideString = 'simpleType'; + s_soap : WideString = 'http://schemas.xmlsoap.org/wsdl/soap/'; + s_soap_short_name = 'soap'; + s_soapAction = 'soapAction'; + s_soapInputEncoding = 'Input_EncodingStyle'; + s_soapOutputEncoding = 'OutputEncodingStyle'; + s_soapStyle = 'style'; + s_soapTransport = 'http://schemas.xmlsoap.org/soap/http'; + s_style = 'style'; + s_targetNamespace = 'targetNamespace'; + s_tns = 'tns'; + s_transport = 'transport'; + s_type = 'type'; + s_types = 'types'; + s_unbounded = 'unbounded'; + s_use = 'use'; + s_value = 'value'; + s_wsdl = 'http://schemas.xmlsoap.org/wsdl/'; + s_xmlns = 'xmlns'; + + + s_WST_headerBlock = 'wst_headerBlock'; + s_WST_record = 'wst_record'; + s_WST_storeType = 'StoreType'; + +implementation + +end. + diff --git a/wst/trunk/ws_helper/xsd_generator.pas b/wst/trunk/ws_helper/xsd_generator.pas new file mode 100644 index 000000000..759ae2a0f --- /dev/null +++ b/wst/trunk/ws_helper/xsd_generator.pas @@ -0,0 +1,833 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2007 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +{$INCLUDE wst_global.inc} +unit xsd_generator; + +interface + +uses + Classes, SysUtils, TypInfo, + {$IFNDEF FPC}xmldom, wst_delphi_xml{$ELSE}DOM, wst_fpc_xml{$ENDIF}, + pastree, pascal_parser_intf; + +type + + EXsdGeneratorException = class(Exception) end; + TBaseTypeHandler = class; + TBaseTypeHandlerClass = class of TBaseTypeHandler; + + IGenerator = interface + ['{F69523B3-A6FF-4BFB-9ACB-D4B9F32DBCA9}'] + procedure Execute( + ASymTable : TwstPasTreeContainer; + AModuleName : string + ); + end; + + IXsdGenerator = interface(IGenerator) + ['{FBFF92BC-B72B-4B85-8D16-379F9E548DDB}'] + function GetSchemaNode(ADocument : TDOMDocument) : TDOMNode; + end; + + IXsdTypeHandler = interface + ['{541EA377-4F70-49B1-AFB4-FC62B24F567B}'] + procedure Generate( + AContainer : TwstPasTreeContainer; + const ASymbol : TPasElement; + ADocument : TDOMDocument + ); + function GetOwner() : IXsdGenerator; + end; + + IXsdTypeHandlerRegistry = interface + ['{C5666646-3426-4696-93EE-AFA8EE7CAE53}'] + function Find( + ASymbol : TPasElement; + Aowner : IGenerator; + out AHandler : IXsdTypeHandler + ) : Boolean; + procedure Register(AFactory : TBaseTypeHandlerClass); + end; + + { TCustomXsdGenerator } + + TCustomXsdGenerator = class( + TInterfacedObject, + IInterface, + IGenerator, + IXsdGenerator + ) + private + FDocument : TDOMDocument; + protected + function GetSchemaNode(ADocument : TDOMDocument) : TDOMNode;virtual;abstract; + procedure Execute( + ASymTable : TwstPasTreeContainer; + AModuleName : string + ); + + procedure Prepare( + ASymTable : TwstPasTreeContainer; + AModule : TPasModule + );virtual; + property Document : TDOMDocument read FDocument; + public + constructor Create(ADocument : TDOMDocument); + end; + + { TXsdGenerator } + + TXsdGenerator = class(TCustomXsdGenerator) + private + FSchemaNode : TDOMElement; + protected + function GetSchemaNode(ADocument : TDOMDocument) : TDOMNode;override; + procedure Prepare(ASymTable : TwstPasTreeContainer; AModule : TPasModule);override; + end; + + { TBaseTypeHandler } + + TBaseTypeHandler = class(TInterfacedObject,IXsdTypeHandler) + private + FOwner : Pointer; + protected + procedure Generate( + AContainer : TwstPasTreeContainer; + const ASymbol : TPasElement; + ADocument : TDOMDocument + );virtual;abstract; + function GetOwner() : IXsdGenerator; + class function CanHandle(ASymbol : TObject) : Boolean;virtual;abstract; + public + constructor Create(AOwner : IGenerator);virtual; + end; + + function GetNameSpaceShortName( + const ANameSpace : string; + ADocument : TDOMDocument + ):string; + + function GetXsdTypeHandlerRegistry():IXsdTypeHandlerRegistry;{$IFDEF USE_INLINE}inline;{$ENDIF} + function CreateElement(const ANodeName : DOMString; AParent : TDOMNode; ADoc : TDOMDocument):TDOMElement;{$IFDEF USE_INLINE}inline;{$ENDIF} + +implementation +uses xsd_consts, Contnrs, StrUtils; + +type + + { TXsdTypeHandlerRegistry } + + TXsdTypeHandlerRegistry = class(TInterfacedObject,IInterface,IXsdTypeHandlerRegistry) + private + FList : TClassList; + private + function FindIndexOfHandler(ASymbol : TPasElement) : Integer; + protected + function Find( + ASymbol : TPasElement; + Aowner : IGenerator; + out AHandler : IXsdTypeHandler + ) : Boolean; + procedure Register(AFactory : TBaseTypeHandlerClass); + public + constructor Create(); + destructor Destroy();override; + end; + + { TTypeDefinition_TypeHandler } + + TTypeDefinition_TypeHandler = class(TBaseTypeHandler) + protected + procedure Generate( + AContainer : TwstPasTreeContainer; + const ASymbol : TPasElement; + ADocument : TDOMDocument + );override; + class function CanHandle(ASymbol : TObject) : Boolean;override; + function GetSchemaNode(ADocument : TDOMDocument) : TDOMNode; + end; + + { TTypeAliasDefinition_TypeHandler } + + TTypeAliasDefinition_TypeHandler = class(TTypeDefinition_TypeHandler) + protected + procedure Generate( + AContainer : TwstPasTreeContainer; + const ASymbol : TPasElement; + ADocument : TDOMDocument + );override; + class function CanHandle(ASymbol : TObject) : Boolean;override; + end; + + { TEnumTypeHandler } + + TEnumTypeHandler = class(TTypeDefinition_TypeHandler) + protected + procedure Generate( + AContainer : TwstPasTreeContainer; + const ASymbol : TPasElement; + ADocument : TDOMDocument + );override; + class function CanHandle(ASymbol : TObject) : Boolean;override; + end; + + { TClassTypeDefinition_TypeHandler } + + TClassTypeDefinition_TypeHandler = class(TTypeDefinition_TypeHandler) + protected + procedure Generate( + AContainer : TwstPasTreeContainer; + const ASymbol : TPasElement; + ADocument : TDOMDocument + );override; + class function CanHandle(ASymbol : TObject) : Boolean;override; + end; + + { TPasRecordType_TypeHandler } + + TPasRecordType_TypeHandler = class(TTypeDefinition_TypeHandler) + protected + procedure Generate( + AContainer : TwstPasTreeContainer; + const ASymbol : TPasElement; + ADocument : TDOMDocument + );override; + class function CanHandle(ASymbol : TObject) : Boolean;override; + end; + + { TBaseArrayRemotable_TypeHandler } + + TBaseArrayRemotable_TypeHandler = class(TTypeDefinition_TypeHandler) + protected + procedure Generate( + AContainer : TwstPasTreeContainer; + const ASymbol : TPasElement; + ADocument : TDOMDocument + );override; + class function CanHandle(ASymbol : TObject) : Boolean;override; + end; + +var + XsdTypeHandlerRegistryInst : IXsdTypeHandlerRegistry = nil; +function GetXsdTypeHandlerRegistry():IXsdTypeHandlerRegistry; +begin + Result := XsdTypeHandlerRegistryInst; +end; + +procedure RegisterFondamentalTypes(); +var + r : IXsdTypeHandlerRegistry; +begin + r := GetXsdTypeHandlerRegistry(); + r.Register(TEnumTypeHandler); + r.Register(TClassTypeDefinition_TypeHandler); + r.Register(TPasRecordType_TypeHandler); + r.Register(TBaseArrayRemotable_TypeHandler); + r.Register(TTypeAliasDefinition_TypeHandler); +end; + +function GetTypeNameSpace( + AContainer : TwstPasTreeContainer; + AType : TPasElement +) : string; +var + locElt : TPasElement; +begin + Result := ''; + locElt := AType; + if ( locElt <> nil ) then begin + if locElt.InheritsFrom(TPasUnresolvedTypeRef) then + locElt := AContainer.FindElement(AContainer.GetExternalName(locElt)); + if ( locElt <> nil ) and + ( not locElt.InheritsFrom(TPasUnresolvedTypeRef) ) and + //locElt.InheritsFrom(TPasType) and + ( locElt.Parent <> nil ) and + ( locElt.Parent.Parent <> nil ) + then begin + Result := AContainer.GetExternalName(locElt.Parent.Parent); + end; + end; + Result := Trim(Result); + if ( Length(Result) = 0 ) then + Result := AContainer.GetExternalName(AContainer.CurrentModule); +end; + +function FindAttributeByValueInNode( + const AAttValue : string; + const ANode : TDOMNode; + out AResAtt : string; + const AStartIndex : Integer = 0; + const AStartingWith : string = '' +):boolean; +var + i,c : Integer; + b : Boolean; +begin + AResAtt := ''; + if Assigned(ANode) and Assigned(ANode.Attributes) then begin + b := ( Length(AStartingWith) = 0); + c := Pred(ANode.Attributes.Length); + if ( AStartIndex >= 0 ) then + i := AStartIndex; + for i := 0 to c do begin + if AnsiSameText(AAttValue,ANode.Attributes.Item[i].NodeValue) and + ( b or ( Pos(AStartingWith,ANode.Attributes.Item[i].NodeName) = 1 )) + then begin + AResAtt := ANode.Attributes.Item[i].NodeName; + Result := True; + Exit; + end; + end; + end; + Result := False; +end; + +function GetNameSpaceShortName( + const ANameSpace : string; + ADocument : TDOMDocument +):string; +begin + if FindAttributeByValueInNode(ANameSpace,ADocument.DocumentElement,Result,0, s_xmlns) then begin + Result := Copy(Result,Length(s_xmlns+':')+1,MaxInt); + end else begin + Result := Format('ns%d',[GetNodeListCount(ADocument.DocumentElement.Attributes)]) ; + ADocument.DocumentElement.SetAttribute(Format('%s:%s',[s_xmlns,Result]),ANameSpace); + end; +end; + +function CreateElement(const ANodeName : DOMString; AParent : TDOMNode; ADoc : TDOMDocument):TDOMElement;//inline; +begin + Result := ADoc.CreateElement(ANodeName); + AParent.AppendChild(Result); +end; + +{ TWsdlTypeHandlerRegistry } + +function TXsdTypeHandlerRegistry.FindIndexOfHandler(ASymbol: TPasElement): Integer; +Var + i, c : Integer; +begin + Result := -1; + c := FList.Count; + for i := 0 to Pred(c) do begin + if TBaseTypeHandlerClass(FList[i]).CanHandle(ASymbol) then begin + Result := i; + Break; + end; + end; +end; + +function TXsdTypeHandlerRegistry.Find( + ASymbol : TPasElement; + Aowner : IGenerator; + out AHandler : IXsdTypeHandler +) : Boolean; +var + fct : TBaseTypeHandlerClass; + i : Integer; +begin + i := FindIndexOfHandler(ASymbol); + Result := ( i >= 0 ); + if Result then begin + fct := TBaseTypeHandlerClass(FList[i]); + AHandler := fct.Create(Aowner) as IXsdTypeHandler; + end; +end; + +procedure TXsdTypeHandlerRegistry.Register(AFactory: TBaseTypeHandlerClass); +begin + if ( FList.IndexOf(AFactory) = -1 ) then begin + FList.Add(AFactory); + end; +end; + +constructor TXsdTypeHandlerRegistry.Create(); +begin + FList := TClassList.Create(); +end; + +destructor TXsdTypeHandlerRegistry.Destroy(); +begin + FreeAndNil(FList); + inherited Destroy(); +end; + +{ TBaseTypeHandler } + +function TBaseTypeHandler.GetOwner(): IXsdGenerator; +begin + Result := IXsdGenerator(FOwner); +end; + +constructor TBaseTypeHandler.Create(AOwner: IGenerator); +begin + Assert(Assigned(AOwner)); + FOwner := Pointer(AOwner); +end; + +{ TTypeDefinition_TypeHandler } + +procedure TTypeDefinition_TypeHandler.Generate( + AContainer : TwstPasTreeContainer; + const ASymbol: TPasElement; + ADocument: TDOMDocument +); +begin + Assert(ASymbol.InheritsFrom(TPasType)); +end; + +class function TTypeDefinition_TypeHandler.CanHandle(ASymbol: TObject): Boolean; +begin + Result := Assigned(ASymbol) and ASymbol.InheritsFrom(TPasType); +end; + +function TTypeDefinition_TypeHandler.GetSchemaNode(ADocument : TDOMDocument) : TDOMNode; +begin + Result := GetOwner().GetSchemaNode(ADocument); +end; + +{ TTypeAliasDefinition_TypeHandler } + +procedure TTypeAliasDefinition_TypeHandler.Generate( + AContainer : TwstPasTreeContainer; + const ASymbol: TPasElement; + ADocument: TDOMDocument +); +var + typItm : TPasAliasType; + ns_shortName, s : string; + defSchemaNode, resNode : TDOMElement; + unitExternalName, baseUnitExternalName : string; +begin + inherited; + typItm := ASymbol as TPasAliasType; + if Assigned(typItm) then begin + unitExternalName := GetTypeNameSpace(AContainer,ASymbol); + if FindAttributeByValueInNode(unitExternalName,ADocument.DocumentElement,ns_shortName) then begin + ns_shortName := Copy(ns_shortName,Length(s_xmlns+':')+1,MaxInt); + end else begin + ns_shortName := Format('ns%d',[GetNodeListCount(ADocument.DocumentElement.Attributes)]) ; + ADocument.DocumentElement.SetAttribute(Format('%s:%s',[s_xmlns,ns_shortName]),unitExternalName); + end; + defSchemaNode := GetSchemaNode(ADocument) as TDOMElement; + + s := Format('%s:%s',[s_xs_short,s_element]); + resNode := CreateElement(s,defSchemaNode,ADocument); + resNode.SetAttribute(s_name, AContainer.GetExternalName(typItm)) ; + + baseUnitExternalName := GetTypeNameSpace(AContainer,typItm.DestType); + s := GetNameSpaceShortName(baseUnitExternalName,ADocument); + s := Format('%s:%s',[s,AContainer.GetExternalName(typItm.DestType)]); + resNode.SetAttribute(s_type,s) ; + end; +end; + +class function TTypeAliasDefinition_TypeHandler.CanHandle(ASymbol: TObject): Boolean; +begin + Result := Assigned(ASymbol) and ASymbol.InheritsFrom(TPasAliasType); +end; + +{ TEnumTypeHandler } + +procedure TEnumTypeHandler.Generate( + AContainer : TwstPasTreeContainer; + const ASymbol : TPasElement; + ADocument : TDOMDocument +); +var + typItm : TPasEnumType; + ns_shortName, s : string; + defSchemaNode, resNode, restrictNode : TDOMElement; + i, c : Integer; + unitExternalName : string; +begin + typItm := ASymbol as TPasEnumType; + if Assigned(typItm) then begin + unitExternalName := GetTypeNameSpace(AContainer,ASymbol); + if FindAttributeByValueInNode(unitExternalName,ADocument.DocumentElement,ns_shortName) then begin + ns_shortName := Copy(ns_shortName,Length(s_xmlns+':')+1,MaxInt); + end else begin + ns_shortName := Format('ns%d',[GetNodeListCount(ADocument.DocumentElement.Attributes)]) ; + ADocument.DocumentElement.SetAttribute(Format('%s:%s',[s_xmlns,ns_shortName]),unitExternalName); + end; + defSchemaNode := GetSchemaNode(ADocument) as TDOMElement; + + s := Format('%s:%s',[s_xs_short,s_simpleType]); + resNode := CreateElement(s,defSchemaNode,ADocument); + resNode.SetAttribute(s_name, AContainer.GetExternalName(typItm)) ; + s := Format('%s:%s',[s_xs_short,s_restriction]); + restrictNode := CreateElement(s,resNode,ADocument); + restrictNode.SetAttribute(s_base,Format('%s:%s',[s_xs_short,'string'])) ; + c := typItm.Values.Count; + for i := 0 to pred(c) do begin + s := Format('%s:%s',[s_xs_short,s_enumeration]); + CreateElement(s,restrictNode,ADocument).SetAttribute( + s_value, + AContainer.GetExternalName(TPasEnumValue(typItm.Values[i])) + ); + end; + end; +end; + +class function TEnumTypeHandler.CanHandle(ASymbol: TObject): Boolean; +begin + Result := inherited CanHandle(ASymbol) and ASymbol.InheritsFrom(TPasEnumType); +end; + +{ TClassTypeDefinition_TypeHandler } +type TTypeCategory = ( tcComplexContent, tcSimpleContent ); +procedure TClassTypeDefinition_TypeHandler.Generate( + AContainer : TwstPasTreeContainer; + const ASymbol : TPasElement; + ADocument : TDOMDocument +); +var + cplxNode : TDOMElement; + typItm : TPasClassType; + propTypItm : TPasType; + s, prop_ns_shortName : string; + defSchemaNode, sqcNode, propNode, derivationNode : TDOMElement; + i : Integer; + p : TPasProperty; + typeCategory : TTypeCategory; + hasSequence : Boolean; + trueParent : TPasType; +begin + inherited; + typItm := ASymbol as TPasClassType; + if Assigned(typItm) then begin + GetNameSpaceShortName(AContainer.GetExternalName(AContainer.CurrentModule) ,ADocument); + defSchemaNode := GetSchemaNode(ADocument) as TDOMElement; + + s := Format('%s:%s',[s_xs_short,s_complexType]); + cplxNode := CreateElement(s,defSchemaNode,ADocument); + cplxNode.SetAttribute(s_name, AContainer.GetExternalName(typItm)) ; + + typeCategory := tcComplexContent; + derivationNode := nil; + hasSequence := True; + if Assigned(typItm.AncestorType) then begin + trueParent := typItm.AncestorType; + + if trueParent.InheritsFrom(TPasNativeClassType) and AnsiSameText('THeaderBlock',trueParent.Name) then begin + cplxNode.SetAttribute(s_WST_headerBlock,'true'); + end; + + if trueParent.InheritsFrom(TPasAliasType) then begin + trueParent := GetUltimeType(trueParent); + end; + if trueParent.InheritsFrom(TPasNativeSimpleContentClassType) or + trueParent.InheritsFrom(TPasNativeSimpleType) + then begin + typeCategory := tcSimpleContent; + derivationNode := CreateElement(Format('%s:%s',[s_xs_short,s_extension]),cplxNode,ADocument); + s := Trim(GetNameSpaceShortName(GetTypeNameSpace(AContainer,trueParent),ADocument)); + if ( Length(s) > 0 ) then begin + s := s + ':'; + end; + s := s + AContainer.GetExternalName(trueParent); + derivationNode.SetAttribute(s_base,s); + hasSequence := False; + end; + end; + for i := 0 to Pred(typItm.Members.Count) do begin + if TPasElement(typItm.Members[i]).InheritsFrom(TPasProperty) then begin + p := TPasProperty(typItm.Members[i]); + if not AContainer.IsAttributeProperty(p) then begin + if ( typeCategory = tcSimpleContent ) then begin + raise EXsdGeneratorException.CreateFmt('Invalid type definition, a simple type cannot have "not attribute" properties : "%s"',[AContainer.GetExternalName(ASymbol)]); + end; + end; + hasSequence := True; + end; + end; + if hasSequence then begin + s := Format('%s:%s',[s_xs_short,s_sequence]); + if Assigned(derivationNode) then begin + sqcNode := CreateElement(s,derivationNode,ADocument); + end else begin + sqcNode := CreateElement(s,cplxNode,ADocument); + end; + end else begin + sqcNode := nil; + end; + + + for i := 0 to Pred(typItm.Members.Count) do begin + if TPasElement(typItm.Members[i]).InheritsFrom(TPasProperty) then begin + p := TPasProperty(typItm.Members[i]); + if AnsiSameText('Has',Copy(p.StoredAccessorName,1,3)) or AnsiSameText('True',p.StoredAccessorName) then begin + if AContainer.IsAttributeProperty(p) then begin + s := Format('%s:%s',[s_xs_short,s_attribute]); + if Assigned(derivationNode) then + propNode := CreateElement(s,derivationNode,ADocument) + else + propNode := CreateElement(s,cplxNode,ADocument); + end else begin + s := Format('%s:%s',[s_xs_short,s_element]); + propNode := CreateElement(s,sqcNode,ADocument); + end; + propNode.SetAttribute(s_name,AContainer.GetExternalName(p)); + propTypItm := p.VarType; + if Assigned(propTypItm) then begin + prop_ns_shortName := GetNameSpaceShortName(GetTypeNameSpace(AContainer,propTypItm),ADocument); + propNode.SetAttribute(s_type,Format('%s:%s',[prop_ns_shortName,AContainer.GetExternalName(propTypItm)])); + if AContainer.IsAttributeProperty(p) then begin + if AnsiSameText('Has',Copy(p.StoredAccessorName,1,3)) then + propNode.SetAttribute(s_use,'optional') + else + propNode.SetAttribute(s_use,'required'); + end else begin + if AnsiSameText('Has',Copy(p.StoredAccessorName,1,3)) then + propNode.SetAttribute(s_minOccurs,'0') + else + propNode.SetAttribute(s_minOccurs,'1'); + propNode.SetAttribute(s_maxOccurs,'1'); + end; + end; + end; + end; + end; + end; +end; + +class function TClassTypeDefinition_TypeHandler.CanHandle(ASymbol: TObject): Boolean; +begin + Result := inherited CanHandle(ASymbol) and + ( ASymbol.InheritsFrom(TPasClassType) and ( TPasClassType(ASymbol).ObjKind = okClass )); +end; + +{ TPasRecordType_TypeHandler } + +procedure TPasRecordType_TypeHandler.Generate( + AContainer : TwstPasTreeContainer; + const ASymbol : TPasElement; + ADocument : TDOMDocument +); +var + cplxNode : TDOMElement; + typItm : TPasRecordType; + propTypItm : TPasType; + s, prop_ns_shortName : string; + defSchemaNode, sqcNode, propNode : TDOMElement; + i : Integer; + p : TPasVariable; + hasSequence : Boolean; + storeOption : string; +begin + inherited; + typItm := ASymbol as TPasRecordType; + if Assigned(typItm) then begin + GetNameSpaceShortName(AContainer.GetExternalName(AContainer.CurrentModule) ,ADocument); + defSchemaNode := GetSchemaNode(ADocument) as TDOMElement; + + s := Format('%s:%s',[s_xs_short,s_complexType]); + cplxNode := CreateElement(s,defSchemaNode,ADocument); + cplxNode.SetAttribute(s_name, AContainer.GetExternalName(typItm)) ; + + cplxNode.SetAttribute(s_WST_record,'true'); + + hasSequence := False; + for i := 0 to Pred(typItm.Members.Count) do begin + if TPasElement(typItm.Members[i]).InheritsFrom(TPasVariable) then begin + p := TPasVariable(typItm.Members[i]); + if not AContainer.IsAttributeProperty(p) then begin + hasSequence := True; + Break; + end; + end; + end; + if hasSequence then begin + s := Format('%s:%s',[s_xs_short,s_sequence]); + sqcNode := CreateElement(s,cplxNode,ADocument); + end else begin + sqcNode := nil; + end; + + + for i := 0 to Pred(typItm.Members.Count) do begin + if TPasElement(typItm.Members[i]).InheritsFrom(TPasVariable) then begin + p := TPasVariable(typItm.Members[i]); + if AContainer.IsAttributeProperty(p) then begin + s := Format('%s:%s',[s_xs_short,s_attribute]); + propNode := CreateElement(s,cplxNode,ADocument); + end else begin + s := Format('%s:%s',[s_xs_short,s_element]); + propNode := CreateElement(s,sqcNode,ADocument); + end; + propNode.SetAttribute(s_name,AContainer.GetExternalName(p)); + propTypItm := p.VarType; + if Assigned(propTypItm) then begin + prop_ns_shortName := GetNameSpaceShortName(GetTypeNameSpace(AContainer,propTypItm),ADocument); + propNode.SetAttribute(s_type,Format('%s:%s',[prop_ns_shortName,AContainer.GetExternalName(propTypItm)])); + storeOption := Trim(AContainer.Properties.GetValue(p,s_WST_storeType)); + if AContainer.IsAttributeProperty(p) then begin + if ( Length(storeOption) > 0 ) then begin + case AnsiIndexText(storeOption,[s_required,s_optional,s_prohibited]) of + 0 : propNode.SetAttribute(s_use,storeOption); + 1 : ; + 2 : propNode.SetAttribute(s_use,storeOption); + else + raise EXsdGeneratorException.CreateFmt('Invalid attribute "%s" value : "%s".',[s_use,storeOption]); + end; + end; + end else begin + case AnsiIndexText(storeOption,[s_required,s_optional,s_prohibited]) of + 0 : ;//propNode.SetAttribute(s_minOccurs,'1'); + 1 : propNode.SetAttribute(s_minOccurs,'0'); + end; + //propNode.SetAttribute(s_maxOccurs,'1'); + end; + end; + end; + end; + end; +end; + +class function TPasRecordType_TypeHandler.CanHandle(ASymbol : TObject) : Boolean; +begin + Result := inherited CanHandle(ASymbol) and ASymbol.InheritsFrom(TPasRecordType); +end; + +{ TBaseArrayRemotable_TypeHandler } + +procedure TBaseArrayRemotable_TypeHandler.Generate( + AContainer : TwstPasTreeContainer; + const ASymbol : TPasElement; + ADocument : TDOMDocument +); + + function GetNameSpaceShortName(const ANameSpace : string):string;//inline; + begin + if FindAttributeByValueInNode(ANameSpace,ADocument.DocumentElement,Result,0,s_xmlns) then begin + Result := Copy(Result,Length(s_xmlns+':')+1,MaxInt); + end else begin + Result := Format('ns%d',[GetNodeListCount(ADocument.DocumentElement.Attributes)]) ; + ADocument.DocumentElement.SetAttribute(Format('%s:%s',[s_xmlns,Result]),ANameSpace); + end; + end; + +var + typItm : TPasArrayType; + propTypItm : TPasType; + s, prop_ns_shortName : string; + defSchemaNode, cplxNode, sqcNode, propNode : TDOMElement; + unitExternalName : string; +begin + inherited; + typItm := ASymbol as TPasArrayType; + if not Assigned(typItm) then + Exit; + if Assigned(typItm) then begin + unitExternalName := GetTypeNameSpace(AContainer,typItm); + GetNameSpaceShortName(unitExternalName); + defSchemaNode := GetSchemaNode(ADocument) as TDOMElement; + + s := Format('%s:%s',[s_xs_short,s_complexType]); + cplxNode := CreateElement(s,defSchemaNode,ADocument); + cplxNode.SetAttribute(s_name, AContainer.GetExternalName(typItm)) ; + + s := Format('%s:%s',[s_xs_short,s_sequence]); + sqcNode := CreateElement(s,cplxNode,ADocument); + propTypItm := typItm.ElType; + s := Format('%s:%s',[s_xs_short,s_element]); + propNode := CreateElement(s,sqcNode,ADocument); + propNode.SetAttribute(s_name,s_item); + if Assigned(propTypItm) then begin + prop_ns_shortName := GetNameSpaceShortName(GetTypeNameSpace(AContainer,propTypItm));// AContainer.GetExternalName(propTypItm.Parent.Parent)); + propNode.SetAttribute(s_type,Format('%s:%s',[prop_ns_shortName,AContainer.GetExternalName(propTypItm)])); + propNode.SetAttribute(s_minOccurs,'0'); + propNode.SetAttribute(s_maxOccurs,s_unbounded); + end; + end; +end; + +class function TBaseArrayRemotable_TypeHandler.CanHandle(ASymbol: TObject): Boolean; +begin + Result := inherited CanHandle(ASymbol) and ASymbol.InheritsFrom(TPasArrayType); +end; + +{ TCustomXsdGenerator } + +procedure TCustomXsdGenerator.Execute( + ASymTable : TwstPasTreeContainer; + AModuleName : string +); +var + j, k : Integer; + tri : TPasElement; + g : IXsdTypeHandler; + gr : IXsdTypeHandlerRegistry; + typeList : TList; + mdl : TPasModule; +begin + if ( ASymTable = nil ) then + raise EXsdGeneratorException.Create('Invalid symbol table.'); + mdl := ASymTable.FindModule(AModuleName); + if ( mdl = nil ) then + raise EXsdGeneratorException.CreateFmt('Unable to find module : "%s".',[AModuleName]); + Prepare(ASymTable,mdl); + gr := GetXsdTypeHandlerRegistry(); + typeList := mdl.InterfaceSection.Declarations; + k := typeList.Count; + for j := 0 to Pred(k) do begin + tri := TPasElement(typeList[j]); + if tri.InheritsFrom(TPasType) and + ( not tri.InheritsFrom(TPasNativeClassType) ) and + ( not tri.InheritsFrom(TPasNativeSimpleType) ) + then begin + if gr.Find(tri,Self,g) then + g.Generate(ASymTable,tri,Self.Document); + end; + end; +end; + +procedure TCustomXsdGenerator.Prepare(ASymTable : TwstPasTreeContainer; AModule : TPasModule); +begin + +end; + +constructor TCustomXsdGenerator.Create(ADocument : TDOMDocument); +begin + if ( ADocument = nil ) then + raise EXsdGeneratorException.Create('Invalid document.'); + FDocument := ADocument; +end; + +{ TXsdGenerator } + +function TXsdGenerator.GetSchemaNode(ADocument : TDOMDocument) : TDOMNode; +begin + Result := FSchemaNode; +end; + +procedure TXsdGenerator.Prepare(ASymTable : TwstPasTreeContainer; AModule : TPasModule); +var + unitExternalName : string; +begin + inherited Prepare(ASymTable, AModule); + unitExternalName := ASymTable.GetExternalName(AModule); + FSchemaNode := CreateElement(s_schema,Document,Document); + FSchemaNode.SetAttribute(s_targetNamespace,unitExternalName); + FSchemaNode.SetAttribute(Format('%s:%s',[s_xmlns,s_xs_short]),s_xs); + FSchemaNode.SetAttribute(Format('%s:%s',[s_xmlns,s_tns]),unitExternalName); +end; + +initialization + XsdTypeHandlerRegistryInst := TXsdTypeHandlerRegistry.Create() as IXsdTypeHandlerRegistry; + RegisterFondamentalTypes(); + +finalization + XsdTypeHandlerRegistryInst := nil; + +end. diff --git a/wst/trunk/ws_helper/xsd_parser.pas b/wst/trunk/ws_helper/xsd_parser.pas index 51ac9335d..6956a5a34 100644 --- a/wst/trunk/ws_helper/xsd_parser.pas +++ b/wst/trunk/ws_helper/xsd_parser.pas @@ -120,7 +120,7 @@ type end; implementation -uses ws_parser_imp, dom_cursors, parserutils, StrUtils +uses ws_parser_imp, dom_cursors, parserutils, StrUtils, xsd_consts {$IFDEF FPC} ,wst_fpc_xml {$ENDIF}