Revert "Register a new appid for dynamic box and its symbolic link to /usr/bin/WebPro...
authorSoo-Hyun Choi <sh9.choi@samsung.com>
Wed, 25 Sep 2013 14:45:02 +0000 (23:45 +0900)
committerSoo-Hyun Choi <sh9.choi@samsung.com>
Thu, 26 Sep 2013 02:30:24 +0000 (11:30 +0900)
This reverts commit 03dd9db6f0df82df0df091321467fceedd22199f.

Conflicts:
src/jobs/widget_install/task_manifest_file.cpp

[Remarks]
    * If setting root_path of app manifest is enabled, a web api plugin
      using dummy root_path doesn' work well.
    * Even if wrt-installer has not set 'root_path', the web api plugin
      have been using 'root_path',
      hoping prefix of the path is /opt/usr/apps
    * In the case of preload app that has /usr/apps base path, the web api
      doesn't work well.
    * Therefore, emove code regarding root_path of app manifest,
      because there are other way to find root path of web apps.

Change-Id: Ia365aec499a5973d874114481f6be1b9b94ede93

src/jobs/widget_install/manifest.cpp
src/jobs/widget_install/manifest.h
src/jobs/widget_install/task_manifest_file.cpp
src/jobs/widget_install/task_manifest_file.h

index 49658c2..80b37b0 100644 (file)
@@ -153,7 +153,6 @@ void Manifest::serialize(xmlTextWriterPtr writer)
         writeAttribute(writer, "xmlns", "http://tizen.org/ns/packages");
         writeAttribute(writer, "package", this->package);
         writeAttribute(writer, "type", this->type);
-        writeAttribute(writer, "root_path", this->rootPath);
         writeAttribute(writer, "version", this->version);
         if (!this->installLocation.IsNull()) {
             writeAttribute(writer, "install-location", (*this->installLocation));
index d926c7e..67ee3ce 100644 (file)
@@ -75,7 +75,7 @@ typedef StringWithLang LabelType, IconType, DescriptionType;
  * errors (related to usage of not allowed characters in given places).
  */
 typedef DPL::String NcnameType, NmtokenType, AnySimpleType, LangType;
-typedef DPL::String OperationType, MimeType, UriType, TypeType, PackageType, RootPathType;
+typedef DPL::String OperationType, MimeType, UriType, TypeType, PackageType;
 typedef DPL::OptionalString InstallLocationType, CategoriesType;
 typedef DPL::String AppCategoryType;
 typedef DPL::OptionalString KeyType, ValueType;
@@ -554,10 +554,6 @@ class Manifest
     {
         this->version = x;
     }
-    void setRootPath(const RootPathType &x)
-    {
-        this->rootPath = x;
-    }
     void setStoreClientId(const NcnameType &x)
     {
         this->storeClientId= x;
@@ -579,7 +575,6 @@ class Manifest
     NcnameType package;
     PackageType type;
     NmtokenType version;
-    RootPathType rootPath;
     std::list<Account> account;
     PrivilegeType privileges;
     NcnameType storeClientId;
index d89b7a2..6dc5fb3 100644 (file)
@@ -183,22 +183,6 @@ void TaskManifestFile::stepCreateExecFile()
             _E("Failed to make a symbolic name for a file [%s]", DPL::GetErrnoString(error).c_str());
     }
 #endif
-
-    // creation of box symlink
-    ConfigParserData::LiveboxList& liveboxList =
-        m_context.widgetConfig.configInfo.m_livebox;
-    if (!liveboxList.empty()) {
-        std::string boxExec = "/usr/bin/WebProcess";
-        std::string boxSymlink = m_context.locations->getExecFile();
-        boxSymlink += ".d-box";
-
-        if (symlink(boxExec.c_str(), boxSymlink.c_str()) != 0) {
-            if (errno) {
-                _E("Failed to make a symbolic name for a file [%s]", DPL::GetErrnoString(errno).c_str());
-            }
-        }
-    }
-
     m_context.job->UpdateProgress(
             InstallerContext::INSTALL_CREATE_EXECFILE,
             "Widget execfile creation Finished");
@@ -330,7 +314,7 @@ void TaskManifestFile::stepCopyLiveboxFiles()
             targetFile << (**boxIt).m_liveboxId << ".";
             targetFile << DPL::ToUTF8String((*sizeIt).m_size) << "." << DEFAULT_PREVIEW_NAME;
 
-            copyDynamicBoxFile(sourceFile.str(), targetFile.str());
+            DynamicBoxFileCopy(sourceFile.str(), targetFile.str());
 
             // clear stream objects
             sourceFile.str("");
@@ -346,7 +330,7 @@ void TaskManifestFile::stepCopyLiveboxFiles()
         targetFile << m_context.locations->getSharedDataDir() << "/";
         targetFile << (**boxIt).m_liveboxId << "." << DEFAULT_ICON_NAME;
 
-        copyDynamicBoxFile(sourceFile.str(), targetFile.str());
+        DynamicBoxFileCopy(sourceFile.str(), targetFile.str());
 
         // clear stream objects
         sourceFile.str("");
@@ -357,7 +341,7 @@ void TaskManifestFile::stepCopyLiveboxFiles()
         "Livebox files copy Finished");
 }
 
