Delphi compatibility fix ( node filtering )

Add Delphi amazon sample

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@239 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2007-08-13 18:12:23 +00:00
parent 1b7b1d4349
commit 65dab20c6f
7 changed files with 417 additions and 149 deletions

View File

@ -0,0 +1,43 @@
-$A8
-$B-
-$C+
-$D+
-$E-
-$F-
-$G+
-$H+
-$I+
-$J-
-$K-
-$L+
-$M-
-$N+
-$O+
-$P+
-$Q-
-$R-
-$S-
-$T-
-$U-
-$V+
-$W-
-$X+
-$YD
-$Z1
-cg
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
-H+
-W+
-M
-$M16384,1048576
-K$00400000
-N"obj"
-LE"c:\program files\borland\delphi7\Projects\Bpl"
-LN"c:\program files\borland\delphi7\Projects\Bpl"
-U"..\..\;..\..\..\;C:\Program Files\Borland\Delphi7\plate_forme\synapse"
-O"..\..\;..\..\..\;C:\Program Files\Borland\Delphi7\plate_forme\synapse"
-I"..\..\;..\..\..\;C:\Program Files\Borland\Delphi7\plate_forme\synapse"
-R"..\..\;..\..\..\;C:\Program Files\Borland\Delphi7\plate_forme\synapse"
-w-UNSAFE_TYPE
-w-UNSAFE_CODE
-w-UNSAFE_CAST

View File

@ -0,0 +1,159 @@
[FileVersion]
Version=7.0
[Compiler]
A=8
B=0
C=1
D=1
E=0
F=0
G=1
H=1
I=1
J=0
K=0
L=1
M=0
N=1
O=1
P=1
Q=0
R=0
S=0
T=0
U=0
V=1
W=0
X=1
Y=1
Z=1
ShowHints=1
ShowWarnings=1
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
NamespacePrefix=
SymbolDeprecated=1
SymbolLibrary=1
SymbolPlatform=1
UnitLibrary=1
UnitPlatform=1
UnitDeprecated=1
HResultCompat=1
HidingMember=1
HiddenVirtual=1
Garbage=1
BoundsError=1
ZeroNilCompat=1
StringConstTruncated=1
ForLoopVarVarPar=1
TypedConstVarPar=1
AsgToTypedConst=1
CaseLabelRange=1
ForVariable=1
ConstructingAbstract=1
ComparisonFalse=1
ComparisonTrue=1
ComparingSignedUnsigned=1
CombiningSignedUnsigned=1
UnsupportedConstruct=1
FileOpen=1
FileOpenUnitSrc=1
BadGlobalSymbol=1
DuplicateConstructorDestructor=1
InvalidDirective=1
PackageNoLink=1
PackageThreadVar=1
ImplicitImport=1
HPPEMITIgnored=1
NoRetVal=1
UseBeforeDef=1
ForLoopVarUndef=1
UnitNameMismatch=1
NoCFGFileFound=1
MessageDirective=1
ImplicitVariants=1
UnicodeToLocale=1
LocaleToUnicode=1
ImagebaseMultiple=1
SuspiciousTypecast=1
PrivatePropAccessor=1
UnsafeType=0
UnsafeCode=0
UnsafeCast=0
[Linker]
MapFile=0
OutputObjs=0
ConsoleApp=1
DebugInfo=0
RemoteSymbols=0
MinStackSize=16384
MaxStackSize=1048576
ImageBase=4194304
ExeDescription=
[Directories]
OutputDir=
UnitOutputDir=obj
PackageDLLOutputDir=
PackageDCPOutputDir=
SearchPath=..\..\;..\..\..\;C:\Program Files\Borland\Delphi7\plate_forme\synapse
Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;FIBDBMidas7;Jcl;JclVcl;JvCoreD7R;JvSystemD7R;JvStdCtrlsD7R;JvAppFrmD7R;JvBandsD7R;JvDBD7R;JvDlgsD7R;JvBDED7R;JvCmpD7R;JvCryptD7R;JvCtrlsD7R;JvCustomD7R;JvDockingD7R;JvDotNetCtrlsD7R;JvEDID7R;JvGlobusD7R;JvHMID7R;JvInterpreterD7R;JvJansD7R;JvManagedThreadsD7R;JvMMD7R;JvNetD7R;JvPageCompsD7R;JvPluginD7R;JvPrintPreviewD7R;JvRuntimeDesignD7R;JvTimeFrameworkD7R;JvUIBD7R;JvValidatorsD7R;JvWizardD7R;JvXPCtrlsD7R;dxForumLibD7;cxLibraryVCLD7;cxPageControlVCLD7;dxBarD7;dxComnD7;dxBarDBNavD7;dxBarExtItemsD7;dxBarExtDBItemsD7;dxsbD7;dxmdsD7;dxdbtrD7;dxtrmdD7;dxorgcD7;dxdborD7;dxEdtrD7;EQTLD7;ECQDBCD7;EQDBTLD7;EQGridD7;dxGrEdD7;dxExELD7;dxELibD7;cxEditorsVCLD7;cxGridVCLD7;dxThemeD7;cxDataD7;cxGridUtilsVCLD7;dxPSCoreD7;dxPsPrVwAdvD7;dxPSLnksD7;dxPSTeeChartD7;dxPSDBTeeChartD7;dxPSdxDBTVLnkD7;dxPSdxOCLnkD7;dxPSdxDBOCLnkD7;dxPScxGridLnkD7;dxPSTLLnkD7;qrpt
Conditionals=
DebugSourceDirs=
UsePackages=0
[Parameters]
RunParams=
HostApplication=
Launcher=
UseLauncher=0
DebugCWD=
[Language]
ActiveLang=
ProjectLang=
RootDir=C:\Program Files\Borland\Delphi7\Bin\
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1036
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
[Excluded Packages]
C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxDBTLLnkD7.bpl=ExpressPrinting System ReportLink for ExpressQuantumDBTreeList by Developer Express Inc.
C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxDBGrLnkD7.bpl=ExpressPrinting System ReportLink for ExpressQuantumGrid by Developer Express Inc.
C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxInsLnkD7.bpl=ExpressPrinting System ReportLink for ExpressInspector by Developer Express Inc.
C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxOILnkD7.bpl=ExpressPrinting System ReportLink for ExpressRTTIInspector by Developer Express Inc.
C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxMVLnkD7.bpl=ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc.
C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxFCLnkD7.bpl=ExpressPrinting System ReportLinks for ExpressFlowChart by Developer Express Inc.
C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPScxSSLnkD7.bpl=ExpressPrinting System ReportLink for ExpressSpreadSheet by Developer Express Inc.
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
Count=7
Item0=..\..\;..\..\..\;C:\Program Files\Borland\Delphi7\plate_forme\synapse
Item1=..\..\;..\..\..\;C:\Program Files\Borland\Delphi7\plate_forme\synapse;..\
Item2=..\..\;..\..\..\
Item3=..\..\
Item4=$(DELPHI)\Lib\Debug;C:\PROGRA~1\Borland\Delphi7\MyTools\JVCL\3.20\jcl\lib\d7\debug;..\..\;..\..\..\;C:\Program Files\Borland\Delphi7\plate_forme\synapse;..\..\..\..\
Item5=..\..\;..\..\..\;C:\Program Files\Borland\Delphi7\plate_forme\synapse;..\..\..\..\
Item6=..\
[HistoryLists\hlUnitOutputDirectory]
Count=1
Item0=obj

View File

@ -0,0 +1,97 @@
program amazon_sample;
{$APPTYPE CONSOLE}
uses
delphi_init_com,
Classes, SysUtils,
soap_formatter,
synapse_http_protocol,
metadata_repository,
AWSECommerceService, AWSECommerceService_proxy;
const sACCES_ID = <your key here>;
function ReadEntry(const APromp : string):string ;
begin
Result := '';
Write(APromp);
while True do begin
ReadLn(Result);
Result := Trim(Result);
if ( Length(Result) > 0 ) then
Break;
end;
end;
var
locService : AWSECommerceServicePortType;
rqst : ItemSearch_Type;
rsps : ItemSearchResponse_Type;
rspsItem : Items_Type;
i, j, k : Integer;
itm : Item_Type;
begin
SYNAPSE_RegisterHTTP_Transport();
WriteLn('Web Services Toolkit Amazon sample');
WriteLn('This sample demonstrates the "ItemSearch" method of the Amazon web service');
WriteLn;
rqst := ItemSearch_Type.Create();
try
locService := wst_CreateInstance_AWSECommerceServicePortType();
rqst.AWSAccessKeyId := sACCES_ID;
while True do begin
rqst.Request.SetLength(1);
rqst.Request[0].SearchIndex := ReadEntry('Enter the Search Index : ');
rqst.Request[0].Availability := Available;
rqst.Request[0].Count := 10;
rqst.Request[0].MerchantId := 'Amazon';
rqst.Request[0].ItemPage := 1;
rqst.Request[0].Keywords := ReadEntry('Enter the Keywords : ');
rsps := locService.ItemSearch(rqst);
if ( rsps.OperationRequest.Errors.Length > 0 ) then begin
WriteLn(Format('Errors ( %d ) : ',[rsps.OperationRequest.Errors.Length]));
for i := 0 to Pred(rsps.OperationRequest.Errors.Length) do begin
WriteLn(Format(' Error[%d] :',[i]));
WriteLn(' ' + rsps.OperationRequest.Errors[i].Code);
WriteLn(' ' + rsps.OperationRequest.Errors[i].Message);
end;
end else begin
WriteLn(Format('Response ( %d ) : ',[rsps.Items.Length]));
if Assigned(rsps) then begin
for i := 0 to Pred(rsps.Items.Length) do begin
rspsItem := rsps.Items[i];
WriteLn(' TotalPages :' + IntToStr(rspsItem.TotalPages));
WriteLn(' TotalResults :' + IntToStr(rspsItem.TotalResults));
WriteLn(' Items :' + IntToStr(rspsItem._Item.Length));
WriteLn('');
for j := 0 to Pred(rspsItem._Item.Length) do begin
itm := rspsItem._Item[j];;
WriteLn(' ASIN :' + itm.ASIN);
WriteLn(' DetailPageURL :' + itm.DetailPageURL);
if Assigned(itm.ItemAttributes) then begin
WriteLn(' Title :' + itm.ItemAttributes.Title);
for k := 0 to Pred(itm.ItemAttributes.Author.Length) do begin
WriteLn(' Author[ ' + IntToStr(k) + ' ] ' + itm.ItemAttributes.Author.Item[k]);
end;
WriteLn(' Manufacturer :' + itm.ItemAttributes.Manufacturer);
WriteLn(' ProductGroup :' + itm.ItemAttributes.ProductGroup);
end;
WriteLn('');
end;
end;
end else begin
WriteLn('Unexpected service response : Invalid response');
end;
end;
WriteLn;
WriteLn;
if ( UpperCase(ReadEntry('Continue ( Y/N ) :'))[1] <> 'Y' ) then
Break;
end;
finally
FreeAndNil(rqst);
FreeAndNil(rsps);
end;
ReadLn;
end.