{
status = OnNameValue(pCharacters);
}
+ else if (strcasecmp(pName, "DisplayName") == 0)
+ {
+ status = OnNameValue(pCharacters);
+ }
else if (strcasecmp(pName, "Author") == 0)
{
status = OnAuthorValue(pCharacters);
__pAppData = new (std::nothrow) AppData;
TryReturn(__pAppData, false, "[osp-installer] __pAppData is null");
+ AppLogTag(OSP_INSTALLER, "<UiApp>");
+
pAttr = GetAttribute();
TryReturn(pAttr, true, "[osp-installer] pAttr is null");
- char* pExecutableName = pAttr->Find("ExecutableName");
- if (pExecutableName == null)
- {
- pExecutableName = pAttr->Find("Name");
- }
- TryReturn(pExecutableName, true, "[osp-installer] pExecutableName is null");
-
- __pPackageAppInfoImpl->SetName(pExecutableName);
-
- char* pDefault = pAttr->Find("Default");
- if (pDefault)
- {
- __pPackageAppInfoImpl->SetDefault(pDefault);
-
- if (strcasecmp(pDefault, "True") == 0)
- {
- __isDefaultName = true;
- __isDefaultAppDetected = true;
- }
- }
- else
- {
- __pPackageAppInfoImpl->SetDefault("False");
- }
-
- __pPackageAppInfoImpl->SetType("UiApp");
-
- char* pMainmenuVisible = pAttr->Find("MainmenuVisible");
- if (pMainmenuVisible)
- {
- if (strcasecmp(pMainmenuVisible, "True") == 0)
- {
- __pPackageAppInfoImpl->SetMainmenuVisible(true);
- }
- else
- {
- __pPackageAppInfoImpl->SetMainmenuVisible(false);
- }
-
- AddAppFeature("MainmenuVisible", pMainmenuVisible);
- AppLogTag(OSP_INSTALLER, " - MainmenuVisible=%s", pMainmenuVisible);
- }
-
- char* pHwAcceleration = pAttr->Find("HwAcceleration");
- if (pHwAcceleration)
- {
- AddAppFeature("HwAcceleration", pHwAcceleration);
- AppLogTag(OSP_INSTALLER, " - HwAcceleration=%s", pHwAcceleration);
- }
- else
- {
- char* pGlFrame = pAttr->Find("GlFrame");
- if (pGlFrame)
- {
- AddAppFeature("GlFrame", pGlFrame);
- AppLogTag(OSP_INSTALLER, " - GlFrame=%s", pGlFrame);
- }
- }
-
- char* pCategory = pAttr->Find("Category");
- if (pCategory)
- {
- AppLogTag(OSP_INSTALLER, " - Category=%s", pCategory);
-
- if (strcasecmp(pCategory, "home-screen") == 0)
- {
- // __pCategoryList->Add(new String("home-screen"));
- __pAppData->__pCategoryList->Add(new String("http://tizen.org/category/homescreen"));
- }
- else if (strcasecmp(pCategory, "lock-screen") == 0)
- {
- // __pCategoryList->Add(new String("lock-screen"));
- __pAppData->__pCategoryList->Add(new String("http://tizen.org/category/lockscreen"));
- }
- else if (strcasecmp(pCategory, "Ime") == 0)
- {
- __pAppData->__pCategoryList->Add(new String("http://tizen.org/category/ime"));
- }
-
- CategoryType categoryType = InstallerUtil::GetCategoryType(pCategory);
- __pPackageAppInfoImpl->SetAppFeature(categoryType);
- }
-
- char* pSubMode = pAttr->Find("SubMode");
- if (pSubMode)
- {
- if (strcasecmp(pSubMode, "True") == 0)
- {
- __pContext->__isSubMode = true;
- AppLogTag(OSP_INSTALLER, " - SubMode=%s", pSubMode);
- }
- }
-
- String app_id;
- if (__pContext->GetPackageNameType() == INSTALLER_PREFIX_TYPE_ORG)
- {
- app_id.Format(1024, PACKAGE_NAME_RULE_ORG, __pPackageInfoImpl->GetAppId().GetPointer(), pExecutableName);
- }
- else
- {
- app_id.Format(1024, PACKAGE_NAME_RULE, __pPackageInfoImpl->GetAppId().GetPointer(), pExecutableName);
- }
-
- __pPackageAppInfoImpl->SetPackageName(app_id);
-
- AppLogTag(OSP_INSTALLER, "app_id = %S", app_id.GetPointer());
- AppLogTag(OSP_INSTALLER, "<UiApp Name=\"%s\" Default=\"%s\">", pExecutableName, pDefault ? pDefault:"False");
+ ParseAppAttribute(pAttr, true);
return true;
}
ManifestHandler::OnServiceAppStartElement(void)
{
XmlAttribute *pAttr = null;
- char *pExecutableName = null;
- char *pDefault = null;
- char *pMainmenuVisible = null;
- char *pLaunchOnBoot = null;
- char *pAutoRestart = null;
- char *pUseUi = null;
__pPackageAppInfoImpl = new _PackageAppInfoImpl;
TryReturn(__pPackageAppInfoImpl, false, "[osp-installer] __pPackageAppInfoImpl is null");
__pAppData = new (std::nothrow) AppData;
TryReturn(__pAppData, false, "[osp-installer] __pAppData is null");
+ AppLogTag(OSP_INSTALLER, "<ServiceApp>");
+
pAttr = GetAttribute();
TryReturn(pAttr, true, "pAttr is null");
- pExecutableName = pAttr->Find("ExecutableName");
- if (pExecutableName == null)
- {
- pExecutableName = pAttr->Find("Name");
- }
- TryReturn(pExecutableName, true, "[osp-installer] pExecutableName is null");
-
- __pPackageAppInfoImpl->SetName(pExecutableName);
-
- pDefault = pAttr->Find("Default");
- if (pDefault)
- {
- __pPackageAppInfoImpl->SetDefault(pDefault);
-
- if (strcasecmp(pDefault, "True") == 0)
- {
- __isDefaultName = true;
- __isDefaultAppDetected = true;
- }
- }
- else
- {
- __pPackageAppInfoImpl->SetDefault("False");
- }
-
- __pPackageAppInfoImpl->SetType("ServiceApp");
- __pPackageAppInfoImpl->SetMainmenuVisible(false);
-
- pMainmenuVisible = pAttr->Find("MainmenuVisible");
- if (pMainmenuVisible)
- {
- AddAppFeature("MainmenuVisible", pMainmenuVisible);
- AppLogTag(OSP_INSTALLER, "<MainmenuVisible=%s>", pMainmenuVisible);
- }
-
- pLaunchOnBoot = pAttr->Find("LaunchOnBoot");
- if (pLaunchOnBoot)
- {
- AddAppFeature("LaunchOnBoot", pLaunchOnBoot);
- AppLogTag(OSP_INSTALLER, "<LaunchOnBoot=%s>", pLaunchOnBoot);
- }
-
- pAutoRestart = pAttr->Find("AutoRestart");
- if (pAutoRestart)
- {
- AddAppFeature("AutoRestart", pAutoRestart);
- AppLogTag(OSP_INSTALLER, "<AutoRestart=%s>", pAutoRestart);
- }
-
- pUseUi = pAttr->Find("UseUi");
- if (pUseUi)
- {
- AddAppFeature("UseUi", pUseUi);
- AppLogTag(OSP_INSTALLER, "<UseUi=%s>", pUseUi);
- }
-
- char* pHwAcceleration = pAttr->Find("HwAcceleration");
- if (pHwAcceleration)
- {
- AddAppFeature("HwAcceleration", pHwAcceleration);
- AppLogTag(OSP_INSTALLER, " - HwAcceleration=%s", pHwAcceleration);
- }
- else
- {
- char* pGlFrame = pAttr->Find("GlFrame");
- if (pGlFrame)
- {
- AddAppFeature("GlFrame", pGlFrame);
- AppLogTag(OSP_INSTALLER, " - GlFrame=%s", pGlFrame);
- }
- }
-
- String app_id;
-
- if (__pContext->GetPackageNameType() == INSTALLER_PREFIX_TYPE_ORG)
- {
- app_id.Format(1024, PACKAGE_NAME_RULE_ORG, __pPackageInfoImpl->GetAppId().GetPointer(), pExecutableName);
- }
- else
- {
- app_id.Format(1024, PACKAGE_NAME_RULE, __pPackageInfoImpl->GetAppId().GetPointer(), pExecutableName);
- }
-
- __pPackageAppInfoImpl->SetPackageName(app_id);
-
- AppLogTag(OSP_INSTALLER, "app_id = %S", app_id.GetPointer());
- AppLogTag(OSP_INSTALLER, "<ServiceApp Name=\"%s\" Default=\"%s\">", pExecutableName, pDefault ? pDefault:"False");
+ ParseAppAttribute(pAttr, false);
return true;
}
}
}
- AppLogTag(OSP_INSTALLER, "<Name Locale=\"%s\">%s</Name>", pAttrValue, pCharacters);
+ AppLogTag(OSP_INSTALLER, "<DisplayName Locale=\"%s\">%s</DisplayName>", pAttrValue, pCharacters);
return true;
}
return true;
}
+
+bool
+ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp)
+{
+ char* pName = pAttr->Find("Name");
+ if (pName == null)
+ {
+ pName = pAttr->Find("ExecutableName");
+ }
+
+ if (pName)
+ {
+ AppLogTag(OSP_INSTALLER, " - Name=%s", pName);
+ __pPackageAppInfoImpl->SetName(pName);
+ }
+
+ char* pMain = pAttr->Find("Main");
+ if (pMain == null)
+ {
+ pMain = pAttr->Find("Default");
+ }
+
+ if (pMain)
+ {
+ AppLogTag(OSP_INSTALLER, " - Main=%s", pMain);
+
+ __pPackageAppInfoImpl->SetDefault(pMain);
+
+ if (strcasecmp(pMain, "True") == 0)
+ {
+ __isDefaultName = true;
+ __isDefaultAppDetected = true;
+ }
+ }
+ else
+ {
+ __pPackageAppInfoImpl->SetDefault("False");
+ }
+
+ char* pHwAcceleration = pAttr->Find("HwAcceleration");
+ if (pHwAcceleration)
+ {
+ AddAppFeature("HwAcceleration", pHwAcceleration);
+ AppLogTag(OSP_INSTALLER, " - HwAcceleration=%s", pHwAcceleration);
+ }
+ else
+ {
+ char* pGlFrame = pAttr->Find("GlFrame");
+ if (pGlFrame)
+ {
+ AddAppFeature("GlFrame", pGlFrame);
+ AppLogTag(OSP_INSTALLER, " - GlFrame=%s", pGlFrame);
+ }
+ }
+
+ char* pCategory = pAttr->Find("Category");
+ if (pCategory)
+ {
+ AppLogTag(OSP_INSTALLER, " - Category=%s", pCategory);
+
+ if (strcasecmp(pCategory, "home-screen") == 0)
+ {
+ __pAppData->__pCategoryList->Add(new String("http://tizen.org/category/homescreen"));
+ }
+ else if (strcasecmp(pCategory, "lock-screen") == 0)
+ {
+ __pAppData->__pCategoryList->Add(new String("http://tizen.org/category/lockscreen"));
+ }
+ else if (strcasecmp(pCategory, "Ime") == 0)
+ {
+ __pAppData->__pCategoryList->Add(new String("http://tizen.org/category/ime"));
+ }
+
+ CategoryType categoryType = InstallerUtil::GetCategoryType(pCategory);
+ __pPackageAppInfoImpl->SetAppFeature(categoryType);
+ }
+
+ char* pSubMode = pAttr->Find("SubMode");
+ if (pSubMode)
+ {
+ if (strcasecmp(pSubMode, "True") == 0)
+ {
+ __pContext->__isSubMode = true;
+ AppLogTag(OSP_INSTALLER, " - SubMode=%s", pSubMode);
+ }
+ }
+
+ if (isUiApp == true)
+ {
+ __pPackageAppInfoImpl->SetType("UiApp");
+
+ char* pMenuIconVisible = pAttr->Find("MenuIconVisible");
+ if (pMenuIconVisible == null)
+ {
+ pMenuIconVisible = pAttr->Find("MainmenuVisible");
+ }
+
+ if (pMenuIconVisible)
+ {
+ if (strcasecmp(pMenuIconVisible, "True") == 0)
+ {
+ __pPackageAppInfoImpl->SetMainmenuVisible(true);
+ }
+ else
+ {
+ __pPackageAppInfoImpl->SetMainmenuVisible(false);
+ }
+
+ AddAppFeature("MenuIconVisible", pMenuIconVisible);
+ AppLogTag(OSP_INSTALLER, " - MenuIconVisible=%s", pMenuIconVisible);
+ }
+ }
+ else
+ {
+ __pPackageAppInfoImpl->SetType("ServiceApp");
+ __pPackageAppInfoImpl->SetMainmenuVisible(false);
+
+ char *pUseUi = pAttr->Find("UseUi");
+ if (pUseUi)
+ {
+ AddAppFeature("UseUi", pUseUi);
+ AppLogTag(OSP_INSTALLER, " - UseUi=%s", pUseUi);
+ }
+
+ char *pLaunchOnBoot = pAttr->Find("LaunchOnBoot");
+ if (pLaunchOnBoot)
+ {
+ AddAppFeature("LaunchOnBoot", pLaunchOnBoot);
+ AppLogTag(OSP_INSTALLER, " - LaunchOnBoot=%s", pLaunchOnBoot);
+ }
+
+ char *pAutoRestart = pAttr->Find("AutoRestart");
+ if (pAutoRestart)
+ {
+ AddAppFeature("AutoRestart", pAutoRestart);
+ AppLogTag(OSP_INSTALLER, " - AutoRestart=%s", pAutoRestart);
+ }
+ }
+
+ String appId;
+ appId.Format(1024, PACKAGE_NAME_RULE, __pPackageInfoImpl->GetAppId().GetPointer(), pName);
+ __pPackageAppInfoImpl->SetPackageName(appId);
+
+ AppLogTag(OSP_INSTALLER, " - appId=%ls", appId.GetPointer());
+
+ return true;
+}