Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Can i make SmartGWT support getting Spring Slice<T> response data?

    I have a bunch of Spring services as datasources (lookupstyle = spring). Many of my middleware services return slices for pagination etc. However, i cannot just add that in the dsresponse, since it will make the structure wrong.
    Therefor i have to create spring classes between my middleware services and smartgwt just to do slice.getContent() and put that in the DSResponse manually.

    Is there some way to make smartGWT "understand" the slice object so that i can have the ds.xml call my spring middleware service directly and extract the data from the slice?

    simplified example:
    Code:
    Slice<Image> images = imageService.getImages();
    DSResponse resp = new DSResponse(images.getContent());
     return resp;
    Last edited by mathias; 21 Sep 2020, 09:32.

    #2
    As with your other similar questions:

    1. Server Scripting provides the easiest way to write little bits of glue code

    2. you can create a custom DataSource if it's a recurring pattern, which binds to Spring however you like

    Comment


      #3
      ok. I have not been able to find how i specify a custom datasource java class in the ds.xml file. How do i do that?

      EDIT: nvm think i found it, "serverConstructor" right?

      I have some problems getting it to work:
      By using the serverConstructor i can see that my custom class is initialized and that it is set as datasource. I want to have it as mentioned above to customize some small aspects.

      However i also have "serverlookup spring". This seems to mean that DataSourceDMI is used (at least that is what is calling my spring beans) and my custom class is not part of the execution (the execute method is never called.)

      Should i inherit from DataSourceDMI in my custom implementation then. The docs mention only BasicDatasource.

      I want everything to work as now (well i have some input there to based on debugging, but that's beside the point), only do some additional processing after the datasource execute is done.
      Last edited by mathias; 22 Sep 2020, 01:09.

      Comment

      Working...
      X