#include "se/DomainCreateCommand.hpp" #include "se/StandardObjectType.hpp" #include "xml/XMLHelper.hpp" DomainCreateCommand::DomainCreateCommand (const std::string& name, const std::string& pw, const std::string* registrantID, const std::vector* techContacts, const std::vector* nameservers, const std::vector* adminContacts, const std::vector* billingContacts, const Period* period) : CreateCommand(StandardObjectType::DOMAIN(), name) { std::vector::const_iterator p; if (period) period->appendPeriod (xmlWriter, objElement); if (nameservers) { DOMElement *ns = xmlWriter->appendChild (objElement, "ns"); for (p = nameservers->begin(); p != nameservers->end(); p++) XMLHelper::setTextContent (xmlWriter->appendChild (ns, "hostObj"), *p); } if (registrantID) { XMLHelper::setTextContent (xmlWriter->appendChild(objElement, "registrant"), *registrantID); } if (adminContacts) for (p = adminContacts->begin(); p != adminContacts->end(); p++) xmlWriter->appendChild(objElement, "contact", *p, "type", "admin"); if (techContacts) for (p = techContacts->begin(); p != techContacts->end(); p++) xmlWriter->appendChild(objElement, "contact", *p, "type", "tech"); if (billingContacts) for (p = billingContacts->begin(); p != billingContacts->end(); p++) xmlWriter->appendChild(objElement, "contact", *p, "type", "billing"); XMLHelper::setTextContent (xmlWriter->appendChild (xmlWriter->appendChild (objElement, "authInfo"), "pw"), pw); }