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