Clean-up application service
authorJihoon Chung <jihoon.chung@samsung.com>
Sat, 20 Apr 2013 12:37:35 +0000 (21:37 +0900)
committerJihoon Chung <jihoon.chung@samsung.com>
Sat, 20 Apr 2013 13:20:35 +0000 (22:20 +0900)
[Issue#] N/A
[Problem] N/A
[Cause] N/A
[Solution] Remove deprecated code, appservice
[SCMRequest] must be imported with wrt, wrt-installer

Change-Id: I012661c5d349e1e2822f6076ce6c7051637e4ac4

modules/widget_dao/dao/config_parser_data.cpp
modules/widget_dao/dao/widget_dao.cpp
modules/widget_dao/dao/widget_dao_read_only.cpp [changed mode: 0755->0644]
modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h [changed mode: 0755->0644]
modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h
modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h [changed mode: 0755->0644]
modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h
modules/widget_dao/orm/wrt_db

index 969e20b..4477344 100644 (file)
@@ -376,24 +376,6 @@ bool ConfigParserData::Setting::operator<=(const Setting& other) const
     return m_name <= other.m_name;
 }
 
-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_disposition == info.m_disposition;
-}
-
-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_disposition != info.m_disposition;
-}
-
 bool ConfigParserData::AppControlInfo::operator== (const AppControlInfo& info) const
 {
     return m_src == info.m_src &&
index e5ca1af..553028f 100644 (file)
@@ -308,7 +308,7 @@ void WidgetDAO::registerWidgetInternal(
 
     registerWidgetSettings(widgetHandle, widgetRegInfo);
 
-    registerAppService(widgetHandle, widgetRegInfo);
+    registerAppControl(widgetHandle, widgetRegInfo);
 
     registerEncryptedResouceInfo(widgetHandle, widgetRegInfo);
 
@@ -674,10 +674,10 @@ void WidgetDAO::registerWidgetSettings(DbWidgetHandle widgetHandle,
     }
 }
 
-void WidgetDAO::insertApplicationServiceInfo(DbWidgetHandle handle,
+void WidgetDAO::insertAppControlInfo(DbWidgetHandle handle,
                                              DPL::String src,
                                              DPL::String operation,
-                                             DPL::String scheme,
+                                             DPL::String uri,
                                              DPL::String mime,
                                              unsigned index,
                                              unsigned disposition)
@@ -685,41 +685,26 @@ void WidgetDAO::insertApplicationServiceInfo(DbWidgetHandle handle,
     using namespace DPL::DB::ORM;
     using namespace DPL::DB::ORM::wrt;
 
-    ApplicationServiceInfo::Row row;
+    AppControlInfo::Row row;
 
     row.Set_app_id(handle);
-    row.Set_service_index(index);
+    row.Set_execute_index(index);
     row.Set_src(src);
     row.Set_operation(operation);
-    row.Set_scheme(scheme);
+    row.Set_uri(uri);
     row.Set_mime(mime);
     row.Set_disposition(disposition);
 
-    DO_INSERT(row, ApplicationServiceInfo);
+    DO_INSERT(row, AppControlInfo);
 }
 
-void WidgetDAO::registerAppService(DbWidgetHandle widgetHandle,
+void WidgetDAO::registerAppControl(DbWidgetHandle widgetHandle,
                                    const WidgetRegisterInfo &regInfo)
 {
     using namespace DPL::DB::ORM;
     using namespace DPL::DB::ORM::wrt;
     const ConfigParserData& widgetConfigurationInfo = regInfo.configInfo;
 
-    // appServiceList
-    FOREACH(ASIt, widgetConfigurationInfo.appServiceList)
-    {
-        ApplicationServiceInfo::Row row;
-        row.Set_app_id(widgetHandle);
-        row.Set_service_index(ASIt->m_index);
-        row.Set_src(ASIt->m_src);
-        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)
-    }
-
     // appControlList
     FOREACH(appControl_it, widgetConfigurationInfo.appControlList)
     {
@@ -733,7 +718,7 @@ void WidgetDAO::registerAppService(DbWidgetHandle widgetHandle,
         {
             FOREACH(uri_it, appControl_it->m_uriList)
             {
-                DPL::String scheme = *uri_it;
+                DPL::String uri = *uri_it;
 
                 if (!appControl_it->m_mimeList.empty())
                 {
@@ -741,20 +726,20 @@ void WidgetDAO::registerAppService(DbWidgetHandle widgetHandle,
                     {
                         DPL::String mime = *mime_it;
 
-                        insertApplicationServiceInfo(widgetHandle, src, operation, scheme, mime, index, disposition);
+                        insertAppControlInfo(widgetHandle, src, operation, uri, mime, index, disposition);
                     }
                 }
                 else
                 {
                     DPL::String mime = L"";
 
-                    insertApplicationServiceInfo(widgetHandle, src, operation, scheme, mime, index, disposition);
+                    insertAppControlInfo(widgetHandle, src, operation, uri, mime, index, disposition);
                 }
             }
         }
         else
         {
-            DPL::String scheme = L"";
+            DPL::String uri = L"";
 
             if (!appControl_it->m_mimeList.empty())
             {
@@ -762,14 +747,14 @@ void WidgetDAO::registerAppService(DbWidgetHandle widgetHandle,
                 {
                     DPL::String mime = *mime_it;
 
-                    insertApplicationServiceInfo(widgetHandle, src, operation, scheme, mime, index, disposition);
+                    insertAppControlInfo(widgetHandle, src, operation, uri, mime, index, disposition);
                 }
             }
             else
             {
                 DPL::String mime = L"";
 
-                insertApplicationServiceInfo(widgetHandle, src, operation, scheme, mime, index, disposition);
+                insertAppControlInfo(widgetHandle, src, operation, uri, mime, index, disposition);
             }
         }
     }
old mode 100755 (executable)
new mode 100644 (file)
index 877b2cd..ae57410
@@ -1066,39 +1066,39 @@ void WidgetDAOReadOnly::getWidgetSettings(
     SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get settings list")
 }
 
-void WidgetDAOReadOnly::getAppServiceList(
-    WidgetApplicationServiceList& outAppServiceList) const
+void WidgetDAOReadOnly::getAppControlList(
+    WidgetAppControlList& outAppControlList) const
 {
-    LogDebug("Getting getAppServiceList. Handle: " << m_widgetHandle);
+    LogDebug("Getting getAppControlList. Handle: " << m_widgetHandle);
     SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
     {
         ScopedTransaction transaction(&WrtDatabase::interface());
         CHECK_WIDGET_EXISTENCE(transaction, m_widgetHandle)
 
-        WRT_DB_SELECT(select, ApplicationServiceInfo, &WrtDatabase::interface())
-        select->Where(Equals<ApplicationServiceInfo::app_id>(m_widgetHandle));
+        WRT_DB_SELECT(select, AppControlInfo, &WrtDatabase::interface())
+        select->Where(Equals<AppControlInfo::app_id>(m_widgetHandle));
 
-        ApplicationServiceInfo::Select::RowList rows = select->GetRowList();
+        AppControlInfo::Select::RowList rows = select->GetRowList();
 
         if (rows.empty()) {
-            LogDebug("Application Service list is empty. Handle: " <<
+            LogDebug("AppControl list is empty. Handle: " <<
                      m_widgetHandle);
         }
 
         FOREACH(it, rows) {
-            WidgetApplicationService ret;
+            WidgetAppControl ret;
             ret.src = it->Get_src();
             ret.operation = it->Get_operation();
-            ret.scheme = it->Get_scheme();
+            ret.uri = it->Get_uri();
             ret.mime = it->Get_mime();
-            ret.disposition = static_cast<WidgetApplicationService::Disposition>(it->Get_disposition());
-            ret.index = it->Get_service_index();
-            outAppServiceList.push_back(ret);
+            ret.disposition = static_cast<WidgetAppControl::Disposition>(it->Get_disposition());
+            ret.index = it->Get_execute_index();
+            outAppControlList.push_back(ret);
         }
 
         transaction.Commit();
     }
-    SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get access host list")
+    SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get AppControl list")
 }
 
 PackagingType WidgetDAOReadOnly::getPackagingType() const
old mode 100755 (executable)
new mode 100644 (file)
index f8ffde4..77209e3
@@ -343,12 +343,12 @@ struct WidgetSetting
 typedef std::list<WidgetSetting> WidgetSettings;
 
 /**
- * @brief Widget Application Service
+ * @brief Widget AppControl
  *
- * Application sercvice describes details of behaviour
+ * Application control describes details of behaviour
  * when widget receives aul bundle data.
  */
-struct WidgetApplicationService
+struct WidgetAppControl
 {
     enum class Disposition {
         WINDOW = 0,
@@ -357,21 +357,21 @@ struct WidgetApplicationService
 
     DPL::String src;       /* start uri */
     DPL::String operation; /* service name */
-    DPL::String scheme;    /* scheme type*/
+    DPL::String uri;    /* scheme type*/
     DPL::String mime;      /* mime type */
     Disposition disposition;
     unsigned index;
 
-    bool operator== (const WidgetApplicationService& other) const
+    bool operator== (const WidgetAppControl& other) const
     {
         return src == other.src &&
                operation == other.operation &&
-               scheme == other.scheme &&
+               uri == other.uri &&
                mime == other.mime &&
                disposition == other.disposition;
     }
 };
 
-typedef std::list<WidgetApplicationService> WidgetApplicationServiceList;
+typedef std::list<WidgetAppControl> WidgetAppControlList;
 } // namespace WrtDB
 #endif /* WRT_WIDGET_DAO_COMMON_DAO_TYPES_H_ */
index a37e252..aa0c6b9 100644 (file)
@@ -157,39 +157,6 @@ class ConfigParserData
 
     typedef std::set<Setting> SettingsList;
 
-    /* ServiceInfo will be removed.
-     * ServiceInfo will be changed AppControl
-     */
-    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 Disposition dispos) :
-            m_src(src),
-            m_operation(operation),
-            m_scheme(scheme),
-            m_mime(mime),
-            m_disposition(dispos),
-            m_index(0)
-        {}
-        DPL::String m_src;
-        DPL::String m_operation;
-        DPL::String m_scheme;
-        DPL::String m_mime;
-        Disposition m_disposition;
-        unsigned m_index;
-
-        bool operator==(const ServiceInfo&) const;
-        bool operator!=(const ServiceInfo&) const;
-    };
-
     struct AppControlInfo
     {
         enum class Disposition {
@@ -211,7 +178,6 @@ class ConfigParserData
         bool operator!=(const AppControlInfo&) const;
     };
 
-    typedef std::list<ServiceInfo> ServiceInfoList; // It will be removed.
     typedef std::list<AppControlInfo> AppControlInfoList;
 
     typedef std::list<std::pair<DPL::String, DPL::String> > BoxSizeList;
@@ -327,8 +293,7 @@ class ConfigParserData
     DPL::OptionalString cspPolicy;
     DPL::OptionalString cspPolicyReportOnly;
 
-    //Application service model list
-    ServiceInfoList appServiceList; //It will be removed.
+    //AppControl model list
     AppControlInfoList appControlList;
 
     // For link shared directory
old mode 100755 (executable)
new mode 100644 (file)
index a37da85..b92cb38
@@ -748,13 +748,13 @@ class WidgetDAOReadOnly
     void getWidgetSettings(WidgetSettings& outWidgetSettings) const;
 
     /**
-     * This method gets application service list that define AUL value
+     * This method gets application control list that define AUL value
      *
      * @return See above comment
      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
      */
-    void getAppServiceList(
-        WidgetApplicationServiceList& outAppServiceList) const;
+    void getAppControlList(
+        WidgetAppControlList& outAppControlList) const;
 
     /**
      * This method returns the type of the package.
index 73348e9..b3c276a 100644 (file)
@@ -196,7 +196,7 @@ class WidgetDAO : public WidgetDAOReadOnly
     static void registerWidgetSettings(
         DbWidgetHandle widgetHandle,
         const WidgetRegisterInfo &regInfo);
-    static void registerAppService(
+    static void registerAppControl(
         DbWidgetHandle widgetHandle,
         const WidgetRegisterInfo &regInfo);
     static void registerEncryptedResouceInfo(
@@ -222,10 +222,10 @@ class WidgetDAO : public WidgetDAOReadOnly
     static void unregisterWidgetInternal(
         const TizenAppId & tzAppId);
 
-    static void insertApplicationServiceInfo(DbWidgetHandle handle,
+    static void insertAppControlInfo(DbWidgetHandle handle,
                                              DPL::String src,
                                              DPL::String operation,
-                                             DPL::String scheme,
+                                             DPL::String uri,
                                              DPL::String mime,
                                              unsigned index,
                                              unsigned disposition);
index 0c40a33..3a16855 100755 (executable)
@@ -312,17 +312,17 @@ CREATE_TABLE(SettingsList)
     )
 CREATE_TABLE_END()
 
-CREATE_TABLE(ApplicationServiceInfo)
+CREATE_TABLE(AppControlInfo)
     COLUMN_NOT_NULL(app_id,         INT,)
-    COLUMN_NOT_NULL(service_index,  INT,)
+    COLUMN_NOT_NULL(execute_index,  INT,)
     COLUMN_NOT_NULL(src,            TEXT,)
     COLUMN_NOT_NULL(operation,      TEXT,)
-    COLUMN_NOT_NULL(scheme,         TEXT,)
+    COLUMN_NOT_NULL(uri,            TEXT,)
     COLUMN_NOT_NULL(mime,           TEXT,)
     COLUMN_NOT_NULL(disposition,    TINYINT, DEFAULT 0)
 
     TABLE_CONSTRAINTS(
-        PRIMARY KEY(app_id, operation, scheme, mime)
+        PRIMARY KEY(app_id, operation, uri, mime)
         FOREIGN KEY(app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
     )
 CREATE_TABLE_END()