I currently have a spring-loaded set of DataSources that are wired into server-side Hibernate models.
This is all setup correctly and working like a charm. I have a custom fetch() operation that calls DAO's that are defined and re-used elsewhere in my application.
Basically, I need the ability to pass custom parameters from the client to the executeFetch(...) operation on the server.
I have tried every way possible to attach parameters to the client-side DSRequest, but from what I have found through researching your javadocs is that this practice is actively opposed, (referred to as 'smuggling data') due to technical implications of caching custom sets of data.
(Side question - why can't you just add in a map of custom parameters that are required to be serializable and which are transformed into a same-named map on the server-side com.isomorphic.datasource.DSRequest that is passed into executeFetch? SmartGWT could ignore these parameters for caching or other purposes entirely and this would solve my problem.)
So is there a way to do this? If so, how the heck do you do it?
I thought I might be on the right track with creating an overridden client-side DataSource and overriding the transformRequest method, but that didn't work. I'm using DataSource.get("data_source_id"); to get an instance of the client-side DataSource, but I had no idea how to get that to be cast to an instance of my CustomDataSource object - maybe that is my problem?
Also, side-note, why does the server-side DSResponse have a map to which you can call setParameter(...), but the client-side DSResponse is getAttribute()? The difference in wording isn't documented, and is very confusing.
This is all setup correctly and working like a charm. I have a custom fetch() operation that calls DAO's that are defined and re-used elsewhere in my application.
Basically, I need the ability to pass custom parameters from the client to the executeFetch(...) operation on the server.
I have tried every way possible to attach parameters to the client-side DSRequest, but from what I have found through researching your javadocs is that this practice is actively opposed, (referred to as 'smuggling data') due to technical implications of caching custom sets of data.
(Side question - why can't you just add in a map of custom parameters that are required to be serializable and which are transformed into a same-named map on the server-side com.isomorphic.datasource.DSRequest that is passed into executeFetch? SmartGWT could ignore these parameters for caching or other purposes entirely and this would solve my problem.)
So is there a way to do this? If so, how the heck do you do it?
I thought I might be on the right track with creating an overridden client-side DataSource and overriding the transformRequest method, but that didn't work. I'm using DataSource.get("data_source_id"); to get an instance of the client-side DataSource, but I had no idea how to get that to be cast to an instance of my CustomDataSource object - maybe that is my problem?
Also, side-note, why does the server-side DSResponse have a map to which you can call setParameter(...), but the client-side DSResponse is getAttribute()? The difference in wording isn't documented, and is very confusing.
Comment