For livebox configuration
authorlke01.lee <lke01.lee@samsung.com>
Fri, 7 Dec 2012 07:22:57 +0000 (16:22 +0900)
committerlke01.lee <lke01.lee@samsung.com>
Thu, 27 Dec 2012 01:08:49 +0000 (10:08 +0900)
[Issue#]
[Problem]
[Cause] The configuration informations has been changed from pkgname.config to config.xml
[Solution] Add parsing routine for livebox configuration
[Verification] This commit depends on http://slp-info.sec.samsung.net/gerrit/#/c/125839/,
http://slp-info.sec.samsung.net/gerrit/#/c/128073/

Change-Id: I0d188fea4df254d9a5418649d94cfa19860e461b

configuration/config.tizen.xsd
src/configuration_parser/widget_parser.cpp [changed mode: 0644->0755]
src/configuration_parser/widget_parser.h [changed mode: 0644->0755]
src/jobs/widget_install/job_widget_install.cpp
src/jobs/widget_install/manifest.cpp [changed mode: 0644->0755]
src/jobs/widget_install/manifest.h [changed mode: 0644->0755]
src/jobs/widget_install/task_manifest_file.cpp
src/jobs/widget_install/task_manifest_file.h [changed mode: 0644->0755]

index 490795e..46adddc 100755 (executable)
     </xs:restriction>
 </xs:simpleType>
 
+<xs:simpleType name="liveboxIdType">
+    <xs:restriction base="xs:string">
+        <xs:pattern value="[0-9a-zA-Z]{1,}"/>
+    </xs:restriction>
+</xs:simpleType>
+
+<xs:simpleType name="boxSizeType">
+    <xs:restriction base="xs:token">
+        <xs:enumeration value="1x1"/>
+        <xs:enumeration value="2x1"/>
+        <xs:enumeration value="2x2"/>
+        <xs:enumeration value="4x2"/>
+    </xs:restriction>
+</xs:simpleType>
+
+<xs:simpleType name="pdWidth">
+    <xs:restriction base="xs:int">
+        <xs:minInclusive value="175"/>
+        <xs:maxInclusive value="720"/>
+    </xs:restriction>
+</xs:simpleType>
+
+<xs:simpleType name="pdHeight">
+    <xs:restriction base="xs:int">
+        <xs:minInclusive value="175"/>
+        <xs:maxInclusive value="525"/>
+    </xs:restriction>
+</xs:simpleType>
+
 <xs:element name="content">
     <xs:complexType>
         <xs:attribute name="src" use="required" type="xs:anyURI"/>
   </xs:complexType>
 </xs:element>
 
+<xs:element name="livebox">
+    <xs:complexType mixed="true">
+        <xs:all>
+            <xs:element ref="tizen:label"/>
+            <xs:element ref="tizen:icon"/>
+            <xs:element ref="tizen:box"/>
+        </xs:all>     
+        <xs:attribute name="appid" type="tizen:liveboxIdType" use="required"/> 
+        <xs:attribute name="auto_launch" type="widgets:data.boolean" use="optional"/> 
+        <xs:attribute name="period" type="xs:float" use="optional"/> 
+        <xs:attribute name="network" type="widgets:data.boolean" use="optional"/> 
+        <xs:attribute name="nodisplay" type="widgets:data.boolean" use="optional"/> 
+        <xs:attribute name="primary" type="widgets:data.boolean" use="required"/> 
+        <xs:attribute name="timeout" type="xs:int" use="optional"/> 
+    </xs:complexType>
+</xs:element>
+
+<xs:element name="label" type="xs:string"/>
+
+<xs:element name="icon">
+    <xs:complexType>
+    <xs:attribute name="src" use="required" type="xs:anyURI"/>
+    </xs:complexType>
+</xs:element>
+
+<xs:element name="box">
+    <xs:complexType mixed="true">
+        <xs:sequence>
+            <xs:element ref="tizen:boxsize" maxOccurs="4"/>
+            <xs:element ref="tizen:pd"/>
+        </xs:sequence>
+        <xs:attribute name="src" use="required" type="xs:anyURI"/>
+    </xs:complexType>
+</xs:element>
+
+<xs:element name="pd">
+    <xs:complexType>
+        <xs:attribute name="src" use="required" type="xs:anyURI"/>
+        <xs:attribute name="width" use="required" type="tizen:pdWidth"/>
+        <xs:attribute name="height" use="required" type="tizen:pdHeight"/>
+    </xs:complexType>
+</xs:element>
+
+<xs:element name="boxsize" type="tizen:boxSizeType">
+    <xs:attribute name="preview" use="optional" type="xs:anyURI"/>
+</xs:element>
+
 </xs:schema>
old mode 100644 (file)
new mode 100755 (executable)
index 20ec69e..5ec1f8f
@@ -1466,6 +1466,374 @@ class CategoryParser : public ElementParser
     ConfigParserData& m_data;
 };
 
