Search in sources :

Example 1 with SegmentNumber

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

the class EbicsXmlFactory method createSegmentNumber.

/**
 * Creates a new <code>SegmentNumber</code> XML object
 *
 * @param segmentNumber the segment number
 * @param lastSegment is the last segment?
 * @return the <code>SegmentNumber</code> XML object
 */
public static SegmentNumber createSegmentNumber(long segmentNumber, boolean lastSegment) {
    SegmentNumber newSegmentNumber = SegmentNumber.Factory.newInstance();
    newSegmentNumber.setLongValue(segmentNumber);
    newSegmentNumber.setLastSegment(lastSegment);
    return newSegmentNumber;
}
Also used : SegmentNumber(com.axelor.apps.account.ebics.schema.h003.MutableHeaderType.SegmentNumber)

Example 2 with SegmentNumber

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

the class EbicsXmlFactory method createMutableHeaderType.

/**
 * Creates a new <code>MutableHeaderType</code> XML object
 *
 * @param transactionPhase the transaction phase
 * @param segmentNumber the <code>SegmentNumber</code> element
 * @return the <code>MutableHeaderType</code> XML object
 */
public static MutableHeaderType createMutableHeaderType(String transactionPhase, SegmentNumber segmentNumber) {
    MutableHeaderType newMutableHeaderType = MutableHeaderType.Factory.newInstance();
    newMutableHeaderType.setTransactionPhase(Enum.forString(transactionPhase));
    if (segmentNumber != null) {
        newMutableHeaderType.setSegmentNumber(segmentNumber);
    }
    return newMutableHeaderType;
}
Also used : EmptyMutableHeaderType(com.axelor.apps.account.ebics.schema.h003.EmptyMutableHeaderType) MutableHeaderType(com.axelor.apps.account.ebics.schema.h003.MutableHeaderType)

Example 3 with SegmentNumber

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

the class DTransferRequestElement method buildTransfer.

@Override
public void buildTransfer() throws AxelorException {
    EbicsRequest request;
    Header header;
    Body body;
    MutableHeaderType mutable;
    SegmentNumber segmentNumber;
    StaticHeaderType xstatic;
    segmentNumber = EbicsXmlFactory.createSegmentNumber(this.segmentNumber, lastSegment);
    mutable = EbicsXmlFactory.createMutableHeaderType("Transfer", segmentNumber);
    xstatic = EbicsXmlFactory.createStaticHeaderType(session.getBankID(), transactionId);
    header = EbicsXmlFactory.createEbicsRequestHeader(true, mutable, xstatic);
    body = EbicsXmlFactory.createEbicsRequestBody();
    request = EbicsXmlFactory.createEbicsRequest(1, "H003", header, body);
    document = EbicsXmlFactory.createEbicsRequestDocument(request);
}
Also used : EbicsRequest(com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest) MutableHeaderType(com.axelor.apps.account.ebics.schema.h003.MutableHeaderType) SegmentNumber(com.axelor.apps.account.ebics.schema.h003.MutableHeaderType.SegmentNumber) Header(com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Header) StaticHeaderType(com.axelor.apps.account.ebics.schema.h003.StaticHeaderType) Body(com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Body)

Example 4 with SegmentNumber

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

the class UTransferRequestElement method buildTransfer.

@Override
public void buildTransfer() throws AxelorException {
    EbicsRequest request;
    Header header;
    Body body;
    MutableHeaderType mutable;
    SegmentNumber segmentNumber;
    StaticHeaderType xstatic;
    OrderData orderData;
    DataTransferRequestType dataTransfer;
    segmentNumber = EbicsXmlFactory.createSegmentNumber(this.segmentNumber, lastSegment);
    mutable = EbicsXmlFactory.createMutableHeaderType("Transfer", segmentNumber);
    xstatic = EbicsXmlFactory.createStaticHeaderType(session.getBankID(), transactionId);
    header = EbicsXmlFactory.createEbicsRequestHeader(true, mutable, xstatic);
    orderData = EbicsXmlFactory.createEbicsRequestOrderData(IOUtils.getFactoryContent(content));
    dataTransfer = EbicsXmlFactory.createDataTransferRequestType(orderData);
    // TODO CHECK
    body = EbicsXmlFactory.createEbicsRequestBody(dataTransfer);
    request = EbicsXmlFactory.createEbicsRequest(1, "H003", header, body);
    document = EbicsXmlFactory.createEbicsRequestDocument(request);
    ByteArrayOutputStream bout = new ByteArrayOutputStream();
    try {
        this.save(bout);
    } catch (JDOMException e) {
        // TODO Bloc catch généré automatiquement
        e.printStackTrace();
    }
    System.out.println("Requete data ----------------------------------------------------------------------------");
    System.out.println(bout.toString());
}
Also used : EbicsRequest(com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest) MutableHeaderType(com.axelor.apps.account.ebics.schema.h003.MutableHeaderType) SegmentNumber(com.axelor.apps.account.ebics.schema.h003.MutableHeaderType.SegmentNumber) DataTransferRequestType(com.axelor.apps.account.ebics.schema.h003.DataTransferRequestType) Header(com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Header) StaticHeaderType(com.axelor.apps.account.ebics.schema.h003.StaticHeaderType) OrderData(com.axelor.apps.account.ebics.schema.h003.DataTransferRequestType.OrderData) ByteArrayOutputStream(java.io.ByteArrayOutputStream) JDOMException(org.jdom.JDOMException) Body(com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Body)

Aggregations

MutableHeaderType (com.axelor.apps.account.ebics.schema.h003.MutableHeaderType)3 SegmentNumber (com.axelor.apps.account.ebics.schema.h003.MutableHeaderType.SegmentNumber)3 EbicsRequest (com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest)2 Body (com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Body)2 Header (com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Header)2 StaticHeaderType (com.axelor.apps.account.ebics.schema.h003.StaticHeaderType)2 DataTransferRequestType (com.axelor.apps.account.ebics.schema.h003.DataTransferRequestType)1 OrderData (com.axelor.apps.account.ebics.schema.h003.DataTransferRequestType.OrderData)1 EmptyMutableHeaderType (com.axelor.apps.account.ebics.schema.h003.EmptyMutableHeaderType)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 JDOMException (org.jdom.JDOMException)1