Search in sources :

Example 1 with EbicsUnsecuredRequest

use of com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument.EbicsUnsecuredRequest in project axelor-open-suite by axelor.

the class UnsecuredRequestElement method build.

@Override
public void build() throws AxelorException {
    Header header;
    Body body;
    EmptyMutableHeaderType mutable;
    UnsecuredRequestStaticHeaderType xstatic;
    ProductElementType productType;
    OrderDetailsType orderDetails;
    DataTransfer dataTransfer;
    OrderData orderData;
    EbicsUnsecuredRequest request;
    orderDetails = EbicsXmlFactory.createOrderDetailsType("DZNNN", session.getUser().getNextOrderId(), orderType.getOrderType());
    productType = EbicsXmlFactory.creatProductElementType(Optional.ofNullable(AuthUtils.getUser()).map(User::getLanguage).orElse(null), session.getProduct().getName());
    try {
        xstatic = EbicsXmlFactory.createUnsecuredRequestStaticHeaderType(session.getBankID(), session.getUser().getEbicsPartner().getPartnerId(), session.getUser().getUserId(), productType, orderDetails, session.getUser().getSecurityMedium());
        mutable = EbicsXmlFactory.createEmptyMutableHeaderType();
        header = EbicsXmlFactory.createHeader(true, mutable, xstatic);
        orderData = EbicsXmlFactory.createOrderData(this.orderData);
        dataTransfer = EbicsXmlFactory.createDataTransfer(orderData);
        body = EbicsXmlFactory.createBody(dataTransfer);
        request = EbicsXmlFactory.createEbicsUnsecuredRequest(header, body, 1, "H003");
        document = EbicsXmlFactory.createEbicsUnsecuredRequestDocument(request);
    } catch (AxelorException e) {
        e.printStackTrace();
    }
}
Also used : AxelorException(com.axelor.exception.AxelorException) OrderDetailsType(com.axelor.apps.account.ebics.schema.h003.OrderDetailsType) Header(com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument.EbicsUnsecuredRequest.Header) DataTransfer(com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument.EbicsUnsecuredRequest.Body.DataTransfer) ProductElementType(com.axelor.apps.account.ebics.schema.h003.ProductElementType) OrderData(com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument.EbicsUnsecuredRequest.Body.DataTransfer.OrderData) EbicsUnsecuredRequest(com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument.EbicsUnsecuredRequest) Body(com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument.EbicsUnsecuredRequest.Body) EmptyMutableHeaderType(com.axelor.apps.account.ebics.schema.h003.EmptyMutableHeaderType) UnsecuredRequestStaticHeaderType(com.axelor.apps.account.ebics.schema.h003.UnsecuredRequestStaticHeaderType)

Example 2 with EbicsUnsecuredRequest

use of com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument.EbicsUnsecuredRequest in project axelor-open-suite by axelor.

the class EbicsXmlFactory method createEbicsUnsecuredRequestDocument.

// -----------------------------------------------------------------------------------------------------------------------------------------------
/**
 * Creates a new <code>EbicsUnsecuredRequestDocument</code> XML object
 *
 * @param ebicsUnsecuredRequest the <code>EbicsUnsecuredRequest</code> element
 * @return the <code>EbicsUnsecuredRequestDocument</code> XML object
 */
public static EbicsUnsecuredRequestDocument createEbicsUnsecuredRequestDocument(EbicsUnsecuredRequest ebicsUnsecuredRequest) {
    EbicsUnsecuredRequestDocument newEbicsUnsecuredRequestDocument = EbicsUnsecuredRequestDocument.Factory.newInstance();
    newEbicsUnsecuredRequestDocument.setEbicsUnsecuredRequest(ebicsUnsecuredRequest);
    return newEbicsUnsecuredRequestDocument;
}
Also used : EbicsUnsecuredRequestDocument(com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument)

Example 3 with EbicsUnsecuredRequest

use of com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument.EbicsUnsecuredRequest in project axelor-open-suite by axelor.

the class EbicsXmlFactory method createEbicsUnsecuredRequest.

/**
 * Creates a new <code>EbicsUnsecuredRequest</code> XML object
 *
 * @param header the <code>Header</code> element
 * @param body the <code>Body</code> element
 * @param revision the current revision
 * @param version the current version
 * @return the <code>EbicsUnsecuredRequest</code> XML object
 */
public static EbicsUnsecuredRequest createEbicsUnsecuredRequest(Header header, Body body, int revision, String version) {
    EbicsUnsecuredRequest newEbicsUnsecuredRequest = EbicsUnsecuredRequest.Factory.newInstance();
    newEbicsUnsecuredRequest.setHeader(header);
    newEbicsUnsecuredRequest.setBody(body);
    newEbicsUnsecuredRequest.setRevision(revision);
    newEbicsUnsecuredRequest.setVersion(version);
    return newEbicsUnsecuredRequest;
}
Also used : EbicsUnsecuredRequest(com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument.EbicsUnsecuredRequest)

Aggregations

EbicsUnsecuredRequest (com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument.EbicsUnsecuredRequest)2 EbicsUnsecuredRequestDocument (com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument)1 Body (com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument.EbicsUnsecuredRequest.Body)1 DataTransfer (com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument.EbicsUnsecuredRequest.Body.DataTransfer)1 OrderData (com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument.EbicsUnsecuredRequest.Body.DataTransfer.OrderData)1 Header (com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument.EbicsUnsecuredRequest.Header)1 EmptyMutableHeaderType (com.axelor.apps.account.ebics.schema.h003.EmptyMutableHeaderType)1 OrderDetailsType (com.axelor.apps.account.ebics.schema.h003.OrderDetailsType)1 ProductElementType (com.axelor.apps.account.ebics.schema.h003.ProductElementType)1 UnsecuredRequestStaticHeaderType (com.axelor.apps.account.ebics.schema.h003.UnsecuredRequestStaticHeaderType)1 AxelorException (com.axelor.exception.AxelorException)1