DRDE/ACTK1_0/se/ACProxyCommand.cpp

48 lines
1.6 KiB
C++
Raw Normal View History

2014-01-24 22:23:30 +00:00
#include "common/ErrorPkg.hpp"
#include "se/CLTRID.hpp"
#include "se/IllegalArgException.hpp"
2014-01-28 18:16:48 +00:00
#include "se/ACProxyCommand.hpp"
2014-01-24 22:23:30 +00:00
#include "xml/XMLHelper.hpp"
2014-01-28 18:16:48 +00:00
ACProxyCommandCommand::ACProxyCommandCommand(
2014-01-24 22:23:30 +00:00
const CommandType* commandType,
const ObjectType* objectType,
const std::string& ident,
const Extension& ext) : SendSE(),
cmdType(commandType),
objType(objectType),
extension(ext)
{
if (commandType == NULL)
{
throw IllegalArgException(
ErrorPkg::getMessage("se.command.type.missing"));
}
cmdType = commandType;
command = xmlWriter->appendChild( xmlWriter->appendChild( xmlWriter->getRoot(), "extension"),
"command", extension.getURI());
command->setAttribute(XStr("xsi:schemaLocation").str(),
XStr(extension.getSchemaLocation()).str());
cmdElement = xmlWriter->appendChild(command, cmdType->getCommandName());
objElement = xmlWriter->appendChild(cmdElement, commandType->getCommandName(), objectType->getURI());
objElement->setAttribute( XStr("xsi:schemaLocation").str(), XStr(objType->getSchemaLocation()).str());
DOMElement* element = xmlWriter->appendChild( objElement, objectType->getIdentType());
XMLHelper::setTextContent(element, ident);
}
2014-01-28 18:16:48 +00:00
std::string ACProxyCommandCommand::toXMLImpl()
2014-01-24 22:23:30 +00:00
{
XMLHelper::setTextContent(
xmlWriter->appendChild(command, "clTRID"),
CLTRID::nextVal());
return xmlWriter->toXML();
}