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