[Dart] Investigating addition of HTTP PUT submission support

Miller, James V (GE, Research) millerjv at crd.ge.com
Tue Jun 20 08:42:12 EDT 2006


Zachary, 

I think adding doPut to the CommandServlet and having it call Submit.put()
will do what you want.  Each project has its own CommandServlet at a unique
URL, for instance

http://example.com:8081/TestProject/Command/
http://example.com:8081/SomeOtherProject/Command/

The beginning of doPut() will look similar to the beginning doPost().  It will 
call getInitParameter("project") to deduce the project (the same servlet is
mounted for each project at a unique url, we cache an init parameter in each instance
of the servlet so the servlet knows which project it is responding to). Then instead 
of doing the two xmlrpc lines, you'll create a Submit command and call put().

As Scott pointed out in another email, you could also create a SubmitServlet
that would be similar to the CommandServlet except it would implement doPut()
instead of doPost() as described above.  Then in your Project.xml, you can 
add the SubmitServlet to the ServletManager using 

    <Servlet>
      <Class>dart.server.servlet.SubmitServlet</Class>
      <Context>/Submit/</Context>
      <Properties/>
    </Servlet>
 
This will mount the submit servlet under

http://example.com:8081/TestProject/Submit

I think I prefer having a separate servlet for this so that if a project
does not want to allow HTTP PUT submissions, then can remove the servlet
from the Project.xml file.

Jim

-----Original Message-----
From: dart-bounces+millerjv=crd.ge.com at public.kitware.com
[mailto:dart-bounces+millerjv=crd.ge.com at public.kitware.com]On Behalf Of
Zachary Mark
Sent: Monday, June 19, 2006 6:04 PM
To: dart at public.kitware.com
Subject: [Dart] Investigating addition of HTTP PUT submission support


This is a followup to the e-mail thread referenced at 
http://public.kitware.com/pipermail/dart/2006-June/001557.html

I am investigating the near-term feasibility (as in, beginning very 
soon) about contributing support for submissions via HTTP PUT into the 
DartServer.  This functionality is very highly desired and as such I 
would be willing to implement it myself and contribute it into the Dart 
code base.

I've spent some of the afternoon reading through the Dart source code 
and trying to make heads and tails of it, and I think I have a basic 
design overview, and I'm looking for some of the Dart core devs to take 
a look at my proposal and evaluate what changes could be made to my 
idea.  I am not 100% familiar with the Dart code so this is a guess 
based on what I have gleaned so far.

What I propose is that a void doPut method be added to the 
java.server.servlet.CommandServlet class with the following signature:

       public void doPut( HttpServletRequest request, 
HttpServletResponse response ) throws
                   ServletException, IOException

I would make the assumption that all commands received via PUT are 
submission requests, rather than the much broader functionality offered 
by xmlrpc.  The doPut method would contain a submission command object 
(dart.server.command.Submit) and call the Submit.put method directly.  
It seems that the Submit.put method should handle all the functionality 
that I'm looking for, but there is one issue that I potentially have.  
How can I use HTTP PUT and differentiate between different projects?  
IIRC, HTTP PUT allows only one submission field which obviously should 
contain the full XML submission data.  Is there a "default project" 
setting in the Dart server that I could leverage to direct all PUT 
requests?  Could the XML format be extended so that clients can specify 
which project to submit the results to in the XML?  Maybe this could be 
incorporated into the <DartSubmission> tag, in the following form:

      <DartSubmission version="2.0" createdby="ReSTInstaller" 
project="SampleProject">

Since the client has to specify which project to submit the result to in 
the first place, I don't see a reason not to potentially include it in 
the XML, unless there are some issues that I am not considering.

Sorry I got to the point of rambling, but I'm interested to hear some 
thoughts on this issue and my PUT proposal.

-- Zach


_______________________________________________
Dart mailing list
Dart at public.kitware.com
http://public.kitware.com/mailman/listinfo/dart


More information about the Dart mailing list