Fix App-control Supports
[framework/web/wrt-installer.git] / src / configuration_parser / widget_parser.cpp
index 7dc58aa..3b0a0ec 100644 (file)
@@ -1093,6 +1093,15 @@ class AppServiceParser : public ElementParser
         NormalizeString(m_scheme);
         NormalizeString(m_mime);
 
+        // exception
+        DPL::String ignoreUri(L"file");
+
+        if (!m_scheme.IsNull() && *m_scheme == ignoreUri)
+        {
+            LogInfo("exception : '" << *m_scheme << "' scheme will be ignored.");
+            m_scheme = DPL::OptionalString::Null;
+        }
+
         // verify duplicate element
         DPL::String wildString(L"*/*");
         DPL::String nullString(L"");
@@ -1271,15 +1280,22 @@ class AppControlParser : public ElementParser
 
         virtual void Verify()
         {
+            // exception
+            DPL::String ignoreUri(L"file");
+
+            if (!m_value.IsNull() && *m_value == ignoreUri)
+            {
+                LogInfo("exception : '" << *m_value << "' scheme will be ignored.");
+                m_value = DPL::OptionalString::Null;
+            }
+
             if (m_value.IsNull() || *m_value == L"") {
                 return;
             }
 
             DPL::String wildString(L"*/*");
-            if ((m_data.m_uriList.find(wildString) ==
-                 m_data.m_uriList.end())
-                && (m_data.m_uriList.find(*m_value) ==
-                    m_data.m_uriList.end()))
+            if ((m_data.m_uriList.find(wildString) == m_data.m_uriList.end())
+                && (m_data.m_uriList.find(*m_value) == m_data.m_uriList.end()))
             {
                 m_data.m_uriList.insert(*m_value);
             } else {
@@ -1402,16 +1418,6 @@ class AppControlParser : public ElementParser
             return;
         }
 
-        FOREACH(iterator, m_data.appControlList) {
-            if (iterator->m_src == m_appControl.m_src &&
-                iterator->m_operation == m_appControl.m_operation)
-            {
-                ThrowMsg(Exception::ParseError,
-                         "app control element is duplicated " +
-                         DPL::ToUTF8String(m_appControl.m_src) + ", " +
-                         DPL::ToUTF8String(m_appControl.m_operation));
-            }
-        }
         m_data.appControlList.push_back(m_appControl);
     }