Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 18 of 18 total
Thread Database acces with native modules in EWB3
Wed, Jan 20 2021 10:55 AMPermanent Link

Raul

Team Elevate Team Elevate

On 1/20/2021 10:41 AM, Ronald wrote:
> Raul wrote:
>
> <Server will let you register the name only one once and it can point to
> only one dll - that's the association.>
>
> In the call to the server that name is never used. Tim advices to use this:
>
> Session.DatabaseResource:='modules';
> Session.UserName:='Anonymous';
> Database.DatabaseName:='sampledatabasename';
>
> Where is gdba mentioned above? The dll should be associated with the database call somehow.
>

Sorry - i misunderstood the question.

I think on client side it's this line that specifies the database in
your case:

Database.DatabaseName:='gdba';

The URL is then built using the resource + database name

Raul

Thu, Jan 21 2021 1:46 PMPermanent Link

Ronald

Raul wrote:
<
I think on client side it's this line that specifies the database in
your case:

Database.DatabaseName:='gdba';

The URL is then built using the resource + database name
>

It can not imagine that you should use the databasename for the name of the module.
Is that correct Tim?
Thu, Jan 21 2021 1:55 PMPermanent Link

Raul

Team Elevate Team Elevate

On 1/21/2021 1:46 PM, Ronald wrote:
> It can not imagine that you should use the databasename for the name of the module.

I believe this is because you are using EWB DataSet handling which has
some default behavior for building the server URL (i.e.
<resource/<database name>).

Native modules are not necessarily database modules so this is just a
side effect of that.  Using serverrequest with native module you would
just call full url direct of course.

Raul
Thu, Jan 21 2021 2:28 PMPermanent Link

Ronald

Raul wrote:

<Native modules are not necessarily database modules so this is just a
side effect of that.  Using serverrequest with native module you would
just call full url direct of course.
>

I tested it with:

Session.DatabasesResource:='modules';
Session.UserName:='Anonymous';
Database.DatabaseName:='gdba';

But then I get the error:

Dataset load response error (the server module gdba/ll_tiles/data) does not exist
Thu, Jan 21 2021 9:23 PMPermanent Link

Raul

Team Elevate Team Elevate

On 1/21/2021 2:28 PM, Ronald wrote:
> I tested it with:
>
> Session.DatabasesResource:='modules';
> Session.UserName:='Anonymous';
> Database.DatabaseName:='gdba';
>
> But then I get the error:
>
> Dataset load response error (the server module gdba/ll_tiles/data) does not exist

I played with a simple module that just echos data back in a response
and server requires relative url path to be the module name and not just
base path.

So in your case you need to register the module using
"gdba/ll_tiles/data" as module name and not just as "gdba".

One can register same dll multiple times if needed and module can parse
request URL to see what to response with.

Need Tim to chime in here to clarify this but i can't find a way to have
module handle all paths from base url path right now.

Raul
Fri, Jan 22 2021 4:58 AMPermanent Link

Ronald

Raul wrote:
<
So in your case you need to register the module using
"gdba/ll_tiles/data" as module name and not just as "gdba".
>

Thanks for exploring this, Raul.
But then I would need to register a module for every dataset that I use (ll_tiles is a dataset in this case). That would not be workable.
If only  Database.BaseURL:='/modules/gdba'; would still function like in EWB2 Smile

Ronald
Fri, Jan 22 2021 12:17 PMPermanent Link

Raul

Team Elevate Team Elevate

On 1/22/2021 4:58 AM, Ronald wrote:
> But then I would need to register a module for every dataset that I use (ll_tiles is a dataset in this case). That would not be workable.

That's my understanding yes though it can be the same exact module and
it can just inspect the URL to determine dataset etc.

I assume it's for a security (declare every endpoint url) but for REST
type APIs would be nice to be able to define that modules handles all of
URL base path

Raul
Fri, Jan 22 2021 1:00 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ronald,

<< But then I get the error:

Dataset load response error (the server module gdba/ll_tiles/data) does not exist >>

This is a bug - the module execution is passing the URL path instead of the module name.  I will have a fix out shortly for this.

Tim Young
Elevate Software
www.elevatesoft.com
« Previous PagePage 2 of 2
Jump to Page:  1 2
Image