Search in sources :

Example 1 with UnsecuredRequestStaticHeaderType

use of com.axelor.apps.account.ebics.schema.h003.UnsecuredRequestStaticHeaderType 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 UnsecuredRequestStaticHeaderType

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

the class EbicsXmlFactory method createUnsecuredRequestStaticHeaderType.

/**
 * Creates a new <code>EmptyMutableHeaderType</code> XML object
 *
 * @param hostId the host ID
 * @param partnerId the partner ID
 * @param userId the user ID
 * @param product the <code>ProductElementType</code> element
 * @param orderDetails the <code>OrderDetailsType</code> element
 * @param securityMedium the security medium
 * @return the <code>EmptyMutableHeaderType</code> XML object
 */
public static UnsecuredRequestStaticHeaderType createUnsecuredRequestStaticHeaderType(String hostId, String partnerId, String userId, ProductElementType product, OrderDetailsType orderDetails, String securityMedium) {
    UnsecuredRequestStaticHeaderType newUnsecuredRequestStaticHeaderType = UnsecuredRequestStaticHeaderType.Factory.newInstance();
    newUnsecuredRequestStaticHeaderType.setHostID(hostId);
    newUnsecuredRequestStaticHeaderType.setPartnerID(partnerId);
    newUnsecuredRequestStaticHeaderType.setUserID(userId);
    newUnsecuredRequestStaticHeaderType.setProduct(product);
    newUnsecuredRequestStaticHeaderType.setOrderDetails(orderDetails);
    newUnsecuredRequestStaticHeaderType.setSecurityMedium(securityMedium);
    return newUnsecuredRequestStaticHeaderType;
}
Also used : UnsecuredRequestStaticHeaderType(com.axelor.apps.account.ebics.schema.h003.UnsecuredRequestStaticHeaderType)

Example 3 with UnsecuredRequestStaticHeaderType

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

the class EbicsXmlFactory method createHeader.

/**
 * Creates a new <code>Header</code> XML object
 *
 * @param authenticate should authenticate?
 * @param mutable the <code>EmptyMutableHeaderType</code> element
 * @param xstatic the <code>UnsecuredRequestStaticHeaderType</code> element
 * @return the <code>Header</code> XML object
 */
public static Header createHeader(boolean authenticate, EmptyMutableHeaderType mutable, UnsecuredRequestStaticHeaderType xstatic) {
    Header newHeader = Header.Factory.newInstance();
    newHeader.setAuthenticate(authenticate);
    newHeader.setMutable(mutable);
    newHeader.setStatic(xstatic);
    return newHeader;
}
Also used : Header(com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument.EbicsUnsecuredRequest.Header)

Aggregations

Header (com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument.EbicsUnsecuredRequest.Header)2 UnsecuredRequestStaticHeaderType (com.axelor.apps.account.ebics.schema.h003.UnsecuredRequestStaticHeaderType)2 EbicsUnsecuredRequest (com.axelor.apps.account.ebics.schema.h003.EbicsUnsecuredRequestDocument.EbicsUnsecuredRequest)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 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 AxelorException (com.axelor.exception.AxelorException)1