[Release] wrt-installer_0.1.24
[framework/web/wrt-installer.git] / src / configuration_parser / widget_parser.cpp
index 94e57e8..39b139c 100644 (file)
@@ -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;
-                  } 
+                  }
               }
           }
 
@@ -2481,7 +2354,8 @@ class AccountParser : public ElementParser
         ElementParser(),
         m_data(data),
         m_account(data.accountProvider),
-        m_properNamespace(false)
+        m_properNamespace(false),
+        m_multiSupport(false)
     {}
 
   private:
@@ -2518,8 +2392,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 +2464,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));