From 310bdae96a26fc4439ca9252db57a7a448d04b0f Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Wed, 10 Jul 2013 08:49:09 +0200 Subject: [PATCH] WAC code removal [Issue#] LINUXWRT-629 [Bug] Not supported code [Cause] N/A [Solution] Removal of: - LinkParser, - code branches or WrtDB::APP_TYPE_WAC20 app type, - WACPluginsPrefix [Verification] Build repository [SCMRequest] This change requires: https://review.tizendev.org/80321 Change-Id: I9bced8f45f21fa063cbcf55e277d705b439d1595 --- src/configuration_parser/widget_parser.cpp | 83 -------------------------- src/configuration_parser/widget_parser.h | 6 -- src/jobs/widget_install/ace_registration.cpp | 8 +-- src/jobs/widget_install/job_widget_install.cpp | 14 ----- src/jobs/widget_install/task_certify.cpp | 15 +---- src/jobs/widget_install/task_widget_config.cpp | 5 -- 6 files changed, 3 insertions(+), 128 deletions(-) diff --git a/src/configuration_parser/widget_parser.cpp b/src/configuration_parser/widget_parser.cpp index 00c9fc3..c002eb1 100644 --- a/src/configuration_parser/widget_parser.cpp +++ b/src/configuration_parser/widget_parser.cpp @@ -821,83 +821,6 @@ class PreferenceParser : public ElementParser ConfigParserData& m_data; }; -class LinkParser : public ElementParser -{ - public: - virtual ActionFunc GetElementParser(const DPL::String& /*ns*/, - const DPL::String& /*name*/) - { - return &DenyAllParser::Create; - } - - virtual void Accept(const XmlAttribute& attribute) - { - if (m_properNamespace) { - LogDebug("attribute"); - if (attribute.name == L"rel") { - if (attribute.value != L"describedby") { - ThrowMsg(Exception::ParseError, - "rel attribute must have describedby value"); - } - } else if (attribute.name == L"type") {} else if (attribute.name == - L"href") - { - LogDebug("here is href"); - m_href = attribute.value; - } else { - ThrowMsg(Exception::ParseError, - "unknown attribute '" + - DPL::ToUTF8String(attribute.name) + - "' in link element"); - } - } - } - - virtual void Accept(const Element& element) - { - if (element.ns == - ConfigurationNamespace::WacWidgetNamespaceNameForLinkElement) - { - m_properNamespace = true; - } - LogDebug("element"); - } - - virtual void Accept(const Text&) - { - if (m_properNamespace) { - LogDebug("text"); - ThrowMsg(Exception::ParseError, "link element must be empty"); - } - } - - virtual void Verify() - { - if (!m_href) { - ThrowMsg(Exception::ParseError, - "link element must have href attribute"); - } - - LibIri::Wrapper iri(DPL::ToUTF8String(*m_href).c_str()); - if (!iri.Validate()) { // TODO: Better uri validator ? - ThrowMsg(Exception::ParseError, - "href attribute must be a valid iri/uri/url"); - } - } - - LinkParser(ConfigParserData& data) : - ElementParser(), - m_properNamespace(false), - m_data(data), - m_href(DPL::OptionalString::Null) - {} - - private: - bool m_properNamespace; - ConfigParserData& m_data; - DPL::OptionalString m_href; -}; - class SettingParser : public ElementParser { public: @@ -2687,7 +2610,6 @@ WidgetParser::WidgetParser(ConfigParserData& data) : DPL::MakeDelegate(this, &WidgetParser::OnContentElement); m_map[L"preference"] = DPL::MakeDelegate(this, &WidgetParser::OnPreferenceElement); - m_map[L"link"] = DPL::MakeDelegate(this, &WidgetParser::OnLinkElement); m_map[L"setting"] = DPL::MakeDelegate(this, &WidgetParser::OnSettingElement); m_map[L"application"] = DPL::MakeDelegate( @@ -2764,11 +2686,6 @@ ElementParserPtr WidgetParser::OnPreferenceElement() return ElementParserPtr(new PreferenceParser(m_data)); } -ElementParserPtr WidgetParser::OnLinkElement() -{ - return ElementParserPtr(new LinkParser(m_data)); -} - ElementParserPtr WidgetParser::OnSettingElement() { return ElementParserPtr(new SettingParser(m_data)); diff --git a/src/configuration_parser/widget_parser.h b/src/configuration_parser/widget_parser.h index b56e89a..f59b725 100644 --- a/src/configuration_parser/widget_parser.h +++ b/src/configuration_parser/widget_parser.h @@ -36,17 +36,12 @@ namespace ConfigurationNamespace { static const DPL::String W3CWidgetNamespaceName = L"http://www.w3.org/ns/widgets"; -static const DPL::String WacWidgetNamespaceNameForLinkElement = - L"http://wacapps.net/ns/widgets#"; -static const DPL::String WacWidgetNamespaceName = - L"http://wacapps.net/ns/widgets"; static const DPL::String TizenWebAppNamespaceName = L"http://tizen.org/ns/widgets"; } namespace PluginsPrefix { const char * const W3CPluginsPrefix = "http://www.w3.org/"; -const char * const WACPluginsPrefix = "http://wacapps.net/api/"; const char * const TIZENPluginsPrefix = "http://tizen.org/api/"; } @@ -72,7 +67,6 @@ class WidgetParser : public ElementParser ElementParserPtr OnContentElement(); ElementParserPtr OnPreferenceElement(); ElementParserPtr OnAccessElement(); - ElementParserPtr OnLinkElement(); ElementParserPtr OnSettingElement(); ElementParserPtr OnApplicationElement(); ElementParserPtr OnSplashElement(); diff --git a/src/jobs/widget_install/ace_registration.cpp b/src/jobs/widget_install/ace_registration.cpp index ac266d1..b028ba5 100644 --- a/src/jobs/widget_install/ace_registration.cpp +++ b/src/jobs/widget_install/ace_registration.cpp @@ -52,12 +52,8 @@ bool registerAceWidget(const WrtDB::DbWidgetHandle& widgetHandle, { LogDebug("Updating Ace database"); struct widget_info wi; - DPL::OptionalString os; switch (widgetConfig.webAppType.appType) { - case WrtDB::APP_TYPE_WAC20: - wi.type = WAC20; - break; case WrtDB::APP_TYPE_TIZENWEBAPP: wi.type = Tizen; break; @@ -149,9 +145,7 @@ bool registerAceWidgetFromDB(const WrtDB::DbWidgetHandle& widgetHandle) WidgetDAOReadOnly dao(widgetHandle); WidgetType type = dao.getWidgetType(); - if (type == WrtDB::APP_TYPE_WAC20) { - wi.type = WAC20; - } else if (type == WrtDB::APP_TYPE_TIZENWEBAPP) { + if (type == WrtDB::APP_TYPE_TIZENWEBAPP) { wi.type = Tizen; } else { LogError("Unknown application type"); diff --git a/src/jobs/widget_install/job_widget_install.cpp b/src/jobs/widget_install/job_widget_install.cpp index 70cca13..c77fcf3 100644 --- a/src/jobs/widget_install/job_widget_install.cpp +++ b/src/jobs/widget_install/job_widget_install.cpp @@ -926,20 +926,6 @@ void JobWidgetInstall::setApplicationType( "Config.xml has more than one valid namespace"); } widgetAppType = APP_TYPE_TIZENWEBAPP; - } else if ( - *iterator == - ConfigurationNamespace::WacWidgetNamespaceNameForLinkElement || - *iterator == - ConfigurationNamespace::WacWidgetNamespaceName) - { - if (widgetAppType != APP_TYPE_UNKNOWN && - widgetAppType != APP_TYPE_WAC20) - { - LogError("To many namespaces declared in configuration fileB."); - ThrowMsg(Exceptions::WidgetConfigFileInvalid, - "Config.xml has more than one valid namespace"); - } - widgetAppType = APP_TYPE_WAC20; } else { LogDebug("Namespace ignored."); } diff --git a/src/jobs/widget_install/task_certify.cpp b/src/jobs/widget_install/task_certify.cpp index 2b3d81d..e5d1533 100644 --- a/src/jobs/widget_install/task_certify.cpp +++ b/src/jobs/widget_install/task_certify.cpp @@ -241,8 +241,6 @@ void TaskCertify::stepSignature() SignatureFileInfoSet::reverse_iterator iter = signatureFiles.rbegin(); LogInfo("Number of signatures: " << signatureFiles.size()); - bool complianceMode = GlobalDAOReadOnly::getComplianceMode(); - for (; iter != signatureFiles.rend(); ++iter) { LogInfo("Checking signature with id=" << iter->getFileNumber()); SignatureData data(widgetPath + iter->getFileName(), @@ -253,24 +251,15 @@ void TaskCertify::stepSignature() xml.initialize(data, GlobalConfig::GetSignatureXmlSchema()); xml.read(data); - WrtSignatureValidator::AppType appType = - WrtSignatureValidator::WAC20; - - if (m_contextData.widgetConfig.webAppType == - APP_TYPE_TIZENWEBAPP) - { - appType = WrtSignatureValidator::TIZEN; - } - WrtSignatureValidator::Result result; WrtSignatureValidator validator( - appType, + WrtSignatureValidator::TIZEN, !GlobalSettings:: OCSPTestModeEnabled(), !GlobalSettings:: CrlTestModeEnabled(), - complianceMode); + false); result = validator.check(data, widgetPath); diff --git a/src/jobs/widget_install/task_widget_config.cpp b/src/jobs/widget_install/task_widget_config.cpp index 7834597..2be933c 100644 --- a/src/jobs/widget_install/task_widget_config.cpp +++ b/src/jobs/widget_install/task_widget_config.cpp @@ -593,9 +593,6 @@ bool TaskWidgetConfig::isFeatureAllowed(WrtDB::AppType appType, if (strstr(feature, PluginsPrefix::TIZENPluginsPrefix) == feature) { // Tizen WebApp feature featureType = APP_TYPE_TIZENWEBAPP; - } else if (strstr(feature, PluginsPrefix::WACPluginsPrefix) == feature) { - // WAC 2.0 feature - featureType = APP_TYPE_WAC20; } else if (strstr(feature, PluginsPrefix::W3CPluginsPrefix) == feature) { // W3C standard feature // Both WAC and TIZEN WebApp are possible to use W3C plugins @@ -666,8 +663,6 @@ bool TaskWidgetConfig::isMinVersionCompatible( std::string version; if (appType == WrtDB::AppType::APP_TYPE_TIZENWEBAPP) { version = WrtDB::GlobalConfig::GetTizenVersion(); - } else if (appType == WrtDB::AppType::APP_TYPE_WAC20) { - version = WrtDB::GlobalConfig::GetWACVersion(); } else { LogWarning("Invaild AppType"); return false; -- 2.7.4