Clean-up pkgname
authorJihoon Chung <jihoon.chung@samsung.com>
Fri, 19 Apr 2013 05:35:44 +0000 (14:35 +0900)
committerJihoon Chung <jihoon.chung@samsung.com>
Fri, 19 Apr 2013 06:09:26 +0000 (15:09 +0900)
[Issue#] N/A
[Problem] N/A
[Cause] N/A
[Solution] Some code naming is pkgname even using for app id.
Replace pkgname to application id.
[SCMRequest] N/A

Change-Id: I167ca38deb2c8c2209aece7b7260b65695250a78

modules/certificate_dao/dao/certificate_dao.cpp
modules/certificate_dao/include/wrt-commons/certificate-dao/certificate_dao.h
modules/localization/include/dpl/localization/w3c_file_localization.h [changed mode: 0644->0755]
modules/localization/src/w3c_file_localization.cpp [changed mode: 0644->0755]
modules/security_origin_dao/dao/security_origin_dao.cpp
modules/security_origin_dao/include/wrt-commons/security-origin-dao/security_origin_dao.h
modules/widget_dao/dao/widget_dao_read_only.cpp
modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h [changed mode: 0644->0755]
modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h

index 5bcd6e7..d5506eb 100755 (executable)
@@ -32,7 +32,7 @@
 #include <dpl/wrt-dao-ro/common_dao_types.h>
 #include <sys/stat.h>
 #include <fstream>
-/* GCC versions 4.7 had changes to the C++ standard. It 
+/* GCC versions 4.7 had changes to the C++ standard. It
  * no longer includes <unistd.h> to remove namespace pollution.
  */
 #include <unistd.h>
@@ -63,7 +63,7 @@ const char* const CERTIFICATE_DATABASE_JOURNAL_FILENAME = "-journal";
 const int WEB_APPLICATION_UID = 5000;
 const int WEB_APPLICATION_GUID = 5000;
 
-std::string createDatabasePath(const WrtDB::WidgetPkgName &pkgName)
+std::string createDatabasePath(const WrtDB::TizenPkgId &pkgName)
 {
     std::stringstream filename;
 
@@ -73,24 +73,6 @@ std::string createDatabasePath(const WrtDB::WidgetPkgName &pkgName)
     return filename.str();
 }
 
-std::string createDatabasePath(int widgetHandle)
-{
-    using namespace DPL::DB::ORM;
-    using namespace WrtDB::WidgetConfig;
-    using namespace WrtDB::GlobalConfig;
-
-    WrtDB::TizenAppId appid;
-
-    Try
-    {
-        appid = WrtDB::WidgetDAOReadOnly::getTzAppId(widgetHandle);
-    }
-    Catch(DPL::DB::SqlConnection::Exception::Base) {
-        LogError("Failed to get database Path");
-    }
-    return createDatabasePath(appid);
-}
-
 void checkDatabase(std::string databasePath)
 {
     SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
@@ -144,7 +126,7 @@ void checkDatabase(std::string databasePath)
 }
 }
 
-CertificateDAO::CertificateDAO(const WrtDB::WidgetPkgName &pkgName) :
+CertificateDAO::CertificateDAO(const WrtDB::TizenPkgId &pkgName) :
     m_certificateDBPath(createDatabasePath(pkgName)),
     m_certificateDBInterface(m_certificateDBPath, CERTIFICATE_DB_TYPE)
 {
index 9260ab7..26e981b 100755 (executable)
@@ -38,7 +38,7 @@ class CertificateDAO
         DECLARE_EXCEPTION_TYPE(Base, DataNotExist)
     };
 
-    explicit CertificateDAO(const WrtDB::WidgetPkgName &pkgName);
+    explicit CertificateDAO(const WrtDB::TizenPkgId &pkgName);
     virtual ~CertificateDAO();
     CertificateDataList getCertificateDataList();
     Result getResult(const CertificateData &certificateData);
