55 lines
1.5 KiB
C++
55 lines
1.5 KiB
C++
#include "OTE/LPECreateResponse.hpp"
|
|
#include "se/StandardObjectType.hpp"
|
|
#include "se/EPPDateFormatter.hpp"
|
|
#include "common/StringUtils.hpp"
|
|
|
|
const std::string LPECreateResponse::DOM_CR_DATE_EXPR
|
|
(LPECreateResponse::exprReplace
|
|
(CreateResponse::CR_DATE_EXPR()));
|
|
|
|
const std::string LPECreateResponse::DOM_NAME_EXPR
|
|
(LPECreateResponse::exprReplace
|
|
(CreateResponse::CRE_DATA_EXPR()) +
|
|
"/domain:name/text()");
|
|
|
|
const std::string LPECreateResponse::DOM_EX_DATE_EXPR
|
|
(LPECreateResponse::exprReplace
|
|
(CreateResponse::CRE_DATA_EXPR()) +
|
|
"/domain:exDate/text()");
|
|
|
|
LPECreateResponse::LPECreateResponse()
|
|
: CreateResponse(StandardObjectType::DOMAIN())
|
|
{
|
|
}
|
|
|
|
|
|
void LPECreateResponse::fromXML (XMLDocument *xmlDoc) throw (ParsingException)
|
|
{
|
|
CreateResponse::fromXML (xmlDoc);
|
|
|
|
if (!(resultArray[0].succeeded())) {
|
|
return;
|
|
}
|
|
|
|
try
|
|
{
|
|
name = xmlDoc->getNodeValue (DOM_NAME_EXPR);
|
|
std::string exDateStr = xmlDoc->getNodeValue (DOM_EX_DATE_EXPR);
|
|
exDate = std::auto_ptr<XMLGregorianCalendar>(EPPDateFormatter::fromXSDateTime(exDateStr));
|
|
}
|
|
catch (XPathExpressionException& e)
|
|
{
|
|
maintLogger->warning(e.getMessage());
|
|
ParsingException pe;
|
|
pe.causedBy(e);
|
|
throw pe;
|
|
}
|
|
}
|
|
|
|
std::string LPECreateResponse::exprReplace (const std::string &expr)
|
|
{
|
|
return StringUtils::replaceAll (expr,
|
|
CreateResponse::OBJ(),
|
|
StandardObjectType::DOMAIN()->getName());
|
|
}
|