Petals BC REST

Add support of attachments on HTTP Post request

Details

  • Type: Improvement Request Improvement Request
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0.1-BC
  • Fix Version/s: 1.1.0-BC
  • Component/s: Provider mode
  • Security Level: Public
  • Description:
    Hide

    Add support of attachments on HTTP Post request:

    • through a HTTP POST request with a content-type defined to 'multipart/form-data'
    • attachments are put as a part 'form-data' in the HTTP request:
      • using a HTTP body type defined as 'MULTIPART_FORMDATA',
      • the name of the form field is defined in the SU JBI descriptor,
      • and initialized with a value extracted from the incoming payload through a XPath expression,
      • if the form field is defined as attachment:
        • the result of the XPath expression must the identifier of the attachment to put in the part,
        • we must be able to define an attachment name as the result of a XPath expression
      • Example:
        <jbi:jbi version="1.0" ...>
           <jbi:services binding-component="true">
              <jbi:provides interface-name="edm:EDM" service-name="edm:EDMService" endpoint-name="autogenerate">
                 ...
                 <rest:mapping>
                    ...
                    <rest:operation name="edm:archiver">
                       ...
                       <rest:http-body-type>MULTIPART_FORMDATA</rest:http-body-type>
                       ...
                       <rest:form-data name="file" as-attachment="true">
                          <rest:extracted-by-xpath>
                             substring-after(//*[local-name()='document']/*[local-name()='Include']/@href, 'cid:')
                          </rest:extracted-by-xpath>
                          <rest:attachment-name>
                             <rest:xpath>//*[local-name()='document']/*[local-name()='nom']</rest:xpath>
                          </rest:attachment-name>
                       </rest:form-data>
                       ...
                    </rest:operation>
                    ...
                 </rest:mapping>
              </jbi:provides>
           </jbi:services>
        </jbi:jbi>
    Show
    Add support of attachments on HTTP Post request:
    • through a HTTP POST request with a content-type defined to 'multipart/form-data'
    • attachments are put as a part 'form-data' in the HTTP request:
      • using a HTTP body type defined as 'MULTIPART_FORMDATA',
      • the name of the form field is defined in the SU JBI descriptor,
      • and initialized with a value extracted from the incoming payload through a XPath expression,
      • if the form field is defined as attachment:
        • the result of the XPath expression must the identifier of the attachment to put in the part,
        • we must be able to define an attachment name as the result of a XPath expression
      • Example:
        <jbi:jbi version="1.0" ...>
           <jbi:services binding-component="true">
              <jbi:provides interface-name="edm:EDM" service-name="edm:EDMService" endpoint-name="autogenerate">
                 ...
                 <rest:mapping>
                    ...
                    <rest:operation name="edm:archiver">
                       ...
                       <rest:http-body-type>MULTIPART_FORMDATA</rest:http-body-type>
                       ...
                       <rest:form-data name="file" as-attachment="true">
                          <rest:extracted-by-xpath>
                             substring-after(//*[local-name()='document']/*[local-name()='Include']/@href, 'cid:')
                          </rest:extracted-by-xpath>
                          <rest:attachment-name>
                             <rest:xpath>//*[local-name()='document']/*[local-name()='nom']</rest:xpath>
                          </rest:attachment-name>
                       </rest:form-data>
                       ...
                    </rest:operation>
                    ...
                 </rest:mapping>
              </jbi:provides>
           </jbi:services>
        </jbi:jbi>
  • Environment:
    -

Activity

Christophe DENEUX made changes - Mon, 11 Sep 2017 - 10:29:39 +0200
Status In Progress [ 10003 ] Resolved [ 10004 ]
Resolution Fixed [ 1 ]
Christophe DENEUX made changes - Mon, 11 Sep 2017 - 10:29:07 +0200
Status Open [ 10002 ] In Progress [ 10003 ]
Christophe DENEUX made changes - Mon, 11 Sep 2017 - 10:09:22 +0200
Description Add support of attachments on HTTP Post request:
* through a HTTP POST request with a content-type defined to '{{multipart/form-data}}'
* attachments are put as a part '{{form-data}}' in the HTTP request:
** using a HTTP body type defined as '{{MULTIPART_FORMDATA}}',
** the name of the form field is defined in the SU JBI descriptor,
** and initialized with a value extracted from the incoming payload through a XPath expression,
** if the form field is defined as attachment, the result of the XPath expression must the identifier of the attachement to put in the part,
** Example:
{code}
<jbi:jbi version="1.0" ...>
   <jbi:services binding-component="true">
      <jbi:provides interface-name="edm:EDM" service-name="edm:EDMService" endpoint-name="autogenerate">
         ...
         <rest:mapping>
            ...
            <rest:operation name="edm:archiver">
               ...
               <rest:http-body-type>MULTIPART_FORMDATA</rest:http-body-type>
               ...
               <rest:form-data name="file" as-attachment="true">
                  <rest:extracted-by-xpath>
                     substring-after(//*[local-name()='document']/*[local-name()='Include']/@href, 'cid:')
                  </rest:extracted-by-xpath>
               </rest:form-data>
               ...
            </rest:operation>
            ...
         </rest:mapping>
      </jbi:provides>
   </jbi:services>
</jbi:jbi>
{code}
Add support of attachments on HTTP Post request:
* through a HTTP POST request with a content-type defined to '{{multipart/form-data}}'
* attachments are put as a part '{{form-data}}' in the HTTP request:
** using a HTTP body type defined as '{{MULTIPART_FORMDATA}}',
** the name of the form field is defined in the SU JBI descriptor,
** and initialized with a value extracted from the incoming payload through a XPath expression,
** if the form field is defined as attachment:
*** the result of the XPath expression must the identifier of the attachment to put in the part,
*** we must be able to define an attachment name as the result of a XPath expression
** Example:
{code}
<jbi:jbi version="1.0" ...>
   <jbi:services binding-component="true">
      <jbi:provides interface-name="edm:EDM" service-name="edm:EDMService" endpoint-name="autogenerate">
         ...
         <rest:mapping>
            ...
            <rest:operation name="edm:archiver">
               ...
               <rest:http-body-type>MULTIPART_FORMDATA</rest:http-body-type>
               ...
               <rest:form-data name="file" as-attachment="true">
                  <rest:extracted-by-xpath>
                     substring-after(//*[local-name()='document']/*[local-name()='Include']/@href, 'cid:')
                  </rest:extracted-by-xpath>
                  <rest:attachment-name>
                     <rest:xpath>//*[local-name()='document']/*[local-name()='nom']</rest:xpath>
                  </rest:attachment-name>
               </rest:form-data>
               ...
            </rest:operation>
            ...
         </rest:mapping>
      </jbi:provides>
   </jbi:services>
</jbi:jbi>
{code}
Christophe DENEUX made changes - Mon, 11 Sep 2017 - 10:06:48 +0200
Status Resolved [ 10004 ] Open [ 10002 ]
Resolution Fixed [ 1 ]
Christophe DENEUX made changes - Mon, 9 Jan 2017 - 10:27:21 +0100
Status In Progress [ 10003 ] Resolved [ 10004 ]
Fix Version/s 1.1.0 [ 10696 ]
Resolution Fixed [ 1 ]
Christophe DENEUX made changes - Mon, 9 Jan 2017 - 09:14:52 +0100
Status Open [ 10002 ] In Progress [ 10003 ]
Christophe DENEUX made changes - Mon, 9 Jan 2017 - 09:14:50 +0100
Status New [ 10000 ] Open [ 10002 ]
Christophe DENEUX made changes - Mon, 9 Jan 2017 - 09:13:29 +0100
Field Original Value New Value
Priority Major [ 3 ]
Description Add support of attachments on HTTP Post request:
* through a HTTP POST request with a content-type defined to '{{multipart/form-data}}'
* attachments are put as a part '{{form-data}}' in the HTTP request:
** using a HTTP body type defined as '{{MULTIPART_FORMDATA}}',
** the name of the form field is defined in the SU JBI descriptor,
** and initialized with a value extracted from the incoming payload through a XPath expression,
** if the form field is defined as attachment, the result of the XPath expression must the identifier of the attachement to put in the part
{code}
<jbi:jbi version="1.0" ...>
   <jbi:services binding-component="true">
      <jbi:provides interface-name="edm:EDM" service-name="edm:EDMService" endpoint-name="autogenerate">
         ...
         <rest:mapping>
            ...
            <rest:operation name="edm:archiver">
               ...
               <rest:http-body-type>MULTIPART_FORMDATA</rest:http-body-type>
               ...
               <rest:form-data name="file" as-attachment="true">
                  <rest:extracted-by-xpath>
                     substring-after(//*[local-name()='document']/*[local-name()='Include']/@href, 'cid:')
                  </rest:extracted-by-xpath>
               </rest:form-data>
               ...
            </rest:operation>
            ...
         </rest:mapping>
      </jbi:provides>
   </jbi:services>
</jbi:jbi>
{code}
Add support of attachments on HTTP Post request:
* through a HTTP POST request with a content-type defined to '{{multipart/form-data}}'
* attachments are put as a part '{{form-data}}' in the HTTP request:
** using a HTTP body type defined as '{{MULTIPART_FORMDATA}}',
** the name of the form field is defined in the SU JBI descriptor,
** and initialized with a value extracted from the incoming payload through a XPath expression,
** if the form field is defined as attachment, the result of the XPath expression must the identifier of the attachement to put in the part,
** Example:
{code}
<jbi:jbi version="1.0" ...>
   <jbi:services binding-component="true">
      <jbi:provides interface-name="edm:EDM" service-name="edm:EDMService" endpoint-name="autogenerate">
         ...
         <rest:mapping>
            ...
            <rest:operation name="edm:archiver">
               ...
               <rest:http-body-type>MULTIPART_FORMDATA</rest:http-body-type>
               ...
               <rest:form-data name="file" as-attachment="true">
                  <rest:extracted-by-xpath>
                     substring-after(//*[local-name()='document']/*[local-name()='Include']/@href, 'cid:')
                  </rest:extracted-by-xpath>
               </rest:form-data>
               ...
            </rest:operation>
            ...
         </rest:mapping>
      </jbi:provides>
   </jbi:services>
</jbi:jbi>
{code}

People

Dates

  • Created:
    Mon, 9 Jan 2017 - 09:13:03 +0100
    Updated:
    Mon, 11 Sep 2017 - 10:29:39 +0200
    Resolved:
    Mon, 11 Sep 2017 - 10:29:39 +0200