[Release] wrt-installer_0.0.94 for tizen_2.0 branch submit/tizen_2.0/20130116.080519
authorSoyoung Kim <sy037.kim@samsung.com>
Wed, 16 Jan 2013 08:04:46 +0000 (17:04 +0900)
committerSoyoung Kim <sy037.kim@samsung.com>
Wed, 16 Jan 2013 08:04:52 +0000 (17:04 +0900)
Merge remote-tracking branch 'origin/master' into tizen_2.0

configuration/config.tizen.xsd
configuration/config.xsd
debian/changelog
etc/wrt_preinstall_widgets.sh
packaging/wrt-installer.spec
src/configuration_parser/widget_parser.cpp
src/configuration_parser/widget_parser.h
src/jobs/widget_install/task_manifest_file.cpp
src/jobs/widget_install/task_manifest_file.h

index 1a5b1fb..4bc46ea 100644 (file)
@@ -56,6 +56,7 @@
     </xs:complexType>
 </xs:element>
 
+<!-- TODO : appservice will be removed. Please use app-control-->
 <xs:element name="appservice">
     <xs:complexType>
         <xs:attribute name="src" type="xs:NCName" use="required"/>
         <xs:attribute name="context-menu" type="tizen:activationType" use="optional"/> <!-- default: enable -->
         <xs:attribute name="background-support" type="tizen:activationType" use="optional"/> <!-- default: enable -->
         <xs:attribute name="encryption" type="tizen:activationType" use="optional"/> <!-- default: disable -->
-        <xs:attribute name="nodisplay" type="widgets:data.boolean" use="optional"/> <!-- default: false -->
         <xs:attribute name="install-location" type="tizen:InstallLocationType" use="optional"/>
     </xs:complexType>
 </xs:element>
 
+<xs:element name="app-control">
+  <xs:complexType>
+    <xs:sequence>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="tizen:src"/>
+        <xs:element ref="tizen:operation"/>
+        <xs:element ref="tizen:uri"/>
+        <xs:element ref="tizen:mime"/>
+      </xs:choice>
+    </xs:sequence>
+  </xs:complexType>
+</xs:element>
+
 <xs:element name="category">
   <xs:complexType>
     <xs:anyAttribute processContents="lax"/>
   </xs:complexType>
 </xs:element>
 
+<xs:element name="src">
+    <xs:complexType>
+        <xs:attribute name="name" use="required"/>
+    </xs:complexType>
+</xs:element>
+
+<xs:element name="operation">
+    <xs:complexType>
+        <xs:attribute name="name" use="required"/>
+    </xs:complexType>
+</xs:element>
+
+<xs:element name="uri">
+    <xs:complexType>
+        <xs:attribute name="name" use="required"/>
+    </xs:complexType>
+</xs:element>
+
+<xs:element name="mime">
+  <xs:complexType>
+    <xs:attribute name="name" use="required"/>
+  </xs:complexType>
+</xs:element>
+
 <xs:element name="livebox">
     <xs:complexType mixed="true">
         <xs:all>
index 8acb687..4e6a005 100755 (executable)
@@ -71,6 +71,7 @@
                 <!-- The wildcards permitted within the list are ##local (a nonqualified element) and ##targetNamespace (the target namespace). Two wildcards can also be used instead of the list: ##any (any namespace) and ##other (any namespace other than the target namespace). -->\r
                 <!--xs:group ref="widgets:extension"/-->\r
                 <xs:element ref="tizen:appservice"  maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
+                <xs:element ref="tizen:app-control"  maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
                 <xs:element ref="tizen:setting"  maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
                 <xs:element ref="tizen:application" minOccurs="1" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
                 <xs:element ref="tizen:content"  minOccurs="1" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
index a1d3bbf..9027226 100644 (file)
@@ -1,3 +1,14 @@
+wrt-installer (0.0.94) unstable; urgency=low
+
+  * Modify app control element.
+  * Modify config.xml
+  * preinstall plugin during booting time for window SDK
+
+  * Git : framework/web/wrt-installer
+  * Tag : wrt-installer_0.0.94
+
+ -- Soyoung Kim <sy037.kim@samsung.com>  Wed, 16 Jan 2013 16:57:22 +0900
+
 wrt-installer (0.0.93) unstable; urgency=low
 
   * privilege skip checking ACE.
