Change pkgname to appid for docomo request. PART1
authorSoyoung Kim <sy037.kim@samsung.com>
Wed, 23 Jan 2013 12:26:44 +0000 (21:26 +0900)
committerSoyoung Kim <sy037.kim@samsung.com>
Mon, 28 Jan 2013 07:47:40 +0000 (16:47 +0900)
[Issue#] N/A
[Problem] application unique field is appid not pkgid.
[Cause] N/A
[Solution] Fixed pkgname to appid and add pkgid.
[SCMRequest] this package should be imported after wrt-commons has been released.

32 files changed:
configuration/config.tizen.xsd
src/configuration_parser/widget_parser.cpp
src/jobs/widget_install/job_widget_install.cpp
src/jobs/widget_install/job_widget_install.h
src/jobs/widget_install/task_ace_check.cpp
src/jobs/widget_install/task_certificates.cpp
src/jobs/widget_install/task_database.cpp
src/jobs/widget_install/task_encrypt_resource.cpp
src/jobs/widget_install/task_file_manipulation.cpp
src/jobs/widget_install/task_manifest_file.cpp
src/jobs/widget_install/task_smack.cpp
src/jobs/widget_install/task_widget_config.cpp
src/jobs/widget_install/widget_update_info.cpp
src/jobs/widget_install/widget_update_info.h
src/jobs/widget_uninstall/job_widget_uninstall.cpp
src/jobs/widget_uninstall/job_widget_uninstall.h
src/jobs/widget_uninstall/task_check.cpp
src/jobs/widget_uninstall/task_db_update.cpp
src/jobs/widget_uninstall/task_delete_certificates.cpp
src/jobs/widget_uninstall/task_remove_custom_handlers.cpp
src/jobs/widget_uninstall/task_remove_files.cpp
src/jobs/widget_uninstall/task_smack.cpp
src/jobs/widget_uninstall/task_uninstall_ospsvc.cpp
src/jobs/widget_uninstall/uninstaller_context.h
src/misc/feature_logic.cpp
src/misc/feature_logic.h
src/misc/widget_location.cpp
src/misc/widget_location.h
src/pkg-manager/backendlib.cpp
src/wrt-installer/wrt_installer.cpp
src/wrt-installer/wrt_installer_api.cpp
src/wrt-installer/wrt_installer_api.h

index 8fc4c99..99e8ecf 100755 (executable)
     <xs:restriction base="xs:anyURI"/>
 </xs:simpleType>
 
-<xs:simpleType name="applicationIdType">
+<xs:simpleType name="PackageType">
     <xs:restriction base="xs:string">
         <xs:pattern value="[0-9a-zA-Z]{10}"/>
     </xs:restriction>
 </xs:simpleType>
 
+<xs:simpleType name="applicationIdType">
+    <xs:restriction base="xs:string">
+        <xs:pattern value="[0-9a-zA-Z]{10}.[0-9a-zA-Z]{1,}"/>
+    </xs:restriction>
+</xs:simpleType>
+
 <xs:simpleType name="screenOrientationType">
     <xs:restriction base="xs:token">
         <xs:enumeration value="portrait"/>
@@ -69,6 +75,7 @@
 <xs:element name="application">
     <xs:complexType>
         <xs:attribute name="id" type="tizen:applicationIdType" use="required"/>
+        <xs:attribute name="package" type="tizen:PackageType" use="required"/>
         <xs:attribute name="required_version" type="xs:float" use="required"/>
     </xs:complexType>
 </xs:element>
index d740ac3..6926292 100755 (executable)
@@ -1506,6 +1506,8 @@ class ApplicationParser : public ElementParser
             LogDebug("attribute");
             if (attribute.name == L"id") {
                 m_id = attribute.value;
+            } else if (attribute.name == L"package") {
+                m_package = attribute.value;
             } else if (attribute.name == L"required_version") {
                 m_version = attribute.value;
                 NormalizeString(m_version);
@@ -1525,13 +1527,17 @@ class ApplicationParser : public ElementParser
                      "application element must have id attribute");
         }
 
+        if(!!m_package) {
+            m_data.tizenPkgId = m_package;
+        }
+
         if(!m_version) {
             ThrowMsg(Exception::ParseError,
                      "application element must have required_version attribute");
         }
 
         //TODO check if id and version format is right
-        m_data.tizenId = m_id;
+        m_data.tizenAppId = m_id;
         m_data.tizenMinVersionRequired = m_version;
     }
 
@@ -1547,6 +1553,7 @@ class ApplicationParser : public ElementParser
   private:
     ConfigParserData& m_data;
     DPL::OptionalString m_id;
+    DPL::OptionalString m_package;
     DPL::OptionalString m_version;
     bool m_properNamespace;
 };
index 0ebbc40..9e56959 100644 (file)
@@ -85,7 +85,8 @@ const char * const CONFIG_XML = "config.xml";
 const char * const WITH_OSP_XML = "res/wgt/config.xml";
 
 //allowed: a-z, A-Z, 0-9
-const char* REG_TIZENID_PATTERN = "^[a-zA-Z0-9]{10}$";
+const char* REG_TIZENID_PATTERN = "^[a-zA-Z0-9]{10}.[a-zA-Z0-9]{1,}$";
+const size_t PACKAGE_ID_LENGTH = 10;
 
 static const DPL::String SETTING_VALUE_ENCRYPTION = L"encryption";
 static const DPL::String SETTING_VALUE_ENCRYPTION_ENABLE = L"enable";
@@ -134,13 +135,13 @@ bool hasExtension(const std::string& filename, const std::string& extension) {
     return (0 == filename.compare(fileLen-extLen, extLen, extension));
 }
 