old mode 100644 (file)
new mode 100755 (executable)
index 4f6aa1d..52c3af9
@@ -39,7 +39,7 @@ DPL::Optional<DPL::String> getFilePathInWidgetPackageFromUrl(
     WrtDB::DbWidgetHandle widgetHandle,
     const DPL::String &url);
 DPL::Optional<DPL::String> getFilePathInWidgetPackageFromUrl(
-    const WrtDB::WidgetPkgName &pkgname,
+    const WrtDB::TizenAppId &tzAppId,
     const DPL::String &url);
 DPL::Optional<DPL::String> getFilePathInWidgetPackageFromUrl(
     WrtDB::WidgetDAOReadOnlyPtr dao,
@@ -49,37 +49,37 @@ DPL::Optional<DPL::String> getFilePathInWidgetPackage(
     WrtDB::DbWidgetHandle widgetHandle,
     const DPL::String& file);
 DPL::Optional<DPL::String> getFilePathInWidgetPackage(
-    const WrtDB::WidgetPkgName &pkgname,
+    const WrtDB::TizenAppId &tzAppId,
     const DPL::String& file);
 DPL::Optional<DPL::String> getFilePathInWidgetPackage(
     WrtDB::WidgetDAOReadOnlyPtr dao,
     const DPL::String& file);
 
 DPL::OptionalString getStartFile(WrtDB::DbWidgetHandle handle);
-DPL::OptionalString getStartFile(const WrtDB::WidgetPkgName & pkgname);
+DPL::OptionalString getStartFile(const WrtDB::TizenAppId & tzAppId);
 DPL::OptionalString getStartFile(WrtDB::WidgetDAOReadOnlyPtr dao);
 
 OptionalWidgetIcon getIcon(WrtDB::DbWidgetHandle widgetHandle);
-OptionalWidgetIcon getIcon(const WrtDB::WidgetPkgName & pkgname);
+OptionalWidgetIcon getIcon(const WrtDB::TizenAppId & tzAppId);
 OptionalWidgetIcon getIcon(WrtDB::WidgetDAOReadOnlyPtr dao);
 
 WidgetIconList getValidIconsList(
     WrtDB::DbWidgetHandle widgetHandle);
 WidgetIconList getValidIconsList(
-    const WrtDB::WidgetPkgName &pkgname);
+    const WrtDB::TizenAppId &tzAppId);
 WidgetIconList getValidIconsList(
     WrtDB::WidgetDAOReadOnlyPtr dao);
 
 OptionalWidgetStartFileInfo getStartFileInfo(
     WrtDB::DbWidgetHandle widgetHandle);
 OptionalWidgetStartFileInfo getStartFileInfo(
-    const WrtDB::WidgetPkgName &pkgname);
+    const WrtDB::TizenAppId &tzAppId);
 OptionalWidgetStartFileInfo getStartFileInfo(
     WrtDB::WidgetDAOReadOnlyPtr dao);
 
 WrtDB::WidgetLocalizedInfo getLocalizedInfo(WrtDB::DbWidgetHandle widgetHandle);
 WrtDB::WidgetLocalizedInfo getLocalizedInfo(
-    const WrtDB::WidgetPkgName & pkgname);
+    const WrtDB::TizenAppId & tzAppId);
 WrtDB::WidgetLocalizedInfo getLocalizedInfo(WrtDB::WidgetDAOReadOnlyPtr dao);
 }
 
old mode 100644 (file)
new mode 100755 (executable)
index 4bea51f..85ac27e
@@ -127,11 +127,11 @@ DPL::Optional<DPL::String> getFilePathInWidgetPackageFromUrl(
 }
 
 DPL::Optional<DPL::String> getFilePathInWidgetPackageFromUrl(
-    const WrtDB::WidgetPkgName &pkgname,
+    const WrtDB::TizenAppId &tzAppId,
     const DPL::String &url)
 {
     return getFilePathInWidgetPackageFromUrl(
-               WidgetDAOReadOnlyPtr(new WidgetDAOReadOnly(pkgname)),
+               WidgetDAOReadOnlyPtr(new WidgetDAOReadOnly(tzAppId)),
                url);
 }
 
@@ -197,11 +197,11 @@ DPL::Optional<DPL::String> getFilePathInWidgetPackage(
 }
 
 DPL::Optional<DPL::String> getFilePathInWidgetPackage(
-    const WrtDB::WidgetPkgName &pkgname,
+    const WrtDB::TizenAppId &tzAppId,
     const DPL::String& file)
 {
     return getFilePathInWidgetPackage(
-               WidgetDAOReadOnlyPtr(new WidgetDAOReadOnly(pkgname)),
+               WidgetDAOReadOnlyPtr(new WidgetDAOReadOnly(tzAppId)),
                file);
 }
 
