[Release] wrt-installer_0.1.16 submit/tizen_2.1/20130321.024837
authorJihoon Chung <jihoon.chung@samsung.com>
Thu, 21 Mar 2013 02:48:15 +0000 (11:48 +0900)
committerJihoon Chung <jihoon.chung@samsung.com>
Thu, 21 Mar 2013 02:48:15 +0000 (11:48 +0900)
14 files changed:
configuration/config.tizen.xsd
configuration/config.xsd
debian/changelog
packaging/wrt-installer.spec
src/configuration_parser/widget_parser.cpp
src/configuration_parser/widget_parser.h
src/jobs/widget_install/job_widget_install.cpp
src/jobs/widget_install/manifest.cpp
src/jobs/widget_install/manifest.h
src/jobs/widget_install/task_certify.cpp
src/jobs/widget_install/task_database.cpp [changed mode: 0644->0755]
src/jobs/widget_install/task_manifest_file.cpp
src/jobs/widget_install/task_manifest_file.h
src/jobs/widget_uninstall/job_widget_uninstall.cpp

index 765f2b6..f82cab5 100755 (executable)
@@ -2,6 +2,7 @@
 <!-- Widget Configuration Document Extensions XSD For TIZEN -->
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"   xmlns:tizen="http://tizen.org/ns/widgets" targetNamespace="http://tizen.org/ns/widgets" xmlns:widgets="http://www.w3.org/ns/widgets">
     <xs:import namespace="http://www.w3.org/ns/widgets" schemaLocation="config.xsd"/>
+    <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
 <xs:simpleType name="appserviceOperationType">
     <!--               
     <xs:restriction base="xs:token">           
         <xs:all>
             <xs:element ref="tizen:box-label"/>
             <xs:element ref="tizen:box-icon"/>
-            <xs:element ref="tizen:box-content"/>
+            <!--xs:element ref="tizen:box-content"/-->
         </xs:all>     
         <xs:attribute name="id" type="tizen:appWidgetIdType" use="required"/>
         <xs:attribute name="primary" type="widgets:data.boolean" use="required"/>
     </xs:restriction>
 </xs:simpleType>
 
+<xs:element name="account">
+    <xs:complexType mixed="true">
+        <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+                <xs:element ref="tizen:icon" />
+                <xs:element ref="tizen:display-name" />
+                <xs:element name="capability" type="xs:string"/>
+            </xs:choice>
+        </xs:sequence>
+    <xs:attribute name="multiple-account-support" use="required" type="widgets:data.boolean"/>
+    </xs:complexType>
+</xs:element>
+
+<xs:element name="icon">
+  <xs:complexType>
+    <xs:attribute name="section" use="required" type="xs:string"/>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="display-name">
+  <xs:complexType mixed="true">
+    <xs:attribute ref="xml:lang"/>
+  </xs:complexType>
+</xs:element>
+
 </xs:schema>
index ba1c5ab..ff06e1e 100755 (executable)
@@ -77,6 +77,7 @@
                 <xs:element ref="tizen:content"  minOccurs="1" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
                 <xs:element ref="tizen:app-widget"  minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
                 <xs:element ref="tizen:privilege"  minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
+                <xs:element ref="tizen:account"  minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
                 </xs:choice>\r
             <xs:attribute ref="xml:lang"/>\r
             <xs:attribute name="id" type="xs:anyURI"/>\r
index 05ea16a..f2a5ade 100644 (file)
@@ -1,3 +1,11 @@
+wrt-installer (0.1.16) unstable; urgency=low
+
+  * Fixed send signal pkgmgr to pkgid from appid
+  * Add Account parser and generate manifest
+  * Fixed signature path during installation hybridapp
+
+ -- Jihoon Chung <jihoon.chung@samsung.com>  Thu, 21 Mar 2013 11:32:51 +0900
+
 wrt-installer (0.1.15) unstable; urgency=low
 
   * add getting detail information from widget file.
index 28e55e2..31d757d 100644 (file)
@@ -1,7 +1,7 @@
-#git:framework/web/wrt-installer wrt-installer 0.1.15
+#git:framework/web/wrt-installer wrt-installer 0.1.16
 Name:       wrt-installer
 Summary:    Installer for tizen Webruntime
