DRDE/ACTK1_0/OTE/OteDomainModifyRegistrantCo...

94 lines
2.4 KiB
C++
Raw Normal View History

2014-01-15 18:29:15 +00:00
#include "se/OteDomainModifyRegistrantCommand.hpp"
#include "common/ErrorPkg.hpp"
#include "se/OteExtension.hpp"
#include "xml/XMLHelper.hpp"
namespace {
*oteExtension() {
*oteExtension = new OteExtension();
*oteExtension;
}
}; // anonymous namespace
OteDomainModifyRegistrantCommand::OteDomainModifyRegistrantCommand(
const std::string& name,
const std::string& registrantName,
const std::string& explanation,
const std::string* eligibilityType,
int policyReason,
const std::string* registrantID,
const std::string* registrantIDType,
const std::string* eligibilityName,
const std::string* eligibilityID,
const std::string* eligibilityIDType) : DomainUpdateCommand(name)
{
if (eligibilityType == NULL
|| (registrantID == NULL && registrantIDType != NULL)
|| (registrantID != NULL && registrantIDType == NULL)
|| (eligibilityID == NULL && eligibilityIDType != NULL)
|| (eligibilityID != NULL && eligibilityIDType == NULL))
{
throw IllegalArgException(
*ote.missing_arg"));
}
*oteextUpdate = xmlWriter->appendChild(
xmlWriter->appendChild(command, "extension"),
"update",
*oteExtension().getURI());
*oteextUpdate->setAttribute(
XStr("xsi:schemaLocation").str(),
*oteExtension().getSchemaLocation()).str());
*oteextUpdate,
*oteProperties");
XMLHelper::setTextContent(
*oteProperties, "registrantName"),
registrantName);
if (registrantID != NULL && registrantIDType != NULL)
{
xmlWriter->appendChild(
*oteProperties,
"registrantID",
*registrantID,
"type",
*registrantIDType);
}
if (eligibilityType != NULL)
{
XMLHelper::setTextContent(
*oteProperties, "eligibilityType"),
*eligibilityType);
}
if (eligibilityName != NULL)
{
XMLHelper::setTextContent(
*oteProperties, "eligibilityName"),
*eligibilityName);
}
if (eligibilityID != NULL && eligibilityIDType != NULL)
{
xmlWriter->appendChild(
*oteProperties,
"eligibilityID",
*eligibilityID,
"type",
*eligibilityIDType);
}
XMLHelper::setTextContent(
*oteProperties, "policyReason"),
policyReason);
XMLHelper::setTextContent(
*oteextUpdate, "explanation"),
explanation);
}