#include <widget_install/widget_install_context.h>
#include <widget_install/widget_install_errors.h>
#include <widget_parser.h>
+#include <web_provider_plugin_info.h>
+#include <web_provider_livebox_info.h>
+#include <manifest.h>
namespace { // anonymous
const DPL::String BR = DPL::FromUTF8String("<br>");
AddStep(&TaskWidgetConfig::ProcessAppControlInfo);
AddStep(&TaskWidgetConfig::ProcessSecurityModel);
AddStep(&TaskWidgetConfig::StepVerifyFeatures);
+ AddStep(&TaskWidgetConfig::StepVerifyLivebox);
AddStep(&TaskWidgetConfig::StepCheckMinVersionInfo);
}
"Widget Config step2 Finished");
}
+void TaskWidgetConfig::StepVerifyLivebox()
+{
+ using namespace WrtDB;
+ ConfigParserData &data = m_installContext.widgetConfig.configInfo;
+ ConfigParserData::LiveboxList liveBoxList = data.m_livebox;
+
+ if (liveBoxList.size() <= 0) {
+ return;
+ }
+
+ FOREACH (it, liveBoxList) {
+ std::string boxType;
+
+ if ((**it).m_type.empty()) {
+ boxType = web_provider_livebox_get_default_type();
+ } else {
+ boxType = DPL::ToUTF8String((**it).m_type);
+ }
+
+ LogInfo("livebox type: " << boxType);
+
+ boxSizeType boxSizeList = (**it).m_boxInfo.m_boxSize;
+ char** boxSize = static_cast<char**>(
+ malloc(sizeof(char*)* boxSizeList.size()));
+
+ int boxSizeCnt = 0;
+ FOREACH (m, boxSizeList) {
+ boxSize[boxSizeCnt++] = strdup(DPL::ToUTF8String((*m).first).c_str());
+ }
+
+ bool chkSize = web_provider_plugin_check_supported_size(
+ boxType.c_str(), boxSize, boxSizeCnt);
+
+ for(int i = 0; i < boxSizeCnt; i++) {
+ delete[] boxSize[i];
+ }
+
+ if(!chkSize) {
+ LogError("Invalid boxSize");
+ ThrowMsg(Exceptions::WidgetConfigFileInvalid, "Invalid boxSize");
+ }
+ }
+}
+
bool TaskWidgetConfig::isFeatureAllowed(WrtDB::AppType appType,
DPL::String featureName)
{