Using relative links in configuration files. Implemented listBundles to retrieve...
authorMarkus Jung <markus.jung@samsung.com>
Mon, 6 Jul 2015 06:46:53 +0000 (15:46 +0900)
committerUze Choi <uzchoi@samsung.com>
Tue, 7 Jul 2015 08:55:26 +0000 (08:55 +0000)
Change-Id: Ia5d2f2b7e16cb2eb5f37bd866f33d437c03eb033
Signed-off-by: Markus Jung <markus.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1530
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/resource-manipulation/modules/resourceContainer/examples/ResourceContainerConfig.xml
service/resource-manipulation/modules/resourceContainer/include/internal/BundleInfoInternal.h
service/resource-manipulation/modules/resourceContainer/src/BundleInfoInternal.cpp
service/resource-manipulation/modules/resourceContainer/src/ResourceContainerImpl.cpp

index 7304ee9..e8910d1 100644 (file)
@@ -10,7 +10,7 @@
                                <resourceType>core.softsensor</resourceType>
                 <attributes>
                   <attribute>
-                    <name>version</name>
+                    <name>version</name>       
                     <type>string</type>
                     <value>1.0</value>
                   </attribute>
     </bundle>
     <bundle>
         <id>oic.bundle.hueJavaSample</id>
-        <path>/home/iotivity/development/iotivity-resource-manipulation/service/resource-manipulation/modules/resourceContainer/examples/HueJavaSampleBundle/hue/target/hue-1.0-SNAPSHOT-jar-with-dependencies.jar</path>
+        <path>../../../../../../../../service/resource-manipulation/modules/resourceContainer/examples/HueJavaSampleBundle/hue/target/hue-1.0-SNAPSHOT-jar-with-dependencies.jar </path>
+        <uri>/hueJava</uri>
         <activator>org.iotivity.bundle.hue.HueBundleActivator</activator>
         <version>1.0.0</version>
         <resources>
             <resourceInfo>
                 <name>light</name>
+                <uri>light/1</uri>
                                <resourceType>oic.light.control</resourceType>
                 <address>http://192.168.0.2/api/newdeveloper/lights/1</address>
             </resourceInfo>       
index 050db47..a333fbf 100644 (file)
@@ -76,6 +76,8 @@ namespace OIC{
                 void setJavaBundle(bool javaBundle);
                 bool getJavaBundle();
 
+                void setBundleInfo(BundleInfo* bundleInfo);
+
             private:
                 bool m_loaded, m_activated, m_java_bundle;
                 int m_id;
index efbc837..eadd3ce 100644 (file)
@@ -171,5 +171,11 @@ namespace OIC
         jobject BundleInfoInternal::getJavaBundleActivatorObject(){
             return m_java_activator_object;
         }
+
+        void BundleInfoInternal::setBundleInfo(BundleInfo* bundleInfo){
+            m_ID = bundleInfo->getID();
+            m_path = bundleInfo->getPath();
+            m_version = bundleInfo->getPath();
+        }
     }
 }
index 5857067..3e016c9 100644 (file)
@@ -514,6 +514,11 @@ namespace OIC
         std::list< BundleInfo* > ResourceContainerImpl::listBundles()
         {
             std::list< BundleInfo* > ret;
+            for(std::map<std::string, BundleInfoInternal*>::iterator it = m_bundles.begin(); it != m_bundles.end(); ++it){
+                BundleInfo* bundleInfo = BundleInfo::createBundleInfo();
+                ((BundleInfoInternal*)bundleInfo)->setBundleInfo((BundleInfo*)it->second);
+                ret.push_back(it->second);
+            }
             return ret;
         }