+class LiveboxParser : public ElementParser
+{
+  public:
+
+    struct LabelParser : public ElementParser
+    {
+        virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                const DPL::String& /*name*/)
+        {
+            return &IgnoringParser::Create;
+        }
+
+        virtual void Accept(const XmlAttribute& attribute)
+        {
+        }
+
+       virtual void Accept(const Element& element)
+       {
+               if (element.ns ==
+                   ConfigurationNamespace::TizenWebAppNamespaceName)
+               {
+                   m_properNamespace = true;
+               }
+       }
+
+       virtual void Accept(const Text& text)
+       {
+           if(m_properNamespace)
+            m_label = text.value;
+       }
+
+        virtual void Verify()
+        {
+               m_data.m_label = m_label;
+        }
+
+        LabelParser(ConfigParserData::LiveboxInfo& data) :
+            ElementParser(),
+            m_properNamespace(false),
+            m_data(data)
+        {
+        }
+
+      private:
+        DPL::String m_label;
+        ConfigParserData::LiveboxInfo& m_data;
+        bool m_properNamespace;
+    };
+
+    struct IconParser : public ElementParser
+    {
+        virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                const DPL::String& /*name*/)
+        {
+            return &IgnoringParser::Create;
+        }
+
+        virtual void Accept(const XmlAttribute& attribute)
+        {
+        if(m_properNamespace) {
+            if (attribute.name == L"src") {
+                m_icon = attribute.value;
+            }
+               }
+        }
+
+        virtual void Accept(const Element& element)
+        {
+               if (element.ns ==
+                   ConfigurationNamespace::TizenWebAppNamespaceName)
+               {
+                   m_properNamespace = true;
+               }
+        }
+
+        virtual void Accept(const Text& /*text*/)
+        {
+        }
+
+        virtual void Verify()
+        {
+               m_data.m_icon = m_icon;
+        }
+
+        explicit IconParser(ConfigParserData::LiveboxInfo& data) :
+               ElementParser(),
+               m_properNamespace(false),
+               m_data(data)
+        {
+        }
+
+      private:
+        DPL::String m_icon;
+        ConfigParserData::LiveboxInfo& m_data;
+       bool m_properNamespace;
+    };
+
+    struct BoxParser : public ElementParser
+    {
+           struct PdParser : public ElementParser
+           {
+               virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                       const DPL::String& name)
+               {
+                   return &IgnoringParser::Create;
+               }
+
+               virtual void Accept(const XmlAttribute& attribute)
+               {
+               if(m_properNamespace) {
+                   if (attribute.name == L"src") {
+                       m_src = attribute.value;
+                   } else if (attribute.name == L"width") {
+                       m_width = attribute.value;
+                   } else if (attribute.name == L"height") {
+                       m_height = attribute.value;
+                   }
+                       }
+               }
+
+               virtual void Accept(const Element& element)
+               {
+                       if (element.ns ==
+                           ConfigurationNamespace::TizenWebAppNamespaceName)
+                       {
+                           m_properNamespace = true;
+                       }
+               }
+
+               virtual void Accept(const Text& /*text*/)
+               {
+               }
+
+               virtual void Verify()
+               {
+                       m_data.m_pdSrc = m_src;
+                       m_data.m_pdWidth = m_width;
+                       m_data.m_pdHeight = m_height;
+               }
+
+               explicit PdParser(ConfigParserData::LiveboxInfo::Box& data) :
+                   ElementParser(),
+                       m_properNamespace(false),
+                   m_data(data)
+               {
+               }
+
+             private:
+               DPL::String m_src;
+               DPL::String m_width;
+               DPL::String m_height;
+
+                bool m_properNamespace;
+               ConfigParserData::LiveboxInfo::Box& m_data;
+           };
+
+           struct SizeParser : public ElementParser
+           {
+               virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                       const DPL::String& /*name*/)
+               {
+                   return &IgnoringParser::Create;
+               }
+
+               virtual void Accept(const XmlAttribute& attribute)
+               {
+                       if(m_properNamespace) {
+                   if (attribute.name == L"preview") {
+                       m_preview = attribute.value;
+                   }
+                               }
+               }
+
+               virtual void Accept(const Element& element)
+               {
+                       if (element.ns ==
+                           ConfigurationNamespace::TizenWebAppNamespaceName)
+                       {
+                           m_properNamespace = true;
+                       }
+               }
+
+               virtual void Accept(const Text& text)
+               {
+                       if(m_properNamespace)
+                        m_size = text.value;
+               }
+
+               virtual void Verify()
+               {
+                    std::pair<DPL::String, DPL::String> boxSize;
+                     boxSize.first = m_size;
+                     boxSize.second = m_preview;
+                     m_data.m_boxSize.push_back(boxSize);
+               }
+
+               explicit SizeParser(ConfigParserData::LiveboxInfo::Box& data) :
+                   ElementParser(),
+                   m_data(data)
+               {
+               }
+
+             private:
+               DPL::String m_size;
+               DPL::String m_preview;
+                bool m_properNamespace;
+               ConfigParserData::LiveboxInfo::Box& m_data;
+           };
+
+        virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                const DPL::String& name)
+        {
+               if (name == L"boxsize") {
+                   return DPL::MakeDelegate(this, &LiveboxParser::BoxParser::OnSizeElement);
+               } else if (name == L"pd") {
+                   return DPL::MakeDelegate(this, &LiveboxParser::BoxParser::OnPdElement);
+               }
+       }
+
+        virtual void Accept(const XmlAttribute& attribute)
+        {
+               if (m_properNamespace) {
+               if (attribute.name == L"src")
+                   m_box.m_boxSrc = attribute.value;
+               }
+        }
+
+        virtual void Accept(const Element& element)
+        {
+               if (element.ns ==
+                   ConfigurationNamespace::TizenWebAppNamespaceName)
+               {
+                   m_properNamespace = true;
+               }
+        }
+
+        virtual void Accept(const Text& /*text*/)
+        {
+        }
+
+        virtual void Verify()
+        {
+          m_data.m_boxInfo = m_box;
+        }
+
+        explicit BoxParser(ConfigParserData::LiveboxInfo& data) :
+            ElementParser(),
+            m_properNamespace(false),
+            m_data(data)
+        {
+        }
+
+        ElementParserPtr OnPdElement()
+        {
+            return ElementParserPtr(new PdParser(m_box));
+        }
+
+        ElementParserPtr OnSizeElement()
+        {
+            return ElementParserPtr(new SizeParser(m_box));
+        }
+
+      private:
+        DPL::String m_src;
+        ConfigParserData::LiveboxInfo& m_data;
+        bool m_properNamespace;
+        ConfigParserData::LiveboxInfo::Box m_box;
+
+    };
+
+    virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                                        const DPL::String& name)
+    {
+        if (name == L"label") {
+            return DPL::MakeDelegate(this, &LiveboxParser::OnLabelElement);
+        } else if (name == L"icon") {
+            return DPL::MakeDelegate(this, &LiveboxParser::OnIconElement);
+        }  else if (name == L"box") {
+            return DPL::MakeDelegate(this, &LiveboxParser::OnBoxElement);
+        } else {
+            return &IgnoringParser::Create;
+        }
+    }
+
+    virtual void Accept(const XmlAttribute& attribute)
+    {
+        if (m_properNamespace) {
+       if (attribute.name == L"appid") {
+            m_appId = attribute.value;
+        } else if (attribute.name == L"auto_launch") {
+            m_autoLaunch = attribute.value;
+        } else if (attribute.name == L"period") {
+            m_period = attribute.value;
+        } else if (attribute.name == L"network") {
+            m_network = attribute.value;
+            LogDebug("@@@ "<<m_network);
+        } else if (attribute.name == L"nodisplay") {
+            m_nodisplay = attribute.value;
+        } else if (attribute.name == L"primary") {
+            m_primary = attribute.value;
+        } else if (attribute.name == L"timeout") {
+            m_timeout = attribute.value;
+        }
+               }
+    }
+
+    virtual void Accept(const Element& element)
+    {
+        if (element.ns ==
+            ConfigurationNamespace::TizenWebAppNamespaceName)
+        {
+            m_properNamespace = true;
+        }
+    }
+
+    virtual void Accept(const Text& /*text*/)
+    {
+    }
+
+    virtual void Verify()
+    {
+        m_livebox.m_appId = m_appId;
+        m_livebox.m_autoLaunch = m_autoLaunch;
+        m_livebox.m_period = m_period;
+        m_livebox.m_network = m_network;
+        m_livebox.m_nodisplay = m_nodisplay;
+        m_livebox.m_primary = m_primary;
+        m_livebox.m_timeout = m_timeout;
+
+        m_data.m_livebox.push_back(m_livebox);
+    }
+
+    explicit LiveboxParser(ConfigParserData& data) :
+        ElementParser(),
+        m_data(data),
+        m_properNamespace(false)
+    {
+        m_livebox = ConfigParserData::LiveboxInfo();
+    }
+
+    ElementParserPtr OnLabelElement()
+    {
+        return ElementParserPtr(new LabelParser(m_livebox));
+    }
+
+    ElementParserPtr OnIconElement()
+    {
+        return ElementParserPtr(new IconParser(m_livebox));
+    }
+    ElementParserPtr OnBoxElement()
+    {
+        return ElementParserPtr(new BoxParser(m_livebox));
+    }
+
+  private:
+    ConfigParserData& m_data;
+    ConfigParserData::LiveboxInfo m_livebox;
+    DPL::String m_appId;
+    DPL::String m_autoLaunch;
+    DPL::String m_period;
+    DPL::String m_network;
+    DPL::String m_nodisplay;
+    DPL::String m_primary;
+    DPL::String m_timeout;
+    bool m_properNamespace;
+
+};
+
 ElementParser::ActionFunc WidgetParser::GetElementParser(const DPL::String& /*ns*/,
         const DPL::String& name)
 {
@@ -1508,6 +1876,8 @@ WidgetParser::WidgetParser(ConfigParserData& data) :
             &WidgetParser::OnAppControlElement);
     m_map[L"category"] = DPL::MakeDelegate(this,
             &WidgetParser::OnCategoryElement);
