Hi
We've played with creating our own handlers for the JSDO. There doesn't seem to be any examples of webhandler code which processes anything but a GET. So I started looking at using the DOH and I can see how it works. To be honest I didn't see the benefit of writing our own to do the same job. We have a basic need to make use of our own dynamic catalog generation logic because the PDS doesn't support temp-tables defined like another table. We're interfacing with a legacy system on the back-end which utilises temp-tables in this way and we need to be able to pass our temp-tables to existent business logic.
Does the DOH need the static json catalog? It seems to have a link in there and I'm a bit concerned this isn't going to work out.
Regards
Darren
Hello Darren,
> We've played with creating our own handlers for the JSDO.
Could you provide more info on your goals?
The usage of Progress Data Services provides a prescriptive approach for working with REST services.
It can use either REST or WEB as the transport. The WEB transports corresponds to the DOH and gives you flexibility to handle HTTP requests programmatically.
In particular, you would use these services to work with the JSDO, either directly in JavaScript, Node.js or Kendo UI Builder.
If your intention is to work with the JSDO, the following dynamic service using WebHandlers could be useful:
- community.progress.com/.../2677
I hope this helps.
Thanks. We can use a static temp-table and just map it over to the other version using buffer-copy prior to operations so we'll work with a static dataset for now. The fill and save-changes will work as expected.
We are sticking with data object services. That being said I've got some questions regarding use.
We're working in 12.0.
We have it read working OK for now with counts and JFP but not thorugh the DOH. Rather than write our own handlers, I've decided to make use of the DOH. It all fits OK as we're using data object services. We have a generated .gen file.
1. Do I need to take the .gen file and drop that into the <service>.map file or will the DOH look for the .gen file?
2. How important is the schema section of the .gen file as we need to customise the catalog generation?
3. Can I just take the default GET which returns the catalog of the file?
We need to customise the catalog a little to add some extra static configuration data for use by the client and to remove fields which the user has no right to see. There are also other tweaks to the catalog which we need.
Thanks
D
We're using the JSDO and data object services with the web transport. We were only writing our own handlers before I discovered the existence of the DOH.
The JSDO can use a static catalog or a dynamically generated catalog file.
The following sample code shows how to use WebHandlers to create a Generic Service for the JSDO. The sample only shows GET operations. However, you should be able to use the same structure to add support for other operations.
Link:
- community.progress.com/.../2677
In addition of working with dynamic code, you can also write static Business Entities to provide custom code.
I hope this helps.
The JSDO can use a static catalog or a dynamically generated catalog file.
The following sample code shows how to use WebHandlers to create a Generic Service for the JSDO. The sample only shows GET operations. However, you should be able to use the same structure to add support for other operations.
Link:
- community.progress.com/.../2677
In addition of working with dynamic code, you can also write static Business Entities to provide custom code.
I hope this helps.
[quote user="Peter Judge"]
I've got this working and it all seems ok. As we're using data object services, do we have to use the "pdo" extension? I'm wondering if instead of web/pdo/HelloService, we can just do /web/HelloService provided we configure the handler correctly
If it's all about having a nice and clean URL, I would just use something like URL forwarding (replace/redirect) functionality of my webserver.
[quote user="Ruben Dröge"]
If it's all about having a nice and clean URL, I would just use something like URL forwarding (replace/redirect) functionality of my webserver.
[/quote]
I know I could do that but it was more about understanding if the DOH uses whether "pdo" is in the URI to change its behaviour.
Thanks
Darren
All services, operations and schemas that are in the GEN file are loaded first, then they are replaced by any identically-named operations and schemas in the MAP file. It's a complete replacement (not a patch/diff-applied) and not a removal, largely for simplicity..
Does that make sense?