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;
}
Beispiel #2
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;
}
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;
}
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;
}
void CConfigProvider::setValue(
	const std::string& filePath,
	const std::string& encoding,
	const std::string& valueName,
	const std::string& valueData) const {
	CAF_CM_FUNCNAME("setValue");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_STRING(filePath);
		CAF_CM_VALIDATE_STRING(encoding);
		CAF_CM_VALIDATE_STRING(valueName);
		CAF_CM_VALIDATE_STRING(valueData);

		if (encoding.compare("iniFileWithoutSection") == 0) {
			SmartPtrCIniFileWithoutSection iniFileWithoutSection;
			iniFileWithoutSection.CreateInstance();
			iniFileWithoutSection->initialize(filePath);
			iniFileWithoutSection->setValue(valueName, valueData);
		} else if (encoding.compare("iniFile") == 0) {
			std::string sectionName;
			std::string keyName;
			parseIniFileValuePath(valueName, sectionName, keyName);

			SmartPtrCIniFile iniFile;
			iniFile.CreateInstance();
			iniFile->initialize(filePath);
			iniFile->setValue(sectionName, keyName, valueData);
		} else if (encoding.compare("xmlFile") == 0) {
			std::string keyName;
			std::deque<std::string> keyPathCollection;
			parseKeyPath(valueName, keyPathCollection, keyName);

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

			const SmartPtrCXmlElement foundElement = parentXml->findOptionalChild(keyName);
			if (! foundElement.IsNull()) {
				foundElement->setValue(valueData);
			} else {
				const std::string foundAttribute = parentXml->findOptionalAttribute(keyName);
				if (! foundAttribute.empty()) {
					parentXml->setAttribute(keyName, valueData);
				} else {
					const SmartPtrCXmlElement createdElement = parentXml->createAndAddElement(keyName);
					createdElement->setValue(valueData);
				}
			}
			rootXml->saveToFile(filePath);
		} else {
			CAF_CM_EXCEPTIONEX_VA2(InvalidArgumentException, E_INVALIDARG,
				"URI encoding is not recognized - filePath: %s, encoding: %s",
				filePath.c_str(), encoding.c_str());
		}
	}
	CAF_CM_EXIT;
}
void ErrorResponseXml::add(
	const SmartPtrCErrorResponseDoc errorResponseDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("ErrorResponseXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(errorResponseDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string clientIdVal =
			BasePlatform::UuidToString(errorResponseDoc->getClientId());
		if (! clientIdVal.empty()) {
			thisXml->addAttribute("clientId", clientIdVal);
		}

		const std::string requestIdVal =
			BasePlatform::UuidToString(errorResponseDoc->getRequestId());
		if (! requestIdVal.empty()) {
			thisXml->addAttribute("requestId", requestIdVal);
		}

		const std::string pmeIdVal = errorResponseDoc->getPmeId();
		if (! pmeIdVal.empty()) {
			thisXml->addAttribute("pmeId", pmeIdVal);
		}

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

		const std::string errorMessageVal = errorResponseDoc->getErrorMessage();
		if (! errorMessageVal.empty()) {
			const SmartPtrCXmlElement errorMessageXml =
				thisXml->createAndAddElement("errorMessage");
			errorMessageXml->setValue(errorMessageVal);
		}
	}
	CAF_CM_EXIT;
}
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;
}
Beispiel #8
0
void JoinTypeXml::add(
	const SmartPtrCJoinTypeDoc joinTypeDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("JoinTypeXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(joinTypeDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string operandVal =
			EnumConvertersXml::convertOperatorTypeToString(joinTypeDoc->getOperand());
		CAF_CM_VALIDATE_STRING(operandVal);
		thisXml->addAttribute("operand", operandVal);

		const SmartPtrCClassFieldDoc dataClassLeftVal =
			joinTypeDoc->getDataClassLeft();
		CAF_CM_VALIDATE_SMARTPTR(dataClassLeftVal);

		const SmartPtrCXmlElement dataClassLeftXml =
			thisXml->createAndAddElement("dataClassLeft");
		ClassFieldXml::add(dataClassLeftVal, dataClassLeftXml);

		const SmartPtrCClassFieldDoc dataClassRightVal =
			joinTypeDoc->getDataClassRight();
		CAF_CM_VALIDATE_SMARTPTR(dataClassRightVal);

		const SmartPtrCXmlElement dataClassRightXml =
			thisXml->createAndAddElement("dataClassRight");
		ClassFieldXml::add(dataClassRightVal, dataClassRightXml);

		const std::string descriptionVal = joinTypeDoc->getDescription();
		if (! descriptionVal.empty()) {
			thisXml->addAttribute("description", descriptionVal);
		}
	}
	CAF_CM_EXIT;
}
void InstallProviderSpecXml::add(
	const SmartPtrCInstallProviderSpecDoc installProviderSpecDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("InstallProviderSpecXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(installProviderSpecDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

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

		const std::string providerNamespaceVal = installProviderSpecDoc->getProviderNamespace();
		CAF_CM_VALIDATE_STRING(providerNamespaceVal);
		thisXml->addAttribute("providerNamespace", providerNamespaceVal);

		const std::string providerNameVal = installProviderSpecDoc->getProviderName();
		CAF_CM_VALIDATE_STRING(providerNameVal);
		thisXml->addAttribute("providerName", providerNameVal);

		const std::string providerVersionVal = installProviderSpecDoc->getProviderVersion();
		CAF_CM_VALIDATE_STRING(providerVersionVal);
		thisXml->addAttribute("providerVersion", providerVersionVal);

		const std::deque<SmartPtrCMinPackageElemDoc> packageValVal =
			installProviderSpecDoc->getPackageCollection();
		CAF_CM_VALIDATE_STL(packageValVal);

		if (! packageValVal.empty()) {
			for (TConstIterator<std::deque<SmartPtrCMinPackageElemDoc> > packageValIter(packageValVal);
				packageValIter; packageValIter++) {
				const SmartPtrCXmlElement packageValXml =
					thisXml->createAndAddElement("package");
				MinPackageElemXml::add(*packageValIter, packageValXml);
			}
		}

		thisXml->addAttribute("version", "1.0");
	}
	CAF_CM_EXIT;
}
void CmdlMetadataXml::add(
	const SmartPtrCCmdlMetadataDoc cmdlMetadataDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("CmdlMetadataXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(cmdlMetadataDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

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

		const std::string valueVal =
			cmdlMetadataDoc->getValue();
		CAF_CM_VALIDATE_STRING(valueVal);

		const SmartPtrCXmlElement valueXml =
			thisXml->createAndAddElement("value");
		valueXml->setValue(valueVal);
	}
	CAF_CM_EXIT;
}
void MultiPmeMgmtBatchCollectionXml::add(
	const SmartPtrCMultiPmeMgmtBatchCollectionDoc multiPmeMgmtBatchCollectionDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("MultiPmeMgmtBatchCollectionXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(multiPmeMgmtBatchCollectionDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::deque<SmartPtrCMultiPmeMgmtBatchDoc> multiPmeBatchVal =
			multiPmeMgmtBatchCollectionDoc->getMultiPmeBatch();
		CAF_CM_VALIDATE_STL(multiPmeBatchVal);

		if (! multiPmeBatchVal.empty()) {
			for (TConstIterator<std::deque<SmartPtrCMultiPmeMgmtBatchDoc> > multiPmeBatchIter(multiPmeBatchVal);
				multiPmeBatchIter; multiPmeBatchIter++) {
				const SmartPtrCXmlElement multiPmeBatchXml =
					thisXml->createAndAddElement("multiPmeBatch");
				MultiPmeMgmtBatchXml::add(*multiPmeBatchIter, multiPmeBatchXml);
			}
		}
	}
	CAF_CM_EXIT;
}
void InstanceOperationCollectionXml::add(
	const SmartPtrCInstanceOperationCollectionDoc instanceOperationCollectionDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("InstanceOperationCollectionXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(instanceOperationCollectionDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::deque<SmartPtrCInstanceOperationDoc> instanceOperationVal =
			instanceOperationCollectionDoc->getInstanceOperationCollection();
		CAF_CM_VALIDATE_STL(instanceOperationVal);

		if (! instanceOperationVal.empty()) {
			for (TConstIterator<std::deque<SmartPtrCInstanceOperationDoc> > instanceOperationIter(instanceOperationVal);
				instanceOperationIter; instanceOperationIter++) {
				const SmartPtrCXmlElement instanceOperationXml =
					thisXml->createAndAddElement("instanceOperation");
				InstanceOperationXml::add(*instanceOperationIter, instanceOperationXml);
			}
		}
	}
	CAF_CM_EXIT;
}
void SchemaSummaryXml::add(
	const SmartPtrCSchemaSummaryDoc schemaSummaryDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("SchemaSummaryXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(schemaSummaryDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string providerNamespaceVal = schemaSummaryDoc->getProviderNamespace();
		CAF_CM_VALIDATE_STRING(providerNamespaceVal);
		thisXml->addAttribute("providerNamespace", providerNamespaceVal);

		const std::string providerNameVal = schemaSummaryDoc->getProviderName();
		CAF_CM_VALIDATE_STRING(providerNameVal);
		thisXml->addAttribute("providerName", providerNameVal);

		const std::string providerVersionVal = schemaSummaryDoc->getProviderVersion();
		CAF_CM_VALIDATE_STRING(providerVersionVal);
		thisXml->addAttribute("providerVersion", providerVersionVal);

		const SmartPtrCClassCollectionDoc classCollectionVal =
			schemaSummaryDoc->getClassCollection();
		CAF_CM_VALIDATE_SMARTPTR(classCollectionVal);

		const SmartPtrCXmlElement classCollectionXml =
			thisXml->createAndAddElement("classCollection");
		ClassCollectionXml::add(classCollectionVal, classCollectionXml);

		const std::string invokerPathVal = schemaSummaryDoc->getInvokerPath();
		if (! invokerPathVal.empty()) {
			thisXml->addAttribute("invokerPath", invokerPathVal);
		}
	}
	CAF_CM_EXIT;
}
void DataClassInstanceCollectionXml::add(
	const SmartPtrCDataClassInstanceCollectionDoc dataClassInstanceCollectionDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("DataClassInstanceCollectionXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(dataClassInstanceCollectionDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::deque<SmartPtrCDataClassInstanceDoc> dataClassInstanceVal =
			dataClassInstanceCollectionDoc->getDataClassInstanceCollection();
		CAF_CM_VALIDATE_STL(dataClassInstanceVal);

		if (! dataClassInstanceVal.empty()) {
			for (TConstIterator<std::deque<SmartPtrCDataClassInstanceDoc> > dataClassInstanceIter(dataClassInstanceVal);
				dataClassInstanceIter; dataClassInstanceIter++) {
				const SmartPtrCXmlElement dataClassInstanceXml =
					thisXml->createAndAddElement("dataClassInstance");
				DataClassInstanceXml::add(*dataClassInstanceIter, dataClassInstanceXml);
			}
		}
	}
	CAF_CM_EXIT;
}
void ActionClassInstanceCollectionXml::add(
    const SmartPtrCActionClassInstanceCollectionDoc actionClassInstanceCollectionDoc,
    const SmartPtrCXmlElement thisXml) {
    CAF_CM_STATIC_FUNC_VALIDATE("ActionClassInstanceCollectionXml", "add");

    CAF_CM_ENTER {
        CAF_CM_VALIDATE_SMARTPTR(actionClassInstanceCollectionDoc);
        CAF_CM_VALIDATE_SMARTPTR(thisXml);

        const std::deque<SmartPtrCActionClassInstanceDoc> actionClassInstanceVal =
        actionClassInstanceCollectionDoc->getActionClassInstanceCollection();
        CAF_CM_VALIDATE_STL(actionClassInstanceVal);

        if (! actionClassInstanceVal.empty()) {
            for (TConstIterator<std::deque<SmartPtrCActionClassInstanceDoc> > actionClassInstanceIter(actionClassInstanceVal);
            actionClassInstanceIter; actionClassInstanceIter++) {
                const SmartPtrCXmlElement actionClassInstanceXml =
                thisXml->createAndAddElement("actionClassInstance");
                ActionClassInstanceXml::add(*actionClassInstanceIter, actionClassInstanceXml);
            }
        }
    }
    CAF_CM_EXIT;
}
void AttachmentNameCollectionXml::add(
	const SmartPtrCAttachmentNameCollectionDoc attachmentNameCollectionDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("AttachmentNameCollectionXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(attachmentNameCollectionDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::deque<std::string> nameVal =
			attachmentNameCollectionDoc->getName();
		CAF_CM_VALIDATE_STL(nameVal);

		if (! nameVal.empty()) {
			for (TConstIterator<std::deque<std::string> > nameIter(nameVal);
				nameIter; nameIter++) {
				const SmartPtrCXmlElement nameXml =
					thisXml->createAndAddElement("attachmentName");
				nameXml->addAttribute("name", *nameIter);
			}
		}
	}
	CAF_CM_EXIT;
}
void MgmtCollectInstancesCollectionXml::add(
	const SmartPtrCMgmtCollectInstancesCollectionDoc mgmtCollectInstancesCollectionDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("MgmtCollectInstancesCollectionXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(mgmtCollectInstancesCollectionDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::deque<SmartPtrCMgmtCollectInstancesDoc> collectInstancesVal =
			mgmtCollectInstancesCollectionDoc->getCollectInstancesCollection();
		CAF_CM_VALIDATE_STL(collectInstancesVal);

		if (! collectInstancesVal.empty()) {
			for (TConstIterator<std::deque<SmartPtrCMgmtCollectInstancesDoc> > collectInstancesIter(collectInstancesVal);
				collectInstancesIter; collectInstancesIter++) {
				const SmartPtrCXmlElement collectInstancesXml =
					thisXml->createAndAddElement("collectInstances");
				MgmtCollectInstancesXml::add(*collectInstancesIter, collectInstancesXml);
			}
		}
	}
	CAF_CM_EXIT;
}
void LogicalRelationshipXml::add(
	const SmartPtrCLogicalRelationshipDoc logicalRelationshipDoc,
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("LogicalRelationshipXml", "add");

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(logicalRelationshipDoc);
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

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

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

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

		const std::string arityVal =
			EnumConvertersXml::convertArityTypeToString(logicalRelationshipDoc->getArity());
		CAF_CM_VALIDATE_STRING(arityVal);
		thisXml->addAttribute("arity", arityVal);

		const SmartPtrCClassCardinalityDoc dataClassLeftVal =
			logicalRelationshipDoc->getDataClassLeft();
		CAF_CM_VALIDATE_SMARTPTR(dataClassLeftVal);

		const SmartPtrCXmlElement dataClassLeftXml =
			thisXml->createAndAddElement("dataClassLeft");
		ClassCardinalityXml::add(dataClassLeftVal, dataClassLeftXml);

		const SmartPtrCClassCardinalityDoc dataClassRightVal =
			logicalRelationshipDoc->getDataClassRight();
		CAF_CM_VALIDATE_SMARTPTR(dataClassRightVal);

		const SmartPtrCXmlElement dataClassRightXml =
			thisXml->createAndAddElement("dataClassRight");
		ClassCardinalityXml::add(dataClassRightVal, dataClassRightXml);

		const std::deque<SmartPtrCJoinTypeDoc> joinVal =
			logicalRelationshipDoc->getJoinCollection();
		CAF_CM_VALIDATE_STL(joinVal);

		if (! joinVal.empty()) {
			for (TConstIterator<std::deque<SmartPtrCJoinTypeDoc> > joinIter(joinVal);
				joinIter; joinIter++) {
				const SmartPtrCXmlElement joinXml =
					thisXml->createAndAddElement("join");
				JoinTypeXml::add(*joinIter, joinXml);
			}
		}

		const std::string descriptionVal = logicalRelationshipDoc->getDescription();
		if (! descriptionVal.empty()) {
			thisXml->addAttribute("description", descriptionVal);
		}
	}
	CAF_CM_EXIT;
}