--- a/secureswitools/swisistools/source/xmlparser/xmlparser.cpp Thu Aug 19 10:02:49 2010 +0300
+++ b/secureswitools/swisistools/source/xmlparser/xmlparser.cpp Tue Aug 31 15:21:33 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "Eclipse Public License v1.0"
@@ -27,7 +27,9 @@
#include "xmlparser.h"
#include "logs.h"
#include "exception.h"
+#include "utf8_wrapper.h"
#include "util.h"
+#include "utility.h"
#include <xercesc/sax2/XMLReaderFactory.hpp>
#include <xercesc/sax2/DefaultHandler.hpp>
@@ -42,13 +44,65 @@
#include <memory>
#include <cstdio>
+#ifndef _WIN32
+#include <ctype.h>
+
+//__ctype_b was removed from glibc. This is a workaround to fix the linking problem
+extern "C"
+ {
+ const unsigned short int** __ctype_b()
+ {
+ return __ctype_b_loc();
+ }
+ }
+
+#endif // _WIN32
+
XERCES_CPP_NAMESPACE_USE
+
+//------------------------------------------------------------------------------------------------------------------------------
+// UTILITY FUNCTIONS
+//------------------------------------------------------------------------------------------------------------------------------
+int XercesStringToInteger(const XercesString& aWideStr)
+ {
+ int strLen = aWideStr.length();
+ const XMLCh* source = aWideStr.c_str();
+ char* buffer = new char[strLen << 2];
+
+ // Using a temp variable in place of buffer as ConvertUTF16toUTF8 modifies the source pointer passed.
+ char* temp = buffer;
+
+ ConvertUTF16toUTF8(&source, aWideStr.c_str() + strLen, &temp, temp + (strLen << 2));
+
+ // Appending NUL to the converted buffer.
+ *temp = 0;
+
+ int value = 0;
+ sscanf(buffer, "%d", &value);
+
+ delete[] buffer;
+ return value;
+ }
+
+
// these function pointers are used to call appropriate release methods of XMLString
// present in the xerces library.
typedef void (*releaseXmlChPtr) (XMLCh** buf);
typedef void (*releaseChPtr) (char** buf);
+#ifdef _WIN32
+
+// We need not do anything for WINDOWS, since XMLCh string(XercesString)
+// and WString both are same and will be in UTF-16 encoding format.
+#define XMLChToWString(aParameter) (aParameter)
+
+#else
+inline std::wstring XMLChToWString(const XercesString& aXercesString)
+ {
+ return XercesStringToWString (aXercesString);
+ }
+#endif // _WIN32
DllExport CScrXmlParser::CScrXmlParser()
@@ -248,8 +302,8 @@
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagUniqueSoftwareTypeName( &XMLString::release, XMLString::transcode("UniqueSoftwareTypeName") );
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagLocalizableSwTypeName( &XMLString::release, XMLString::transcode("LocalizableSoftwareTypeName") );
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSifPluginUid( &XMLString::release, XMLString::transcode("SifPluginUid") );
- fn_auto_ptr<releaseXmlChPtr, XMLCh> tagInstallerSid( &XMLString::release, XMLString::transcode("InstallerSid") );
- fn_auto_ptr<releaseXmlChPtr, XMLCh> tagExecutionLayerSid( &XMLString::release, XMLString::transcode("ExecutionLayerSid") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagLauncherExecutable( &XMLString::release, XMLString::transcode("LauncherExecutable") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagCustomAcess( &XMLString::release, XMLString::transcode("CustomAcess") );
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagMIMEDetails( &XMLString::release, XMLString::transcode("MIMEDetails") );
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagMIMEType( &XMLString::release, XMLString::transcode("MIMEType") );
@@ -259,7 +313,7 @@
DOMNodeList* uniqueSwTypeName = swTypeNamesNode->getElementsByTagName(tagUniqueSoftwareTypeName.get());
const XMLCh* textContent = uniqueSwTypeName->item(0)->getTextContent();
- scrEnvDetails.iUniqueSoftwareTypeName = std::wstring(textContent);
+ scrEnvDetails.iUniqueSoftwareTypeName = XMLChToWString(textContent);
DOMNodeList* localizableSwTypeNames = swTypeNamesNode->getElementsByTagName(tagLocalizableSwTypeName.get());
const XMLSize_t localizableSwTypeNamesCount = localizableSwTypeNames->getLength();
@@ -278,19 +332,23 @@
sscanf(sifPluginUidText.get(),"%x",&sifPluginUidValue);
scrEnvDetails.iSifPluginUid = sifPluginUidValue;
- DOMNodeList* installerSid = aEnvironment->getElementsByTagName(tagInstallerSid.get());
- textContent = installerSid->item(0)->getTextContent();
- fn_auto_ptr<releaseChPtr,char> installerSidText(&XMLString::release, XMLString::transcode(textContent));
- int installerSidValue = 0;
- sscanf(installerSidText.get(),"%x",&installerSidValue);
- scrEnvDetails.iInstallerSid = installerSidValue;
-
- DOMNodeList* executionLayerSid = aEnvironment->getElementsByTagName(tagExecutionLayerSid.get());
- textContent = executionLayerSid->item(0)->getTextContent();
- fn_auto_ptr<releaseChPtr,char> executionLayerSidText(&XMLString::release, XMLString::transcode(textContent));
- int executionLayerSidValue = 0;
- sscanf(executionLayerSidText.get(),"%x",&executionLayerSidValue);
- scrEnvDetails.iExecutionLayerSid = executionLayerSidValue;
+ DOMNodeList* launcherExecutable = aEnvironment->getElementsByTagName(tagLauncherExecutable.get());
+ if(0 != launcherExecutable->getLength())
+ {
+ textContent = launcherExecutable->item(0)->getTextContent();
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> launcherExecutableText( &XMLString::release,textContent );
+ const XMLCh* launcherExecutableValue = launcherExecutableText.get();
+ scrEnvDetails.iLauncherExecutable = XMLChToWString(launcherExecutableValue);
+ }
+ DOMNodeList* customAcessList = aEnvironment->getElementsByTagName(tagCustomAcess.get());
+ const XMLSize_t customAcessDataCount = customAcessList->getLength();
+ for( XMLSize_t count=0 ; count<customAcessDataCount ; ++count )
+ {
+ DOMNode* customAcessRoot = customAcessList->item(count);
+ DOMElement* customAcessNode = static_cast< xercesc::DOMElement* >( customAcessRoot );
+ XmlDetails::TScrEnvironmentDetails::TCustomAcessList customAcessData = GetCustomAcessList(customAcessNode);
+ scrEnvDetails.iCustomAcessList.push_back(customAcessData);
+ }
DOMNodeList* mimeDetails = aEnvironment->getElementsByTagName(tagMIMEDetails.get());
DOMNode* mimeDetailRoot = mimeDetails->item(0);
@@ -300,7 +358,8 @@
for( XMLSize_t count=0 ; count<mimeCount ; ++count )
{
const XMLCh* textContent = mimes->item(count)->getTextContent();
- scrEnvDetails.iMIMEDetails.push_back(textContent);
+ std::wstring textString = XMLChToWString(textContent);
+ scrEnvDetails.iMIMEDetails.push_back(textString);
}
LOGEXIT("CScrXmlParser::GetEnvironmentData()");
@@ -345,7 +404,7 @@
DOMNodeList* softwaretype = elementRoot->getElementsByTagName(tagSoftwareTypeName.get());
const XMLCh* textContent = softwaretype->item(0)->getTextContent();
- preProvisionDetail.iSoftwareTypeName = std::wstring(textContent);
+ preProvisionDetail.iSoftwareTypeName = XMLChToWString(textContent);
// Retrieve the nodes for Component.
DOMNodeList* componentNodes = elementRoot->getElementsByTagName(tagComponent.get());
@@ -381,6 +440,7 @@
XmlDetails::TScrPreProvisionDetail::TComponent CScrXmlParser::GetPreProvisionData( const DOMElement* aDOMElement)
{
+ LOGENTER("CScrXmlParser::GetPreProvisionData()");
XmlDetails::TScrPreProvisionDetail::TComponent component;
DOMNodeList* childNodes = aDOMElement->getChildNodes();
@@ -392,6 +452,7 @@
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentFile( &XMLString::release, XMLString::transcode("ComponentFile") );
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentDetails( &XMLString::release, XMLString::transcode("ComponentDetails") );
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentDependency( &XMLString::release, XMLString::transcode("ComponentDependency") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfo( &XMLString::release, XMLString::transcode("ApplicationRegistrationInfo") );
XmlDetails::TScrPreProvisionDetail::TComponentDetails componentDetails = GetComponentDetails(aDOMElement);
component.iComponentDetails = componentDetails;
@@ -422,13 +483,19 @@
XmlDetails::TScrPreProvisionDetail::TComponentDependency componentDependency = GetComponentDependency(currentElement);
component.iComponentDependency = componentDependency;
}
+ else if( XMLString::equals(currentElement->getTagName(), tagApplicationRegistrationInfo.get()))
+ {
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo appRegistrationInfo = GetApplicationRegistrationInfo(currentElement);
+ component.iApplicationRegistrationInfo.push_back(appRegistrationInfo);
+ }
}
-
+ LOGEXIT("CScrXmlParser::GetPreProvisionData()");
return component;
}
XmlDetails::TScrPreProvisionDetail::TComponentLocalizable CScrXmlParser::GetComponentLocalizable(const DOMElement* aDOMElement)
{
+ LOGENTER("CScrXmlParser::GetComponentLocalizable()");
// tags in ComponentLocalizable
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentLocalizableLocale( &XMLString::release, XMLString::transcode("ComponentLocalizable_Locale") );
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentLocalizableName( &XMLString::release, XMLString::transcode("ComponentLocalizable_Name") );
@@ -443,24 +510,25 @@
if(locale->getLength() != 0)
{
const XMLCh* textLocale = locale->item(0)->getTextContent();
- componentLocalizable.iLocale = Util::WideCharToInteger(textLocale);
+ componentLocalizable.iLocale = XercesStringToInteger(textLocale);
}
const XMLCh* textName = name->item(0)->getTextContent();
- componentLocalizable.iName = textName;
+ componentLocalizable.iName = XMLChToWString(textName);
if(vendor->getLength() != 0)
{
const XMLCh* textVendor = vendor->item(0)->getTextContent();
- componentLocalizable.iVendor = textVendor;
+ componentLocalizable.iVendor = XMLChToWString(textVendor);
}
-
+ LOGEXIT("CScrXmlParser::GetComponentLocalizable()");
return componentLocalizable;
}
XmlDetails::TScrPreProvisionDetail::TComponentProperty CScrXmlParser::GetComponentProperty(const DOMElement* aEnvironment)
{
+ LOGENTER("CScrXmlParser::GetComponentProperty()");
// tags in ComponentProperty
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentPropertyName( &XMLString::release, XMLString::transcode("Name") );
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentPropertyLocale( &XMLString::release, XMLString::transcode("ComponentProperty_Locale") );
@@ -482,12 +550,12 @@
XmlDetails::TScrPreProvisionDetail::TComponentProperty componentProperty;
const XMLCh* textName = name->getTextContent();
- componentProperty.iName = textName;
+ componentProperty.iName = XMLChToWString(textName);
if(locale->getLength() != 0)
{
const XMLCh* textLocale = locale->item(0)->getTextContent();
- componentProperty.iLocale = Util::WideCharToInteger(textLocale);
+ componentProperty.iLocale = XercesStringToInteger(textLocale);
}
DOMNodeList* childNodes = value->item(0)->getChildNodes();
@@ -499,13 +567,13 @@
if( XMLString::equals(currentElement->getTagName(), tagComponentPropertyIntValue.get()))
{
componentProperty.iIsIntValue = true;
- componentProperty.iValue = currentElement->getTextContent();
+ componentProperty.iValue = XMLChToWString(currentElement->getTextContent());
break;
}
else if( XMLString::equals(currentElement->getTagName(), tagComponentPropertyStrValue.get()))
{
componentProperty.iIsIntValue = false;
- componentProperty.iValue = currentElement->getTextContent();
+ componentProperty.iValue = XMLChToWString(currentElement->getTextContent());
break;
}
}
@@ -513,15 +581,16 @@
if(isBinary->getLength() != 0)
{
const XMLCh* textIsBinary = isBinary->item(0)->getTextContent();
- componentProperty.iIsStr8Bit = Util::WideCharToInteger(textIsBinary);
+ componentProperty.iIsStr8Bit = XercesStringToInteger(textIsBinary);
}
-
+ LOGEXIT("CScrXmlParser::GetComponentProperty()");
return componentProperty;
}
XmlDetails::TScrPreProvisionDetail::TComponentFile CScrXmlParser::GetComponentFile( const DOMElement* aDOMElement)
{
+ LOGENTER("CScrXmlParser::GetComponentFile()");
XmlDetails::TScrPreProvisionDetail::TComponentFile componentFile;
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFileProperty( &XMLString::release, XMLString::transcode("FileProperty") );
@@ -542,13 +611,14 @@
// attribute - location
DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
DOMNode* location = attributes->getNamedItem(tagLocation.get());
- componentFile.iLocation = location->getTextContent();
-
+ componentFile.iLocation = XMLChToWString(location->getTextContent());
+ LOGEXIT("CScrXmlParser::GetComponentFile()");
return componentFile;
}
XmlDetails::TScrPreProvisionDetail::TComponentDependency CScrXmlParser::GetComponentDependency( const XERCES_CPP_NAMESPACE::DOMElement* aDOMElement)
{
+ LOGENTER("CScrXmlParser::GetComponentDependency()");
XmlDetails::TScrPreProvisionDetail::TComponentDependency componentDependency;
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDepList( &XMLString::release, XMLString::transcode("DependencyList") );
@@ -568,15 +638,15 @@
DOMNodeList* supplierId = currentDepDetail->getElementsByTagName(tagSupplierId.get());
const XMLCh* textSupplierId = supplierId->item(0)->getTextContent();
- componentDependencyDetail.iSupplierId = std::wstring(textSupplierId);
+ componentDependencyDetail.iSupplierId = XMLChToWString(textSupplierId);
DOMNodeList* fromVersion = currentDepDetail->getElementsByTagName(tagFromVersion.get());
const XMLCh* textFromVersion = fromVersion->item(0)->getTextContent();
- componentDependencyDetail.iFromVersion = std::wstring(textFromVersion);
+ componentDependencyDetail.iFromVersion = XMLChToWString(textFromVersion);
DOMNodeList* toVersion = currentDepDetail->getElementsByTagName(tagToVersion.get());
const XMLCh* textToVersion = toVersion->item(0)->getTextContent();
- componentDependencyDetail.iToVersion = std::wstring(textToVersion);
+ componentDependencyDetail.iToVersion = XMLChToWString(textToVersion);
componentDependency.iComponentDependencyList.push_back(componentDependencyDetail);
@@ -585,14 +655,15 @@
// attribute - location
DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
DOMNode* dependentId = attributes->getNamedItem(tagDependentId.get());
- componentDependency.iDependentId = dependentId->getTextContent();
-
+ componentDependency.iDependentId = XMLChToWString(dependentId->getTextContent());
+ LOGEXIT("CScrXmlParser::GetComponentDependency()");
return componentDependency;
}
XmlDetails::TScrPreProvisionDetail::TComponentFile::TFileProperty
CScrXmlParser::GetFileProperty( const DOMElement* aDOMElement)
{
+ LOGENTER("CScrXmlParser::GetFileProperty()");
// tag for FileProperty
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFilePropertyName( &XMLString::release, XMLString::transcode("Name") );
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFilePropertyValue( &XMLString::release, XMLString::transcode("FileProperty_Value") );
@@ -612,7 +683,7 @@
DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagFilePropertyIsBinary.get());
const XMLCh* textName = name->getTextContent();
- fileProperty.iName = textName;
+ fileProperty.iName = XMLChToWString(textName);
int valueLength = value->getLength();
if(valueLength != 0)
@@ -628,23 +699,26 @@
if( XMLString::equals(valueElement->getTagName(), tagFilePropertyIntValue.get()))
{
fileProperty.iIsIntValue = true;
- fileProperty.iValue = currentElement->getTextContent();
+ fileProperty.iValue = XMLChToWString(currentElement->getTextContent());
}
else if( XMLString::equals(valueElement->getTagName(), tagFilePropertyStrValue.get()))
{
fileProperty.iIsIntValue = false;
- fileProperty.iValue = currentElement->getTextContent();
+ fileProperty.iValue = XMLChToWString(currentElement->getTextContent());
}
}
}
}
+ LOGEXIT("CScrXmlParser::GetFileProperty()");
return fileProperty;
}
XmlDetails::TScrPreProvisionDetail::TComponentDetails
CScrXmlParser::GetComponentDetails( const DOMElement* aDOMElement)
{
+ LOGENTER("CScrXmlParser::GetComponentDetails()");
// tags for ComponentDetails
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagRomApplication( &XMLString::release, XMLString::transcode("RomApplication") );
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagRemovable( &XMLString::release, XMLString::transcode("Removable") );
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSize( &XMLString::release, XMLString::transcode("Size") );
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagScomoState( &XMLString::release, XMLString::transcode("ScomoState") );
@@ -655,6 +729,7 @@
XmlDetails::TScrPreProvisionDetail::TComponentDetails componentDetails;
+ DOMNodeList* romApplication = aDOMElement->getElementsByTagName(tagRomApplication.get());
DOMNodeList* removable = aDOMElement->getElementsByTagName(tagRemovable.get());
DOMNodeList* size = aDOMElement->getElementsByTagName(tagSize.get());
DOMNodeList* scomoState = aDOMElement->getElementsByTagName(tagScomoState.get());
@@ -663,28 +738,35 @@
DOMNodeList* originVerified = aDOMElement->getElementsByTagName(tagOriginVerified.get());
DOMNodeList* hidden = aDOMElement->getElementsByTagName(tagHidden.get());
+ if( romApplication->getLength() != 0)
+ {
+ LOGINFO("CScrXmlParser::GetComponentDetails()- rom app");
+ const XMLCh* textRomApplication = romApplication->item(0)->getTextContent();
+ componentDetails.iIsRomApplication = XercesStringToInteger(textRomApplication);
+ }
+
if( removable->getLength() != 0)
{
const XMLCh* textRemovable = removable->item(0)->getTextContent();
- componentDetails.iIsRemovable = Util::WideCharToInteger(textRemovable);
+ componentDetails.iIsRemovable = XercesStringToInteger(textRemovable);
}
if( size->getLength() != 0)
{
const XMLCh* textSize = size->item(0)->getTextContent();
- componentDetails.iSize = Util::WideCharToInteger(textSize);
+ componentDetails.iSize = XercesStringToInteger(textSize);
}
if( scomoState->getLength() != 0)
{
const XMLCh* textScomoState = scomoState->item(0)->getTextContent();
- componentDetails.iScomoState = Util::WideCharToInteger(textScomoState);
+ componentDetails.iScomoState = XercesStringToInteger(textScomoState);
}
if( globalId->getLength() != 0)
{
const XMLCh* textGlobalId = globalId->item(0)->getTextContent();
- componentDetails.iGlobalId = textGlobalId;
+ componentDetails.iGlobalId = XMLChToWString(textGlobalId);
}
if( versionDetail->getLength() != 0)
@@ -700,29 +782,30 @@
DOMNode* minor = attributes->getNamedItem(tagMinor.get());
DOMNode* build = attributes->getNamedItem(tagBuild.get());
- componentDetails.iVersion.iMajor = major->getTextContent();
- componentDetails.iVersion.iMinor = minor->getTextContent();
- componentDetails.iVersion.iBuild = build->getTextContent();
+ componentDetails.iVersion.iMajor = XMLChToWString(major->getTextContent());
+ componentDetails.iVersion.iMinor = XMLChToWString(minor->getTextContent());
+ componentDetails.iVersion.iBuild = XMLChToWString(build->getTextContent());
}
if( originVerified->getLength() != 0)
{
const XMLCh* textOriginVerified = originVerified->item(0)->getTextContent();
- componentDetails.iOriginVerified = Util::WideCharToInteger(textOriginVerified);
+ componentDetails.iOriginVerified = XercesStringToInteger(textOriginVerified);
}
if( hidden->getLength() != 0)
{
const XMLCh* textHidden = hidden->item(0)->getTextContent();
- componentDetails.iIsHidden = Util::WideCharToInteger(textHidden);
+ componentDetails.iIsHidden = XercesStringToInteger(textHidden);
}
-
+ LOGEXIT("CScrXmlParser::GetComponentDetails()");
return componentDetails;
}
XmlDetails::TScrEnvironmentDetails::TLocalizedSoftwareTypeName
CScrXmlParser::GetLocalizedSoftwareTypeName(const DOMElement* aDOMElement)
{
+ LOGENTER("CScrXmlParser::GetLocalizedSoftwareTypeName()");
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSwTypeNameLocale( &XMLString::release, XMLString::transcode("Locale") );
fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSwTypeNameValue( &XMLString::release, XMLString::transcode("Value") );
@@ -733,12 +816,601 @@
XmlDetails::TScrEnvironmentDetails::TLocalizedSoftwareTypeName localizedSwTypeName;
const XMLCh* textLocale = locale->getTextContent();
- localizedSwTypeName.iLocale = Util::WideCharToInteger(textLocale);
+ localizedSwTypeName.iLocale = XercesStringToInteger(textLocale);
+
+ const XMLCh* textName = name->getTextContent();
+ localizedSwTypeName.iName = XMLChToWString(textName);
+ LOGEXIT("CScrXmlParser::GetLocalizedSoftwareTypeName()");
+ return localizedSwTypeName;
+ }
+
+XmlDetails::TScrEnvironmentDetails::TCustomAcessList
+ CScrXmlParser::GetCustomAcessList(const DOMElement* aDOMElement)
+ {
+ LOGENTER("CScrXmlParser::GetCustomAcessList()");
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSecureId( &XMLString::release, XMLString::transcode("SecureId") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAccessMode( &XMLString::release, XMLString::transcode("AccessMode") );
+
+ DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
+ DOMNode* secureId = attributes->getNamedItem(tagSecureId.get());
+ DOMNode* accessMode = attributes->getNamedItem(tagAccessMode.get());
+
+ XmlDetails::TScrEnvironmentDetails::TCustomAcessList customAcessList;
+
+ fn_auto_ptr<releaseChPtr,char> textSecureId(&XMLString::release, XMLString::transcode(secureId->getTextContent()));
+ int secureIdVal=0;
+ sscanf(textSecureId.get(),"%x",&secureIdVal);
+ customAcessList.iSecureId = secureIdVal;
+
+ const XMLCh* textAccessMode = accessMode->getTextContent();
+ customAcessList.iAccessMode = XercesStringToInteger(textAccessMode);
+ LOGEXIT("CScrXmlParser::GetCustomAcessList()");
+ return customAcessList;
+ }
+
+XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo CScrXmlParser::GetApplicationRegistrationInfo(const DOMElement* aDOMElement)
+ {
+ LOGENTER("CScrXmlParser::GetApplicationRegistrationInfo()");
+ // tags in ApplicationRegistrationInfo
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppAttribute( &XMLString::release, XMLString::transcode("ApplicationAttribute") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoOpaqueData ( &XMLString::release, XMLString::transcode("OpaqueData") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoFileOwnershipInfo( &XMLString::release, XMLString::transcode("FileOwnershipinfo") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppDataType( &XMLString::release, XMLString::transcode("ApplicationDataType") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppServiceInfo( &XMLString::release, XMLString::transcode("ApplicationServiceInfo") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppLocalizableInfo( &XMLString::release, XMLString::transcode("ApplicationLocalizableInfo") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppProperty( &XMLString::release, XMLString::transcode("ApplicationProperty") );
+
+ DOMNodeList* appAttributes = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppAttribute.get());
+ const XMLSize_t appAttributeCount = appAttributes->getLength();
+ DOMNodeList* OpaqueData = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoOpaqueData.get());
+ const XMLSize_t OpaqueDataCount = OpaqueData->getLength();
+ DOMNodeList* fileOwnershipInfos = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoFileOwnershipInfo.get());
+ const XMLSize_t fileOwnershipInfoCount = fileOwnershipInfos->getLength();
+ DOMNodeList* appServiceInfos = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppServiceInfo.get());
+ const XMLSize_t appServiceInfoCount = appServiceInfos->getLength();
+ DOMNodeList* appLocalizableInfos = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppLocalizableInfo.get());
+ const XMLSize_t appLocalizableInfoCount = appLocalizableInfos->getLength();
+ DOMNodeList* appProperties = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppProperty.get());
+ const XMLSize_t appPropertyCount = appProperties->getLength();
+
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo appRegistrationInfo;
+
+ // for each AppAttribute retrieve all tags
+ for( XMLSize_t index = 0; index < appAttributeCount; ++index )
+ {
+ DOMElement* currentappAttribute = static_cast< xercesc::DOMElement* >( appAttributes->item(index) );
+
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppAttribute appAttribute = GetAppAttribute(currentappAttribute);
+ appRegistrationInfo.iApplicationAttribute.push_back(appAttribute);
+ }
+
+ // for each OpaqueData retrieve all tags
+ for( XMLSize_t index = 0; index < OpaqueDataCount; ++index )
+ {
+ DOMElement* currentOpaqueData = static_cast< xercesc::DOMElement* >( OpaqueData->item(index) );
+
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty;
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType = GetOpaqueDataType(currentOpaqueData);
+
+ appProperty.iLocale = opaqueDataType.iLocale;
+ appProperty.iName = L"OpaqueData";
+ appProperty.iIntValue = 0;
+ appProperty.iIsStr8Bit = true;
+ appProperty.iServiceUid = 0;
+
+ if(opaqueDataType.iIsBinary == 1)
+ {
+ std::string str = wstring2string(opaqueDataType.iOpaqueData);
+ std::string decodedString = Util::Base64Decode(str);
+ int len = decodedString.length();
+ appProperty.iStrValue.assign(decodedString.c_str(),decodedString.c_str()+len);
+ }
+ else
+ {
+ appProperty.iStrValue = opaqueDataType.iOpaqueData;
+ }
+
+ appRegistrationInfo.iApplicationProperty.push_back(appProperty);
+ }
+
+ // for each FileOwnershipInfo retrieve all tags
+ for( XMLSize_t index = 0; index < fileOwnershipInfoCount; ++index )
+ {
+ DOMElement* currentFileOwnershipInfo = static_cast< xercesc::DOMElement* >( fileOwnershipInfos->item(index) );
+
+ std::wstring file = GetFileOwnershipInfo(currentFileOwnershipInfo);
+
+ appRegistrationInfo.iFileOwnershipInfo.push_back(file);
+ }
+
+ // for each appServiceInfo retrieve all tags
+ for( XMLSize_t index = 0; index < appServiceInfoCount; ++index )
+ {
+ DOMElement* currentappServiceInfo = static_cast< xercesc::DOMElement* >( appServiceInfos->item(index) );
+
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppServiceInfo appServiceInfo = GetAppServiceInfo(currentappServiceInfo, appRegistrationInfo);
+ appRegistrationInfo.iApplicationServiceInfo.push_back(appServiceInfo);
+ }
+
+ // for each appLocalizableInfo retrieve all tags
+ for( XMLSize_t index = 0; index < appLocalizableInfoCount; ++index )
+ {
+ DOMElement* currentAppLocalizableInfo = static_cast< xercesc::DOMElement* >( appLocalizableInfos->item(index) );
+
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo appLocalizableInfo = GetAppLocalizableInfo(currentAppLocalizableInfo);
+ appRegistrationInfo.iApplicationLocalizableInfo.push_back(appLocalizableInfo);
+ }
+
+ // for each AppProperty retrieve all tags
+ for( XMLSize_t index = 0; index < appPropertyCount; ++index )
+ {
+ DOMElement* currentAppProperty = static_cast< xercesc::DOMElement* >( appProperties->item(index) );
+
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty = GetAppProperty(currentAppProperty);
+ appRegistrationInfo.iApplicationProperty.push_back(appProperty);
+ }
+ LOGEXIT("CScrXmlParser::GetApplicationRegistrationInfo()");
+ return appRegistrationInfo;
+ }
+
+XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppAttribute
+ CScrXmlParser::GetAppAttribute( const DOMElement* aDOMElement)
+ {
+ LOGENTER("CScrXmlParser::GetAppAttribute()");
+ // tags in AppAttribute
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppAttributeName( &XMLString::release, XMLString::transcode("Name") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppAttributeValue( &XMLString::release, XMLString::transcode("ApplicationAttribute_Value") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppAttributeIsBinary( &XMLString::release, XMLString::transcode("ApplicationAttribute_IsBinary") );
+
+ // tags of ComponentProperty_Value
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationAttributeIntValue( &XMLString::release, XMLString::transcode("ApplicationAttribute_IntValue") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationAttributeStrValue( &XMLString::release, XMLString::transcode("ApplicationAttribute_StrValue") );
+
+ // attribute - name
+ DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
+ DOMNode* name = attributes->getNamedItem(tagAppAttributeName.get());
+
+ DOMNodeList* value = aDOMElement->getElementsByTagName(tagAppAttributeValue.get());
+ DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagAppAttributeIsBinary.get());
+
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppAttribute appAttribute;
const XMLCh* textName = name->getTextContent();
- localizedSwTypeName.iName = textName;
+ appAttribute.iName = XMLChToWString(textName);
+
+ DOMNodeList* childNodes = value->item(0)->getChildNodes();
+ const XMLSize_t nodeCount = childNodes->getLength();
+
+ for(int index = 0; index< nodeCount; ++index)
+ {
+ DOMElement* currentElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) );
+ if( XMLString::equals(currentElement->getTagName(), tagApplicationAttributeIntValue.get()))
+ {
+ appAttribute.iIsIntValue = true;
+ appAttribute.iValue = XMLChToWString(currentElement->getTextContent());
+ break;
+ }
+ else if( XMLString::equals(currentElement->getTagName(), tagApplicationAttributeStrValue.get()))
+ {
+ appAttribute.iIsIntValue = false;
+ appAttribute.iValue = XMLChToWString(currentElement->getTextContent());
+ break;
+ }
+ }
+
+ if(isBinary->getLength() != 0)
+ {
+ const XMLCh* textIsBinary = isBinary->item(0)->getTextContent();
+ appAttribute.iIsStr8Bit = XercesStringToInteger(textIsBinary);
+ }
+ LOGEXIT("CScrXmlParser::GetAppAttribute()");
+ return appAttribute;
+ }
+
+std::wstring CScrXmlParser::GetFileOwnershipInfo( const DOMElement* aDOMElement)
+ {
+ LOGENTER("CScrXmlParser::GetFileOwnershipInfo()");
+ // tags in FileOwnershipInfo
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFileName( &XMLString::release, XMLString::transcode("FileName") );
+
+ DOMNodeList* fileName = aDOMElement->getElementsByTagName(tagFileName.get());
+
+ std::wstring file;
+
+ if( fileName->getLength() != 0)
+ {
+ const XMLCh* fil = fileName->item(0)->getTextContent();
+ file = XMLChToWString(fil);
+ }
+
+ LOGEXIT("CScrXmlParser::GetFileOwnershipInfo()");
+ return file;
+ }
+
+XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TDataType
+ CScrXmlParser::GetDataType( const DOMElement* aDOMElement)
+ {
+ LOGENTER("CScrXmlParser::GetDataType()");
+ // tags in DataType
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDataTypePriority( &XMLString::release, XMLString::transcode("Priority") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDataType( &XMLString::release, XMLString::transcode("Type") );
+
+ DOMNodeList* priority = aDOMElement->getElementsByTagName(tagDataTypePriority.get());
+ DOMNodeList* type = aDOMElement->getElementsByTagName(tagDataType.get());
+
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TDataType dataType;
+
+ if( priority->getLength() != 0)
+ {
+ const XMLCh* pri = priority->item(0)->getTextContent();
+ dataType.iPriority = XercesStringToInteger(pri);
+ }
+
+ if( type->getLength() != 0)
+ {
+ const XMLCh* typ = type->item(0)->getTextContent();
+ dataType.iType = XMLChToWString(typ);
+ }
+ LOGEXIT("CScrXmlParser::GetDataType()");
+ return dataType;
+ }
+
+XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType
+ CScrXmlParser::GetOpaqueDataType( const DOMElement* aDOMElement)
+ {
+ LOGENTER("CScrXmlParser::GetOpaqueDataType()");
+ // tags in OpaqueDataType
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagData( &XMLString::release, XMLString::transcode("Data") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagOpaqueLocale( &XMLString::release, XMLString::transcode("OpaqueLocale") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagIsBinary( &XMLString::release, XMLString::transcode("IsBinary") );
+
+ DOMNodeList* Data = aDOMElement->getElementsByTagName(tagData.get());
+ DOMNodeList* OpaqueLocale = aDOMElement->getElementsByTagName(tagOpaqueLocale.get());
+ DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagIsBinary.get());
+
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType;
+
+ if( OpaqueLocale->getLength() != 0)
+ {
+ const XMLCh* pri = OpaqueLocale->item(0)->getTextContent();
+ opaqueDataType.iLocale = XercesStringToInteger(pri);
+ }
+
+ if( Data->getLength() != 0)
+ {
+ const XMLCh* typ = Data->item(0)->getTextContent();
+ opaqueDataType.iOpaqueData = XMLChToWString(typ);
+ }
+
+ if(isBinary->getLength() != 0)
+ {
+ const XMLCh* textIsBinary = isBinary->item(0)->getTextContent();
+ opaqueDataType.iIsBinary = XercesStringToInteger(textIsBinary);
+ }
+
+ LOGEXIT("CScrXmlParser::GetOpaqueDataType()");
+ return opaqueDataType;
+ }
+
+XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType
+ CScrXmlParser::GetServiceOpaqueDataType( const DOMElement* aDOMElement)
+ {
+ LOGENTER("CScrXmlParser::GetServiceOpaqueDataType()");
+ // tags in OpaqueDataType
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagServiceData( &XMLString::release, XMLString::transcode("ServiceData") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagServiceOpaqueLocale( &XMLString::release, XMLString::transcode("ServiceOpaqueLocale") );
+
+ DOMNodeList* ServiceData = aDOMElement->getElementsByTagName(tagServiceData.get());
+ DOMNodeList* ServiceOpaqueLocale = aDOMElement->getElementsByTagName(tagServiceOpaqueLocale.get());
+
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType;
+
+ if( ServiceOpaqueLocale->getLength() != 0)
+ {
+ const XMLCh* pri = ServiceOpaqueLocale->item(0)->getTextContent();
+ opaqueDataType.iLocale = XercesStringToInteger(pri);
+ }
+
+ if( ServiceData->getLength() != 0)
+ {
+ const XMLCh* typ = ServiceData->item(0)->getTextContent();
+ opaqueDataType.iOpaqueData = XMLChToWString(typ);
+ }
+ LOGEXIT("CScrXmlParser::GetServiceOpaqueDataType()");
+ return opaqueDataType;
+ }
+
+XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppServiceInfo
+ CScrXmlParser::GetAppServiceInfo( const DOMElement* aDOMElement, XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo& aAppRegistrationInfo )
+ {
+ LOGENTER("CScrXmlParser::GetAppServiceInfo()");
+ // tags in AppServiceInfo
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppServiceInfoUid( &XMLString::release, XMLString::transcode("Uid") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppServiceAppProperty( &XMLString::release, XMLString::transcode("ServiceOpaqueData") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppServiceInfoDataType( &XMLString::release, XMLString::transcode("ApplicationDataType") );
+
+ DOMNodeList* uid = aDOMElement->getElementsByTagName(tagAppServiceInfoUid.get());
+
+ DOMNodeList* ServiceOpaqueData = aDOMElement->getElementsByTagName(tagAppServiceAppProperty.get());
+ const XMLSize_t ServiceOpaqueDataCount = ServiceOpaqueData->getLength();
+
+ DOMNodeList* dataTypes = aDOMElement->getElementsByTagName(tagAppServiceInfoDataType.get());
+ const XMLSize_t dataTypeCount = dataTypes->getLength();
+
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppServiceInfo appServiceInfo;
+
+ if( uid->getLength() != 0)
+ {
+ const XMLCh* priority = uid->item(0)->getTextContent();
+ appServiceInfo.iUid = XercesStringToInteger(priority);
+ }
+
+ // for each OpaqueData retrieve all tags
+ for( XMLSize_t index = 0; index < ServiceOpaqueDataCount; ++index )
+ {
+ DOMElement* currentOpaqueData = static_cast< xercesc::DOMElement* >( ServiceOpaqueData->item(index) );
+
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty;
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType = GetServiceOpaqueDataType(currentOpaqueData);
+
+ appProperty.iLocale = opaqueDataType.iLocale;
+ appProperty.iName = L"OpaqueData";
+ appProperty.iIntValue = 0;
+ appProperty.iIsStr8Bit = true;
+ appProperty.iServiceUid = appServiceInfo.iUid;
+ if(opaqueDataType.iIsBinary == 1)
+ {
+ std::string str = wstring2string(opaqueDataType.iOpaqueData);
+ std::string decodedString = Util::Base64Decode(str);
+ appProperty.iStrValue = string2wstring(decodedString);
+ }
+ else
+ {
+ appProperty.iStrValue = opaqueDataType.iOpaqueData;
+ }
+ aAppRegistrationInfo.iApplicationProperty.push_back(appProperty);
+ }
+
+ // for each DataType retrieve all tags
+ for( XMLSize_t index = 0; index < dataTypeCount; ++index )
+ {
+ DOMElement* currentDataType = static_cast< xercesc::DOMElement* >( dataTypes->item(index) );
+
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TDataType dataType = GetDataType(currentDataType);
+ appServiceInfo.iDataType.push_back(dataType);
+ }
+ LOGEXIT("CScrXmlParser::GetAppServiceInfo()");
+ return appServiceInfo;
+
+ }
- return localizedSwTypeName;
+XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo
+ CScrXmlParser::GetAppLocalizableInfo( const DOMElement* aDOMElement)
+ {
+ LOGENTER("CScrXmlParser::GetAppLocalizableInfo()");
+ // tags in AppLocalizableInfo
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttribute( &XMLString::release, XMLString::transcode("LocalizableAttribute") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoViewData ( &XMLString::release, XMLString::transcode("ViewData") );
+
+ DOMNodeList* localizableAttributes = aDOMElement->getElementsByTagName(tagAppLocalizableInfoAttribute.get());
+ const XMLSize_t attributeCount = localizableAttributes->getLength();
+ DOMNodeList* viewData = aDOMElement->getElementsByTagName(tagAppLocalizableInfoViewData.get());
+ const XMLSize_t viewDataCount = viewData->getLength();
+
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo appLocalizableInfo;
+
+ LOGINFO("for each AppLocalizableInfoAttribute retrieve all tags");
+ // for each AppLocalizableInfoAttribute retrieve all tags
+ for( XMLSize_t index = 0; index < attributeCount; ++index )
+ {
+ DOMElement* currentLocalizableAttribute = static_cast< xercesc::DOMElement* >( localizableAttributes->item(index) );
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TLocalizableAttribute appLocalizableAttribute = GetAppLocalizableAttribute(currentLocalizableAttribute);
+ appLocalizableInfo.iLocalizableAttribute.push_back(appLocalizableAttribute);
+ }
+
+ LOGINFO("for each AppLocalizableViewData retrieve all tags");
+ // for each AppLocalizableViewData retrieve all tags
+
+ for( XMLSize_t index = 0; index < viewDataCount; ++index )
+ {
+ DOMElement* currentLocalizableViewData = static_cast< xercesc::DOMElement* >( viewData->item(index) );
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData appLocalizableViewData = GetAppLocalizableViewData(currentLocalizableViewData);
+ LOGINFO("push_back viewdata");
+ appLocalizableInfo.iViewData.push_back(appLocalizableViewData);
+ }
+
+ LOGEXIT("CScrXmlParser::GetAppLocalizableInfo()");
+ return appLocalizableInfo;
+ }
+
+XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TLocalizableAttribute
+ CScrXmlParser::GetAppLocalizableAttribute( const DOMElement* aDOMElement)
+ {
+ LOGENTER("CScrXmlParser::GetAppLocalizableAttribute()");
+ // tags in AppLocalizableInfo
+ // tags in AppLocalizableInfoAttribute
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeName( &XMLString::release, XMLString::transcode("Name") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeValue( &XMLString::release, XMLString::transcode("LocalizableAttribute_Value") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeIsBinary( &XMLString::release, XMLString::transcode("LocalizableAttribute_IsBinary") );
+
+ // tags of AppLocalizableInfoAttribute_Value
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeIntValue( &XMLString::release, XMLString::transcode("LocalizableAttribute_IntValue") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeStrValue( &XMLString::release, XMLString::transcode("LocalizableAttribute_StrValue") );
+
+ LOGINFO("attribute - name");
+ // attribute - name
+ DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
+ DOMNode* name = attributes->getNamedItem(tagAppLocalizableInfoAttributeName.get());
+
+ DOMNodeList* value = aDOMElement->getElementsByTagName(tagAppLocalizableInfoAttributeValue.get());
+ DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagAppLocalizableInfoAttributeIsBinary.get());
+
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TLocalizableAttribute appLocalizableAttribute;
+
+ LOGINFO("name->getTextContent");
+ const XMLCh* textName = name->getTextContent();
+ appLocalizableAttribute.iName = XMLChToWString(textName);
+
+ DOMNodeList* childNodes = value->item(0)->getChildNodes();
+ const XMLSize_t nodeCount = childNodes->getLength();
+
+ for(int index = 0; index< nodeCount; ++index)
+ {
+ DOMElement* currentElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) );
+ if( XMLString::equals(currentElement->getTagName(), tagAppLocalizableInfoAttributeIntValue.get()))
+ {
+ appLocalizableAttribute.iIsIntValue = true;
+ appLocalizableAttribute.iValue = XMLChToWString(currentElement->getTextContent());
+ break;
+ }
+ else if( XMLString::equals(currentElement->getTagName(), tagAppLocalizableInfoAttributeStrValue.get()))
+ {
+ appLocalizableAttribute.iIsIntValue = false;
+ appLocalizableAttribute.iValue = XMLChToWString(currentElement->getTextContent());
+ break;
+ }
+ }
+
+ if(isBinary->getLength() != 0)
+ {
+ const XMLCh* textIsBinary = isBinary->item(0)->getTextContent();
+ appLocalizableAttribute.iIsStr8Bit = XercesStringToInteger(textIsBinary);
+ }
+
+ LOGEXIT("CScrXmlParser::GetAppLocalizableAttribute()");
+ return appLocalizableAttribute;
+ }
+
+
+XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData
+ CScrXmlParser::GetAppLocalizableViewData( const DOMElement* aDOMElement)
+ {
+ LOGENTER("CScrXmlParser::GetAppLocalizableViewData()");
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoViewDataAttribute ( &XMLString::release, XMLString::transcode("ViewDataAttribute") );
+
+ DOMNodeList* viewDataAttr = aDOMElement->getElementsByTagName(tagAppLocalizableInfoViewDataAttribute.get());
+ const XMLSize_t viewDataAttrCount = viewDataAttr->getLength();
+
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData appViewData;
+
+ for( XMLSize_t index = 0; index < viewDataAttrCount; ++index )
+ {
+ DOMElement* currentLocalizableViewData = static_cast< xercesc::DOMElement* >( viewDataAttr->item(index) );
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData::TViewDataAttributes appLocalizableViewData = GetAppLocalizableViewDataAttributes(currentLocalizableViewData);
+ LOGINFO("push_back viewdata");
+ appViewData.iViewDataAttributes.push_back(appLocalizableViewData);
+ }
+ LOGEXIT("CScrXmlParser::GetAppLocalizableViewData()");
+ return appViewData;
+ }
+
+XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData::TViewDataAttributes
+ CScrXmlParser::GetAppLocalizableViewDataAttributes( const DOMElement* aDOMElement)
+ {
+ LOGENTER("CScrXmlParser::GetAppLocalizableViewDataAttributes()");
+ // tags in AppLocalizableViewData
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataName( &XMLString::release, XMLString::transcode("Name") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataValue( &XMLString::release, XMLString::transcode("ViewData_Value") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataIsBinary( &XMLString::release, XMLString::transcode("ViewData_IsBinary") );
+
+ // tags of AppLocalizableViewData_Value
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataIntValue( &XMLString::release, XMLString::transcode("ViewData_IntValue") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataStrValue( &XMLString::release, XMLString::transcode("ViewData_StrValue") );
+
+ LOGINFO("attribute - name");
+ // attribute - name
+ DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
+ DOMNode* name = attributes->getNamedItem(tagAppLocalizableViewDataName.get());
+
+ DOMNodeList* value = aDOMElement->getElementsByTagName(tagAppLocalizableViewDataValue.get());
+ DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagAppLocalizableViewDataIsBinary.get());
+
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData::TViewDataAttributes appLocalizableViewDataAttribute;
+
+ LOGINFO("name->getTextContent");
+ const XMLCh* textName = name->getTextContent();
+ LOGINFO("assign name");
+ appLocalizableViewDataAttribute.iName = XMLChToWString(textName);
+
+ LOGINFO("getChildNodes()");
+ DOMNodeList* childNodes = value->item(0)->getChildNodes();
+ LOGINFO("childNodes->getLength()");
+ const XMLSize_t nodeCount = childNodes->getLength();
+
+ for(int index = 0; index< nodeCount; ++index)
+ {
+ DOMElement* currentElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) );
+ if( XMLString::equals(currentElement->getTagName(), tagAppLocalizableViewDataIntValue.get()))
+ {
+ LOGINFO("int value");
+ appLocalizableViewDataAttribute.iIsIntValue = true;
+ appLocalizableViewDataAttribute.iValue = XMLChToWString(currentElement->getTextContent());
+ break;
+ }
+ else if( XMLString::equals(currentElement->getTagName(), tagAppLocalizableViewDataStrValue.get()))
+ {
+ LOGINFO("str value");
+ appLocalizableViewDataAttribute.iIsIntValue = false;
+ appLocalizableViewDataAttribute.iValue = XMLChToWString(currentElement->getTextContent());
+ break;
+ }
+ }
+
+ if(isBinary->getLength() != 0)
+ {
+ LOGINFO("bin value");
+ const XMLCh* textIsBinary = isBinary->item(0)->getTextContent();
+ appLocalizableViewDataAttribute.iIsStr8Bit = XercesStringToInteger(textIsBinary);
+ }
+ LOGEXIT("CScrXmlParser::GetAppLocalizableViewDataAttributes()");
+ return appLocalizableViewDataAttribute;
+ }
+
+
+XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty
+ CScrXmlParser::GetAppProperty( const DOMElement* aDOMElement)
+ {
+ LOGENTER("CScrXmlParser::GetAppProperty()");
+ // tags in AppProperty
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyLocale( &XMLString::release, XMLString::transcode("Locale") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyName( &XMLString::release, XMLString::transcode("Name") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyIntValue( &XMLString::release, XMLString::transcode("IntValue") );
+ fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyStrValue( &XMLString::release, XMLString::transcode("StrValue") );
+
+ DOMNodeList* locale = aDOMElement->getElementsByTagName(tagAppPropertyLocale.get());
+ DOMNodeList* name = aDOMElement->getElementsByTagName(tagAppPropertyName.get());
+ DOMNodeList* intvalue = aDOMElement->getElementsByTagName(tagAppPropertyIntValue.get());
+ DOMNodeList* strvalue = aDOMElement->getElementsByTagName(tagAppPropertyStrValue.get());
+
+ XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty;
+
+ if( locale->getLength() != 0)
+ {
+ const XMLCh* loc = locale->item(0)->getTextContent();
+ appProperty.iLocale = XercesStringToInteger(loc);
+ }
+
+ if( name->getLength() != 0)
+ {
+ const XMLCh* nam = name->item(0)->getTextContent();
+ appProperty.iName = XMLChToWString(nam);
+ }
+
+ if( intvalue->getLength() != 0)
+ {
+ const XMLCh* intval = intvalue->item(0)->getTextContent();
+ appProperty.iIntValue = XercesStringToInteger(intval);
+ }
+ else if( strvalue->getLength() != 0)
+ {
+ const XMLCh* strval = strvalue->item(0)->getTextContent();
+ appProperty.iStrValue = XMLChToWString(strval);
+ }
+
+ appProperty.iIsStr8Bit = false;
+
+ LOGEXIT("CScrXmlParser::GetAppProperty()");
+ return appProperty;
}
void CScrXmlParser::ConfigDomParser(xercesc::XercesDOMParser& aDomParser)
@@ -787,3 +1459,5 @@
std::string msg( "Resetting error handler object" );
LOGINFO(msg);
}
+
+