index 9742d0d..2d7b9d5 100755 (executable)
@@ -75,4 +75,7 @@ if [ ! -d $_working_dir ]; then
        exit 1
 fi
 
+#Plugin installation is temporary code for window SDK
+/usr/bin/wrt-installer -p
+
 install_widgets
index 8fc7754..a113ad7 100644 (file)
@@ -1,7 +1,7 @@
-#git:framework/web/wrt-installer wrt-installer 0.0.93
+#git:framework/web/wrt-installer wrt-installer 0.0.94
 Name:       wrt-installer
 Summary:    Installer for tizen Webruntime
-Version:    0.0.93
+Version:    0.0.94
 Release:    1
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index 5ef2769..d740ac3 100755 (executable)
@@ -1060,7 +1060,7 @@ class SettingParser : public ElementParser
     ConfigParserData::Setting m_setting;
 };
 
-class AppControlParser : public ElementParser
+class AppServiceParser : public ElementParser
 {
   public:
     virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
@@ -1146,7 +1146,7 @@ class AppControlParser : public ElementParser
         m_data.appServiceList.push_back(serviceInfo);
     }
 
-    AppControlParser(ConfigParserData& data) :
+    AppServiceParser(ConfigParserData& data) :
         ElementParser(),
         m_src(DPL::OptionalString::Null),
         m_operation(DPL::OptionalString::Null),
@@ -1164,6 +1164,315 @@ class AppControlParser : public ElementParser
     ConfigParserData& m_data;
 };
 
