You've already forked lazarus-ccr
defaultElementForm, defaultAttributeForm : Runtime WSDL/XSD generation.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4233 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -67,6 +67,7 @@ type
|
||||
RootAddress : ShortString;
|
||||
ServicesCount : Word;
|
||||
Services : PService;
|
||||
Properties : PPropertyData;
|
||||
end;
|
||||
|
||||
IModuleMetadataMngr = interface
|
||||
@ -75,6 +76,11 @@ type
|
||||
function GetCount():Integer;
|
||||
function GetRepositoryName(const AIndex : Integer):shortstring;
|
||||
procedure SetRepositoryNameSpace(const ARepName,ANameSpace : shortstring);
|
||||
procedure SetRepositoryCustomData(
|
||||
const ARepName : shortstring;
|
||||
const ADataName,
|
||||
AData : string
|
||||
);
|
||||
function LoadRepositoryName(
|
||||
const ARepName,ARootAddress : shortstring;
|
||||
out ARepository : PServiceRepository
|
||||
@ -316,6 +322,8 @@ begin
|
||||
end;
|
||||
Freemem(ARepository^.Services, c * SizeOf(TService) );
|
||||
end;
|
||||
if (ARepository^.Properties <> nil) then
|
||||
ClearProperties(ARepository^.Properties);
|
||||
Freemem(ARepository,SizeOf(TServiceRepository));
|
||||
ARepository := nil;
|
||||
end;
|
||||
@ -493,6 +501,7 @@ begin
|
||||
ADest^.Name := ASource^.Name;
|
||||
ADest^.NameSpace := ASource^.NameSpace;
|
||||
ADest^.RootAddress := ASource^.RootAddress;
|
||||
ADest^.Properties := CloneProperties(ASource^.Properties);
|
||||
c := ASource^.ServicesCount;
|
||||
if ( c > 0 ) then begin
|
||||
ADest^.Services := wst_GetMem( c * SizeOf(TService) );
|
||||
@ -531,6 +540,11 @@ type
|
||||
function GetCount():Integer;
|
||||
function GetRepositoryName(const AIndex : Integer):shortstring;
|
||||
procedure SetRepositoryNameSpace(const ARepName,ANameSpace : shortstring);
|
||||
procedure SetRepositoryCustomData(
|
||||
const ARepName : shortstring;
|
||||
const ADataName,
|
||||
AData : string
|
||||
);
|
||||
function LoadRepositoryName(
|
||||
const ARepName,ARootAddress : shortstring;
|
||||
out ARepository : PServiceRepository
|
||||
@ -673,6 +687,23 @@ begin
|
||||
FRepositories[i]^.NameSpace := ANameSpace;
|
||||
end;
|
||||
|
||||
procedure TModuleMetadataMngr.SetRepositoryCustomData(
|
||||
const ARepName : shortstring;
|
||||
const ADataName,
|
||||
AData : string
|
||||
);
|
||||
var
|
||||
i : Integer;
|
||||
rp : PServiceRepository;
|
||||
sp : PService;
|
||||
begin
|
||||
i := FindInnerListIndex(ARepName);
|
||||
if (i < 0) then
|
||||
i := InternalLoadRepository(ARepName);
|
||||
rp := FRepositories[i];
|
||||
Add(rp^.Properties,ADataName,AData);
|
||||
end;
|
||||
|
||||
function TModuleMetadataMngr.LoadRepositoryName(
|
||||
const ARepName,ARootAddress : shortstring;
|
||||
out ARepository : PServiceRepository
|
||||
|
@ -178,6 +178,9 @@ const
|
||||
sFORMAT_Input_EncodingStyle = 'FORMAT_Input_EncodingStyle';
|
||||
sFORMAT_Input_EncodingStyleURI = 'FORMAT_Input_EncodingStyleURI';
|
||||
|
||||
sFORM_attributeFormDefault = 'attributeFormDefault';
|
||||
sFORM_elementFormDefault = 'elementFormDefault';
|
||||
|
||||
var
|
||||
WsdlTypeHandlerRegistryInst : IWsdlTypeHandlerRegistry;
|
||||
|
||||
@ -596,6 +599,7 @@ var
|
||||
defNode, typesNode, schNode : TDOMElement;
|
||||
i, c : Integer;
|
||||
ps : PService;
|
||||
propData : PPropertyData;
|
||||
begin
|
||||
if not ( Assigned(AMdtdRep) and Assigned(ADoc)) then
|
||||
Exit;
|
||||
@ -605,6 +609,12 @@ begin
|
||||
schNode := CreateElement(sXSD + ':' + sWSDL_SCHEMA,typesNode,ADoc);
|
||||
schNode.SetAttribute(sXMLNS,sXSD_NS);
|
||||
schNode.SetAttribute(sWSDL_TARGET_NS,AMdtdRep^.NameSpace);
|
||||
propData := Find(AMdtdRep^.Properties,sFORM_elementFormDefault);
|
||||
if (propData <> nil) and (propData^.Data <> '') then
|
||||
schNode.SetAttribute(sFORM_elementFormDefault,Trim(propData^.Data));
|
||||
propData := Find(AMdtdRep^.Properties,sFORM_attributeFormDefault);
|
||||
if (propData <> nil) and (propData^.Data <> '') then
|
||||
schNode.SetAttribute(sFORM_attributeFormDefault,Trim(propData^.Data));
|
||||
|
||||
GenerateServiceTypes();
|
||||
|
||||
|
@ -2981,6 +2981,7 @@ procedure TInftGenerator.GenerateCustomMetadatas();
|
||||
|
||||
var
|
||||
i : Integer;
|
||||
s : string;
|
||||
begin
|
||||
SetCurrentStream(FImpStream);
|
||||
IncIndent();
|
||||
@ -2992,6 +2993,12 @@ begin
|
||||
WriteLn('begin');
|
||||
Indent();WriteLn('mm := GetModuleMetadataMngr();');
|
||||
Indent();WriteLn('mm.SetRepositoryNameSpace(%s, %s);',[sUNIT_NAME,sNAME_SPACE]);
|
||||
s := Trim(SymbolTable.Properties.GetValue(SymbolTable.CurrentModule,s_elementFormDefault));
|
||||
if (s <> '') then
|
||||
Indent();WriteLn('mm.SetRepositoryCustomData(%s, %s, %s);',[sUNIT_NAME,QuotedStr(s_elementFormDefault),QuotedStr(s)]);
|
||||
s := Trim(SymbolTable.Properties.GetValue(SymbolTable.CurrentModule,s_attributeFormDefault));
|
||||
if (s <> '') then
|
||||
Indent();WriteLn('mm.SetRepositoryCustomData(%s, %s, %s);',[sUNIT_NAME,QuotedStr(s_attributeFormDefault),QuotedStr(s)]);
|
||||
for i := 0 to Pred(SymbolTable.BindingCount) do begin
|
||||
WriteServiceDatas(SymbolTable.Binding[i]);
|
||||
end;
|
||||
|
Reference in New Issue
Block a user