626 { |
697 { |
627 DOMElement* valueElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) ); |
698 DOMElement* valueElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) ); |
628 if( XMLString::equals(valueElement->getTagName(), tagFilePropertyIntValue.get())) |
699 if( XMLString::equals(valueElement->getTagName(), tagFilePropertyIntValue.get())) |
629 { |
700 { |
630 fileProperty.iIsIntValue = true; |
701 fileProperty.iIsIntValue = true; |
631 fileProperty.iValue = currentElement->getTextContent(); |
702 fileProperty.iValue = XMLChToWString(currentElement->getTextContent()); |
632 } |
703 } |
633 else if( XMLString::equals(valueElement->getTagName(), tagFilePropertyStrValue.get())) |
704 else if( XMLString::equals(valueElement->getTagName(), tagFilePropertyStrValue.get())) |
634 { |
705 { |
635 fileProperty.iIsIntValue = false; |
706 fileProperty.iIsIntValue = false; |
636 fileProperty.iValue = currentElement->getTextContent(); |
707 fileProperty.iValue = XMLChToWString(currentElement->getTextContent()); |
637 } |
708 } |
638 } |
709 } |
639 } |
710 } |
640 } |
711 } |
|
712 LOGEXIT("CScrXmlParser::GetFileProperty()"); |
641 return fileProperty; |
713 return fileProperty; |
642 } |
714 } |
643 |
715 |
644 XmlDetails::TScrPreProvisionDetail::TComponentDetails |
716 XmlDetails::TScrPreProvisionDetail::TComponentDetails |
645 CScrXmlParser::GetComponentDetails( const DOMElement* aDOMElement) |
717 CScrXmlParser::GetComponentDetails( const DOMElement* aDOMElement) |
646 { |
718 { |
|
719 LOGENTER("CScrXmlParser::GetComponentDetails()"); |
647 // tags for ComponentDetails |
720 // tags for ComponentDetails |
|
721 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagRomApplication( &XMLString::release, XMLString::transcode("RomApplication") ); |
648 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagRemovable( &XMLString::release, XMLString::transcode("Removable") ); |
722 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagRemovable( &XMLString::release, XMLString::transcode("Removable") ); |
649 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSize( &XMLString::release, XMLString::transcode("Size") ); |
723 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSize( &XMLString::release, XMLString::transcode("Size") ); |
650 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagScomoState( &XMLString::release, XMLString::transcode("ScomoState") ); |
724 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagScomoState( &XMLString::release, XMLString::transcode("ScomoState") ); |
651 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagGlobalId( &XMLString::release, XMLString::transcode("GlobalId") ); |
725 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagGlobalId( &XMLString::release, XMLString::transcode("GlobalId") ); |
652 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagVersion( &XMLString::release, XMLString::transcode("Version") ); |
726 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagVersion( &XMLString::release, XMLString::transcode("Version") ); |
653 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagOriginVerified( &XMLString::release, XMLString::transcode("OriginVerified") ); |
727 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagOriginVerified( &XMLString::release, XMLString::transcode("OriginVerified") ); |
654 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagHidden( &XMLString::release, XMLString::transcode("Hidden") ); |
728 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagHidden( &XMLString::release, XMLString::transcode("Hidden") ); |
655 |
729 |
656 XmlDetails::TScrPreProvisionDetail::TComponentDetails componentDetails; |
730 XmlDetails::TScrPreProvisionDetail::TComponentDetails componentDetails; |
657 |
731 |
|
732 DOMNodeList* romApplication = aDOMElement->getElementsByTagName(tagRomApplication.get()); |
658 DOMNodeList* removable = aDOMElement->getElementsByTagName(tagRemovable.get()); |
733 DOMNodeList* removable = aDOMElement->getElementsByTagName(tagRemovable.get()); |
659 DOMNodeList* size = aDOMElement->getElementsByTagName(tagSize.get()); |
734 DOMNodeList* size = aDOMElement->getElementsByTagName(tagSize.get()); |
660 DOMNodeList* scomoState = aDOMElement->getElementsByTagName(tagScomoState.get()); |
735 DOMNodeList* scomoState = aDOMElement->getElementsByTagName(tagScomoState.get()); |
661 DOMNodeList* globalId = aDOMElement->getElementsByTagName(tagGlobalId.get()); |
736 DOMNodeList* globalId = aDOMElement->getElementsByTagName(tagGlobalId.get()); |
662 DOMNodeList* versionDetail = aDOMElement->getElementsByTagName(tagVersion.get()); |
737 DOMNodeList* versionDetail = aDOMElement->getElementsByTagName(tagVersion.get()); |
663 DOMNodeList* originVerified = aDOMElement->getElementsByTagName(tagOriginVerified.get()); |
738 DOMNodeList* originVerified = aDOMElement->getElementsByTagName(tagOriginVerified.get()); |
664 DOMNodeList* hidden = aDOMElement->getElementsByTagName(tagHidden.get()); |
739 DOMNodeList* hidden = aDOMElement->getElementsByTagName(tagHidden.get()); |
665 |
740 |
|
741 if( romApplication->getLength() != 0) |
|
742 { |
|
743 LOGINFO("CScrXmlParser::GetComponentDetails()- rom app"); |
|
744 const XMLCh* textRomApplication = romApplication->item(0)->getTextContent(); |
|
745 componentDetails.iIsRomApplication = XercesStringToInteger(textRomApplication); |
|
746 } |
|
747 |
666 if( removable->getLength() != 0) |
748 if( removable->getLength() != 0) |
667 { |
749 { |
668 const XMLCh* textRemovable = removable->item(0)->getTextContent(); |
750 const XMLCh* textRemovable = removable->item(0)->getTextContent(); |
669 componentDetails.iIsRemovable = Util::WideCharToInteger(textRemovable); |
751 componentDetails.iIsRemovable = XercesStringToInteger(textRemovable); |
670 } |
752 } |
671 |
753 |
672 if( size->getLength() != 0) |
754 if( size->getLength() != 0) |
673 { |
755 { |
674 const XMLCh* textSize = size->item(0)->getTextContent(); |
756 const XMLCh* textSize = size->item(0)->getTextContent(); |
675 componentDetails.iSize = Util::WideCharToInteger(textSize); |
757 componentDetails.iSize = XercesStringToInteger(textSize); |
676 } |
758 } |
677 |
759 |
678 if( scomoState->getLength() != 0) |
760 if( scomoState->getLength() != 0) |
679 { |
761 { |
680 const XMLCh* textScomoState = scomoState->item(0)->getTextContent(); |
762 const XMLCh* textScomoState = scomoState->item(0)->getTextContent(); |
681 componentDetails.iScomoState = Util::WideCharToInteger(textScomoState); |
763 componentDetails.iScomoState = XercesStringToInteger(textScomoState); |
682 } |
764 } |
683 |
765 |
684 if( globalId->getLength() != 0) |
766 if( globalId->getLength() != 0) |
685 { |
767 { |
686 const XMLCh* textGlobalId = globalId->item(0)->getTextContent(); |
768 const XMLCh* textGlobalId = globalId->item(0)->getTextContent(); |
687 componentDetails.iGlobalId = textGlobalId; |
769 componentDetails.iGlobalId = XMLChToWString(textGlobalId); |
688 } |
770 } |
689 |
771 |
690 if( versionDetail->getLength() != 0) |
772 if( versionDetail->getLength() != 0) |
691 { |
773 { |
692 // tags for Version |
774 // tags for Version |
698 DOMNamedNodeMap* attributes = versionElement->getAttributes(); |
780 DOMNamedNodeMap* attributes = versionElement->getAttributes(); |
699 DOMNode* major = attributes->getNamedItem(tagMajor.get()); |
781 DOMNode* major = attributes->getNamedItem(tagMajor.get()); |
700 DOMNode* minor = attributes->getNamedItem(tagMinor.get()); |
782 DOMNode* minor = attributes->getNamedItem(tagMinor.get()); |
701 DOMNode* build = attributes->getNamedItem(tagBuild.get()); |
783 DOMNode* build = attributes->getNamedItem(tagBuild.get()); |
702 |
784 |
703 componentDetails.iVersion.iMajor = major->getTextContent(); |
785 componentDetails.iVersion.iMajor = XMLChToWString(major->getTextContent()); |
704 componentDetails.iVersion.iMinor = minor->getTextContent(); |
786 componentDetails.iVersion.iMinor = XMLChToWString(minor->getTextContent()); |
705 componentDetails.iVersion.iBuild = build->getTextContent(); |
787 componentDetails.iVersion.iBuild = XMLChToWString(build->getTextContent()); |
706 } |
788 } |
707 |
789 |
708 if( originVerified->getLength() != 0) |
790 if( originVerified->getLength() != 0) |
709 { |
791 { |
710 const XMLCh* textOriginVerified = originVerified->item(0)->getTextContent(); |
792 const XMLCh* textOriginVerified = originVerified->item(0)->getTextContent(); |
711 componentDetails.iOriginVerified = Util::WideCharToInteger(textOriginVerified); |
793 componentDetails.iOriginVerified = XercesStringToInteger(textOriginVerified); |
712 } |
794 } |
713 |
795 |
714 if( hidden->getLength() != 0) |
796 if( hidden->getLength() != 0) |
715 { |
797 { |
716 const XMLCh* textHidden = hidden->item(0)->getTextContent(); |
798 const XMLCh* textHidden = hidden->item(0)->getTextContent(); |
717 componentDetails.iIsHidden = Util::WideCharToInteger(textHidden); |
799 componentDetails.iIsHidden = XercesStringToInteger(textHidden); |
718 } |
800 } |
719 |
801 LOGEXIT("CScrXmlParser::GetComponentDetails()"); |
720 return componentDetails; |
802 return componentDetails; |
721 } |
803 } |
722 |
804 |
723 XmlDetails::TScrEnvironmentDetails::TLocalizedSoftwareTypeName |
805 XmlDetails::TScrEnvironmentDetails::TLocalizedSoftwareTypeName |
724 CScrXmlParser::GetLocalizedSoftwareTypeName(const DOMElement* aDOMElement) |
806 CScrXmlParser::GetLocalizedSoftwareTypeName(const DOMElement* aDOMElement) |
725 { |
807 { |
|
808 LOGENTER("CScrXmlParser::GetLocalizedSoftwareTypeName()"); |
726 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSwTypeNameLocale( &XMLString::release, XMLString::transcode("Locale") ); |
809 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSwTypeNameLocale( &XMLString::release, XMLString::transcode("Locale") ); |
727 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSwTypeNameValue( &XMLString::release, XMLString::transcode("Value") ); |
810 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSwTypeNameValue( &XMLString::release, XMLString::transcode("Value") ); |
728 |
811 |
729 DOMNamedNodeMap* attributes = aDOMElement->getAttributes(); |
812 DOMNamedNodeMap* attributes = aDOMElement->getAttributes(); |
730 DOMNode* locale = attributes->getNamedItem(tagSwTypeNameLocale.get()); |
813 DOMNode* locale = attributes->getNamedItem(tagSwTypeNameLocale.get()); |
731 DOMNode* name = attributes->getNamedItem(tagSwTypeNameValue.get()); |
814 DOMNode* name = attributes->getNamedItem(tagSwTypeNameValue.get()); |
732 |
815 |
733 XmlDetails::TScrEnvironmentDetails::TLocalizedSoftwareTypeName localizedSwTypeName; |
816 XmlDetails::TScrEnvironmentDetails::TLocalizedSoftwareTypeName localizedSwTypeName; |
734 |
817 |
735 const XMLCh* textLocale = locale->getTextContent(); |
818 const XMLCh* textLocale = locale->getTextContent(); |
736 localizedSwTypeName.iLocale = Util::WideCharToInteger(textLocale); |
819 localizedSwTypeName.iLocale = XercesStringToInteger(textLocale); |
737 |
820 |
738 const XMLCh* textName = name->getTextContent(); |
821 const XMLCh* textName = name->getTextContent(); |
739 localizedSwTypeName.iName = textName; |
822 localizedSwTypeName.iName = XMLChToWString(textName); |
740 |
823 LOGEXIT("CScrXmlParser::GetLocalizedSoftwareTypeName()"); |
741 return localizedSwTypeName; |
824 return localizedSwTypeName; |
|
825 } |
|
826 |
|
827 XmlDetails::TScrEnvironmentDetails::TCustomAcessList |
|
828 CScrXmlParser::GetCustomAcessList(const DOMElement* aDOMElement) |
|
829 { |
|
830 LOGENTER("CScrXmlParser::GetCustomAcessList()"); |
|
831 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSecureId( &XMLString::release, XMLString::transcode("SecureId") ); |
|
832 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAccessMode( &XMLString::release, XMLString::transcode("AccessMode") ); |
|
833 |
|
834 DOMNamedNodeMap* attributes = aDOMElement->getAttributes(); |
|
835 DOMNode* secureId = attributes->getNamedItem(tagSecureId.get()); |
|
836 DOMNode* accessMode = attributes->getNamedItem(tagAccessMode.get()); |
|
837 |
|
838 XmlDetails::TScrEnvironmentDetails::TCustomAcessList customAcessList; |
|
839 |
|
840 fn_auto_ptr<releaseChPtr,char> textSecureId(&XMLString::release, XMLString::transcode(secureId->getTextContent())); |
|
841 int secureIdVal=0; |
|
842 sscanf(textSecureId.get(),"%x",&secureIdVal); |
|
843 customAcessList.iSecureId = secureIdVal; |
|
844 |
|
845 const XMLCh* textAccessMode = accessMode->getTextContent(); |
|
846 customAcessList.iAccessMode = XercesStringToInteger(textAccessMode); |
|
847 LOGEXIT("CScrXmlParser::GetCustomAcessList()"); |
|
848 return customAcessList; |
|
849 } |
|
850 |
|
851 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo CScrXmlParser::GetApplicationRegistrationInfo(const DOMElement* aDOMElement) |
|
852 { |
|
853 LOGENTER("CScrXmlParser::GetApplicationRegistrationInfo()"); |
|
854 // tags in ApplicationRegistrationInfo |
|
855 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppAttribute( &XMLString::release, XMLString::transcode("ApplicationAttribute") ); |
|
856 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoOpaqueData ( &XMLString::release, XMLString::transcode("OpaqueData") ); |
|
857 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoFileOwnershipInfo( &XMLString::release, XMLString::transcode("FileOwnershipinfo") ); |
|
858 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppDataType( &XMLString::release, XMLString::transcode("ApplicationDataType") ); |
|
859 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppServiceInfo( &XMLString::release, XMLString::transcode("ApplicationServiceInfo") ); |
|
860 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppLocalizableInfo( &XMLString::release, XMLString::transcode("ApplicationLocalizableInfo") ); |
|
861 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppProperty( &XMLString::release, XMLString::transcode("ApplicationProperty") ); |
|
862 |
|
863 DOMNodeList* appAttributes = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppAttribute.get()); |
|
864 const XMLSize_t appAttributeCount = appAttributes->getLength(); |
|
865 DOMNodeList* OpaqueData = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoOpaqueData.get()); |
|
866 const XMLSize_t OpaqueDataCount = OpaqueData->getLength(); |
|
867 DOMNodeList* fileOwnershipInfos = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoFileOwnershipInfo.get()); |
|
868 const XMLSize_t fileOwnershipInfoCount = fileOwnershipInfos->getLength(); |
|
869 DOMNodeList* appServiceInfos = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppServiceInfo.get()); |
|
870 const XMLSize_t appServiceInfoCount = appServiceInfos->getLength(); |
|
871 DOMNodeList* appLocalizableInfos = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppLocalizableInfo.get()); |
|
872 const XMLSize_t appLocalizableInfoCount = appLocalizableInfos->getLength(); |
|
873 DOMNodeList* appProperties = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppProperty.get()); |
|
874 const XMLSize_t appPropertyCount = appProperties->getLength(); |
|
875 |
|
876 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo appRegistrationInfo; |
|
877 |
|
878 // for each AppAttribute retrieve all tags |
|
879 for( XMLSize_t index = 0; index < appAttributeCount; ++index ) |
|
880 { |
|
881 DOMElement* currentappAttribute = static_cast< xercesc::DOMElement* >( appAttributes->item(index) ); |
|
882 |
|
883 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppAttribute appAttribute = GetAppAttribute(currentappAttribute); |
|
884 appRegistrationInfo.iApplicationAttribute.push_back(appAttribute); |
|
885 } |
|
886 |
|
887 // for each OpaqueData retrieve all tags |
|
888 for( XMLSize_t index = 0; index < OpaqueDataCount; ++index ) |
|
889 { |
|
890 DOMElement* currentOpaqueData = static_cast< xercesc::DOMElement* >( OpaqueData->item(index) ); |
|
891 |
|
892 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty; |
|
893 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType = GetOpaqueDataType(currentOpaqueData); |
|
894 |
|
895 appProperty.iLocale = opaqueDataType.iLocale; |
|
896 appProperty.iName = L"OpaqueData"; |
|
897 appProperty.iIntValue = 0; |
|
898 appProperty.iIsStr8Bit = true; |
|
899 appProperty.iServiceUid = 0; |
|
900 |
|
901 if(opaqueDataType.iIsBinary == 1) |
|
902 { |
|
903 std::string str = wstring2string(opaqueDataType.iOpaqueData); |
|
904 std::string decodedString = Util::Base64Decode(str); |
|
905 int len = decodedString.length(); |
|
906 appProperty.iStrValue.assign(decodedString.c_str(),decodedString.c_str()+len); |
|
907 } |
|
908 else |
|
909 { |
|
910 appProperty.iStrValue = opaqueDataType.iOpaqueData; |
|
911 } |
|
912 |
|
913 appRegistrationInfo.iApplicationProperty.push_back(appProperty); |
|
914 } |
|
915 |
|
916 // for each FileOwnershipInfo retrieve all tags |
|
917 for( XMLSize_t index = 0; index < fileOwnershipInfoCount; ++index ) |
|
918 { |
|
919 DOMElement* currentFileOwnershipInfo = static_cast< xercesc::DOMElement* >( fileOwnershipInfos->item(index) ); |
|
920 |
|
921 std::wstring file = GetFileOwnershipInfo(currentFileOwnershipInfo); |
|
922 |
|
923 appRegistrationInfo.iFileOwnershipInfo.push_back(file); |
|
924 } |
|
925 |
|
926 // for each appServiceInfo retrieve all tags |
|
927 for( XMLSize_t index = 0; index < appServiceInfoCount; ++index ) |
|
928 { |
|
929 DOMElement* currentappServiceInfo = static_cast< xercesc::DOMElement* >( appServiceInfos->item(index) ); |
|
930 |
|
931 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppServiceInfo appServiceInfo = GetAppServiceInfo(currentappServiceInfo, appRegistrationInfo); |
|
932 appRegistrationInfo.iApplicationServiceInfo.push_back(appServiceInfo); |
|
933 } |
|
934 |
|
935 // for each appLocalizableInfo retrieve all tags |
|
936 for( XMLSize_t index = 0; index < appLocalizableInfoCount; ++index ) |
|
937 { |
|
938 DOMElement* currentAppLocalizableInfo = static_cast< xercesc::DOMElement* >( appLocalizableInfos->item(index) ); |
|
939 |
|
940 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo appLocalizableInfo = GetAppLocalizableInfo(currentAppLocalizableInfo); |
|
941 appRegistrationInfo.iApplicationLocalizableInfo.push_back(appLocalizableInfo); |
|
942 } |
|
943 |
|
944 // for each AppProperty retrieve all tags |
|
945 for( XMLSize_t index = 0; index < appPropertyCount; ++index ) |
|
946 { |
|
947 DOMElement* currentAppProperty = static_cast< xercesc::DOMElement* >( appProperties->item(index) ); |
|
948 |
|
949 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty = GetAppProperty(currentAppProperty); |
|
950 appRegistrationInfo.iApplicationProperty.push_back(appProperty); |
|
951 } |
|
952 LOGEXIT("CScrXmlParser::GetApplicationRegistrationInfo()"); |
|
953 return appRegistrationInfo; |
|
954 } |
|
955 |
|
956 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppAttribute |
|
957 CScrXmlParser::GetAppAttribute( const DOMElement* aDOMElement) |
|
958 { |
|
959 LOGENTER("CScrXmlParser::GetAppAttribute()"); |
|
960 // tags in AppAttribute |
|
961 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppAttributeName( &XMLString::release, XMLString::transcode("Name") ); |
|
962 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppAttributeValue( &XMLString::release, XMLString::transcode("ApplicationAttribute_Value") ); |
|
963 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppAttributeIsBinary( &XMLString::release, XMLString::transcode("ApplicationAttribute_IsBinary") ); |
|
964 |
|
965 // tags of ComponentProperty_Value |
|
966 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationAttributeIntValue( &XMLString::release, XMLString::transcode("ApplicationAttribute_IntValue") ); |
|
967 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationAttributeStrValue( &XMLString::release, XMLString::transcode("ApplicationAttribute_StrValue") ); |
|
968 |
|
969 // attribute - name |
|
970 DOMNamedNodeMap* attributes = aDOMElement->getAttributes(); |
|
971 DOMNode* name = attributes->getNamedItem(tagAppAttributeName.get()); |
|
972 |
|
973 DOMNodeList* value = aDOMElement->getElementsByTagName(tagAppAttributeValue.get()); |
|
974 DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagAppAttributeIsBinary.get()); |
|
975 |
|
976 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppAttribute appAttribute; |
|
977 |
|
978 const XMLCh* textName = name->getTextContent(); |
|
979 appAttribute.iName = XMLChToWString(textName); |
|
980 |
|
981 DOMNodeList* childNodes = value->item(0)->getChildNodes(); |
|
982 const XMLSize_t nodeCount = childNodes->getLength(); |
|
983 |
|
984 for(int index = 0; index< nodeCount; ++index) |
|
985 { |
|
986 DOMElement* currentElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) ); |
|
987 if( XMLString::equals(currentElement->getTagName(), tagApplicationAttributeIntValue.get())) |
|
988 { |
|
989 appAttribute.iIsIntValue = true; |
|
990 appAttribute.iValue = XMLChToWString(currentElement->getTextContent()); |
|
991 break; |
|
992 } |
|
993 else if( XMLString::equals(currentElement->getTagName(), tagApplicationAttributeStrValue.get())) |
|
994 { |
|
995 appAttribute.iIsIntValue = false; |
|
996 appAttribute.iValue = XMLChToWString(currentElement->getTextContent()); |
|
997 break; |
|
998 } |
|
999 } |
|
1000 |
|
1001 if(isBinary->getLength() != 0) |
|
1002 { |
|
1003 const XMLCh* textIsBinary = isBinary->item(0)->getTextContent(); |
|
1004 appAttribute.iIsStr8Bit = XercesStringToInteger(textIsBinary); |
|
1005 } |
|
1006 LOGEXIT("CScrXmlParser::GetAppAttribute()"); |
|
1007 return appAttribute; |
|
1008 } |
|
1009 |
|
1010 std::wstring CScrXmlParser::GetFileOwnershipInfo( const DOMElement* aDOMElement) |
|
1011 { |
|
1012 LOGENTER("CScrXmlParser::GetFileOwnershipInfo()"); |
|
1013 // tags in FileOwnershipInfo |
|
1014 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFileName( &XMLString::release, XMLString::transcode("FileName") ); |
|
1015 |
|
1016 DOMNodeList* fileName = aDOMElement->getElementsByTagName(tagFileName.get()); |
|
1017 |
|
1018 std::wstring file; |
|
1019 |
|
1020 if( fileName->getLength() != 0) |
|
1021 { |
|
1022 const XMLCh* fil = fileName->item(0)->getTextContent(); |
|
1023 file = XMLChToWString(fil); |
|
1024 } |
|
1025 |
|
1026 LOGEXIT("CScrXmlParser::GetFileOwnershipInfo()"); |
|
1027 return file; |
|
1028 } |
|
1029 |
|
1030 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TDataType |
|
1031 CScrXmlParser::GetDataType( const DOMElement* aDOMElement) |
|
1032 { |
|
1033 LOGENTER("CScrXmlParser::GetDataType()"); |
|
1034 // tags in DataType |
|
1035 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDataTypePriority( &XMLString::release, XMLString::transcode("Priority") ); |
|
1036 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDataType( &XMLString::release, XMLString::transcode("Type") ); |
|
1037 |
|
1038 DOMNodeList* priority = aDOMElement->getElementsByTagName(tagDataTypePriority.get()); |
|
1039 DOMNodeList* type = aDOMElement->getElementsByTagName(tagDataType.get()); |
|
1040 |
|
1041 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TDataType dataType; |
|
1042 |
|
1043 if( priority->getLength() != 0) |
|
1044 { |
|
1045 const XMLCh* pri = priority->item(0)->getTextContent(); |
|
1046 dataType.iPriority = XercesStringToInteger(pri); |
|
1047 } |
|
1048 |
|
1049 if( type->getLength() != 0) |
|
1050 { |
|
1051 const XMLCh* typ = type->item(0)->getTextContent(); |
|
1052 dataType.iType = XMLChToWString(typ); |
|
1053 } |
|
1054 LOGEXIT("CScrXmlParser::GetDataType()"); |
|
1055 return dataType; |
|
1056 } |
|
1057 |
|
1058 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType |
|
1059 CScrXmlParser::GetOpaqueDataType( const DOMElement* aDOMElement) |
|
1060 { |
|
1061 LOGENTER("CScrXmlParser::GetOpaqueDataType()"); |
|
1062 // tags in OpaqueDataType |
|
1063 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagData( &XMLString::release, XMLString::transcode("Data") ); |
|
1064 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagOpaqueLocale( &XMLString::release, XMLString::transcode("OpaqueLocale") ); |
|
1065 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagIsBinary( &XMLString::release, XMLString::transcode("IsBinary") ); |
|
1066 |
|
1067 DOMNodeList* Data = aDOMElement->getElementsByTagName(tagData.get()); |
|
1068 DOMNodeList* OpaqueLocale = aDOMElement->getElementsByTagName(tagOpaqueLocale.get()); |
|
1069 DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagIsBinary.get()); |
|
1070 |
|
1071 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType; |
|
1072 |
|
1073 if( OpaqueLocale->getLength() != 0) |
|
1074 { |
|
1075 const XMLCh* pri = OpaqueLocale->item(0)->getTextContent(); |
|
1076 opaqueDataType.iLocale = XercesStringToInteger(pri); |
|
1077 } |
|
1078 |
|
1079 if( Data->getLength() != 0) |
|
1080 { |
|
1081 const XMLCh* typ = Data->item(0)->getTextContent(); |
|
1082 opaqueDataType.iOpaqueData = XMLChToWString(typ); |
|
1083 } |
|
1084 |
|
1085 if(isBinary->getLength() != 0) |
|
1086 { |
|
1087 const XMLCh* textIsBinary = isBinary->item(0)->getTextContent(); |
|
1088 opaqueDataType.iIsBinary = XercesStringToInteger(textIsBinary); |
|
1089 } |
|
1090 |
|
1091 LOGEXIT("CScrXmlParser::GetOpaqueDataType()"); |
|
1092 return opaqueDataType; |
|
1093 } |
|
1094 |
|
1095 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType |
|
1096 CScrXmlParser::GetServiceOpaqueDataType( const DOMElement* aDOMElement) |
|
1097 { |
|
1098 LOGENTER("CScrXmlParser::GetServiceOpaqueDataType()"); |
|
1099 // tags in OpaqueDataType |
|
1100 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagServiceData( &XMLString::release, XMLString::transcode("ServiceData") ); |
|
1101 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagServiceOpaqueLocale( &XMLString::release, XMLString::transcode("ServiceOpaqueLocale") ); |
|
1102 |
|
1103 DOMNodeList* ServiceData = aDOMElement->getElementsByTagName(tagServiceData.get()); |
|
1104 DOMNodeList* ServiceOpaqueLocale = aDOMElement->getElementsByTagName(tagServiceOpaqueLocale.get()); |
|
1105 |
|
1106 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType; |
|
1107 |
|
1108 if( ServiceOpaqueLocale->getLength() != 0) |
|
1109 { |
|
1110 const XMLCh* pri = ServiceOpaqueLocale->item(0)->getTextContent(); |
|
1111 opaqueDataType.iLocale = XercesStringToInteger(pri); |
|
1112 } |
|
1113 |
|
1114 if( ServiceData->getLength() != 0) |
|
1115 { |
|
1116 const XMLCh* typ = ServiceData->item(0)->getTextContent(); |
|
1117 opaqueDataType.iOpaqueData = XMLChToWString(typ); |
|
1118 } |
|
1119 LOGEXIT("CScrXmlParser::GetServiceOpaqueDataType()"); |
|
1120 return opaqueDataType; |
|
1121 } |
|
1122 |
|
1123 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppServiceInfo |
|
1124 CScrXmlParser::GetAppServiceInfo( const DOMElement* aDOMElement, XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo& aAppRegistrationInfo ) |
|
1125 { |
|
1126 LOGENTER("CScrXmlParser::GetAppServiceInfo()"); |
|
1127 // tags in AppServiceInfo |
|
1128 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppServiceInfoUid( &XMLString::release, XMLString::transcode("Uid") ); |
|
1129 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppServiceAppProperty( &XMLString::release, XMLString::transcode("ServiceOpaqueData") ); |
|
1130 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppServiceInfoDataType( &XMLString::release, XMLString::transcode("ApplicationDataType") ); |
|
1131 |
|
1132 DOMNodeList* uid = aDOMElement->getElementsByTagName(tagAppServiceInfoUid.get()); |
|
1133 |
|
1134 DOMNodeList* ServiceOpaqueData = aDOMElement->getElementsByTagName(tagAppServiceAppProperty.get()); |
|
1135 const XMLSize_t ServiceOpaqueDataCount = ServiceOpaqueData->getLength(); |
|
1136 |
|
1137 DOMNodeList* dataTypes = aDOMElement->getElementsByTagName(tagAppServiceInfoDataType.get()); |
|
1138 const XMLSize_t dataTypeCount = dataTypes->getLength(); |
|
1139 |
|
1140 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppServiceInfo appServiceInfo; |
|
1141 |
|
1142 if( uid->getLength() != 0) |
|
1143 { |
|
1144 const XMLCh* priority = uid->item(0)->getTextContent(); |
|
1145 appServiceInfo.iUid = XercesStringToInteger(priority); |
|
1146 } |
|
1147 |
|
1148 // for each OpaqueData retrieve all tags |
|
1149 for( XMLSize_t index = 0; index < ServiceOpaqueDataCount; ++index ) |
|
1150 { |
|
1151 DOMElement* currentOpaqueData = static_cast< xercesc::DOMElement* >( ServiceOpaqueData->item(index) ); |
|
1152 |
|
1153 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty; |
|
1154 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType = GetServiceOpaqueDataType(currentOpaqueData); |
|
1155 |
|
1156 appProperty.iLocale = opaqueDataType.iLocale; |
|
1157 appProperty.iName = L"OpaqueData"; |
|
1158 appProperty.iIntValue = 0; |
|
1159 appProperty.iIsStr8Bit = true; |
|
1160 appProperty.iServiceUid = appServiceInfo.iUid; |
|
1161 if(opaqueDataType.iIsBinary == 1) |
|
1162 { |
|
1163 std::string str = wstring2string(opaqueDataType.iOpaqueData); |
|
1164 std::string decodedString = Util::Base64Decode(str); |
|
1165 appProperty.iStrValue = string2wstring(decodedString); |
|
1166 } |
|
1167 else |
|
1168 { |
|
1169 appProperty.iStrValue = opaqueDataType.iOpaqueData; |
|
1170 } |
|
1171 aAppRegistrationInfo.iApplicationProperty.push_back(appProperty); |
|
1172 } |
|
1173 |
|
1174 // for each DataType retrieve all tags |
|
1175 for( XMLSize_t index = 0; index < dataTypeCount; ++index ) |
|
1176 { |
|
1177 DOMElement* currentDataType = static_cast< xercesc::DOMElement* >( dataTypes->item(index) ); |
|
1178 |
|
1179 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TDataType dataType = GetDataType(currentDataType); |
|
1180 appServiceInfo.iDataType.push_back(dataType); |
|
1181 } |
|
1182 LOGEXIT("CScrXmlParser::GetAppServiceInfo()"); |
|
1183 return appServiceInfo; |
|
1184 |
|
1185 } |
|
1186 |
|
1187 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo |
|
1188 CScrXmlParser::GetAppLocalizableInfo( const DOMElement* aDOMElement) |
|
1189 { |
|
1190 LOGENTER("CScrXmlParser::GetAppLocalizableInfo()"); |
|
1191 // tags in AppLocalizableInfo |
|
1192 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttribute( &XMLString::release, XMLString::transcode("LocalizableAttribute") ); |
|
1193 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoViewData ( &XMLString::release, XMLString::transcode("ViewData") ); |
|
1194 |
|
1195 DOMNodeList* localizableAttributes = aDOMElement->getElementsByTagName(tagAppLocalizableInfoAttribute.get()); |
|
1196 const XMLSize_t attributeCount = localizableAttributes->getLength(); |
|
1197 DOMNodeList* viewData = aDOMElement->getElementsByTagName(tagAppLocalizableInfoViewData.get()); |
|
1198 const XMLSize_t viewDataCount = viewData->getLength(); |
|
1199 |
|
1200 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo appLocalizableInfo; |
|
1201 |
|
1202 LOGINFO("for each AppLocalizableInfoAttribute retrieve all tags"); |
|
1203 // for each AppLocalizableInfoAttribute retrieve all tags |
|
1204 for( XMLSize_t index = 0; index < attributeCount; ++index ) |
|
1205 { |
|
1206 DOMElement* currentLocalizableAttribute = static_cast< xercesc::DOMElement* >( localizableAttributes->item(index) ); |
|
1207 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TLocalizableAttribute appLocalizableAttribute = GetAppLocalizableAttribute(currentLocalizableAttribute); |
|
1208 appLocalizableInfo.iLocalizableAttribute.push_back(appLocalizableAttribute); |
|
1209 } |
|
1210 |
|
1211 LOGINFO("for each AppLocalizableViewData retrieve all tags"); |
|
1212 // for each AppLocalizableViewData retrieve all tags |
|
1213 |
|
1214 for( XMLSize_t index = 0; index < viewDataCount; ++index ) |
|
1215 { |
|
1216 DOMElement* currentLocalizableViewData = static_cast< xercesc::DOMElement* >( viewData->item(index) ); |
|
1217 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData appLocalizableViewData = GetAppLocalizableViewData(currentLocalizableViewData); |
|
1218 LOGINFO("push_back viewdata"); |
|
1219 appLocalizableInfo.iViewData.push_back(appLocalizableViewData); |
|
1220 } |
|
1221 |
|
1222 LOGEXIT("CScrXmlParser::GetAppLocalizableInfo()"); |
|
1223 return appLocalizableInfo; |
|
1224 } |
|
1225 |
|
1226 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TLocalizableAttribute |
|
1227 CScrXmlParser::GetAppLocalizableAttribute( const DOMElement* aDOMElement) |
|
1228 { |
|
1229 LOGENTER("CScrXmlParser::GetAppLocalizableAttribute()"); |
|
1230 // tags in AppLocalizableInfo |
|
1231 // tags in AppLocalizableInfoAttribute |
|
1232 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeName( &XMLString::release, XMLString::transcode("Name") ); |
|
1233 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeValue( &XMLString::release, XMLString::transcode("LocalizableAttribute_Value") ); |
|
1234 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeIsBinary( &XMLString::release, XMLString::transcode("LocalizableAttribute_IsBinary") ); |
|
1235 |
|
1236 // tags of AppLocalizableInfoAttribute_Value |
|
1237 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeIntValue( &XMLString::release, XMLString::transcode("LocalizableAttribute_IntValue") ); |
|
1238 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeStrValue( &XMLString::release, XMLString::transcode("LocalizableAttribute_StrValue") ); |
|
1239 |
|
1240 LOGINFO("attribute - name"); |
|
1241 // attribute - name |
|
1242 DOMNamedNodeMap* attributes = aDOMElement->getAttributes(); |
|
1243 DOMNode* name = attributes->getNamedItem(tagAppLocalizableInfoAttributeName.get()); |
|
1244 |
|
1245 DOMNodeList* value = aDOMElement->getElementsByTagName(tagAppLocalizableInfoAttributeValue.get()); |
|
1246 DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagAppLocalizableInfoAttributeIsBinary.get()); |
|
1247 |
|
1248 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TLocalizableAttribute appLocalizableAttribute; |
|
1249 |
|
1250 LOGINFO("name->getTextContent"); |
|
1251 const XMLCh* textName = name->getTextContent(); |
|
1252 appLocalizableAttribute.iName = XMLChToWString(textName); |
|
1253 |
|
1254 DOMNodeList* childNodes = value->item(0)->getChildNodes(); |
|
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(), tagAppLocalizableInfoAttributeIntValue.get())) |
|
1261 { |
|
1262 appLocalizableAttribute.iIsIntValue = true; |
|
1263 appLocalizableAttribute.iValue = XMLChToWString(currentElement->getTextContent()); |
|
1264 break; |
|
1265 } |
|
1266 else if( XMLString::equals(currentElement->getTagName(), tagAppLocalizableInfoAttributeStrValue.get())) |
|
1267 { |
|
1268 appLocalizableAttribute.iIsIntValue = false; |
|
1269 appLocalizableAttribute.iValue = XMLChToWString(currentElement->getTextContent()); |
|
1270 break; |
|
1271 } |
|
1272 } |
|
1273 |
|
1274 if(isBinary->getLength() != 0) |
|
1275 { |
|
1276 const XMLCh* textIsBinary = isBinary->item(0)->getTextContent(); |
|
1277 appLocalizableAttribute.iIsStr8Bit = XercesStringToInteger(textIsBinary); |
|
1278 } |
|
1279 |
|
1280 LOGEXIT("CScrXmlParser::GetAppLocalizableAttribute()"); |
|
1281 return appLocalizableAttribute; |
|
1282 } |
|
1283 |
|
1284 |
|
1285 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData |
|
1286 CScrXmlParser::GetAppLocalizableViewData( const DOMElement* aDOMElement) |
|
1287 { |
|
1288 LOGENTER("CScrXmlParser::GetAppLocalizableViewData()"); |
|
1289 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoViewDataAttribute ( &XMLString::release, XMLString::transcode("ViewDataAttribute") ); |
|
1290 |
|
1291 DOMNodeList* viewDataAttr = aDOMElement->getElementsByTagName(tagAppLocalizableInfoViewDataAttribute.get()); |
|
1292 const XMLSize_t viewDataAttrCount = viewDataAttr->getLength(); |
|
1293 |
|
1294 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData appViewData; |
|
1295 |
|
1296 for( XMLSize_t index = 0; index < viewDataAttrCount; ++index ) |
|
1297 { |
|
1298 DOMElement* currentLocalizableViewData = static_cast< xercesc::DOMElement* >( viewDataAttr->item(index) ); |
|
1299 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData::TViewDataAttributes appLocalizableViewData = GetAppLocalizableViewDataAttributes(currentLocalizableViewData); |
|
1300 LOGINFO("push_back viewdata"); |
|
1301 appViewData.iViewDataAttributes.push_back(appLocalizableViewData); |
|
1302 } |
|
1303 LOGEXIT("CScrXmlParser::GetAppLocalizableViewData()"); |
|
1304 return appViewData; |
|
1305 } |
|
1306 |
|
1307 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData::TViewDataAttributes |
|
1308 CScrXmlParser::GetAppLocalizableViewDataAttributes( const DOMElement* aDOMElement) |
|
1309 { |
|
1310 LOGENTER("CScrXmlParser::GetAppLocalizableViewDataAttributes()"); |
|
1311 // tags in AppLocalizableViewData |
|
1312 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataName( &XMLString::release, XMLString::transcode("Name") ); |
|
1313 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataValue( &XMLString::release, XMLString::transcode("ViewData_Value") ); |
|
1314 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataIsBinary( &XMLString::release, XMLString::transcode("ViewData_IsBinary") ); |
|
1315 |
|
1316 // tags of AppLocalizableViewData_Value |
|
1317 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataIntValue( &XMLString::release, XMLString::transcode("ViewData_IntValue") ); |
|
1318 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataStrValue( &XMLString::release, XMLString::transcode("ViewData_StrValue") ); |
|
1319 |
|
1320 LOGINFO("attribute - name"); |
|
1321 // attribute - name |
|
1322 DOMNamedNodeMap* attributes = aDOMElement->getAttributes(); |
|
1323 DOMNode* name = attributes->getNamedItem(tagAppLocalizableViewDataName.get()); |
|
1324 |
|
1325 DOMNodeList* value = aDOMElement->getElementsByTagName(tagAppLocalizableViewDataValue.get()); |
|
1326 DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagAppLocalizableViewDataIsBinary.get()); |
|
1327 |
|
1328 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData::TViewDataAttributes appLocalizableViewDataAttribute; |
|
1329 |
|
1330 LOGINFO("name->getTextContent"); |
|
1331 const XMLCh* textName = name->getTextContent(); |
|
1332 LOGINFO("assign name"); |
|
1333 appLocalizableViewDataAttribute.iName = XMLChToWString(textName); |
|
1334 |
|
1335 LOGINFO("getChildNodes()"); |
|
1336 DOMNodeList* childNodes = value->item(0)->getChildNodes(); |
|
1337 LOGINFO("childNodes->getLength()"); |
|
1338 const XMLSize_t nodeCount = childNodes->getLength(); |
|
1339 |
|
1340 for(int index = 0; index< nodeCount; ++index) |
|
1341 { |
|
1342 DOMElement* currentElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) ); |
|
1343 if( XMLString::equals(currentElement->getTagName(), tagAppLocalizableViewDataIntValue.get())) |
|
1344 { |
|
1345 LOGINFO("int value"); |
|
1346 appLocalizableViewDataAttribute.iIsIntValue = true; |
|
1347 appLocalizableViewDataAttribute.iValue = XMLChToWString(currentElement->getTextContent()); |
|
1348 break; |
|
1349 } |
|
1350 else if( XMLString::equals(currentElement->getTagName(), tagAppLocalizableViewDataStrValue.get())) |
|
1351 { |
|
1352 LOGINFO("str value"); |
|
1353 appLocalizableViewDataAttribute.iIsIntValue = false; |
|
1354 appLocalizableViewDataAttribute.iValue = XMLChToWString(currentElement->getTextContent()); |
|
1355 break; |
|
1356 } |
|
1357 } |
|
1358 |
|
1359 if(isBinary->getLength() != 0) |
|
1360 { |
|
1361 LOGINFO("bin value"); |
|
1362 const XMLCh* textIsBinary = isBinary->item(0)->getTextContent(); |
|
1363 appLocalizableViewDataAttribute.iIsStr8Bit = XercesStringToInteger(textIsBinary); |
|
1364 } |
|
1365 LOGEXIT("CScrXmlParser::GetAppLocalizableViewDataAttributes()"); |
|
1366 return appLocalizableViewDataAttribute; |
|
1367 } |
|
1368 |
|
1369 |
|
1370 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty |
|
1371 CScrXmlParser::GetAppProperty( const DOMElement* aDOMElement) |
|
1372 { |
|
1373 LOGENTER("CScrXmlParser::GetAppProperty()"); |
|
1374 // tags in AppProperty |
|
1375 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyLocale( &XMLString::release, XMLString::transcode("Locale") ); |
|
1376 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyName( &XMLString::release, XMLString::transcode("Name") ); |
|
1377 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyIntValue( &XMLString::release, XMLString::transcode("IntValue") ); |
|
1378 fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyStrValue( &XMLString::release, XMLString::transcode("StrValue") ); |
|
1379 |
|
1380 DOMNodeList* locale = aDOMElement->getElementsByTagName(tagAppPropertyLocale.get()); |
|
1381 DOMNodeList* name = aDOMElement->getElementsByTagName(tagAppPropertyName.get()); |
|
1382 DOMNodeList* intvalue = aDOMElement->getElementsByTagName(tagAppPropertyIntValue.get()); |
|
1383 DOMNodeList* strvalue = aDOMElement->getElementsByTagName(tagAppPropertyStrValue.get()); |
|
1384 |
|
1385 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty; |
|
1386 |
|
1387 if( locale->getLength() != 0) |
|
1388 { |
|
1389 const XMLCh* loc = locale->item(0)->getTextContent(); |
|
1390 appProperty.iLocale = XercesStringToInteger(loc); |
|
1391 } |
|
1392 |
|
1393 if( name->getLength() != 0) |
|
1394 { |
|
1395 const XMLCh* nam = name->item(0)->getTextContent(); |
|
1396 appProperty.iName = XMLChToWString(nam); |
|
1397 } |
|
1398 |
|
1399 if( intvalue->getLength() != 0) |
|
1400 { |
|
1401 const XMLCh* intval = intvalue->item(0)->getTextContent(); |
|
1402 appProperty.iIntValue = XercesStringToInteger(intval); |
|
1403 } |
|
1404 else if( strvalue->getLength() != 0) |
|
1405 { |
|
1406 const XMLCh* strval = strvalue->item(0)->getTextContent(); |
|
1407 appProperty.iStrValue = XMLChToWString(strval); |
|
1408 } |
|
1409 |
|
1410 appProperty.iIsStr8Bit = false; |
|
1411 |
|
1412 LOGEXIT("CScrXmlParser::GetAppProperty()"); |
|
1413 return appProperty; |
742 } |
1414 } |
743 |
1415 |
744 void CScrXmlParser::ConfigDomParser(xercesc::XercesDOMParser& aDomParser) |
1416 void CScrXmlParser::ConfigDomParser(xercesc::XercesDOMParser& aDomParser) |
745 { |
1417 { |
746 aDomParser.setValidationScheme( XercesDOMParser::Val_Always ); |
1418 aDomParser.setValidationScheme( XercesDOMParser::Val_Always ); |