From 5f1abc7f04f7ad99f6495cea41d01d3a8afb0e56 Mon Sep 17 00:00:00 2001 From: Duyoung Jang Date: Thu, 18 Oct 2012 15:43:51 +0900 Subject: [PATCH] Create Livebox information in xml Change-Id: Ie55cd188066657f943ed28dad6737157870742ed --- inc/InstallerDefs.h | 5 +- src/Context/InstallationContext.cpp | 127 +++++++++++++++++++++++- src/Context/InstallationContext.h | 40 ++++++++ src/Manager/SignatureManager.cpp | 42 ++++---- src/Manager/SignatureManager.h | 3 +- src/XmlHandler/ManifestGenerator.cpp | 109 +++++++++++++++++++++ src/XmlHandler/ManifestGenerator.h | 2 + src/XmlHandler/ManifestHandler.cpp | 181 +++++++++++++++++++++++++++++------ src/XmlHandler/ManifestHandler.h | 7 ++ 9 files changed, 467 insertions(+), 49 deletions(-) mode change 100644 => 100755 src/XmlHandler/ManifestGenerator.h diff --git a/inc/InstallerDefs.h b/inc/InstallerDefs.h index 9ec3bbc..5fb3d9a 100755 --- a/inc/InstallerDefs.h +++ b/inc/InstallerDefs.h @@ -47,6 +47,9 @@ #define TYPE_INFO_FILE L"/info/type.info" #define PACKAGE_XML_FILE L"/info/manifest.xml" +#define SIGNATURE1_XML_FILE L"/signature1.xml" +#define AUTHOR_SIGNATURE_XML_FILE L"/author-signature.xml" + #define UISCALABILITY_INFO L"1 %ls %ls %ls" #define UIAPP_LOADER_PATH "/usr/lib/osp/osp-ui-app-loader" // UiApp @@ -72,7 +75,7 @@ #define DIR_MEMORYCARD_OSP_APPLICATIONS_TEMP L"/opt/storage/sdcard/apps/__@@osp_tmp@@__" #define OSP_INSTALLER "osp-installer" -#define OSP_INSTALLER_VERSION "osp-installer version = 2012/10/16" +#define OSP_INSTALLER_VERSION "osp-installer version = 2012/10/18" enum InstallationSetStep { diff --git a/src/Context/InstallationContext.cpp b/src/Context/InstallationContext.cpp index 7b34d70..8d0a40b 100755 --- a/src/Context/InstallationContext.cpp +++ b/src/Context/InstallationContext.cpp @@ -50,6 +50,7 @@ InstallationContext::InstallationContext(void) ,__operation(INSTALLER_OPERATION_INSTALL) ,__storage(INSTALLATION_STORAGE_INTERNAL) ,__pPrivilegeList(null) +,__pLiveBoxList(null) ,__rootCertType(ROOT_CERTIFICATE_NONE) ,__packageNameType(INSTALLER_PREFIX_TYPE_NONE) ,__pPackageInfoImpl(null) @@ -70,6 +71,13 @@ InstallationContext::~InstallationContext(void) delete __pPrivilegeList; __pPrivilegeList = null; } + + if (__pLiveBoxList) + { + __pLiveBoxList->RemoveAll(); + delete __pLiveBoxList; + __pLiveBoxList = null; + } } InstallerError @@ -358,7 +366,7 @@ InstallationContext::GetManifestXmlPath(void) { String path; - path = GetInstallDir() + DIR_INFO + "/manifest.xml"; + path = GetInstallDir() + PACKAGE_XML_FILE; return path; } @@ -368,7 +376,17 @@ InstallationContext::GetSignatureXmlPath(void) { String path; - path = GetInstallDir() + "/signature1.xml"; + path = GetInstallDir() + SIGNATURE1_XML_FILE; + + return path; +} + +String +InstallationContext::GetAuthorSignatureXmlPath(void) +{ + String path; + + path = GetInstallDir() + AUTHOR_SIGNATURE_XML_FILE; return path; } @@ -385,6 +403,18 @@ InstallationContext::SetPrivilegeList(ArrayList* privilegeList) __pPrivilegeList = privilegeList; } +ArrayList* +InstallationContext::GetLiveBoxList(void) const +{ + return __pLiveBoxList; +} + +void +InstallationContext::SetLiveBoxList(ArrayList* pLiveBoxList) +{ + __pLiveBoxList = pLiveBoxList; +} + RootCertificateType InstallationContext::GetRootCertType(void) const { @@ -415,3 +445,96 @@ InstallationContext::GetPackageInfoImpl(void) const return __pPackageInfoImpl; } +LiveboxInfo::LiveboxInfo(void) +:__updatePeriod(0) +,__pNameList(null) +,__pSizeList(null) +{ + __pNameList = new (std::nothrow) HashMap; + TryReturn(__pNameList, , "[osp-installer] __pNameList is null."); + __pNameList->Construct(); + + __pSizeList = new (std::nothrow) ArrayList; + TryReturn(__pSizeList, , "[osp-installer] __pSizeList is null."); + __pSizeList->Construct(); +} + +LiveboxInfo::~LiveboxInfo(void) +{ + __pNameList->RemoveAll(true); + delete __pNameList; + + __pSizeList->RemoveAll(true); + delete __pSizeList; +} + +result +LiveboxInfo::SetUpdatePeriod(long long period) +{ + __updatePeriod = period; + return E_SUCCESS; +} + +long long +LiveboxInfo::GetUpdatePeriod(void) const +{ + return __updatePeriod; +} + +result +LiveboxInfo::SetPopupEnabled(const String& value) +{ + __popupEnabled = value; + return E_SUCCESS; +} + +const String& +LiveboxInfo::GetPopupEnabled(void) const +{ + return __popupEnabled; +} + +result +LiveboxInfo::SetIcon(const String& icon) +{ + __icon = icon; + return E_SUCCESS; +} + +const String& +LiveboxInfo::GetIcon(void) const +{ + return __icon; +} + +result +LiveboxInfo::AddName(const String& language, const String& name) +{ + result r = E_SUCCESS; + + r = __pNameList->Add(language, name); + + return r; +} + +HashMap* +LiveboxInfo::GetNameList(void) const +{ + return __pNameList; +} + +result +LiveboxInfo::AddSize(const String& size) +{ + result r = E_SUCCESS; + + r = __pSizeList->Add(size); + + return r; +} + +ArrayList* +LiveboxInfo::GetSizeList(void) const +{ + return __pSizeList; +} diff --git a/src/Context/InstallationContext.h b/src/Context/InstallationContext.h index a030b4e..3103587 100755 --- a/src/Context/InstallationContext.h +++ b/src/Context/InstallationContext.h @@ -107,10 +107,14 @@ public: Osp::Base::String GetManifestXmlPath(void); Osp::Base::String GetSignatureXmlPath(void); + Osp::Base::String GetAuthorSignatureXmlPath(void); const Osp::Base::Collection::ArrayList* GetPrivilegeList(void) const; void SetPrivilegeList(Osp::Base::Collection::ArrayList* privilegeList); + Osp::Base::Collection::ArrayList* GetLiveBoxList(void) const; + void SetLiveBoxList(Osp::Base::Collection::ArrayList* privilegeList); + RootCertificateType GetRootCertType(void) const; void SetRootCertType(RootCertificateType certType); @@ -148,6 +152,7 @@ private: Osp::Base::String __appRootPath; Osp::Base::Collection::ArrayList* __pPrivilegeList; + Osp::Base::Collection::ArrayList* __pLiveBoxList; RootCertificateType __rootCertType; int __packageNameType; @@ -156,4 +161,39 @@ private: }; // InstallationContext +class LiveboxInfo + : public Osp::Base::Object +{ +public: + LiveboxInfo(void); + virtual ~LiveboxInfo(void); + + result SetUpdatePeriod(long long period); + long long GetUpdatePeriod(void) const; + + result SetPopupEnabled(const Osp::Base::String& value); + const Osp::Base::String& GetPopupEnabled(void) const; + + result SetIcon(const Osp::Base::String& icon); + const Osp::Base::String& GetIcon(void) const; + + result AddName(const Osp::Base::String& language, const Osp::Base::String& name); + Osp::Base::Collection::HashMap* GetNameList(void) const; + + result AddSize(const Osp::Base::String& size); + Osp::Base::Collection::ArrayList* GetSizeList(void) const; + +private: + LiveboxInfo(const LiveboxInfo& value); + LiveboxInfo& operator =(const LiveboxInfo& source); + + long long __updatePeriod; + Osp::Base::String __popupEnabled; + Osp::Base::String __icon; + + Osp::Base::Collection::HashMap* __pNameList; + Osp::Base::Collection::ArrayList* __pSizeList; + +}; // LiveboxInfo + #endif // _INSTALLATION_CONTEXT_H_ diff --git a/src/Manager/SignatureManager.cpp b/src/Manager/SignatureManager.cpp index dec8ef6..16d4664 100755 --- a/src/Manager/SignatureManager.cpp +++ b/src/Manager/SignatureManager.cpp @@ -30,7 +30,8 @@ using namespace Osp::Base::Utility; SignatureManager::SignatureManager(void) :__pContext(null) -,__pSignature(null) +,__pAuthorSignature(null) +,__pDistributorSignature(null) ,__pAuthorCertPath(null) ,__pDistributorCertPath(null) { @@ -38,7 +39,8 @@ SignatureManager::SignatureManager(void) SignatureManager::~SignatureManager(void) { - delete __pSignature; + delete __pAuthorSignature; + delete __pDistributorSignature; delete __pAuthorCertPath; delete __pDistributorCertPath; } @@ -57,35 +59,43 @@ SignatureManager::SetSignature() TryReturn(__pContext, false, "[osp-installer] __pContext is null."); bool ret = true; - char* pFilepath = _StringConverter::CopyToCharArrayN(__pContext->GetSignatureXmlPath()); + char* pSignaturePath = _StringConverter::CopyToCharArrayN(__pContext->GetSignatureXmlPath()); + char* pAuthorSignaturePath = _StringConverter::CopyToCharArrayN(__pContext->GetAuthorSignatureXmlPath()); - __pSignature = new SignatureHandler; - TryCatch(__pSignature, ret = false, "[osp-installer] __pSignature is null"); + __pDistributorSignature = new SignatureHandler; + TryCatch(__pDistributorSignature, ret = false, "[osp-installer] __pDistributorSignature is null"); - ret = __pSignature->Construct(__pContext); - TryCatch(ret == true, ret = false, "[osp-installer] __pSignature->Construct is failed."); + ret = __pDistributorSignature->Construct(__pContext); + TryCatch(ret == true, ret = false, "[osp-installer] __pDistributorSignature->Construct is failed."); - ret = __pSignature->Parse(pFilepath); - if (ret == false) - { - AppLogTag(OSP_INSTALLER, "__pSignature->Parse is failed. [%s]\n", pFilepath); - } + ret = __pDistributorSignature->Parse(pSignaturePath); + TryCatch(ret == true, ret = false, "[osp-installer] __pDistributorSignature->Parse is failed."); + + __pAuthorSignature = new SignatureHandler; + TryCatch(__pAuthorSignature, ret = false, "[osp-installer] __pAuthorSignature is null"); + + ret = __pAuthorSignature->Construct(__pContext); + TryCatch(ret == true, ret = false, "[osp-installer] __pAuthorSignature->Construct is failed."); + + ret = __pAuthorSignature->Parse(pAuthorSignaturePath); + TryCatch(ret == true, ret = false, "[osp-installer] __pAuthorSignature->Parse is failed."); CATCH: - delete[] pFilepath; + delete[] pSignaturePath; + delete[] pAuthorSignaturePath; return ret; } bool SignatureManager::AddCert(RootCertificateType certType) { - TryReturn(__pSignature, false, "[osp-installer] __pSignature is null."); + TryReturn(__pDistributorSignature, false, "[osp-installer] __pDistributorSignature is null."); bool ret = true; if (certType == ROOT_CERTIFICATE_DEVELOPER) { - IList* pAuthorCertChain = __pSignature->GetAuthorCertChain(); + IList* pAuthorCertChain = __pAuthorSignature->GetAuthorCertChain(); if (pAuthorCertChain) { @@ -103,7 +113,7 @@ SignatureManager::AddCert(RootCertificateType certType) } else { - IList* pDistributorCertChain = __pSignature->GetDistributorCertChain(); + IList* pDistributorCertChain = __pDistributorSignature->GetDistributorCertChain(); if (pDistributorCertChain) { diff --git a/src/Manager/SignatureManager.h b/src/Manager/SignatureManager.h index be036db..5c9e14b 100755 --- a/src/Manager/SignatureManager.h +++ b/src/Manager/SignatureManager.h @@ -59,7 +59,8 @@ private: private: InstallationContext* __pContext; - SignatureHandler* __pSignature; + SignatureHandler* __pAuthorSignature; + SignatureHandler* __pDistributorSignature; Osp::Security::Cert::X509CertificatePath* __pAuthorCertPath; Osp::Security::Cert::X509CertificatePath* __pDistributorCertPath; diff --git a/src/XmlHandler/ManifestGenerator.cpp b/src/XmlHandler/ManifestGenerator.cpp index 3a65650..3bbc721 100755 --- a/src/XmlHandler/ManifestGenerator.cpp +++ b/src/XmlHandler/ManifestGenerator.cpp @@ -291,6 +291,11 @@ ManifestGenerator::Write() } __pWriter->EndElement(); + + if (pAppInfoImpl->GetType() == L"ServiceApp") + { + WriteLiveboxes(pAppInfoImpl); + } } } @@ -366,3 +371,107 @@ ManifestGenerator::WriteLanguageValue(IMap* pList, const String& element) const delete pMapEnum; return true; } + +bool +ManifestGenerator::WriteLiveboxes(_PackageAppInfoImpl* pAppInfoImpl) const +{ + TryReturn(__pContext, false, "[osp-installer] __pContext is null."); + TryReturn(__pWriter, false, "[osp-installer] __pWriter is null."); + + ArrayList* pLiveboxList = __pContext->GetLiveBoxList(); + _PackageInfoImpl* pPackageInfoImpl = __pContext->GetPackageInfoImpl(); + String label("label"); + + if (pLiveboxList) + { + for (int j = 0 ; j < pLiveboxList->GetCount(); j++) + { + LiveboxInfo* pLiveboxInfo = dynamic_cast(pLiveboxList->GetAt(j)); + + if (pLiveboxInfo) + { + long long updatePeriod = pLiveboxInfo->GetUpdatePeriod(); + String period = LongLong::ToString(updatePeriod/1000); + IMap* pLiveboxNameList = pLiveboxInfo->GetNameList(); + ArrayList* pSizeList = pLiveboxInfo->GetSizeList(); + String popupEnabled = pLiveboxInfo->GetPopupEnabled(); + + __pWriter->StartElement("livebox"); + + __pWriter->WriteAttribute("appid", pAppInfoImpl->GetPackageName()); + __pWriter->WriteAttribute("period", period); + __pWriter->WriteAttribute("pinup", "false"); + __pWriter->WriteAttribute("primary", "true"); + __pWriter->WriteAttribute("auto_launch", "false"); + __pWriter->WriteAttribute("abi", "osp"); + + WriteLanguageValue(pLiveboxNameList, label); + + if (pLiveboxInfo->GetIcon().IsEmpty() == false) + { + String liveboxIcon; + liveboxIcon.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_ICONS, pLiveboxInfo->GetIcon().GetPointer()); + + __pWriter->StartElement("icon"); + __pWriter->WriteString(liveboxIcon); + __pWriter->EndElement(); + } + + if (pSizeList) + { + __pWriter->StartElement("box"); + __pWriter->WriteAttribute("type", "buffer"); + + for (int k = 0 ; k < pSizeList->GetCount(); k++) + { + String* pSize = dynamic_cast(pSizeList->GetAt(k)); + + if (pSize) + { + String convertedSize; + + if ((*pSize) == L"1x1") + { + convertedSize = L"172x172"; + } + else if((*pSize) == L"2x1") + { + convertedSize = L"348x172"; + } + else if((*pSize) == L"2x2") + { + convertedSize = L"348x348"; + } + else if((*pSize) == L"4x2") + { + convertedSize = L"700x348"; + } + + __pWriter->StartElement("size"); + __pWriter->WriteString(convertedSize); + __pWriter->EndElement(); + } + } + __pWriter->EndElement(); + } + + popupEnabled.ToLowerCase(); + if (popupEnabled == L"true") + { + __pWriter->StartElement("pd"); + __pWriter->WriteAttribute("type", "buffer"); + + __pWriter->StartElement("size"); + __pWriter->WriteString("720x250"); + __pWriter->EndElement(); + + __pWriter->EndElement(); + } + } + + __pWriter->EndElement(); + } + } + + return true; +} diff --git a/src/XmlHandler/ManifestGenerator.h b/src/XmlHandler/ManifestGenerator.h old mode 100644 new mode 100755 index 46b9536..7748806 --- a/src/XmlHandler/ManifestGenerator.h +++ b/src/XmlHandler/ManifestGenerator.h @@ -24,6 +24,7 @@ #define _MANIFEST_GENERATOR_H_ #include +#include #include "InstallationContext.h" #include "XmlWriter.h" @@ -51,6 +52,7 @@ private: bool FindFeatureValue(Osp::Base::Collection::ArrayList* pFeatureList, const Osp::Base::String& feature, const Osp::Base::String& value) const; bool WriteLanguageValue(Osp::Base::Collection::IMap* pList, const Osp::Base::String& label) const; + bool WriteLiveboxes(Osp::App::_PackageAppInfoImpl* pAppInfoImpl) const; private: InstallationContext* __pContext; diff --git a/src/XmlHandler/ManifestHandler.cpp b/src/XmlHandler/ManifestHandler.cpp index f155b45..7c2c773 100755 --- a/src/XmlHandler/ManifestHandler.cpp +++ b/src/XmlHandler/ManifestHandler.cpp @@ -39,6 +39,7 @@ using namespace Osp::System; ManifestHandler::ManifestHandler(void) :__pContext(null) ,__pPrivilegeList(null) +,__pLiveBoxList(null) ,__pPackageInfoImpl(null) ,__pPackageAppInfoImpl(null) ,__pAppControlInfoImpl(null) @@ -48,6 +49,7 @@ ManifestHandler::ManifestHandler(void) ,__pDataControlTypeImpl(null) ,__pLaunchConditionImpl(null) ,__pNotificationImpl(null) +,__pLiveboxInfo(null) ,__pDefaultIconType(null) ,__isDefaultMainmenu(false) ,__isDefaultSetting(false) @@ -137,6 +139,14 @@ ManifestHandler::OnStartElement(const char *pName) { status = OnIconsElement(); } + else if (strcasecmp(pName, "LiveBoxes") == 0) + { + status = OnLiveBoxesElement(); + } + else if (strcasecmp(pName, "LiveBox") == 0) + { + status = OnLiveBoxElement(); + } if (!status) { @@ -238,6 +248,18 @@ ManifestHandler::OnEndElement(const char *pName) __pDefaultIconType = null; AppLogTag(OSP_INSTALLER, "", pName); } + else if (strcasecmp(pName, "LiveBoxes") == 0) + { + __pContext->SetLiveBoxList(__pLiveBoxList); + __pLiveBoxList = null; + AppLogTag(OSP_INSTALLER, "", pName); + } + else if (strcasecmp(pName, "LiveBox") == 0) + { + __pLiveBoxList->Add(*__pLiveboxInfo); + __pLiveboxInfo = null; + AppLogTag(OSP_INSTALLER, "", pName); + } if (!status) { @@ -312,6 +334,10 @@ ManifestHandler::OnCharacters(const char *pCharacters) { status = OnNotificationValue(pCharacters); } + else if (strcasecmp(pName, "Size") == 0) + { + status = OnSizeValue(pCharacters); + } if (!status) { @@ -365,6 +391,48 @@ ManifestHandler::OnPrivilegesEndElement(void) } bool +ManifestHandler::OnLiveBoxesElement(void) +{ + __pLiveBoxList = new ArrayList; + TryReturn(__pLiveBoxList, false, "[osp-installer] __pLiveBoxList is null"); + + AppLogTag(OSP_INSTALLER, ""); + + return true; +} + +bool +ManifestHandler::OnLiveBoxElement(void) +{ + TryReturn(__pLiveboxInfo == null, false, "[osp-installer] __pLiveboxInfo is not null"); + + XmlAttribute *pAttr = null; + char *pUpdatePeriod = null; + char *pPopupEnabled = null; + + __pLiveboxInfo = new LiveboxInfo; + TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null"); + + pAttr = GetAttribute(); + TryReturn(pAttr, true, "[osp-installer] pAttr is null"); + + pUpdatePeriod = pAttr->Find("UpdatePeriod"); + TryReturn(pUpdatePeriod, false, "[osp-installer] pUpdatePeriod is null"); + + long long updatePeriod = atoll(pUpdatePeriod); + __pLiveboxInfo->SetUpdatePeriod(updatePeriod); + + pPopupEnabled = pAttr->Find("LiveBoxPopupEnabled"); + TryReturn(pPopupEnabled, false, "[osp-installer] pPopupEnabled is null"); + + __pLiveboxInfo->SetPopupEnabled(pPopupEnabled); + + AppLogTag(OSP_INSTALLER, "", updatePeriod, pPopupEnabled); + + return true; +} + +bool ManifestHandler::OnUiScalabilityElement(void) { XmlAttribute *pAttr = null; @@ -571,24 +639,29 @@ ManifestHandler::OnIconValue(const char *pCharacters) pTypeValue = pAttr->Find("Type"); TryReturn(pTypeValue, true, "[osp-installer] pTypeValue is null"); - if (pTypeValue != null) - { - char icon[1024] = {0,}; + char icon[1024] = {0,}; - if (strcasecmp(pTypeValue, "Xhigh") == 0) - { - snprintf(icon, sizeof(icon), "%s/%s", "screen-density-xhigh", pCharacters); - } - else if (strcasecmp(pTypeValue, "High") == 0) - { - snprintf(icon, sizeof(icon), "%s/%s", "screen-density-high", pCharacters); - } - else - { - AppLogTag(OSP_INSTALLER, "Invalid Type [%s]", __pDefaultIconType); - return false; - } + if (strcasecmp(pTypeValue, "Xhigh") == 0) + { + snprintf(icon, sizeof(icon), "%s/%s", "screen-density-xhigh", pCharacters); + } + else if (strcasecmp(pTypeValue, "High") == 0) + { + snprintf(icon, sizeof(icon), "%s/%s", "screen-density-high", pCharacters); + } + else + { + AppLogTag(OSP_INSTALLER, "Invalid Type [%s]", __pDefaultIconType); + return false; + } + if (FindElement("Livebox") == true) + { + TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null"); + __pLiveboxInfo->SetIcon(icon); + } + else + { if (strcasecmp(pAttrValue1, "MainMenu") == 0) { if (__isDefaultMainmenu == false) @@ -625,10 +698,10 @@ ManifestHandler::OnIconValue(const char *pCharacters) __isDefaultQuickpanel = true; } } - - AppLogTag(OSP_INSTALLER, "%s", pAttrValue1, pTypeValue, pCharacters); } + AppLogTag(OSP_INSTALLER, "%s", pAttrValue1, pTypeValue, pCharacters); + return true; } @@ -644,8 +717,8 @@ ManifestHandler::OnPrivilegeValue(const char *pCharacters) bool ManifestHandler::OnNameValue(const char *pCharacters) { - XmlAttribute *pAttr = 0; - char *pAttrValue = 0; + XmlAttribute* pAttr = 0; + char* pAttrValue = 0; pAttr = GetAttribute(); TryReturn(pAttr, true, "[osp-installer] pAttr is null"); @@ -653,19 +726,30 @@ ManifestHandler::OnNameValue(const char *pCharacters) pAttrValue = pAttr->Find("Locale"); TryReturn(pAttrValue, true, "[osp-installer] pAttrValue is null"); - if (strcasecmp(pAttrValue, "eng-GB") == 0 || strcasecmp(pAttrValue, "eng-US") == 0) + if (FindElement("Livebox") == true) { - if (__isDefaultName == true) - { - __pPackageInfoImpl->SetAppName(pCharacters); - } - } + TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null"); - if (__pPackageAppInfoImpl) - { String* pValue = new String; StringUtil::Utf8ToString(pCharacters, *pValue); - __pPackageAppInfoImpl->AddName(*(new String(pAttrValue)), *pValue); + __pLiveboxInfo->AddName(*(new String(pAttrValue)), *pValue); + } + else + { + if (strcasecmp(pAttrValue, "eng-GB") == 0 || strcasecmp(pAttrValue, "eng-US") == 0) + { + if (__isDefaultName == true) + { + __pPackageInfoImpl->SetAppName(pCharacters); + } + } + + if (__pPackageAppInfoImpl) + { + String* pValue = new String; + StringUtil::Utf8ToString(pCharacters, *pValue); + __pPackageAppInfoImpl->AddName(*(new String(pAttrValue)), *pValue); + } } AppLogTag(OSP_INSTALLER, "%s", pAttrValue, pCharacters); @@ -789,6 +873,17 @@ ManifestHandler::OnNotificationValue(const char *pCharacters) } bool +ManifestHandler::OnSizeValue(const char *pCharacters) +{ + TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null"); + + __pLiveboxInfo->AddSize(*(new String(pCharacters))); + AppLogTag(OSP_INSTALLER, "%s", pCharacters); + + return true; +} + +bool ManifestHandler::OnAppControlElement(void) { XmlAttribute *pAttr = null; @@ -1102,3 +1197,31 @@ ManifestHandler::OnServiceAppElement(void) return true; } + +bool +ManifestHandler::FindElement(const char *pName) +{ + bool res = false; + Osp::Base::Collection::IEnumerator* pEnum = GetElementEnumeratorN(); + + if (pEnum) + { + while(pEnum->MoveNext() == E_SUCCESS) + { + String* pStr = static_cast(pEnum->GetCurrent()); + if (pStr) + { + if (pStr->Equals(pName, false) == true) + { + AppLogTag(OSP_INSTALLER, "[%s] is matched.", pName); + res = true; + break; + } + } + } + + delete pEnum; + } + + return res; +} diff --git a/src/XmlHandler/ManifestHandler.h b/src/XmlHandler/ManifestHandler.h index af44055..6801d0b 100755 --- a/src/XmlHandler/ManifestHandler.h +++ b/src/XmlHandler/ManifestHandler.h @@ -55,6 +55,8 @@ private: virtual bool OnCharacters(const char *pCharacters); bool OnPrivilegesElement(void); bool OnPrivilegesEndElement(void); + bool OnLiveBoxesElement(void); + bool OnLiveBoxElement(void); bool OnUiScalabilityElement(void); bool OnUiThemeElement(void); bool OnIconsElement(void); @@ -74,6 +76,7 @@ private: bool OnDataControlTypeValue(const char *pCharacters); bool OnConditionValue(const char *pCharacters); bool OnNotificationValue(const char *pCharacters); + bool OnSizeValue(const char *pCharacters); bool OnAppControlElement(void); bool OnCapabilityElement(void); @@ -82,9 +85,12 @@ private: bool OnUiAppElement(void); bool OnServiceAppElement(void); + bool FindElement(const char *pName); + private: InstallationContext* __pContext; Osp::Base::Collection::ArrayList* __pPrivilegeList; + Osp::Base::Collection::ArrayList* __pLiveBoxList; Osp::App::_PackageInfoImpl* __pPackageInfoImpl; Osp::App::_PackageAppInfoImpl* __pPackageAppInfoImpl; Osp::App::_AppControlInfoImpl* __pAppControlInfoImpl; @@ -94,6 +100,7 @@ private: Osp::App::_DataControlTypeImpl* __pDataControlTypeImpl; Osp::App::_LaunchConditionInfoImpl* __pLaunchConditionImpl; Osp::App::_NotificationInfoImpl* __pNotificationImpl; + LiveboxInfo* __pLiveboxInfo; char* __pDefaultIconType; bool __isDefaultMainmenu; -- 2.7.4