Commit 700c2bcf authored by Martin Straka's avatar Martin Straka

Refactor files on new isds structures

parent f51e75ac
This diff is collapsed.
......@@ -318,24 +318,6 @@ private:
void sendEmail(const QString &emailMessage, const QStringList &fileList,
const QString &subject, const QString &body, qint64 msgId);
/*!
* @brief Decode XML data from CMS.
*
* @param[in] rawData File content.
* @return Decoded XML data or QByteArray().
*/
static
QByteArray getXmlFromCms(const QByteArray &rawData);
/*!
* @brief Decode data from ZFO file.
*
* @param[in] base64ZfoData Base64-encoded zfo file content.
* @return Decoded raw data or QByteArray().
*/
static
QByteArray decodeZfoFile(const QByteArray &base64ZfoData);
/*!
* @brief Parse xml data of zfo file.
*
......
......@@ -113,7 +113,7 @@ bool Xml::parseDbStatusFromXml(const QByteArray &xmlData,
return (dbStatusCode == "0000");
}
QByteArray Xml::decodeMessageCmsData(const QByteArray &cmsData)
QByteArray Xml::getXmlFromCms(const QByteArray &cmsData)
{
/* decode cms and obtain message xml data - used openssl */
void *xmlContent = NULL;
......
......@@ -62,5 +62,5 @@ namespace Xml {
* @param[in] cmsData Message cms data.
* @return XML message data.
*/
QByteArray decodeMessageCmsData(const QByteArray &msgCmsData);
QByteArray getXmlFromCms(const QByteArray &msgCmsData);
}
......@@ -68,7 +68,6 @@ QList<Isds::Event> Xml::parseGetSignedMsgDeliveryInfoResponse(
return QList<Isds::Event>();
}
QList<Isds::Event> events;
QXmlStreamReader xml;
xml.addData(xmlData);
QByteArray signature;
......@@ -89,13 +88,18 @@ QList<Isds::Event> Xml::parseGetSignedMsgDeliveryInfoResponse(
/* decode signature from base64 and obtain cms message */
QByteArray cmsData = QByteArray::fromBase64(signature);
QByteArray soap = decodeMessageCmsData(cmsData);
QByteArray soap = getXmlFromCms(cmsData);
return Xml::parseDeliveryInfo(soap);
}
QList<Isds::Event> Xml::parseDeliveryInfo(const QByteArray &soap)
{
if (soap.isNull()) {
return QList<Isds::Event>();
}
/* Parse XML */
xml.clear();
QList<Isds::Event> events;
QXmlStreamReader xml;
xml.addData(soap);
while (!xml.atEnd() && !xml.hasError()){
......
......@@ -40,13 +40,20 @@ namespace Xml {
QByteArray xmlCreateSignedDeliveryInfoSoapRequest(qint64 msgId);
/*!
* @brief Parse signed message delivery info xml.
* @brief Parse signed message delivery info.
*
* @param[in] xmlData Xml Data for parsing.
* @param[out] events List of message events.
* @param[in] xmlData Xml signed delivery info for parsing.
* @param[out] txt Error description if something failed.
* @return true if success.
* @return List of delivery events.
*/
QList<Isds::Event> parseGetSignedMsgDeliveryInfoResponse(
const QByteArray &xmlData, QString &txt);
/*!
* @brief Parse xml message delivery info.
*
* @param[in] soap Xml delivery data for parsing.
* @return List of delivery events.
*/
QList<Isds::Event> parseDeliveryInfo(const QByteArray &soap);
}
......@@ -300,7 +300,7 @@ Isds::Message Xml::parseSignedMessageDownloadResponse(
/* decode signature from base64 and obtain cms message */
QByteArray cmsData = QByteArray::fromBase64(signature);
QByteArray soap = decodeMessageCmsData(cmsData);
QByteArray soap = getXmlFromCms(cmsData);
if (soap.isNull()) {
return Isds::Message();
}
......
......@@ -29,7 +29,7 @@ Isds::Message Xml::parseZfo(const QByteArray &zfoContent)
{
qDebug("%s()", __func__);
QByteArray soap = Xml::decodeMessageCmsData(zfoContent);
QByteArray soap = Xml::getXmlFromCms(zfoContent);
if (soap.isNull()) {
return Isds::Message();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment