use of com.axelor.apps.account.ebics.schema.h003.DataTransferRequestType.OrderData 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();
}
}
use of com.axelor.apps.account.ebics.schema.h003.DataTransferRequestType.OrderData in project axelor-open-suite by axelor.
the class EbicsXmlFactory method createDataTransfer.
/**
* Creates a new <code>DataTransfer</code> XML object
*
* @param orderData the <code>OrderData</code> element
* @return the <code>DataTransfer</code> XML object
*/
public static DataTransfer createDataTransfer(OrderData orderData) {
DataTransfer newDataTransfer = DataTransfer.Factory.newInstance();
newDataTransfer.setOrderData(orderData);
return newDataTransfer;
}
use of com.axelor.apps.account.ebics.schema.h003.DataTransferRequestType.OrderData 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());
}
use of com.axelor.apps.account.ebics.schema.h003.DataTransferRequestType.OrderData in project axelor-open-suite by axelor.
the class EbicsXmlFactory method createOrderData.
/**
* Creates a new <code>OrderData</code> XML object
*
* @param orderData the order data as byte array
* @return the <code>OrderData</code> XML object
*/
public static OrderData createOrderData(byte[] orderData) {
OrderData newOrderData = OrderData.Factory.newInstance();
newOrderData.setByteArrayValue(orderData);
return newOrderData;
}
use of com.axelor.apps.account.ebics.schema.h003.DataTransferRequestType.OrderData in project axelor-open-suite by axelor.
the class EbicsXmlFactory method createDataTransferRequestType.
/**
* Create the <code>DataTransferRequestType</code> XML object
*
* @param orderData the <code>
* com.axelor.apps.account.ebics.schema.h003.DataTransferRequestType.OrderData</code> element
* @return the <code>DataTransferRequestType</code> XML object
*/
public static DataTransferRequestType createDataTransferRequestType(com.axelor.apps.account.ebics.schema.h003.DataTransferRequestType.OrderData orderData) {
DataTransferRequestType newDataTransferRequestType = DataTransferRequestType.Factory.newInstance();
newDataTransferRequestType.setOrderData(orderData);
return newDataTransferRequestType;
}
Aggregations