+    m_map[L"livebox"] = DPL::MakeDelegate(this, &WidgetParser::OnLiveboxElement);
+
 }
 
 ElementParserPtr WidgetParser::OnNameElement()
@@ -1595,6 +1965,11 @@ ElementParserPtr WidgetParser::OnCategoryElement()
     return ElementParserPtr(new CategoryParser(m_data));
 }
 
+ElementParserPtr WidgetParser::OnLiveboxElement()
+{
+    return ElementParserPtr(new LiveboxParser(m_data));
+}
+
 void WidgetParser::Accept(const Element& element)
 {
     if (element.ns != ConfigurationNamespace::W3CWidgetNamespaceName &&
old mode 100644 (file)
new mode 100755 (executable)
index 8f8b78d..7670388
@@ -81,6 +81,7 @@ class WidgetParser : public ElementParser
     ElementParserPtr OnPrivilegeElement();
     ElementParserPtr OnAppControlElement();
     ElementParserPtr OnCategoryElement();
+    ElementParserPtr OnLiveboxElement();
 
     virtual ActionFunc GetElementParser(const DPL::String& ns,
             const DPL::String& name);
index 1c2f7d0..6216ffc 100644 (file)
@@ -249,7 +249,6 @@ JobWidgetInstall::JobWidgetInstall(std::string const &widgetPath,
         {
             AddTask(new TaskRemoveBackupFiles(m_installerContext));
         }
-
         AddTask(new TaskPluginsCopy(m_installerContext));
         AddTask(new TaskDatabase(m_installerContext));
         AddTask(new TaskAceCheck(m_installerContext));
old mode 100644 (file)
new mode 100755 (executable)
index 46f367c..8e6bf4b
@@ -176,6 +176,7 @@ void Manifest::serialize(xmlTextWriterPtr writer)
         FOREACH(u, this->uiApplication) { u->serialize(writer); }
         FOREACH(i, this->imeApplication) { i->serialize(writer); }
         //FOREACH(f, this->font) { f->serialize(writer); }
+        FOREACH(l, this->livebox) { l->serialize(writer); }
     }
     endElement(writer);
 }
@@ -301,5 +302,84 @@ void AppControl::serialize(xmlTextWriterPtr writer)
     }
     endElement(writer);
 }
