From: Taejeong Lee Date: Thu, 23 May 2013 07:09:51 +0000 (+0900) Subject: Add "getRootPluginHandleList()" api to PluginDAOReadOnly. X-Git-Tag: submit/tizen_2.2/20130927.091100^2~89 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51422ada56619364f831792f64d4eef10353ee20;p=platform%2Fframework%2Fweb%2Fwrt-commons.git Add "getRootPluginHandleList()" api to PluginDAOReadOnly. [Issue#] N/A [Problem] Performance [Cause] N/A [Solution] Add "getRootPluginHandleList()" api to PluginDAOReadOnly. Change-Id: I9624177e8349e81fade08e3b96e5d4d4cec751f0 --- diff --git a/modules/widget_dao/dao/plugin_dao_read_only.cpp b/modules/widget_dao/dao/plugin_dao_read_only.cpp index d5acba9..045cdd6 100644 --- a/modules/widget_dao/dao/plugin_dao_read_only.cpp +++ b/modules/widget_dao/dao/plugin_dao_read_only.cpp @@ -154,6 +154,35 @@ PluginHandleList PluginDAOReadOnly::getPluginHandleList() } } +PluginHandleList PluginDAOReadOnly::getRootPluginHandleList() +{ + LogDebug("Getting root plugin handle list."); + Try { + using namespace DPL::DB::ORM; + using namespace DPL::DB::ORM::wrt; + + WRT_DB_SELECT(select, PluginProperties, &WrtDatabase::interface()) + PluginHandleList handleList = select->GetValueList(); + + WRT_DB_SELECT(select_2nd, PluginDependencies, &WrtDatabase::interface()) + PluginDependencies::Select::RowList dependenciesRows = select_2nd->GetRowList(); + + if (!dependenciesRows.empty()) + { + FOREACH(it, dependenciesRows) + { + handleList.remove(it->Get_PluginPropertiesId()); + } + } + + return handleList; + } + Catch(DPL::DB::SqlConnection::Exception::Base) { + ReThrowMsg(PluginDAOReadOnly::Exception::DatabaseError, + "Failed in getRootPluginHandleList"); + } +} + DbPluginHandle PluginDAOReadOnly::getPluginHandle() const { return m_pluginHandle; 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 eb9c030..293cf13 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 @@ -79,6 +79,7 @@ class PluginDAOReadOnly PluginDAOReadOnly(const std::string &libraryName); static PluginHandleList getPluginHandleList(); + static PluginHandleList getRootPluginHandleList(); static bool isPluginInstalled(const std::string &libraryName); static bool isPluginInstalled(DbPluginHandle pluginHandle);