@@ -212,9 +212,9 @@ DPL::Optional<DPL::String> getFilePathInWidgetPackage(
     return GetFilePathInWidgetPackageInternal(dao->getPath(), file);
 }
 
-DPL::OptionalString getStartFile(const WrtDB::WidgetPkgName & pkgname)
+DPL::OptionalString getStartFile(const WrtDB::TizenAppId & tzAppId)
 {
-    return getStartFile(WidgetDAOReadOnlyPtr(new WidgetDAOReadOnly(pkgname)));
+    return getStartFile(WidgetDAOReadOnlyPtr(new WidgetDAOReadOnly(tzAppId)));
 }
 
 DPL::OptionalString getStartFile(const WrtDB::DbWidgetHandle handle)
@@ -253,9 +253,9 @@ DPL::OptionalString getStartFile(WrtDB::WidgetDAOReadOnlyPtr dao)
     return DPL::OptionalString::Null;
 }
 
-OptionalWidgetIcon getIcon(const WrtDB::WidgetPkgName & pkgname)
+OptionalWidgetIcon getIcon(const WrtDB::TizenAppId & tzAppId)
 {
-    return getIcon(WidgetDAOReadOnlyPtr(new WidgetDAOReadOnly(pkgname)));
+    return getIcon(WidgetDAOReadOnlyPtr(new WidgetDAOReadOnly(tzAppId)));
 }
 
 OptionalWidgetIcon getIcon(WrtDB::DbWidgetHandle widgetHandle)
@@ -304,10 +304,10 @@ WidgetIconList getValidIconsList(WrtDB::DbWidgetHandle widgetHandle)
                WidgetDAOReadOnlyPtr(new WidgetDAOReadOnly(widgetHandle)));
 }
 
-WidgetIconList getValidIconsList(const WrtDB::WidgetPkgName &pkgname)
+WidgetIconList getValidIconsList(const WrtDB::TizenAppId &tzAppId)
 {
     return getValidIconsList(
-               WidgetDAOReadOnlyPtr(new WidgetDAOReadOnly(pkgname)));
+               WidgetDAOReadOnlyPtr(new WidgetDAOReadOnly(tzAppId)));
 }
 
 WidgetIconList getValidIconsList(WrtDB::WidgetDAOReadOnlyPtr dao)
@@ -339,10 +339,10 @@ OptionalWidgetStartFileInfo getStartFileInfo(WrtDB::DbWidgetHandle widgetHandle)
 }
 
 OptionalWidgetStartFileInfo getStartFileInfo(
-    const WrtDB::WidgetPkgName &pkgname)
+    const WrtDB::TizenAppId &tzAppId)
 {
     return getStartFileInfo(
-               WidgetDAOReadOnlyPtr(new WidgetDAOReadOnly(pkgname)));
+               WidgetDAOReadOnlyPtr(new WidgetDAOReadOnly(tzAppId)));
 }
 
 OptionalWidgetStartFileInfo getStartFileInfo(WrtDB::WidgetDAOReadOnlyPtr dao)
@@ -389,9 +389,9 @@ WidgetLocalizedInfo getLocalizedInfo(const WrtDB::DbWidgetHandle handle)
     return getLocalizedInfo(WidgetDAOReadOnlyPtr(new WidgetDAOReadOnly(handle)));
 }
 
-WidgetLocalizedInfo getLocalizedInfo(const WrtDB::WidgetPkgName & pkgname)
+WidgetLocalizedInfo getLocalizedInfo(const WrtDB::TizenAppId & tzAppId)
 {
-    return getLocalizedInfo(WidgetDAOReadOnlyPtr(new WidgetDAOReadOnly(pkgname)));
+    return getLocalizedInfo(WidgetDAOReadOnlyPtr(new WidgetDAOReadOnly(tzAppId)));
 }
 
 WidgetLocalizedInfo getLocalizedInfo(WidgetDAOReadOnlyPtr dao)
index f3c4740..0293898 100755 (executable)
@@ -61,7 +61,7 @@ const char* const SECURITY_DATABASE_JOURNAL_FILENAME = "-journal";
 const int WEB_APPLICATION_UID = 5000;
 const int WEB_APPLICATION_GUID = 5000;
 
-std::string createDatabasePath(const WrtDB::WidgetPkgName &pkgName)
+std::string createDatabasePath(const WrtDB::TizenPkgId &pkgName)
 {
     std::stringstream filename;
 
@@ -71,24 +71,6 @@ std::string createDatabasePath(const WrtDB::WidgetPkgName &pkgName)
     return filename.str();
 }
 
