Remove deprecated API
authorJihoon Chung <jihoon.chung@samsaung.com>
Sun, 4 Aug 2013 07:36:55 +0000 (16:36 +0900)
committerJihoon Chung <jihoon.chung@samsaung.com>
Wed, 7 Aug 2013 15:11:40 +0000 (00:11 +0900)
[Issue#] N/A
[Problem] N/A
[Cause] N/A
[Solution] Remove deprecated API
[SCMRequest] N/A

Change-Id: I3a95aea130764378bc651b12ea7bc7b3cb885b82

modules/widget_dao/dao/widget_dao.cpp
modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h
tests/dao/TestCases_WidgetDAO.cpp

index e33290f..ed66aa2 100644 (file)
@@ -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<WidgetInfo::tizen_appid>(fromAppId));
-
-        WidgetInfo::Row row = select->GetSingleRow();
-
-        //WidgetInfo::Row row;
-        row.Set_tizen_appid(toAppId);
-
-        WRT_DB_UPDATE(update, WidgetInfo, &WrtDatabase::interface())
-        update->Where(Equals<WidgetInfo::tizen_appid>(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
index a1fb784..710249e 100644 (file)
@@ -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<DbWidgetHandle> handle =
             DPL::Optional<DbWidgetHandle>());
-    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
 
index 7e1f603..7221cca 100644 (file)
@@ -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);
 }