-bool checkTizenIdExist(const std::string& tizenId) {
+bool checkTizenPkgIdExist(const std::string& tizenPkgId) {
     std::string installPath =
         std::string(GlobalConfig::GetUserInstalledWidgetPath()) +
-        "/" + tizenId;
+        "/" + tizenPkgId;
     std::string preinstallPath =
         std::string(GlobalConfig::GetUserPreloadedWidgetPath()) +
-        "/" + tizenId;
+        "/" + tizenPkgId;
 
     struct stat dirStat;
     if ((stat(installPath.c_str(), &dirStat) == 0) &&
@@ -324,42 +325,88 @@ JobWidgetInstall::ConfigureResult JobWidgetInstall::PrePareInstallation(
 void JobWidgetInstall::setTizenId(
         const WrtDB::ConfigParserData &configInfo)
 {
+    bool shouldMakeAppid = false;
     using namespace PackageManager;
+    if(!!configInfo.tizenAppId) {
+        LogDebug("Setting tizenAppId provided in config.xml: " <<
+                configInfo.tizenAppId);
 
-    if(!!configInfo.tizenId) {
-        LogDebug("Setting tizenId provided in config.xml: " << configInfo.tizenId);
-        // send start signal of pkgmgr
-        getInstallerStruct().pkgmgrInterface->setPkgname(
-                DPL::ToUTF8String(*(configInfo.tizenId)));
-        getInstallerStruct().pkgmgrInterface->sendSignal(
-                PKGMGR_START_KEY,
-                PKGMGR_START_INSTALL);
-
-        m_installerContext.widgetConfig.pkgName = *configInfo.tizenId;
+        m_installerContext.widgetConfig.tzAppid = *configInfo.tizenAppId;
+        //check package id.
+        if(!!configInfo.tizenPkgId) {
+            LogDebug("Setting tizenPkgId provided in config.xml: " <<
+                    configInfo.tizenPkgId);
 
+            m_installerContext.widgetConfig.tzPkgid = *configInfo.tizenPkgId;
+        } else {
+            std::string appid = DPL::ToUTF8String(*configInfo.tizenAppId);
+            if(appid.length() > PACKAGE_ID_LENGTH) {
+                m_installerContext.widgetConfig.tzPkgid =
+                    DPL::FromUTF8String(appid.substr(PACKAGE_ID_LENGTH));
+            } else {
+                m_installerContext.widgetConfig.tzPkgid =
+                    *configInfo.tizenAppId;
+            }
+            shouldMakeAppid = true;
+        }
     } else {
-        WidgetPkgName tizenId = WidgetDAOReadOnly::generateTizenId();
-        LogDebug("Checking if tizen id is unique");
+        shouldMakeAppid = true;
+        TizenPkgId pkgId = WidgetDAOReadOnly::generatePkgId();
+        LogDebug("Checking if pkg id is unique");
         while (true) {
-            if (checkTizenIdExist(DPL::ToUTF8String(tizenId))) {
+            if (checkTizenPkgIdExist(DPL::ToUTF8String(pkgId))) {
                 //path exist, chose another one
-                tizenId = WidgetDAOReadOnly::generateTizenId();
+                pkgId = WidgetDAOReadOnly::generatePkgId();
                 continue;
             }
             break;
         }
+        m_installerContext.widgetConfig.tzPkgid = pkgId;
+        LogInfo("tizen_id name was generated by WRT: " <<
+                m_installerContext.widgetConfig.tzPkgid);
+
+    }
+
+    if(shouldMakeAppid == true) {
+        DPL::OptionalString name;
+        DPL::OptionalString defaultLocale = configInfo.defaultlocale;
+
+        FOREACH(localizedData, configInfo.localizedDataSet)
+        {
+            Locale i = localizedData->first;
+            if (!!defaultLocale) {
+                if (defaultLocale == i) {
+                    name = localizedData->second.name;
+                    break;
+                }
 
-        m_installerContext.widgetConfig.pkgName = tizenId;
-        LogInfo("tizen_id name was generated by WRT: " << tizenId);
-        // send start signal of pkgmgr
-        getInstallerStruct().pkgmgrInterface->setPkgname(DPL::ToUTF8String(
-                    m_installerContext.widgetConfig.pkgName));
-        getInstallerStruct().pkgmgrInterface->sendSignal(
-                PKGMGR_START_KEY,
-                PKGMGR_START_INSTALL);
+            } else {
+                name = localizedData->second.name;
+                break;
+            }
+        }
+        if (!!name) {
+            LogDebug("Name : " << name);
+            std::ostringstream appid;
+            appid << m_installerContext.widgetConfig.tzPkgid << "." << name;
+            LogDebug("tizen appid was generated by WRT : " << appid.str());
+            m_installerContext.widgetConfig.tzAppid =
+                DPL::FromUTF8String(appid.str());
+        } else {
+            m_installerContext.widgetConfig.tzAppid =
+                m_installerContext.widgetConfig.tzPkgid;
+        }
     }
 
-    LogInfo("Tizen Id : " << m_installerContext.widgetConfig.pkgName);
+    // send start signal of pkgmgr
+    getInstallerStruct().pkgmgrInterface->setPkgname(DPL::ToUTF8String(
+                m_installerContext.widgetConfig.tzAppid));
+    getInstallerStruct().pkgmgrInterface->sendSignal(
+            PKGMGR_START_KEY,
+            PKGMGR_START_INSTALL);
+
+    LogInfo("Tizen App Id : " << m_installerContext.widgetConfig.tzAppid);
+    LogInfo("Tizen Pkg Id : " << m_installerContext.widgetConfig.tzPkgid);
     LogInfo("W3C Widget GUID : " << m_installerContext.widgetConfig.guid);
 }
 
@@ -367,7 +414,7 @@ void JobWidgetInstall::configureWidgetLocation(const std::string & widgetPath,
                                                const std::string& tempPath)
 {
     m_installerContext.locations =
-        WidgetLocation(DPL::ToUTF8String(m_installerContext.widgetConfig.pkgName),
+        WidgetLocation(DPL::ToUTF8String(m_installerContext.widgetConfig.tzAppid),
                 widgetPath, tempPath,
                 m_installerContext.widgetConfig.packagingType,
                 m_installerContext.locationType);
@@ -382,7 +429,7 @@ JobWidgetInstall::ConfigureResult JobWidgetInstall::ConfigureInstallation(
 {
     WidgetUpdateInfo update = detectWidgetUpdate(configData,
             m_installerContext.widgetConfig.webAppType,
-            m_installerContext.widgetConfig.pkgName);
+            m_installerContext.widgetConfig.tzAppid);
     ConfigureResult result = checkWidgetUpdate(update);
 
     // Validate tizenId
@@ -392,9 +439,9 @@ JobWidgetInstall::ConfigureResult JobWidgetInstall::ConfigureInstallation(
     }
 
     if ((regexec(&reg,
-                    DPL::ToUTF8String(m_installerContext.widgetConfig.pkgName).c_str(),
+                    DPL::ToUTF8String(m_installerContext.widgetConfig.tzAppid).c_str(),
                     static_cast<size_t>(0), NULL, 0) != REG_NOERROR) ||
-            (checkTizenIdExist(DPL::ToUTF8String(m_installerContext.widgetConfig.pkgName)) &&
+            (checkTizenPkgIdExist(DPL::ToUTF8String(m_installerContext.widgetConfig.tzPkgid)) &&
              result != ConfigureResult::Updated))
     {
         //it is true when tizenId does not fit REG_TIZENID_PATTERN
@@ -432,17 +479,17 @@ JobWidgetInstall::ConfigureResult JobWidgetInstall::checkWidgetUpdate(
         LogInfo("Widget info does not exist");
         updateTypeCheckBit = WidgetUpdateMode::NotInstalled;
     } else {
-        LogInfo("Widget info exists. PkgName: " <<
-                update.existingWidgetInfo.pkgname);
+        LogInfo("Widget info exists. appid: " <<
+                update.existingWidgetInfo.tzAppid);
 
-        WidgetPkgName pkgname = update.existingWidgetInfo.pkgname;
+        TizenAppId tzAppid = update.existingWidgetInfo.tzAppid;
 
-        LogInfo("Widget model exists. package name: " << pkgname);
+        LogInfo("Widget model exists. tizen app id: " << tzAppid);
 
         // Check running state
         int retval = APP_MANAGER_ERROR_NONE;
         bool isRunning = false;
-        retval = app_manager_is_running(DPL::ToUTF8String(pkgname).c_str(), &isRunning);
+        retval = app_manager_is_running(DPL::ToUTF8String(tzAppid).c_str(), &isRunning);
         if (APP_MANAGER_ERROR_NONE != retval) {
             LogError("Fail to get running state");
             return ConfigureResult::Failed;
@@ -463,7 +510,7 @@ JobWidgetInstall::ConfigureResult JobWidgetInstall::checkWidgetUpdate(
             }
         }
 
-        m_installerContext.widgetConfig.pkgName = pkgname;
+        m_installerContext.widgetConfig.tzAppid = tzAppid;
         OptionalWidgetVersion existingVersion;
         existingVersion = update.existingWidgetInfo.existingVersion;
         OptionalWidgetVersion incomingVersion = update.incomingVersion;
@@ -618,7 +665,7 @@ ConfigParserData JobWidgetInstall::getWidgetDataFromXML(
 WidgetUpdateInfo JobWidgetInstall::detectWidgetUpdate(
         const ConfigParserData &configInfo,
         const WrtDB::WidgetType appType,
-        const WrtDB::WidgetPkgName &tizenId)
+        const WrtDB::TizenAppId &tizenId)
 {
     LogInfo("Checking up widget package for config.xml...");
 
@@ -652,7 +699,7 @@ WidgetUpdateInfo JobWidgetInstall::detectWidgetUpdate(
                     widgetGUID,
                     widgetVersion,
                     WidgetUpdateInfo::ExistingWidgetInfo(
-                        dao.getPkgName(), dao.getVersion()));
+                        dao.getTzAppId(), dao.getVersion()));
         }
         Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
         {
@@ -671,7 +718,7 @@ WidgetUpdateInfo JobWidgetInstall::detectWidgetUpdate(
                     widgetGUID,
                     widgetVersion,
                     WidgetUpdateInfo::ExistingWidgetInfo(
-                        dao.getPkgName(), dao.getVersion()));
+                        dao.getTzAppId(), dao.getVersion()));
         }
         Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
         {
@@ -726,7 +773,7 @@ void JobWidgetInstall::SendFinishedSuccess()
     //inform widget info
     JobWidgetInstall::displayWidgetInfo();
 
-    WidgetPkgName& tizenId = m_installerContext.widgetConfig.pkgName;
+    TizenAppId& tizenId = m_installerContext.widgetConfig.tzAppid;
 
     // send signal of pkgmgr
     getInstallerStruct().pkgmgrInterface->sendSignal(
@@ -746,7 +793,7 @@ void JobWidgetInstall::SendFinishedFailure()
 
     LogError("Error in installation step: " << m_exceptionCaught);
     LogError("Message: " << m_exceptionMessage);
-    WidgetPkgName & tizenId = m_installerContext.widgetConfig.pkgName;
+    TizenAppId & tizenId = m_installerContext.widgetConfig.tzAppid;
 
     LogDebug("Call widget install failure finishedCallback");
 
@@ -767,22 +814,22 @@ void JobWidgetInstall::SaveExceptionData(const Jobs::JobExceptionBase &e)
 
 void JobWidgetInstall::displayWidgetInfo()
 {
-    WidgetDAOReadOnly dao(m_installerContext.locations->getPkgname());
+    WidgetDAOReadOnly dao(m_installerContext.widgetConfig.tzAppid);
 
     std::ostringstream out;
     WidgetLocalizedInfo localizedInfo =
-        W3CFileLocalization::getLocalizedInfo(dao.getPkgName());
+        W3CFileLocalization::getLocalizedInfo(dao.getTzAppId());
 
     out << std::endl <<
         "===================================== INSTALLED WIDGET INFO ========="\
         "============================";
     out << std::endl << "Name:                        " << localizedInfo.name;
-    out << std::endl << "PkgName:                     " << dao.getPkgName();
+    out << std::endl << "AppId:                     " << dao.getTzAppId();
     WidgetSize size = dao.getPreferredSize();
     out << std::endl << "Width:                       " << size.width;
     out << std::endl << "Height:                      " << size.height;
     out << std::endl << "Start File:                  " <<
-        W3CFileLocalization::getStartFile(dao.getPkgName());
+        W3CFileLocalization::getStartFile(dao.getTzAppId());
     out << std::endl << "Version:                     " << dao.getVersion();
     out << std::endl << "Licence:                     " <<
         localizedInfo.license;
@@ -797,7 +844,7 @@ void JobWidgetInstall::displayWidgetInfo()
         dao.isDistributorSigned();
     out << std::endl << "Widget trusted:              " << dao.isTrusted();
 
-    OptionalWidgetIcon icon = W3CFileLocalization::getIcon(dao.getPkgName());
+    OptionalWidgetIcon icon = W3CFileLocalization::getIcon(dao.getTzAppId());
     DPL::OptionalString iconSrc = !!icon ? icon->src : DPL::OptionalString::Null;
     out << std::endl << "Icon:                        " << iconSrc;
 
index 6066c26..ec23ef9 100644 (file)
@@ -68,7 +68,7 @@ class JobWidgetInstall :
     static WidgetUpdateInfo detectWidgetUpdate(
             const WrtDB::ConfigParserData &configInfo,
             const WrtDB::WidgetType appType,
-            const WrtDB::WidgetPkgName &tizenId);
+            const WrtDB::TizenAppId &tizenId);
     WidgetUpdateMode::Type CalcWidgetUpdatePolicy(
             const OptionalWidgetVersion &existingVersion,
             const OptionalWidgetVersion &incomingVersion) const;
index 7436f4b..77e35d1 100644 (file)
@@ -52,7 +52,7 @@ TaskAceCheck::TaskAceCheck(InstallerContext& context) :
 void TaskAceCheck::StepPrepareForAce()
 {
     m_context.featureLogic =
-        FeatureLogicPtr(new FeatureLogic(m_context.locations->getPkgname()));
+        FeatureLogicPtr(new FeatureLogic(m_context.widgetConfig.tzAppid));
     m_context.job->UpdateProgress(
         InstallerContext::INSTALL_ACE_PREPARE,
         "Widget Access Control Check Prepared");
@@ -60,7 +60,7 @@ void TaskAceCheck::StepPrepareForAce()
 
 void TaskAceCheck::StepAceCheck()
 {
-    WrtDB::WidgetDAO dao(m_context.locations->getPkgname());
+    WrtDB::WidgetDAO dao(m_context.widgetConfig.tzAppid);
     LogInfo("StepAceCheck!");
     // This widget does not use any device cap
     if (m_context.featureLogic->isDone()) {
@@ -93,7 +93,7 @@ void TaskAceCheck::StepAceCheck()
 
 void TaskAceCheck::StepProcessAceResponse()
 {
-    WrtDB::WidgetDAO dao(m_context.locations->getPkgname());
+    WrtDB::WidgetDAO dao(m_context.widgetConfig.tzAppid);
     if (m_context.widgetConfig.packagingType ==
             WrtDB::PKG_TYPE_HOSTED_WEB_APP) {
         return;
@@ -184,7 +184,7 @@ void TaskAceCheck::StepCheckAceResponse()
     for(;it != end; ++it){
         LogInfo("  |-  Feature: " << it->name << " has reject status: " << it->rejected);
         if (it->rejected) {
-            WrtDB::WidgetDAO dao(m_context.locations->getPkgname());
+            WrtDB::WidgetDAO dao(m_context.widgetConfig.tzAppid);
             dao.updateFeatureRejectStatus(*it);
         }
     }
index 92fc86f..42fb092 100755 (executable)
@@ -61,7 +61,7 @@ void TaskCertificates::StepSetCertiInfo()
 
     if ((pkgmgr_installer_save_certinfo(
                     const_cast<char*>(DPL::ToUTF8String(
-                            m_context.widgetConfig.pkgName).c_str()),
+                            m_context.widgetConfig.tzAppid).c_str()),
                     m_pkgHandle)) < 0) {
         LogError("pkgmgrInstallerSaveCertinfo fail");
         ThrowMsg(Exceptions::SetCertificateInfoFailed,
@@ -159,7 +159,7 @@ void TaskCertificates::StepAbortCertiInfo()
 {
     if ((pkgmgr_installer_delete_certinfo(
                     const_cast<char*>(DPL::ToUTF8String(
-                            m_context.widgetConfig.pkgName).c_str()))) < 0) {
+                            m_context.widgetConfig.tzAppid).c_str()))) < 0) {
         LogError("pkgmgr_installer_delete_certinfo fail");
     }
 }
index 78c06ef..8ba08cf 100644 (file)
@@ -74,7 +74,7 @@ void TaskDatabase::StepWrtDBInsert()
             Try
             {
                 m_handleToRemove = WidgetDAOReadOnly::getHandle(
-                    m_context.locations->getPkgname());
+                    m_context.widgetConfig.tzAppid);
             }
             Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
             {
@@ -82,21 +82,21 @@ void TaskDatabase::StepWrtDBInsert()
                 ThrowMsg(Exceptions::InvalidPackage, "Given tizenId not found for update installation");
             }
             WidgetDAO::registerOrUpdateWidget(
-                    m_context.locations->getPkgname(),
+                    m_context.widgetConfig.tzAppid,
                     m_context.widgetConfig,
                     m_context.wacSecurity);
             m_handle = WidgetDAOReadOnly::getHandle(
-                m_context.locations->getPkgname());
+                m_context.widgetConfig.tzAppid);
         }
         else //new installation
         {
             LogInfo("Registering widget...");
             WidgetDAO::registerWidget(
-                    m_context.locations->getPkgname(),
+                    m_context.widgetConfig.tzAppid,
                     m_context.widgetConfig,
                     m_context.wacSecurity);
             m_handle = WidgetDAOReadOnly::getHandle(
-                m_context.locations->getPkgname());
+                m_context.widgetConfig.tzAppid);
         }
 
         FOREACH (cap, m_context.staticPermittedDevCaps) {
@@ -150,7 +150,7 @@ void TaskDatabase::StepRegisterExternalFiles()
     {
         Try
         {
-            WidgetDAO dao(m_context.locations->getPkgname());
+            WidgetDAO dao(m_context.widgetConfig.tzAppid);
             WrtDB::ExternalLocationList externalLocationsDB = dao.getWidgetExternalLocations();
             FOREACH(file, externalLocationsDB)
             {
@@ -211,22 +211,22 @@ void TaskDatabase::StepCreateVconf()
     std::map<std::string, WrtDB::SettingsType> vconfData;
     vconfData[
         WrtDB::VconfConfig::GetVconfKeyPopupUsage(
-            m_context.locations->getPkgname())] = WrtDB::SETTINGS_TYPE_ON;
+            m_context.widgetConfig.tzAppid)] = WrtDB::SETTINGS_TYPE_ON;
     vconfData[
         WrtDB::VconfConfig::GetVconfKeyGeolocationUsage(
-            m_context.locations->getPkgname())] = WrtDB::SETTINGS_TYPE_ON;
+            m_context.widgetConfig.tzAppid)] = WrtDB::SETTINGS_TYPE_ON;
     vconfData[
         WrtDB::VconfConfig::GetVconfKeyWebNotificationUsage(
-            m_context.locations->getPkgname())] = WrtDB::SETTINGS_TYPE_ON;
+            m_context.widgetConfig.tzAppid)] = WrtDB::SETTINGS_TYPE_ON;
     vconfData[
         WrtDB::VconfConfig::GetVconfKeyWebDatabaseUsage(
-            m_context.locations->getPkgname())] = WrtDB::SETTINGS_TYPE_ON;
+            m_context.widgetConfig.tzAppid)] = WrtDB::SETTINGS_TYPE_ON;
     vconfData[
         WrtDB::VconfConfig::GetVconfKeyFilesystemUsage(
-            m_context.locations->getPkgname())] = WrtDB::SETTINGS_TYPE_ON;
+            m_context.widgetConfig.tzAppid)] = WrtDB::SETTINGS_TYPE_ON;
     vconfData[
         WrtDB::VconfConfig::GetVconfKeyMemorySavingMode(
-            m_context.locations->getPkgname())] = WrtDB::SETTINGS_TYPE_OFF;
+            m_context.widgetConfig.tzAppid)] = WrtDB::SETTINGS_TYPE_OFF;
 
     // vconftool -g 5000 set -t int <path> initialize value
     // Current installer should use vconftool for setting group ID
