From ba2f09e6d3bdd638b5f7c6dc75d91f447e5a77a7 Mon Sep 17 00:00:00 2001 From: Jihoon Chung Date: Sat, 23 Mar 2013 16:43:51 +0900 Subject: [PATCH] Clean-up unused feature data [Issue#] N/A [Problem] N/A [Cause] N/A [Solution] Current WRT uses Privilege instead of Feature Deprecated : Parser for feature (FeatureParser, ParamParser, OnFeatureElement()) param and required field [SCMRequest] N/A Change-Id: I1936b0bff216bc501c8db6a40eff2baef87c794e --- src/configuration_parser/widget_parser.cpp | 138 +------------------------ src/configuration_parser/widget_parser.h | 1 - src/jobs/widget_install/job_widget_install.cpp | 2 - src/jobs/widget_install/task_widget_config.cpp | 24 ----- src/misc/feature_logic.cpp | 5 +- src/misc/feature_logic.h | 2 - 6 files changed, 4 insertions(+), 168 deletions(-) diff --git a/src/configuration_parser/widget_parser.cpp b/src/configuration_parser/widget_parser.cpp index 94e57e8..50c8137 100644 --- a/src/configuration_parser/widget_parser.cpp +++ b/src/configuration_parser/widget_parser.cpp @@ -743,132 +743,6 @@ class ContentParser : public ElementParser ConfigParserData& m_data; }; -class FeatureParser : public ElementParser -{ - public: - struct ParamParser : public ElementParser - { - virtual ActionFunc GetElementParser(const DPL::String& /*ns*/, - const DPL::String& /*name*/) - { - return &IgnoringParser::Create; - } - - virtual void Accept(const XmlAttribute& attribute) - { - if (attribute.name == L"name") { - m_name = attribute.value; - NormalizeString(m_name); - } else if (attribute.name == L"value") { - m_value = attribute.value; - NormalizeString(m_value); - } - } - - virtual void Accept(const Element& /*element*/) - {} - - virtual void Accept(const Text& /*text*/) - { - ThrowMsg(Exception::ParseError, "param element must be empty"); - } - - virtual void Verify() - { - if (m_name.IsNull() || *m_name == L"") { - return; - } - if (m_value.IsNull() || *m_value == L"") { - return; - } - - ConfigParserData::Param param(*m_name); - param.value = *m_value; - - if (m_data.paramsList.find(param) == m_data.paramsList.end()) { - m_data.paramsList.insert(param); - } - } - - ParamParser(ConfigParserData::Feature& data) : - ElementParser(), - m_data(data) - {} - - private: - DPL::OptionalString m_name; - DPL::OptionalString m_value; - ConfigParserData::Feature& m_data; - }; - - virtual ActionFunc GetElementParser(const DPL::String& /*ns*/, - const DPL::String& name) - { - if (name == L"param") { - return DPL::MakeDelegate(this, &FeatureParser::OnParamElement); - } 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"name") { - m_feature.name = attribute.value; - } else if (attribute.name == L"required") { - if (attribute.value == L"false") { - m_feature.required = false; - } else { - m_feature.required = true; - } - } - } - - virtual void Verify() - { - LibIri::Wrapper iri(DPL::ToUTF8String(m_feature.name).c_str()); - - if (m_feature.name != L"") { - if (iri.Validate()) { - if (m_data.featuresList.find(m_feature) == - m_data.featuresList.end()) - { - m_data.featuresList.insert(m_feature); - } else { - LogDebug("Ignoring feature with name" << - DPL::ToUTF8String(m_feature.name)); - } - } else { - if (m_feature.required) { - //Throw only if required - ThrowMsg(Exception::ParseError, "invalid feature IRI"); - } - } - } - } - - ElementParserPtr OnParamElement() - { - return ElementParserPtr(new ParamParser(m_feature)); - } - - FeatureParser(ConfigParserData& data) : - ElementParser(), - m_data(data), - m_feature(L"") - {} - - private: - ConfigParserData& m_data; - ConfigParserData::Feature m_feature; -}; - class PreferenceParser : public ElementParser { public: @@ -1661,7 +1535,6 @@ class PrivilegeParser : public ElementParser m_privilege.name = attribute.value; } } - m_feature.required = false; } virtual void Verify() @@ -1676,7 +1549,7 @@ class PrivilegeParser : public ElementParser m_data.featuresList.insert(m_feature); } else { LogDebug("Ignoring feature with name" << - DPL::ToUTF8String(m_feature.name)); + DPL::ToUTF8String(m_feature.name)); } } } @@ -2409,7 +2282,7 @@ class AccountParser : public ElementParser if (attribute.value == L"ture") { m_multiSupport = true; - } + } } } @@ -2518,8 +2391,6 @@ WidgetParser::WidgetParser(ConfigParserData& data) : m_map[L"icon"] = DPL::MakeDelegate(this, &WidgetParser::OnIconElement); m_map[L"content"] = DPL::MakeDelegate(this, &WidgetParser::OnContentElement); - m_map[L"feature"] = - DPL::MakeDelegate(this, &WidgetParser::OnFeatureElement); m_map[L"preference"] = DPL::MakeDelegate(this, &WidgetParser::OnPreferenceElement); m_map[L"link"] = DPL::MakeDelegate(this, &WidgetParser::OnLinkElement); @@ -2592,11 +2463,6 @@ ElementParserPtr WidgetParser::OnContentElement() return ElementParserPtr(new ContentParser(m_data)); } -ElementParserPtr WidgetParser::OnFeatureElement() -{ - return ElementParserPtr(new FeatureParser(m_data)); -} - ElementParserPtr WidgetParser::OnPreferenceElement() { return ElementParserPtr(new PreferenceParser(m_data)); diff --git a/src/configuration_parser/widget_parser.h b/src/configuration_parser/widget_parser.h index c171c9d..7dba4f5 100644 --- a/src/configuration_parser/widget_parser.h +++ b/src/configuration_parser/widget_parser.h @@ -70,7 +70,6 @@ class WidgetParser : public ElementParser ElementParserPtr OnLicenseElement(); ElementParserPtr OnIconElement(); ElementParserPtr OnContentElement(); - ElementParserPtr OnFeatureElement(); ElementParserPtr OnPreferenceElement(); ElementParserPtr OnAccessElement(); ElementParserPtr OnLinkElement(); diff --git a/src/jobs/widget_install/job_widget_install.cpp b/src/jobs/widget_install/job_widget_install.cpp index e0a26bb..c311d8c 100644 --- a/src/jobs/widget_install/job_widget_install.cpp +++ b/src/jobs/widget_install/job_widget_install.cpp @@ -925,8 +925,6 @@ void JobWidgetInstall::displayWidgetInfo() FOREACH(it, list) { out << std::endl << " Name: " << it->name; - out << std::endl << " Required: " << it->required; - out << std::endl << " Params:"; } } diff --git a/src/jobs/widget_install/task_widget_config.cpp b/src/jobs/widget_install/task_widget_config.cpp index b53bb25..cbf6590 100644 --- a/src/jobs/widget_install/task_widget_config.cpp +++ b/src/jobs/widget_install/task_widget_config.cpp @@ -478,30 +478,6 @@ void TaskWidgetConfig::StepVerifyFeatures() << "] cannot be allowed to use [" << DPL::ToUTF8String(it->name) + "] feature"); - } - if (!WrtDB::FeatureDAOReadOnly::isFeatureInstalled( - DPL::ToUTF8String(it->name))) - { - LogWarning("Feature not found. Checking if required :[" << - DPL::ToUTF8String(it->name) << "]"); - - if (it->required) { - /** - * WL-3210 The WRT MUST inform the user if a widget cannot be - * installed because one or more required features are not - * supported. - */ - std::ostringstream os; - os << - "Widget cannot be installed, required feature is missing:[" - << DPL::ToUTF8String(it->name) << "]"; - if (!GlobalSettings::TestModeEnabled() && !isTizenWebApp()) { - std::string label = os.str(); - createInstallPopup(PopupType::WIDGET_WRONG_FEATURE_INFO, - label); - } - ThrowMsg(Exceptions::WidgetConfigFileInvalid, os.str()); - } } else { newList.insert(*it); featureInfo += DPL::ToUTF8String(it->name); diff --git a/src/misc/feature_logic.cpp b/src/misc/feature_logic.cpp index de4b99c..aa8b873 100644 --- a/src/misc/feature_logic.cpp +++ b/src/misc/feature_logic.cpp @@ -79,9 +79,8 @@ void FeatureLogic::setAceResponse(bool allowed) Assert(isProcessable() && "Wrong usage"); if (!allowed) { m_currentFeature->rejected = true; - if (m_currentFeature->required) { - m_rejected = true; - } + // TODO: checking tizen specification regarding security for insatlling + // m_rejected = true; } } diff --git a/src/misc/feature_logic.h b/src/misc/feature_logic.h index 03bb51a..8c4458f 100644 --- a/src/misc/feature_logic.h +++ b/src/misc/feature_logic.h @@ -72,10 +72,8 @@ class FeatureLogic : DPL::Noncopyable { name = second.name; devCapSet = second.devCapSet; - required = second.required; rejected = second.rejected; pluginId = second.pluginId; - params = second.params; currentCap = devCapSet.find(*second.currentCap); } }; -- 2.7.4