diff options
Diffstat (limited to 'src/XmlHandler')
-rwxr-xr-x | src/XmlHandler/ManifestGenerator.cpp | 108 | ||||
-rwxr-xr-x | src/XmlHandler/ManifestGenerator.h | 1 |
2 files changed, 61 insertions, 48 deletions
diff --git a/src/XmlHandler/ManifestGenerator.cpp b/src/XmlHandler/ManifestGenerator.cpp index 3bbc721..e6bd262 100755 --- a/src/XmlHandler/ManifestGenerator.cpp +++ b/src/XmlHandler/ManifestGenerator.cpp @@ -241,54 +241,7 @@ ManifestGenerator::Write() __pWriter->EndElement(); } - ArrayList* pAppControlImplList = pAppInfoImpl->GetAppControlList(); - if (pAppControlImplList) - { - _AppControlInfoImpl* pAppControl = dynamic_cast<_AppControlInfoImpl*>(pAppControlImplList->GetAt(0)); - if (pAppControl) - { - ArrayList* pCapabilityList = pAppControl->GetCapabilityList(); - if (pCapabilityList) - { - _AppControlCapabilityInfoImpl* pCapability = dynamic_cast<_AppControlCapabilityInfoImpl*>(pCapabilityList->GetAt(0)); - if (pCapability) - { - String operationId = pCapability->GetOperationId(); - - __pWriter->StartElement("application-service"); - - __pWriter->StartElement("operation"); - __pWriter->WriteAttribute("name", operationId); - __pWriter->EndElement(); - - ArrayList* pResolutionList = pCapability->GetResolutionList(); - if (pResolutionList) - { - _AppControlResolutionInfoImpl* pResolution = dynamic_cast <_AppControlResolutionInfoImpl*>(pResolutionList->GetAt(0)); - if (pResolution) - { - String* pUriScheme = pResolution->GetUriScheme(); - if (pUriScheme->IsEmpty() == false) - { - __pWriter->StartElement("uri"); - __pWriter->WriteAttribute("name", *pUriScheme); - __pWriter->EndElement(); - } - - String* pMimeType = pResolution->GetMimeType(); - if (pMimeType->IsEmpty() == false) - { - __pWriter->StartElement("mime"); - __pWriter->WriteAttribute("name", *pMimeType); - __pWriter->EndElement(); - } - } - } - __pWriter->EndElement(); - } - } - } - } + WriteAppControl(pAppInfoImpl); __pWriter->EndElement(); @@ -475,3 +428,62 @@ ManifestGenerator::WriteLiveboxes(_PackageAppInfoImpl* pAppInfoImpl) const return true; } + +bool +ManifestGenerator::WriteAppControl(_PackageAppInfoImpl* pAppInfoImpl) const +{ + TryReturn(pAppInfoImpl, false, "[osp-installer] pAppInfoImpl is null."); + + ArrayList* pAppControlImplList = pAppInfoImpl->GetAppControlList(); + if (pAppControlImplList) + { + _AppControlInfoImpl* pAppControl = dynamic_cast<_AppControlInfoImpl*>(pAppControlImplList->GetAt(0)); + if (pAppControl) + { + ArrayList* pCapabilityList = pAppControl->GetCapabilityList(); + + for (int i = 0 ; i < pCapabilityList->GetCount(); i++) + { + if (pCapabilityList) + { + _AppControlCapabilityInfoImpl* pCapability = dynamic_cast<_AppControlCapabilityInfoImpl*>(pCapabilityList->GetAt(i)); + if (pCapability) + { + String operationId = pCapability->GetOperationId(); + + __pWriter->StartElement("application-service"); + + __pWriter->StartElement("operation"); + __pWriter->WriteAttribute("name", operationId); + __pWriter->EndElement(); + + ArrayList* pResolutionList = pCapability->GetResolutionList(); + if (pResolutionList) + { + _AppControlResolutionInfoImpl* pResolution = dynamic_cast <_AppControlResolutionInfoImpl*>(pResolutionList->GetAt(0)); + if (pResolution) + { + String* pUriScheme = pResolution->GetUriScheme(); + if (pUriScheme && pUriScheme->IsEmpty() == false) + { + __pWriter->StartElement("uri"); + __pWriter->WriteAttribute("name", *pUriScheme); + __pWriter->EndElement(); + } + + String* pMimeType = pResolution->GetMimeType(); + if (pMimeType && pMimeType->IsEmpty() == false) + { + __pWriter->StartElement("mime"); + __pWriter->WriteAttribute("name", *pMimeType); + __pWriter->EndElement(); + } + } + } + __pWriter->EndElement(); + } + } + } + } + } +} diff --git a/src/XmlHandler/ManifestGenerator.h b/src/XmlHandler/ManifestGenerator.h index 7748806..375bd70 100755 --- a/src/XmlHandler/ManifestGenerator.h +++ b/src/XmlHandler/ManifestGenerator.h @@ -53,6 +53,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; + bool WriteAppControl(Osp::App::_PackageAppInfoImpl* pAppInfoImpl) const; private: InstallationContext* __pContext; |