-Version:    0.1.15
+Version:    0.1.16
 Release:    1
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index 71dc7a8..df343dc 100644 (file)
@@ -2220,6 +2220,277 @@ class CspReportOnlyParser : public ElementParser
     DPL::OptionalString m_policy;
 };
 
+class AccountParser : public ElementParser
+{
+  public:
+    struct AccountProviderParser : public ElementParser
+    {
+      public:
+
+          struct IconParser : public ElementParser
+        {
+            public:
+                virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                        const DPL::String& /*name*/)
+                {
+                    return &IgnoringParser::Create;
+                }
+
+                virtual void Accept(const Text& text)
+                {
+                    if (text.value == L"") {
+                        return;
+                    }
+                    m_value = text.value;
+                }
+
+                virtual void Accept(const Element& /*element*/)
+                {}
+
+                virtual void Accept(const XmlAttribute& attribute)
+                {
+                    if (attribute.name == L"section") {
+                        if (attribute.value == L"account") {
+                            m_type = ConfigParserData::IconSectionType::DefaultIcon;
+                        } else if (attribute.value == L"account-small") {
+                            m_type = ConfigParserData::IconSectionType::SmallIcon;
+                        }
+                    }
+                }
+
+                virtual void Verify()
+                {
+                    if (m_value.IsNull() || *m_value == L"") {
+                        return;
+                    }
+
+                    std::pair<ConfigParserData::IconSectionType, DPL::String> icon;
+                    icon.first = m_type;
+                    icon.second = *m_value;
+
+                    m_data.m_iconSet.insert(icon);
+                }
+
+                IconParser(ConfigParserData::AccountProvider& data) :
+                    ElementParser(),
+                    m_properNamespace(false),
+                    m_data(data),
+                    m_type(ConfigParserData::DefaultIcon)
+            {}
+
+            private:
+                bool m_properNamespace;
+                ConfigParserData::IconSectionType m_type;
+                DPL::OptionalString m_value;
+                ConfigParserData::AccountProvider& m_data;
+        };
+
+          struct DisplayNameParser : public ElementParser
+        {
+            public:
+                virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                        const DPL::String& /*name*/)
+                {
+                    return &IgnoringParser::Create;
+                }
+
+                virtual void Accept(const Text& text)
+                {
+                    if (text.value == L"") {
+                        return;
+                    }
+                    m_value = text.value;
+                }
+
+                virtual void Accept(const Element& element)
+                {
+                    m_lang = element.lang;
+                    m_value= L"";
+                }
+
+                virtual void Accept(const XmlAttribute& /*attribute*/)
+                {}
+
+                virtual void Verify()
+                {
+                    if (m_value.IsNull() || *m_value == L"") {
+                        return;
+                    }
+
+                    std::pair<DPL::String, DPL::String> name;
+                    name.first = *m_lang;
+                    name.second = *m_value;
+
+                    m_data.m_displayNameSet.insert(name);
+                }
+
+                DisplayNameParser(ConfigParserData::AccountProvider& data) :
+                    ElementParser(),
+                    m_properNamespace(false),
+                    m_data(data)
+            {}
+
+            private:
+                bool m_properNamespace;
+                DPL::OptionalString m_lang;
+                DPL::OptionalString m_value;
+                ConfigParserData::AccountProvider& m_data;
+        };
+
+          struct CapabilityParser : public ElementParser
+        {
+            public:
+                virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                        const DPL::String& /*name*/)
+                {
+                    return &IgnoringParser::Create;
+                }
+
+                virtual void Accept(const Text& text)
+                {
+                    if (text.value == L"") {
+                        return;
+                    }
+                    m_value = text.value;
+                }
+
+                virtual void Accept(const Element& /*element*/)
+                {}
+
+                virtual void Accept(const XmlAttribute& /*attribute*/)
+                {}
+
+                virtual void Verify()
+                {
+                    if (m_value.IsNull() || *m_value == L"") {
+                        return;
+                    }
+                    m_data.m_capabilityList.push_back(*m_value);
+                }
+
+                CapabilityParser(ConfigParserData::AccountProvider& data) :
+                    ElementParser(),
+                    m_properNamespace(false),
+                    m_data(data)
+            {}
+
+            private:
+                bool m_properNamespace;
+                DPL::OptionalString m_value;
+                ConfigParserData::AccountProvider& m_data;
+        };
+          virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                  const DPL::String& name)
+          {
+              if (name == L"icon") {
+                  return DPL::MakeDelegate(this, &AccountProviderParser::OnIconElement);
+              } else if (name == L"display-name") {
+                  return DPL::MakeDelegate(this,
+                          &AccountProviderParser::OnDisplayNameElement);
+              } else if (name == L"capability") {
+                  return DPL::MakeDelegate(this, &AccountProviderParser::OnCapabilityElement);
+              } else {
+                  return &IgnoringParser::Create;
+              }
+          }
+
+          virtual void Accept(const Text& text)
+          {}
+
+          virtual void Accept(const Element& /*element*/)
+          {}
+
+          virtual void Accept(const XmlAttribute& attribute)
+          {
+              if (attribute.name == L"multiple-accounts-support") {
+                  if (attribute.value == L"") {
+                      return;
+                  }
+
+                  if (attribute.value == L"ture") {
+                      m_multiSupport = true;
+                  } 
+              }
+          }
+
+          virtual void Verify()
+          {
+              m_data.m_multiAccountSupport = m_multiSupport;
+          }
+
+          ElementParserPtr OnIconElement()
+          {
+              return ElementParserPtr(new IconParser(m_data));
+          }
+
+          ElementParserPtr OnDisplayNameElement()
+          {
+              return ElementParserPtr(new DisplayNameParser(m_data));
+          }
+
+          ElementParserPtr OnCapabilityElement()
+          {
+              return ElementParserPtr(new CapabilityParser(m_data));
+          }
+
+          AccountProviderParser(ConfigParserData::AccountProvider& data) :
+              ElementParser(),
+              m_properNamespace(false),
+              m_data(data),
+              m_multiSupport(false)
+        {}
+
+      private:
+          bool m_properNamespace;
+          bool m_multiSupport;
+          ConfigParserData::AccountProvider& m_data;
+    };
+
+    virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+            const DPL::String& name)
+    {
+        if (name == L"account-provider") {
+            return DPL::MakeDelegate(this, &AccountParser::OnProviderElement);
+        } else {
+            return &IgnoringParser::Create;
+        }
+    }
+
+    virtual void Accept(const Element& element)
+    {
+        if (element.ns == ConfigurationNamespace::TizenWebAppNamespaceName) {
+            m_properNamespace = true;
+        }
+    }
+
+    virtual void Accept(const XmlAttribute& /*attribute*/)
+    {}
+
+    virtual void Accept(const Text& /*text*/)
+    {}
+
+    virtual void Verify()
+    {}
+
+    ElementParserPtr OnProviderElement()
+    {
+        return ElementParserPtr(new AccountProviderParser(m_account));
+    }
+
+    AccountParser(ConfigParserData& data) :
+        ElementParser(),
+        m_data(data),
+        m_account(data.accountProvider),
+        m_properNamespace(false)
+    {}
+
+  private:
+    ConfigParserData& m_data;
+    ConfigParserData::AccountProvider& m_account;
+    bool m_properNamespace;
+    bool m_multiSupport;
+};
+
 ElementParser::ActionFunc WidgetParser::GetElementParser(
     const DPL::String& /*ns*/,
     const DPL::String&
@@ -2283,6 +2554,7 @@ WidgetParser::WidgetParser(ConfigParserData& data) :
             &WidgetParser::
                 OnCspReportOnlyElement);
 #endif
