From: Jihoon Chung Date: Tue, 22 Oct 2013 08:26:41 +0000 (+0900) Subject: Clean-up GlobalDAO (GetDeviceCapability) X-Git-Tag: 2.2.1_release~1^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bd62254559c4eec5a92617a510a93b060462b9e1;p=framework%2Fweb%2Fwrt-commons.git Clean-up GlobalDAO (GetDeviceCapability) [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 --- diff --git a/modules/widget_dao/CMakeLists.txt b/modules/widget_dao/CMakeLists.txt index 0db09c1..f2668eb 100755 --- a/modules/widget_dao/CMakeLists.txt +++ b/modules/widget_dao/CMakeLists.txt @@ -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 index f894d2b..0000000 --- a/modules/widget_dao/dao/global_dao_read_only.cpp +++ /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 -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -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(apifeature)); - featureUUID = select->GetSingleValue(); - } - - { - WRT_DB_SELECT(select, - FeatureDeviceCapProxy, - &WrtDatabase::interface()) - select->Where(Equals( - featureUUID)); - rows = select->GetRowList(); - } - - FOREACH(it, rows){ - WRT_DB_SELECT(select, DeviceCapabilities, &WrtDatabase::interface()) - select->Where(Equals( - it->Get_DeviceCapID())); - result.insert(select-> - GetSingleValue()); - } - - 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 index 446b43c..0000000 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/global_dao_read_only.h +++ /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 -#include -#include - -#include -#include -#include - -#include - -namespace WrtDB { -typedef std::list WidgetPackageList; -typedef std::set 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_