2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file task_widget_config.cpp
18 * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
20 * @brief Implementation file for installer task widget config
28 #include <dpl/errno_string.h>
29 #include <dpl/foreach.h>
30 #include <dpl/localization/w3c_file_localization.h>
31 #include <dpl/singleton_impl.h>
32 #include <dpl/utils/mime_type_utils.h>
33 #include <dpl/utils/wrt_global_settings.h>
34 #include <dpl/utils/wrt_utility.h>
35 #include <dpl/wrt-dao-ro/global_config.h>
36 #include <dpl/wrt-dao-rw/feature_dao.h>
38 #include <libiriwrapper.h>
39 #include <parser_runner.h>
40 #include <root_parser.h>
42 #include <widget_install/job_widget_install.h>
43 #include <widget_install/task_widget_config.h>
44 #include <widget_install/widget_install_context.h>
45 #include <widget_install/widget_install_errors.h>
46 #include <widget_parser.h>
47 #include <wrt_error.h>
50 namespace { // anonymous
51 const WidgetHandle WIDGET_HANDLE_START_VALUE = 1000;
52 const DPL::String BR = DPL::FromUTF8String("<br>");
53 const std::string WIDGET_NOT_COMPATIBLE = "This widget is "
54 "not compatible with WRT.<br><br>";
55 const std::string QUESTION = "Do you want to install it anyway?";
57 const char *const DEFAULT_LANGUAGE = "default";
59 const char *const WRT_WIDGET_CONFIG_FILE_NAME = "config.xml";
61 const std::string WINDGET_INSTALL_NETWORK_ACCESS = "network access";
66 namespace WidgetInstall {
67 void InstallerTaskWidgetPopupData::PopupData::addWidgetInfo(
68 const DPL::String &info)
73 TaskWidgetConfig::TaskWidgetConfig(InstallerContext& installContext) :
74 DPL::TaskDecl<TaskWidgetConfig>(this),
75 m_installContext(installContext),
76 WidgetInstallPopup(installContext)
78 AddStep(&TaskWidgetConfig::StepProcessConfigurationFile);
79 AddStep(&TaskWidgetConfig::ReadLocaleFolders);
80 AddStep(&TaskWidgetConfig::ProcessLocalizedStartFiles);
81 AddStep(&TaskWidgetConfig::ProcessBackgroundPageFile);
82 AddStep(&TaskWidgetConfig::ProcessLocalizedIcons);
83 AddStep(&TaskWidgetConfig::StepVerifyFeatures);
85 if (!GlobalSettings::TestModeEnabled() && !m_installContext.m_quiet) {
86 AddStep(&TaskWidgetConfig::StepCancelWidgetInstallationAfterVerifyFeatures);
87 AddStep(&TaskWidgetConfig::StepShowWidgetInfo);
88 AddStep(&TaskWidgetConfig::StepCancelWidgetInstallation);
89 AddStep(&TaskWidgetConfig::StepCheckMinVersionInfo);
90 AddStep(&TaskWidgetConfig::StepCancelWidgetInstallationAfterMinVersion);
91 AddStep(&TaskWidgetConfig::StepDeletePopupWin);
95 void TaskWidgetConfig::StepProcessConfigurationFile()
99 std::string path = m_installContext.locations->getConfigurationDir();
100 LogInfo("path: " << path);
102 processFile(path, m_installContext.widgetConfig);
104 Catch(Exception::ConfigParseFailed)
106 LogError("Parsing failed.");
107 ReThrow(Exceptions::WidgetConfigFileInvalid);
111 // To get widget type for distribute WAC, TIZEN WebApp
112 setApplicationType();
114 Catch(Exception::ConfigParseFailed)
116 LogError("Config.xml has more than one namespace");
117 ReThrow(Exceptions::WidgetConfigFileInvalid);
120 m_installContext.job->UpdateProgress(
121 InstallerContext::INSTALL_WIDGET_CONFIG1,
122 "Parse elements of configuration file and save them");
125 void TaskWidgetConfig::ReadLocaleFolders()
127 LogDebug("Reading locale");
128 //Adding default locale
129 m_localeFolders.insert(L"");
131 std::string localePath = m_installContext.locations->getConfigurationDir() + "/locales";
132 DIR* localeDir = opendir(localePath.c_str());
134 LogDebug("No /locales directory in the widget package.");
138 struct dirent* dirent;
139 struct stat statStruct;
142 if ((dirent = readdir(localeDir))) {
143 DPL::String dirName = DPL::FromUTF8String(dirent->d_name);
144 std::string absoluteDirName = localePath + "/";
145 absoluteDirName += dirent->d_name;
147 if (stat(absoluteDirName.c_str(), &statStruct) != 0) {
148 LogError("stat() failed with " << DPL::GetErrnoString());
152 if (S_ISDIR(statStruct.st_mode)) {
153 //Yes, we ignore current, parent & hidden directories
154 if (dirName[0] != L'.') {
155 LogDebug("Adding locale directory \"" << dirName << "\"");
156 m_localeFolders.insert(dirName);
164 LogError("readdir() failed with " << DPL::GetErrnoString());
167 if (closedir(localeDir)) {
168 LogError("closedir() failed with " << DPL::GetErrnoString());
172 void TaskWidgetConfig::ProcessLocalizedStartFiles()
174 typedef DPL::String S;
176 m_installContext.widgetConfig.configInfo.startFile,
177 m_installContext.widgetConfig.configInfo.
178 startFileContentType,
179 m_installContext.widgetConfig.configInfo.startFileEncoding,
181 ProcessStartFile(S(L"index.htm"), S(L"text/html"));
182 ProcessStartFile(S(L"index.html"), S(L"text/html"));
183 ProcessStartFile(S(L"index.svg"), S(L"image/svg+xml"));
184 ProcessStartFile(S(L"index.xhtml"), S(L"application/xhtml+xml"));
185 ProcessStartFile(S(L"index.xht"), S(L"application/xhtml+xml"));
186 // TODO: (l.wrzosek) we need better check if in current locales widget is valid.
187 FOREACH(it, m_installContext.widgetConfig.localizationData.startFiles) {
188 if (it->propertiesForLocales.size() > 0) {
192 ThrowMsg(Exceptions::WidgetConfigFileInvalid,
193 L"The Widget has no valid start file");
196 void TaskWidgetConfig::ProcessStartFile(const DPL::OptionalString& path,
197 const DPL::OptionalString& type,
198 const DPL::OptionalString& encoding,
199 bool typeForcedInConfig)
201 using namespace WrtDB;
204 WidgetRegisterInfo::LocalizedStartFile startFileData;
205 startFileData.path = *path;
207 FOREACH(i, m_localeFolders) {
208 DPL::String pathPrefix = *i;
209 if (!pathPrefix.empty()) {
210 pathPrefix = L"locales/" + pathPrefix + L"/";
213 DPL::String relativePath = pathPrefix + *path;
214 DPL::String absolutePath = DPL::FromUTF8String(
215 m_installContext.locations->getConfigurationDir()) + L"/" + relativePath;
217 // get property data from packaged app
218 if (WrtUtilFileExists(DPL::ToUTF8String(absolutePath))) {
219 WidgetRegisterInfo::StartFileProperties startFileProperties;
221 startFileProperties.type = *type;
223 startFileProperties.type =
224 MimeTypeUtils::identifyFileMimeType(absolutePath);
227 //proceed only if MIME type is supported
228 if (MimeTypeUtils::isMimeTypeSupportedForStartFile(
229 startFileProperties.type))
232 startFileProperties.encoding = *encoding;
234 MimeTypeUtils::MimeAttributes attributes =
235 MimeTypeUtils::getMimeAttributes(
236 startFileProperties.type);
237 if (attributes.count(L"charset") > 0) {
238 startFileProperties.encoding =
239 attributes[L"charset"];
241 startFileProperties.encoding = L"UTF-8";
245 startFileData.propertiesForLocales[*i] =
249 //(there seems to be no similar requirement in .6,
250 //so let's throw only when mime type is
251 // provided explcitly in config.xml)
252 if (typeForcedInConfig) {
253 ThrowMsg(Exceptions::WidgetConfigFileInvalid,
254 "Unsupported MIME type for start file.");
258 // set property data for hosted start url
259 // Hosted start url only support TIZEN WebApp
260 if (m_installContext.widgetConfig.type ==
261 APP_TYPE_TIZENWEBAPP)
263 const char *startPath =
264 DPL::ToUTF8String(startFileData.path).c_str();
265 if (strstr(startPath, "http") == startPath) {
266 WidgetRegisterInfo::StartFileProperties
269 startFileProperties.type = *type;
272 startFileProperties.encoding = *encoding;
274 startFileData.propertiesForLocales[*i] =
281 m_installContext.widgetConfig.localizationData.startFiles.push_back(
286 void TaskWidgetConfig::ProcessBackgroundPageFile()
288 if (!!m_installContext.widgetConfig.configInfo.backgroundPage) {
289 // check whether file exists
290 DPL::String backgroundPagePath = DPL::FromUTF8String(
291 m_installContext.locations->getConfigurationDir()) + L"/" +
292 *m_installContext.widgetConfig.configInfo.backgroundPage;
293 //if no then cancel installation
294 if (!WrtUtilFileExists(DPL::ToUTF8String(backgroundPagePath))) {
295 ThrowMsg(Exceptions::WidgetConfigFileInvalid,
296 L"Given background page file not found in archive");
301 void TaskWidgetConfig::ProcessLocalizedIcons()
303 using namespace WrtDB;
304 ProcessIcon(ConfigParserData::Icon(L"icon.svg"));
305 ProcessIcon(ConfigParserData::Icon(L"icon.ico"));
306 ProcessIcon(ConfigParserData::Icon(L"icon.png"));
307 ProcessIcon(ConfigParserData::Icon(L"icon.gif"));
308 ProcessIcon(ConfigParserData::Icon(L"icon.jpg"));
310 FOREACH(i, m_installContext.widgetConfig.configInfo.iconsList)
316 void TaskWidgetConfig::ProcessIcon(const WrtDB::ConfigParserData::Icon& icon)
319 bool isAnyIconValid = false;
320 //In case a default filename is passed as custom filename in config.xml, we
321 //need to keep a set of already processed filenames to avoid icon duplication
324 using namespace WrtDB;
326 if (m_processedIconSet.count(icon.src) > 0) {
329 m_processedIconSet.insert(icon.src);
331 LocaleSet localesAvailableForIcon;
333 FOREACH(i, m_localeFolders)
335 DPL::String pathPrefix = *i;
336 if (!pathPrefix.empty()) {
337 pathPrefix = L"locales/" + pathPrefix + L"/";
340 DPL::String relativePath = pathPrefix + icon.src;
341 DPL::String absolutePath = DPL::FromUTF8String(
342 m_installContext.locations->getConfigurationDir()) + L"/" + relativePath;
344 if (WrtUtilFileExists(DPL::ToUTF8String(absolutePath))) {
345 DPL::String type = MimeTypeUtils::identifyFileMimeType(absolutePath);
347 if (MimeTypeUtils::isMimeTypeSupportedForIcon(type)) {
348 isAnyIconValid = true;
349 localesAvailableForIcon.insert(*i);
350 LogInfo("Icon absolutePath :" << absolutePath <<
351 ", assigned locale :" << *i << ", type: " << type);
358 WidgetRegisterInfo::LocalizedIcon localizedIcon(icon,
359 localesAvailableForIcon);
360 m_installContext.widgetConfig.localizationData.icons.push_back(
365 void TaskWidgetConfig::StepCancelWidgetInstallationAfterVerifyFeatures()
367 LogDebug("StepCancelWidgetInstallationAfterVerifyFeatures");
368 if (InfoPopupButton::WRT_POPUP_BUTTON_CANCEL == m_installCancel) {
369 m_installCancel = WRT_POPUP_BUTTON;
371 ThrowMsg(Exceptions::WidgetConfigFileInvalid, "Widget not allowed");
375 void TaskWidgetConfig::StepCancelWidgetInstallation()
377 if (InfoPopupButton::WRT_POPUP_BUTTON_CANCEL == m_installCancel) {
378 m_installCancel = WRT_POPUP_BUTTON;
380 ThrowMsg(Exceptions::NotAllowed, "Widget not allowed");
384 void TaskWidgetConfig::StepCancelWidgetInstallationAfterMinVersion()
386 if (InfoPopupButton::WRT_POPUP_BUTTON_CANCEL == m_installCancel) {
387 m_installCancel = WRT_POPUP_BUTTON;
389 ThrowMsg(Exceptions::NotAllowed, "WRT version incompatible.");
393 void TaskWidgetConfig::createInstallPopup(PopupType type, const std::string &label)
395 m_installContext.job->Pause();
399 bool ret = createPopup();
402 loadPopup( type, label);
407 void TaskWidgetConfig::StepDeletePopupWin()
412 void TaskWidgetConfig::StepShowWidgetInfo()
414 if (!m_popupData.widgetInfo.empty()) {
415 std::string label = DPL::ToUTF8String(m_popupData.widgetInfo);
416 createInstallPopup(PopupType::WIDGET_FEATURE_INFO, label);
417 m_installContext.job->UpdateProgress(
418 InstallerContext::INSTALL_WIDGET_CONFIG2,
419 "Show Widget Info Finished");
423 void TaskWidgetConfig::StepCheckMinVersionInfo()
425 if (!isMinVersionCompatible(
426 m_installContext.widgetConfig.type.appType,
427 m_installContext.widgetConfig.minVersion)) {
428 std::string label = WIDGET_NOT_COMPATIBLE + QUESTION;
429 createInstallPopup(PopupType::WIDGET_MIN_VERSION, label);
432 m_installContext.job->UpdateProgress(
433 InstallerContext::INSTALL_WIDGET_CONFIG2,
434 "Check MinVersion Finished");
437 void TaskWidgetConfig::StepVerifyFeatures()
439 using namespace WrtDB;
440 ConfigParserData &data = m_installContext.widgetConfig.configInfo;
441 ConfigParserData::FeaturesList list = data.featuresList;
442 ConfigParserData::FeaturesList newList;
444 //in case of tests, this variable is unused
445 std::string featureInfo;
448 // check feature vender for permission
449 // WAC, TIZEN WebApp cannot use other feature
451 if (!isFeatureAllowed(m_installContext.widgetConfig.type.appType,
454 LogInfo("This application type not allowed to use this feature");
456 Exceptions::WidgetConfigFileInvalid,
458 m_installContext.widgetConfig.type.getApptypeToString() <<
459 "] cannot be allowed to use [" <<
460 DPL::ToUTF8String(it->name) + "] feature");
462 if (!WrtDB::FeatureDAOReadOnly::isFeatureInstalled(
463 DPL::ToUTF8String(it->name))) {
464 LogWarning("Feature not found. Checking if required :[" <<
465 DPL::ToUTF8String(it->name) << "]");
469 * WL-3210 The WRT MUST inform the user if a widget cannot be
470 * installed because one or more required features are not
473 std::ostringstream os;
474 os << "Widget cannot be installed, required feature is missing:["
475 << DPL::ToUTF8String(it->name) << "]";
476 if (!GlobalSettings::TestModeEnabled() && !isTizenWebApp()) {
477 std::string label = os.str();
478 createInstallPopup(PopupType::WIDGET_WRONG_FEATURE_INFO, label);
480 ThrowMsg(Exceptions::WidgetConfigFileInvalid, os.str());
484 featureInfo += DPL::ToUTF8String(it->name);
485 featureInfo += DPL::ToUTF8String(BR);
488 if(!data.accessInfoSet.empty()) {
489 featureInfo += WINDGET_INSTALL_NETWORK_ACCESS;
490 featureInfo += DPL::ToUTF8String(BR);
492 data.featuresList = newList;
493 if (!featureInfo.empty()) {
494 m_popupData.addWidgetInfo(DPL::FromUTF8String(featureInfo));
497 m_installContext.job->UpdateProgress(
498 InstallerContext::INSTALL_WIDGET_CONFIG2,
499 "Widget Config step2 Finished");
502 void TaskWidgetConfig::setApplicationType()
504 using namespace WrtDB;
505 WidgetRegisterInfo* widgetInfo = &(m_installContext.widgetConfig);
506 ConfigParserData* configInfo = &(widgetInfo->configInfo);
508 FOREACH(iterator, configInfo->nameSpaces) {
509 LogInfo("namespace = [" << *iterator << "]");
510 AppType currentAppType = APP_TYPE_UNKNOWN;
512 if (*iterator == ConfigurationNamespace::W3CWidgetNamespaceName) {
516 ConfigurationNamespace::WacWidgetNamespaceNameForLinkElement ||
518 ConfigurationNamespace::WacWidgetNamespaceName)
520 currentAppType = APP_TYPE_WAC20;
521 } else if (*iterator == ConfigurationNamespace::TizenWebAppNamespaceName) {
522 currentAppType = APP_TYPE_TIZENWEBAPP;
525 if (widgetInfo->type == APP_TYPE_UNKNOWN) {
526 widgetInfo->type = currentAppType;
527 } else if (widgetInfo->type == currentAppType) {
530 ThrowMsg(Exceptions::WidgetConfigFileInvalid,
531 "Config.xml has more than one namespace");
535 // If there is no define, type set to WAC 2.0
536 if (widgetInfo->type == APP_TYPE_UNKNOWN) {
537 widgetInfo->type = APP_TYPE_WAC20;
540 LogInfo("type = [" << widgetInfo->type.getApptypeToString() << "]");
543 bool TaskWidgetConfig::isFeatureAllowed(WrtDB::AppType appType,
544 DPL::String featureName)
546 using namespace WrtDB;
547 LogInfo("AppType = [" <<
548 WidgetType(appType).getApptypeToString() << "]");
549 LogInfo("FetureName = [" << featureName << "]");
551 AppType featureType = APP_TYPE_UNKNOWN;
552 const char* feature = DPL::ToUTF8String(featureName).c_str();
553 // check prefix of feature name
554 if (strstr(feature, PluginsPrefix::TIZENPluginsPrefix) == feature) {
555 // Tizen WebApp feature
556 featureType = APP_TYPE_TIZENWEBAPP;
557 } else if (strstr(feature, PluginsPrefix::WACPluginsPrefix) == feature) {
559 featureType = APP_TYPE_WAC20;
560 } else if (strstr(feature, PluginsPrefix::W3CPluginsPrefix) == feature) {
561 // W3C standard feature
562 // Both WAC and TIZEN WebApp are possible to use W3C plugins
566 // unknown feature will be checked next step
570 if (appType == featureType) {
576 bool TaskWidgetConfig::parseVersionString(const std::string &version,
577 long &majorVersion, long &minorVersion, long µVersion) const
579 std::istringstream inputString(version);
580 inputString >> majorVersion;
581 if (inputString.bad() || inputString.fail()) {
582 LogWarning("Invalid minVersion format.");
585 inputString.get(); // skip period
586 inputString >> minorVersion;
587 if (inputString.bad() || inputString.fail()) {
588 LogWarning("Invalid minVersion format");
591 inputString.get(); // skip period
592 if (inputString.bad() || inputString.fail()) {
593 inputString >> microVersion;
599 bool TaskWidgetConfig::isMinVersionCompatible(WrtDB::AppType appType,
600 const DPL::OptionalString &widgetVersion) const
602 if (widgetVersion.IsNull() || (*widgetVersion).empty())
604 LogWarning("minVersion attribute is empty. WRT assumes platform "
605 "supports this widget.");
609 //Parse widget version
610 long majorWidget = 0, minorWidget = 0, microWidget = 0;
611 if (!parseVersionString(DPL::ToUTF8String(*widgetVersion), majorWidget,
612 minorWidget, microWidget)) {
613 LogWarning("Invalid format of widget version string.");
617 //Parse supported version
618 long majorSupported = 0, minorSupported = 0, microSupported = 0;
620 if (appType == WrtDB::AppType::APP_TYPE_TIZENWEBAPP) {
621 version = WrtDB::GlobalConfig::GetTizenVersion();
622 } else if (appType == WrtDB::AppType::APP_TYPE_WAC20) {
623 version = WrtDB::GlobalConfig::GetWACVersion();
625 LogWarning("Invaild AppType");
629 if (!parseVersionString(version,
630 majorSupported, minorSupported, microSupported)) {
631 LogWarning("Invalid format of WAC version string.");
635 if (majorWidget > majorSupported ||
636 minorWidget > minorSupported ||
637 microWidget > microSupported) {
638 LogInfo("Platform doesn't support this widget.");
644 bool TaskWidgetConfig::isTizenWebApp() const
647 if (m_installContext.widgetConfig.type.appType
648 == WrtDB::AppType::APP_TYPE_TIZENWEBAPP)
654 bool TaskWidgetConfig::parseConfigurationFileBrowser(WrtDB::ConfigParserData& configInfo,
655 const std::string& _currentPath, int* pErrCode)
660 parser.Parse(_currentPath, ElementParserPtr(new
664 DPL::FromUTF32String(
667 Catch(ElementParser::Exception::Base)
669 LogDebug("Invalid widget configuration file!");
670 *pErrCode = WRT_WM_ERR_INVALID_ARCHIVE;
676 bool TaskWidgetConfig::parseConfigurationFileWidget(WrtDB::ConfigParserData& configInfo,
677 const std::string& _currentPath, int* pErrCode)
681 //TODO: rewrite this madness
682 std::string cfgAbsPath;
684 struct dirent* ptr = NULL;
686 dir = opendir(_currentPath.c_str());
688 *pErrCode = WRT_ERR_UNKNOWN;
691 bool has_config_xml = false;
693 while ((ptr = readdir(dir)) != NULL) { //Find configuration file, based on its name
694 if (ptr->d_type == DT_REG) {
695 if (!strcmp(ptr->d_name, WRT_WIDGET_CONFIG_FILE_NAME)) {
696 std::string dName(ptr->d_name);
697 WrtUtilJoinPaths(cfgAbsPath, _currentPath, dName);
699 //Parse widget configuration file
700 LogDebug("Found config: " << cfgAbsPath);
704 parser.Parse(cfgAbsPath, ElementParserPtr(new
713 Catch(ElementParser::Exception::Base)
715 LogDebug("Invalid widget configuration file!");
716 // _rethrown_exception.Dump();
717 *pErrCode = WRT_WM_ERR_INVALID_ARCHIVE;
722 has_config_xml = true;
729 //We must have config.xml so leaveing if we doesn't
730 if (!has_config_xml) {
731 LogDebug("Invalid archive");
732 *pErrCode = WRT_WM_ERR_INVALID_ARCHIVE;
738 bool TaskWidgetConfig::locateAndParseConfigurationFile(
739 const std::string& _currentPath,
740 WrtDB::WidgetRegisterInfo& pWidgetConfigInfo,
741 const std::string& baseFolder,
744 using namespace WrtDB;
750 ConfigParserData& configInfo = pWidgetConfigInfo.configInfo;
752 // check if this installation from browser, or not.
753 size_t pos = _currentPath.rfind("/");
754 std::ostringstream infoPath;
755 infoPath << _currentPath.substr(pos+1);
757 if (infoPath.str() != WRT_WIDGET_CONFIG_FILE_NAME) {
758 if (_currentPath.empty() || baseFolder.empty()) {
759 *pErrCode = WRT_ERR_INVALID_ARG;
762 // in case of general installation using wgt archive
763 if(!parseConfigurationFileWidget(configInfo, _currentPath, pErrCode))
768 // in case of browser installation
769 if(!parseConfigurationFileBrowser(configInfo, _currentPath, pErrCode))
775 if(!fillWidgetConfig(pWidgetConfigInfo, configInfo))
777 *pErrCode = WRT_WM_ERR_INVALID_ARCHIVE;
783 bool TaskWidgetConfig::fillWidgetConfig(WrtDB::WidgetRegisterInfo& pWidgetConfigInfo,
784 WrtDB::ConfigParserData& configInfo)
786 if (!!configInfo.widget_id) {
787 if (!pWidgetConfigInfo.guid) {
788 pWidgetConfigInfo.guid = configInfo.widget_id;
790 if (pWidgetConfigInfo.guid != configInfo.widget_id) {
791 LogDebug("Invalid archive");
796 if (!!configInfo.tizenId) {
797 if (!pWidgetConfigInfo.pkgname) {
798 pWidgetConfigInfo.pkgname = configInfo.tizenId;
800 if (pWidgetConfigInfo.pkgname != configInfo.tizenId) {
801 LogDebug("Invalid archive - Tizen ID not same error");
806 if (!!configInfo.version) {
807 if (!pWidgetConfigInfo.version) {
808 pWidgetConfigInfo.version = configInfo.version;
810 if (pWidgetConfigInfo.version != configInfo.version) {
811 LogDebug("Invalid archive");
816 if (!!configInfo.minVersionRequired) {
817 pWidgetConfigInfo.minVersion = configInfo.minVersionRequired;
818 } else if (!!configInfo.tizenMinVersionRequired) {
819 pWidgetConfigInfo.minVersion = configInfo.tizenMinVersionRequired;
824 void TaskWidgetConfig::processFile(const std::string& path,
825 WrtDB::WidgetRegisterInfo &widgetConfiguration)
829 if (!locateAndParseConfigurationFile(path, widgetConfiguration,
830 DEFAULT_LANGUAGE, &pErrCode)) {
831 LogWarning("Widget archive: Failed while parsing config file");
832 ThrowMsg(Exception::ConfigParseFailed, path);
836 } //namespace WidgetInstall