+
+void LiveBox::serialize(xmlTextWriterPtr writer)
+{
+    startElement(writer, "livebox");
+    if(!this->appid.empty()) {
+        writeAttribute(writer, "appid", this->appid);
+    }
+    if(!this->auto_launch.empty()) {
+        writeAttribute(writer, "auto_launch", this->auto_launch);
+    }
+    if(!this->network.empty()) {
+        writeAttribute(writer, "network", this->network);
+    }
+    writeAttribute(writer, "abi", "html");
+    if(!this->period.empty()) {
+        writeAttribute(writer, "period", this->period);
+    }
+    if(!this->nodisplay.empty()) {
+        writeAttribute(writer, "nodisplay", this->nodisplay);
+    }
+    if(!this->primary.empty()) {
+        writeAttribute(writer, "primary", this->primary);
+    }
+    if(!this->timeout.empty()) {
+        writeAttribute(writer, "timeout", this->timeout);
+    }
+    if(!this->label.empty()) {
+        startElement(writer, "label");
+        writeText(writer, this->label);
+        endElement(writer);
+    }
+
+    if(!this->icon.empty()) {
+        startElement(writer, "icon");
+        writeText(writer, this->icon);
+        endElement(writer);
+    }
+
+    if(!this->box.boxSrc.empty() && !this->box.boxSize.empty())
+    {
+        startElement(writer, "box");
+        writeAttribute(writer, "type", "buffer");
+
+        FOREACH(m, this->box.boxSize)
+        {
+            std::pair<DPL::String, DPL::String> boxSize = *m;
+            startElement(writer, "size");
+            if(!boxSize.second.empty())
+                writeAttribute(writer, "preview", boxSize.second);
+            writeText(writer, boxSize.first);
+            endElement(writer);
+        }
+
+        startElement(writer, "script");
+        writeAttribute(writer, "src", this->box.boxSrc);
+        endElement(writer);
+
+        endElement(writer);
+
+        if(!this->box.pdSrc.empty() && ! this->box.pdWidth.empty() && ! this->box.pdHeight.empty()) {
+            startElement(writer, "pd");
+            writeAttribute(writer, "type", "buffer");
+
+            startElement(writer, "size");
+            DPL::String pdSize = this->box.pdWidth+DPL::String(L"x")+this->box.pdHeight;
+            writeText(writer, pdSize);
+            endElement(writer);
+
+            startElement(writer, "script");
+            writeAttribute(writer, "src", this->box.pdSrc);
+            endElement(writer);
+
+            endElement(writer);
+        }
+    }
+
+    endElement(writer);
+}
+
 } //namespace Jobs
 } //namespace WidgetInstall
