XMLRPC: jobs.poll

« index

 Find a job that matches any of the applications on a given factory and lock it

 Signature
 ~~~~~~~~~
 jobs.poll(factory_name)

 Arguments
 ~~~~~~~~~
 - factory_name (string): The name of the factory that you want to poll for

 Return value
 ~~~~~~~~~~~~
 When a job is found that matches any of the workers that are running on the
 requested factory then an array will be returned containing the following fields:

 - job (string): The GUID of the job
 - application (string): The name of the application to run, e.g. "OpenOffice.org Writer"
 - version (string): The version string of the application, e.g. "3.0" or "2003 SP2"
 - pageStart (int): The first page to render in the output
 - pageEnd (int): The last page to render in the output. If this is zero then it should be
                  rendered to the end of the document.
 - format (string): 3-letter code specifying the desired output format (pdf, png or odf). If this
                    is empty then the factory can decide.
 - filename (string): The original filename of the ODF document
 - doctype (string): 3-letter code specifying the input type (odt, ods, odp)
 - document (string): Base64-encoded contents of the document

 When no mathcing job has been found then an empty result is returned.

 Job locking
 ~~~~~~~~~~~
 The matching job is locked for five minutes. This is to make sure that no jobs are processed by two factories at
 the same time. If your factory takes longer to process a job, it is possible that somebody else will lock it. In
 this case, your upload will fail.

 Example request
 ~~~~~~~~~~~~~~~
 POST /xmlrpc HTTP/1.0
 Host: example.org
 Content-Type: text/xml
 Content-Length: 193

 <?xml version='1.0'?>
 <methodCall>
   <methodName>jobs.finish</methodName>
   <params>
     <param><value><string>My factory</string></value></param>
   </params>
 </methodCall>

 Example response
 ~~~~~~~~~~~~~~~~
 HTTP/1.1 200 OK
 Content-Type: application/xml
 Content-Length: 10164
 Connection: close

 <?xml version="1.0" encoding="iso-8859-1"?>
 <methodResponse>
   <params>
     <param>
       <value>
         <struct>
           <member>
             <name>job</name>
             <value><string>4975c9c6-79a0-43a1-8134-0ba5c0a80105</string></value>
           </member>
           <member>
             <name>application</name>
             <value><string>OpenOffice.org Writer</string></value>
           </member>
           <member>
             <name>version</name>
             <value><string>3.0</string></value>
           </member>
           <member>
             <name>pageStart</name>
             <value><string>1</string></value>
           </member>
           <member>
             <name>pageEnd</name>
             <value><string>0</string></value>
           </member>
           <member>
             <name>format</name>
             <value><string>pdf</string></value>
           </member>
           <member>
             <name>filename</name>
             <value><string>mydocument.odt</string></value>
           </member>
           <member>
             <name>doctype</name>
             <value><string>odt</string></value>
           </member>
           <member>
             <name>document</name>
             <value><string>UEsDBBQA ... AAAAAA==</string></value>
           </member>
         </struct>
       </value>
     <param>
   </params>
 </methodResponse>

Admin: