1 /* |
1 /* |
2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
36 #include "xmlparser.h" |
36 #include "xmlparser.h" |
37 #include <xercesc/parsers/XercesDOMParser.hpp> |
37 #include <xercesc/parsers/XercesDOMParser.hpp> |
38 #include <xercesc/sax/ErrorHandler.hpp> |
38 #include <xercesc/sax/ErrorHandler.hpp> |
39 #include <xercesc/dom/DOM.hpp> |
39 #include <xercesc/dom/DOM.hpp> |
40 |
40 |
41 #include "parameterlist.h" |
|
42 |
41 |
43 using namespace std; |
|
44 |
|
45 #define AppRegistrationInfo XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo |
|
46 #define ApplicationAttribute XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppAttribute |
|
47 #define AppDataType XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TDataType |
|
48 #define AppServiceInfo XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppServiceInfo |
|
49 #define AppLocalizableInfo XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo |
|
50 #define AppLocalizableAttribute XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TLocalizableAttribute |
|
51 #define AppViewData XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData |
|
52 #define AppViewDataAttributes XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData::TViewDataAttributes |
|
53 #define AppProperty XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty |
|
54 #define AppOpaqueDataType XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType |
|
55 #define ComponentLocalizable XmlDetails::TScrPreProvisionDetail::TComponentLocalizable |
42 #define ComponentLocalizable XmlDetails::TScrPreProvisionDetail::TComponentLocalizable |
56 #define ComponentProperty XmlDetails::TScrPreProvisionDetail::TComponentProperty |
43 #define ComponentProperty XmlDetails::TScrPreProvisionDetail::TComponentProperty |
57 #define ComponentFile XmlDetails::TScrPreProvisionDetail::TComponentFile |
44 #define ComponentFile XmlDetails::TScrPreProvisionDetail::TComponentFile |
58 #define FileProperty XmlDetails::TScrPreProvisionDetail::TComponentFile::TFileProperty |
45 #define FileProperty XmlDetails::TScrPreProvisionDetail::TComponentFile::TFileProperty |
59 #define ComponentDependency XmlDetails::TScrPreProvisionDetail::TComponentDependency |
46 #define ComponentDependency XmlDetails::TScrPreProvisionDetail::TComponentDependency |
60 #define ComponentDependencyDetail XmlDetails::TScrPreProvisionDetail::TComponentDependency::TComponentDependencyDetail |
47 #define ComponentDependencyDetail XmlDetails::TScrPreProvisionDetail::TComponentDependency::TComponentDependencyDetail |
61 |
|
62 |
48 |
63 class CXmlGenerator |
49 class CXmlGenerator |
64 { |
50 { |
65 |
51 |
66 public: |
52 public: |
76 ~CXmlGenerator(); |
62 ~CXmlGenerator(); |
77 |
63 |
78 /** |
64 /** |
79 * Retrieves software environment details, from the supplied xml file. |
65 * Retrieves software environment details, from the supplied xml file. |
80 */ |
66 */ |
81 void WritePreProvisionDetails(const std::wstring aXmlFileName, |
67 void WritePreProvisionDetails(const std::wstring aXmlFileName, const XmlDetails::TScrPreProvisionDetail& aPreProvisionDetail); |
82 const XmlDetails::TScrPreProvisionDetail& aPreProvisionDetail, |
|
83 int& aRomApplication |
|
84 ); |
|
85 |
68 |
86 |
69 |
87 private: |
70 private: |
88 |
71 |
89 void WriteComponent( XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
72 void WriteComponent( XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
90 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
73 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
91 const XmlDetails::TScrPreProvisionDetail::TComponent& aComponent, |
74 const XmlDetails::TScrPreProvisionDetail::TComponent& aComponent |
92 int& aRomApplication |
|
93 ); |
75 ); |
94 |
76 |
95 void WriteComponentVersion ( |
77 void WriteComponentVersion ( |
96 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
78 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
97 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
79 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
109 ( |
91 ( |
110 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
92 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
111 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
93 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
112 const std::vector<ComponentProperty>& aComponentProperties |
94 const std::vector<ComponentProperty>& aComponentProperties |
113 ); |
95 ); |
114 |
|
115 void WriteAppRegInfo |
|
116 ( |
|
117 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
|
118 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
|
119 const std::vector<AppRegistrationInfo>& aAppRegInfo |
|
120 ); |
|
121 |
|
122 |
|
123 void WriteAppAttributes |
|
124 ( |
|
125 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
|
126 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
|
127 const std::vector<ApplicationAttribute>& aAppAttributes |
|
128 ); |
|
129 |
|
130 void WriteAppProperty |
|
131 ( |
|
132 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
|
133 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
|
134 const std::vector<AppProperty>& aAppProperty |
|
135 ); |
|
136 |
|
137 void WriteAppServiceInfo |
|
138 ( |
|
139 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
|
140 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
|
141 const std::vector<AppServiceInfo>& aAppServiceInfo, |
|
142 const std::vector<AppOpaqueDataType>& aAppOpaqueData |
|
143 ); |
|
144 |
|
145 void WriteAppDataType |
|
146 ( |
|
147 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
|
148 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
|
149 const std::vector<AppDataType>& aAppDataType |
|
150 ); |
|
151 |
|
152 void WriteAppLocalizableInfo |
|
153 ( |
|
154 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
|
155 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
|
156 const std::vector<AppLocalizableInfo>& aAppLocalizableInfo |
|
157 ); |
|
158 |
|
159 void WriteAppLocalizableAttribute |
|
160 ( |
|
161 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
|
162 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
|
163 const std::vector<AppLocalizableAttribute>& aAppLocalizableAttribute |
|
164 ); |
|
165 |
|
166 void WriteAppLocalizableViewData |
|
167 ( |
|
168 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
|
169 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
|
170 const std::vector<AppViewData>& aAppViewData |
|
171 ); |
|
172 |
|
173 void WriteAppLocalizableViewDataAttributes |
|
174 ( |
|
175 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
|
176 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
|
177 const std::vector<AppViewDataAttributes>& aAppViewDataAttributes |
|
178 ); |
|
179 |
96 |
180 void WriteComponentFiles |
97 void WriteComponentFiles |
181 ( |
98 ( |
182 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
99 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
183 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
100 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
199 ); |
116 ); |
200 |
117 |
201 void AddChildElement( |
118 void AddChildElement( |
202 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
119 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
203 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
120 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
204 const XMLCh* aElementName, |
121 const wchar_t* aElementName, |
205 const XMLCh* aTextValue |
122 const wchar_t* aTextValue |
206 ); |
123 ); |
207 |
124 |
208 XERCES_CPP_NAMESPACE::DOMElement* AddTag |
125 XERCES_CPP_NAMESPACE::DOMElement* AddTag |
209 ( |
126 ( |
210 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
127 XERCES_CPP_NAMESPACE::DOMElement* aRootElement, |
211 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
128 XERCES_CPP_NAMESPACE::DOMDocument* aDocument, |
212 const XMLCh* aTagName |
129 const wchar_t* aTagName |
213 ); |
130 ); |
214 |
131 |
215 void SetWriterFeatures(XERCES_CPP_NAMESPACE::DOMWriter* aDomWriter); |
132 void SetWriterFeatures(XERCES_CPP_NAMESPACE::DOMWriter* aDomWriter); |
|
133 |
216 }; |
134 }; |
217 |
135 |
218 |
136 |
219 XERCES_CPP_NAMESPACE_BEGIN |
137 XERCES_CPP_NAMESPACE_BEGIN |
220 |
138 |