Prepare database for additional appservice parameter
authorAndrzej Surdej <a.surdej@samsung.com>
Thu, 21 Feb 2013 10:33:43 +0000 (11:33 +0100)
committerGerrit Code Review <gerrit2@kim11>
Wed, 27 Feb 2013 09:50:31 +0000 (18:50 +0900)
[Issue#] LINUXWRT-58
[Problem] N/A
[Cause] N/A
[Solution] N/A
[Verification] To verify build repo.

Change-Id: I1efe3251c6df8de11959b0a7503622e05aea94c2

modules/widget_dao/dao/config_parser_data.cpp
modules/widget_dao/dao/widget_dao.cpp
modules/widget_dao/dao/widget_dao_read_only.cpp
modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h
modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h
modules/widget_dao/orm/wrt_db

index eccbe40..cc5253a 100644 (file)
@@ -451,7 +451,8 @@ bool ConfigParserData::ServiceInfo::operator== (const ServiceInfo& info) const
     return m_src == info.m_src &&
            m_operation == info.m_operation &&
            m_scheme == info.m_scheme &&
-           m_mime == info.m_mime;
+           m_mime == info.m_mime &&
+           m_disposition == info.m_disposition;
 }
 
 bool ConfigParserData::ServiceInfo::operator!= (const ServiceInfo& info) const
@@ -459,7 +460,8 @@ bool ConfigParserData::ServiceInfo::operator!= (const ServiceInfo& info) const
     return m_src != info.m_src &&
            m_operation != info.m_operation &&
            m_scheme != info.m_scheme &&
-           m_mime != info.m_mime;
+           m_mime != info.m_mime &&
+           m_disposition != info.m_disposition;
 }
 
 bool ConfigParserData::LiveboxInfo::operator==(const LiveboxInfo& other) const
index d67b408..86819ab 100644 (file)
@@ -709,6 +709,7 @@ void WidgetDAO::registerAppService(DbWidgetHandle widgetHandle,
         row.Set_operation(ASIt->m_operation);
         row.Set_scheme(ASIt->m_scheme);
         row.Set_mime(ASIt->m_mime);
+        row.Set_disposition(static_cast<int>(ASIt->m_disposition));
 
         DO_INSERT(row, ApplicationServiceInfo)
     }
index 5f7274b..b11158a 100644 (file)
@@ -1129,6 +1129,7 @@ void WidgetDAOReadOnly::getAppServiceList(
             ret.operation = it->Get_operation();
             ret.scheme = it->Get_scheme();
             ret.mime = it->Get_mime();
+            ret.disposition = static_cast<WidgetApplicationService::Disposition>(it->Get_disposition());
             outAppServiceList.push_back(ret);
         }
 
index ff30556..234ef6e 100644 (file)
@@ -378,18 +378,24 @@ typedef std::list<WidgetSetting> WidgetSettings;
  */
 struct WidgetApplicationService
 {
-  public:
+    enum class Disposition {
+        WINDOW = 0,
+        INLINE
+    };
+
     DPL::String src;       /* start uri */
     DPL::String operation; /* service name */
     DPL::String scheme;    /* scheme type*/
     DPL::String mime;      /* mime type */
+    Disposition disposition;
 
     bool operator== (const WidgetApplicationService& other) const
     {
         return src == other.src &&
                operation == other.operation &&
                scheme == other.scheme &&
-               mime == other.mime;
+               mime == other.mime &&
+               disposition == other.disposition;
     }
 };
 
index f56be55..5eb7f6e 100644 (file)
@@ -181,20 +181,27 @@ class ConfigParserData
      */
     struct ServiceInfo
     {
+        enum class Disposition {
+            WINDOW = 0,
+            INLINE
+        };
         ServiceInfo(
             const DPL::String& src,
             const DPL::String& operation,
             const DPL::String& scheme,
-            const DPL::String& mime) :
+            const DPL::String& mime,
+            const Disposition dispos) :
             m_src(src),
             m_operation(operation),
             m_scheme(scheme),
-            m_mime(mime)
+            m_mime(mime),
+            m_disposition(dispos)
         {}
         DPL::String m_src;
         DPL::String m_operation;
         DPL::String m_scheme;
         DPL::String m_mime;
+        Disposition m_disposition;
 
         bool operator==(const ServiceInfo&) const;
         bool operator!=(const ServiceInfo&) const;
index 9a41d5b..2aa4cd2 100755 (executable)
@@ -313,20 +313,21 @@ CREATE_TABLE(CRLResponseStorage)
 CREATE_TABLE_END()
 
 CREATE_TABLE(SettingsList)
-    COLUMN_NOT_NULL(appId,         INT,)
-    COLUMN_NOT_NULL(settingName,               TEXT,   )
-    COLUMN_NOT_NULL(settingValue,        TEXT,   )
+    COLUMN_NOT_NULL(appId,          INT,)
+    COLUMN_NOT_NULL(settingName,    TEXT,)
+    COLUMN_NOT_NULL(settingValue,   TEXT,)
     TABLE_CONSTRAINTS(
         FOREIGN KEY (appId) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
     )
 CREATE_TABLE_END()
 
 CREATE_TABLE(ApplicationServiceInfo)
-    COLUMN_NOT_NULL(app_id,    INT,)
-    COLUMN_NOT_NULL(src,       TEXT,)
-    COLUMN_NOT_NULL(operation, TEXT,)
-    COLUMN_NOT_NULL(scheme,    TEXT,)
-    COLUMN_NOT_NULL(mime,      TEXT,)
+    COLUMN_NOT_NULL(app_id,         INT,)
+    COLUMN_NOT_NULL(src,            TEXT,)
+    COLUMN_NOT_NULL(operation,      TEXT,)
+    COLUMN_NOT_NULL(scheme,         TEXT,)
+    COLUMN_NOT_NULL(mime,           TEXT,)
+    COLUMN_NOT_NULL(disposition,    TINYINT, DEFAULT 0)
 
     TABLE_CONSTRAINTS(
         PRIMARY KEY(app_id, operation, scheme, mime)