HI
We have noticed that even though we supply a tableRef property to a DataSource object in our Angular application the JSDO does not add the tableRef into the filter when calling the count invoke or the read / get.
This causes incorrect results or errors for BE's which have multiple tables.
Code example
We are using the JSDO version 6 for Angular with Angular 6.
PS - If you do the above using a Jquery implementation of the JSDO it adds tableRef to the filter.
Thanks
Christian.
Hello Christian,
Thank you for reporting the issue via GitHub:
We will take a look and let you know our findings.
Thank you and regards,
Edsel
Hi Edsel
The tableref being passed on the URL seems to have been removed from JSDO 4.2 onwards in both Angular and Jquery versions.
I am looking to debug why.
Thanks
Christian.
Hi Edsel
It looks like an addition by Mike Fechner made in JSDO 4.2 on 16.03.2016 has been lost in future JSDO versions.
Can we get this change added back into the JSDO?
Its in the request mapping function (See lines annotated with CJB:
// Christian Bryan - 10.02.2019 Add this back in
// Mike Fechner, Consultingwerk Ltd. 16.03.2016
// Adding the tableRef property of the JSDO Parameters to
// the Filter Parameter so that the backend can use this
// information to actually know which Business Entity Table
// the query filter string is intended for ...
filter = JSON.stringify({
ablFilter: ablFilter,
tableRef: params.tableRef, // CJB
viewTables: jsdo.viewTables, // CJB
sqlQuery: sqlQuery,
orderBy: sortFields,
skip: params.skip,
top: params.top
});
Thanks
Christian.
I don't think this has ever been merged into the Standard Progress JSDO code line. As a matter of fact, we have re-applied this custimization to the JSDO 6.0 in our repo. I don't think we can just issue a pull request - due to a different build script we've been using.
But you may have a look at our JSDO repo.
Hello Christian,
Thank you for the debugging.
The enhancement with viewTables was not not submitted to the JSDO repo as a PR.
@Mike
Do you think that it would be possible to submit a PR to the develop branch, perhaps, not from your main branch but one that just provides the require update?
Is it just to add tableRef and viewTables to the call?
Please let me know.
Thank you and regards,
Edsel
HI Guys
From my point of view i would like tableRef and possibly viewTables added into the JSDO and in particular the JSDO for Angular asap as we need them for our current development project.
Thanks
Christian.
We also think viewTables functionality should be added to the standard JSO.
Br,
Patrik
Hello,
I'm afraid we're unable to issue a pull request which only includes that specific update, as that change was not an isolated commit.
@Christian, since it is a small change, perhaps you could issue the PR? Alternatively you could use our version of the JSDO core and angular packages.
Regards,
Radu Nicoara
Since we’re discussing the tableRef and viewTable settings, it might also be worth mentioning that our Angular data source implementation also supports working with a subset of the ProDataSet, by means of a “partialDataSet” setting. For example, when working with something like:
eOrder -> eCustomer
eOrder -> eOrderLine
eOrderLine -> eItem
We can use two different JSDO configurations:
tableRef = eOrder, viewTables = eCustomer and
tableRef = eOrderLine, viewTabels = eItem
It follows the MVVM pattern, in that the backend uses a model optimised for the business logic and the client adopts different “views”, depending on what is needed for the use case.
However, this is handled by our data source and not our version of the JSDO.
I believe that support for scenarios like this would also be a great addition to the JSDO.
Hi Radu
How do i go about doing the PR?
Thanks
Hi Christian,
I believe Edsel would be better qualified to answer that question.
HI Radu
How would we go about using your implementation of the JSDO for angular?
Thanks
Christian.
Hi Christian,
To use our implementation of the JSDO, please follow these steps:
- uninstall @progress/jsdo-core and @progress/jsdo-angular
- run the following command in the root of your project: "npm install --save @consultingwerk/smartcomponents-jsdo-core @consultingwerk/smartcomponents-jsdo-angular --registry npm.consultingwerkcloud.com"
- in your code, replace all imports from "@progress/jsdo-core" to "@consultingwerk/smartcomponents-jsdo-core" and from "@progress/jsdo-angular" to "@consultingwerk/smartcomponents-jsdo-angular"
The rest of your existing code should work as is.
You might also be interested in looking into our Smart Data Source, which makes tasks such as performing a named query quite easy. Since you have licensed the SmartComponent Library, I can also give you access to that.