+    m_map[L"account"] = DPL::MakeDelegate(this, &WidgetParser::OnAccountElement);
 }
 
 ElementParserPtr WidgetParser::OnNameElement()
@@ -2390,6 +2662,11 @@ ElementParserPtr WidgetParser::OnCspReportOnlyElement()
     return ElementParserPtr(new CspReportOnlyParser(m_data));
 }
 
+ElementParserPtr WidgetParser::OnAccountElement()
+{
+    return ElementParserPtr(new AccountParser(m_data));
+}
+
 void WidgetParser::Accept(const Element& element)
 {
     if (element.ns != ConfigurationNamespace::W3CWidgetNamespaceName &&
index af9f7db..c171c9d 100644 (file)
@@ -85,6 +85,7 @@ class WidgetParser : public ElementParser
     ElementParserPtr OnAppWidgetElement();
     ElementParserPtr OnCspElement();
     ElementParserPtr OnCspReportOnlyElement();
+    ElementParserPtr OnAccountElement();
 
     virtual ActionFunc GetElementParser(const DPL::String& ns,
                                         const DPL::String& name);
index cd810fb..2607ab6 100644 (file)
@@ -426,7 +426,7 @@ void JobWidgetInstall::setTizenId(
     getInstallerStruct().pkgmgrInterface->setPkgname(DPL::ToUTF8String(
                                                          m_installerContext.
                                                              widgetConfig.
-                                                             tzAppid));
+                                                             tzPkgid));
     LogInfo("Tizen App Id : " << m_installerContext.widgetConfig.tzAppid);
     LogInfo("Tizen Pkg Id : " << m_installerContext.widgetConfig.tzPkgid);
     LogInfo("W3C Widget GUID : " << m_installerContext.widgetConfig.guid);
index f143d46..1b1dbd7 100644 (file)
@@ -193,6 +193,10 @@ void Manifest::serialize(xmlTextWriterPtr writer)
         FOREACH(l, this->livebox) {
             l->serialize(writer);
         }
+        FOREACH(acc, this->account)
+        {
+            acc->serialize(writer);
+        }
     }
     endElement(writer);
 }
