[Release] wrt-commons_0.2.83 submit/tizen_2.0/20121226.113839
authorTaejeong Lee <taejeong.lee@samsung.com>
Wed, 26 Dec 2012 11:37:22 +0000 (20:37 +0900)
committerTaejeong Lee <taejeong.lee@samsung.com>
Wed, 26 Dec 2012 11:38:15 +0000 (20:38 +0900)
Change-Id: If920a1477ede38fcd6a71b497ce670712e40fba8

debian/changelog
modules/custom_handler_dao/include/wrt-commons/custom-handler-dao-ro/common_dao_types.h
modules/custom_handler_dao/include/wrt-commons/custom-handler-dao-ro/custom_handler_dao_read_only.h
modules/widget_dao/dao/widget_dao_read_only.cpp
modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h
packaging/wrt-commons.spec
tests/dao/TestCases_WidgetDAO.cpp
tests/dao/wrt_dao_tests_prepare_db.sh

index 3a1e787f42060cd66eb4c07cb11c2ffe2e0dec12..48d1cb1d82f1defedb302cf19233b61dad66fca6 100644 (file)
@@ -1,3 +1,9 @@
+wrt-commons (0.2.83) unstable; urgency=low
+
+  * Replacing widget handle with tizenid in property DAO
+
+ -- KEONGEUN <lke01.lee@samsung.com>  Fri, 21 Dec 2012 17:03:54 +0900
+
 wrt-commons (0.2.82) unstable; urgency=low
 
   * CustomHandlersDB API updated to handle new functionalities.
index 97c9a50edf037c8fb837f6616d44df8a6ef4b184..b08142a4d68a541db3a4f5710becce7e3027c126 100644 (file)
 #include <memory>
 #include <dpl/string.h>
 
-#include <list>
-#include <memory>
-#include <dpl/string.h>
-
 namespace CustomHandlerDB {
 
 /**
index bb5c8f6e2ac5a128c75dabd4d8b1cd07a8f9445c..88c720d5e9bbc68b9ff2970685c0fa152c846120 100644 (file)
@@ -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);
 
index 5b13abe5d36c5dc5f7a03a4e7a2dd37c8d19175b..58a8c27178d478e3bcf0f10356feb1ce8d7a8528 100644 (file)
@@ -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 << "/";
 
index 37a7138f28022239f44ba564705954eec2c451cd..f454637fc1f8124749a9831efa41976f7f99cf32 100644 (file)
@@ -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.
index 4a71cd80c005dfea6c74f3b2f4cd4fd30781dda9..f6743e4123d3df289e3419dde22112ef7767438c 100644 (file)
@@ -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
index e26f45dc33d828c84a328417bbf0f93440c4c00e..92e19953aff4bd425ecafa2f4dc97a238036953a 100644 (file)
@@ -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<WidgetPkgName> 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");
 }
 
 /*
index 386c68bae19368a1a2e86a62c8e8d05dd88fb833..4f989f0c07f9e94b4532c8eccd6eb137c0bd64f9 100755 (executable)
@@ -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')";