+class AppControlParser : public ElementParser
+{
+  public:
+     struct SourceParser : public ElementParser
+     {
+         public:
+             virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                     const DPL::String& /*name*/)
+             {
+                 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") {
+                     if (attribute.value.size() > 0) {
+                         m_value = attribute.value;
+                         NormalizeString(m_value);
+                     }
+                 }
+             }
+
+             virtual void Verify()
+             {
+                 if (m_value.IsNull() || *m_value== L"") {
+                     return;
+                 }
+
+                 m_data.m_src = *m_value;
+             }
+
+             SourceParser(ConfigParserData::AppControlInfo& data) :
+                 ElementParser(),
+                 m_properNamespace(false),
+                 m_data(data)
+         {
+         }
+
+         private:
+             bool m_properNamespace;
+             DPL::OptionalString m_value;
+             ConfigParserData::AppControlInfo& m_data;
+     };
+
+     struct OperationParser : public ElementParser
+     {
+         public:
+             virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                     const DPL::String& /*name*/)
+             {
+                 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") {
+                     if (attribute.value.size() > 0) {
+                         m_value = attribute.value;
+                         NormalizeString(m_value);
+                     }
+                 }
+             }
+
+             virtual void Verify()
+             {
+                 if (m_value.IsNull() || *m_value== L"") {
+                     return;
+                 }
+
+                 m_data.m_operation = *m_value;
+             }
+
+             OperationParser(ConfigParserData::AppControlInfo& data) :
+                 ElementParser(),
+                 m_properNamespace(false),
+                 m_data(data)
+         {
+         }
+
+         private:
+             bool m_properNamespace;
+             DPL::OptionalString m_value;
+             ConfigParserData::AppControlInfo& m_data;
+     };
+
+     struct UriParser : public ElementParser
+     {
+         public:
+             virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                     const DPL::String& /*name*/)
+             {
+                 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") {
+                     if (attribute.value.size() > 0) {
+                         m_value = attribute.value;
+                         NormalizeString(m_value);
+                     }
+                 }
+             }
+
+             virtual void Verify()
+             {
+                 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())) {                   
+                         
+                     m_data.m_uriList.insert(*m_value);
+                 } else {
+                     LogDebug("Ignoring uri with name" <<
+                             DPL::ToUTF8String(*m_value));
+                 }
+             }
+
+             UriParser(ConfigParserData::AppControlInfo& data) :
+                 ElementParser(),
+                 m_properNamespace(false),
+                 m_data(data)
+         {
+         }
+
+         private:
+             bool m_properNamespace;
+             DPL::OptionalString m_value;
+             ConfigParserData::AppControlInfo& m_data;
+     };
+
+     struct MimeParser : public ElementParser
+     {
+         public:
+             virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                     const DPL::String& /*name*/)
+             {
+                 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") {
+                     if (attribute.value.size() > 0) {
+                         m_value = attribute.value;
+                         NormalizeString(m_value);
+                     }
+                 }
+             }
+
+             virtual void Verify()
+             {
+                 if (m_value.IsNull() || *m_value == L"") {
+                     return;
+                 }
+
+                 DPL::String wildString(L"*/*");
+                 if ((m_data.m_mimeList.find(wildString) ==
+                             m_data.m_mimeList.end())
+                         && (m_data.m_mimeList.find(*m_value) ==
+                             m_data.m_mimeList.end())) {                   
+                     m_data.m_mimeList.insert(*m_value);
+                 } else {
+                     LogDebug("Ignoring mime with name" <<
+                             DPL::ToUTF8String(*m_value));
+                 }
+             }
+
+             MimeParser(ConfigParserData::AppControlInfo& data) :
+                 ElementParser(),
+                 m_properNamespace(false),
+                 m_data(data)
+         {
+         }
+
+         private:
+             bool m_properNamespace;
+             DPL::OptionalString m_value;
+             ConfigParserData::AppControlInfo& m_data;
+     };
+     
+    virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+            const DPL::String& name)
+    {
+        if (name == L"src") {
+            return DPL::MakeDelegate(this, &AppControlParser::OnSourceElement);
+        } else if (name == L"operation") {
+            return DPL::MakeDelegate(this, &AppControlParser::OnOperationElement);
+        } else if (name == L"uri") {
+            return DPL::MakeDelegate(this, &AppControlParser::OnUriElement);
+        }  else if (name == L"mime") {
+            return DPL::MakeDelegate(this, &AppControlParser::OnMimeElement);
+        } else {
+            return &IgnoringParser::Create;
+        }
+    }
+
+    virtual void Accept(const XmlAttribute& attribute)
+    {
+    }
+
+    virtual void Accept(const Element& element)
+    {
+        LogWarning("namespace for app service = " << element.ns);
+        if (element.ns == ConfigurationNamespace::W3CWidgetNamespaceName) {
+            ThrowMsg(Exception::ParseError,
+                "Wrong xml namespace for widget element");
+        }
+    }
+
+    virtual void Accept(const Text& /*text*/)
+    {
+        ThrowMsg(Exception::ParseError, "param element must be empty");
+    }
+
+    virtual void Verify()
+    {
+        if (m_appControl.m_src == L""){
+            LogWarning("service element must have src element");
+            return;
+        }
+
+        if (m_appControl.m_operation == L""){
+            LogWarning("service element must have operation element");
+            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);
+    }
+
+    ElementParserPtr OnSourceElement()
+    {
+        return ElementParserPtr(new SourceParser(m_appControl));
+    }
+
+    ElementParserPtr OnOperationElement()
+    {
+        return ElementParserPtr(new OperationParser(m_appControl));
+    }
+
+    ElementParserPtr OnUriElement()
+    {
+        return ElementParserPtr(new UriParser(m_appControl));
+    }
+
+    ElementParserPtr OnMimeElement()
+    {
+        return ElementParserPtr(new MimeParser(m_appControl));
+    }
+    
+    AppControlParser(ConfigParserData& data) :
+        ElementParser(),
+        m_data(data),
+        m_appControl(L"")
+    {
+    }
+
+  private:
+    ConfigParserData& m_data;
+    ConfigParserData::AppControlInfo m_appControl;
+};
+
 class ApplicationParser : public ElementParser
 {
   public:
@@ -1823,6 +2132,7 @@ class LiveboxParser : public ElementParser
 
 };
 
