LogError("Failed to localize config.xml");
result = ConfigureResult::Failed_InvalidConfig;
}
+ Catch(Exceptions::WidgetConfigFileInvalid)
+ {
+ LogError("Invalid configuration file");
+ result = ConfigureResult::Failed_InvalidConfig;
+ }
+ Catch(DPL::Exception)
+ {
+ LogError("Unknown exception");
+ result = ConfigureResult::Failed;
+ }
return result;
}
void JobWidgetInstall::setApplicationType(
const WrtDB::ConfigParserData &configInfo)
{
+ AppType widgetAppType = APP_TYPE_UNKNOWN;
FOREACH(iterator, configInfo.nameSpaces) {
LogInfo("namespace = [" << *iterator << "]");
- AppType currentAppType = APP_TYPE_UNKNOWN;
- if (*iterator == ConfigurationNamespace::W3CWidgetNamespaceName) {
- continue;
+ if (*iterator == ConfigurationNamespace::TizenWebAppNamespaceName) {
+ if (widgetAppType != APP_TYPE_UNKNOWN &&
+ widgetAppType != APP_TYPE_TIZENWEBAPP)
+ {
+ LogError("To many namespaces declared in configuration fileA.");
+ ThrowMsg(Exceptions::WidgetConfigFileInvalid,
+ "Config.xml has more than one valid namespace");
+ }
+ widgetAppType = APP_TYPE_TIZENWEBAPP;
} else if (
*iterator ==
ConfigurationNamespace::WacWidgetNamespaceNameForLinkElement ||
*iterator ==
ConfigurationNamespace::WacWidgetNamespaceName)
{
- currentAppType = APP_TYPE_WAC20;
- } else if (*iterator ==
- ConfigurationNamespace::TizenWebAppNamespaceName)
- {
- currentAppType = APP_TYPE_TIZENWEBAPP;
- }
-
- if (m_installerContext.widgetConfig.webAppType ==
- APP_TYPE_UNKNOWN)
- {
- m_installerContext.widgetConfig.webAppType = currentAppType;
- } else if (m_installerContext.widgetConfig.webAppType ==
- currentAppType)
- {
- continue;
+ if (widgetAppType != APP_TYPE_UNKNOWN &&
+ widgetAppType != APP_TYPE_WAC20)
+ {
+ LogError("To many namespaces declared in configuration fileB.");
+ ThrowMsg(Exceptions::WidgetConfigFileInvalid,
+ "Config.xml has more than one valid namespace");
+ }
+ widgetAppType = APP_TYPE_WAC20;
} else {
- ThrowMsg(Exceptions::WidgetConfigFileInvalid,
- "Config.xml has more than one namespace");
+ LogDebug("Namespace ignored.");
}
}
- // If there is no define, type set to WAC 2.0
- if (m_installerContext.widgetConfig.webAppType == APP_TYPE_UNKNOWN) {
- m_installerContext.widgetConfig.webAppType = APP_TYPE_WAC20;
- }
+ m_installerContext.widgetConfig.webAppType = widgetAppType;
LogInfo("type = [" <<
m_installerContext.widgetConfig.webAppType.getApptypeToString() <<