-void TaskManifestFile::copyDynamicBoxFile(const std::string& sourceFile,
+void TaskManifestFile::DynamicBoxFileCopy(const std::string& sourceFile,
                                           const std::string& targetFile)
 {
     Try
@@ -373,41 +357,6 @@ void TaskManifestFile::copyDynamicBoxFile(const std::string& sourceFile,
     }
 }
 
-bool TaskManifestFile::addBoxUiApplication(Manifest& manifest)
-{
-    UiApplication uiApp;
-    std::string postfix = ".d-box";
-    static bool isAdded = false;
-
-    Try
-    {
-        if (isAdded) {
-            _D("UiApplication for d-box is already added");
-            return false;
-        }
-        uiApp.setNodisplay(true);
-        uiApp.setTaskmanage(false);
-        uiApp.setMultiple(false);
-        setWidgetName(manifest, uiApp);
-        setWidgetIcons(uiApp);
-
-        // appid for box is like [webapp id].d-box
-        setWidgetIds(manifest, uiApp, postfix);
-        // executable path for box is like [app path]/bin/[webapp id].d-box
-        setWidgetExecPath(uiApp, postfix);
-        manifest.addUiApplication(uiApp);
-        isAdded = true;
-
-        return true;
-    }
-    Catch(DPL::Exception)
-    {
-        _E("Adding UiApplication on xml is failed.");
-        isAdded = false;
-        return false;
-    }
-}
-
 void TaskManifestFile::stepBackupIconFiles()
 {
     _D("Backup Icon Files");
@@ -925,8 +874,6 @@ void TaskManifestFile::generateWidgetDescription(Manifest & manifest,
 void TaskManifestFile::setWidgetManifest(Manifest & manifest)
 {
     manifest.setPackage(m_context.widgetConfig.tzPkgid);
-    manifest.setRootPath(DPL::FromUTF8String(
-                m_context.locations->getPackageInstallationDir()));
 
     if (!!m_context.widgetConfig.version) {
         manifest.setVersion(*m_context.widgetConfig.version);
@@ -1036,20 +983,7 @@ void TaskManifestFile::setMetadata(UiApplication &uiApp)
 
 void TaskManifestFile::setLiveBoxInfo(Manifest& manifest)
 {
-    ConfigParserData::LiveboxList& liveboxList =
-        m_context.widgetConfig.configInfo.m_livebox;
-
-    if (liveboxList.empty()) {
-        _D("no livebox");
-        return;
-    }
-
-    if (!addBoxUiApplication(manifest)) {
-        _D("error during adding UiApplication for d-box");
-        return;
-    }
-
-    FOREACH(it, liveboxList) {
+    FOREACH(it, m_context.widgetConfig.configInfo.m_livebox) {
         _D("setLiveBoxInfo");
         LiveBoxInfo liveBox;
         DPL::Optional<WrtDB::ConfigParserData::LiveboxInfo> ConfigInfo = *it;
index dee925d..98c3d23 100644 (file)
@@ -120,9 +120,8 @@ class TaskManifestFile :
                             const DPL::OptionalString& tag,
                             const DPL::String& language, const std::string &extension,
                             bool & defaultIconSaved);
-    void copyDynamicBoxFile(const std::string& sourceFile,
+    void DynamicBoxFileCopy(const std::string& sourceFile,
                             const std::string& targetFile);
-    bool addBoxUiApplication(Manifest& manifest);
 
     //for widget update
     void backupIconFiles();