old mode 100644 (file)
new mode 100755 (executable)
index ecbedee..0418a84
@@ -223,6 +223,54 @@ private:
 typedef UiApplication UiApplicationType;
 
 /**
+ * @brief LiveBox element
+ */
+typedef std::list<std::pair<DPL::String, DPL::String>> boxSizeType;
+
+
+struct BoxInfo
+{
+    NcnameType boxSrc;
+    boxSizeType boxSize;
+    NcnameType pdSrc;
+    NcnameType pdWidth;
+    NcnameType pdHeight;
+};
+typedef BoxInfo BoxInfoType;
+
+class LiveBox
+{
+public:
+    LiveBox() { }
+    void setAppid(const NcnameType &x) { this->appid = x; }
+    void setAutoLaunch(const NcnameType &x) { this->auto_launch = x; }
+    void setPeriod(const NcnameType &x) { this->period = x; }
+    void setNetwork(const NcnameType &x) { this->network = x; }
+    void setNodisplay(const NcnameType &x) { this->nodisplay = x; }
+    void setPrimary(const NcnameType &x) { this->primary = x; }
+    void setTimeout(const NcnameType &x) { this->timeout = x; }
+    void setLabel(const NcnameType &x) { this->label = x; }
+    void setIcon(const NcnameType &x) { this->icon = x; }
+    void setBox(const BoxInfoType &x) { this->box = x; }
+
+    void serialize(xmlTextWriterPtr writer);
+
+private:
+    NcnameType appid;
+    NcnameType auto_launch;
+    NcnameType period;
+    NcnameType network;
+    NcnameType nodisplay;
+    NcnameType primary;
+    NcnameType timeout;
+    NcnameType label;
+    NcnameType icon;
+    BoxInfoType box;
+};
+
+typedef LiveBox LiveBoxInfo;
+
+/**
  * @brief manifest element
  *
  * Manifest xml file representation.
@@ -263,6 +311,11 @@ public:
     }
 //    void addFont(const FontType &x) { this->font.push_back(x); }
 
+    void addLivebox(const LiveBoxInfo &x)
+    {
+        this->livebox.push_back(x);
+    }
+
     void setInstallLocation(const InstallLocationType &x)
     {
         this->installLocation = x;
@@ -281,6 +334,7 @@ private:
     std::list<UiApplicationType> uiApplication;
     std::list<ImeApplicationType> imeApplication;
 //    std::list<FontType> font;
+    std::list<LiveBoxInfo> livebox;
     InstallLocationType installLocation;
     NcnameType package;
     PackageType type;
index 21743d2..8e2965f 100755 (executable)
@@ -551,6 +551,7 @@ void TaskManifestFile::writeManifest(const DPL::String & path)
     setWidgetOtherInfo(uiApp);
     setAppServiceInfo(uiApp);
     setAppCategory(uiApp);
+    setLiveBoxInfo(manifest);
 
     manifest.addUiApplication(uiApp);
     manifest.generate(path);
@@ -809,6 +810,91 @@ void TaskManifestFile::stepAbortParseManifest()
     {
         LogWarning("No manifest file found: " << manifest_file);
     }
+}
+
+void TaskManifestFile::setLiveBoxInfo(Manifest& manifest)
+{
+
+    FOREACH(it, m_context.widgetConfig.configInfo.m_livebox) {
+
+        LogInfo("setLiveBoxInfo");
+        LiveBoxInfo liveBox;
+        DPL::String pkgname;
+        DPL::Optional<WrtDB::ConfigParserData::LiveboxInfo>    ConfigInfo = *it;
+
+        if(!!m_context.widgetConfig.pkgname)
+        {
+            pkgname =
+                *m_context.widgetConfig.pkgname+DPL::String(L".")
+                +ConfigInfo->m_appId;
+            liveBox.setAppid(pkgname);
+        }
+
+        if(ConfigInfo->m_autoLaunch !=L"") {
+            liveBox.setAutoLaunch(ConfigInfo->m_autoLaunch);
+        }
+
+        if(ConfigInfo->m_period !=L"")
+            liveBox.setPeriod(ConfigInfo->m_period);
+
+        if(ConfigInfo->m_network !=L"")
+            liveBox.setNetwork(ConfigInfo->m_network);
+
+        if(ConfigInfo->m_nodisplay !=L"")
+            liveBox.setNodisplay(ConfigInfo->m_nodisplay);
+
+        if(ConfigInfo->m_primary !=L"")
+            liveBox.setPrimary(ConfigInfo->m_primary);
+
+        if(ConfigInfo->m_timeout !=L"")
+            liveBox.setTimeout(ConfigInfo->m_timeout);
+
+        if(ConfigInfo->m_label !=L"")
+            liveBox.setLabel(ConfigInfo->m_label);
+
+        DPL::String defaultLocale
+            = DPL::FromUTF8String(m_context.locations->getPackageInstallationDir())
+            + DPL::String(L"/res/wgt/");
+
+        if(ConfigInfo->m_icon!=L"") {
+            liveBox.setIcon(defaultLocale+ConfigInfo->m_icon);
+        }
+
+        if (ConfigInfo->m_boxInfo.m_boxSrc.empty() || ConfigInfo->m_boxInfo.m_boxSize.empty()) {
+            LogInfo("Widget doesn't contain box");
+            return;
+        } else {
+            BoxInfoType box;
+            if (!ConfigInfo->m_boxInfo.m_boxSrc.empty()) {
+                if((std::string::npos != ConfigInfo->m_boxInfo.m_boxSrc.find(L"http"))
+                       || (std::string::npos != ConfigInfo->m_boxInfo.m_boxSrc.find(L"https")))
+                    box.boxSrc = ConfigInfo->m_boxInfo.m_boxSrc;
+                else
+                    box.boxSrc = defaultLocale + ConfigInfo->m_boxInfo.m_boxSrc;
+            }
+
+            std::list<std::pair<DPL::String,DPL::String>> BoxSizeList
+                = ConfigInfo->m_boxInfo.m_boxSize;
+            FOREACH(im, BoxSizeList) {
+                std::pair<DPL::String, DPL::String> boxSize = *im;
+                if(!boxSize.second.empty())
+                    boxSize.second = defaultLocale + boxSize.second;
+                box.boxSize.push_back(boxSize);
+            }
+
+            if (!ConfigInfo->m_boxInfo.m_pdSrc.empty()
+                    && !ConfigInfo->m_boxInfo.m_pdWidth.empty()
+                    && !ConfigInfo->m_boxInfo.m_pdHeight.empty()) {
+                box.pdSrc = defaultLocale + ConfigInfo->m_boxInfo.m_pdSrc;
+                box.pdWidth = ConfigInfo->m_boxInfo.m_pdWidth;
+                box.pdHeight = ConfigInfo->m_boxInfo.m_pdHeight;
+            }
+
+            liveBox.setBox(box);
+        }
+
+        manifest.addLivebox(liveBox);
+    }
 
 }
 
old mode 100644 (file)
new mode 100755 (executable)
index 0755d6d..191bc49
@@ -96,6 +96,7 @@ class TaskManifestFile :
     void setWidgetOtherInfo(UiApplication & uiApp);
     void setAppServiceInfo(UiApplication & uiApp);
     void setAppCategory(UiApplication & uiApp);
+    void setLiveBoxInfo(Manifest& manifest);
 
     void generateWidgetName(Manifest & manifest, UiApplication &uiApp, const DPL::OptionalString& tag, DPL::OptionalString name, bool & defaultNameSaved);
     void generateWidgetIcon(UiApplication & uiApp, const DPL::OptionalString& tag, const DPL::String& language, bool & defaultIconSaved);