Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Loading custom dataset
Sun, Feb 9 2014 9:29 AMPermanent Link

Uli Becker

I use some custom datasets and have written a module for that.

In order to load rows I have to use a request and read the result from
the responsecontent (at least I don't know another way to do that).

Since I can set the "Custom DataSets Resource Name" and the "Custom
DataSets Module" in EWB webserver, it would be great to have a procedure
like this (I added it to WebData and if works fine):

procedure TDatabase.LoadCustomDataset(DataSet: TDataSet; Append:
Boolean=False);
var
   TempRequest: TServerRequest;
   I: Integer;
begin
   DataSet.AppendLoad:=Append;
   TempRequest:=FRequestQueue.GetNewRequest;
   TempRequest.URL:='customdatasets';
   TempRequest.Params.Add('method=rows');
   TempRequest.Params.Add('dataset='+DataSet.DataSetName);
   for I:=0 to DataSet.Params.Count-1 do
      TempRequest.Params.Add(DataSet.Params[I]);
   TempRequest.Data:=DataSet;
   TempRequest.OnComplete:=RequestComplete;
   if (FUserName <> '') and (FPassword <> '') then
      begin
      TempRequest.RequestHeaders.Values['X-EWBUser']:=FUserName;
      TempRequest.RequestHeaders.Values['X-EWBPassword']:=FPassword;
      end;
   FRequestQueue.AddRequest(TempRequest);
end;

Of course 'customdatasets' would have to be a variable.

Uli
Mon, Feb 10 2014 5:11 AMPermanent Link

Uli Becker

Never mind.

Database.BaseURL:='customdatasets';

will do it. Smiley

Uli
Mon, Feb 10 2014 8:39 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< Never mind.

Database.BaseURL:='customdatasets';

will do it. Smiley>>

Smiley Just a quick note about this feature: with the advent of the new
dataset URL structure in 1.03, I'll most likely be removing the "custom
dataset module" setting in the EWB web server at some point in favor of just
using the normal modules.  I'll probably keep around the custom dataset
resource name setting in order to allow mapping one to the other, but
there's really no need for the custom dataset module setting anymore, and it
isn't flexible enough to allow for having multiple custom dataset modules.
In addition, dataset responses often need to be mixed with non-dataset
responses (think login authentication).

I'm (hopefully) going to have time to do a video on this topic this week,
since it's an important piece of the puzzle and is needed quite often.

Tim Young
Elevate Software
www.elevatesoft.com
Image