From 049856c93e9fc85d7543ebe5844e6967b9829903 Mon Sep 17 00:00:00 2001 From: "lke01.lee" Date: Wed, 26 Dec 2012 10:36:21 +0900 Subject: [PATCH] livebox configuration valuables has been modified [Issue#] N/A [Problem] [Cause] N/A [Solution] livebox configuration valuables have been changed and unused files have been removed. [Verification] This path depends on wrt-common http://slp-info.sec.samsung.net/gerrit/#/c/129652/ Change-Id: I8c744ee4cb1b6083e51434954b0847145a3b068b --- src/CMakeLists.txt | 8 + src/configuration_parser/widget_parser.cpp | 427 ++++++++++++------------- src/jobs/widget_install/job_widget_install.cpp | 1 + src/jobs/widget_install/manifest.cpp | 30 +- src/jobs/widget_install/manifest.h | 17 +- src/jobs/widget_install/task_manifest_file.cpp | 54 ++-- 6 files changed, 261 insertions(+), 276 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b22683d..fe1d5d6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -99,6 +99,14 @@ SET(INSTALLER_SOURCES ${INSTALLER_SRC_DIR}/pkg-manager/pkgmgr_signal.cpp ) +IF(LB_SUPPORT) + SET(INSTALLER_SOURCES + ${INSTALLER_SOURCES} + ) + MESSAGE(STATUS "adding definition -DLB_SUPPORT") + ADD_DEFINITIONS("-DLB_SUPPORT") +ENDIF(LB_SUPPORT) + MESSAGE(STATUS "add -DSEP_INSTALLER") ADD_DEFINITIONS("-DSEP_INSTALLER") diff --git a/src/configuration_parser/widget_parser.cpp b/src/configuration_parser/widget_parser.cpp index 5ec1f8f..c64171b 100755 --- a/src/configuration_parser/widget_parser.cpp +++ b/src/configuration_parser/widget_parser.cpp @@ -1468,9 +1468,9 @@ class CategoryParser : public ElementParser class LiveboxParser : public ElementParser { - public: + public: - struct LabelParser : public ElementParser + struct BoxLabelParser : public ElementParser { virtual ActionFunc GetElementParser(const DPL::String& /*ns*/, const DPL::String& /*name*/) @@ -1482,40 +1482,40 @@ class LiveboxParser : public ElementParser { } - virtual void Accept(const Element& element) - { - if (element.ns == - ConfigurationNamespace::TizenWebAppNamespaceName) - { - m_properNamespace = true; - } - } + 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 Accept(const Text& text) + { + if(m_properNamespace) + m_label = text.value; + } virtual void Verify() { - m_data.m_label = m_label; + m_data.m_label = m_label; } - LabelParser(ConfigParserData::LiveboxInfo& data) : + BoxLabelParser(ConfigParserData::LiveboxInfo& data) : ElementParser(), - m_properNamespace(false), + m_properNamespace(false), m_data(data) { } - private: + private: DPL::String m_label; + bool m_properNamespace; ConfigParserData::LiveboxInfo& m_data; - bool m_properNamespace; }; - struct IconParser : public ElementParser + struct BoxIconParser : public ElementParser { virtual ActionFunc GetElementParser(const DPL::String& /*ns*/, const DPL::String& /*name*/) @@ -1525,20 +1525,20 @@ class LiveboxParser : public ElementParser virtual void Accept(const XmlAttribute& attribute) { - if(m_properNamespace) { - if (attribute.name == L"src") { - m_icon = attribute.value; + 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; - } + if (element.ns == + ConfigurationNamespace::TizenWebAppNamespaceName) + { + m_properNamespace = true; + } } virtual void Accept(const Text& /*text*/) @@ -1547,159 +1547,159 @@ class LiveboxParser : public ElementParser virtual void Verify() { - m_data.m_icon = m_icon; + m_data.m_icon = m_icon; } - explicit IconParser(ConfigParserData::LiveboxInfo& data) : - ElementParser(), - m_properNamespace(false), - m_data(data) + explicit BoxIconParser(ConfigParserData::LiveboxInfo& data) : + ElementParser(), + m_properNamespace(false), + m_data(data) { } - private: + private: DPL::String m_icon; + bool m_properNamespace; 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 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; - }; + struct BoxContentParser : public ElementParser + { + struct BoxSizeParser : 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 boxSize; + boxSize.first = m_size; + boxSize.second = m_preview; + m_data.m_boxSize.push_back(boxSize); + } + + explicit BoxSizeParser(ConfigParserData::LiveboxInfo::BoxContentInfo& data) : + ElementParser(), + m_data(data) + { + } + + private: + DPL::String m_size; + DPL::String m_preview; + bool m_properNamespace; + ConfigParserData::LiveboxInfo::BoxContentInfo& m_data; + }; + + 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::BoxContentInfo& 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::BoxContentInfo& 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); - } - } + if (name == L"box-size") { + return DPL::MakeDelegate(this, &LiveboxParser::BoxContentParser::OnBoxSizeElement); + } else if (name == L"pd") { + return DPL::MakeDelegate(this, &LiveboxParser::BoxContentParser::OnPdElement); + } + } virtual void Accept(const XmlAttribute& attribute) { - if (m_properNamespace) { - if (attribute.name == L"src") - m_box.m_boxSrc = attribute.value; - } + 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; - } + if (element.ns == + ConfigurationNamespace::TizenWebAppNamespaceName) + { + m_properNamespace = true; + } } virtual void Accept(const Text& /*text*/) @@ -1708,43 +1708,42 @@ class LiveboxParser : public ElementParser virtual void Verify() { - m_data.m_boxInfo = m_box; + m_data.m_boxInfo = m_box; } - explicit BoxParser(ConfigParserData::LiveboxInfo& data) : + explicit BoxContentParser(ConfigParserData::LiveboxInfo& data) : ElementParser(), - m_properNamespace(false), + m_properNamespace(false), m_data(data) { } - ElementParserPtr OnPdElement() + ElementParserPtr OnBoxSizeElement() { - return ElementParserPtr(new PdParser(m_box)); + return ElementParserPtr(new BoxSizeParser(m_box)); } - ElementParserPtr OnSizeElement() + ElementParserPtr OnPdElement() { - return ElementParserPtr(new SizeParser(m_box)); + return ElementParserPtr(new PdParser(m_box)); } - private: - DPL::String m_src; + private: + DPL::String m_src; + bool m_properNamespace; ConfigParserData::LiveboxInfo& m_data; - bool m_properNamespace; - ConfigParserData::LiveboxInfo::Box m_box; - + ConfigParserData::LiveboxInfo::BoxContentInfo 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); + const DPL::String& name) + { + if (name == L"box-label") { + return DPL::MakeDelegate(this, &LiveboxParser::OnBoxLabelElement); + } else if (name == L"box-icon") { + return DPL::MakeDelegate(this, &LiveboxParser::OnBoxIconElement); + } else if (name == L"box-content") { + return DPL::MakeDelegate(this, &LiveboxParser::OnBoxContentElement); } else { return &IgnoringParser::Create; } @@ -1753,29 +1752,22 @@ class LiveboxParser : public ElementParser 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("@@@ "< #include #include + #include #include diff --git a/src/jobs/widget_install/manifest.cpp b/src/jobs/widget_install/manifest.cpp index 8e6bf4b..12bdc92 100755 --- a/src/jobs/widget_install/manifest.cpp +++ b/src/jobs/widget_install/manifest.cpp @@ -306,28 +306,24 @@ void AppControl::serialize(xmlTextWriterPtr 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->liveboxId.empty()) { + writeAttribute(writer, "appid", this->liveboxId); } if(!this->primary.empty()) { writeAttribute(writer, "primary", this->primary); } - if(!this->timeout.empty()) { - writeAttribute(writer, "timeout", this->timeout); + if(!this->autoLaunch.empty()) { + writeAttribute(writer, "auto_launch", this->autoLaunch); } + + if(!this->updatePeriod.empty()) { + writeAttribute(writer, "period", this->updatePeriod); + } + + writeAttribute(writer, "abi", "html"); + writeAttribute(writer, "network", "true"); + writeAttribute(writer, "nodisplay", "false"); + if(!this->label.empty()) { startElement(writer, "label"); writeText(writer, this->label); diff --git a/src/jobs/widget_install/manifest.h b/src/jobs/widget_install/manifest.h index 0418a84..ac469d2 100755 --- a/src/jobs/widget_install/manifest.h +++ b/src/jobs/widget_install/manifest.h @@ -242,13 +242,10 @@ 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 setLiveboxId(const NcnameType &x) { this->liveboxId = x; } void setPrimary(const NcnameType &x) { this->primary = x; } - void setTimeout(const NcnameType &x) { this->timeout = x; } + void setAutoLaunch(const NcnameType &x) { this->autoLaunch = x; } + void setUpdatePeriod(const NcnameType &x) { this->updatePeriod = 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; } @@ -256,12 +253,10 @@ public: void serialize(xmlTextWriterPtr writer); private: - NcnameType appid; - NcnameType auto_launch; - NcnameType period; - NcnameType network; - NcnameType nodisplay; + NcnameType liveboxId; NcnameType primary; + NcnameType autoLaunch; + NcnameType updatePeriod; NcnameType timeout; NcnameType label; NcnameType icon; diff --git a/src/jobs/widget_install/task_manifest_file.cpp b/src/jobs/widget_install/task_manifest_file.cpp index 8e2965f..306024e 100755 --- a/src/jobs/widget_install/task_manifest_file.cpp +++ b/src/jobs/widget_install/task_manifest_file.cpp @@ -814,40 +814,38 @@ void TaskManifestFile::stepAbortParseManifest() void TaskManifestFile::setLiveBoxInfo(Manifest& manifest) { - FOREACH(it, m_context.widgetConfig.configInfo.m_livebox) { - LogInfo("setLiveBoxInfo"); LiveBoxInfo liveBox; - DPL::String pkgname; - DPL::Optional 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); + DPL::Optional ConfigInfo = *it; + DPL::String pkgname = *m_context.widgetConfig.pkgname; + size_t found; + + if(ConfigInfo->m_liveboxId != L"") { + found = ConfigInfo->m_liveboxId.find_first_of(L"."); + if(found != std::string::npos) { + if(0 == ConfigInfo->m_liveboxId.compare(0, found, pkgname)) + liveBox.setLiveboxId(ConfigInfo->m_liveboxId); + else { + DPL::String liveboxId = + pkgname+DPL::String(L".")+ConfigInfo->m_liveboxId; + liveBox.setLiveboxId(liveboxId); + } + } else { + DPL::String liveboxId = + pkgname+DPL::String(L".")+ConfigInfo->m_liveboxId; + liveBox.setLiveboxId(liveboxId); + } } - 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_autoLaunch !=L"") + liveBox.setAutoLaunch(ConfigInfo->m_autoLaunch); + + if(ConfigInfo->m_updatePeriod !=L"") + liveBox.setUpdatePeriod(ConfigInfo->m_updatePeriod); if(ConfigInfo->m_label !=L"") liveBox.setLabel(ConfigInfo->m_label); @@ -866,8 +864,8 @@ void TaskManifestFile::setLiveBoxInfo(Manifest& manifest) } 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"))) + if((0 == ConfigInfo->m_boxInfo.m_boxSrc.compare(0, 4, L"http")) + || (0 == ConfigInfo->m_boxInfo.m_boxSrc.compare(0, 5, L"https"))) box.boxSrc = ConfigInfo->m_boxInfo.m_boxSrc; else box.boxSrc = defaultLocale + ConfigInfo->m_boxInfo.m_boxSrc; -- 2.7.4