-std::string createDatabasePath(int widgetHandle)
-{
-    using namespace DPL::DB::ORM;
-    using namespace WrtDB::WidgetConfig;
-    using namespace WrtDB::GlobalConfig;
-
-    WrtDB::TizenAppId appid;
-
-    Try
-    {
-        appid = WrtDB::WidgetDAOReadOnly::getTzAppId(widgetHandle);
-    }
-    Catch(DPL::DB::SqlConnection::Exception::Base) {
-        LogError("Failed to get database Path");
-    }
-    return createDatabasePath(appid);
-}
-
 void checkDatabase(std::string databasePath)
 {
     SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
@@ -142,15 +124,7 @@ void checkDatabase(std::string databasePath)
 }
 }
 
-SecurityOriginDAO::SecurityOriginDAO(int handle) :
-    m_securityOriginDBPath(createDatabasePath(handle)),
-    m_securityOriginDBInterface(m_securityOriginDBPath, SECURITY_ORIGIN_DB_TYPE)
-{
-    checkDatabase(m_securityOriginDBPath);
-    m_securityOriginDBInterface.AttachToThread(SECURITY_ORIGIN_DB_OPTION);
-}
-
-SecurityOriginDAO::SecurityOriginDAO(const WrtDB::WidgetPkgName &pkgName) :
+SecurityOriginDAO::SecurityOriginDAO(const WrtDB::TizenPkgId &pkgName) :
     m_securityOriginDBPath(createDatabasePath(pkgName)),
     m_securityOriginDBInterface(m_securityOriginDBPath, SECURITY_ORIGIN_DB_TYPE)
 {
index 146ea6d..e8c8604 100755 (executable)
@@ -39,8 +39,7 @@ class SecurityOriginDAO
         DECLARE_EXCEPTION_TYPE(Base, DataNotExist)
     };
 
-    explicit SecurityOriginDAO(int handle) __attribute__((deprecated));
-    explicit SecurityOriginDAO(const WrtDB::WidgetPkgName &pkgName);
+    explicit SecurityOriginDAO(const WrtDB::TizenPkgId &pkgName);
     virtual ~SecurityOriginDAO();
     SecurityOriginDataList getSecurityOriginDataList();
     Result getResult(const SecurityOriginData &securityOriginData);
index 2afc1b9..877b2cd 100755 (executable)
@@ -156,7 +156,7 @@ TizenAppId getTizenAppIdByPkgId(const TizenPkgId tzPkgid)
     SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed in getHandle")
 }
 
-WidgetPkgName getTizenPkgIdByHandle(const DbWidgetHandle handle)
+TizenPkgId getTizenPkgIdByHandle(const DbWidgetHandle handle)
 {
     LogDebug("Getting TizenPkgId by DbWidgetHandle: " << handle);
 
@@ -170,7 +170,7 @@ WidgetPkgName getTizenPkgIdByHandle(const DbWidgetHandle handle)
             ThrowMsg(WidgetDAOReadOnly::Exception::WidgetNotExist,
                      "Failed to get widget by handle");
         }
-        WidgetPkgName tzPkgid = rowList.front().Get_tizen_pkgid();
+        TizenPkgId tzPkgid = rowList.front().Get_tizen_pkgid();
 
         return tzPkgid;
     }
@@ -189,7 +189,7 @@ WidgetDAOReadOnly::WidgetDAOReadOnly(DPL::OptionalString widgetGUID) :
     m_widgetHandle(WidgetDAOReadOnly::getHandle(widgetGUID))
 {}
 
-WidgetDAOReadOnly::WidgetDAOReadOnly(DPL::String tzAppid) :
+WidgetDAOReadOnly::WidgetDAOReadOnly(TizenAppId tzAppid) :
     m_widgetHandle(WidgetDAOReadOnly::getHandle(tzAppid))
 {}
 
@@ -239,21 +239,6 @@ DbWidgetHandle WidgetDAOReadOnly::getHandle(const DPL::String tzAppId)
     SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed in getHandle")
 }
 
