molostoff / ubiquity-xforms

Automatically exported from code.google.com/p/ubiquity-xforms
0 stars 0 forks source link

Move submission to a dictionary-style selection mechanism #433

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The submission code has grown in a variety of ways, and has become a little
difficult to follow. There are a number of improvements that can be made,
and one of the first is to adopt a dictionary approach to selecting the
correct method to call.

This simply means that when deciding how to process a particular
submission, the first thing that is isolated is the protocol that must be
used ('http', 'file', etc.) and then next the method ('GET', 'PUT', etc.).

A dictionary of methods then makes calling the correct functionality as
simple as:

  // Get a handler for a protocol:
  //
  schemeHandler = handlers[protocol];

  // Now call the correct method:
  //
  schemeHandler[method](sResource, oBody, nTimeout, oCallback);

Since it will be quite a bit of work to add all of the methods in one go,
then the simple approach is to add any new code to scheme handlers like
this, and if no handler exists fallback to the current mechanisms.

Original issue reported on code.google.com by mark.bir...@gtempaccount.com on 17 Apr 2009 at 6:16

GoogleCodeExporter commented 8 years ago
There are a number of ways to implement local file access, and here is a useful
source of information for what happens when using XHR to access local files:

  <http://lists.w3.org/Archives/Public/public-webapps/2009AprJun/0200.html>

Original comment by mark.bir...@gtempaccount.com on 17 Apr 2009 at 6:17