From: Jihoon Chung Date: Sun, 4 Aug 2013 07:36:55 +0000 (+0900) Subject: Remove deprecated API X-Git-Tag: 2.2.1_release~9^2~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ca75812664bbc9de256c64ff51f86d82d90d3523;p=framework%2Fweb%2Fwrt-commons.git Remove deprecated API [Issue#] N/A [Problem] N/A [Cause] N/A [Solution] Remove deprecated API [SCMRequest] N/A Change-Id: I3a95aea130764378bc651b12ea7bc7b3cb885b82 --- diff --git a/modules/widget_dao/dao/widget_dao.cpp b/modules/widget_dao/dao/widget_dao.cpp index e33290f..ed66aa2 100644 --- a/modules/widget_dao/dao/widget_dao.cpp +++ b/modules/widget_dao/dao/widget_dao.cpp @@ -326,60 +326,6 @@ void WidgetDAO::registerWidgetInternal( registerWidgetSecuritySettings(widgetHandle); } -void WidgetDAO::registerOrUpdateWidget( - const TizenAppId & widgetName, - const WidgetRegisterInfo &widgetRegInfo, - const IWidgetSecurity &widgetSecurity) -{ - LogDebug("Reregistering widget"); - SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN - { - DPL::DB::ORM::wrt::ScopedTransaction transaction( - &WrtDatabase::interface()); - - unregisterWidgetInternal(widgetName); - registerWidgetInternal(widgetName, widgetRegInfo, widgetSecurity); - transaction.Commit(); - } - SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to reregister widget") -} - -void WidgetDAO::backupAndUpdateWidget( - const TizenAppId & oldAppId, - const TizenAppId & newAppId, - const WidgetRegisterInfo &widgetRegInfo, - const IWidgetSecurity &widgetSecurity) -{ - LogDebug("Backup and Register widget"); - SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN - { - DPL::DB::ORM::wrt::ScopedTransaction transaction( - &WrtDatabase::interface()); - - updateWidgetAppIdInternal(newAppId, oldAppId); - registerWidgetInternal(newAppId, widgetRegInfo, widgetSecurity); - transaction.Commit(); - } - SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to reregister widget") -} - -void WidgetDAO::restoreUpdateWidget( - const TizenAppId & oldAppId, - const TizenAppId & newAppId) -{ - LogDebug("restore widget"); - SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN - { - DPL::DB::ORM::wrt::ScopedTransaction transaction( - &WrtDatabase::interface()); - - unregisterWidgetInternal(newAppId); - updateWidgetAppIdInternal(oldAppId, newAppId); - transaction.Commit(); - } - SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to reregister widget") -} - #define DO_INSERT(row, table) \ { \ WRT_DB_INSERT(insert, table, &WrtDatabase::interface()) \ @@ -918,39 +864,6 @@ void WidgetDAO::unregisterWidgetInternal( // Deleting in other tables is done via "delete cascade" in SQL } -void WidgetDAO::updateWidgetAppIdInternal( - const TizenAppId & fromAppId, - const TizenAppId & toAppId) -{ - SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN - { - using namespace DPL::DB::ORM; - using namespace DPL::DB::ORM::wrt; - - ScopedTransaction transaction(&WrtDatabase::interface()); - if (!isWidgetInstalled(fromAppId)) { - ThrowMsg(WidgetDAOReadOnly::Exception::WidgetNotExist, - "Cannot find widget. tzAppId: " << fromAppId); - } - - WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface()) - select->Where(Equals(fromAppId)); - - WidgetInfo::Row row = select->GetSingleRow(); - - //WidgetInfo::Row row; - row.Set_tizen_appid(toAppId); - - WRT_DB_UPDATE(update, WidgetInfo, &WrtDatabase::interface()) - update->Where(Equals(fromAppId)); - update->Values(row); - update->Execute(); - - transaction.Commit(); - } - SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to update appid") -} - #undef DO_INSERT #undef SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN diff --git a/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h b/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h index a1fb784..710249e 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h +++ b/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h @@ -89,38 +89,6 @@ class WidgetDAO : public WidgetDAOReadOnly static void updateTizenAppId(const TizenAppId & fromAppId, const TizenAppId & toAppId); - - /** - * This method re-registers the widget information to the DB when it is - * installed. - * - * It performs unregistration and new registration of widget in db in one - * transaction. - * - * @see WidgetRegisterInfo - * @param[in] tzAppId Widget tizen app id that will be registered. - * @param[in] pWidgetRegisterInfo Specified the widget's information - * needed to be registered. - * @param[in] widgetSecurity Widget's security certificates. - */ - static void registerOrUpdateWidget( - const TizenAppId & tzAppId, - const WidgetRegisterInfo &widgetRegInfo, - const IWidgetSecurity &widgetSecurity) __attribute__((deprecated)); - - /* This method backup widget information and update new widget information - * for restore widget information - */ - static void backupAndUpdateWidget( - const TizenAppId & oldAppId, - const TizenAppId & newAppId, - const WidgetRegisterInfo &widgetRegInfo, - const IWidgetSecurity &widgetSecurity) __attribute__((deprecated)); - - static void restoreUpdateWidget( - const TizenAppId & oldAppId, - const TizenAppId & newAppId) __attribute__((deprecated)); - /** * This method removes a widget's information from EmDB. * @@ -234,20 +202,14 @@ class WidgetDAO : public WidgetDAOReadOnly const IWidgetSecurity &widgetSecurity, const DPL::Optional handle = DPL::Optional()); - static void unregisterWidgetInternal( - const TizenAppId & tzAppId); - - static void updateWidgetAppIdInternal( - const TizenAppId & fromAppId, - const TizenAppId & toAppId) __attribute__((deprecated)); - + static void unregisterWidgetInternal(const TizenAppId & tzAppId); static void insertAppControlInfo(DbWidgetHandle handle, - DPL::String src, - DPL::String operation, - DPL::String uri, - DPL::String mime, - unsigned index, - unsigned disposition); + DPL::String src, + DPL::String operation, + DPL::String uri, + DPL::String mime, + unsigned index, + unsigned disposition); }; } // namespace WrtDB diff --git a/tests/dao/TestCases_WidgetDAO.cpp b/tests/dao/TestCases_WidgetDAO.cpp index 7e1f603..7221cca 100644 --- a/tests/dao/TestCases_WidgetDAO.cpp +++ b/tests/dao/TestCases_WidgetDAO.cpp @@ -920,7 +920,9 @@ RUNNER_TEST(widget_dao_test_register_or_update_widget) tizenAppId), "Widget is not registered"); //success full update - WidgetDAO::registerOrUpdateWidget(tizenAppId, regInfo2, sec); + WidgetDAO::updateTizenAppId(tizenAppId, L"backup"); + WidgetDAO::registerWidget(tizenAppId, regInfo2, sec); + WidgetDAO::unregisterWidget(L"backup"); RUNNER_ASSERT_MSG(WidgetDAO::isWidgetInstalled( tizenAppId), "Widget is not reregistered"); WidgetDAO dao(tizenAppId); @@ -929,6 +931,7 @@ RUNNER_TEST(widget_dao_test_register_or_update_widget) RUNNER_ASSERT_MSG( *dao.getAuthorName() == L"BBB", "Data widget was not updated"); + WidgetDAO::unregisterWidget(tizenAppId); }