+ else
+ {
+ for (subItem = item->first_node(); subItem; subItem =
+ subItem->next_sibling())
+ {
+ map< string, string > propertyMap;
+
+ strKey = subItem->name();
+
+ if (strKey.compare(INPUT_RESOURCE))
+ {
+ m_mapisHasInput[strBundleId] = true;
+ OIC_LOG_V(INFO, CONTAINER_TAG,
+ "Bundle has input (%s)",
+ strBundleId.c_str());
+ }
+
+ for (subItem2 = subItem->first_node(); subItem2;
+ subItem2 = subItem2->next_sibling())
+ {
+ string newStrKey = subItem2->name();
+ string newStrValue = subItem2->value();
+ OIC_LOG_V(INFO, CONTAINER_TAG,
+ "key: %s, value %s",
+ newStrKey.c_str(), newStrValue.c_str());
+
+ propertyMap[trim_both(newStrKey)] =
+ trim_both(newStrValue);
+ }
+
+ resourceInfoOut->resourceProperty[trim_both(strKey)].push_back(
+ propertyMap);
+ }
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+ }
+ catch (rapidxml::parse_error &e)
+ {
+ OIC_LOG(ERROR, CONTAINER_TAG, "xml parsing failed !!");
+ OIC_LOG_V(ERROR, CONTAINER_TAG, "Exception (%s)", e.what());
+ }
+ }
+ else{
+ OIC_LOG(INFO, CONTAINER_TAG, "config is not loaded yet !!");
+ }
+ }
+
+ void Configuration::getResourceConfiguration(std::string bundleId,
+ std::vector< resourceInfo > *configOutput)
+ {
+ rapidxml::xml_node< char > *bundle;
+ rapidxml::xml_node< char > *resource;
+ rapidxml::xml_node< char > *item, *subItem, *subItem2;
+
+ string strBundleId;
+ string strKey, strValue;
+ OIC_LOG(INFO, CONTAINER_TAG, "Loading resource configuration!");
+
+ if (m_loaded)
+ {
+ try
+ {
+ // <bundle>
+ bundle = m_xmlDoc.first_node();
+ if (bundle)
+ {
+ for (bundle = bundle->first_node(BUNDLE_TAG); bundle; bundle =
+ bundle->next_sibling())
+ {
+ // <id>
+ strBundleId = bundle->first_node(BUNDLE_ID)->value();
+
+ OIC_LOG_V(INFO, CONTAINER_TAG, "Comparing bundle ids %s - %s !",
+ strBundleId.c_str(), bundleId.c_str());
+
+ if (!strBundleId.compare(bundleId))
+ {
+ OIC_LOG_V(INFO, CONTAINER_TAG, "Inspecting");
+ // <resourceInfo>
+ bundle = bundle->first_node(OUTPUT_RESOURCES_TAG);
+ if (bundle)
+ {
+ for (resource = bundle->
+ first_node(OUTPUT_RESOURCE_INFO);
+ resource; resource = resource->next_sibling())