From 17c4f4ce5462f84a9d29b4d853c81c239f6ce39a Mon Sep 17 00:00:00 2001 From: Taejeong Lee Date: Wed, 26 Dec 2012 20:37:22 +0900 Subject: [PATCH] [Release] wrt-commons_0.2.83 Change-Id: If920a1477ede38fcd6a71b497ce670712e40fba8 --- debian/changelog | 6 ++++++ .../custom-handler-dao-ro/common_dao_types.h | 4 ---- .../custom_handler_dao_read_only.h | 1 + .../widget_dao/dao/widget_dao_read_only.cpp | 21 ++++++------------- .../dpl/wrt-dao-ro/widget_dao_read_only.h | 16 +++++++------- packaging/wrt-commons.spec | 2 +- tests/dao/TestCases_WidgetDAO.cpp | 9 ++++---- tests/dao/wrt_dao_tests_prepare_db.sh | 12 +++++------ 8 files changed, 32 insertions(+), 39 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3a1e787..48d1cb1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +wrt-commons (0.2.83) unstable; urgency=low + + * Replacing widget handle with tizenid in property DAO + + -- KEONGEUN Fri, 21 Dec 2012 17:03:54 +0900 + wrt-commons (0.2.82) unstable; urgency=low * CustomHandlersDB API updated to handle new functionalities. diff --git a/modules/custom_handler_dao/include/wrt-commons/custom-handler-dao-ro/common_dao_types.h b/modules/custom_handler_dao/include/wrt-commons/custom-handler-dao-ro/common_dao_types.h index 97c9a50..b08142a 100644 --- a/modules/custom_handler_dao/include/wrt-commons/custom-handler-dao-ro/common_dao_types.h +++ b/modules/custom_handler_dao/include/wrt-commons/custom-handler-dao-ro/common_dao_types.h @@ -28,10 +28,6 @@ #include #include -#include -#include -#include - namespace CustomHandlerDB { /** diff --git a/modules/custom_handler_dao/include/wrt-commons/custom-handler-dao-ro/custom_handler_dao_read_only.h b/modules/custom_handler_dao/include/wrt-commons/custom-handler-dao-ro/custom_handler_dao_read_only.h index bb5c8f6..88c720d 100644 --- a/modules/custom_handler_dao/include/wrt-commons/custom-handler-dao-ro/custom_handler_dao_read_only.h +++ b/modules/custom_handler_dao/include/wrt-commons/custom-handler-dao-ro/custom_handler_dao_read_only.h @@ -69,6 +69,7 @@ class CustomHandlerDAOReadOnly */ CustomHandlerPtr getContentHandler(const DPL::String& content, const DPL::String& url); + CustomHandlerPtr getContentHandler(const DPL::String& protocol, const DPL::String& url, const DPL::String& baseURL); diff --git a/modules/widget_dao/dao/widget_dao_read_only.cpp b/modules/widget_dao/dao/widget_dao_read_only.cpp index 5b13abe..58a8c27 100644 --- a/modules/widget_dao/dao/widget_dao_read_only.cpp +++ b/modules/widget_dao/dao/widget_dao_read_only.cpp @@ -127,12 +127,9 @@ WidgetPkgName getPkgNameByHandle(const DbWidgetHandle handle) ThrowMsg(WidgetDAOReadOnly::Exception::WidgetNotExist, "Failed to get widget by handle"); } - DPL::OptionalString pkgname = rowList.front().Get_pkgname(); - if(pkgname.IsNull()){ - ThrowMsg(WidgetDAOReadOnly::Exception::DatabaseError, - "PkgName is null for this widget"); - } - return *pkgname; + WidgetPkgName pkgname = rowList.front().Get_pkgname(); + + return pkgname; } SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed in getHandle") @@ -533,13 +530,7 @@ WidgetGUID WidgetDAOReadOnly::getGUID() const DPL::OptionalString WidgetDAOReadOnly::getPkgname() const { - return DPL::OptionalString(getPkgname_TEMPORARY_API()); -} - -WidgetPkgName WidgetDAOReadOnly::getPkgname_TEMPORARY_API() const -{ - WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle); - return row.Get_pkgname(); + return DPL::OptionalString(getPkgName()); } DPL::OptionalString WidgetDAOReadOnly::getDefaultlocale() const @@ -1015,7 +1006,7 @@ std::string WidgetDAOReadOnly::getCookieDatabasePath() const using namespace WrtDB::WidgetConfig; std::ostringstream path; - WidgetPkgName pkgname = getPkgname_TEMPORARY_API(); + WidgetPkgName pkgname = getPkgName(); path << GetWidgetPersistentStoragePath(pkgname); path << "/"; @@ -1027,7 +1018,7 @@ std::string WidgetDAOReadOnly::getCookieDatabasePath() const std::string WidgetDAOReadOnly::getPrivateLocalStoragePath() const { std::ostringstream path; - WidgetPkgName pkgname = getPkgname_TEMPORARY_API(); + WidgetPkgName pkgname = getPkgName(); path << WidgetConfig::GetWidgetWebLocalStoragePath(pkgname); path << "/"; diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h b/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h index 37a7138..f454637 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h @@ -177,7 +177,7 @@ struct WidgetRegisterInfo LocalizationData localizationData; DPL::OptionalString pkgname; - WidgetPkgName pkgname_TEMPORARY_API; + WidgetPkgName pkgName; time_t installedTime; PackagingType packagingType; @@ -371,15 +371,15 @@ class WidgetDAOReadOnly */ WidgetGUID getGUID() const; + /** - * This method returns the Package name of the widget. - * - * @return pkgname - * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table. - * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table. - */ + * This method returns the Package name of the widget. + * + * @return pkgname + * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table. + * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table. + */ DPL::OptionalString getPkgname() const; - WidgetPkgName getPkgname_TEMPORARY_API() const; /** * This method returns the defaultlocale for the widget. diff --git a/packaging/wrt-commons.spec b/packaging/wrt-commons.spec index 4a71cd8..f6743e4 100644 --- a/packaging/wrt-commons.spec +++ b/packaging/wrt-commons.spec @@ -1,7 +1,7 @@ #git:framework/web/wrt-commons wrt-commons 0.2.82 Name: wrt-commons Summary: Wrt common library -Version: 0.2.82 +Version: 0.2.83 Release: 1 Group: Development/Libraries License: Apache License, Version 2.0 diff --git a/tests/dao/TestCases_WidgetDAO.cpp b/tests/dao/TestCases_WidgetDAO.cpp index e26f45d..92e1995 100644 --- a/tests/dao/TestCases_WidgetDAO.cpp +++ b/tests/dao/TestCases_WidgetDAO.cpp @@ -88,7 +88,7 @@ WidgetPkgName _registerWidget(const WidgetRegisterInfo& regInfo, { WidgetPkgName pkgname; Try { - auto previous = WidgetDAO::getPkgnameList(); + auto previous = WidgetDAO::getPkgnameList_TEMPORARY_API(); // register widget pkgname = WidgetDAO::registerWidgetGenerateTizenId(regInfo, sec); @@ -96,7 +96,7 @@ WidgetPkgName _registerWidget(const WidgetRegisterInfo& regInfo, RUNNER_ASSERT_MSG(!pkgname.empty(), "(called from line " << line << ")"); - auto current = WidgetDAO::getPkgnameList(); + auto current = WidgetDAO::getPkgnameList_TEMPORARY_API(); RUNNER_ASSERT_MSG(previous.size()+1 == current.size(), "(called from line " << line << ")"); @@ -257,7 +257,7 @@ RUNNER_TEST(widget_dao_test_register_widget_minimum_info) WacSecurityMock sec; const std::size_t NUMBER_OF_WIDGETS = 5; - DPL::Optional lastPkgname; + WidgetPkgName lastPkgname; for (std::size_t number = 0; number < NUMBER_OF_WIDGETS; ++number) { @@ -828,7 +828,7 @@ Expected: For all position in database should be returned one item in list */ RUNNER_TEST(widget_dao_test_get_widget_pkgname_list) { - WidgetPkgNameList pkgnames = WidgetDAO::getPkgnameList(); + WidgetPkgNameList_TEMPORARY_API pkgnames = WidgetDAO::getPkgnameList_TEMPORARY_API(); RUNNER_ASSERT(pkgnames.size() >= 3); } @@ -844,7 +844,6 @@ RUNNER_TEST(widget_dao_test_get_widget_list) RUNNER_ASSERT(list.size() >= 3); RUNNER_ASSERT_MSG(!!list.front(), "widget dao exists"); WidgetDAOReadOnlyPtr dao = list.front(); - RUNNER_ASSERT_MSG(!dao->getPkgname().IsNull(), "dao object do not have tizen id"); } /* diff --git a/tests/dao/wrt_dao_tests_prepare_db.sh b/tests/dao/wrt_dao_tests_prepare_db.sh index 386c68b..4f989f0 100755 --- a/tests/dao/wrt_dao_tests_prepare_db.sh +++ b/tests/dao/wrt_dao_tests_prepare_db.sh @@ -66,7 +66,7 @@ if [ "x$1" == "xstart" ]; then INS_ALL_WIDGET_STARTFILE="insert into WidgetStartFile(app_id, src)" INS_ALL_WIDGET_LOC_STARTFILE="insert into WidgetLocalizedStartFile(app_id, start_file_id, widget_locale, type, encoding)" INS_ALL_WIDGET_DEFPREF="insert into WidgetDefaultPreference(app_id, key_name, key_value, readonly)" - INS_ALL_WIDGET_PREF="insert into WidgetPreference(app_id, key_name, key_value, readonly)" + INS_ALL_WIDGET_PREF="insert into WidgetPreference(pkgname, key_name, key_value, readonly)" INS_ALL_WIDGET_FEATURE="insert into WidgetFeature(app_id, name, required)" INS_ALL_WIDGET_FEATURE_PARAM="insert into FeatureParam(widget_feature_id, name, value)" INS_ALL_WIDGET_WINMODES="insert into WidgetWindowModes(app_id, window_mode)" @@ -107,11 +107,11 @@ if [ "x$1" == "xstart" ]; then sqlite3 $WRT_DB "${INS_ALL_WIDGET_LOC_STARTFILE} VALUES(2003, 4, 'en', '', '')"; #widget properties - sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES(2000, 'key1_for_2000', 'value_for_key1_2000', 0)"; - sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES(2000, 'key2_for_2000', 'value_for_key2_2000', 0)"; - sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES(2001, 'key1_for_2001', 'value1_for_key_2001', 1)"; - sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES(2002, 'key1_for_2002', 'value1_for_key_2002', 0)"; - sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES(2002, 'key2_for_2002', 'value2_for_key_2002', 1)"; + sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES('tizenid201', 'key1_for_2000', 'value_for_key1_2000', 0)"; + sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES('tizenid201', 'key2_for_2000', 'value_for_key2_2000', 0)"; + sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES('tizenid202', 'key1_for_2001', 'value1_for_key_2001', 1)"; + sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES('tizenid203', 'key1_for_2002', 'value1_for_key_2002', 0)"; + sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES('tizenid203', 'key2_for_2002', 'value2_for_key_2002', 1)"; #create if not exists and fix autoincrement value sqlite3 $WRT_DB "INSERT INTO WidgetInfo(pkgname) VALUES('temp')"; -- 2.34.1