Clean-up GlobalDAO (GetDeviceCapability)
authorJihoon Chung <jihoon.chung@samsaung.com>
Tue, 22 Oct 2013 08:26:41 +0000 (17:26 +0900)
committerSoo-Hyun Choi <sh9.choi@samsung.com>
Tue, 29 Oct 2013 06:24:16 +0000 (15:24 +0900)
[Issue#]   LINUXWRT-1034
[Problem]  GlobalDAO has unnecessary API.
[Cause]    N/A
[Solution] Remove "GetDeviceCapability" API
           - API moevs to "FeatureDAO::GetDeviceCapability"
           - Also clean-up GlobalDAOReadOnly.

[Verification] build repo
[SCMRequest] N/A

Change-Id: I397595406d6f3fabc59b67776010876b25328d84

modules/widget_dao/CMakeLists.txt
modules/widget_dao/dao/global_dao_read_only.cpp [deleted file]
modules/widget_dao/include/dpl/wrt-dao-ro/global_dao_read_only.h [deleted file]

index 0db09c1..f2668eb 100755 (executable)
@@ -43,7 +43,6 @@ set(WRT_DAO_RO_SOURCES
     dao/config_parser_data.cpp
     dao/common_dao_types.cpp
     dao/feature_dao_read_only.cpp
-    dao/global_dao_read_only.cpp
     dao/path_builder.cpp
     dao/plugin_dao_read_only.cpp
     dao/property_dao_read_only.cpp
@@ -119,7 +118,6 @@ INSTALL(FILES
     include/dpl/wrt-dao-ro/feature_dao_read_only.h
     include/dpl/wrt-dao-ro/feature_model.h
     include/dpl/wrt-dao-ro/global_config.h
-    include/dpl/wrt-dao-ro/global_dao_read_only.h
     include/dpl/wrt-dao-ro/path_builder.h
     include/dpl/wrt-dao-ro/plugin_dao_read_only.h
     include/dpl/wrt-dao-ro/property_dao_read_only.h
diff --git a/modules/widget_dao/dao/global_dao_read_only.cpp b/modules/widget_dao/dao/global_dao_read_only.cpp
deleted file mode 100644 (file)
index f894d2b..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *    Licensed under the Apache License, Version 2.0 (the "License");
- *    you may not use this file except in compliance with the License.
- *    You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *    Unless required by applicable law or agreed to in writing, software
- *    distributed under the License is distributed on an "AS IS" BASIS,
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *    See the License for the specific language governing permissions and
- *    limitations under the License.
- */
-/**
- * @file    global_dao_read_only.cpp
- * @author  Pawel Sikorski (p.sikorski@samsung.com)
- * @version 1.0
- * @brief   This file contains the definition of global dao class.
- */
-#include <stddef.h>
-#include <dpl/wrt-dao-ro/global_dao_read_only.h>
-
-#include <dpl/foreach.h>
-#include <dpl/log/log.h>
-#include <dpl/string.h>
-#include <dpl/db/orm.h>
-#include <orm_generator_wrt.h>
-#include <dpl/wrt-dao-ro/webruntime_database.h>
-#include <dpl/wrt-dao-ro/WrtDatabase.h>
-#include <dpl/wrt-dao-ro/common_dao_types.h>
-
-namespace WrtDB {
-DeviceCapabilitySet GlobalDAOReadOnly::GetDeviceCapability(
-    const DPL::String &apifeature)
-{
-    // This could be done with one simply sql query but support for join is
-    // needed in orm.
-    Try {
-        using namespace DPL::DB::ORM;
-        using namespace DPL::DB::ORM::wrt;
-
-        int featureUUID;
-        FeatureDeviceCapProxy::Select::RowList rows;
-        DeviceCapabilitySet result;
-
-        {
-            WRT_DB_SELECT(select, FeaturesList, &WrtDatabase::interface())
-            select->Where(Equals<FeaturesList::FeatureName>(apifeature));
-            featureUUID = select->GetSingleValue<FeaturesList::FeatureUUID>();
-        }
-
-        {
-            WRT_DB_SELECT(select,
-                          FeatureDeviceCapProxy,
-                          &WrtDatabase::interface())
-            select->Where(Equals<FeatureDeviceCapProxy::FeatureUUID>(
-                              featureUUID));
-            rows = select->GetRowList();
-        }
-
-        FOREACH(it, rows){
-            WRT_DB_SELECT(select, DeviceCapabilities, &WrtDatabase::interface())
-            select->Where(Equals<DeviceCapabilities::DeviceCapID>(
-                              it->Get_DeviceCapID()));
-            result.insert(select->
-                              GetSingleValue<DeviceCapabilities::DeviceCapName>());
-        }
-
-        return result;
-    } Catch(DPL::DB::SqlConnection::Exception::Base){
-        ReThrowMsg(GlobalDAOReadOnly::Exception::DatabaseError,
-                   "Failed to update roaming network data usage");
-    }
-}
-
-} // namespace WrtDB
diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/global_dao_read_only.h b/modules/widget_dao/include/dpl/wrt-dao-ro/global_dao_read_only.h
deleted file mode 100644 (file)
index 446b43c..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *    Licensed under the Apache License, Version 2.0 (the "License");
- *    you may not use this file except in compliance with the License.
- *    You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *    Unless required by applicable law or agreed to in writing, software
- *    distributed under the License is distributed on an "AS IS" BASIS,
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *    See the License for the specific language governing permissions and
- *    limitations under the License.
- */
-/**
- * @file    global_dao_read_only.h
- * @author  Pawel Sikorski (p.sikorski@samsung.com)
- * @version 1.0
- * @brief   This file contains the declaration of global dao
- */
-
-#ifndef WRT_SRC_CONFIGURATION_GLOBAL_DAO_READ_ONLY_H_
-#define WRT_SRC_CONFIGURATION_GLOBAL_DAO_READ_ONLY_H_
-
-#include <list>
-#include <set>
-#include <string>
-
-#include <dpl/availability.h>
-#include <dpl/string.h>
-#include <dpl/exception.h>
-
-#include <dpl/wrt-dao-ro/common_dao_types.h>
-
-namespace WrtDB {
-typedef std::list<DPL::String> WidgetPackageList;
-typedef std::set<DPL::String> DeviceCapabilitySet;
-
-class GlobalDAOReadOnly
-{
-  public:
-    /**
-     * GlobalDAOReadOnly Exception classes
-     */
-    class Exception
-    {
-      public:
-        DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
-        DECLARE_EXCEPTION_TYPE(Base, DatabaseError)
-    };
-
-  public:
-    /**
-     * This method returns set of device capabilities used by apifeature.
-     */
-    static DeviceCapabilitySet GetDeviceCapability(
-        const DPL::String &apifeature) DPL_DEPRECATED_WITH_MESSAGE("Use FeatureDAOReadOnly::GetDeviceCapability");
-
-  protected:
-    DPL_DEPRECATED GlobalDAOReadOnly()
-    {}
-};
-} // namespace WrtDB
-
-#endif // WRT_SRC_CONFIGURATION_GLOBAL_DAO_READ_ONLY_H_