From 30f09f632ad20e9b29fec8e484cb861fdc93cfd3 Mon Sep 17 00:00:00 2001 From: Jihoon Chung Date: Thu, 21 Mar 2013 11:48:15 +0900 Subject: [PATCH] [Release] wrt-installer_0.1.16 --- configuration/config.tizen.xsd | 28 ++- configuration/config.xsd | 1 + debian/changelog | 8 + packaging/wrt-installer.spec | 4 +- src/configuration_parser/widget_parser.cpp | 277 +++++++++++++++++++++ src/configuration_parser/widget_parser.h | 1 + src/jobs/widget_install/job_widget_install.cpp | 2 +- src/jobs/widget_install/manifest.cpp | 37 +++ src/jobs/widget_install/manifest.h | 38 +++ src/jobs/widget_install/task_certify.cpp | 2 +- src/jobs/widget_install/task_database.cpp | 5 + src/jobs/widget_install/task_manifest_file.cpp | 46 ++++ src/jobs/widget_install/task_manifest_file.h | 1 + src/jobs/widget_uninstall/job_widget_uninstall.cpp | 2 +- 14 files changed, 446 insertions(+), 6 deletions(-) mode change 100644 => 100755 src/jobs/widget_install/task_database.cpp diff --git a/configuration/config.tizen.xsd b/configuration/config.tizen.xsd index 765f2b6..f82cab5 100755 --- a/configuration/config.tizen.xsd +++ b/configuration/config.tizen.xsd @@ -2,6 +2,7 @@ + @@ -202,4 +203,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/configuration/config.xsd b/configuration/config.xsd index ba1c5ab..ff06e1e 100755 --- a/configuration/config.xsd +++ b/configuration/config.xsd @@ -77,6 +77,7 @@ + diff --git a/debian/changelog b/debian/changelog index 05ea16a..f2a5ade 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Thu, 21 Mar 2013 11:32:51 +0900 + wrt-installer (0.1.15) unstable; urgency=low * add getting detail information from widget file. diff --git a/packaging/wrt-installer.spec b/packaging/wrt-installer.spec index 28e55e2..31d757d 100644 --- a/packaging/wrt-installer.spec +++ b/packaging/wrt-installer.spec @@ -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 diff --git a/src/configuration_parser/widget_parser.cpp b/src/configuration_parser/widget_parser.cpp index 71dc7a8..df343dc 100644 --- a/src/configuration_parser/widget_parser.cpp +++ b/src/configuration_parser/widget_parser.cpp @@ -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 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 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 && diff --git a/src/configuration_parser/widget_parser.h b/src/configuration_parser/widget_parser.h index af9f7db..c171c9d 100644 --- a/src/configuration_parser/widget_parser.h +++ b/src/configuration_parser/widget_parser.h @@ -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); diff --git a/src/jobs/widget_install/job_widget_install.cpp b/src/jobs/widget_install/job_widget_install.cpp index cd810fb..2607ab6 100644 --- a/src/jobs/widget_install/job_widget_install.cpp +++ b/src/jobs/widget_install/job_widget_install.cpp @@ -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); diff --git a/src/jobs/widget_install/manifest.cpp b/src/jobs/widget_install/manifest.cpp index f143d46..1b1dbd7 100644 --- a/src/jobs/widget_install/manifest.cpp +++ b/src/jobs/widget_install/manifest.cpp @@ -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 diff --git a/src/jobs/widget_install/manifest.h b/src/jobs/widget_install/manifest.h index 342c387..28fed98 100644 --- a/src/jobs/widget_install/manifest.h +++ b/src/jobs/widget_install/manifest.h @@ -145,6 +145,38 @@ class AppControl typedef AppControl AppControlType; /** + * @brief account element + */ +typedef std::list> IconListType; +typedef std::list DisplayNameListType; +typedef std::list 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; }; } //namespace Jobs } //namespace WidgetInstall diff --git a/src/jobs/widget_install/task_certify.cpp b/src/jobs/widget_install/task_certify.cpp index aaa7655..09fac6c 100644 --- a/src/jobs/widget_install/task_certify.cpp +++ b/src/jobs/widget_install/task_certify.cpp @@ -221,7 +221,7 @@ void TaskCertify::stepSignature() { LogInfo("================ Step: <> ENTER ==============="); - std::string widgetPath = m_contextData.locations->getTemporaryRootDir() + + std::string widgetPath = m_contextData.locations->getTemporaryPackageDir() + "/"; SignatureFileInfoSet signatureFiles; diff --git a/src/jobs/widget_install/task_database.cpp b/src/jobs/widget_install/task_database.cpp old mode 100644 new mode 100755 index 341edf4..775ddf8 --- a/src/jobs/widget_install/task_database.cpp +++ b/src/jobs/widget_install/task_database.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -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); } diff --git a/src/jobs/widget_install/task_manifest_file.cpp b/src/jobs/widget_install/task_manifest_file.cpp index 6821d26..ce8b844 100644 --- a/src/jobs/widget_install/task_manifest_file.cpp +++ b/src/jobs/widget_install/task_manifest_file.cpp @@ -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 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 diff --git a/src/jobs/widget_install/task_manifest_file.h b/src/jobs/widget_install/task_manifest_file.h index de18c42..98548cb 100644 --- a/src/jobs/widget_install/task_manifest_file.h +++ b/src/jobs/widget_install/task_manifest_file.h @@ -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, diff --git a/src/jobs/widget_uninstall/job_widget_uninstall.cpp b/src/jobs/widget_uninstall/job_widget_uninstall.cpp index b28b9e9..13c336b 100644 --- a/src/jobs/widget_uninstall/job_widget_uninstall.cpp +++ b/src/jobs/widget_uninstall/job_widget_uninstall.cpp @@ -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, -- 2.7.4