Difference between revisions of "The MIRC Protocol for Document Exchange"

From MircWiki
Jump to navigation Jump to search
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
This article describes the protocol used by the RSNA MIRC software to import and export documents. It is used by the submit service to accept MIRCdocument submissions for indexing and storage.
+
This article describes the protocol used by the RSNA MIRC software to import and export documents. It is used by the Submit Service to accept MIRCdocument submissions for storage and indexing.
  
 
==The Document Exchange Interfaces==
 
==The Document Exchange Interfaces==
Line 5: Line 5:
  
 
===The Browser Interface===
 
===The Browser Interface===
When the submit service receives an HTTP GET, it returns an HTML page containing a form allowing the user to browse the client computer, select a file for uploading, and submit it.
+
When the Submit Service receives an HTTP GET, it returns an HTML page containing a form allowing the user to browse the client computer, select a file for uploading, and submit it.
  
 
When the user clicks the <b>Submit</b> button on the form, the browser sends the file in an HTTP POST with Content-Type <b>multipart/form-data</b>.
 
When the user clicks the <b>Submit</b> button on the form, the browser sends the file in an HTTP POST with Content-Type <b>multipart/form-data</b>.
  
When the submit service receives an HTTP POST with Content-Type <b>multipart/form-data</b>, it creates a directory for the submission, receives the data, parses the multipart request, saves the file in the directory, and then parses the file as described in [[#The_File_Structure_of_a_MIRC_Submission|The File Structure of a MIRC Submission]].
+
When the Submit Service receives an HTTP POST with Content-Type <b>multipart/form-data</b>, it creates a directory for the submission, receives the data, parses the multipart request, saves the file in the directory, and then parses the file as described in [[#The_File_Structure_of_a_MIRC_Submission|The File Structure of a MIRC Submission]].
  
After parsing the posted file, the submit service returns an HTML page in the response text describing the actions it has taken. The browser then displays the results in its window.
+
After parsing the posted file, the Submit Service returns an HTML page in the response text describing the actions it has taken. The browser then displays the results in its window.
  
 
===The Authoring Tool Interface===
 
===The Authoring Tool Interface===
When the submit service receives an HTTP POST with Content-Type <b>application/x-zip-compressed</b>, it creates a directory for the submission, receives the data, saves the file in the directory, and then parses the file as described in [[#The_File_Structure_of_a_MIRC_Submission|The File Structure of a MIRC Submission]].
+
When the Submit Service receives an HTTP POST with Content-Type <b>application/x-zip-compressed</b>, it creates a directory for the submission, receives the data, saves the file in the directory, and then parses the file as described in [[#The_File_Structure_of_a_MIRC_Submission|The File Structure of a MIRC Submission]].
  
If the POST includes a <b>path</b> query string, the submit service attempts to update the document found at the relative path specified. The path is relative to the storage service's root directory. For the RSNA MIRC implementation, this path always begins with <b>documents/</b>.
+
If the POST includes a <b>path</b> query string, the Submit Service attempts to update the document found at the relative path specified. The path is relative to the storage service's root directory.  
  
After parsing the posted file, the submit service returns an HTML page in the response text describing the actions it has taken.
+
After parsing the posted file, the Submit Service returns an HTML page in the response text describing the actions it has taken.
  
 
==The File Structure of a MIRC Submission==
 
==The File Structure of a MIRC Submission==
 
Whether submitted within a multipart form by a browser or as an HTTP file transfer by an authoring tool, the submitted file is a zip file containing one MIRCdocument as described in [[The MIRCdocument Schema]], plus all the objects that the MIRCdocument references in its own directory.  
 
Whether submitted within a multipart form by a browser or as an HTTP file transfer by an authoring tool, the submitted file is a zip file containing one MIRCdocument as described in [[The MIRCdocument Schema]], plus all the objects that the MIRCdocument references in its own directory.  
  
Because the transmitter has no control over where, or even in what form, the MIRCdocument will be stored on a MIRC site, the zip file is not allowed to provide any directory information for the files it contains. Zip files containing directory information are rejected by the submit service, and the results page describes the action taken.
+
Because the transmitter has no control over where, or even in what form, the MIRCdocument will be stored on a MIRC site, any directory information in the file is ignored and all files are treated as if they were in the same directory.  
  
 
===Local and Global References===
 
===Local and Global References===
Line 31: Line 31:
  
 
===An Example Zip File===
 
===An Example Zip File===
The following shows a MIRCdocument submission opened with WinZip. Note the absence of path information for the files.
+
The following shows a MIRCdocument submission opened with WinZip.
 
<center>
 
<center>
 
[[Image:SubmitServiceZipWindow1.JPG]]
 
[[Image:SubmitServiceZipWindow1.JPG]]
 
</center>
 
</center>

Latest revision as of 11:14, 26 October 2011

This article describes the protocol used by the RSNA MIRC software to import and export documents. It is used by the Submit Service to accept MIRCdocument submissions for storage and indexing.

1 The Document Exchange Interfaces

The submit service provides two interfaces for documents: one intended for web browsers and one intended for MIRCdocument authoring tools. In both cases, the payload is the same.

1.1 The Browser Interface

When the Submit Service receives an HTTP GET, it returns an HTML page containing a form allowing the user to browse the client computer, select a file for uploading, and submit it.

When the user clicks the Submit button on the form, the browser sends the file in an HTTP POST with Content-Type multipart/form-data.

When the Submit Service receives an HTTP POST with Content-Type multipart/form-data, it creates a directory for the submission, receives the data, parses the multipart request, saves the file in the directory, and then parses the file as described in The File Structure of a MIRC Submission.

After parsing the posted file, the Submit Service returns an HTML page in the response text describing the actions it has taken. The browser then displays the results in its window.

1.2 The Authoring Tool Interface

When the Submit Service receives an HTTP POST with Content-Type application/x-zip-compressed, it creates a directory for the submission, receives the data, saves the file in the directory, and then parses the file as described in The File Structure of a MIRC Submission.

If the POST includes a path query string, the Submit Service attempts to update the document found at the relative path specified. The path is relative to the storage service's root directory.

After parsing the posted file, the Submit Service returns an HTML page in the response text describing the actions it has taken.

2 The File Structure of a MIRC Submission

Whether submitted within a multipart form by a browser or as an HTTP file transfer by an authoring tool, the submitted file is a zip file containing one MIRCdocument as described in The MIRCdocument Schema, plus all the objects that the MIRCdocument references in its own directory.

Because the transmitter has no control over where, or even in what form, the MIRCdocument will be stored on a MIRC site, any directory information in the file is ignored and all files are treated as if they were in the same directory.

2.1 Local and Global References

MIRCdocuments may contain references to objects anywhere on the internet. Objects whose locations on the internet are independent of the location of the MIRCdocument are global references, and they are specified in href, src, or docref attributes with fully qualified path names, including the protocol.

Objects that are part of the submission and referenced by the MIRCdocument are local references, and they are specified in href, src, or docref attributes without protocols or path information. Thus, images included in the submission are referenced only by their file names.

2.2 An Example Zip File

The following shows a MIRCdocument submission opened with WinZip.

Error creating thumbnail: Unable to save thumbnail to destination