Ticket #4572 (closed defect: invalid)
Need way around modifying web server to support ItemFileWriteStore
| Reported by: | guest | Owned by: | jaredj |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Data | Version: | 0.9 |
| Severity: | normal | Keywords: | |
| Cc: | gene.mutschler@… |
Description
Downloaded most recent 0.9 distribution. Wanted to use ItemFileWriteStore? to read (AND MODIFY) a data set. Found that the save operation doesn't do anything. Looking at the code revealed that I apparently have to write my own callback to do the work. (I would have thought that there would be a default that overwrote the original file.) After researching support and Google, I didn't find anything to the contrary.
So, I did. I used the rawXhrPut function to PUT a new file:
function saveAll(saveCompleteCallback, saveFailedCallback, newFileContentString) {
var saveArgs = {
url: "datadir/data.json", method: "PUT", contentType: "text/json", handleAs: "json"
}; var saveHandler; saveArgs.putData = newFileContentString; saveHandler = dojo.rawXhrPut(saveArgs); saveHandler.addCallback(saveCompleteCallback); saveHandler.addErrback(saveFailedCallback);
}
where this function is assigned to the _saveEverything method of the ItemFileWriteStore? object.
Was getting error 403 on Apache 5.5.17 bundled in Netbeans 5.5.1. Checking the apache documentation, I found that there is an init param ("readonly") for the servlet that needs to be set to "false", after which my save started working.
This means, of course, that it will now be necessary to instruct my users to modify their web.xml for Apache to allow this, unless there is something about the code above that I could have done to avoid the problem.
I see two defects here: 1) there should be a default implementation for the ItemFileWriteStore? save operation, and 2) a way should be found to avoid the need to avoid reconfiguring Apache for what is supposed to be a "standard" part of dojo.
Contact info: Gene Mutschler, Unisys Corp. (gene.mutschler@…)