735 const XMLCh* textLocale = locale->getTextContent(); |
763 const XMLCh* textLocale = locale->getTextContent(); |
736 localizedSwTypeName.iLocale = Util::WideCharToInteger(textLocale); |
764 localizedSwTypeName.iLocale = Util::WideCharToInteger(textLocale); |
737 |
765 |
738 const XMLCh* textName = name->getTextContent(); |
766 const XMLCh* textName = name->getTextContent(); |
739 localizedSwTypeName.iName = textName; |
767 localizedSwTypeName.iName = textName; |
740 |
768 LOGEXIT("CScrXmlParser::GetLocalizedSoftwareTypeName()"); |
741 return localizedSwTypeName; |
769 return localizedSwTypeName; |
|
770 } |
|
771 |
|
772 XmlDetails::TScrEnvironmentDetails::TCustomAcessList |
|
773 CScrXmlParser::GetCustomAcessList(const DOMElement* aDOMElement) |
|
774 { |
|
775 LOGENTER("CScrXmlParser::GetCustomAcessList()"); |
|
776 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSecureId( &XMLString::release, XMLString::transcode("SecureId") ); |
|
777 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAccessMode( &XMLString::release, XMLString::transcode("AccessMode") ); |
|
778 |
|
779 DOMNamedNodeMap* attributes = aDOMElement->getAttributes(); |
|
780 DOMNode* secureId = attributes->getNamedItem(tagSecureId.get()); |
|
781 DOMNode* accessMode = attributes->getNamedItem(tagAccessMode.get()); |
|
782 |
|
783 XmlDetails::TScrEnvironmentDetails::TCustomAcessList customAcessList; |
|
784 |
|
785 fn_auto_ptr<releaseChPtr,char> textSecureId(&XMLString::release, XMLString::transcode(secureId->getTextContent())); |
|
786 int secureIdVal=0; |
|
787 sscanf(textSecureId.get(),"%x",&secureIdVal); |
|
788 customAcessList.iSecureId = secureIdVal; |
|
789 |
|
790 const XMLCh* textAccessMode = accessMode->getTextContent(); |
|
791 customAcessList.iAccessMode = Util::WideCharToInteger(textAccessMode); |
|
792 LOGEXIT("CScrXmlParser::GetCustomAcessList()"); |
|
793 return customAcessList; |
|
794 } |
|
795 |
|
796 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo CScrXmlParser::GetApplicationRegistrationInfo(const DOMElement* aDOMElement) |
|
797 { |
|
798 LOGENTER("CScrXmlParser::GetApplicationRegistrationInfo()"); |
|
799 // tags in ApplicationRegistrationInfo |
|
800 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppAttribute( &XMLString::release, XMLString::transcode("ApplicationAttribute") ); |
|
801 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoOpaqueData ( &XMLString::release, XMLString::transcode("OpaqueData") ); |
|
802 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoFileOwnershipInfo( &XMLString::release, XMLString::transcode("FileOwnershipinfo") ); |
|
803 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppDataType( &XMLString::release, XMLString::transcode("ApplicationDataType") ); |
|
804 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppServiceInfo( &XMLString::release, XMLString::transcode("ApplicationServiceInfo") ); |
|
805 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppLocalizableInfo( &XMLString::release, XMLString::transcode("ApplicationLocalizableInfo") ); |
|
806 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppProperty( &XMLString::release, XMLString::transcode("ApplicationProperty") ); |
|
807 |
|
808 DOMNodeList* appAttributes = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppAttribute.get()); |
|
809 const XMLSize_t appAttributeCount = appAttributes->getLength(); |
|
810 DOMNodeList* OpaqueData = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoOpaqueData.get()); |
|
811 const XMLSize_t OpaqueDataCount = OpaqueData->getLength(); |
|
812 DOMNodeList* fileOwnershipInfos = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoFileOwnershipInfo.get()); |
|
813 const XMLSize_t fileOwnershipInfoCount = fileOwnershipInfos->getLength(); |
|
814 DOMNodeList* appServiceInfos = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppServiceInfo.get()); |
|
815 const XMLSize_t appServiceInfoCount = appServiceInfos->getLength(); |
|
816 DOMNodeList* appLocalizableInfos = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppLocalizableInfo.get()); |
|
817 const XMLSize_t appLocalizableInfoCount = appLocalizableInfos->getLength(); |
|
818 DOMNodeList* appProperties = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppProperty.get()); |
|
819 const XMLSize_t appPropertyCount = appProperties->getLength(); |
|
820 |
|
821 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo appRegistrationInfo; |
|
822 |
|
823 // for each AppAttribute retrieve all tags |
|
824 for( XMLSize_t index = 0; index < appAttributeCount; ++index ) |
|
825 { |
|
826 DOMElement* currentappAttribute = static_cast< xercesc::DOMElement* >( appAttributes->item(index) ); |
|
827 |
|
828 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppAttribute appAttribute = GetAppAttribute(currentappAttribute); |
|
829 appRegistrationInfo.iApplicationAttribute.push_back(appAttribute); |
|
830 } |
|
831 |
|
832 // for each OpaqueData retrieve all tags |
|
833 for( XMLSize_t index = 0; index < OpaqueDataCount; ++index ) |
|
834 { |
|
835 DOMElement* currentOpaqueData = static_cast< xercesc::DOMElement* >( OpaqueData->item(index) ); |
|
836 |
|
837 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty; |
|
838 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType = GetOpaqueDataType(currentOpaqueData); |
|
839 |
|
840 appProperty.iLocale = opaqueDataType.iLocale; |
|
841 appProperty.iName = L"OpaqueData"; |
|
842 appProperty.iIntValue = 0; |
|
843 appProperty.iIsStr8Bit = true; |
|
844 appProperty.iServiceUid = 0; |
|
845 appProperty.iStrValue = opaqueDataType.iOpaqueData; |
|
846 |
|
847 appRegistrationInfo.iApplicationProperty.push_back(appProperty); |
|
848 } |
|
849 |
|
850 // for each FileOwnershipInfo retrieve all tags |
|
851 for( XMLSize_t index = 0; index < fileOwnershipInfoCount; ++index ) |
|
852 { |
|
853 DOMElement* currentFileOwnershipInfo = static_cast< xercesc::DOMElement* >( fileOwnershipInfos->item(index) ); |
|
854 |
|
855 std::wstring file = GetFileOwnershipInfo(currentFileOwnershipInfo); |
|
856 |
|
857 appRegistrationInfo.iFileOwnershipInfo.push_back(file); |
|
858 } |
|
859 |
|
860 // for each appServiceInfo retrieve all tags |
|
861 for( XMLSize_t index = 0; index < appServiceInfoCount; ++index ) |
|
862 { |
|
863 DOMElement* currentappServiceInfo = static_cast< xercesc::DOMElement* >( appServiceInfos->item(index) ); |
|
864 |
|
865 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppServiceInfo appServiceInfo = GetAppServiceInfo(currentappServiceInfo, appRegistrationInfo); |
|
866 appRegistrationInfo.iApplicationServiceInfo.push_back(appServiceInfo); |
|
867 } |
|
868 |
|
869 // for each appLocalizableInfo retrieve all tags |
|
870 for( XMLSize_t index = 0; index < appLocalizableInfoCount; ++index ) |
|
871 { |
|
872 DOMElement* currentAppLocalizableInfo = static_cast< xercesc::DOMElement* >( appLocalizableInfos->item(index) ); |
|
873 |
|
874 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo appLocalizableInfo = GetAppLocalizableInfo(currentAppLocalizableInfo); |
|
875 appRegistrationInfo.iApplicationLocalizableInfo.push_back(appLocalizableInfo); |
|
876 } |
|
877 |
|
878 // for each AppProperty retrieve all tags |
|
879 for( XMLSize_t index = 0; index < appPropertyCount; ++index ) |
|
880 { |
|
881 DOMElement* currentAppProperty = static_cast< xercesc::DOMElement* >( appProperties->item(index) ); |
|
882 |
|
883 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty = GetAppProperty(currentAppProperty); |
|
884 appRegistrationInfo.iApplicationProperty.push_back(appProperty); |
|
885 } |
|
886 LOGEXIT("CScrXmlParser::GetApplicationRegistrationInfo()"); |
|
887 return appRegistrationInfo; |
|
888 } |
|
889 |
|
890 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppAttribute |
|
891 CScrXmlParser::GetAppAttribute( const DOMElement* aDOMElement) |
|
892 { |
|
893 LOGENTER("CScrXmlParser::GetAppAttribute()"); |
|
894 // tags in AppAttribute |
|
895 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppAttributeName( &XMLString::release, XMLString::transcode("Name") ); |
|
896 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppAttributeValue( &XMLString::release, XMLString::transcode("ApplicationAttribute_Value") ); |
|
897 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppAttributeIsBinary( &XMLString::release, XMLString::transcode("ApplicationAttribute_IsBinary") ); |
|
898 |
|
899 // tags of ComponentProperty_Value |
|
900 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationAttributeIntValue( &XMLString::release, XMLString::transcode("ApplicationAttribute_IntValue") ); |
|
901 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationAttributeStrValue( &XMLString::release, XMLString::transcode("ApplicationAttribute_StrValue") ); |
|
902 |
|
903 // attribute - name |
|
904 DOMNamedNodeMap* attributes = aDOMElement->getAttributes(); |
|
905 DOMNode* name = attributes->getNamedItem(tagAppAttributeName.get()); |
|
906 |
|
907 DOMNodeList* value = aDOMElement->getElementsByTagName(tagAppAttributeValue.get()); |
|
908 DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagAppAttributeIsBinary.get()); |
|
909 |
|
910 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppAttribute appAttribute; |
|
911 |
|
912 const XMLCh* textName = name->getTextContent(); |
|
913 appAttribute.iName = textName; |
|
914 |
|
915 DOMNodeList* childNodes = value->item(0)->getChildNodes(); |
|
916 const XMLSize_t nodeCount = childNodes->getLength(); |
|
917 |
|
918 for(int index = 0; index< nodeCount; ++index) |
|
919 { |
|
920 DOMElement* currentElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) ); |
|
921 if( XMLString::equals(currentElement->getTagName(), tagApplicationAttributeIntValue.get())) |
|
922 { |
|
923 appAttribute.iIsIntValue = true; |
|
924 appAttribute.iValue = currentElement->getTextContent(); |
|
925 break; |
|
926 } |
|
927 else if( XMLString::equals(currentElement->getTagName(), tagApplicationAttributeStrValue.get())) |
|
928 { |
|
929 appAttribute.iIsIntValue = false; |
|
930 appAttribute.iValue = currentElement->getTextContent(); |
|
931 break; |
|
932 } |
|
933 } |
|
934 |
|
935 if(isBinary->getLength() != 0) |
|
936 { |
|
937 const XMLCh* textIsBinary = isBinary->item(0)->getTextContent(); |
|
938 appAttribute.iIsStr8Bit = Util::WideCharToInteger(textIsBinary); |
|
939 } |
|
940 LOGEXIT("CScrXmlParser::GetAppAttribute()"); |
|
941 return appAttribute; |
|
942 } |
|
943 |
|
944 std::wstring CScrXmlParser::GetFileOwnershipInfo( const DOMElement* aDOMElement) |
|
945 { |
|
946 LOGENTER("CScrXmlParser::GetFileOwnershipInfo()"); |
|
947 // tags in FileOwnershipInfo |
|
948 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFileName( &XMLString::release, XMLString::transcode("FileName") ); |
|
949 |
|
950 DOMNodeList* fileName = aDOMElement->getElementsByTagName(tagFileName.get()); |
|
951 |
|
952 std::wstring file; |
|
953 |
|
954 if( fileName->getLength() != 0) |
|
955 { |
|
956 const XMLCh* fil = fileName->item(0)->getTextContent(); |
|
957 file = fil; |
|
958 } |
|
959 |
|
960 LOGEXIT("CScrXmlParser::GetFileOwnershipInfo()"); |
|
961 return file; |
|
962 } |
|
963 |
|
964 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TDataType |
|
965 CScrXmlParser::GetDataType( const DOMElement* aDOMElement) |
|
966 { |
|
967 LOGENTER("CScrXmlParser::GetDataType()"); |
|
968 // tags in DataType |
|
969 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDataTypePriority( &XMLString::release, XMLString::transcode("Priority") ); |
|
970 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDataType( &XMLString::release, XMLString::transcode("Type") ); |
|
971 |
|
972 DOMNodeList* priority = aDOMElement->getElementsByTagName(tagDataTypePriority.get()); |
|
973 DOMNodeList* type = aDOMElement->getElementsByTagName(tagDataType.get()); |
|
974 |
|
975 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TDataType dataType; |
|
976 |
|
977 if( priority->getLength() != 0) |
|
978 { |
|
979 const XMLCh* pri = priority->item(0)->getTextContent(); |
|
980 dataType.iPriority = Util::WideCharToInteger(pri); |
|
981 } |
|
982 |
|
983 if( type->getLength() != 0) |
|
984 { |
|
985 const XMLCh* typ = type->item(0)->getTextContent(); |
|
986 dataType.iType = typ; |
|
987 } |
|
988 LOGEXIT("CScrXmlParser::GetDataType()"); |
|
989 return dataType; |
|
990 } |
|
991 |
|
992 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType |
|
993 CScrXmlParser::GetOpaqueDataType( const DOMElement* aDOMElement) |
|
994 { |
|
995 LOGENTER("CScrXmlParser::GetOpaqueDataType()"); |
|
996 // tags in OpaqueDataType |
|
997 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagData( &XMLString::release, XMLString::transcode("Data") ); |
|
998 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagOpaqueLocale( &XMLString::release, XMLString::transcode("OpaqueLocale") ); |
|
999 |
|
1000 DOMNodeList* Data = aDOMElement->getElementsByTagName(tagData.get()); |
|
1001 DOMNodeList* OpaqueLocale = aDOMElement->getElementsByTagName(tagOpaqueLocale.get()); |
|
1002 |
|
1003 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType; |
|
1004 |
|
1005 if( OpaqueLocale->getLength() != 0) |
|
1006 { |
|
1007 const XMLCh* pri = OpaqueLocale->item(0)->getTextContent(); |
|
1008 opaqueDataType.iLocale = Util::WideCharToInteger(pri); |
|
1009 } |
|
1010 |
|
1011 if( Data->getLength() != 0) |
|
1012 { |
|
1013 const XMLCh* typ = Data->item(0)->getTextContent(); |
|
1014 opaqueDataType.iOpaqueData = typ; |
|
1015 } |
|
1016 LOGEXIT("CScrXmlParser::GetOpaqueDataType()"); |
|
1017 return opaqueDataType; |
|
1018 } |
|
1019 |
|
1020 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType |
|
1021 CScrXmlParser::GetServiceOpaqueDataType( const DOMElement* aDOMElement) |
|
1022 { |
|
1023 LOGENTER("CScrXmlParser::GetServiceOpaqueDataType()"); |
|
1024 // tags in OpaqueDataType |
|
1025 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagServiceData( &XMLString::release, XMLString::transcode("ServiceData") ); |
|
1026 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagServiceOpaqueLocale( &XMLString::release, XMLString::transcode("ServiceOpaqueLocale") ); |
|
1027 |
|
1028 DOMNodeList* ServiceData = aDOMElement->getElementsByTagName(tagServiceData.get()); |
|
1029 DOMNodeList* ServiceOpaqueLocale = aDOMElement->getElementsByTagName(tagServiceOpaqueLocale.get()); |
|
1030 |
|
1031 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType; |
|
1032 |
|
1033 if( ServiceOpaqueLocale->getLength() != 0) |
|
1034 { |
|
1035 const XMLCh* pri = ServiceOpaqueLocale->item(0)->getTextContent(); |
|
1036 opaqueDataType.iLocale = Util::WideCharToInteger(pri); |
|
1037 } |
|
1038 |
|
1039 if( ServiceData->getLength() != 0) |
|
1040 { |
|
1041 const XMLCh* typ = ServiceData->item(0)->getTextContent(); |
|
1042 opaqueDataType.iOpaqueData = typ; |
|
1043 } |
|
1044 LOGEXIT("CScrXmlParser::GetServiceOpaqueDataType()"); |
|
1045 return opaqueDataType; |
|
1046 } |
|
1047 |
|
1048 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppServiceInfo |
|
1049 CScrXmlParser::GetAppServiceInfo( const DOMElement* aDOMElement, XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo& aAppRegistrationInfo ) |
|
1050 { |
|
1051 LOGENTER("CScrXmlParser::GetAppServiceInfo()"); |
|
1052 // tags in AppServiceInfo |
|
1053 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppServiceInfoUid( &XMLString::release, XMLString::transcode("Uid") ); |
|
1054 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppServiceAppProperty( &XMLString::release, XMLString::transcode("ServiceOpaqueData") ); |
|
1055 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppServiceInfoDataType( &XMLString::release, XMLString::transcode("ApplicationDataType") ); |
|
1056 |
|
1057 DOMNodeList* uid = aDOMElement->getElementsByTagName(tagAppServiceInfoUid.get()); |
|
1058 |
|
1059 DOMNodeList* ServiceOpaqueData = aDOMElement->getElementsByTagName(tagAppServiceAppProperty.get()); |
|
1060 const XMLSize_t ServiceOpaqueDataCount = ServiceOpaqueData->getLength(); |
|
1061 |
|
1062 DOMNodeList* dataTypes = aDOMElement->getElementsByTagName(tagAppServiceInfoDataType.get()); |
|
1063 const XMLSize_t dataTypeCount = dataTypes->getLength(); |
|
1064 |
|
1065 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppServiceInfo appServiceInfo; |
|
1066 |
|
1067 if( uid->getLength() != 0) |
|
1068 { |
|
1069 const XMLCh* priority = uid->item(0)->getTextContent(); |
|
1070 appServiceInfo.iUid = Util::WideCharToInteger(priority); |
|
1071 } |
|
1072 |
|
1073 // for each OpaqueData retrieve all tags |
|
1074 for( XMLSize_t index = 0; index < ServiceOpaqueDataCount; ++index ) |
|
1075 { |
|
1076 DOMElement* currentOpaqueData = static_cast< xercesc::DOMElement* >( ServiceOpaqueData->item(index) ); |
|
1077 |
|
1078 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty; |
|
1079 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType = GetServiceOpaqueDataType(currentOpaqueData); |
|
1080 |
|
1081 appProperty.iLocale = opaqueDataType.iLocale; |
|
1082 appProperty.iName = L"OpaqueData"; |
|
1083 appProperty.iIntValue = 0; |
|
1084 appProperty.iIsStr8Bit = true; |
|
1085 appProperty.iServiceUid = appServiceInfo.iUid; |
|
1086 appProperty.iStrValue = opaqueDataType.iOpaqueData; |
|
1087 |
|
1088 aAppRegistrationInfo.iApplicationProperty.push_back(appProperty); |
|
1089 } |
|
1090 |
|
1091 // for each DataType retrieve all tags |
|
1092 for( XMLSize_t index = 0; index < dataTypeCount; ++index ) |
|
1093 { |
|
1094 DOMElement* currentDataType = static_cast< xercesc::DOMElement* >( dataTypes->item(index) ); |
|
1095 |
|
1096 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TDataType dataType = GetDataType(currentDataType); |
|
1097 appServiceInfo.iDataType.push_back(dataType); |
|
1098 } |
|
1099 LOGEXIT("CScrXmlParser::GetAppServiceInfo()"); |
|
1100 return appServiceInfo; |
|
1101 |
|
1102 } |
|
1103 |
|
1104 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo |
|
1105 CScrXmlParser::GetAppLocalizableInfo( const DOMElement* aDOMElement) |
|
1106 { |
|
1107 LOGENTER("CScrXmlParser::GetAppLocalizableInfo()"); |
|
1108 // tags in AppLocalizableInfo |
|
1109 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttribute( &XMLString::release, XMLString::transcode("LocalizableAttribute") ); |
|
1110 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoViewData ( &XMLString::release, XMLString::transcode("ViewData") ); |
|
1111 |
|
1112 DOMNodeList* localizableAttributes = aDOMElement->getElementsByTagName(tagAppLocalizableInfoAttribute.get()); |
|
1113 const XMLSize_t attributeCount = localizableAttributes->getLength(); |
|
1114 DOMNodeList* viewData = aDOMElement->getElementsByTagName(tagAppLocalizableInfoViewData.get()); |
|
1115 const XMLSize_t viewDataCount = viewData->getLength(); |
|
1116 |
|
1117 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo appLocalizableInfo; |
|
1118 |
|
1119 LOGINFO("for each AppLocalizableInfoAttribute retrieve all tags"); |
|
1120 // for each AppLocalizableInfoAttribute retrieve all tags |
|
1121 for( XMLSize_t index = 0; index < attributeCount; ++index ) |
|
1122 { |
|
1123 DOMElement* currentLocalizableAttribute = static_cast< xercesc::DOMElement* >( localizableAttributes->item(index) ); |
|
1124 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TLocalizableAttribute appLocalizableAttribute = GetAppLocalizableAttribute(currentLocalizableAttribute); |
|
1125 appLocalizableInfo.iLocalizableAttribute.push_back(appLocalizableAttribute); |
|
1126 } |
|
1127 |
|
1128 LOGINFO("for each AppLocalizableViewData retrieve all tags"); |
|
1129 // for each AppLocalizableViewData retrieve all tags |
|
1130 |
|
1131 for( XMLSize_t index = 0; index < viewDataCount; ++index ) |
|
1132 { |
|
1133 DOMElement* currentLocalizableViewData = static_cast< xercesc::DOMElement* >( viewData->item(index) ); |
|
1134 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData appLocalizableViewData = GetAppLocalizableViewData(currentLocalizableViewData); |
|
1135 LOGINFO("push_back viewdata"); |
|
1136 appLocalizableInfo.iViewData.push_back(appLocalizableViewData); |
|
1137 } |
|
1138 |
|
1139 LOGEXIT("CScrXmlParser::GetAppLocalizableInfo()"); |
|
1140 return appLocalizableInfo; |
|
1141 } |
|
1142 |
|
1143 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TLocalizableAttribute |
|
1144 CScrXmlParser::GetAppLocalizableAttribute( const DOMElement* aDOMElement) |
|
1145 { |
|
1146 LOGENTER("CScrXmlParser::GetAppLocalizableAttribute()"); |
|
1147 // tags in AppLocalizableInfo |
|
1148 // tags in AppLocalizableInfoAttribute |
|
1149 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeName( &XMLString::release, XMLString::transcode("Name") ); |
|
1150 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeValue( &XMLString::release, XMLString::transcode("LocalizableAttribute_Value") ); |
|
1151 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeIsBinary( &XMLString::release, XMLString::transcode("LocalizableAttribute_IsBinary") ); |
|
1152 |
|
1153 // tags of AppLocalizableInfoAttribute_Value |
|
1154 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeIntValue( &XMLString::release, XMLString::transcode("LocalizableAttribute_IntValue") ); |
|
1155 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeStrValue( &XMLString::release, XMLString::transcode("LocalizableAttribute_StrValue") ); |
|
1156 |
|
1157 LOGINFO("attribute - name"); |
|
1158 // attribute - name |
|
1159 DOMNamedNodeMap* attributes = aDOMElement->getAttributes(); |
|
1160 DOMNode* name = attributes->getNamedItem(tagAppLocalizableInfoAttributeName.get()); |
|
1161 |
|
1162 DOMNodeList* value = aDOMElement->getElementsByTagName(tagAppLocalizableInfoAttributeValue.get()); |
|
1163 DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagAppLocalizableInfoAttributeIsBinary.get()); |
|
1164 |
|
1165 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TLocalizableAttribute appLocalizableAttribute; |
|
1166 |
|
1167 LOGINFO("name->getTextContent"); |
|
1168 const XMLCh* textName = name->getTextContent(); |
|
1169 appLocalizableAttribute.iName = textName; |
|
1170 |
|
1171 DOMNodeList* childNodes = value->item(0)->getChildNodes(); |
|
1172 const XMLSize_t nodeCount = childNodes->getLength(); |
|
1173 |
|
1174 for(int index = 0; index< nodeCount; ++index) |
|
1175 { |
|
1176 DOMElement* currentElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) ); |
|
1177 if( XMLString::equals(currentElement->getTagName(), tagAppLocalizableInfoAttributeIntValue.get())) |
|
1178 { |
|
1179 appLocalizableAttribute.iIsIntValue = true; |
|
1180 appLocalizableAttribute.iValue = currentElement->getTextContent(); |
|
1181 break; |
|
1182 } |
|
1183 else if( XMLString::equals(currentElement->getTagName(), tagAppLocalizableInfoAttributeStrValue.get())) |
|
1184 { |
|
1185 appLocalizableAttribute.iIsIntValue = false; |
|
1186 appLocalizableAttribute.iValue = currentElement->getTextContent(); |
|
1187 break; |
|
1188 } |
|
1189 } |
|
1190 |
|
1191 if(isBinary->getLength() != 0) |
|
1192 { |
|
1193 const XMLCh* textIsBinary = isBinary->item(0)->getTextContent(); |
|
1194 appLocalizableAttribute.iIsStr8Bit = Util::WideCharToInteger(textIsBinary); |
|
1195 } |
|
1196 |
|
1197 LOGEXIT("CScrXmlParser::GetAppLocalizableAttribute()"); |
|
1198 return appLocalizableAttribute; |
|
1199 } |
|
1200 |
|
1201 |
|
1202 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData |
|
1203 CScrXmlParser::GetAppLocalizableViewData( const DOMElement* aDOMElement) |
|
1204 { |
|
1205 LOGENTER("CScrXmlParser::GetAppLocalizableViewData()"); |
|
1206 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoViewDataAttribute ( &XMLString::release, XMLString::transcode("ViewDataAttribute") ); |
|
1207 |
|
1208 DOMNodeList* viewDataAttr = aDOMElement->getElementsByTagName(tagAppLocalizableInfoViewDataAttribute.get()); |
|
1209 const XMLSize_t viewDataAttrCount = viewDataAttr->getLength(); |
|
1210 |
|
1211 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData appViewData; |
|
1212 |
|
1213 for( XMLSize_t index = 0; index < viewDataAttrCount; ++index ) |
|
1214 { |
|
1215 DOMElement* currentLocalizableViewData = static_cast< xercesc::DOMElement* >( viewDataAttr->item(index) ); |
|
1216 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData::TViewDataAttributes appLocalizableViewData = GetAppLocalizableViewDataAttributes(currentLocalizableViewData); |
|
1217 LOGINFO("push_back viewdata"); |
|
1218 appViewData.iViewDataAttributes.push_back(appLocalizableViewData); |
|
1219 } |
|
1220 LOGEXIT("CScrXmlParser::GetAppLocalizableViewData()"); |
|
1221 return appViewData; |
|
1222 } |
|
1223 |
|
1224 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData::TViewDataAttributes |
|
1225 CScrXmlParser::GetAppLocalizableViewDataAttributes( const DOMElement* aDOMElement) |
|
1226 { |
|
1227 LOGENTER("CScrXmlParser::GetAppLocalizableViewDataAttributes()"); |
|
1228 // tags in AppLocalizableViewData |
|
1229 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataName( &XMLString::release, XMLString::transcode("Name") ); |
|
1230 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataValue( &XMLString::release, XMLString::transcode("ViewData_Value") ); |
|
1231 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataIsBinary( &XMLString::release, XMLString::transcode("ViewData_IsBinary") ); |
|
1232 |
|
1233 // tags of AppLocalizableViewData_Value |
|
1234 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataIntValue( &XMLString::release, XMLString::transcode("ViewData_IntValue") ); |
|
1235 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataStrValue( &XMLString::release, XMLString::transcode("ViewData_StrValue") ); |
|
1236 |
|
1237 LOGINFO("attribute - name"); |
|
1238 // attribute - name |
|
1239 DOMNamedNodeMap* attributes = aDOMElement->getAttributes(); |
|
1240 DOMNode* name = attributes->getNamedItem(tagAppLocalizableViewDataName.get()); |
|
1241 |
|
1242 DOMNodeList* value = aDOMElement->getElementsByTagName(tagAppLocalizableViewDataValue.get()); |
|
1243 DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagAppLocalizableViewDataIsBinary.get()); |
|
1244 |
|
1245 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData::TViewDataAttributes appLocalizableViewDataAttribute; |
|
1246 |
|
1247 LOGINFO("name->getTextContent"); |
|
1248 const XMLCh* textName = name->getTextContent(); |
|
1249 LOGINFO("assign name"); |
|
1250 appLocalizableViewDataAttribute.iName = textName; |
|
1251 |
|
1252 LOGINFO("getChildNodes()"); |
|
1253 DOMNodeList* childNodes = value->item(0)->getChildNodes(); |
|
1254 LOGINFO("childNodes->getLength()"); |
|
1255 const XMLSize_t nodeCount = childNodes->getLength(); |
|
1256 |
|
1257 for(int index = 0; index< nodeCount; ++index) |
|
1258 { |
|
1259 DOMElement* currentElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) ); |
|
1260 if( XMLString::equals(currentElement->getTagName(), tagAppLocalizableViewDataIntValue.get())) |
|
1261 { |
|
1262 LOGINFO("int value"); |
|
1263 appLocalizableViewDataAttribute.iIsIntValue = true; |
|
1264 appLocalizableViewDataAttribute.iValue = currentElement->getTextContent(); |
|
1265 break; |
|
1266 } |
|
1267 else if( XMLString::equals(currentElement->getTagName(), tagAppLocalizableViewDataStrValue.get())) |
|
1268 { |
|
1269 LOGINFO("str value"); |
|
1270 appLocalizableViewDataAttribute.iIsIntValue = false; |
|
1271 appLocalizableViewDataAttribute.iValue = currentElement->getTextContent(); |
|
1272 break; |
|
1273 } |
|
1274 } |
|
1275 |
|
1276 if(isBinary->getLength() != 0) |
|
1277 { |
|
1278 LOGINFO("bin value"); |
|
1279 const XMLCh* textIsBinary = isBinary->item(0)->getTextContent(); |
|
1280 appLocalizableViewDataAttribute.iIsStr8Bit = Util::WideCharToInteger(textIsBinary); |
|
1281 } |
|
1282 LOGEXIT("CScrXmlParser::GetAppLocalizableViewDataAttributes()"); |
|
1283 return appLocalizableViewDataAttribute; |
|
1284 } |
|
1285 |
|
1286 |
|
1287 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty |
|
1288 CScrXmlParser::GetAppProperty( const DOMElement* aDOMElement) |
|
1289 { |
|
1290 LOGENTER("CScrXmlParser::GetAppProperty()"); |
|
1291 // tags in AppProperty |
|
1292 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyLocale( &XMLString::release, XMLString::transcode("Locale") ); |
|
1293 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyName( &XMLString::release, XMLString::transcode("Name") ); |
|
1294 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyIntValue( &XMLString::release, XMLString::transcode("IntValue") ); |
|
1295 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyStrValue( &XMLString::release, XMLString::transcode("StrValue") ); |
|
1296 |
|
1297 DOMNodeList* locale = aDOMElement->getElementsByTagName(tagAppPropertyLocale.get()); |
|
1298 DOMNodeList* name = aDOMElement->getElementsByTagName(tagAppPropertyName.get()); |
|
1299 DOMNodeList* intvalue = aDOMElement->getElementsByTagName(tagAppPropertyIntValue.get()); |
|
1300 DOMNodeList* strvalue = aDOMElement->getElementsByTagName(tagAppPropertyStrValue.get()); |
|
1301 |
|
1302 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty; |
|
1303 |
|
1304 if( locale->getLength() != 0) |
|
1305 { |
|
1306 const XMLCh* loc = locale->item(0)->getTextContent(); |
|
1307 appProperty.iLocale = Util::WideCharToInteger(loc); |
|
1308 } |
|
1309 |
|
1310 if( name->getLength() != 0) |
|
1311 { |
|
1312 const XMLCh* nam = name->item(0)->getTextContent(); |
|
1313 appProperty.iName = nam; |
|
1314 } |
|
1315 |
|
1316 if( intvalue->getLength() != 0) |
|
1317 { |
|
1318 const XMLCh* intval = intvalue->item(0)->getTextContent(); |
|
1319 appProperty.iIntValue = Util::WideCharToInteger(intval); |
|
1320 } |
|
1321 |
|
1322 if( strvalue->getLength() != 0) |
|
1323 { |
|
1324 const XMLCh* strval = strvalue->item(0)->getTextContent(); |
|
1325 appProperty.iStrValue = strval; |
|
1326 } |
|
1327 LOGEXIT("CScrXmlParser::GetAppProperty()"); |
|
1328 return appProperty; |
742 } |
1329 } |
743 |
1330 |
744 void CScrXmlParser::ConfigDomParser(xercesc::XercesDOMParser& aDomParser) |
1331 void CScrXmlParser::ConfigDomParser(xercesc::XercesDOMParser& aDomParser) |
745 { |
1332 { |
746 aDomParser.setValidationScheme( XercesDOMParser::Val_Always ); |
1333 aDomParser.setValidationScheme( XercesDOMParser::Val_Always ); |