@@ -249,7 +249,7 @@ void TaskDatabase::StepAbortDBInsert()
     LogWarning("[DB Update Task] Aborting... (DB Clean)");
     Try
     {
-        WidgetDAO::unregisterWidget(m_context.locations->getPkgname());
+        WidgetDAO::unregisterWidget(m_context.widgetConfig.tzAppid);
         LogDebug("Cleaning DB successful!");
     }
     Catch(DPL::DB::SqlConnection::Exception::Base)
index 71752e5..b6fe720 100644 (file)
@@ -79,7 +79,7 @@ void TaskEncryptResource::StepEncryptResource()
     LogDebug("Step Encrypt resource");
     m_resEnc = new ResourceEncryptor;
     m_resEnc->CreateEncryptionKey(DPL::ToUTF8String(m_context.
-                widgetConfig.pkgName));
+                widgetConfig.tzAppid));
 
     EncryptDirectory(m_context.locations->getTemporaryRootDir());
 }
index 8306799..1748798 100644 (file)
@@ -274,10 +274,10 @@ void TaskFileManipulation::StepPrepareExternalDir()
 {
     LogDebug("Step prepare to install in exernal directory");
     Try {
-        std::string pkgname =
-            DPL::ToUTF8String(*m_context.widgetConfig.pkgname);
+        std::string appid =
+            DPL::ToUTF8String(m_context.widgetConfig.tzAppid);
 
-        WidgetInstallToExtSingleton::Instance().initialize(pkgname);
+        WidgetInstallToExtSingleton::Instance().initialize(appid);
 
         size_t totalSize =
             Utils::getFolderSize(m_context.locations->getTemporaryPackageDir());
index b34b13c..660c39a 100755 (executable)
@@ -312,9 +312,9 @@ DPL::String TaskManifestFile::getIconTargetFilename(
         const DPL::String& languageTag) const
 {
     DPL::OStringStream filename;
-    WidgetPkgName pkgname = m_context.widgetConfig.pkgName;
+    TizenAppId appid = m_context.widgetConfig.tzAppid;
 
-    filename << DPL::ToUTF8String(pkgname).c_str();
+    filename << DPL::ToUTF8String(appid).c_str();
 
     if (!languageTag.empty()) {
         DPL::OptionalString tag = getLangTag(languageTag); // translate en -> en_US etc
@@ -357,26 +357,26 @@ void TaskManifestFile::saveLocalizedKey(std::ofstream &file,
 void TaskManifestFile::updateAilInfo()
 {
     // Update ail for desktop
-    std::string cfgPkgname =
-        DPL::ToUTF8String(m_context.widgetConfig.pkgName);
-    const char* pkgname = cfgPkgname.c_str();
+    std::string cfgAppid =
+        DPL::ToUTF8String(m_context.widgetConfig.tzAppid);
+    const char* appid = cfgAppid.c_str();
 
-    LogDebug("Update ail desktop : " << pkgname );
+    LogDebug("Update ail desktop : " << appid);
     ail_appinfo_h ai = NULL;
     ail_error_e ret;
 
-    ret = ail_package_get_appinfo(pkgname, &ai);
+    ret = ail_package_get_appinfo(appid, &ai);
     if (ai) {
         ail_package_destroy_appinfo(ai);
     }
 
     if (AIL_ERROR_NO_DATA == ret) {
-        if (ail_desktop_add(pkgname) < 0) {
-            LogWarning("Failed to add ail desktop : " << pkgname);
+        if (ail_desktop_add(appid) < 0) {
+            LogWarning("Failed to add ail desktop : " << appid);
         }
     } else if (AIL_ERROR_OK == ret) {
-        if (ail_desktop_update(pkgname) < 0) {
-            LogWarning("Failed to update ail desktop : " << pkgname);
+        if (ail_desktop_update(appid) < 0) {
+            LogWarning("Failed to update ail desktop : " << appid);
         }
     }
 }
@@ -393,12 +393,12 @@ void TaskManifestFile::backupIconFiles()
 
     std::list<std::string> fileList;
     getFileList(GlobalConfig::GetUserWidgetDesktopIconPath(), fileList);
-    std::string pkgname = DPL::ToUTF8String(m_context.widgetConfig.pkgName);
+    std::string appid = DPL::ToUTF8String(m_context.widgetConfig.tzAppid);
 
     FOREACH(it, fileList)
     {
-        if (0 == (strncmp((*it).c_str(), pkgname.c_str(),
-                        strlen(pkgname.c_str())))) {
+        if (0 == (strncmp((*it).c_str(), appid.c_str(),
+                        strlen(appid.c_str())))) {
             std::ostringstream icon_file, backup_icon;
             icon_file << GlobalConfig::GetUserWidgetDesktopIconPath();
             icon_file << "/" << (*it);
@@ -462,8 +462,8 @@ void TaskManifestFile::getFileList(const char* path,
 
 void TaskManifestFile::stepGenerateManifest()
 {
-    WidgetPkgName pkgname = m_context.widgetConfig.pkgName;
-    manifest_name = pkgname + L".xml";
+    TizenPkgId pkgid = m_context.widgetConfig.tzPkgid;
+    manifest_name = pkgid + L".xml";
     manifest_file += L"/tmp/" + manifest_name;
 
     //libxml - init and check
@@ -592,16 +592,16 @@ void TaskManifestFile::setWidgetName(Manifest & manifest, UiApplication & uiApp)
         generateWidgetName(manifest, uiApp, DPL::OptionalString::Null, name, defaultNameSaved);
     }
     //appid
-    WidgetPkgName pkgname = m_context.widgetConfig.pkgName;
-    uiApp.setAppid(pkgname);
+    TizenAppId appid = m_context.widgetConfig.tzAppid;
+    uiApp.setAppid(appid);
 
 
     //extraid
     if(!!m_context.widgetConfig.guid) {
         uiApp.setExtraid(*m_context.widgetConfig.guid);
     } else {
-        if(!pkgname.empty()) {
-            uiApp.setExtraid(DPL::String(L"http://") + pkgname);
+        if(!appid.empty()) {
+            uiApp.setExtraid(DPL::String(L"http://") + appid);
         }
     }
 
@@ -704,7 +704,7 @@ void TaskManifestFile::generateWidgetIcon(UiApplication & uiApp, const DPL::Opti
 
 void TaskManifestFile::setWidgetManifest(Manifest & manifest)
 {
-    manifest.setPackage(m_context.widgetConfig.pkgName);
+    manifest.setPackage(m_context.widgetConfig.tzPkgid);
 
     if(!!m_context.widgetConfig.version)
     {
@@ -837,22 +837,22 @@ void TaskManifestFile::setLiveBoxInfo(Manifest& manifest)
         LogInfo("setLiveBoxInfo");
         LiveBoxInfo liveBox;
         DPL::Optional<WrtDB::ConfigParserData::LiveboxInfo> ConfigInfo = *it;
-        DPL::String pkgname = m_context.widgetConfig.pkgName;
+        DPL::String pkgid = m_context.widgetConfig.tzPkgid;
         size_t found;
 
         if(ConfigInfo->m_liveboxId != L"") {
             found = ConfigInfo->m_liveboxId.find_first_of(L".");
             if(found != std::string::npos) {
-                if(0 == ConfigInfo->m_liveboxId.compare(0, found, pkgname))
+                if(0 == ConfigInfo->m_liveboxId.compare(0, found, pkgid))
                     liveBox.setLiveboxId(ConfigInfo->m_liveboxId);
                 else {
                     DPL::String liveboxId =
-                        pkgname+DPL::String(L".")+ConfigInfo->m_liveboxId;
+                        pkgid+DPL::String(L".")+ConfigInfo->m_liveboxId;
                     liveBox.setLiveboxId(liveboxId);
                 }
             } else {
                 DPL::String liveboxId =
-                    pkgname+DPL::String(L".")+ConfigInfo->m_liveboxId;
+                    pkgid+DPL::String(L".")+ConfigInfo->m_liveboxId;
                 liveBox.setLiveboxId(liveboxId);
             }
         }
@@ -861,7 +861,7 @@ void TaskManifestFile::setLiveBoxInfo(Manifest& manifest)
             liveBox.setPrimary(ConfigInfo->m_primary);
 
         if(ConfigInfo->m_autoLaunch == L"true")
-            liveBox.setAutoLaunch(pkgname);
+            liveBox.setAutoLaunch(pkgid);
 
         if(ConfigInfo->m_updatePeriod != L"")
             liveBox.setUpdatePeriod(ConfigInfo->m_updatePeriod);
index b468d3b..1afe3ee 100644 (file)
@@ -53,9 +53,9 @@ void TaskSmack::Step()
             devcaps << utf8;
         }
     }
-    WidgetPkgName pkgName = m_context.widgetConfig.pkgName;
+    TizenAppId tzAppid = m_context.widgetConfig.tzAppid;
     int result = handle_access_control_conf_forWAC(
-                     DPL::ToUTF8String(pkgName).c_str(),
+                     DPL::ToUTF8String(tzAppid).c_str(),
                      devcaps.str().c_str(),
                      OPERATION_INSTALL);
     Assert(result==PC_OPERATION_SUCCESS && "access control setup failed");
index 54a8f31..f47357c 100644 (file)
@@ -771,9 +771,16 @@ bool TaskWidgetConfig::fillWidgetConfig(WrtDB::WidgetRegisterInfo& pWidgetConfig
             }
         }
     }
-    if (!!configInfo.tizenId) {
-       if (pWidgetConfigInfo.pkgName != *configInfo.tizenId) {
-           LogError("Invalid archive - Tizen ID not same error");
+    if (!!configInfo.tizenAppId) {
+       if(DPL::ToUTF8String(pWidgetConfigInfo.tzAppid).compare(
+                   DPL::ToUTF8String(*configInfo.tizenAppId)) < 0) {
+           LogError("Invalid archive - Tizen App ID not same error");
+           return false;
+       }
+    }
+    if (!!configInfo.tizenPkgId) {
+       if (pWidgetConfigInfo.tzPkgid != *configInfo.tizenPkgId) {
+           LogError("Invalid archive - Tizen Pkg ID not same error");
            return false;
        }
     }
index 3e93084..ac42252 100644 (file)
@@ -28,18 +28,18 @@ WidgetUpdateInfo::ExistingWidgetInfo::ExistingWidgetInfo() :
 }
 
 WidgetUpdateInfo::ExistingWidgetInfo::ExistingWidgetInfo(
-    const WrtDB::WidgetPkgName & name,
+    const WrtDB::TizenAppId & appid,
     const DPL::Optional<WidgetVersion> &version) :
-    pkgname(name),
+    tzAppid(appid),
     isExist(true),
     existingVersion(version)
 {
 }
 
 WidgetUpdateInfo::ExistingWidgetInfo::ExistingWidgetInfo(
-    const WrtDB::WidgetPkgName & name,
+    const WrtDB::TizenAppId & appid,
     const DPL::Optional<DPL::String> &version) :
-    pkgname(name),
+    tzAppid(appid),
     isExist(true)
 {
     if (!!version) {
index 9f10cb3..858fa25 100644 (file)
@@ -34,14 +34,14 @@ struct WidgetUpdateInfo
 {
     struct ExistingWidgetInfo
     {
-        WrtDB::WidgetPkgName pkgname;
+        WrtDB::TizenAppId tzAppid;
         bool isExist;
         DPL::Optional<WidgetVersion> existingVersion;
 
         ExistingWidgetInfo();
-        ExistingWidgetInfo(const WrtDB::WidgetPkgName & name,
+        ExistingWidgetInfo(const WrtDB::TizenAppId & tzAppid,
                            const DPL::Optional<WidgetVersion> &version);
-        ExistingWidgetInfo(const WrtDB::WidgetPkgName & name,
+        ExistingWidgetInfo(const WrtDB::TizenAppId & tzAppid,
                            const DPL::Optional<DPL::String> &version);
     };
 
index 3cb8d82..b080652 100644 (file)
@@ -57,7 +57,7 @@ class UninstallerTaskFail :
 
 namespace Jobs {
 namespace WidgetUninstall {
-JobWidgetUninstall::JobWidgetUninstall(const std::string & widgetPkgName,
+JobWidgetUninstall::JobWidgetUninstall(const std::string & tizenAppId,
         const WidgetUninstallationStruct &uninstallerStruct) :
     Job(Uninstallation),
     JobContextBase<WidgetUninstallationStruct>(uninstallerStruct)
@@ -67,15 +67,16 @@ JobWidgetUninstall::JobWidgetUninstall(const std::string & widgetPkgName,
     m_context.removeFinished = false;
     m_context.uninstallStep = UninstallerContext::UNINSTALL_START;
     m_context.job = this;
-    m_context.pkgname = widgetPkgName;
+    m_context.tzAppid = tizenAppId;
     m_context.isExternalWidget = getExternalWidgetFlag();
 
     Try
     {
-        WrtDB::WidgetDAOReadOnly dao(DPL::FromUTF8String(widgetPkgName));
-        m_context.locations = WidgetLocation(m_context.pkgname);
+        WrtDB::WidgetDAOReadOnly dao(DPL::FromUTF8String(tizenAppId));
+        m_context.locations = WidgetLocation(m_context.tzAppid);
+        m_context.tzPkgid = DPL::ToUTF8String(dao.getTizenPkgId());
 
-        LogInfo("Widget model exists. Pkg name: " << m_context.pkgname);
+        LogInfo("Widget model exists. Pkg name: " << m_context.tzAppid);
 
         AddTask(new TaskSmack(m_context));
         AddTask(new TaskCheck(m_context));
@@ -89,7 +90,7 @@ JobWidgetUninstall::JobWidgetUninstall(const std::string & widgetPkgName,
         AddTask(new TaskDeleteCertificates(m_context));
 
         // send start signal of pkgmgr
-        if (getInstallerStruct().pkgmgrInterface->setPkgname(m_context.pkgname)) {
+        if (getInstallerStruct().pkgmgrInterface->setPkgname(m_context.tzAppid)) {
             getInstallerStruct().pkgmgrInterface->sendSignal(
                     PKGMGR_START_KEY,
                     PKGMGR_START_UNINSTALL);
@@ -103,7 +104,7 @@ JobWidgetUninstall::JobWidgetUninstall(const std::string & widgetPkgName,
 
 std::string JobWidgetUninstall::getRemovedTizenId() const
 {
-    return m_context.pkgname;
+    return m_context.tzAppid;
 }
 
 bool JobWidgetUninstall::getRemoveStartedFlag() const
@@ -177,7 +178,7 @@ bool JobWidgetUninstall::getExternalWidgetFlag() const
 {
 
     LogDebug("Get external widget");
-    if (APP2EXT_SD_CARD == app2ext_get_app_location(m_context.pkgname.c_str())) {
+    if (APP2EXT_SD_CARD == app2ext_get_app_location(m_context.tzAppid.c_str())) {
         LogDebug("This widget is in external stroage");
         return true;
     }
index 80c188c..4b912b8 100644 (file)
@@ -47,9 +47,9 @@ class JobWidgetUninstall :
     /**
      * @brief Uninstaller must to know which widget to uninstall.
      *
-     * @param[in] WrtDB::WidgetPkgName widgetPkgName - widget to uninstall
+     * @param[in] WrtDB::TizenAppId tzAppId - widget to uninstall
      */
-    JobWidgetUninstall(const std::string &widgetPkgName,
+    JobWidgetUninstall(const std::string &tizenAppId,
             const WidgetUninstallationStruct& uninstallerStruct);
 
     std::string getRemovedTizenId() const;
index 8670ac5..d2ae728 100644 (file)
@@ -43,13 +43,13 @@ TaskCheck::~TaskCheck()
 
 void TaskCheck::StepUninstallPreCheck()
 {
-    LogInfo("Uninstall check for pkgname: " << m_context.locations->getPkgname());
+    LogInfo("Uninstall check for appid: " << m_context.tzAppid);
     //check if deferred
     //TODO if widget to be updated, then remove it from Deferred list?
 
     int ret = APP_MANAGER_ERROR_NONE;
     bool isRunning = false;
-    ret = app_manager_is_running(m_context.pkgname.c_str(), &isRunning);
+    ret = app_manager_is_running(m_context.tzAppid.c_str(), &isRunning);
     if (APP_MANAGER_ERROR_NONE != ret) {
         LogError("Fail to get running state");
         ThrowMsg(Exceptions::PlatformAPIFailure,
@@ -64,7 +64,7 @@ void TaskCheck::StepUninstallPreCheck()
         //TODO or defer uninstall?
     }
 
-    LogInfo("Widget Can be uninstalled. Pkgname : " << m_context.locations->getPkgname());
+    LogInfo("Widget Can be uninstalled. Pkgname : " << m_context.tzAppid);
     m_context.job->UpdateProgress(UninstallerContext::UNINSTALL_PRECHECK,
                                   "Uninstall pre-checking Finished");
 }
index d3f2c93..c9eebd6 100644 (file)
@@ -50,8 +50,8 @@ void TaskDbUpdate::StepDbUpdate()
     {
         //TODO: widget handle should not be used any more
         ace_unregister_widget(static_cast<ace_widget_handle_t>(
-            WidgetDAOReadOnly::getHandle(m_context.locations->getPkgname())));
-        WidgetDAO::unregisterWidget(m_context.locations->getPkgname());
+            WidgetDAOReadOnly::getHandle(DPL::FromUTF8String(m_context.tzAppid))));
+        WidgetDAO::unregisterWidget(DPL::FromUTF8String(m_context.tzAppid));
 
         LogDebug("Unregistered widget successfully!");
     }
index d656c39..77e2058 100755 (executable)
@@ -47,7 +47,7 @@ void TaskDeleteCertificates::StepDeleteCertificates()
 
     if ((pkgmgr_installer_delete_certinfo(
                     const_cast<char*>((
-                            m_context.pkgname).c_str()))) < 0) {
+                            m_context.tzAppid).c_str()))) < 0) {
         LogError("pkgmgr_installer_delete_certinfo fail");
     }
 }
index 5c020a9..5f2b5e5 100644 (file)
@@ -40,12 +40,12 @@ TaskRemoveCustomHandlers::TaskRemoveCustomHandlers(UninstallerContext& context)
 void TaskRemoveCustomHandlers::Step()
 {
     LogDebug("Removing widget from appsvc");
-    int result = appsvc_unset_defapp(m_context.pkgname.c_str());
+    int result = appsvc_unset_defapp(m_context.tzAppid.c_str());
     LogDebug("Result: " << result);
 
     CustomHandlerDB::Interface::attachDatabaseRW();
     CustomHandlerDB::CustomHandlerDAO handlersDao(
-            DPL::FromASCIIString(m_context.pkgname));
+            DPL::FromASCIIString(m_context.tzAppid));
     handlersDao.removeWidgetProtocolHandlers();
     handlersDao.removeWidgetContentHandlers();
     CustomHandlerDB::Interface::detachDatabase();
index d7c3157..2e120fe 100644 (file)
@@ -97,14 +97,14 @@ void TaskRemoveFiles::StepRemoveDesktop()
     std::ostringstream desktopFile;
 
     desktopFile << GlobalConfig::GetUserWidgetDesktopPath() << "/";
-    desktopFile << m_context.pkgname << ".desktop";
+    desktopFile << m_context.tzAppid << ".desktop";
 
     unlink(desktopFile.str().c_str());
 
     ail_appinfo_h ai = NULL;
     ail_error_e ret;
 
-    const char* package = m_context.pkgname.c_str();
+    const char* package = m_context.tzAppid.c_str();
     LogDebug("ail delete : " << package);
 
     ret = ail_package_get_appinfo(package, &ai);
@@ -126,7 +126,7 @@ void TaskRemoveFiles::StepRemoveDesktop()
 void TaskRemoveFiles::StepRemoveManifest()
 {
     std::ostringstream manifest_name;
-    manifest_name << m_context.pkgname << ".xml";
+    manifest_name << m_context.tzPkgid<< ".xml";
     std::ostringstream destFile;
     destFile << "/opt/share/packages" << "/"; //TODO constant with path
     destFile << manifest_name.str();
@@ -148,7 +148,7 @@ void TaskRemoveFiles::StepRemoveManifest()
 
 void TaskRemoveFiles::StepRemoveExternalLocations()
 {
-    WidgetDAO dao(m_context.locations->getPkgname());
+    WidgetDAO dao(DPL::FromUTF8String(m_context.tzAppid));
     LogDebug("Removing external locations:");
     WrtDB::ExternalLocationList externalPaths = dao.getWidgetExternalLocations();
     FOREACH(path, externalPaths)
@@ -179,8 +179,7 @@ void TaskRemoveFiles::StepRemoveExternalLocations()
 void TaskRemoveFiles::StepRemoveVconf()
 {
     std::string key =
-        WrtDB::VconfConfig::GetVconfKeyRootPath(
-            m_context.locations->getPkgname());
+        WrtDB::VconfConfig::GetVconfKeyRootPath(DPL::FromUTF8String(m_context.tzAppid));
     if(vconf_unset_recursive(key.c_str())) {
         LogError("Fail to unset vconf file");
     } else {
@@ -191,7 +190,7 @@ void TaskRemoveFiles::StepRemoveVconf()
 void TaskRemoveFiles::StepRemoveExternalWidget()
 {
     Try {
-        WidgetInstallToExtSingleton::Instance().initialize(m_context.pkgname);
+        WidgetInstallToExtSingleton::Instance().initialize(m_context.tzPkgid);
         WidgetInstallToExtSingleton::Instance().uninstallation();
         WidgetInstallToExtSingleton::Instance().deinitialize();
     }
index 23d2df6..265b364 100644 (file)
@@ -42,11 +42,11 @@ void TaskSmack::Step()
     LogInfo("------------------------> SMACK: Jobs::WidgetUninstall::TaskSmack::Step()");
 #ifdef WRT_SMACK_ENABLED
     try {
-      WrtDB::WidgetDAOReadOnly dao(m_context.locations->getPkgname());
-      WidgetPkgName pkgName = dao.getPkgName();
+      WrtDB::WidgetDAOReadOnly dao(m_context.widgetConfig.tzAppid);
+      TizenAppId tzAppid = dao.getTizenAppId();
       const char *devCap = "";
       int result = handle_access_control_conf_forWAC(
-                       DPL::ToUTF8String(pkgName).c_str(),
+                       DPL::ToUTF8String(tzAppid).c_str(),
                        NULL,
                        OPERATION_UNINSTALL);
       Assert(result==PC_OPERATION_SUCCESS && "access control setup failed");
index 187d958..bdb3c8f 100644 (file)
@@ -53,7 +53,7 @@ void TaskUninstallOspsvc::StepUninstallOspsvc()
     LogInfo("Step : Uninstall Osp service ");
 
     std::ostringstream commStr;
-    commStr << OSP_INSTALL_STR << BashUtils::escape_arg(m_context.pkgname);
+    commStr << OSP_INSTALL_STR << BashUtils::escape_arg(m_context.tzPkgid);
     LogDebug("osp uninstall command : " << commStr.str());
 
     char readBuf[MAX_BUF_SIZE];
@@ -75,7 +75,7 @@ void TaskUninstallOspsvc::StepUninstallOspsvc()
 
     pclose(fd);
     
-    LogInfo("Widget Can be uninstalled. Pkgname : " << m_context.pkgname);
+    LogInfo("Widget Can be uninstalled. Pkgname : " << m_context.tzPkgid);
     m_context.job->UpdateProgress(UninstallerContext::UNINSTALL_REMOVE_OSPSVC,
                                   "Uninstall OSP service finished");
 }
index caedcb7..67f15eb 100644 (file)
@@ -59,7 +59,8 @@ struct UninstallerContext
 
     UninstallStep uninstallStep;       ///< current step of installation
     Jobs::WidgetUninstall::JobWidgetUninstall *job;
-    std::string pkgname;
+    std::string tzAppid;
+    std::string tzPkgid;
     bool isExternalWidget;
 };
 
index ee71e76..726f807 100644 (file)
 namespace Jobs {
 namespace WidgetInstall {
 
-FeatureLogic::FeatureLogic(const WrtDB::WidgetPkgName & pkgname)
+FeatureLogic::FeatureLogic(const WrtDB::TizenAppId & tzAppid)
   : m_rejected(false)
 {
-    WrtDB::WidgetDAOReadOnly widgetDao(pkgname);
+    WrtDB::WidgetDAOReadOnly widgetDao(tzAppid);
     WidgetFeatureSet featureSet = widgetDao.getFeaturesList();
     FOREACH(it, featureSet) {
         LogInfo("Feature name : " << it->name);
index 1c3ed23..9faf46e 100644 (file)
@@ -33,7 +33,7 @@ namespace WidgetInstall {
 class FeatureLogic : DPL::Noncopyable {
   public:
 
-    FeatureLogic(const WrtDB::WidgetPkgName & pkgname);
+    FeatureLogic(const WrtDB::TizenAppId & tzAppid);
 
     bool isDone() const;
 
index 35a8026..e78f0e1 100644 (file)
@@ -57,7 +57,7 @@ WidgetLocation::WidgetLocation()
 }
 
 WidgetLocation::WidgetLocation(const std::string & widgetname) :
-                                        m_pkgname(widgetname)
+                                        m_pkgid(widgetname)
 {
 }
 
@@ -69,7 +69,7 @@ WidgetLocation::WidgetLocation(const std::string & widgetname,
                                std::string sourcePath,
                                WrtDB::PackagingType t,
                                InstallLocationType locationType):
-                                    m_pkgname(widgetname),
+                                    m_pkgid(widgetname),
                                     m_widgetSource(sourcePath),
                                     m_type(t),
                                     m_temp(new WidgetLocation::DirectoryDeletor())
@@ -86,7 +86,7 @@ WidgetLocation::WidgetLocation(const std::string & widgetname,
                                std::string dirPath,
                                WrtDB::PackagingType t,
                                InstallLocationType locationType):
-                                    m_pkgname(widgetname),
+                                    m_pkgid(widgetname),
                                     m_widgetSource(sourcePath),
                                     m_type(t),
                                     m_temp(new
@@ -107,24 +107,24 @@ std::string WidgetLocation::getInstallationDir() const
 
 std::string WidgetLocation::getPackageInstallationDir() const
 {
-    return m_installedPath + "/" + m_pkgname;
+    return m_installedPath + "/" + m_pkgid;
 }
 
 std::string WidgetLocation::getSourceDir() const
 {
     return m_installedPath + "/"
-            + m_pkgname + WrtDB::GlobalConfig::GetWidgetSrcPath();
+            + m_pkgid + WrtDB::GlobalConfig::GetWidgetSrcPath();
 }
 
 std::string WidgetLocation::getBinaryDir() const
 {
     return m_installedPath + "/"
-            + m_pkgname + WrtDB::GlobalConfig::GetUserWidgetExecPath();
+            + m_pkgid + WrtDB::GlobalConfig::GetUserWidgetExecPath();
 }
 
 std::string WidgetLocation::getExecFile() const
 {
-    return getBinaryDir() + "/" + m_pkgname;
+    return getBinaryDir() + "/" + m_pkgid;
 }
 
 std::string WidgetLocation::getBackupDir() const
@@ -144,13 +144,13 @@ std::string WidgetLocation::getBackupBinaryDir() const
 
 std::string WidgetLocation::getBackupExecFile() const
 {
-    return getBackupBinaryDir() + "/" + m_pkgname;
+    return getBackupBinaryDir() + "/" + m_pkgid;
 }
 
 std::string WidgetLocation::getUserDataRootDir() const
 {
     return std::string(WrtDB::GlobalConfig::GetWidgetUserDataPath()) +
-        "/" + m_pkgname;
+        "/" + m_pkgid;
 }
 
 std::string WidgetLocation::getPrivateStorageDir() const
@@ -162,7 +162,7 @@ std::string WidgetLocation::getPrivateStorageDir() const
 std::string WidgetLocation::getShareDir() const
 {
     return std::string(WrtDB::GlobalConfig::GetUserInstalledWidgetPath()) + "/"
-            + m_pkgname + "/" + WrtDB::GlobalConfig::GetWidgetSharePath();
+            + m_pkgid + "/" + WrtDB::GlobalConfig::GetWidgetSharePath();
 }
 
 std::string WidgetLocation::getTemporaryPackageDir() const
@@ -206,9 +206,9 @@ std::string WidgetLocation::getConfigurationDir() const
     }
 }
 
-DPL::String WidgetLocation::getPkgname() const
+DPL::String WidgetLocation::getPkgId() const
 {
-    return DPL::FromUTF8String(m_pkgname);
+    return DPL::FromUTF8String(m_pkgid);
 }
 
 std::string WidgetLocation::getInstalledIconPath() const
index e04c3dd..3a9c152 100644 (file)
@@ -168,10 +168,10 @@ public:
      */
     std::string getWidgetSource() const;
     /**
-     * @brief pkgname Returns pkgname
-     * @return pkgname
+     * @brief pkgid Returns pkgid
+     * @return pkgid
      */
-    DPL::String getPkgname() const;
+    DPL::String getPkgId() const;
 
     //external files
     /**
@@ -190,7 +190,7 @@ public:
 
 private:
     std::string m_widgetSource;                   // Source widget zip file/widget url
-    std::string m_pkgname;                        //name of package
+    std::string m_pkgid;                        //id of package
     std::string m_iconPath;                       //installed icon path
     WrtDB::PackagingType m_type;
     std::shared_ptr<DirectoryDeletor> m_temp;      //directory
index f2ebcf5..f843e8c 100644 (file)
@@ -91,10 +91,10 @@ static int pkg_plugin_get_installed_apps_list(const char * /*category*/,
 
 
     WrtDB::WrtDatabase::attachToThreadRO();
-    WidgetPkgNameList pkgnameslList = WidgetDAOReadOnly::getPkgnameList();
+    TizenAppIdList tizenAppidList = WidgetDAOReadOnly::getTizenAppidList();
     *count = 0;
 
-    FOREACH(iterator, pkgnameslList) {
+    FOREACH(iterator, tizenAppidList) {
         package_manager_pkg_info_t *pkg_info =
             static_cast<package_manager_pkg_info_t*>
             (malloc(sizeof(package_manager_pkg_info_t)));
@@ -106,11 +106,11 @@ static int pkg_plugin_get_installed_apps_list(const char * /*category*/,
             pkg_last->next = pkg_info;
         }
 
-        WidgetPkgName pkgname = *iterator;
-        WidgetDAOReadOnly widget(pkgname);
+        TizenAppId tzAppid = *iterator;
+        WidgetDAOReadOnly widget(tzAppid);
         strncpy(pkg_info->pkg_type, "wgt", PKG_TYPE_STRING_LEN_MAX);
         snprintf(pkg_info->pkg_name, PKG_NAME_STRING_LEN_MAX, "%s",
-                DPL::ToUTF8String(pkgname).c_str());
+                DPL::ToUTF8String(tzAppid).c_str());
 
         DPL::Optional<DPL::String> version = widget.getVersion();
         if (!version.IsNull()) {
index 8deea1d..92bf7f2 100644 (file)
@@ -465,11 +465,11 @@ void WrtInstaller::uninstallPkgNameStep()
 void WrtInstaller::uninstallGuidStep()
 {
     LogDebug("Uninstalling widget ...");
-    std::string pkgname;
-    WrtErrStatus status = wrt_get_widget_by_guid(pkgname, m_name);
+    std::string appid;
+    WrtErrStatus status = wrt_get_widget_by_guid(appid, m_name);
     if (status == WRT_SUCCESS) {
         LogDebug("Guid : " << m_name);
-        wrt_uninstall_widget(pkgname.c_str(), this, &staticWrtStatusCallback,
+        wrt_uninstall_widget(appid.c_str(), this, &staticWrtStatusCallback,
                 !m_quiet ? &staticWrtUninstallProgressCallback : NULL,
                 pkgmgrSignalInterface);
     } else {
@@ -513,11 +513,11 @@ void WrtInstaller::unistallWgtFileStep()
 
         std::string guid = DPL::ToUTF8String(*widgetGUID);
 
-        std::string pkgname;
-        WrtErrStatus status = wrt_get_widget_by_guid(pkgname, guid);
+        std::string appid;
+        WrtErrStatus status = wrt_get_widget_by_guid(appid, guid);
         if (status == WRT_SUCCESS) {
-            LogDebug("Pkgname from packagePath : " << pkgname);
-            wrt_uninstall_widget(pkgname.c_str(), this, &staticWrtStatusCallback,
+            LogDebug("Appid from packagePath : " << appid);
+            wrt_uninstall_widget(appid.c_str(), this, &staticWrtStatusCallback,
                     !m_quiet ? &staticWrtUninstallProgressCallback : NULL,
                     pkgmgrSignalInterface);
         } else {
index e481f2f..1230599 100755 (executable)
@@ -348,7 +348,7 @@ extern "C"
         UNHANDLED_EXCEPTION_HANDLER_END
     }
 
-    EXPORT_API void wrt_uninstall_widget(const char * const pkg_name,
+    EXPORT_API void wrt_uninstall_widget(const char * const tzAppid,
                                          void* userdata,
                                          WrtInstallerStatusCallback status_cb,
                                          WrtProgressCallback progress_cb,
@@ -356,13 +356,13 @@ extern "C"
     {
         UNHANDLED_EXCEPTION_HANDLER_BEGIN
         {
-            std::string widgetPkgName(pkg_name);
-            LogInfo("[WRT-API] UNINSTALL WIDGET: " << widgetPkgName);
+            std::string tizenAppid(tzAppid);
+            LogInfo("[WRT-API] UNINSTALL WIDGET: " << tizenAppid);
             // Post uninstallation event
             CONTROLLER_POST_EVENT(
                     Logic::InstallerController,
                     InstallerControllerEvents::UninstallWidgetEvent(
-                            widgetPkgName,
+                            tizenAppid,
                             WidgetUninstallationStruct(
                                     InstallerCallbacksTranslate::uninstallFinishedCallback,
                                     InstallerCallbacksTranslate::installProgressCallback,
@@ -589,7 +589,7 @@ extern "C"
         }
     }
 
-    EXPORT_API WrtErrStatus wrt_get_widget_by_guid(std::string & pkgname,
+    EXPORT_API WrtErrStatus wrt_get_widget_by_guid(std::string & tzAppid,
                                                    const std::string guid)
     {
         try
@@ -599,7 +599,7 @@ extern "C"
 
             WidgetGUID widget_guid = DPL::FromUTF8String(guid);
             WrtDB::WidgetDAOReadOnly dao(widget_guid);
-            pkgname = DPL::ToUTF8String(dao.getPkgName());
+            tzAppid = DPL::ToUTF8String(dao.getTzAppId());
             return WRT_SUCCESS;
         }
         catch (WidgetDAOReadOnly::Exception::WidgetNotExist)
index 6f2bea6..7ef5893 100755 (executable)
@@ -248,15 +248,15 @@ void wrt_install_widget(const char *path,
         );
 
 /**
- * @fn void wrt_installer_uninstall_widget (const char * const pkg_name,
+ * @fn void wrt_installer_uninstall_widget (const char * const tizenAppid,
  *                                void* userdata,
  *                                WrtInstallerStatusCallback cb)
  * @brief Uninstalls widget using its name
  *
- * This method is used to uninstall the widget specified by its pkgname.
+ * This method is used to uninstall the widget specified by its appid.
  * The callback function is called when the uninstall operation is done.
  *
- * @param [in]  pkg_name    - package name
+ * @param [in]  tzAppid     - tizen appid
  * @param [in]  userdata    - user parameters to be passed to the callback
  * @param [in]  status_cb   - Call to this one will be done at the end of
  *                            operation
@@ -275,7 +275,7 @@ void wrt_install_widget(const char *path,
  *
  * @see wrt_installer_install_widget
  */
-void wrt_uninstall_widget (const char * const pkg_name,
+void wrt_uninstall_widget (const char * const tzAppid,
         void* userdata,
         WrtInstallerStatusCallback status_cb,
         WrtProgressCallback progress_cb,
@@ -342,12 +342,12 @@ int wrt_installer_init_for_tests(void *userdata,
 void wrt_installer_shutdown_for_tests();
 
 /**
- * @brief wrt_get_widget_by_guid Returns pkgname by pkg guid (widgetId)
- * @param pkgname pkgname argument ot be set
+ * @brief wrt_get_widget_by_guid Returns tizenAppid by pkg guid (widgetId)
+ * @param tzAppid tizen appid argument ot be set
  * @param guid guid that we look for
  * @return error code
  */
-WrtErrStatus wrt_get_widget_by_guid(std::string &pkgname, const std::string guid);
+WrtErrStatus wrt_get_widget_by_guid(std::string &tzAppid, const std::string guid);
 #ifdef __cplusplus
 }
 #endif