summaryrefslogtreecommitdiff
path: root/src/XmlHandler
diff options
context:
space:
mode:
authorDuyoung Jang <duyoung.jang@samsung.com>2012-10-22 18:58:34 +0900
committerDuyoung Jang <duyoung.jang@samsung.com>2012-10-22 18:58:34 +0900
commitafb06a2176b489447230f3fb227808124a236730 (patch)
tree591d4b591f17fb78e36c3f1e52dee56cb861d9ee /src/XmlHandler
parent22038b1a60a120c9a00fed87294bd47728f6145f (diff)
downloadinstaller-afb06a2176b489447230f3fb227808124a236730.tar.gz
installer-afb06a2176b489447230f3fb227808124a236730.tar.bz2
installer-afb06a2176b489447230f3fb227808124a236730.zip
Fix to parse appcontrol
Change-Id: Ic0cdcbaaa35d61659b13803f413d5f89104ca71f
Diffstat (limited to 'src/XmlHandler')
-rwxr-xr-xsrc/XmlHandler/ManifestGenerator.cpp108
-rwxr-xr-xsrc/XmlHandler/ManifestGenerator.h1
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;