Add PluginDAOReadOnly::getImplementedObjects() API.
authorTaejeong Lee <taejeong.lee@samsung.com>
Fri, 14 Jun 2013 16:25:53 +0000 (01:25 +0900)
committerTaejeong Lee <taejeong.lee@samsung.com>
Fri, 21 Jun 2013 12:32:03 +0000 (21:32 +0900)
 - It returns whole of ImplementedObjectes in PluginDAO DB.

[Issue#] N/A
[Problem] Performance
[Cause] N/A
[Solution] Add PluginDAOReadOnly::getImplementedObjects() API.

Change-Id: I91c7743b593946871db0fa4f07d7f6c81741319b

modules/support/wrt_plugin_export.h
modules/widget_dao/dao/plugin_dao_read_only.cpp
modules/widget_dao/include/dpl/wrt-dao-ro/plugin_dao_read_only.h

index ae1e8e1..0cf4e37 100644 (file)
@@ -138,7 +138,7 @@ typedef enum class_definition_iframe_behaviour_e
     //it is default one
     NONE,
     //object should be copied as reference to each iframe
-    REFERENCE,
+    REFERENCE, // deprecated
     //object should be created for each iframe and NOT inform plugin
     CREATE_INSTANCE
 } class_definition_iframe_behaviour_t;
@@ -153,9 +153,9 @@ typedef enum class_definition_iframe_notice_e
 typedef enum class_definition_iframe_overlay_e
 {
     IGNORED,
-    USE_OVERLAYED,
-    OVERLAYED_BEFORE_ORIGINAL
-} class_definition_iframe_overlay_t;
+    USE_OVERLAYED, //deprecated
+    OVERLAYED_BEFORE_ORIGINAL //deprecated
+} class_definition_iframe_overlay_t; //deprecated
 
 typedef void* js_object_instance_t;
 //global_context - id
@@ -170,7 +170,7 @@ typedef struct class_definition_options_s
     class_definition_type_t type;
     class_definition_iframe_behaviour_t iframe_option;
     class_definition_iframe_notice_t iframe_notice;
-    class_definition_iframe_overlay_t iframe_overlay;
+    class_definition_iframe_overlay_t iframe_overlay;   //deprecated
     iframe_loaded_cb cb;
     void * private_data;
     js_function_impl function;
index 045cdd6..a90e013 100644 (file)
@@ -275,6 +275,35 @@ DbPluginHandle PluginDAOReadOnly::getPluginHandleForImplementedObject(
     }
 }
 
+ImplementedObjectsList PluginDAOReadOnly::getImplementedObjects()
+{
+    LogDebug("getImplementedObjects");
+
+    Try
+    {
+        ImplementedObjectsList objectList;
+        using namespace DPL::DB::ORM;
+        using namespace DPL::DB::ORM::wrt;
+
+        WRT_DB_SELECT(select, PluginImplementedObjects, &WrtDatabase::interface())
+        std::list<DPL::String> valueList = select->GetValueList<PluginImplementedObjects::PluginObject>();
+
+        if (!valueList.empty()) {
+            FOREACH(it, valueList)
+            {
+                objectList.push_back(DPL::ToUTF8String(*it));
+            }
+        } else {
+            LogWarning("PluginHandle for object not found");
+        }
+        return objectList;
+    }
+    Catch(DPL::DB::SqlConnection::Exception::Base) {
+        ReThrowMsg(PluginDAOReadOnly::Exception::DatabaseError,
+                   "Failed in GetPluginHandleForImplementedObject");
+    }
+}
+
 ImplementedObjectsList PluginDAOReadOnly::getImplementedObjectsForPluginHandle(
     DbPluginHandle handle)
 {
index 293cf13..3be2441 100644 (file)
@@ -90,6 +90,7 @@ class PluginDAOReadOnly
     static DbPluginHandle getPluginHandleForImplementedObject(
         const std::string& objectName);
 
+    static ImplementedObjectsList getImplementedObjects();
     static ImplementedObjectsList getImplementedObjectsForPluginHandle(
         DbPluginHandle handle);