+
 ElementParser::ActionFunc WidgetParser::GetElementParser(const DPL::String& /*ns*/,
         const DPL::String& name)
 {
@@ -1856,12 +2166,12 @@ WidgetParser::WidgetParser(ConfigParserData& data) :
     m_map[L"setting"] =
         DPL::MakeDelegate(this, &WidgetParser::OnSettingElement);
     // TODO: appservice will be removed
-    m_map[L"appservice"] = DPL::MakeDelegate(this, &WidgetParser::OnAppControlElement);
+    m_map[L"appservice"] = DPL::MakeDelegate(this, &WidgetParser::OnAppServiceElement);
     m_map[L"application"] = DPL::MakeDelegate(this, &WidgetParser::OnApplicationElement);
     m_map[L"splash"] = DPL::MakeDelegate(this, &WidgetParser::OnSplashElement);
     m_map[L"background"] = DPL::MakeDelegate(this, &WidgetParser::OnBackgroundElement);
     m_map[L"privilege"] = DPL::MakeDelegate(this, &WidgetParser::OnPrivilegeElement);
-    m_map[L"appcontrol"] = DPL::MakeDelegate(this,
+    m_map[L"app-control"] = DPL::MakeDelegate(this,
             &WidgetParser::OnAppControlElement);
     m_map[L"category"] = DPL::MakeDelegate(this,
             &WidgetParser::OnCategoryElement);
@@ -1944,6 +2254,11 @@ ElementParserPtr WidgetParser::OnPrivilegeElement()
     return ElementParserPtr(new PrivilegeParser(m_data));
 }
 
+ElementParserPtr WidgetParser::OnAppServiceElement()
+{
+    return ElementParserPtr(new AppServiceParser(m_data));
+}
+
 ElementParserPtr WidgetParser::OnAppControlElement()
 {
     return ElementParserPtr(new AppControlParser(m_data));
index 7670388..82b406c 100755 (executable)
@@ -79,6 +79,7 @@ class WidgetParser : public ElementParser
     ElementParserPtr OnSplashElement();
     ElementParserPtr OnBackgroundElement();
     ElementParserPtr OnPrivilegeElement();
+    ElementParserPtr OnAppServiceElement();
     ElementParserPtr OnAppControlElement();
     ElementParserPtr OnCategoryElement();
     ElementParserPtr OnLiveboxElement();
index 4a22574..b34b13c 100644 (file)
@@ -547,6 +547,7 @@ void TaskManifestFile::writeManifest(const DPL::String & path)
     setWidgetManifest(manifest);
     setWidgetOtherInfo(uiApp);
     setAppServiceInfo(uiApp);
+    setAppControlInfo(uiApp);
     setAppCategory(uiApp);
     setLiveBoxInfo(manifest);
 
@@ -765,6 +766,36 @@ void TaskManifestFile::setAppServiceInfo(UiApplication & uiApp)
     }
 }
 
+void TaskManifestFile::setAppControlInfo(UiApplication & uiApp)
+{
+    WrtDB::ConfigParserData::AppControlInfoList appControlList =
+        m_context.widgetConfig.configInfo.appControlList;
+
+    if (appControlList.empty()) {
+        LogInfo("Widget doesn't contain app control");
+        return;
+    }
+
+    // x-tizen-svc=http://tizen.org/appcontrol/operation/pick|NULL|image;
+    FOREACH(it, appControlList) {
+        AppControl appControl;
+        if (!it->m_operation.empty()) {
+            appControl.addOperation(it->m_operation); //TODO: encapsulation?
+        }
+        if (!it->m_uriList.empty()) {
+            FOREACH(uri, it->m_uriList) {
+                appControl.addUri(*uri);
+            }
+        }
+        if (!it->m_mimeList.empty()) {
+            FOREACH(mime, it->m_mimeList) {
+                appControl.addMime(*mime);
+            }
+        }
+        uiApp.addAppControl(appControl);
+    }
+}
+
 void TaskManifestFile::setAppCategory(UiApplication &uiApp)
 {
     WrtDB::ConfigParserData::CategoryList categoryList =
index 191bc49..ec9e12b 100755 (executable)
@@ -94,7 +94,9 @@ class TaskManifestFile :
     void setWidgetIcons(UiApplication & uiApp);
     void setWidgetManifest(Manifest & manifest);
     void setWidgetOtherInfo(UiApplication & uiApp);
+    /*  please use AppControl. this function will be removed. */
     void setAppServiceInfo(UiApplication & uiApp);
+    void setAppControlInfo(UiApplication & uiApp);
     void setAppCategory(UiApplication & uiApp);
     void setLiveBoxInfo(Manifest& manifest);