Modify to check verification mode
[framework/osp/installer.git] / src / XmlHandler / ManifestHandler.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18  * @file        ManifestHandler.cpp
19  * @brief       This is the implementation file for %ManifestHandler class.
20  */
21
22 #include <FIoFile.h>
23 #include <FSys_SystemInfoImpl.h>
24 #include <FApp_PackageInfoImpl.h>
25 #include <FBase_StringConverter.h>
26
27 #include "ManifestHandler.h"
28 #include "PrivilegeHandler.h"
29 #include "InstallerUtil.h"
30
31
32 using namespace Osp::Base;
33 using namespace Osp::Base::Collection;
34 using namespace Osp::Base::Utility;
35 using namespace Osp::App;
36 using namespace Osp::Io;
37 using namespace Osp::System;
38
39 ManifestHandler::ManifestHandler(void)
40 :__pContext(null)
41 ,__pPrivilegeList(null)
42 ,__pLiveBoxList(null)
43 ,__pContentInfoList(null)
44 ,__pPackageInfoImpl(null)
45 ,__pPackageAppInfoImpl(null)
46 ,__pAppControlInfoImpl(null)
47 ,__pAppControlCapabilityInfoImpl(null)
48 ,__pAppControlResolutionInfoImpl(null)
49 ,__pDataControlInfoImpl(null)
50 ,__pDataControlTypeImpl(null)
51 ,__pLaunchConditionImpl(null)
52 ,__pNotificationImpl(null)
53 ,__pLiveboxInfo(null)
54 ,__pContentInfo(null)
55 ,__pDefaultIconType(null)
56 ,__isDefaultMainmenu(false)
57 ,__isDefaultSetting(false)
58 ,__isDefaultTicker(false)
59 ,__isDefaultQuickpanel(false)
60 ,__isDefaultLaunchImage(false)
61 ,__isDefaultName(false)
62 ,__isDefaultAppDetected(false)
63 {
64 }
65
66 ManifestHandler::~ManifestHandler(void)
67 {
68         if (__pPackageAppInfoImpl)
69         {
70                 delete __pPackageAppInfoImpl;
71                 __pPackageAppInfoImpl = null;
72         }
73 }
74
75 bool
76 ManifestHandler::Construct(InstallationContext* pContext)
77 {
78         __pContext = pContext;
79         __pPackageInfoImpl = pContext->GetPackageInfoImpl();
80
81         return true;
82 }
83
84 bool
85 ManifestHandler::Parse(const char *pFilepath)
86 {
87         return ParseDocument(pFilepath);
88 }
89
90 bool
91 ManifestHandler::OnStartElement(const char *pName)
92 {
93         TryReturn(pName, true, "[osp-installer] pName is null.");
94
95         bool status = true;
96
97         if (strcasecmp(pName, "Manifest") == 0)
98         {
99                 AppLogTag(OSP_INSTALLER, "------------------------------------------");
100                 AppLogTag(OSP_INSTALLER, "manifest.xml");
101                 AppLogTag(OSP_INSTALLER, "------------------------------------------");
102                 AppLogTag(OSP_INSTALLER, "<%s>", pName);
103         }
104         else if (strcasecmp(pName, "Apps") == 0)
105         {
106                 AppLogTag(OSP_INSTALLER, "<%s>", pName);
107         }
108         else if (strcasecmp(pName, "UiApp") == 0)
109         {
110                 status = OnUiAppElement();
111         }
112         else if (strcasecmp(pName, "ServiceApp") == 0)
113         {
114                 status = OnServiceAppElement();
115         }
116         else if (strcasecmp(pName, "DataControl") == 0)
117         {
118                 status = OnDataControlElement();
119         }
120         else if (strcasecmp(pName, "AppControl") == 0)
121         {
122                 status = OnAppControlElement();
123         }
124         else if (strcasecmp(pName, "Capability") == 0)
125         {
126                 status = OnCapabilityElement();
127         }
128         else if (strcasecmp(pName, "Resolution") == 0)
129         {
130                 status = OnResolutionElement();
131         }
132         else if (strcasecmp(pName, "Privileges") == 0)
133         {
134                 status = OnPrivilegesElement();
135         }
136         else if (strcasecmp(pName, "UiScalability") == 0)
137         {
138                 status = OnUiScalabilityElement();
139         }
140         else if (strcasecmp(pName, "UiTheme") == 0)
141         {
142                 status = OnUiThemeElement();
143         }
144         else if (strcasecmp(pName, "Icons") == 0)
145         {
146                 status = OnIconsElement();
147         }
148         else if (strcasecmp(pName, "LiveBoxes") == 0)
149         {
150                 status = OnLiveBoxesElement();
151         }
152         else if (strcasecmp(pName, "LiveBox") == 0)
153         {
154                 status = OnLiveBoxElement();
155         }
156         else if (strcasecmp(pName, "Contents") == 0)
157         {
158                 status = OnContentsElement();
159         }
160         else if (strcasecmp(pName, "Content") == 0)
161         {
162                 status = OnContentElement();
163         }
164
165         if (!status)
166         {
167                 return false;
168         }
169
170         return true;
171 }
172
173 bool
174 ManifestHandler::OnEndElement(const char *pName)
175 {
176         TryReturn(pName, true, "[osp-installer] pName is null.");
177
178         bool status = true;
179
180         if (strcasecmp(pName, "Privileges") == 0)
181         {
182                 status = OnPrivilegesEndElement();
183         }
184         else if (strcasecmp(pName, "UiApp") == 0)
185         {
186                 __pPackageInfoImpl->AddAppInfo(*__pPackageAppInfoImpl);
187                 __pPackageAppInfoImpl = null;
188
189                 __isDefaultName = false;
190                 AppLogTag(OSP_INSTALLER, "</%s>", pName);
191         }
192         else if (strcasecmp(pName, "ServiceApp") == 0)
193         {
194                 __pPackageInfoImpl->AddAppInfo(*__pPackageAppInfoImpl);
195                 __pPackageAppInfoImpl = null;
196
197                 __isDefaultName = false;
198                 AppLogTag(OSP_INSTALLER, "</%s>", pName);
199         }
200         else if (strcasecmp(pName, "AppControl") == 0)
201         {
202                 __pPackageAppInfoImpl->AddAppControl(__pAppControlInfoImpl);
203                 __pAppControlInfoImpl = null;
204                 AppLogTag(OSP_INSTALLER, "</%s>", pName);
205         }
206         else if (strcasecmp(pName, "DataControl") == 0)
207         {
208                 __pPackageAppInfoImpl->AddDataControl(__pDataControlInfoImpl);
209                 __pDataControlInfoImpl = null;
210                 AppLogTag(OSP_INSTALLER, "</%s>", pName);
211         }
212         else if (strcasecmp(pName, "DataControlType") == 0)
213         {
214                 __pDataControlInfoImpl->AddControlType(__pDataControlTypeImpl);
215                 __pDataControlTypeImpl = null;
216                 AppLogTag(OSP_INSTALLER, "</%s>", pName);
217         }
218         else if (strcasecmp(pName, "Condition") == 0)
219         {
220                 __pPackageAppInfoImpl->AddLaunchCondition(*__pLaunchConditionImpl);
221                 __pLaunchConditionImpl = null;
222                 AppLogTag(OSP_INSTALLER, "</%s>", pName);
223         }
224         else if (strcasecmp(pName, "Notification") == 0)
225         {
226                 __pPackageAppInfoImpl->AddNotification(*__pNotificationImpl);
227                 __pNotificationImpl = null;
228                 AppLogTag(OSP_INSTALLER, "</%s>", pName);
229         }
230         else if (strcasecmp(pName, "Capability") == 0)
231         {
232                 if (__pAppControlInfoImpl)
233                 {
234                         __pAppControlInfoImpl->AddCapability(__pAppControlCapabilityInfoImpl);
235                         __pAppControlCapabilityInfoImpl = null;
236                 }
237                 AppLogTag(OSP_INSTALLER, "</%s>", pName);
238         }
239         else if (strcasecmp(pName, "Resolution") == 0)
240         {
241                 __pAppControlCapabilityInfoImpl->AddResolution(__pAppControlResolutionInfoImpl);
242                 __pAppControlResolutionInfoImpl = null;
243                 AppLogTag(OSP_INSTALLER, "</%s>", pName);
244         }
245         else if (strcasecmp(pName, "Apps") == 0)
246         {
247                 AppLogTag(OSP_INSTALLER, "</%s>", pName);
248         }
249         else if (strcasecmp(pName, "UiScalability") == 0)
250         {
251                 AppLogTag(OSP_INSTALLER, "</%s>", pName);
252         }
253         else if (strcasecmp(pName, "Icons") == 0)
254         {
255                 delete[] __pDefaultIconType;
256                 __pDefaultIconType = null;
257                 AppLogTag(OSP_INSTALLER, "</%s>", pName);
258         }
259         else if (strcasecmp(pName, "LiveBoxes") == 0)
260         {
261                 __pContext->SetLiveBoxList(__pLiveBoxList);
262                 __pLiveBoxList = null;
263                 AppLogTag(OSP_INSTALLER, "</%s>", pName);
264         }
265         else if (strcasecmp(pName, "Contents") == 0)
266         {
267                 __pContext->SetContentInfoList(__pContentInfoList);
268                 __pContentInfoList = null;
269                 AppLogTag(OSP_INSTALLER, "</%s>", pName);
270         }
271         else if (strcasecmp(pName, "LiveBox") == 0)
272         {
273                 __pLiveBoxList->Add(*__pLiveboxInfo);
274                 __pLiveboxInfo = null;
275                 AppLogTag(OSP_INSTALLER, "</%s>", pName);
276         }
277         else if (strcasecmp(pName, "Content") == 0)
278         {
279                 __pContentInfoList->Add(*__pContentInfo);
280                 __pContentInfo = null;
281                 AppLogTag(OSP_INSTALLER, "</%s>", pName);
282         }
283         else if (strcasecmp(pName, "Manifest") == 0)
284         {
285                 if (__isDefaultAppDetected == false)
286                 {
287                         fprintf(stderr, "__isDefaultAppDetected is false.\n");
288                 }
289                 TryReturn(__isDefaultAppDetected, false, "[osp-installer][Error] Default App is not detected...");
290                 AppLogTag(OSP_INSTALLER, "</%s>", pName);
291         }
292
293         if (!status)
294         {
295                 return false;
296         }
297
298         return true;
299 }
300
301 bool
302 ManifestHandler::OnCharacters(const char *pCharacters)
303 {
304         bool status = true;
305         char *pName = 0;
306
307         pName = GetElementName();
308         TryReturn(pName, false, "[osp-installer] pName is null.");
309
310         if (strcasecmp(pName, "Id") == 0)
311         {
312                 status = OnIdValue(pCharacters);
313         }
314         else if (strcasecmp(pName, "Version") == 0)
315         {
316                 status = OnVersionValue(pCharacters);
317         }
318         else if (strcasecmp(pName, "Type") == 0)
319         {
320                 status = OnTypeValue(pCharacters);
321         }
322         else if (strcasecmp(pName, "Url") == 0)
323         {
324                 status = OnUrlValue(pCharacters);
325         }
326         else if (strcasecmp(pName, "ApiVersion") == 0)
327         {
328                 status = OnApiVersionValue(pCharacters);
329         }
330         else if (strcasecmp(pName, "Secret") == 0)
331         {
332                 status = OnSecretValue(pCharacters);
333         }
334         else if (strcasecmp(pName, "Privilege") == 0)
335         {
336                 status = OnPrivilegeValue(pCharacters);
337         }
338         else if (strcasecmp(pName, "Name") == 0)
339         {
340                 status = OnNameValue(pCharacters);
341         }
342         else if (strcasecmp(pName, "Vendor") == 0)
343         {
344                 status = OnVendorValue(pCharacters);
345         }
346         else if (strcasecmp(pName, "Description") == 0)
347         {
348                 status = OnDescriptionValue(pCharacters);
349         }
350         else if (strcasecmp(pName, "Icon") == 0)
351         {
352                 status = OnIconValue(pCharacters);
353         }
354         else if (strcasecmp(pName, "DataControlType") == 0)
355         {
356                 status = OnDataControlTypeValue(pCharacters);
357         }
358         else if (strcasecmp(pName, "Condition") == 0)
359         {
360                 status = OnConditionValue(pCharacters);
361         }
362         else if (strcasecmp(pName, "Notification") == 0)
363         {
364                 status = OnNotificationValue(pCharacters);
365         }
366         else if (strcasecmp(pName, "Size") == 0)
367         {
368                 status = OnSizeValue(pCharacters);
369         }
370         else if (strcasecmp(pName, "InstallationLocation") == 0)
371         {
372                 status = OnInstallationLocationValue(pCharacters);
373         }
374
375         if (!status)
376         {
377                 return false;
378         }
379
380         return true;
381 }
382
383 bool
384 ManifestHandler::OnPrivilegesElement(void)
385 {
386         __pPrivilegeList = new ArrayList;
387         TryReturn(__pPrivilegeList, false, "[osp-installer] __pPrivilegeList is null");
388
389         AppLogTag(OSP_INSTALLER, "<Privileges>");
390
391         return true;
392 }
393
394 bool
395 ManifestHandler::OnPrivilegesEndElement(void)
396 {
397         if (__pContext->IsVerificationMode() == false)
398         {
399                 AppLogTag(OSP_INSTALLER, "Signature file not found. [%ls]\n", __pContext->GetSignatureXmlPath().GetPointer());
400
401                 result r = E_SUCCESS;
402                 String privileges;
403                 String hmacPrivileges;
404                 String appId = __pPackageInfoImpl->GetAppId();
405                 r = PrivilegeHandler::GenerateCipherPrivilege(appId, *__pPrivilegeList, privileges, hmacPrivileges);
406                 if (IsFailed(r))
407                 {
408                         fprintf(stderr, "PrivilegeHandler::GenerateCipherPrivilege is failded. [%ls][%ls][%ls]\n", appId.GetPointer(), privileges.GetPointer(), hmacPrivileges.GetPointer());
409                 }
410                 TryReturn(!IsFailed(r), false, "[osp-installer] privMgr.GeneratePrivilegeString() failed");
411
412                 __pPackageInfoImpl->SetPrivilegesValue(privileges, hmacPrivileges);
413         }
414
415         __pContext->SetPrivilegeList(__pPrivilegeList);
416         
417         AppLogTag(OSP_INSTALLER, "</Privileges>");
418
419         return true;
420 }
421
422 bool
423 ManifestHandler::OnLiveBoxesElement(void)
424 {
425         __pLiveBoxList = new ArrayList;
426         TryReturn(__pLiveBoxList, false, "[osp-installer] __pLiveBoxList is null");
427
428         AppLogTag(OSP_INSTALLER, "<LiveBoxes>");
429
430         return true;
431 }
432
433 bool
434 ManifestHandler::OnLiveBoxElement(void)
435 {
436         TryReturn(__pLiveboxInfo == null, false, "[osp-installer] __pLiveboxInfo is not null");
437
438         XmlAttribute *pAttr = null;
439         char *pUpdatePeriod = null;
440         char *pPopupEnabled = null;
441
442         __pLiveboxInfo = new LiveboxInfo;
443         TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null");
444
445         pAttr = GetAttribute();
446         TryReturn(pAttr, true, "[osp-installer] pAttr is null");
447
448         pUpdatePeriod = pAttr->Find("UpdatePeriod");
449         TryReturn(pUpdatePeriod, false, "[osp-installer] pUpdatePeriod is null");
450
451         long long updatePeriod = atoll(pUpdatePeriod);
452         __pLiveboxInfo->SetUpdatePeriod(updatePeriod);
453
454         pPopupEnabled = pAttr->Find("LiveBoxPopupEnabled");
455         TryReturn(pPopupEnabled, false, "[osp-installer] pPopupEnabled is null");
456
457         __pLiveboxInfo->SetPopupEnabled(pPopupEnabled);
458
459         AppLogTag(OSP_INSTALLER, "<Livebox UpdatePeriod=\"%lld\" pPopupEnabled=\"%s\">", updatePeriod, pPopupEnabled);
460
461         return true;
462 }
463
464 bool
465 ManifestHandler::OnContentsElement(void)
466 {
467         __pContentInfoList = new ArrayList;
468         TryReturn(__pContentInfoList, false, "[osp-installer] __pContentInfoList is null");
469
470         AppLogTag(OSP_INSTALLER, "<Contents>");
471
472         return true;
473 }
474
475 bool
476 ManifestHandler::OnContentElement(void)
477 {
478         TryReturn(__pContentInfo == null, false, "[osp-installer] __pContentInfo is not null");
479
480         XmlAttribute *pAttr = null;
481         char *pDefault = null;
482
483         __pContentInfo = new ContentInfo;
484         TryReturn(__pContentInfo, false, "[osp-installer] __pLiveboxInfo is null");
485
486         pAttr = GetAttribute();
487         TryReturn(pAttr, true, "[osp-installer] pAttr is null");
488
489         char* pId = pAttr->Find("Id");
490         if (pId)
491         {
492                 __pContentInfo->SetContentId(pId);
493         }
494
495         char* pEntryName = pAttr->Find("EntryName");
496         if (pEntryName)
497         {
498                 __pContentInfo->SetContentId(pEntryName);
499         }
500
501         pDefault = pAttr->Find("Default");
502         if (pDefault)
503         {
504                 if (strcasecmp(pDefault, "True") == 0)
505                 {
506                         __isDefaultAppDetected = true;
507                 }
508         }
509
510         AppLogTag(OSP_INSTALLER, "<Content Id=\"%s\" EntryName=\"%s\">", pId, pEntryName);
511
512         return true;
513 }
514
515 bool
516 ManifestHandler::OnUiScalabilityElement(void)
517 {
518         XmlAttribute *pAttr = null;
519         char *pCoordinateSystem = null;
520         char *pBaseScreenSize = null;
521         char *pLogicalCoordinate = null;
522
523         AppLogTag(OSP_INSTALLER, "<UiScalability>");
524
525         pAttr = GetAttribute();
526         TryReturn(pAttr, true, "[osp-installer] pAttr is null");
527
528         pCoordinateSystem = pAttr->Find("CoordinateSystem");
529         if (pCoordinateSystem)
530         {
531                 _AppFeatureInfoImpl* pAppFeatureInfo = new _AppFeatureInfoImpl;
532                 TryReturn(pAppFeatureInfo, false, "[osp-installer] pAppFeatureInfo is null");
533
534                 pAppFeatureInfo->SetName("CoordinateSystem");
535                 pAppFeatureInfo->SetValue(pCoordinateSystem);
536
537                 __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
538
539                 AppLogTag(OSP_INSTALLER, "<CoordinateSystem=%s>", pCoordinateSystem);
540         }
541
542         pBaseScreenSize = pAttr->Find("BaseScreenSize");
543         if (pBaseScreenSize)
544         {
545                 _AppFeatureInfoImpl* pAppFeatureInfo = new _AppFeatureInfoImpl;
546                 TryReturn(pAppFeatureInfo, false, "[osp-installer] pAppFeatureInfo is null");
547
548                 pAppFeatureInfo->SetName("BaseScreenSize");
549                 pAppFeatureInfo->SetValue(pBaseScreenSize);
550
551                 __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
552
553                 AppLogTag(OSP_INSTALLER, "<BaseScreenSize=%s>", pBaseScreenSize);
554         }
555
556         pLogicalCoordinate = pAttr->Find("LogicalCoordinate");
557         if (pLogicalCoordinate)
558         {
559                 _AppFeatureInfoImpl* pAppFeatureInfo = new _AppFeatureInfoImpl;
560                 TryReturn(pAppFeatureInfo, false, "[osp-installer] pAppFeatureInfo is null");
561
562                 pAppFeatureInfo->SetName("LogicalCoordinate");
563                 pAppFeatureInfo->SetValue(pLogicalCoordinate);
564
565                 __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
566
567                 AppLogTag(OSP_INSTALLER, "<LogicalCoordinate=%s>", pLogicalCoordinate);
568         }
569
570         return true;
571 }
572
573 bool
574 ManifestHandler::OnUiThemeElement(void)
575 {
576         XmlAttribute *pAttr = null;
577         char *pSystemTheme = null;
578         char *pUserDefinedTheme = null;
579
580         AppLogTag(OSP_INSTALLER, "<UiTheme>");
581
582         pAttr = GetAttribute();
583         TryReturn(pAttr, true, "[osp-installer] pAttr is null");
584
585         pSystemTheme = pAttr->Find("SystemTheme");
586         if (pSystemTheme)
587         {
588                 _AppFeatureInfoImpl* pAppFeatureInfo = new _AppFeatureInfoImpl;
589                 TryReturn(pAppFeatureInfo, false, "[osp-installer] pAppFeatureInfo is null");
590
591                 pAppFeatureInfo->SetName("SystemTheme");
592                 pAppFeatureInfo->SetValue(pSystemTheme);
593
594                 __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
595
596                 AppLogTag(OSP_INSTALLER, "<SystemTheme=%s>", pSystemTheme);
597         }
598
599         pUserDefinedTheme = pAttr->Find("UserDefinedTheme");
600         if (pUserDefinedTheme)
601         {
602                 _AppFeatureInfoImpl* pAppFeatureInfo = new _AppFeatureInfoImpl;
603                 TryReturn(pAppFeatureInfo, false, "[osp-installer] pAppFeatureInfo is null");
604
605                 pAppFeatureInfo->SetName("UserDefinedTheme");
606                 pAppFeatureInfo->SetValue(pUserDefinedTheme);
607
608                 __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
609
610                 AppLogTag(OSP_INSTALLER, "<UserDefinedTheme=%s>", pUserDefinedTheme);
611         }
612
613         return true;
614 }
615
616 bool
617 ManifestHandler::OnIconsElement(void)
618 {
619         result r = E_SUCCESS;
620         int width = 0;
621         String defaultIconType;
622
623         AppLogTag(OSP_INSTALLER, "<Icons>");
624
625         r = _SystemInfoImpl::GetSysInfo(L"ScreenWidth", width);
626         if (IsFailed(r))
627         {
628                 defaultIconType = L"Xhigh";     
629         }
630         else
631         {
632                 if (width == 480)
633                 {
634                         defaultIconType = L"High";
635                 }
636                 else
637                 {
638                         defaultIconType = L"Xhigh";
639                 }
640         }
641
642         AppLogTag(OSP_INSTALLER, "ScreenWidth = [%d]", width);
643
644         __pDefaultIconType = _StringConverter::CopyToCharArrayN(defaultIconType);
645         TryReturn(__pDefaultIconType, false, "[osp-installer] __pDefaultIconType is null.");
646
647         AppLogTag(OSP_INSTALLER, "DefaultIconType = [%s]", __pDefaultIconType);
648
649         return true;
650 }
651
652 bool
653 ManifestHandler::OnIdValue(const char *pCharacters)
654 {
655         __pPackageInfoImpl->SetAppId(pCharacters);
656         AppLogTag(OSP_INSTALLER, "<Id>%s</Id>", pCharacters);
657
658         return true;
659 }
660
661 bool
662 ManifestHandler::OnVersionValue(const char *pCharacters)
663 {
664         __pPackageInfoImpl->SetAppVersion(pCharacters);
665         AppLogTag(OSP_INSTALLER, "<Version>%s</Version>", pCharacters);
666
667         return true;
668 }
669
670 bool
671 ManifestHandler::OnTypeValue(const char *pCharacters)
672 {
673         __pPackageInfoImpl->SetAppType(pCharacters);
674
675         if (strcasecmp(pCharacters, "Contents") == 0)
676         {
677                 __pPackageInfoImpl->SetAppApiVersion("3.0");
678         }
679
680         AppLogTag(OSP_INSTALLER, "<Type>%s</Type>", pCharacters);
681
682         return true;
683 }
684
685 bool
686 ManifestHandler::OnUrlValue(const char *pCharacters)
687 {
688         __pPackageInfoImpl->SetAppUrl(pCharacters);
689         AppLogTag(OSP_INSTALLER, "<Url>%s</Url>", pCharacters);
690
691         return true;
692 }
693
694 bool
695 ManifestHandler::OnSecretValue(const char *pCharacters)
696 {
697         __pPackageInfoImpl->SetAppSecret(pCharacters);
698         AppLogTag(OSP_INSTALLER, "<Secret>%s</Secret>", pCharacters);
699
700         return true;
701 }
702
703 bool
704 ManifestHandler::OnApiVersionValue(const char *pCharacters)
705 {
706         __pPackageInfoImpl->SetAppApiVersion(pCharacters);
707         AppLogTag(OSP_INSTALLER, "<ApiVersion>%s</ApiVersion>", pCharacters);
708
709         return true;
710 }
711
712 bool
713 ManifestHandler::OnIconValue(const char *pCharacters)
714 {
715         XmlAttribute *pAttr = 0;
716         char *pAttrValue1 = 0;
717         char *pTypeValue = 0;
718
719         pAttr = GetAttribute();
720         TryReturn(pAttr, true, "[osp-installer] pAttr is null");
721
722         pAttrValue1 = pAttr->Find("Section");
723         TryReturn(pAttrValue1, true, "[osp-installer] pAttrValue1 is null");
724
725         pTypeValue = pAttr->Find("Type");
726         TryReturn(pTypeValue, true, "[osp-installer] pTypeValue is null");
727
728         char icon[1024] = {0,};
729
730         if (strcasecmp(pTypeValue, "Xhigh") == 0)
731         {
732                 snprintf(icon, sizeof(icon), "%s/%s", "screen-density-xhigh", pCharacters);
733         }
734         else if (strcasecmp(pTypeValue, "High") == 0)
735         {
736                 snprintf(icon, sizeof(icon), "%s/%s", "screen-density-high", pCharacters);
737         }
738         else
739         {
740                 AppLogTag(OSP_INSTALLER, "Invalid Type [%s]", __pDefaultIconType);
741                 return false;
742         }
743
744         if (FindElement("Livebox") == true)
745         {
746                 TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null");
747                 __pLiveboxInfo->SetIcon(icon);
748         }
749         else if (FindElement("Content") == true)
750         {
751                 TryReturn(__pContentInfo, false, "[osp-installer] __pContentInfo is null");
752                 __pContentInfo->SetIcon(icon);
753         }
754         else
755         {
756                 if (strcasecmp(pAttrValue1, "MainMenu") == 0)
757                 {
758                         if (__isDefaultMainmenu == false)
759                         {
760                                 __pPackageAppInfoImpl->SetMainmenuIcon(icon);
761                         }
762
763                         if (strcasecmp(pTypeValue, __pDefaultIconType) == 0)
764                         {
765                                 __isDefaultMainmenu = true;
766                         }
767                 }
768                 else if (strcasecmp(pAttrValue1, "Setting") == 0)
769                 {
770                         if (__isDefaultSetting == false)
771                         {
772                                 __pPackageAppInfoImpl->SetSettingIcon(icon);
773                         }
774
775                         if (strcasecmp(pTypeValue, __pDefaultIconType) == 0)
776                         {
777                                 __isDefaultSetting = true;
778                         }
779                 }
780                 else if (strcasecmp(pAttrValue1, "Notification") == 0)
781                 {
782                         if (__isDefaultQuickpanel == false)
783                         {
784                                 __pPackageAppInfoImpl->SetQuickpanelIcon(icon);
785                         }
786
787                         if (strcasecmp(pTypeValue, __pDefaultIconType) == 0)
788                         {
789                                 __isDefaultQuickpanel = true;
790                         }
791                 }
792         }
793
794         AppLogTag(OSP_INSTALLER, "<Icon Section=\"%s\" Type=\"%s\">%s</Icon>", pAttrValue1, pTypeValue, pCharacters);
795
796         return true;
797 }
798
799 bool
800 ManifestHandler::OnPrivilegeValue(const char *pCharacters)
801 {
802         __pPrivilegeList->Add(*new String(pCharacters));
803         AppLogTag(OSP_INSTALLER, "<Privilege>%s</Privilege>", pCharacters);
804
805         return true;
806 }
807
808 bool
809 ManifestHandler::OnNameValue(const char *pCharacters)
810 {
811         XmlAttribute* pAttr = 0;
812         char* pAttrValue = 0;
813
814         pAttr = GetAttribute();
815         TryReturn(pAttr, true, "[osp-installer] pAttr is null");
816
817         pAttrValue = pAttr->Find("Locale");
818         TryReturn(pAttrValue, true, "[osp-installer] pAttrValue is null");
819
820         if (FindElement("Livebox") == true)
821         {
822                 TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null");
823
824                 String* pValue = new String;
825                 StringUtil::Utf8ToString(pCharacters, *pValue);
826                 __pLiveboxInfo->AddName(*(new String(pAttrValue)), *pValue);
827         }
828         else if (FindElement("Content") == true)
829         {
830                 TryReturn(__pContentInfo, false, "[osp-installer] __pContentInfo is null");
831
832                 String* pValue = new String;
833                 StringUtil::Utf8ToString(pCharacters, *pValue);
834                 __pContentInfo->AddName(*(new String(pAttrValue)), *pValue);
835         }
836         else
837         {
838                 if (strcasecmp(pAttrValue, "eng-GB") == 0 || strcasecmp(pAttrValue, "eng-US") == 0)
839                 {
840                         if (__isDefaultName == true)
841                         {
842                                 __pPackageInfoImpl->SetAppName(pCharacters);
843                         }
844                 }
845
846                 if (__pPackageAppInfoImpl)
847                 {
848                         String* pValue = new String;
849                         StringUtil::Utf8ToString(pCharacters, *pValue);
850                         __pPackageAppInfoImpl->AddName(*(new String(pAttrValue)), *pValue);
851                 }
852         }
853
854         AppLogTag(OSP_INSTALLER, "<Name Locale=\"%s\">%s</Name>", pAttrValue, pCharacters);
855
856         return true;
857 }
858
859 bool
860 ManifestHandler::OnVendorValue(const char *pCharacters)
861 {
862         XmlAttribute *pAttr = 0;
863         char *pAttrValue = 0;
864
865         pAttr = GetAttribute();
866         TryReturn(pAttr, true, "[osp-installer] pAttr is null");
867
868         pAttrValue = pAttr->Find("Locale");
869         TryReturn(pAttrValue, true, "[osp-installer] pAttrValue is null");
870
871         if (strcasecmp(pAttrValue, "eng-GB") == 0 || strcasecmp(pAttrValue, "eng-US") == 0)
872         {
873                 // Set default name
874                 __pPackageInfoImpl->SetAppVendor(pCharacters);
875         }
876
877         AppLogTag(OSP_INSTALLER, "<Vendor Locale=\"%s\">%s</Vendor>", pAttrValue, pCharacters);
878
879         return true;
880 }
881
882 bool
883 ManifestHandler::OnDescriptionValue(const char *pCharacters)
884 {
885         XmlAttribute *pAttr = 0;
886         char *pAttrValue = 0;
887
888         pAttr = GetAttribute();
889         TryReturn(pAttr, true, "[osp-installer] pAttr is null");
890
891         pAttrValue = pAttr->Find("Locale");
892         TryReturn(pAttrValue, true, "[osp-installer] pAttrValue is null");
893
894         if (strcasecmp(pAttrValue, "eng-GB") == 0 || strcasecmp(pAttrValue, "eng-US") == 0)
895         {
896                 // Set default name
897                 __pPackageInfoImpl->SetAppDescription(pCharacters);
898         }
899
900         AppLogTag(OSP_INSTALLER, "<Description Locale=\"%s\">%s</Description>", pAttrValue, pCharacters);
901
902         return true;
903 }
904
905 bool
906 ManifestHandler::OnDataControlTypeValue(const char *pCharacters)
907 {
908         XmlAttribute *pAttr = null;
909         char *pAccessValue = null;
910
911         pAttr = GetAttribute();
912         TryReturn(pAttr, true, "[osp-installer] pAttr is null");
913
914         pAccessValue = pAttr->Find("Access");
915         TryReturn(pAccessValue, true, "[osp-installer] pAccessValue is null");
916
917         __pDataControlTypeImpl = new _DataControlTypeImpl;
918         TryReturn(__pDataControlTypeImpl, false, "[osp-installer] __pDataControlTypeImpl is null");
919
920         __pDataControlTypeImpl->SetType(pCharacters);
921         __pDataControlTypeImpl->SetAccess(pAccessValue);
922
923         AppLogTag(OSP_INSTALLER, "<DataControlType Access=\"%s\", Type=\"%s\">", pAccessValue, pCharacters);
924
925         return true;
926 }
927
928 bool
929 ManifestHandler::OnConditionValue(const char *pCharacters)
930 {
931         XmlAttribute *pAttr = null;
932         char *pName = null;
933
934         pAttr = GetAttribute();
935         TryReturn(pAttr, true, "[osp-installer] pAttr is null");
936
937         pName = pAttr->Find("Name");
938         TryReturn(pName, true, "[osp-installer] pName is null");
939
940         __pLaunchConditionImpl = new _LaunchConditionInfoImpl;
941         TryReturn(__pLaunchConditionImpl, false, "[osp-installer] __pLaunchConditionImpl is null");
942
943         __pLaunchConditionImpl->SetName(pName);
944         __pLaunchConditionImpl->SetValue(pCharacters);
945
946         AppLogTag(OSP_INSTALLER, "<LaunchCondition Name=\"%s\", Value=\"%s\">", pName, pCharacters);
947
948         return true;
949 }
950
951 bool
952 ManifestHandler::OnNotificationValue(const char *pCharacters)
953 {
954         XmlAttribute *pAttr = null;
955         char *pName = null;
956
957         pAttr = GetAttribute();
958         TryReturn(pAttr, true, "[osp-installer] pAttr is null");
959
960         pName = pAttr->Find("Name");
961         TryReturn(pName, true, "[osp-installer] pName is null");
962
963         __pNotificationImpl = new _NotificationInfoImpl;
964         TryReturn(__pNotificationImpl, false, "[osp-installer] __pNotificationImpl is null");
965
966         __pNotificationImpl->SetName(pName);
967         __pNotificationImpl->SetValue(pCharacters);
968
969         AppLogTag(OSP_INSTALLER, "<Notification Name=\"%s\", Value=\"%s\">", pName, pCharacters);
970
971         return true;
972 }
973
974 bool
975 ManifestHandler::OnSizeValue(const char *pCharacters)
976 {
977         TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null");
978
979         __pLiveboxInfo->AddSize(*(new String(pCharacters)));
980         AppLogTag(OSP_INSTALLER, "<Size>%s</Size>", pCharacters);
981
982         return true;
983 }
984
985 bool
986 ManifestHandler::OnInstallationLocationValue(const char *pCharacters)
987 {
988         AppLogTag(OSP_INSTALLER, "<InstallationLocation>%s</InstallationLocation>", pCharacters);
989
990         if ((strcasecmp(pCharacters, "UserPreferred") == 0) &&
991                         (File::IsFileExist(DIR_MEMORYCARD_INSTALLATION) == true))
992         {
993                 AppLogTag(OSP_INSTALLER, "INSTALLATION_STORAGE = [EXTERNAL]");
994                 __pContext->SetInstallationStorage(InstallationContext::INSTALLATION_STORAGE_EXTERNAL);
995                 __pPackageInfoImpl->SetAppStorageType(PACKAGE_STORAGE_TYPE_EXTERNAL);
996         }
997
998         return true;
999 }
1000
1001 bool
1002 ManifestHandler::OnAppControlElement(void)
1003 {
1004         XmlAttribute *pAttr = null;
1005         char *pAttrValue1 = null;
1006         char *pAttrValue2 = null;
1007
1008         pAttr = GetAttribute();
1009         TryReturn(pAttr, true, "[osp-installer] pAttr is null");
1010
1011         pAttrValue1 = pAttr->Find("ProviderId");
1012         TryReturn(pAttrValue1, true, "[osp-installer] pAttrValue1 is null");
1013
1014         pAttrValue2 = pAttr->Find("Category");
1015         TryReturn(pAttrValue2, true, "[osp-installer] pAttrValue2 is null");
1016
1017         __pAppControlInfoImpl = new _AppControlInfoImpl;
1018         TryReturn(__pAppControlInfoImpl, false, "[osp-installer] __pAppControlInfoImpl is null");
1019
1020         __pAppControlInfoImpl->SetProviderId(pAttrValue1);
1021         __pAppControlInfoImpl->SetCategory(pAttrValue2);
1022
1023         AppLogTag(OSP_INSTALLER, "<AppControl ProviderId=\"%s\" Category=\"%s\">", pAttrValue1, pAttrValue2);
1024
1025         return true;
1026 }
1027
1028 bool
1029 ManifestHandler::OnCapabilityElement(void)
1030 {
1031         XmlAttribute *pAttr = null;
1032         char *pAttrValue = null;
1033
1034         pAttr = GetAttribute();
1035         TryReturn(pAttr, true, "[osp-installer] pAttr is null");
1036
1037         pAttrValue = pAttr->Find("OperationId");
1038         TryReturn(pAttrValue, true, "[osp-installer] pAttrValue1 is null");
1039
1040         __pAppControlCapabilityInfoImpl = new _AppControlCapabilityInfoImpl;
1041         TryReturn(__pAppControlCapabilityInfoImpl, false, "[osp-installer] __pAppControlCapabilityInfoImpl is null");
1042
1043         __pAppControlCapabilityInfoImpl->SetOperationId(pAttrValue);
1044
1045         AppLogTag(OSP_INSTALLER, "<Capability OperationId=\"%s\">", pAttrValue);
1046
1047         return true;
1048 }
1049
1050 bool
1051 ManifestHandler::OnResolutionElement(void)
1052 {
1053         XmlAttribute *pAttr = null;
1054         char *pAttrValue1 = null;
1055         char *pAttrValue2 = null;
1056
1057         pAttr = GetAttribute();
1058         TryReturn(pAttr, true, "[osp-installer] pAttr is null");
1059
1060         pAttrValue1 = pAttr->Find("MimeType");
1061         pAttrValue2 = pAttr->Find("UriScheme");
1062
1063         __pAppControlResolutionInfoImpl = new _AppControlResolutionInfoImpl;
1064         TryReturn(__pAppControlResolutionInfoImpl, false, "[osp-installer] __pAppControlResolutionInfoImpl is null");
1065
1066         if (pAttrValue1)
1067         {
1068                 String* pMimeType = new String(pAttrValue1);
1069                 __pAppControlResolutionInfoImpl->SetMimeType(pMimeType);
1070         }
1071
1072         if (pAttrValue2)
1073         {
1074                 String* pUriScheme = new String(pAttrValue2);
1075                 __pAppControlResolutionInfoImpl->SetUriScheme(pUriScheme);
1076         }
1077
1078         AppLogTag(OSP_INSTALLER, "<Resolution MimeType=\"%s\" UriScheme=\"%s\">", pAttrValue1, pAttrValue2);
1079
1080         return true;
1081 }
1082
1083 bool
1084 ManifestHandler::OnDataControlElement(void)
1085 {
1086         XmlAttribute *pAttr = null;
1087         char *pProviderId = null;
1088
1089         pAttr = GetAttribute();
1090         TryReturn(pAttr, true, "[osp-installer] pAttr is null");
1091
1092         pProviderId = pAttr->Find("ProviderId");
1093         TryReturn(pProviderId, true, "[osp-installer] pProviderId is null");
1094
1095         __pDataControlInfoImpl = new _DataControlInfoImpl;
1096         TryReturn(__pDataControlInfoImpl, false, "[osp-installer] __pDataControlInfoImpl is null");
1097
1098         __pDataControlInfoImpl->SetProviderId(pProviderId);
1099
1100         AppLogTag(OSP_INSTALLER, "<DataControl ProviderId=\"%s\">", pProviderId);
1101
1102         return true;
1103 }
1104
1105 bool
1106 ManifestHandler::OnUiAppElement(void)
1107 {
1108         XmlAttribute *pAttr = null;
1109         char *pExecutableName = null;
1110         char *pDefault = null;
1111         char *pMainmenuVisible = null;
1112         char *pCategory = null;
1113
1114         __pPackageAppInfoImpl = new _PackageAppInfoImpl;
1115         TryReturn(__pPackageAppInfoImpl, false, "[osp-installer] __pPackageAppInfoImpl is null");
1116
1117         pAttr = GetAttribute();
1118         TryReturn(pAttr, true, "[osp-installer] pAttr is null");
1119
1120         pExecutableName = pAttr->Find("ExecutableName");
1121         if (pExecutableName == null)
1122         {
1123                 pExecutableName = pAttr->Find("Name");
1124         }
1125         TryReturn(pExecutableName, true, "[osp-installer] pExecutableName is null");
1126
1127         __pPackageAppInfoImpl->SetName(pExecutableName);
1128
1129         pDefault = pAttr->Find("Default");
1130         if (pDefault)
1131         {
1132                 __pPackageAppInfoImpl->SetDefault(pDefault);
1133
1134                 if (strcasecmp(pDefault, "True") == 0)
1135                 {
1136                         __isDefaultName = true;
1137                         __isDefaultAppDetected = true;
1138                 }
1139         }
1140         else
1141         {
1142                 __pPackageAppInfoImpl->SetDefault("False");
1143         }
1144
1145         __pPackageAppInfoImpl->SetType("UiApp");
1146
1147         pMainmenuVisible = pAttr->Find("MainmenuVisible");
1148         if (pMainmenuVisible)
1149         {
1150                 if (strcasecmp(pMainmenuVisible, "True") == 0)
1151                 {
1152                         __pPackageAppInfoImpl->SetMainmenuVisible(true);
1153                 }
1154                 else
1155                 {
1156                         __pPackageAppInfoImpl->SetMainmenuVisible(false);
1157                 }
1158
1159                 _AppFeatureInfoImpl* pAppFeatureInfo = new _AppFeatureInfoImpl;
1160                 TryReturn(pAppFeatureInfo, false, "[osp-installer] pAppFeatureInfo is null");
1161
1162                 pAppFeatureInfo->SetName("MainmenuVisible");
1163                 pAppFeatureInfo->SetValue(pMainmenuVisible);
1164                 __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
1165
1166                 AppLogTag(OSP_INSTALLER, "<MainmenuVisible=%s>", pMainmenuVisible);
1167         }
1168
1169         String app_id;
1170
1171         if (__pContext->GetPackageNameType() == INSTALLER_PREFIX_TYPE_ORG)
1172         {
1173                 app_id.Format(1024, PACKAGE_NAME_RULE_ORG, __pPackageInfoImpl->GetAppId().GetPointer(), pExecutableName);
1174         }
1175         else
1176         {
1177                 app_id.Format(1024, PACKAGE_NAME_RULE, __pPackageInfoImpl->GetAppId().GetPointer(), pExecutableName);
1178         }
1179
1180         __pPackageAppInfoImpl->SetPackageName(app_id);
1181
1182         pCategory = pAttr->Find("Category");
1183         if (pCategory)
1184         {
1185                 AppLogTag(OSP_INSTALLER, "<Category=%s>", pCategory);
1186
1187                 CategoryType categoryType = InstallerUtil::GetCategoryType(pCategory);
1188                 __pPackageAppInfoImpl->SetAppFeature(categoryType);
1189         }
1190
1191         AppLogTag(OSP_INSTALLER, "app_id = %S", app_id.GetPointer());
1192         AppLogTag(OSP_INSTALLER, "<UiApp Name=\"%s\" Default=\"%s\">", pExecutableName, pDefault ? pDefault:"False");
1193
1194         return true;
1195 }
1196
1197 bool
1198 ManifestHandler::OnServiceAppElement(void)
1199 {
1200         XmlAttribute *pAttr = null;
1201         char *pExecutableName = null;
1202         char *pDefault = null;
1203         char *pMainmenuVisible = null;
1204         char *pLaunchOnBoot = null;
1205         char *pAutoRestart = null;
1206         char *pRemoteUi = null;
1207
1208         __pPackageAppInfoImpl = new _PackageAppInfoImpl;
1209         TryReturn(__pPackageAppInfoImpl, false, "[osp-installer] __pPackageAppInfoImpl is null");
1210
1211         pAttr = GetAttribute();
1212         TryReturn(pAttr, true, "pAttr is null");
1213
1214         pExecutableName = pAttr->Find("ExecutableName");
1215         if (pExecutableName == null)
1216         {
1217                 pExecutableName = pAttr->Find("Name");
1218         }
1219         TryReturn(pExecutableName, true, "[osp-installer] pExecutableName is null");
1220
1221         __pPackageAppInfoImpl->SetName(pExecutableName);
1222
1223         pDefault = pAttr->Find("Default");
1224         if (pDefault)
1225         {
1226                 __pPackageAppInfoImpl->SetDefault(pDefault);
1227
1228                 if (strcasecmp(pDefault, "True") == 0)
1229                 {
1230                         __isDefaultName = true;
1231                         __isDefaultAppDetected = true;
1232                 }
1233         }
1234         else
1235         {
1236                 __pPackageAppInfoImpl->SetDefault("False");
1237         }
1238
1239         __pPackageAppInfoImpl->SetType("ServiceApp");
1240         __pPackageAppInfoImpl->SetMainmenuVisible(false);
1241
1242         pMainmenuVisible = pAttr->Find("MainmenuVisible");
1243         if (pMainmenuVisible)
1244         {
1245                 _AppFeatureInfoImpl* pAppFeatureInfo = new _AppFeatureInfoImpl;
1246                 TryReturn(pAppFeatureInfo, false, "[osp-installer] pAppFeatureInfo is null");
1247
1248                 pAppFeatureInfo->SetName("MainmenuVisible");
1249                 pAppFeatureInfo->SetValue(pMainmenuVisible);
1250                 __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
1251
1252                 AppLogTag(OSP_INSTALLER, "<MainmenuVisible=%s>", pMainmenuVisible);
1253         }
1254
1255         pLaunchOnBoot = pAttr->Find("LaunchOnBoot");
1256         if (pLaunchOnBoot)
1257         {
1258                 _AppFeatureInfoImpl* pAppFeatureInfo = new _AppFeatureInfoImpl;
1259                 TryReturn(pAppFeatureInfo, false, "[osp-installer] pAppFeatureInfo is null");
1260
1261                 pAppFeatureInfo->SetName("LaunchOnBoot");
1262                 pAppFeatureInfo->SetValue(pLaunchOnBoot);
1263
1264                 __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
1265
1266                 AppLogTag(OSP_INSTALLER, "<LaunchOnBoot=%s>", pLaunchOnBoot);
1267         }
1268
1269         pAutoRestart = pAttr->Find("AutoRestart");
1270         if (pAutoRestart)
1271         {
1272                 _AppFeatureInfoImpl* pAppFeatureInfo = new _AppFeatureInfoImpl;
1273                 TryReturn(pAppFeatureInfo, false, "[osp-installer] pAppFeatureInfo is null");
1274
1275                 pAppFeatureInfo->SetName("AutoRestart");
1276                 pAppFeatureInfo->SetValue(pAutoRestart);
1277
1278                 __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
1279
1280                 AppLogTag(OSP_INSTALLER, "<AutoRestart=%s>", pAutoRestart);
1281         }
1282
1283         pRemoteUi = pAttr->Find("RemoteUi");
1284         if (pRemoteUi)
1285         {
1286                 _AppFeatureInfoImpl* pAppFeatureInfo = new _AppFeatureInfoImpl;
1287                 TryReturn(pAppFeatureInfo, false, "[osp-installer] pAppFeatureInfo is null");
1288
1289                 pAppFeatureInfo->SetName("RemoteUi");
1290                 pAppFeatureInfo->SetValue(pRemoteUi);
1291
1292                 __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
1293
1294                 AppLogTag(OSP_INSTALLER, "<RemoteUi=%s>", pRemoteUi);
1295         }
1296
1297         String app_id;
1298
1299         if (__pContext->GetPackageNameType() == INSTALLER_PREFIX_TYPE_ORG)
1300         {
1301                 app_id.Format(1024, PACKAGE_NAME_RULE_ORG, __pPackageInfoImpl->GetAppId().GetPointer(), pExecutableName);
1302         }
1303         else
1304         {
1305                 app_id.Format(1024, PACKAGE_NAME_RULE, __pPackageInfoImpl->GetAppId().GetPointer(), pExecutableName);
1306         }
1307
1308         __pPackageAppInfoImpl->SetPackageName(app_id);
1309
1310         AppLogTag(OSP_INSTALLER, "app_id = %S", app_id.GetPointer());
1311         AppLogTag(OSP_INSTALLER, "<ServiceApp Name=\"%s\" Default=\"%s\">", pExecutableName, pDefault ? pDefault:"False");
1312
1313         return true;
1314 }
1315
1316 bool
1317 ManifestHandler::FindElement(const char *pName)
1318 {
1319         bool res = false;
1320         Osp::Base::Collection::IEnumerator* pEnum = GetElementEnumeratorN();
1321
1322         if (pEnum)
1323         {
1324                 while(pEnum->MoveNext() == E_SUCCESS)
1325                 {
1326                         String* pStr = static_cast<String*>(pEnum->GetCurrent());
1327                         if (pStr)
1328                         {
1329                                 if (pStr->Equals(pName, false) == true)
1330                                 {
1331                                         AppLogTag(OSP_INSTALLER, "[%s] is matched.", pName);
1332                                         res = true;
1333                                         break;
1334                                 }
1335                         }
1336                 }
1337
1338                 delete pEnum;
1339         }
1340
1341         return res;
1342 }