From 62b7883326633386dd9e16edf9146b747c415f82 Mon Sep 17 00:00:00 2001 From: Taejeong Lee Date: Sat, 15 Jun 2013 01:25:53 +0900 Subject: [PATCH] Add PluginDAOReadOnly::getImplementedObjects() API. - 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 | 10 ++++---- modules/widget_dao/dao/plugin_dao_read_only.cpp | 29 ++++++++++++++++++++++ .../include/dpl/wrt-dao-ro/plugin_dao_read_only.h | 1 + 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/modules/support/wrt_plugin_export.h b/modules/support/wrt_plugin_export.h index ae1e8e1..0cf4e37 100644 --- a/modules/support/wrt_plugin_export.h +++ b/modules/support/wrt_plugin_export.h @@ -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; diff --git a/modules/widget_dao/dao/plugin_dao_read_only.cpp b/modules/widget_dao/dao/plugin_dao_read_only.cpp index 045cdd6..a90e013 100644 --- a/modules/widget_dao/dao/plugin_dao_read_only.cpp +++ b/modules/widget_dao/dao/plugin_dao_read_only.cpp @@ -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 valueList = select->GetValueList(); + + 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) { diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/plugin_dao_read_only.h b/modules/widget_dao/include/dpl/wrt-dao-ro/plugin_dao_read_only.h index 293cf13..3be2441 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/plugin_dao_read_only.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/plugin_dao_read_only.h @@ -90,6 +90,7 @@ class PluginDAOReadOnly static DbPluginHandle getPluginHandleForImplementedObject( const std::string& objectName); + static ImplementedObjectsList getImplementedObjects(); static ImplementedObjectsList getImplementedObjectsForPluginHandle( DbPluginHandle handle); -- 2.7.4