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;
}
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;
}
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);
}
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());
}
Aggregations