-WidgetPkgName WidgetDAOReadOnly::getPkgName() const
-{
-    return getTizenPkgIdByHandle(m_widgetHandle);
-}
-
-WidgetPkgName WidgetDAOReadOnly::getPkgName(const WidgetGUID GUID)
-{
-    return getTizenPkgIdByHandle(getHandle(GUID));
-}
-
-WidgetPkgName WidgetDAOReadOnly::getPkgName(const DbWidgetHandle handle)
-{
-    return getTizenPkgIdByHandle(handle);
-}
-
 TizenAppId WidgetDAOReadOnly::getTzAppId() const
 {
     return getTizenAppIdByHandle(m_widgetHandle);
@@ -274,6 +259,11 @@ TizenAppId WidgetDAOReadOnly::getTzAppId(const TizenPkgId tzPkgid)
     return getTizenAppIdByPkgId(tzPkgid);
 }
 
+TizenPkgId WidgetDAOReadOnly::getTzPkgId() const
+{
+    return getTizenPkgIdByHandle(m_widgetHandle);
+}
+
 PropertyDAOReadOnly::WidgetPropertyKeyList
 WidgetDAOReadOnly::getPropertyKeyList() const
 {
@@ -433,17 +423,6 @@ DbWidgetHandleList WidgetDAOReadOnly::getHandleList()
     SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get handle list")
 }
 
-WidgetPkgNameList WidgetDAOReadOnly::getPkgnameList()
-{
-    LogDebug("Getting Pkgname List ");
-    SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
-    {
-        WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface())
-        return select->GetValueList<WidgetInfo::tizen_appid>();
-    }
-    SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get Pkgname list")
-}
-
 TizenAppIdList WidgetDAOReadOnly::getTizenAppidList()
 {
     LogDebug("Getting Pkgname List ");
old mode 100644 (file)
new mode 100755 (executable)
index c345fc8..0ee8e52
@@ -81,7 +81,6 @@ class PluginObjectsDAO
 typedef int DbWidgetHandle;
 typedef DPL::String TizenPkgId;
 typedef DPL::String TizenAppId;
-typedef DPL::String WidgetPkgName;
 
 /**
  * Value of invalid widget handle
@@ -213,13 +212,7 @@ typedef std::multiset<DbWidgetFeature> DbWidgetFeatureSet;
  * @brief Default container with DbWidgetHandle's
  */
 typedef std::list<DbWidgetHandle> DbWidgetHandleList;
-
-typedef std::list<WidgetPkgName> WidgetPkgNameList; //TODO: this cannot be null
-                                                    // -> appropriate changes in
-                                                    // db schema needed
-typedef std::list<TizenAppId> TizenAppIdList; //TODO: this cannot be null ->
-                                              // appropriate changes in db
-                                              // schema needed
+typedef std::list<TizenAppId> TizenAppIdList;
 
 class WidgetDAOReadOnly; //forward declaration
 typedef std::shared_ptr<WidgetDAOReadOnly> WidgetDAOReadOnlyPtr;
index 5e585c2..a37da85 100755 (executable)
@@ -295,7 +295,7 @@ class WidgetDAOReadOnly
      */
     WidgetDAOReadOnly(DbWidgetHandle widgetHandle);
     WidgetDAOReadOnly(DPL::OptionalString widgetGUID);
-    WidgetDAOReadOnly(DPL::String tzAppid);
+    WidgetDAOReadOnly(WrtDB::TizenAppId tzAppid);
 
     /**
      * Destructor
@@ -329,17 +329,15 @@ class WidgetDAOReadOnly
     static TizenAppId getTzAppId(const TizenPkgId tzPkgid);
 
     /**
-     * Returns WidgetPkgName for the specified widget
+     * Returns TizenPkgId for the specified widget
      *
-     * @return pkgName;
+     * @return TizenPkgId;
      * @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.
      */
 
-    WidgetPkgName getPkgName() const;
-    static WidgetPkgName getPkgName(const WidgetGUID GUID);
-    static WidgetPkgName getPkgName(const DbWidgetHandle handle);
+    TizenPkgId getTzPkgId() const;
 
     /**
      * This method returns the root directory of widget resource.
@@ -597,11 +595,10 @@ class WidgetDAOReadOnly
     static DbWidgetHandleList getHandleList();
 
     /**
-     * This method returns list of pkgname of installed packages
-     * @return list of pkgname of installed packages
+     * This method returns list of tizen application list of installed packages
+     * @return list of TizenAppIdList of installed packages
      */
     static TizenAppIdList getTizenAppidList();
-    static WidgetPkgNameList getPkgnameList();
 
     /**
      * This method returns a list of all the installed widgets.