Ejemplo n.º 1
0
void PropertyXml::add(
	const SmartPtrCPropertyDoc propertyDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("PropertyXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(propertyDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string nameVal = propertyDoc->getName();
		CAF_CM_VALIDATE_STRING(nameVal);
		thisXml->addAttribute("name", nameVal);

		const std::string typeVal =
			EnumConvertersXml::convertPropertyTypeToString(propertyDoc->getType());
		CAF_CM_VALIDATE_STRING(typeVal);
		thisXml->addAttribute("type", typeVal);

		const std::deque<std::string> valueVal =
			propertyDoc->getValue();
		CAF_CM_VALIDATE_STL(valueVal);

		if (! valueVal.empty()) {
			for (TConstIterator<std::deque<std::string> > valueIter(valueVal);
				valueIter; valueIter++) {
				const SmartPtrCXmlElement valueXml =
					thisXml->createAndAddElement("value");
				valueXml->setValue(*valueIter);
			}
		}
	}
	CAF_CM_EXIT;
}
Ejemplo n.º 2
0
void ClassFieldXml::add(
	const SmartPtrCClassFieldDoc classFieldDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("ClassFieldXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(classFieldDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string namespaceValVal = classFieldDoc->getNamespaceVal();
		CAF_CM_VALIDATE_STRING(namespaceValVal);
		thisXml->addAttribute("namespace", namespaceValVal);

		const std::string nameVal = classFieldDoc->getName();
		CAF_CM_VALIDATE_STRING(nameVal);
		thisXml->addAttribute("name", nameVal);

		const std::string versionVal = classFieldDoc->getVersion();
		CAF_CM_VALIDATE_STRING(versionVal);
		thisXml->addAttribute("version", versionVal);

		const std::string fieldVal = classFieldDoc->getField();
		CAF_CM_VALIDATE_STRING(fieldVal);
		thisXml->addAttribute("field", fieldVal);
	}
	CAF_CM_EXIT;
}
Ejemplo n.º 3
0
void ResponseHeaderXml::add(
	const SmartPtrCResponseHeaderDoc responseHeaderDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("ResponseHeaderXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(responseHeaderDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string versionVal = responseHeaderDoc->getVersion();
		CAF_CM_VALIDATE_STRING(versionVal);
		thisXml->addAttribute("version", versionVal);

		const std::string createdDateTimeVal = responseHeaderDoc->getCreatedDateTime();
		CAF_CM_VALIDATE_STRING(createdDateTimeVal);
		thisXml->addAttribute("createdDateTime", createdDateTimeVal);

		const std::string sequenceNumberVal =
				CStringConv::toString<uint32>(responseHeaderDoc->getSequenceNumber());
		CAF_CM_VALIDATE_STRING(sequenceNumberVal);
		thisXml->addAttribute("sequenceNumber", sequenceNumberVal);

		const std::string isFinalResponseVal = responseHeaderDoc->getIsFinalResponse() ? "true" : "false";
		CAF_CM_VALIDATE_STRING(isFinalResponseVal);
		thisXml->addAttribute("isFinalResponse", isFinalResponseVal);

		const std::string sessionIdVal =
			BasePlatform::UuidToString(responseHeaderDoc->getSessionId());
		if (! sessionIdVal.empty()) {
			thisXml->addAttribute("sessionId", sessionIdVal);
		}
	}
	CAF_CM_EXIT;
}
SmartPtrCAttachmentNameCollectionDoc AttachmentNameCollectionXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("AttachmentNameCollectionXml", "parse");

	SmartPtrCAttachmentNameCollectionDoc attachmentNameCollectionDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const CXmlElement::SmartPtrCElementCollection nameChildrenXml =
			thisXml->findRequiredChildren("attachmentName");

		std::deque<std::string> nameVal;
		if (! nameChildrenXml.IsNull() && ! nameChildrenXml->empty()) {
			for (TConstIterator<CXmlElement::CElementCollection> nameXmlIter(*nameChildrenXml);
				nameXmlIter; nameXmlIter++) {
				const SmartPtrCXmlElement nameXml = nameXmlIter->second;
				const std::string name = nameXml->findRequiredAttribute("name");
				nameVal.push_back(name);
			}
		}

		attachmentNameCollectionDoc.CreateInstance();
		attachmentNameCollectionDoc->initialize(
			nameVal);
	}
	CAF_CM_EXIT;

	return attachmentNameCollectionDoc;
}
Ejemplo n.º 5
0
SmartPtrCCmdlUnionDoc CmdlUnionXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("CmdlUnionXml", "parse");

	SmartPtrCCmdlUnionDoc cmdlUnionDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string namespaceValStrVal =
			thisXml->findRequiredAttribute("namespace");
		const std::string namespaceValVal = namespaceValStrVal;

		const std::string nameStrVal =
			thisXml->findRequiredAttribute("name");
		const std::string nameVal = nameStrVal;

		const std::string versionStrVal =
			thisXml->findRequiredAttribute("version");
		const std::string versionVal = versionStrVal;

		cmdlUnionDoc.CreateInstance();
		cmdlUnionDoc->initialize(
			namespaceValVal,
			nameVal,
			versionVal);
	}
	CAF_CM_EXIT;

	return cmdlUnionDoc;
}
void ActionClassInstanceXml::add(
	const SmartPtrCActionClassInstanceDoc actionClassInstanceDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("ActionClassInstanceXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(actionClassInstanceDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string namespaceValVal = actionClassInstanceDoc->getNamespaceVal();
		CAF_CM_VALIDATE_STRING(namespaceValVal);
		thisXml->addAttribute("namespace", namespaceValVal);

		const std::string nameVal = actionClassInstanceDoc->getName();
		CAF_CM_VALIDATE_STRING(nameVal);
		thisXml->addAttribute("name", nameVal);

		const std::string versionVal = actionClassInstanceDoc->getVersion();
		CAF_CM_VALIDATE_STRING(versionVal);
		thisXml->addAttribute("version", versionVal);

		const SmartPtrCInstanceOperationCollectionDoc instanceOperationCollectionVal =
			actionClassInstanceDoc->getInstanceOperationCollection();
		CAF_CM_VALIDATE_SMARTPTR(instanceOperationCollectionVal);

		const SmartPtrCXmlElement instanceOperationCollectionXml =
			thisXml->createAndAddElement("instanceOperationCollection");
		InstanceOperationCollectionXml::add(instanceOperationCollectionVal, instanceOperationCollectionXml);
	}
	CAF_CM_EXIT;
}
Ejemplo n.º 7
0
SmartPtrCXmlElement CConfigProvider::findXmlElement(
	const std::deque<std::string>& keyPathCollection,
	const SmartPtrCXmlElement& rootXml) const {
	CAF_CM_FUNCNAME("findXmlElement");

	SmartPtrCXmlElement xmlRc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_STL(keyPathCollection);
		CAF_CM_VALIDATE_SMARTPTR(rootXml);

		xmlRc = rootXml;
		for (std::deque<std::string>::const_iterator keyPathIter = keyPathCollection.begin();
			keyPathIter != keyPathCollection.end();
			keyPathIter++) {
			const std::string keyPath = *keyPathIter;

			if (keyPathIter == keyPathCollection.begin()) {
				if (xmlRc->getName().compare(keyPath) != 0) {
					CAF_CM_EXCEPTIONEX_VA2(NoSuchElementException, ERROR_NOT_FOUND,
						"Root element does not match - %s != %s", keyPath.c_str(), xmlRc->getName().c_str());
				}
			} else {
				xmlRc = xmlRc->findRequiredChild(keyPath);
			}
		}
	}
	CAF_CM_EXIT;

	return xmlRc;
}
Ejemplo n.º 8
0
SmartPtrCLoggingLevelElemDoc LoggingLevelElemXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("LoggingLevelElemXml", "parse");

	SmartPtrCLoggingLevelElemDoc loggingLevelElemDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string componentStrVal =
			thisXml->findRequiredAttribute("component");
		LOGGINGCOMPONENT_TYPE componentVal = LOGGINGCOMPONENT_NONE;
		if (! componentStrVal.empty()) {
			componentVal = EnumConvertersXml::convertStringToLoggingComponentType(componentStrVal);
		}

		const std::string levelStrVal =
			thisXml->findRequiredAttribute("level");
		LOGGINGLEVEL_TYPE levelVal = LOGGINGLEVEL_NONE;
		if (! levelStrVal.empty()) {
			levelVal = EnumConvertersXml::convertStringToLoggingLevelType(levelStrVal);
		}

		loggingLevelElemDoc.CreateInstance();
		loggingLevelElemDoc->initialize(
			componentVal,
			levelVal);
	}
	CAF_CM_EXIT;

	return loggingLevelElemDoc;
}
Ejemplo n.º 9
0
SmartPtrCEventKeyDoc EventKeyXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("EventKeyXml", "parse");

	SmartPtrCEventKeyDoc eventKeyDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string nameStrVal =
			thisXml->findRequiredAttribute("name");
		const std::string nameVal = nameStrVal;

		const std::string valueStrVal =
			thisXml->findRequiredAttribute("value");
		const std::string valueVal = valueStrVal;

		eventKeyDoc.CreateInstance();
		eventKeyDoc->initialize(
			nameVal,
			valueVal);
	}
	CAF_CM_EXIT;

	return eventKeyDoc;
}
Ejemplo n.º 10
0
SmartPtrCCmdlMetadataDoc CmdlMetadataXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("CmdlMetadataXml", "parse");

	SmartPtrCCmdlMetadataDoc cmdlMetadataDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string nameStrVal =
			thisXml->findRequiredAttribute("name");
		const std::string nameVal = nameStrVal;

		const SmartPtrCXmlElement valueXml =
			thisXml->findRequiredChild("value");

		std::string valueVal;
		if (! valueXml.IsNull()) {
			valueVal = valueXml->getValue();
		}

		cmdlMetadataDoc.CreateInstance();
		cmdlMetadataDoc->initialize(
			nameVal,
			valueVal);
	}
	CAF_CM_EXIT;

	return cmdlMetadataDoc;
}
Ejemplo n.º 11
0
void DiagDeleteValueXml::add(
	const SmartPtrCDiagDeleteValueDoc diagDeleteValueDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("DiagDeleteValueXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(diagDeleteValueDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string jobIdVal =
			BasePlatform::UuidToString(diagDeleteValueDoc->getJobId());
		CAF_CM_VALIDATE_STRING(jobIdVal);
		thisXml->addAttribute("jobId", jobIdVal);

		const std::string fileAliasVal = diagDeleteValueDoc->getFileAlias();
		CAF_CM_VALIDATE_STRING(fileAliasVal);
		thisXml->addAttribute("fileAlias", fileAliasVal);

		const std::string valueNameVal =
			diagDeleteValueDoc->getValueName();
		CAF_CM_VALIDATE_STRING(valueNameVal);

		const SmartPtrCXmlElement valueNameXml =
			thisXml->createAndAddElement("valueName");
		valueNameXml->setValue(valueNameVal);
	}
	CAF_CM_EXIT;
}
SmartPtrCInstallProviderSpecDoc InstallProviderSpecXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("InstallProviderSpecXml", "parse");

	SmartPtrCInstallProviderSpecDoc installProviderSpecDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string clientIdStrVal =
			thisXml->findRequiredAttribute("clientId");
		UUID clientIdVal = CAFCOMMON_GUID_NULL;
		if (! clientIdStrVal.empty()) {
			BasePlatform::UuidFromString(clientIdStrVal.c_str(), clientIdVal);
		}

		const std::string providerNamespaceStrVal =
			thisXml->findRequiredAttribute("providerNamespace");
		const std::string providerNamespaceVal = providerNamespaceStrVal;

		const std::string providerNameStrVal =
			thisXml->findRequiredAttribute("providerName");
		const std::string providerNameVal = providerNameStrVal;

		const std::string providerVersionStrVal =
			thisXml->findRequiredAttribute("providerVersion");
		const std::string providerVersionVal = providerVersionStrVal;

		const CXmlElement::SmartPtrCElementCollection packageValChildrenXml =
			thisXml->findRequiredChildren("package");

		std::deque<SmartPtrCMinPackageElemDoc> packageValVal;
		if (! packageValChildrenXml.IsNull() && ! packageValChildrenXml->empty()) {
			for (TConstIterator<CXmlElement::CElementCollection> packageValXmlIter(*packageValChildrenXml);
				packageValXmlIter; packageValXmlIter++) {
				const SmartPtrCXmlElement packageValXml = packageValXmlIter->second;
				const SmartPtrCMinPackageElemDoc packageValDoc =
					MinPackageElemXml::parse(packageValXml);
				packageValVal.push_back(packageValDoc);
			}
		}

		installProviderSpecDoc.CreateInstance();
		installProviderSpecDoc->initialize(
			clientIdVal,
			providerNamespaceVal,
			providerNameVal,
			providerVersionVal,
			packageValVal);
	}
	CAF_CM_EXIT;

	return installProviderSpecDoc;
}
Ejemplo n.º 13
0
SmartPtrCErrorResponseDoc ErrorResponseXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("ErrorResponseXml", "parse");

	SmartPtrCErrorResponseDoc errorResponseDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string clientIdStrVal =
			thisXml->findOptionalAttribute("clientId");
		UUID clientIdVal = CAFCOMMON_GUID_NULL;
		if (! clientIdStrVal.empty()) {
			BasePlatform::UuidFromString(clientIdStrVal.c_str(), clientIdVal);
		}

		const std::string requestIdStrVal =
			thisXml->findOptionalAttribute("requestId");
		UUID requestIdVal = CAFCOMMON_GUID_NULL;
		if (! requestIdStrVal.empty()) {
			BasePlatform::UuidFromString(requestIdStrVal.c_str(), requestIdVal);
		}

		const std::string pmeIdVal =
			thisXml->findOptionalAttribute("pmeId");

		const SmartPtrCXmlElement responseHeaderXml =
			thisXml->findOptionalChild("responseHeader");
		SmartPtrCResponseHeaderDoc responseHeaderVal;
		if (! responseHeaderXml.IsNull()) {
			responseHeaderVal = ResponseHeaderXml::parse(responseHeaderXml);
		}

		const SmartPtrCXmlElement errorMessageXml =
			thisXml->findOptionalChild("errorMessage");
		std::string errorMessageVal;
		if (! errorMessageXml.IsNull()) {
			errorMessageVal = errorMessageXml->getValue();
		}

		errorResponseDoc.CreateInstance();
		errorResponseDoc->initialize(
			clientIdVal,
			requestIdVal,
			pmeIdVal,
			responseHeaderVal,
			errorMessageVal);
	}
	CAF_CM_EXIT;

	return errorResponseDoc;
}
Ejemplo n.º 14
0
std::string XmlRoots::savePersistenceToString(
    const SmartPtrCPersistenceDoc persistenceDoc) {
    CAF_CM_STATIC_FUNC_VALIDATE("XmlRoots", "savePersistenceToString");
    CAF_CM_VALIDATE_SMARTPTR(persistenceDoc);

    const std::string schemaNamespace = DocXmlUtils::getSchemaNamespace("fx");
    const std::string schemaLocation = DocXmlUtils::getSchemaLocation("fx/Persistence.xsd");

    const SmartPtrCXmlElement rootXml = CXmlUtils::createRootElement(
                                            "persistence", schemaNamespace, schemaLocation);
    PersistenceXml::add(persistenceDoc, rootXml);

    return rootXml->saveToString();
}
Ejemplo n.º 15
0
SmartPtrCDiagRequestDoc DiagRequestXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("DiagRequestXml", "parse");

	SmartPtrCDiagRequestDoc diagRequestDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string clientIdStrVal =
			thisXml->findRequiredAttribute("clientId");
		UUID clientIdVal = CAFCOMMON_GUID_NULL;
		if (! clientIdStrVal.empty()) {
			BasePlatform::UuidFromString(clientIdStrVal.c_str(), clientIdVal);
		}

		const std::string requestIdStrVal =
			thisXml->findRequiredAttribute("requestId");
		UUID requestIdVal = CAFCOMMON_GUID_NULL;
		if (! requestIdStrVal.empty()) {
			BasePlatform::UuidFromString(requestIdStrVal.c_str(), requestIdVal);
		}

		const std::string pmeIdVal =
			thisXml->findRequiredAttribute("pmeId");

		const SmartPtrCXmlElement requestHeaderXml =
			thisXml->findRequiredChild("requestHeader");

		SmartPtrCRequestHeaderDoc requestHeaderVal;
		if (! requestHeaderXml.IsNull()) {
			requestHeaderVal = RequestHeaderXml::parse(requestHeaderXml);
		}

		const SmartPtrCXmlElement batchXml =
			thisXml->findRequiredChild("batch");

		SmartPtrCDiagBatchDoc batchVal;
		if (! batchXml.IsNull()) {
			batchVal = DiagBatchXml::parse(batchXml);
		}

		diagRequestDoc.CreateInstance();
		diagRequestDoc->initialize(
			clientIdVal,
			requestIdVal,
			pmeIdVal,
			requestHeaderVal,
			batchVal);
	}
	CAF_CM_EXIT;

	return diagRequestDoc;
}
Ejemplo n.º 16
0
SmartPtrCResponseHeaderDoc ResponseHeaderXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("ResponseHeaderXml", "parse");

	SmartPtrCResponseHeaderDoc responseHeaderDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string versionVal =
			thisXml->findRequiredAttribute("version");

		const std::string createdDateTimeVal =
			thisXml->findRequiredAttribute("createdDateTime");

		const std::string sequenceNumberStrVal =
			thisXml->findRequiredAttribute("sequenceNumber");
		uint32 sequenceNumberVal = 0;
		if (! sequenceNumberStrVal.empty()) {
			sequenceNumberVal = CStringConv::fromString<uint32>(sequenceNumberStrVal);
		}

		const std::string isFinalResponseStrVal =
			thisXml->findRequiredAttribute("isFinalResponse");
		bool isFinalResponseVal = false;
		if (! isFinalResponseStrVal.empty()) {
			isFinalResponseVal = (isFinalResponseStrVal.compare("true") == 0)  ? true : false;
		}

		const std::string sessionIdStrVal =
			thisXml->findOptionalAttribute("sessionId");
		UUID sessionIdVal = CAFCOMMON_GUID_NULL;
		if (! sessionIdStrVal.empty()) {
			BasePlatform::UuidFromString(sessionIdStrVal.c_str(), sessionIdVal);
		}

		responseHeaderDoc.CreateInstance();
		responseHeaderDoc->initialize(
			versionVal,
			createdDateTimeVal,
			sequenceNumberVal,
			isFinalResponseVal,
			sessionIdVal);
	}
	CAF_CM_EXIT;

	return responseHeaderDoc;
}
SmartPtrCMgmtCollectInstancesCollectionDoc MgmtCollectInstancesCollectionXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("MgmtCollectInstancesCollectionXml", "parse");

	SmartPtrCMgmtCollectInstancesCollectionDoc mgmtCollectInstancesCollectionDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const CXmlElement::SmartPtrCElementCollection collectInstancesChildrenXml =
			thisXml->findRequiredChildren("collectInstances");

		std::deque<SmartPtrCMgmtCollectInstancesDoc> collectInstancesVal;
		if (! collectInstancesChildrenXml.IsNull() && ! collectInstancesChildrenXml->empty()) {
			for (TConstIterator<CXmlElement::CElementCollection> collectInstancesXmlIter(*collectInstancesChildrenXml);
				collectInstancesXmlIter; collectInstancesXmlIter++) {
				const SmartPtrCXmlElement collectInstancesXml = collectInstancesXmlIter->second;
				const SmartPtrCMgmtCollectInstancesDoc collectInstancesDoc =
					MgmtCollectInstancesXml::parse(collectInstancesXml);
				collectInstancesVal.push_back(collectInstancesDoc);
			}
		}

		mgmtCollectInstancesCollectionDoc.CreateInstance();
		mgmtCollectInstancesCollectionDoc->initialize(
			collectInstancesVal);
	}
	CAF_CM_EXIT;

	return mgmtCollectInstancesCollectionDoc;
}
SmartPtrCMultiPmeMgmtBatchCollectionDoc MultiPmeMgmtBatchCollectionXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("MultiPmeMgmtBatchCollectionXml", "parse");

	SmartPtrCMultiPmeMgmtBatchCollectionDoc multiPmeMgmtBatchCollectionDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const CXmlElement::SmartPtrCElementCollection multiPmeBatchChildrenXml =
			thisXml->findRequiredChildren("multiPmeBatch");

		std::deque<SmartPtrCMultiPmeMgmtBatchDoc> multiPmeBatchVal;
		if (! multiPmeBatchChildrenXml.IsNull() && ! multiPmeBatchChildrenXml->empty()) {
			for (TConstIterator<CXmlElement::CElementCollection> multiPmeBatchXmlIter(*multiPmeBatchChildrenXml);
				multiPmeBatchXmlIter; multiPmeBatchXmlIter++) {
				const SmartPtrCXmlElement multiPmeBatchXml = multiPmeBatchXmlIter->second;
				const SmartPtrCMultiPmeMgmtBatchDoc multiPmeBatchDoc =
					MultiPmeMgmtBatchXml::parse(multiPmeBatchXml);
				multiPmeBatchVal.push_back(multiPmeBatchDoc);
			}
		}

		multiPmeMgmtBatchCollectionDoc.CreateInstance();
		multiPmeMgmtBatchCollectionDoc->initialize(
			multiPmeBatchVal);
	}
	CAF_CM_EXIT;

	return multiPmeMgmtBatchCollectionDoc;
}
SmartPtrCActionClassInstanceCollectionDoc ActionClassInstanceCollectionXml::parse(
    const SmartPtrCXmlElement thisXml) {
    CAF_CM_STATIC_FUNC_VALIDATE("ActionClassInstanceCollectionXml", "parse");

    SmartPtrCActionClassInstanceCollectionDoc actionClassInstanceCollectionDoc;

    CAF_CM_ENTER {
        CAF_CM_VALIDATE_SMARTPTR(thisXml);

        const CXmlElement::SmartPtrCElementCollection actionClassInstanceChildrenXml =
        thisXml->findRequiredChildren("actionClassInstance");

        std::deque<SmartPtrCActionClassInstanceDoc> actionClassInstanceVal;
        if (! actionClassInstanceChildrenXml.IsNull() && ! actionClassInstanceChildrenXml->empty()) {
            for (TConstIterator<CXmlElement::CElementCollection> actionClassInstanceXmlIter(*actionClassInstanceChildrenXml);
            actionClassInstanceXmlIter; actionClassInstanceXmlIter++) {
                const SmartPtrCXmlElement actionClassInstanceXml = actionClassInstanceXmlIter->second;
                const SmartPtrCActionClassInstanceDoc actionClassInstanceDoc =
                ActionClassInstanceXml::parse(actionClassInstanceXml);
                actionClassInstanceVal.push_back(actionClassInstanceDoc);
            }
        }

        actionClassInstanceCollectionDoc.CreateInstance();
        actionClassInstanceCollectionDoc->initialize(
            actionClassInstanceVal);
    }
    CAF_CM_EXIT;

    return actionClassInstanceCollectionDoc;
}
SmartPtrCInstanceOperationCollectionDoc InstanceOperationCollectionXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("InstanceOperationCollectionXml", "parse");

	SmartPtrCInstanceOperationCollectionDoc instanceOperationCollectionDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const CXmlElement::SmartPtrCElementCollection instanceOperationChildrenXml =
			thisXml->findRequiredChildren("instanceOperation");

		std::deque<SmartPtrCInstanceOperationDoc> instanceOperationVal;
		if (! instanceOperationChildrenXml.IsNull() && ! instanceOperationChildrenXml->empty()) {
			for (TConstIterator<CXmlElement::CElementCollection> instanceOperationXmlIter(*instanceOperationChildrenXml);
				instanceOperationXmlIter; instanceOperationXmlIter++) {
				const SmartPtrCXmlElement instanceOperationXml = instanceOperationXmlIter->second;
				const SmartPtrCInstanceOperationDoc instanceOperationDoc =
					InstanceOperationXml::parse(instanceOperationXml);
				instanceOperationVal.push_back(instanceOperationDoc);
			}
		}

		instanceOperationCollectionDoc.CreateInstance();
		instanceOperationCollectionDoc->initialize(
			instanceOperationVal);
	}
	CAF_CM_EXIT;

	return instanceOperationCollectionDoc;
}
void ProviderEventResponseXml::add(
	const SmartPtrCProviderEventResponseDoc providerEventResponseDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("ProviderEventResponseXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(providerEventResponseDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string pmeIdVal = providerEventResponseDoc->getPmeId();
		CAF_CM_VALIDATE_STRING(pmeIdVal);
		thisXml->addAttribute("pmeId", pmeIdVal);

		const SmartPtrCResponseHeaderDoc responseHeaderVal =
			providerEventResponseDoc->getResponseHeader();
		if (! responseHeaderVal.IsNull()) {
			const SmartPtrCXmlElement responseHeaderXml =
				thisXml->createAndAddElement("responseHeader");
			ResponseHeaderXml::add(responseHeaderVal, responseHeaderXml);
		}

		const SmartPtrCEventManifestDoc manifestVal =
			providerEventResponseDoc->getManifest();
		CAF_CM_VALIDATE_SMARTPTR(manifestVal);

		const SmartPtrCXmlElement manifestXml =
			thisXml->createAndAddElement("manifest");
		EventManifestXml::add(manifestVal, manifestXml);

		const SmartPtrCEventKeyCollectionDoc eventKeyCollectionVal =
			providerEventResponseDoc->getEventKeyCollection();
		if (! eventKeyCollectionVal.IsNull()) {
			const SmartPtrCXmlElement eventKeyCollectionXml =
				thisXml->createAndAddElement("eventKeyCollection");
			EventKeyCollectionXml::add(eventKeyCollectionVal, eventKeyCollectionXml);
		}

		const SmartPtrCStatisticsDoc statisticsVal =
			providerEventResponseDoc->getStatistics();
		if (! statisticsVal.IsNull()) {
			const SmartPtrCXmlElement statisticsXml =
				thisXml->createAndAddElement("statistics");
			StatisticsXml::add(statisticsVal, statisticsXml);
		}
	}
	CAF_CM_EXIT;
}
Ejemplo n.º 22
0
SmartPtrCMethodParameterDoc MethodParameterXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("MethodParameterXml", "parse");

	SmartPtrCMethodParameterDoc methodParameterDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string nameStrVal =
			thisXml->findRequiredAttribute("name");
		const std::string nameVal = nameStrVal;

		const std::string typeStrVal =
			thisXml->findRequiredAttribute("type");
		PARAMETER_TYPE typeVal = PARAMETER_NONE;
		if (! typeStrVal.empty()) {
			typeVal = EnumConvertersXml::convertStringToParameterType(typeStrVal);
		}

		const std::string isOptionalStrVal =
			thisXml->findRequiredAttribute("isOptional");
		bool isOptionalVal = false;
		if (! isOptionalStrVal.empty()) {
			isOptionalVal = (isOptionalStrVal.compare("true") == 0)  ? true : false;
		}

		const std::string isListStrVal =
			thisXml->findOptionalAttribute("isList");
		bool isListVal = false;
		if (! isListStrVal.empty()) {
			isListVal = (isListStrVal.compare("true") == 0)  ? true : false;
		}

		const std::string defaultValStrVal =
			thisXml->findOptionalAttribute("default");
		const std::string defaultValVal = defaultValStrVal;

		const std::string displayNameStrVal =
			thisXml->findOptionalAttribute("displayName");
		const std::string displayNameVal = displayNameStrVal;

		const std::string descriptionStrVal =
			thisXml->findOptionalAttribute("description");
		const std::string descriptionVal = descriptionStrVal;

		methodParameterDoc.CreateInstance();
		methodParameterDoc->initialize(
			nameVal,
			typeVal,
			isOptionalVal,
			isListVal,
			defaultValVal,
			displayNameVal,
			descriptionVal);
	}
	CAF_CM_EXIT;

	return methodParameterDoc;
}
Ejemplo n.º 23
0
std::deque<std::pair<std::string, std::string> > CConfigProvider::createXmlFilePropertyCollection(
	const std::string& filePath) const {
	CAF_CM_FUNCNAME_VALIDATE("createXmlFilePropertyCollection");

	std::deque<std::pair<std::string, std::string> > propertyCollection;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_STRING(filePath);

		const SmartPtrCXmlElement rootXml = CXmlUtils::parseFile(filePath, std::string());

		const std::string keyPath = rootXml->getName();
		createXmlPropertyCollection(keyPath, rootXml, propertyCollection);
	}
	CAF_CM_EXIT;

	return propertyCollection;
}
Ejemplo n.º 24
0
std::string CCafMessagePayload::getVersion() const {
	CAF_CM_FUNCNAME_VALIDATE("getVersion");
	CAF_CM_PRECOND_ISINITIALIZED(_isInitialized);

	SmartPtrCXmlElement headerXml = _payloadXml->findOptionalChild("requestHeader");
	if (headerXml.IsNull()) {
		headerXml = _payloadXml->findOptionalChild("responseHeader");
	}

	std::string rc;
	if (headerXml.IsNull()) {
		rc = _payloadXml->findRequiredAttribute("version");
	} else {
		rc = headerXml->findRequiredAttribute("version");
	}

	return rc;
}
Ejemplo n.º 25
0
void EventKeyXml::add(
	const SmartPtrCEventKeyDoc eventKeyDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("EventKeyXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(eventKeyDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string nameVal = eventKeyDoc->getName();
		CAF_CM_VALIDATE_STRING(nameVal);
		thisXml->addAttribute("name", nameVal);

		const std::string valueVal = eventKeyDoc->getValue();
		CAF_CM_VALIDATE_STRING(valueVal);
		thisXml->addAttribute("value", valueVal);
	}
	CAF_CM_EXIT;
}
Ejemplo n.º 26
0
SmartPtrCPropertyDoc PropertyXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("PropertyXml", "parse");

	SmartPtrCPropertyDoc propertyDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string nameStrVal =
			thisXml->findRequiredAttribute("name");
		const std::string nameVal = nameStrVal;

		const std::string typeStrVal =
			thisXml->findRequiredAttribute("type");
		PROPERTY_TYPE typeVal = PROPERTY_NONE;
		if (! typeStrVal.empty()) {
			typeVal = EnumConvertersXml::convertStringToPropertyType(typeStrVal);
		}

		const CXmlElement::SmartPtrCElementCollection valueChildrenXml =
			thisXml->findRequiredChildren("value");

		std::deque<std::string> valueVal;
		if (! valueChildrenXml.IsNull() && ! valueChildrenXml->empty()) {
			for (TConstIterator<CXmlElement::CElementCollection> valueXmlIter(*valueChildrenXml);
				valueXmlIter; valueXmlIter++) {
				const SmartPtrCXmlElement valueXml = valueXmlIter->second;
				const std::string valueDoc = valueXml->getValue();
				valueVal.push_back(valueDoc);
			}
		}

		propertyDoc.CreateInstance();
		propertyDoc->initialize(
			nameVal,
			typeVal,
			valueVal);
	}
	CAF_CM_EXIT;

	return propertyDoc;
}
Ejemplo n.º 27
0
void CConfigProvider::createXmlPropertyCollection(
	const std::string& keyPath,
	const SmartPtrCXmlElement& thisXml,
	std::deque<std::pair<std::string, std::string> >& propertyCollection) const {
	CAF_CM_FUNCNAME_VALIDATE("createXmlPropertyCollection");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_STRING(keyPath);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);
		// propertyCollection is optional

		const CXmlElement::SmartPtrCAttributeCollection attributeCollection = thisXml->getAllAttributes();
		if (! attributeCollection.IsNull() && ! attributeCollection->empty()) {
			for (TConstIterator<CXmlElement::CAttributeCollection> attributeXmlIter(*attributeCollection);
				attributeXmlIter; attributeXmlIter++) {
				const std::string attributeName = attributeXmlIter->first;
				const std::string attributeValue = attributeXmlIter->second;

				const std::string newKeyPath = keyPath + _keyPathDelimStr + attributeName;
				propertyCollection.push_back(std::make_pair(newKeyPath, attributeValue));
			}
		}

		const CXmlElement::SmartPtrCElementCollection childrenXml = thisXml->getAllChildren();
		if (! childrenXml.IsNull() && ! childrenXml->empty()) {
			for (TConstIterator<CXmlElement::CElementCollection > childrenXmlIter(*childrenXml);
				childrenXmlIter; childrenXmlIter++) {
				const SmartPtrCXmlElement childXml = childrenXmlIter->second;
				const std::string newKeyPath = keyPath + _keyPathDelimStr + childXml->getName();

				const std::string value = childXml->getValue();
				if (! value.empty()) {
					propertyCollection.push_back(std::make_pair(newKeyPath, value));
				}

				createXmlPropertyCollection(newKeyPath, childXml, propertyCollection);
			}
		}
	}
	CAF_CM_EXIT;
}
Ejemplo n.º 28
0
void DiagRequestXml::add(
	const SmartPtrCDiagRequestDoc diagRequestDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("DiagRequestXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(diagRequestDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string clientIdVal =
			BasePlatform::UuidToString(diagRequestDoc->getClientId());
		CAF_CM_VALIDATE_STRING(clientIdVal);
		thisXml->addAttribute("clientId", clientIdVal);

		const std::string requestIdVal =
			BasePlatform::UuidToString(diagRequestDoc->getRequestId());
		CAF_CM_VALIDATE_STRING(requestIdVal);
		thisXml->addAttribute("requestId", requestIdVal);

		const std::string pmeIdVal = diagRequestDoc->getPmeId();
		CAF_CM_VALIDATE_STRING(pmeIdVal);
		thisXml->addAttribute("pmeId", pmeIdVal);

		const SmartPtrCRequestHeaderDoc requestHeaderVal =
			diagRequestDoc->getRequestHeader();
		CAF_CM_VALIDATE_SMARTPTR(requestHeaderVal);

		const SmartPtrCXmlElement requestHeaderXml =
			thisXml->createAndAddElement("requestHeader");
		RequestHeaderXml::add(requestHeaderVal, requestHeaderXml);

		const SmartPtrCDiagBatchDoc batchVal =
			diagRequestDoc->getBatch();
		CAF_CM_VALIDATE_SMARTPTR(batchVal);

		const SmartPtrCXmlElement batchXml =
			thisXml->createAndAddElement("batch");
		DiagBatchXml::add(batchVal, batchXml);
	}
	CAF_CM_EXIT;
}
Ejemplo n.º 29
0
void LoggingLevelElemXml::add(
	const SmartPtrCLoggingLevelElemDoc loggingLevelElemDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("LoggingLevelElemXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(loggingLevelElemDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string componentVal =
			EnumConvertersXml::convertLoggingComponentTypeToString(loggingLevelElemDoc->getComponent());
		CAF_CM_VALIDATE_STRING(componentVal);
		thisXml->addAttribute("component", componentVal);

		const std::string levelVal =
			EnumConvertersXml::convertLoggingLevelTypeToString(loggingLevelElemDoc->getLevel());
		CAF_CM_VALIDATE_STRING(levelVal);
		thisXml->addAttribute("level", levelVal);
	}
	CAF_CM_EXIT;
}
std::string CInstallToMgmtRequestTransformerInstance::saveUninstallProviderJobToString(
	const SmartPtrCUninstallProviderJobDoc& uninstallProviderJob) {
	CAF_CM_STATIC_FUNC_VALIDATE("XmlRoots", "saveUninstallProviderJobToString");

	std::string rc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(uninstallProviderJob);

		const std::string schemaNamespace = DocXmlUtils::getSchemaNamespace("fx");

		const SmartPtrCXmlElement rootXml = CXmlUtils::createRootElement(
			"cafUninstallProviderJob", schemaNamespace);
		UninstallProviderJobXml::add(uninstallProviderJob, rootXml);

		rc = rootXml->saveToStringRaw();
	}
	CAF_CM_EXIT;

	return rc;
}