Commit 540b1d44 authored by Karel Slaný's avatar Karel Slaný Committed by Martin Straka
Browse files

Added indentation to the GovMvCrrVbh XML request to make it more human readable.

parent ba757701
......@@ -23,36 +23,37 @@
#include "src/datovka_shared/gov_services/service/gov_mv_crr_vbh.h"
#define SRVC_XML_TEMPLATE "<?xml version='1.0' encoding='UTF-8'?>" \
"<d:root xmlns:d=\"http://software602.cz/sample\" ancestor_id=\"\" " \
"folder_id=\"\" formdata_id=\"\" fsuser_id=\"\" institute_type=\"\" " \
"ldapPass=\"\" nazev=\"\" page=\"0\" page_id=\"\" query_seq=\"2\" " \
"register=\"258\" retry=\"0\" seq=\"\" templateVersion_id=\"\" " \
"url=\"\" url_release=\"\" user_name=\"\" version=\"9.7\" " \
"xml:lang=\"cs\">" \
"<d:crr>" \
"<d:crrVypisBody>" \
"<d:zadost>" \
"<d:uid/>" \
"<d:autor/>" \
"<d:duvod/>" \
"<d:osobaRC/>" \
"<d:cisloRP_prevod/>" \
"<d:prijmeni>__repl__SURNAME__</d:prijmeni>" \
"<d:jmeno>__repl_NAME__</d:jmeno>" \
"<d:rodnePrijmeni/>" \
"<d:datumNarozeni>__repl__BIRTH_DATE__</d:datumNarozeni>" \
"<d:datumNarozeni_prevod/>" \
"<d:cisloRP>__repl__DRIVE_LICENSE_ID__</d:cisloRP>" \
"<d:vystup>PDF</d:vystup>" \
"</d:zadost>" \
"</d:crrVypisBody>" \
"<d:x509Certificate KeyName=\"\"/>" \
"<d:vydanyDokument url=\"\">" \
"<d:pdf/>" \
"</d:vydanyDokument>" \
"</d:crr>" \
"</d:root>"
static const char xml_template[] =
"<?xml version='1.0' encoding='UTF-8'?>""\n"
"<d:root xmlns:d=\"http://software602.cz/sample\" ancestor_id=\"\" "
"folder_id=\"\" formdata_id=\"\" fsuser_id=\"\" institute_type=\"\" "
"ldapPass=\"\" nazev=\"\" page=\"0\" page_id=\"\" query_seq=\"2\" "
"register=\"258\" retry=\"0\" seq=\"\" templateVersion_id=\"\" "
"url=\"\" url_release=\"\" user_name=\"\" version=\"9.7\" "
"xml:lang=\"cs\">""\n"
" <d:crr>""\n"
" <d:crrVypisBody>""\n"
" <d:zadost>""\n"
" <d:uid/>""\n"
" <d:autor/>""\n"
" <d:duvod/>""\n"
" <d:osobaRC/>""\n"
" <d:cisloRP_prevod/>""\n"
" <d:prijmeni>__repl__SURNAME__</d:prijmeni>""\n"
" <d:jmeno>__repl_NAME__</d:jmeno>""\n"
" <d:rodnePrijmeni/>""\n"
" <d:datumNarozeni>__repl__BIRTH_DATE__</d:datumNarozeni>""\n"
" <d:datumNarozeni_prevod/>""\n"
" <d:cisloRP>__repl__DRIVE_LICENSE_ID__</d:cisloRP>""\n"
" <d:vystup>PDF</d:vystup>""\n"
" </d:zadost>""\n"
" </d:crrVypisBody>""\n"
" <d:x509Certificate KeyName=\"\"/>""\n"
" <d:vydanyDokument url=\"\">""\n"
" <d:pdf/>""\n"
" </d:vydanyDokument>""\n"
" </d:crr>""\n"
"</d:root>";
GovMvCrrVbh::GovMvCrrVbh(void)
: m_drivingLicenceId()
......@@ -140,7 +141,7 @@ bool GovMvCrrVbh::haveAllRequiredFields(void) const
QByteArray GovMvCrrVbh::binaryXmlContent(
const Isds::DbOwnerInfo &dbOwnerInfo) const
{
QString xml(QStringLiteral(SRVC_XML_TEMPLATE));
QString xml(xml_template);
xml.replace("__repl_NAME__", dbOwnerInfo.personName().firstName());
xml.replace("__repl__SURNAME__", dbOwnerInfo.personName().lastName());
xml.replace("__repl__BIRTH_DATE__", dbOwnerInfo.birthInfo().date().toString("yyyy-MM-dd"));
......
......@@ -44,16 +44,8 @@
#define GOV_SRV_XML_RPID "rpid"
/*!
* @brief Encapsulates some mandatory XML information.
* @brief Describes a form field.
*/
class XmlRequiredFields {
public:
QString ic;
QString rpId;
QString from;
QString to;
};
class RequiredInput {
public:
RequiredInput(void)
......@@ -142,6 +134,13 @@ public:
virtual
QList<RequiredInput> requiredFields(void) const = 0;
/*!
* @brief Set service input data.
*
* @param[in] key Key identifying the data.
* @param[in] val Value to be set.
* @return True if data were set, false on any error.
*/
virtual
bool setRequiredField(const QString &key, const QString &val) = 0;
......
......@@ -123,8 +123,8 @@ void Gov::loadServicesToModel(const QVariant &srvcModelVariant) const
GovServiceListModel *srvcModel =
GovServiceListModel::fromVariant(srvcModelVariant);
if (Q_UNLIKELY(srvcModel == Q_NULLPTR)) {
Q_ASSERT(0);
logErrorNL("%s", "Cannot access gov services model.");
Q_ASSERT(0);
return;
}
......
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