use of com.axelor.apps.account.ebics.schema.h003.StaticHeaderOrderDetailsType.OrderType in project axelor-open-suite by axelor.
the class EbicsXmlFactory method createStaticHeaderOrderDetailsType.
/**
* Creates a new <code>StaticHeaderOrderDetailsType</code> XML object
*
* @param orderId the order ID
* @param orderAttribute the order attribute
* @param orderType the order type
* @param orderParams the <code>FDLOrderParamsType</code> element
* @return the <code>StaticHeaderOrderDetailsType</code> XML object
*/
public static StaticHeaderOrderDetailsType createStaticHeaderOrderDetailsType(String orderId, String orderAttribute, OrderType orderType, FDLOrderParamsType orderParams) {
StaticHeaderOrderDetailsType newStaticHeaderOrderDetailsType = StaticHeaderOrderDetailsType.Factory.newInstance();
if (orderId != null) {
// newStaticHeaderOrderDetailsType.setOrderID(orderId);
}
newStaticHeaderOrderDetailsType.setOrderAttribute(com.axelor.apps.account.ebics.schema.h003.OrderAttributeType.Enum.forString(orderAttribute));
newStaticHeaderOrderDetailsType.setOrderType(orderType);
newStaticHeaderOrderDetailsType.setOrderParams(orderParams);
qualifySubstitutionGroup(newStaticHeaderOrderDetailsType.getOrderParams(), FDLOrderParamsDocument.type.getDocumentElementName(), null);
return newStaticHeaderOrderDetailsType;
}
use of com.axelor.apps.account.ebics.schema.h003.StaticHeaderOrderDetailsType.OrderType in project axelor-open-suite by axelor.
the class EbicsXmlFactory method createOrderDetailsType.
/**
* Creates a new <code>OrderDetailsType</code> XML object
*
* @param orderAttribute the order attribute
* @param orderId the order ID
* @param orderType the order type
* @return the <code>OrderDetailsType</code> XML object
*/
@SuppressWarnings("deprecation")
public static OrderDetailsType createOrderDetailsType(String orderAttribute, String orderId, String orderType) {
OrderDetailsType newOrderDetailsType = OrderDetailsType.Factory.newInstance();
newOrderDetailsType.setOrderAttribute(orderAttribute);
if (orderId != null) {
newOrderDetailsType.setOrderID(orderId);
}
newOrderDetailsType.setOrderType(orderType);
return newOrderDetailsType;
}
use of com.axelor.apps.account.ebics.schema.h003.StaticHeaderOrderDetailsType.OrderType in project axelor-open-suite by axelor.
the class SPRRequestElement method buildInitialization.
@Override
public void buildInitialization() throws AxelorException {
EbicsRequest request;
Header header;
Body body;
MutableHeaderType mutable;
StaticHeaderType xstatic;
Product product;
BankPubKeyDigests bankPubKeyDigests;
Authentication authentication;
Encryption encryption;
DataTransferRequestType dataTransfer;
DataEncryptionInfo dataEncryptionInfo;
SignatureData signatureData;
EncryptionPubKeyDigest encryptionPubKeyDigest;
StaticHeaderOrderDetailsType orderDetails;
OrderType orderType;
StandardOrderParamsType standardOrderParamsType;
UserSignature userSignature;
EbicsUser ebicsUser = session.getUser();
EbicsPartner ebicsPartner = ebicsUser.getEbicsPartner();
userSignature = new UserSignature(ebicsUser, generateName("SIG"), "A005", " ".getBytes(), " ".getBytes());
// TODO Manage the ebics ts case, with an eletronic signature of the user
userSignature.build();
userSignature.validate();
mutable = EbicsXmlFactory.createMutableHeaderType("Initialisation", null);
product = EbicsXmlFactory.createProduct(session.getProduct().getLanguage(), session.getProduct().getName());
authentication = EbicsXmlFactory.createAuthentication("X002", "http://www.w3.org/2001/04/xmlenc#sha256", decodeHex(KeyUtil.getKeyDigest(session.getBankX002Key())));
encryption = EbicsXmlFactory.createEncryption("E002", "http://www.w3.org/2001/04/xmlenc#sha256", decodeHex(KeyUtil.getKeyDigest(session.getBankE002Key())));
bankPubKeyDigests = EbicsXmlFactory.createBankPubKeyDigests(authentication, encryption);
orderType = EbicsXmlFactory.createOrderType(type.getOrderType());
standardOrderParamsType = EbicsXmlFactory.createStandardOrderParamsType();
OrderAttribute orderAttribute = new OrderAttribute(type, ebicsPartner.getEbicsTypeSelect());
orderAttribute.build();
orderDetails = EbicsXmlFactory.createStaticHeaderOrderDetailsType(ebicsUser.getNextOrderId(), orderAttribute.getOrderAttributes(), orderType, standardOrderParamsType);
xstatic = EbicsXmlFactory.createStaticHeaderType(session.getBankID(), nonce, 0, ebicsPartner.getPartnerId(), product, ebicsUser.getSecurityMedium(), ebicsUser.getUserId(), Calendar.getInstance(), orderDetails, bankPubKeyDigests);
header = EbicsXmlFactory.createEbicsRequestHeader(true, mutable, xstatic);
encryptionPubKeyDigest = EbicsXmlFactory.createEncryptionPubKeyDigest("E002", "http://www.w3.org/2001/04/xmlenc#sha256", decodeHex(KeyUtil.getKeyDigest(session.getBankX002Key())));
signatureData = EbicsXmlFactory.createSignatureData(true, EbicsUtils.encrypt(EbicsUtils.zip(userSignature.prettyPrint()), keySpec));
dataEncryptionInfo = EbicsXmlFactory.createDataEncryptionInfo(true, encryptionPubKeyDigest, generateTransactionKey());
dataTransfer = EbicsXmlFactory.createDataTransferRequestType(dataEncryptionInfo, signatureData);
body = EbicsXmlFactory.createEbicsRequestBody(dataTransfer);
request = EbicsXmlFactory.createEbicsRequest(1, "H003", header, body);
document = EbicsXmlFactory.createEbicsRequestDocument(request);
}
Aggregations