Revert "Change pkgname to appid for docomo request. PART1"
authorTaejeong Lee <taejeong.lee@samsung.com>
Fri, 25 Jan 2013 13:20:43 +0000 (22:20 +0900)
committerTaejeong Lee <taejeong.lee@samsung.com>
Fri, 25 Jan 2013 13:20:48 +0000 (22:20 +0900)
This reverts commit b2ace93bd9ba27d509c82a455e590fe042f7baa6.

Change-Id: Ief357a5f1d70bcca60ea0cc83de843402e105fdc

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