I'm testing the batch uploader component and it seems that it only generates add requests to the server, not updates if a record with matching primary key already exists. I can't seem to find any documentation for BatchUploader. Is it limited to inserts only?
Announcement
Collapse
No announcement yet.
X
-
I was hoping for a more generalized solution. Unless I'm missing something, this would require a facade data source for every real data source we wanted to allow uploads to.
We have a large number of data sources that use a generic editor component which includes the ability to upload using BatchUploader. All of our server-side code extends a single class so we were hoping to intercept the standard "add" request and, if it was from the BatchUploader, implement the conditional logic.
Is there another technique you can recommend that would avoid the need for a separate facade datasource for every real datasource? I was hoping the DSRequest.getComponentId() would identify BatchUploader or maybe a way to set the operationId on the requests issued by BatchUploader.
Comment
-
A couple of ways to do this:
1) create a reusable facade DataSource where the real target DataSource is specified as a custom property in .ds.xml "targetDataSource". This requires an extra .ds.xml per DataSource that supports batch upload, to eliminate that..
2) give the BatchUploader a DataSource ID like targetDataSourceName_batchUpload. No .ds.xml file will exist for this; on the server you could either subclass IDACall to route them to custom code, or implement a strategy similar to the above via addDynamicDSGenerator() so that facade DataSources are automatically generated.
Comment
-
Option 2 sounds easy enough, but how do I "give the BatchUploader a DataSource ID like targetDataSourceName_batchUpload"? BatchUploader.setUploadDataSource() only takes an actual DataSource object as the argument, not a simple String data source name.
Is there some way on the client side to clone a datasource to create one just like it with a different name?
Comment
Comment