@@ -422,5 +426,38 @@ void LiveBox::serialize(xmlTextWriterPtr writer)
 
     endElement(writer);
 }
+
+void Account::serialize(xmlTextWriterPtr writer)
+{
+    startElement(writer, "account");
+    {
+        startElement(writer, "account-provider");
+        writeAttribute(writer, "app-id", this->provider.appid);
+        writeAttribute(writer, "multiple-accounts-support",
+                this->provider.multiAccount);
+
+        FOREACH(i, this->provider.icon)
+        {
+            startElement(writer, "icon");
+            writeAttribute(writer, "section", i->first);
+            writeText(writer, i->second);
+            endElement(writer);
+        }
+        FOREACH(n, this->provider.name)
+        {
+            writeElementWithOneAttribute(writer, "label",
+                    n->getString(), "xml:lang",
+                    n->getLang(), n->hasLang());
+        }
+        FOREACH(c, this->provider.capability)
+        {
+            startElement(writer, "capability");
+            writeText(writer, *c);
+            endElement(writer);
+        }
+        endElement(writer);
+    }
+    endElement(writer);
+}
 } //namespace Jobs
 } //namespace WidgetInstall
index 342c387..28fed98 100644 (file)
@@ -145,6 +145,38 @@ class AppControl
 typedef AppControl AppControlType;
 
 /**
+ * @brief account element
+ */
+typedef std::list<std::pair<DPL::String, DPL::String>> IconListType;
+typedef std::list<LabelType> DisplayNameListType;
+typedef std::list<DPL::String> AccountCapabilityType;
+
+struct AccountProvider
+{
+    NcnameType appid;
+    NcnameType multiAccount;
+    IconListType icon;
+    DisplayNameListType name;
+    AccountCapabilityType capability;
+};
+
+typedef AccountProvider AccountProviderType;
+
+class Account
+{
+  public:
+    Account() {}
+    void addAccountProvider(const AccountProvider &x)
+    {
+        this->provider = x;
+    }
+    void serialize(xmlTextWriterPtr writer);
+
+  private:
+    AccountProviderType provider;
+};
+
+/**
  * @brief ime-application element
  */
 class ImeApplication
@@ -441,6 +473,11 @@ class Manifest
         this->livebox.push_back(x);
     }
 
+    void addAccount(const Account &x)
+    {
+        this->account.push_back(x);
+    }
+
     void setInstallLocation(const InstallLocationType &x)
     {
         this->installLocation = x;
@@ -474,6 +511,7 @@ class Manifest
     NcnameType package;
     PackageType type;
     NmtokenType version;
+    std::list<Account> account;
 };
 } //namespace Jobs
 } //namespace WidgetInstall
index aaa7655..09fac6c 100644 (file)
@@ -221,7 +221,7 @@ void TaskCertify::stepSignature()
 {
     LogInfo("================ Step: <<Signature>> ENTER ===============");
 
-    std::string widgetPath = m_contextData.locations->getTemporaryRootDir() +
+    std::string widgetPath = m_contextData.locations->getTemporaryPackageDir() +
         "/";
 
     SignatureFileInfoSet signatureFiles;
old mode 100644 (file)
new mode 100755 (executable)
index 341edf4..775ddf8
@@ -36,6 +36,7 @@
 #include <dpl/log/log.h>
 #include <dpl/assert.h>
 #include <wrt-commons/security-origin-dao/security_origin_dao.h>
+#include <dpl/wrt-dao-ro/widget_dao_types.h>
 #include <string>
 #include <sstream>
 #include <ace_api_install.h>
@@ -152,6 +153,8 @@ void TaskDatabase::StepSecurityOriginDBInsert()
     LogDebug("Create Security origin database");
     // automatically create security origin database
     using namespace SecurityOriginDB;
+    using namespace WrtDB;
+
     SecurityOriginDAO dao(m_context.locations->getPkgId());
 
     // Checking privilege list for setting security origin exception data
@@ -161,6 +164,8 @@ void TaskDatabase::StepSecurityOriginDBInsert()
         if (result != g_W3CPrivilegeTextMap.end()) {
             if (result->second == FEATURE_USER_MEDIA) {
                 dao.setPrivilegeSecurityOriginData(result->second, false);
+            } else if (result->second == FEATURE_FULLSCREEN_MODE) {
+                continue;
             } else {
                 dao.setPrivilegeSecurityOriginData(result->second);
             }
index 6821d26..ce8b844 100644 (file)
@@ -581,6 +581,7 @@ void TaskManifestFile::writeManifest(const DPL::String & path)
     setAppControlInfo(uiApp);
     setAppCategory(uiApp);
     setLiveBoxInfo(manifest);
+    setAccount(manifest);
 
     manifest.addUiApplication(uiApp);
     manifest.generate(path);
@@ -971,5 +972,50 @@ void TaskManifestFile::setLiveBoxInfo(Manifest& manifest)
         manifest.addLivebox(liveBox);
     }
 }
+
+void TaskManifestFile::setAccount(Manifest& manifest)
+{
+    WrtDB::ConfigParserData::AccountProvider account =
+        m_context.widgetConfig.configInfo.accountProvider;
+
+    AccountProviderType provider;
+
+    if (account.m_iconSet.empty()) {
+        LogInfo("Widget doesn't contain Account");
+        return;
+    }
+    if (account.m_multiAccountSupport) {
+        provider.multiAccount = L"ture";
+    } else {
+        provider.multiAccount = L"false";
+    }
+    provider.appid = m_context.widgetConfig.tzAppid;
+
+    FOREACH(it, account.m_iconSet) {
+        std::pair<DPL::String, DPL::String> icon;
+
+        if (it->first == ConfigParserData::IconSectionType::DefaultIcon) {
+            icon.first = L"account";
+        } else if (it->first == ConfigParserData::IconSectionType::SmallIcon) {
+            icon.first = L"account-small";
+        }
+        icon.second = it->second;
+
+        provider.icon.push_back(icon);
+    }
+
+    FOREACH(it, account.m_displayNameSet) {
+        provider.name.push_back(LabelType(it->second, it->first));
+    }
+
+    FOREACH(it, account.m_capabilityList) {
+        provider.capability.push_back(*it);
+    }
+
+    Account accountInfo;
+    accountInfo.addAccountProvider(provider);
+    manifest.addAccount(accountInfo);
+}
+
 } //namespace WidgetInstall
 } //namespace Jobs
index de18c42..98548cb 100644 (file)
@@ -99,6 +99,7 @@ class TaskManifestFile :
     void setAppControlInfo(UiApplication & uiApp);
     void setAppCategory(UiApplication & uiApp);
     void setLiveBoxInfo(Manifest& manifest);
+    void setAccount(Manifest& uiApp);
 
     void generateWidgetName(Manifest & manifest,
                             UiApplication &uiApp,
index b28b9e9..13c336b 100644 (file)
@@ -109,7 +109,7 @@ JobWidgetUninstall::JobWidgetUninstall(
         AddTask(new TaskDeleteCertificates(m_context));
 
         // send start signal of pkgmgr
-        if (getInstallerStruct().pkgmgrInterface->setPkgname(m_context.tzAppid))
+        if (getInstallerStruct().pkgmgrInterface->setPkgname(m_context.tzPkgid))
         {
             getInstallerStruct().pkgmgrInterface->sendSignal(
                 PKGMGR_START_KEY,