Implementation Livebox, Accounts parsers.
authorDongeup Ham <dongeup.ham@samsung.com>
Thu, 3 Jan 2013 01:19:00 +0000 (10:19 +0900)
committerDongeup Ham <dongeup.ham@samsung.com>
Thu, 3 Jan 2013 02:21:50 +0000 (11:21 +0900)
Change-Id: Iee2b4bf218636a2ece19a7cd2378ec04d39b8a09
Signed-off-by: Dongeup Ham <dongeup.ham@samsung.com>
19 files changed:
CMakeLists.txt
inc/InstallerDefs.h
src/Context/InstallationContext.cpp
src/Context/InstallationContext.h
src/Context/InstallationContextData.cpp [new file with mode: 0755]
src/Context/InstallationContextData.h [new file with mode: 0755]
src/Manager/ConfigurationManager.cpp
src/Step/SignatureStep.cpp
src/XmlHandler/ManifestGenerator.cpp
src/XmlHandler/ManifestHandler.cpp
src/XmlHandler/ManifestHandler.h
src/XmlHandler/Parser/ManifestAccountsParser.cpp [new file with mode: 0755]
src/XmlHandler/Parser/ManifestAccountsParser.h [new file with mode: 0755]
src/XmlHandler/Parser/ManifestLiveboxesParser.cpp [new file with mode: 0755]
src/XmlHandler/Parser/ManifestLiveboxesParser.h [new file with mode: 0755]
src/XmlHandler/Parser/ManifestParser.cpp [new file with mode: 0755]
src/XmlHandler/Parser/ManifestParser.h [new file with mode: 0755]
src/XmlHandler/XmlHandler.h [changed mode: 0644->0755]
src/XmlHandler/XmlWriter.cpp

index 815bc60..3d13070 100755 (executable)
@@ -11,6 +11,7 @@ INCLUDE_DIRECTORIES(
        src/Installer
        src/Manager
        src/XmlHandler
+       src/XmlHandler/Parser
        src/Step
        src/Util
        /usr/include/glib-2.0
@@ -32,6 +33,7 @@ INCLUDE_DIRECTORIES(
 SET (${this_target}_SOURCE_FILES
        src/Context/DrmLicense.cpp
        src/Context/InstallationContext.cpp
+       src/Context/InstallationContextData.cpp
        src/Installer/DirectoryInstaller.cpp
        src/Installer/GuestInstaller.cpp
        src/Installer/IDEInstaller.cpp
@@ -59,6 +61,9 @@ SET (${this_target}_SOURCE_FILES
        src/XmlHandler/XmlHandler.cpp
        src/XmlHandler/XmlWriter.cpp
        src/XmlHandler/PrivilegeHandler.cpp
+       src/XmlHandler/Parser/ManifestParser.cpp
+       src/XmlHandler/Parser/ManifestAccountsParser.cpp
+       src/XmlHandler/Parser/ManifestLiveboxesParser.cpp
        src/backend/backend.cpp
        src/Util/InstallerUtil.cpp
        )
index c644b83..a70a471 100755 (executable)
@@ -21,7 +21,7 @@
 #ifndef _INSTALLER_DEFS_H_
 #define _INSTALLER_DEFS_H_
 
-#define OSP_INSTALLER_VERSION "osp-installer version = [2012/12/28]_RC[1]"
+#define OSP_INSTALLER_VERSION "osp-installer version = [2013/01/03]_[1]"
 
 #define DIR_BIN                                L"/bin"
 #define DIR_INFO                       L"/info"
index 34adf81..4cb56ea 100755 (executable)
@@ -54,8 +54,8 @@ InstallationContext::InstallationContext(void)
 ,__operation(INSTALLER_OPERATION_INSTALL)
 ,__storage(INSTALLATION_STORAGE_INTERNAL)
 ,__pPrivilegeList(null)
-,__pLiveBoxList(null)
-,__pContentInfoList(null)
+,__pLiveboxDataList(null)
+,__pContentDataList(null)
 ,__pAuthorCertPath(null)
 ,__pDistributorCertPath(null)
 ,__rootCertType(ROOT_CERTIFICATE_NONE)
@@ -86,11 +86,11 @@ InstallationContext::~InstallationContext(void)
                __pPrivilegeList = null;
        }
 
-       if (__pLiveBoxList)
+       if (__pLiveboxDataList)
        {
-               __pLiveBoxList->RemoveAll();
-               delete __pLiveBoxList;
-               __pLiveBoxList = null;
+               __pLiveboxDataList->RemoveAll();
+               delete __pLiveboxDataList;
+               __pLiveboxDataList = null;
        }
 
        if (__pAppDataList)
@@ -438,27 +438,27 @@ InstallationContext::SetPrivilegeList(ArrayList* privilegeList)
 }
 
 ArrayList*
-InstallationContext::GetLiveBoxList(void) const
+InstallationContext::GetLiveboxDataList(void) const
 {
-       return __pLiveBoxList;
+       return __pLiveboxDataList;
 }
 
 void
-InstallationContext::SetLiveBoxList(ArrayList* pLiveBoxList)
+InstallationContext::SetLiveboxDataList(ArrayList* pLiveboxDataList)
 {
-       __pLiveBoxList = pLiveBoxList;
+       __pLiveboxDataList = pLiveboxDataList;
 }
 
 ArrayList*
-InstallationContext::GetContentInfoList(void) const
+InstallationContext::GetContentDataList(void) const
 {
-       return __pContentInfoList;
+       return __pContentDataList;
 }
 
 void
-InstallationContext::SetContentInfoList(ArrayList* pContentInfoList)
+InstallationContext::SetContentDataList(ArrayList* pContentDataList)
 {
-       __pContentInfoList = pContentInfoList;
+       __pContentDataList = pContentDataList;
 }
 
 X509CertificatePath*
@@ -526,194 +526,3 @@ InstallationContext::GetPackageInfoImpl(void) const
 {
        return __pPackageInfoImpl;
 }
-
-LiveboxInfo::LiveboxInfo(void)
-:__updatePeriod(0)
-,__pNameList(null)
-,__pSizeList(null)
-{
-       __pNameList = new (std::nothrow) HashMap;
-       TryReturn(__pNameList, , "[osp-installer] __pNameList is null.");
-       __pNameList->Construct();
-
-       __pSizeList = new (std::nothrow) ArrayList;
-       TryReturn(__pSizeList, , "[osp-installer] __pSizeList is null.");
-       __pSizeList->Construct();
-}
-
-LiveboxInfo::~LiveboxInfo(void)
-{
-       __pNameList->RemoveAll(true);
-       delete __pNameList;
-
-       __pSizeList->RemoveAll(true);
-       delete __pSizeList;
-}
-
-result
-LiveboxInfo::SetUpdatePeriod(long long period)
-{
-       __updatePeriod = period;
-       return E_SUCCESS;
-}
-
-long long
-LiveboxInfo::GetUpdatePeriod(void) const
-{
-       return __updatePeriod;
-}
-
-result
-LiveboxInfo::SetPopupEnabled(const String& value)
-{
-       __popupEnabled = value;
-       return E_SUCCESS;
-}
-
-const String&
-LiveboxInfo::GetPopupEnabled(void) const
-{
-       return __popupEnabled;
-}
-
-result
-LiveboxInfo::SetIcon(const String& icon)
-{
-       __icon = icon;
-       return E_SUCCESS;
-}
-
-const String&
-LiveboxInfo::GetIcon(void) const
-{
-       return __icon;
-}
-
-result
-LiveboxInfo::SetName(const String& name)
-{
-       __name = name;
-       return E_SUCCESS;
-}
-
-const String&
-LiveboxInfo::GetName(void) const
-{
-       return __name;
-}
-
-result
-LiveboxInfo::AddName(const String& language, const String& name)
-{
-       result r = E_SUCCESS;
-
-       r = __pNameList->Add(language, name);
-
-       return r;
-}
-
-HashMap*
-LiveboxInfo::GetNameList(void) const
-{
-       return __pNameList;
-}
-
-result
-LiveboxInfo::AddSize(const String& size)
-{
-       result r = E_SUCCESS;
-
-       r = __pSizeList->Add(size);
-
-       return r;
-}
-
-ArrayList*
-LiveboxInfo::GetSizeList(void) const
-{
-       return __pSizeList;
-}
-
-ContentInfo::ContentInfo(void)
-:__pNameList(null)
-{
-       __pNameList = new (std::nothrow) HashMap;
-       TryReturn(__pNameList, , "[osp-installer] __pNameList is null.");
-       __pNameList->Construct();
-}
-
-ContentInfo::~ContentInfo(void)
-{
-       __pNameList->RemoveAll(true);
-       delete __pNameList;
-}
-
-result
-ContentInfo::SetContentId(const String& contentId)
-{
-       __contentId = contentId;
-       return E_SUCCESS;
-}
-
-const String&
-ContentInfo::GetContentId(void) const
-{
-       return __contentId;
-}
-
-result
-ContentInfo::SetIcon(const String& icon)
-{
-       __icon = icon;
-       return E_SUCCESS;
-}
-
-const String&
-ContentInfo::GetIcon(void) const
-{
-       return __icon;
-}
-
-result
-ContentInfo::AddName(const String& language, const String& name)
-{
-       result r = E_SUCCESS;
-
-       r = __pNameList->Add(language, name);
-
-       return r;
-}
-
-HashMap*
-ContentInfo::GetNameList(void) const
-{
-       return __pNameList;
-}
-
-AppControlData::AppControlData()
-:__pOperationDataList(null)
-{
-       __pOperationDataList = new (std::nothrow) ArrayListT<OperationData*>;
-}
-
-AppControlData::~AppControlData()
-{
-       __pOperationDataList->RemoveAll();
-       delete __pOperationDataList;
-}
-
-AppData::AppData()
-:__pCategoryList(null)
-,__pAppControlData(null)
-{
-       __pCategoryList = new (std::nothrow) ArrayListT<String*>;
-       __pAppControlData = new (std::nothrow) AppControlData;
-}
-
-AppData::~AppData()
-{
-       __pCategoryList->RemoveAll();
-       delete __pCategoryList;
-
-       delete __pAppControlData;
-}
index 24ba7cc..b1d77da 100755 (executable)
 // limitations under the License.
 //
 /**
- * @file       InstallerContext.h
- * @brief      This is the header file for the %InstallerContext class.
+ * @file       InstallationContext.h
+ * @brief      This is the header file for the %InstallationContext class.
  *
- * This header file contains the declarations of the %InstallerContext class.
+ * This header file contains the declarations of the %InstallationContext class.
  */
 #ifndef _INSTALLATION_CONTEXT_H_
 #define _INSTALLATION_CONTEXT_H_
 #include "InstallerDefs.h"
 #include "IInstallationStep.h"
 #include "DrmLicense.h"
+#include "InstallationContextData.h"
 
 class IInstallationStep;
 
-class OperationData
-       : public Tizen::Base::Object
-{
-public:
-       OperationData(){};
-       virtual ~OperationData(){};
-
-       Tizen::Base::String __id;
-       Tizen::Base::String __mimeType;
-       Tizen::Base::String __uri;
-};
-
-class AppControlData
-       : public Tizen::Base::Object
-{
-public:
-               AppControlData();
-               virtual ~AppControlData();
-
-               Tizen::Base::Collection::IListT<OperationData*>* __pOperationDataList;
-};
-
-class AppData
-       : public Tizen::Base::Object
-{
-public:
-       AppData();
-       virtual ~AppData();
-
-       Tizen::Base::Collection::IListT<Tizen::Base::String*>* __pCategoryList;
-       AppControlData* __pAppControlData;
-       Tizen::Base::String name;
-
-private:
-};
-
-class PackageData
-       : public Tizen::Base::Object
-{
-public:
-       PackageData(){};
-       virtual ~PackageData(){};
-
-};
-
 /**
  * @class              InstallationContext
  * @brief              This class represents the class of InstallationContext.
@@ -163,11 +119,11 @@ public:
        const Tizen::Base::Collection::ArrayList* GetPrivilegeList(void) const;
        void SetPrivilegeList(Tizen::Base::Collection::ArrayList* privilegeList);
 
-       Tizen::Base::Collection::ArrayList* GetLiveBoxList(void) const;
-       void SetLiveBoxList(Tizen::Base::Collection::ArrayList* pLiveBoxList);
+       Tizen::Base::Collection::ArrayList* GetLiveboxDataList(void) const;
+       void SetLiveboxDataList(Tizen::Base::Collection::ArrayList* pLiveboxDataList);
 
-       Tizen::Base::Collection::ArrayList* GetContentInfoList(void) const;
-       void SetContentInfoList(Tizen::Base::Collection::ArrayList* pContentInfoList);
+       Tizen::Base::Collection::ArrayList* GetContentDataList(void) const;
+       void SetContentDataList(Tizen::Base::Collection::ArrayList* pContentDataList);
 
        Tizen::Security::Cert::X509CertificatePath* GetAuthorCertPath(void) const;
        void SetAuthorCertPath(Tizen::Security::Cert::X509CertificatePath* pAuthorCertPath);
@@ -221,8 +177,8 @@ private:
        Tizen::Base::String __appRootPath;
 
        Tizen::Base::Collection::ArrayList* __pPrivilegeList;
-       Tizen::Base::Collection::ArrayList* __pLiveBoxList;
-       Tizen::Base::Collection::ArrayList* __pContentInfoList;
+       Tizen::Base::Collection::ArrayList* __pLiveboxDataList;
+       Tizen::Base::Collection::ArrayList* __pContentDataList;
        Tizen::Security::Cert::X509CertificatePath* __pAuthorCertPath;
        Tizen::Security::Cert::X509CertificatePath* __pDistributorCertPath;
        RootCertificateType __rootCertType;
@@ -234,73 +190,4 @@ private:
 
 }; // InstallationContext
 
-class LiveboxInfo
-       : public Tizen::Base::Object
-{
-public:
-       LiveboxInfo(void);
-       virtual ~LiveboxInfo(void);
-
-       result SetUpdatePeriod(long long period);
-       long long GetUpdatePeriod(void) const;
-
-       result SetPopupEnabled(const Tizen::Base::String& value);
-       const Tizen::Base::String& GetPopupEnabled(void) const;
-
-       result SetIcon(const Tizen::Base::String& icon);
-       const Tizen::Base::String& GetIcon(void) const;
-
-       result SetName(const Tizen::Base::String& name);
-       const Tizen::Base::String& GetName(void) const;
-
-       result AddName(const Tizen::Base::String& language, const Tizen::Base::String& name);
-       Tizen::Base::Collection::HashMap* GetNameList(void) const;
-
-       result AddSize(const Tizen::Base::String& size);
-       Tizen::Base::Collection::ArrayList* GetSizeList(void) const;
-
-       Tizen::Base::String __main;
-       Tizen::Base::String __configurationAppControlAppId;
-
-private:
-       LiveboxInfo(const LiveboxInfo& value);
-       LiveboxInfo& operator =(const LiveboxInfo& source);
-
-       long long __updatePeriod;
-       Tizen::Base::String __popupEnabled;
-       Tizen::Base::String __icon;
-       Tizen::Base::String __name;
-
-       Tizen::Base::Collection::HashMap* __pNameList;
-       Tizen::Base::Collection::ArrayList* __pSizeList;
-
-}; // LiveboxInfo
-
-class ContentInfo
-       : public Tizen::Base::Object
-{
-public:
-       ContentInfo(void);
-       virtual ~ContentInfo(void);
-
-       result SetContentId(const Tizen::Base::String& contentId);
-       const Tizen::Base::String& GetContentId(void) const;
-
-       result SetIcon(const Tizen::Base::String& icon);
-       const Tizen::Base::String& GetIcon(void) const;
-
-       result AddName(const Tizen::Base::String& language, const Tizen::Base::String& name);
-       Tizen::Base::Collection::HashMap* GetNameList(void) const;
-
-private:
-       ContentInfo(const ContentInfo& value);
-       ContentInfo& operator =(const ContentInfo& source);
-
-       Tizen::Base::String __icon;
-       Tizen::Base::String __contentId;
-
-       Tizen::Base::Collection::HashMap* __pNameList;
-
-}; // ContentInfo
-
 #endif // _INSTALLATION_CONTEXT_H_
diff --git a/src/Context/InstallationContextData.cpp b/src/Context/InstallationContextData.cpp
new file mode 100755 (executable)
index 0000000..986b436
--- /dev/null
@@ -0,0 +1,243 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file       InstallationContextData.cpp
+ * @brief      This is the implementation for the InstallationContextData class.
+ */
+
+#include "InstallationContextData.h"
+
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Io;
+using namespace Tizen::Security::Cert;
+using namespace Tizen::App::Package;
+
+
+AppControlData::AppControlData()
+:__pOperationDataList(null)
+{
+       __pOperationDataList = new (std::nothrow) ArrayListT<OperationData*>;
+}
+
+AppControlData::~AppControlData()
+{
+       __pOperationDataList->RemoveAll();
+       delete __pOperationDataList;
+}
+
+
+AccountData::AccountData()
+:__pNameList(null)
+{
+       __pNameList = new (std::nothrow) HashMap;
+       TryReturn(__pNameList, , "[osp-installer] __pNameList is null.");
+       __pNameList->Construct();
+}
+
+AccountData::~AccountData()
+{
+       __pNameList->RemoveAll(true);
+       delete __pNameList;
+}
+
+
+LiveboxData::LiveboxData(void)
+:__updatePeriod(0)
+,__pNameList(null)
+,__pSizeList(null)
+{
+       __pNameList = new (std::nothrow) HashMap;
+       TryReturn(__pNameList, , "[osp-installer] __pNameList is null.");
+       __pNameList->Construct();
+
+       __pSizeList = new (std::nothrow) ArrayList;
+       TryReturn(__pSizeList, , "[osp-installer] __pSizeList is null.");
+       __pSizeList->Construct();
+}
+
+LiveboxData::~LiveboxData(void)
+{
+       __pNameList->RemoveAll(true);
+       delete __pNameList;
+
+       __pSizeList->RemoveAll(true);
+       delete __pSizeList;
+}
+
+result
+LiveboxData::SetUpdatePeriod(long long period)
+{
+       __updatePeriod = period;
+       return E_SUCCESS;
+}
+
+long long
+LiveboxData::GetUpdatePeriod(void) const
+{
+       return __updatePeriod;
+}
+
+result
+LiveboxData::SetPopupEnabled(const String& value)
+{
+       __popupEnabled = value;
+       return E_SUCCESS;
+}
+
+const String&
+LiveboxData::GetPopupEnabled(void) const
+{
+       return __popupEnabled;
+}
+
+result
+LiveboxData::SetIcon(const String& icon)
+{
+       __icon = icon;
+       return E_SUCCESS;
+}
+
+const String&
+LiveboxData::GetIcon(void) const
+{
+       return __icon;
+}
+
+result
+LiveboxData::SetName(const String& name)
+{
+       __name = name;
+       return E_SUCCESS;
+}
+
+const String&
+LiveboxData::GetName(void) const
+{
+       return __name;
+}
+
+result
+LiveboxData::AddName(const String& language, const String& name)
+{
+       result r = E_SUCCESS;
+
+       r = __pNameList->Add(language, name);
+
+       return r;
+}
+
+HashMap*
+LiveboxData::GetNameList(void) const
+{
+       return __pNameList;
+}
+
+result
+LiveboxData::AddSize(const String& size)
+{
+       result r = E_SUCCESS;
+
+       r = __pSizeList->Add(size);
+
+       return r;
+}
+
+ArrayList*
+LiveboxData::GetSizeList(void) const
+{
+       return __pSizeList;
+}
+
+
+ContentData::ContentData(void)
+:__pNameList(null)
+{
+       __pNameList = new (std::nothrow) HashMap;
+       TryReturn(__pNameList, , "[osp-installer] __pNameList is null.");
+       __pNameList->Construct();
+}
+
+ContentData::~ContentData(void)
+{
+       __pNameList->RemoveAll(true);
+       delete __pNameList;
+}
+
+result
+ContentData::SetContentId(const String& contentId)
+{
+       __contentId = contentId;
+       return E_SUCCESS;
+}
+
+const String&
+ContentData::GetContentId(void) const
+{
+       return __contentId;
+}
+
+result
+ContentData::SetIcon(const String& icon)
+{
+       __icon = icon;
+       return E_SUCCESS;
+}
+
+const String&
+ContentData::GetIcon(void) const
+{
+       return __icon;
+}
+
+result
+ContentData::AddName(const String& language, const String& name)
+{
+       result r = E_SUCCESS;
+
+       r = __pNameList->Add(language, name);
+
+       return r;
+}
+
+HashMap*
+ContentData::GetNameList(void) const
+{
+       return __pNameList;
+}
+
+AppData::AppData()
+:__pCategoryList(null)
+,__pAppControlData(null)
+,__pAccountDataList(null)
+{
+       __pCategoryList = new (std::nothrow) ArrayListT<String*>;
+       __pAppControlData = new (std::nothrow) AppControlData;
+       __pAccountDataList = new (std::nothrow) ArrayListT<AccountData*>;
+}
+
+AppData::~AppData()
+{
+       __pCategoryList->RemoveAll();
+       delete __pCategoryList;
+
+       delete __pAppControlData;
+
+       __pAccountDataList->RemoveAll();
+       delete __pAccountDataList;
+}
diff --git a/src/Context/InstallationContextData.h b/src/Context/InstallationContextData.h
new file mode 100755 (executable)
index 0000000..efe552f
--- /dev/null
@@ -0,0 +1,167 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file       InstallerContextData.h
+ * @brief      This is the header file for the context data classes.
+ *
+ * This header file contains the declarations of the the context data classes.
+ */
+#ifndef _INSTALLATION_CONTEXT_DATA_H_
+#define _INSTALLATION_CONTEXT_DATA_H_
+
+#include <FAppPkg_PackageInfoImpl.h>
+#include <FSecCertX509CertificatePath.h>
+
+#include "InstallerDefs.h"
+
+
+class OperationData
+       : public Tizen::Base::Object
+{
+public:
+       OperationData(){};
+       virtual ~OperationData(){};
+
+       Tizen::Base::String __id;
+       Tizen::Base::String __mimeType;
+       Tizen::Base::String __uri;
+};
+
+
+class AppControlData
+       : public Tizen::Base::Object
+{
+public:
+       AppControlData();
+       virtual ~AppControlData();
+
+       Tizen::Base::Collection::IListT<OperationData*>* __pOperationDataList;
+};
+
+
+class AccountData
+       : public Tizen::Base::Object
+{
+public:
+       AccountData();
+       virtual ~AccountData();
+
+       Tizen::Base::String __providerId;
+       Tizen::Base::String __multipleAccountsSupport;
+       Tizen::Base::String __accountIcon;
+       Tizen::Base::String __accountSmallIcon;
+       Tizen::Base::Collection::HashMap* __pNameList;
+};
+
+
+class LiveboxData
+       : public Tizen::Base::Object
+{
+public:
+       LiveboxData(void);
+       virtual ~LiveboxData(void);
+
+       result SetUpdatePeriod(long long period);
+       long long GetUpdatePeriod(void) const;
+
+       result SetPopupEnabled(const Tizen::Base::String& value);
+       const Tizen::Base::String& GetPopupEnabled(void) const;
+
+       result SetIcon(const Tizen::Base::String& icon);
+       const Tizen::Base::String& GetIcon(void) const;
+
+       result SetName(const Tizen::Base::String& name);
+       const Tizen::Base::String& GetName(void) const;
+
+       result AddName(const Tizen::Base::String& language, const Tizen::Base::String& name);
+       Tizen::Base::Collection::HashMap* GetNameList(void) const;
+
+       result AddSize(const Tizen::Base::String& size);
+       Tizen::Base::Collection::ArrayList* GetSizeList(void) const;
+
+       Tizen::Base::String __main;
+       Tizen::Base::String __configurationAppControlAppId;
+
+private:
+       LiveboxData(const LiveboxData& value);
+       LiveboxData& operator =(const LiveboxData& source);
+
+       long long __updatePeriod;
+       Tizen::Base::String __popupEnabled;
+       Tizen::Base::String __icon;
+       Tizen::Base::String __name;
+
+       Tizen::Base::Collection::HashMap* __pNameList;
+       Tizen::Base::Collection::ArrayList* __pSizeList;
+
+};
+
+
+class ContentData
+       : public Tizen::Base::Object
+{
+public:
+       ContentData(void);
+       virtual ~ContentData(void);
+
+       result SetContentId(const Tizen::Base::String& contentId);
+       const Tizen::Base::String& GetContentId(void) const;
+
+       result SetIcon(const Tizen::Base::String& icon);
+       const Tizen::Base::String& GetIcon(void) const;
+
+       result AddName(const Tizen::Base::String& language, const Tizen::Base::String& name);
+       Tizen::Base::Collection::HashMap* GetNameList(void) const;
+
+private:
+       ContentData(const ContentData& value);
+       ContentData& operator =(const ContentData& source);
+
+       Tizen::Base::String __icon;
+       Tizen::Base::String __contentId;
+
+       Tizen::Base::Collection::HashMap* __pNameList;
+
+};
+
+
+class AppData
+       : public Tizen::Base::Object
+{
+public:
+       AppData();
+       virtual ~AppData();
+
+       Tizen::Base::Collection::IListT<Tizen::Base::String*>* __pCategoryList;
+       AppControlData* __pAppControlData;
+       Tizen::Base::String name;
+       Tizen::Base::Collection::IListT<AccountData*>* __pAccountDataList;
+
+private:
+};
+
+
+class PackageData
+       : public Tizen::Base::Object
+{
+public:
+       PackageData(){};
+       virtual ~PackageData(){};
+};
+
+
+#endif // _INSTALLATION_CONTEXT_DATA_H_
index fffaa91..9f85304 100755 (executable)
@@ -65,7 +65,7 @@ ConfigurationManager::CreateFile(InstallationContext* pContext)
        char* pXmlPath = null;
        int err = 0;
        bool hybridService = pContext->IsHybridService();
-       ArrayList* pContentInfoList = null;
+       ArrayList* pContentDataList = null;
 
        _PackageInfoImpl *pPackageInfoImpl = null;
        pPackageInfoImpl = pContext->GetPackageInfoImpl();
@@ -221,16 +221,16 @@ ConfigurationManager::CreateFile(InstallationContext* pContext)
                }
        }
 
-       pContentInfoList = pContext->GetContentInfoList();
-       if (pContentInfoList)
+       pContentDataList = pContext->GetContentDataList();
+       if (pContentDataList)
        {
-               int contentCount = pContentInfoList->GetCount();
+               int contentCount = pContentDataList->GetCount();
                for (int i = 0 ; i < contentCount; i++)
                {
-                       ContentInfo* pContentInfo = static_cast<ContentInfo*>(pContentInfoList->GetAt(i));
-                       if (pContentInfo)
+                       ContentData* pContentData = static_cast<ContentData*>(pContentDataList->GetAt(i));
+                       if (pContentData)
                        {
-                               String contentId = pContentInfo->GetContentId();
+                               String contentId = pContentData->GetContentId();
                                String oldPath = rootPath + DIR_CONTENTS + L"/" + contentId;
 
                                if (File::IsFileExist(SLP_FONT_PATH) == false)
index 768acd1..7f710d6 100755 (executable)
@@ -57,7 +57,7 @@ SignatureStep::Run(InstallationContext* pContext)
 
        if (__pContext->IsVerificationMode() == false)
        {
-               AppLogTag(OSP_INSTALLER, "Signature file not found. path = [%ls]\n", __pContext->GetSignatureXmlPath().GetPointer());
+               AppLogTag(OSP_INSTALLER, "no signature file[%ls]\n", __pContext->GetSignatureXmlPath().GetPointer());
                return INSTALLER_ERROR_NONE;
        }
 
index a1b2f71..1434954 100755 (executable)
@@ -237,34 +237,34 @@ ManifestGenerator::WriteLiveboxes(_PackageAppInfoImpl* pAppInfoImpl) const
        TryReturn(__pContext, false, "[osp-installer] __pContext is null.");
        TryReturn(__pWriter, false, "[osp-installer] __pWriter is null.");
 
-       ArrayList* pLiveboxList = __pContext->GetLiveBoxList();
+       ArrayList* pLiveboxDataList = __pContext->GetLiveboxDataList();
        _PackageInfoImpl* pPackageInfoImpl = __pContext->GetPackageInfoImpl();
        String label("label");
 
-       if (pLiveboxList == null)
+       if (pLiveboxDataList == null)
        {
                return true;
        }
 
-       for (int j = 0 ; j < pLiveboxList->GetCount(); j++)
+       for (int j = 0 ; j < pLiveboxDataList->GetCount(); j++)
        {
-               LiveboxInfo* pLiveboxInfo = dynamic_cast<LiveboxInfo*>(pLiveboxList->GetAt(j));
-               if (pLiveboxInfo == null)
+               LiveboxData* pLiveboxData = dynamic_cast<LiveboxData*>(pLiveboxDataList->GetAt(j));
+               if (pLiveboxData == null)
                {
-                       AppLogTag(OSP_INSTALLER, "pLiveboxInfo is null [%d]", j);
+                       AppLogTag(OSP_INSTALLER, "pLiveboxData is null [%d]", j);
                        continue;
                }
 
-               long long updatePeriod = pLiveboxInfo->GetUpdatePeriod();
+               long long updatePeriod = pLiveboxData->GetUpdatePeriod();
                String period = LongLong::ToString(updatePeriod/1000);
-               IMap* pLiveboxNameList = pLiveboxInfo->GetNameList();
-               ArrayList* pSizeList = pLiveboxInfo->GetSizeList();
-               String popupEnabled = pLiveboxInfo->GetPopupEnabled();
-               String primary = pLiveboxInfo->__main;
+               IMap* pLiveboxNameList = pLiveboxData->GetNameList();
+               ArrayList* pSizeList = pLiveboxData->GetSizeList();
+               String popupEnabled = pLiveboxData->GetPopupEnabled();
+               String primary = pLiveboxData->__main;
 
                __pWriter->StartElement("livebox");
 
-               __pWriter->WriteAttribute("appid", pAppInfoImpl->GetPackageName() + "." + pLiveboxInfo->GetName() );
+               __pWriter->WriteAttribute("appid", pAppInfoImpl->GetPackageName() + "." + pLiveboxData->GetName() );
                __pWriter->WriteAttribute("period", period);
                __pWriter->WriteAttribute("pinup", "false");
 
@@ -279,10 +279,10 @@ ManifestGenerator::WriteLiveboxes(_PackageAppInfoImpl* pAppInfoImpl) const
 
                WriteLanguageValue(pLiveboxNameList, label);
 
-//             if (pLiveboxInfo->GetIcon().IsEmpty() == false)
+//             if (pLiveboxData->GetIcon().IsEmpty() == false)
 //             {
 //                     String liveboxIcon;
-//                     liveboxIcon.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, pLiveboxInfo->GetIcon().GetPointer());
+//                     liveboxIcon.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, pLiveboxData->GetIcon().GetPointer());
 //
 //                     __pWriter->StartElement("icon");
 //                     __pWriter->WriteString(liveboxIcon);
@@ -321,10 +321,10 @@ ManifestGenerator::WriteLiveboxes(_PackageAppInfoImpl* pAppInfoImpl) const
                        __pWriter->EndElement();
                }
 
-               if (pLiveboxInfo->__configurationAppControlAppId.IsEmpty() == false)
+               if (pLiveboxData->__configurationAppControlAppId.IsEmpty() == false)
                {
                        __pWriter->StartElement("setup");
-                       __pWriter->WriteString(pLiveboxInfo->__configurationAppControlAppId);
+                       __pWriter->WriteString(pLiveboxData->__configurationAppControlAppId);
                        __pWriter->EndElement();
                }
 
index d70f1bd..6e23824 100755 (executable)
@@ -27,7 +27,8 @@
 #include "ManifestHandler.h"
 #include "PrivilegeHandler.h"
 #include "InstallerUtil.h"
-
+#include "ManifestAccountsParser.h"
+#include "ManifestLiveboxesParser.h"
 
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
@@ -39,8 +40,7 @@ using namespace Tizen::System;
 ManifestHandler::ManifestHandler(void)
 :__pContext(null)
 ,__pPrivilegeList(null)
-,__pLiveBoxList(null)
-,__pContentInfoList(null)
+,__pContentDataList(null)
 ,__pPackageInfoImpl(null)
 ,__pPackageAppInfoImpl(null)
 ,__pAppControlInfoImpl(null)
@@ -50,8 +50,7 @@ ManifestHandler::ManifestHandler(void)
 ,__pDataControlTypeImpl(null)
 ,__pLaunchConditionImpl(null)
 ,__pNotificationImpl(null)
-,__pLiveboxInfo(null)
-,__pContentInfo(null)
+,__pContentData(null)
 ,__pDefaultIconType(null)
 ,__isDefaultMainmenu(false)
 ,__isDefaultSetting(false)
@@ -63,11 +62,15 @@ ManifestHandler::ManifestHandler(void)
 ,__pAppData(null)
 ,__pSubModeAppControlData(null)
 ,__pOperationData(null)
+,__isParserMode(false)
 {
 }
 
 ManifestHandler::~ManifestHandler(void)
 {
+       delete[] __pDefaultIconType;
+       __pDefaultIconType = null;
+
        if (__pPackageAppInfoImpl)
        {
                delete __pPackageAppInfoImpl;
@@ -84,6 +87,12 @@ ManifestHandler::Construct(InstallationContext* pContext)
        return true;
 }
 
+InstallationContext*
+ManifestHandler::GetContext(void)
+{
+       return __pContext;
+}
+
 bool
 ManifestHandler::Parse(const char *pFilepath)
 {
@@ -97,6 +106,12 @@ ManifestHandler::OnStartElement(const char *pName)
 
        bool status = true;
 
+       if (__isParserMode == true)
+       {
+               TryReturn(__pParser, false, "[osp-installer] __pParser is null");
+               return __pParser->OnStartElement(pName);
+       }
+
        if (strcasecmp(pName, "Manifest") == 0)
        {
                AppLogTag(OSP_INSTALLER, "------------------------------------------");
@@ -148,14 +163,6 @@ ManifestHandler::OnStartElement(const char *pName)
        {
                status = OnIconsStartElement();
        }
-       else if (strcasecmp(pName, "LiveBoxes") == 0)
-       {
-               status = OnLiveBoxesStartElement();
-       }
-       else if (strcasecmp(pName, "LiveBox") == 0)
-       {
-               status = OnLiveBoxStartElement();
-       }
        else if (strcasecmp(pName, "Contents") == 0)
        {
                status = OnContentsStartElement();
@@ -168,9 +175,18 @@ ManifestHandler::OnStartElement(const char *pName)
        {
                status = OnOperationStartElement();
        }
+       else if (strcasecmp(pName, "Liveboxes") == 0)
+       {
+               status = OnLiveboxesStartElement(pName);
+       }
+       else if (strcasecmp(pName, "Accounts") == 0)
+       {
+               status = OnAccountsStartElement(pName);
+       }
 
        if (!status)
        {
+               __isParserMode = false;
                return false;
        }
 
@@ -184,6 +200,23 @@ ManifestHandler::OnEndElement(const char *pName)
 
        bool status = true;
 
+       if (__isParserMode == true)
+       {
+               TryReturn(__pParser, false, "[osp-installer] __pParser is null");
+               __pParser->OnEndElement(pName);
+
+               if (strcasecmp(pName, "Accounts") == 0)
+               {
+                       status = OnAccountsEndElement();
+               }
+               else if (strcasecmp(pName, "Liveboxes") == 0)
+               {
+                       status = OnLiveboxesEndElement();
+               }
+
+               return status;
+       }
+
        if (strcasecmp(pName, "Privileges") == 0)
        {
                status = OnPrivilegesEndElement();
@@ -236,18 +269,10 @@ ManifestHandler::OnEndElement(const char *pName)
        {
                status = OnIconsEndElement();
        }
-       else if (strcasecmp(pName, "LiveBoxes") == 0)
-       {
-               status = OnLiveBoxesEndElement();
-       }
        else if (strcasecmp(pName, "Contents") == 0)
        {
                status = OnContentsEndElement();
        }
-       else if (strcasecmp(pName, "LiveBox") == 0)
-       {
-               status = OnLiveBoxEndElement();
-       }
        else if (strcasecmp(pName, "Content") == 0)
        {
                status = OnContentEndElement();
@@ -273,9 +298,14 @@ bool
 ManifestHandler::OnCharacters(const char *pCharacters)
 {
        bool status = true;
-       char *pName = 0;
 
-       pName = GetElementName();
+       if (__isParserMode == true)
+       {
+               TryReturn(__pParser, false, "[osp-installer] __pParser is null");
+               return __pParser->OnCharacters(pCharacters);
+       }
+
+       char *pName = GetElementName();
        TryReturn(pName, false, "[osp-installer] pName is null.");
 
        if (strcasecmp(pName, "Id") == 0)
@@ -334,10 +364,6 @@ ManifestHandler::OnCharacters(const char *pCharacters)
        {
                status = OnNotificationValue(pCharacters);
        }
-       else if (strcasecmp(pName, "Size") == 0)
-       {
-               status = OnSizeValue(pCharacters);
-       }
        else if (strcasecmp(pName, "InstallationLocation") == 0)
        {
                status = OnInstallationLocationValue(pCharacters);
@@ -354,10 +380,6 @@ ManifestHandler::OnCharacters(const char *pCharacters)
        {
                status = OnUriValue(pCharacters);
        }
-       else if (strcasecmp(pName, "ConfigurationAppControlAppId") == 0)
-       {
-               status = OnConfigurationAppControlAppIdValue(pCharacters);
-       }
 
        if (!status)
        {
@@ -686,8 +708,8 @@ ManifestHandler::OnDataControlStartElement(void)
 bool
 ManifestHandler::OnContentsStartElement(void)
 {
-       __pContentInfoList = new (std::nothrow) ArrayList;
-       TryReturn(__pContentInfoList, false, "[osp-installer] __pContentInfoList is null");
+       __pContentDataList = new (std::nothrow) ArrayList;
+       TryReturn(__pContentDataList, false, "[osp-installer] __pContentDataList is null");
 
        AppLogTag(OSP_INSTALLER, "<Contents>");
 
@@ -697,13 +719,13 @@ ManifestHandler::OnContentsStartElement(void)
 bool
 ManifestHandler::OnContentStartElement(void)
 {
-       TryReturn(__pContentInfo == null, false, "[osp-installer] __pContentInfo is not null");
+       TryReturn(__pContentData == null, false, "[osp-installer] __pContentData is not null");
 
        XmlAttribute *pAttr = null;
        char *pDefault = null;
 
-       __pContentInfo = new (std::nothrow) ContentInfo;
-       TryReturn(__pContentInfo, false, "[osp-installer] __pLiveboxInfo is null");
+       __pContentData = new (std::nothrow) ContentData;
+       TryReturn(__pContentData, false, "[osp-installer] __pContentData is null");
 
        pAttr = GetAttribute();
        TryReturn(pAttr, true, "[osp-installer] pAttr is null");
@@ -711,13 +733,13 @@ ManifestHandler::OnContentStartElement(void)
        char* pId = pAttr->Find("Id");
        if (pId)
        {
-               __pContentInfo->SetContentId(pId);
+               __pContentData->SetContentId(pId);
        }
 
        char* pEntryName = pAttr->Find("EntryName");
        if (pEntryName)
        {
-               __pContentInfo->SetContentId(pEntryName);
+               __pContentData->SetContentId(pEntryName);
        }
 
        pDefault = pAttr->Find("Default");
@@ -735,61 +757,29 @@ ManifestHandler::OnContentStartElement(void)
 }
 
 bool
-ManifestHandler::OnLiveBoxesStartElement(void)
+ManifestHandler::OnLiveboxesStartElement(const char *pName)
 {
-       __pLiveBoxList = new (std::nothrow) ArrayList;
-       TryReturn(__pLiveBoxList, false, "[osp-installer] __pLiveBoxList is null");
+       __pParser = new (std::nothrow) ManifestLiveboxesParser;
+       TryReturn(__pParser, false, "[osp-installer] __pParser is null");
 
-       AppLogTag(OSP_INSTALLER, "<LiveBoxes>");
+       __isParserMode = true;
+       AppLogTag(OSP_INSTALLER, "------------------------------------------");
+       __pParser->Construct(this);
 
-       return true;
+       return __pParser->OnStartElement(pName);
 }
 
 bool
-ManifestHandler::OnLiveBoxStartElement(void)
+ManifestHandler::OnAccountsStartElement(const char *pName)
 {
-       TryReturn(__pLiveboxInfo == null, false, "[osp-installer] __pLiveboxInfo is not null");
-
-       XmlAttribute *pAttr = null;
-
-       __pLiveboxInfo = new (std::nothrow) LiveboxInfo;
-       TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null");
-
-       pAttr = GetAttribute();
-       TryReturn(pAttr, true, "[osp-installer] pAttr is null");
-
-       AppLogTag(OSP_INSTALLER, "<Livebox>");
+       __pParser = new (std::nothrow) ManifestAccountsParser;
+       TryReturn(__pParser, false, "[osp-installer] __pParser is null");
 
-       char *pProviderName = pAttr->Find("ProviderName");
-       if (pProviderName)
-       {
-               __pLiveboxInfo->SetName(pProviderName);
-               AppLogTag(OSP_INSTALLER, " - ProviderName=%s", pProviderName);
-       }
+       __isParserMode = true;
+       AppLogTag(OSP_INSTALLER, "------------------------------------------");
+       __pParser->Construct(this);
 
-       char *pUpdatePeriod = pAttr->Find("UpdatePeriod");
-       if (pUpdatePeriod)
-       {
-               long long updatePeriod = atoll(pUpdatePeriod);
-               __pLiveboxInfo->SetUpdatePeriod(updatePeriod);
-               AppLogTag(OSP_INSTALLER, " - UpdatePeriod=%lld", updatePeriod);
-       }
-
-       char *pLiveboxPopupEnabled = pAttr->Find("LiveBoxPopupEnabled");
-       if (pLiveboxPopupEnabled)
-       {
-               __pLiveboxInfo->SetPopupEnabled(pLiveboxPopupEnabled);
-               AppLogTag(OSP_INSTALLER, " - LiveBoxPopupEnabled=%s", pLiveboxPopupEnabled);
-       }
-
-       char *pMain = pAttr->Find("Main");
-       if (pMain)
-       {
-               __pLiveboxInfo->__main = pMain;
-               AppLogTag(OSP_INSTALLER, " - Main=%s", pMain);
-       }
-
-       return true;
+       return __pParser->OnStartElement(pName);
 }
 
 bool
@@ -797,7 +787,7 @@ ManifestHandler::OnPrivilegesEndElement(void)
 {
        if (__pContext->IsVerificationMode() == false)
        {
-               AppLogTag(OSP_INSTALLER, "Signature file not found. [%ls]\n", __pContext->GetSignatureXmlPath().GetPointer());
+               AppLogTag(OSP_INSTALLER, "no signature file[%ls]\n", __pContext->GetSignatureXmlPath().GetPointer());
 
                result r = E_SUCCESS;
                String privileges;
@@ -874,8 +864,6 @@ ManifestHandler::OnAppsEndElement(void)
 bool
 ManifestHandler::OnIconsEndElement(void)
 {
-       delete[] __pDefaultIconType;
-       __pDefaultIconType = null;
        AppLogTag(OSP_INSTALLER, "</Icons>");
 
        return true;
@@ -971,8 +959,8 @@ ManifestHandler::OnNotificationEndElement(void)
 bool
 ManifestHandler::OnContentsEndElement(void)
 {
-       __pContext->SetContentInfoList(__pContentInfoList);
-       __pContentInfoList = null;
+       __pContext->SetContentDataList(__pContentDataList);
+       __pContentDataList = null;
        AppLogTag(OSP_INSTALLER, "</Contents>");
 
        return true;
@@ -981,29 +969,29 @@ ManifestHandler::OnContentsEndElement(void)
 bool
 ManifestHandler::OnContentEndElement(void)
 {
-       __pContentInfoList->Add(*__pContentInfo);
-       __pContentInfo = null;
+       __pContentDataList->Add(*__pContentData);
+       __pContentData = null;
        AppLogTag(OSP_INSTALLER, "</Content>");
 
        return true;
 }
 
 bool
-ManifestHandler::OnLiveBoxesEndElement(void)
+ManifestHandler::OnAccountsEndElement(void)
 {
-       __pContext->SetLiveBoxList(__pLiveBoxList);
-       __pLiveBoxList = null;
-       AppLogTag(OSP_INSTALLER, "</LiveBoxes>");
+       delete __pParser;
+       __isParserMode = false;
+       AppLogTag(OSP_INSTALLER, "------------------------------------------");
 
        return true;
 }
 
 bool
-ManifestHandler::OnLiveBoxEndElement(void)
+ManifestHandler::OnLiveboxesEndElement(void)
 {
-       __pLiveBoxList->Add(*__pLiveboxInfo);
-       __pLiveboxInfo = null;
-       AppLogTag(OSP_INSTALLER, "</LiveBox>");
+       delete __pParser;
+       __isParserMode = false;
+       AppLogTag(OSP_INSTALLER, "------------------------------------------");
 
        return true;
 }
@@ -1024,8 +1012,8 @@ ManifestHandler::OnManifestEndElement(void)
 bool
 ManifestHandler::OnIdValue(const char *pCharacters)
 {
-       __pPackageInfoImpl->SetAppId(pCharacters);
        AppLogTag(OSP_INSTALLER, "<Id>%s</Id>", pCharacters);
+       __pPackageInfoImpl->SetAppId(pCharacters);
 
        return true;
 }
@@ -1033,8 +1021,8 @@ ManifestHandler::OnIdValue(const char *pCharacters)
 bool
 ManifestHandler::OnVersionValue(const char *pCharacters)
 {
-       __pPackageInfoImpl->SetAppVersion(pCharacters);
        AppLogTag(OSP_INSTALLER, "<Version>%s</Version>", pCharacters);
+       __pPackageInfoImpl->SetAppVersion(pCharacters);
 
        return true;
 }
@@ -1042,6 +1030,7 @@ ManifestHandler::OnVersionValue(const char *pCharacters)
 bool
 ManifestHandler::OnTypeValue(const char *pCharacters)
 {
+       AppLogTag(OSP_INSTALLER, "<Type>%s</Type>", pCharacters);
        __pPackageInfoImpl->SetAppType(pCharacters);
 
        if (strcasecmp(pCharacters, "Contents") == 0)
@@ -1049,8 +1038,6 @@ ManifestHandler::OnTypeValue(const char *pCharacters)
                __pPackageInfoImpl->SetAppApiVersion("3.0");
        }
 
-       AppLogTag(OSP_INSTALLER, "<Type>%s</Type>", pCharacters);
-
        return true;
 }
 
@@ -1072,8 +1059,8 @@ ManifestHandler::OnAuthorValue(const char *pCharacters)
 //             __pPackageInfoImpl->SetAppVendor(pCharacters);
 //     }
 
-       __pPackageInfoImpl->SetAppVendor(pCharacters);
        AppLogTag(OSP_INSTALLER, "<Author>%s</Author>", pCharacters);
+       __pPackageInfoImpl->SetAppVendor(pCharacters);
 
        return true;
 }
@@ -1137,15 +1124,10 @@ ManifestHandler::OnIconValue(const char *pCharacters)
                return false;
        }
 
-       if (FindElement("Livebox") == true)
-       {
-               TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null");
-               __pLiveboxInfo->SetIcon(icon);
-       }
-       else if (FindElement("Content") == true)
+       if (FindElement("Content") == true)
        {
-               TryReturn(__pContentInfo, false, "[osp-installer] __pContentInfo is null");
-               __pContentInfo->SetIcon(icon);
+               TryReturn(__pContentData, false, "[osp-installer] __pContentData is null");
+               __pContentData->SetIcon(icon);
        }
        else
        {
@@ -1204,21 +1186,13 @@ ManifestHandler::OnNameValue(const char *pCharacters)
        pAttrValue = pAttr->Find("Locale");
        TryReturn(pAttrValue, true, "[osp-installer] pAttrValue is null");
 
-       if (FindElement("Livebox") == true)
+       if (FindElement("Content") == true)
        {
-               TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null");
+               TryReturn(__pContentData, false, "[osp-installer] __pContentData is null");
 
                String* pValue = new (std::nothrow) String;
                StringUtil::Utf8ToString(pCharacters, *pValue);
-               __pLiveboxInfo->AddName(*(new (std::nothrow) String(pAttrValue)), *pValue);
-       }
-       else if (FindElement("Content") == true)
-       {
-               TryReturn(__pContentInfo, false, "[osp-installer] __pContentInfo is null");
-
-               String* pValue = new (std::nothrow) String;
-               StringUtil::Utf8ToString(pCharacters, *pValue);
-               __pContentInfo->AddName(*(new (std::nothrow) String(pAttrValue)), *pValue);
+               __pContentData->AddName(*(new (std::nothrow) String(pAttrValue)), *pValue);
        }
        else
        {
@@ -1336,17 +1310,6 @@ ManifestHandler::OnNotificationValue(const char *pCharacters)
 }
 
 bool
-ManifestHandler::OnSizeValue(const char *pCharacters)
-{
-       TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null");
-
-       __pLiveboxInfo->AddSize(*(new (std::nothrow) String(pCharacters)));
-       AppLogTag(OSP_INSTALLER, "<Size>%s</Size>", pCharacters);
-
-       return true;
-}
-
-bool
 ManifestHandler::OnInstallationLocationValue(const char *pCharacters)
 {
        AppLogTag(OSP_INSTALLER, "<InstallationLocation>%s</InstallationLocation>", pCharacters);
@@ -1391,17 +1354,6 @@ ManifestHandler::OnUriValue(const char* pCharacters)
 }
 
 bool
-ManifestHandler::OnConfigurationAppControlAppIdValue(const char* pCharacters)
-{
-       TryReturn(__pLiveboxInfo, true, "[osp-installer] __pLiveboxInfo is null");
-
-       __pLiveboxInfo->__configurationAppControlAppId = pCharacters;
-       AppLogTag(OSP_INSTALLER, "<ConfigurationAppControlAppId>%s</ConfigurationAppControlAppId>", pCharacters);
-
-       return true;
-}
-
-bool
 ManifestHandler::FindElement(const char *pName)
 {
        bool res = false;
@@ -1595,3 +1547,16 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp)
 
        return true;
 }
+
+AppData*
+ManifestHandler::GetAppData(void)
+{
+       return __pAppData;
+}
+
+char*
+ManifestHandler::GetDefaultIconType(void)
+{
+       return __pDefaultIconType;
+}
+
index ac2a009..e2ef45d 100755 (executable)
@@ -29,6 +29,8 @@
 #include "XmlHandler.h"
 #include "InstallationContext.h"
 
+class ManifestParser;
+
 /**
  * @class              ManifestHandler
  * @brief              This class represents the class of ManifestHandler.
@@ -45,8 +47,12 @@ public:
        virtual ~ManifestHandler(void);
 
        bool Construct(InstallationContext *pConext);
+       InstallationContext* GetContext(void);
        bool Parse(const char *pFilepath);
 
+       AppData* GetAppData(void);
+       char* GetDefaultIconType(void);
+
 private:
        ManifestHandler(const ManifestHandler& value);
        ManifestHandler& operator =(const ManifestHandler& source);
@@ -71,8 +77,9 @@ private:
 
        bool OnContentsStartElement(void);
        bool OnContentStartElement(void);
-       bool OnLiveBoxesStartElement(void);
-       bool OnLiveBoxStartElement(void);
+
+       bool OnLiveboxesStartElement(const char *pName);
+       bool OnAccountsStartElement(const char *pName);
 
        // EndElement
        bool OnPrivilegesEndElement(void);
@@ -94,8 +101,10 @@ private:
 
        bool OnContentsEndElement(void);
        bool OnContentEndElement(void);
-       bool OnLiveBoxesEndElement(void);
-       bool OnLiveBoxEndElement(void);
+
+       bool OnLiveboxesEndElement(void);
+       bool OnAccountsEndElement(void);
+
        bool OnManifestEndElement(void);
 
        // OnValue
@@ -129,8 +138,7 @@ private:
 private:
        InstallationContext* __pContext;
        Tizen::Base::Collection::ArrayList* __pPrivilegeList;
-       Tizen::Base::Collection::ArrayList* __pLiveBoxList;
-       Tizen::Base::Collection::ArrayList* __pContentInfoList;
+       Tizen::Base::Collection::ArrayList* __pContentDataList;
        Tizen::App::Package::_PackageInfoImpl* __pPackageInfoImpl;
        Tizen::App::Package::_PackageAppInfoImpl* __pPackageAppInfoImpl;
        Tizen::App::Package::_AppControlInfoImpl* __pAppControlInfoImpl;
@@ -140,8 +148,8 @@ private:
        Tizen::App::Package::_DataControlTypeImpl* __pDataControlTypeImpl;
        Tizen::App::Package::_LaunchConditionInfoImpl* __pLaunchConditionImpl;
        Tizen::App::Package::_NotificationInfoImpl* __pNotificationImpl;
-       LiveboxInfo* __pLiveboxInfo;
-       ContentInfo* __pContentInfo;
+
+       ContentData* __pContentData;
        char* __pDefaultIconType;
 
        bool __isDefaultMainmenu;
@@ -156,6 +164,9 @@ private:
        AppControlData* __pSubModeAppControlData;
        OperationData* __pOperationData;
 
+       bool __isParserMode;
+       ManifestParser* __pParser;
+
 }; // ManifestHandler
 
 #endif // _MANIFEST_HANDLER_H_
diff --git a/src/XmlHandler/Parser/ManifestAccountsParser.cpp b/src/XmlHandler/Parser/ManifestAccountsParser.cpp
new file mode 100755 (executable)
index 0000000..a50d680
--- /dev/null
@@ -0,0 +1,272 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file       ManifestAccountsParser.cpp
+ * @brief      This is the implementation file for %ManifestAccountsParser class.
+ */
+
+#include <FIoFile.h>
+#include <FSys_SystemInfoImpl.h>
+#include <FAppPkg_PackageInfoImpl.h>
+#include <FBase_StringConverter.h>
+
+#include "ManifestAccountsParser.h"
+#include "InstallerUtil.h"
+#include "InstallationContext.h"
+#include "ManifestHandler.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Base::Utility;
+using namespace Tizen::App::Package;
+using namespace Tizen::Io;
+using namespace Tizen::System;
+
+ManifestAccountsParser::ManifestAccountsParser(void)
+:__pContext(null)
+,__pAccountData(null)
+,__isAccountIconSelected(false)
+,__isAccountSmallIconSelected(false)
+{
+}
+
+ManifestAccountsParser::~ManifestAccountsParser(void)
+{
+       delete __pAccountData;
+}
+
+bool
+ManifestAccountsParser::OnStartElement(const char *pName)
+{
+       TryReturn(pName, true, "[osp-installer] pName is null");
+       bool status = true;
+
+       if (strcasecmp(pName, "Accounts") == 0)
+       {
+               status = OnAccountsStartElement();
+       }
+       else if (strcasecmp(pName, "AccountProvider") == 0)
+       {
+               status = OnAccountProviderStartElement();
+       }
+
+       return status;
+}
+
+bool
+ManifestAccountsParser::OnEndElement(const char *pName)
+{
+       TryReturn(pName, true, "[osp-installer] pName is null");
+       bool status = true;
+
+       if (strcasecmp(pName, "Accounts") == 0)
+       {
+               status = OnAccountsEndElement();
+       }
+       else if (strcasecmp(pName, "AccountProvider") == 0)
+       {
+               status = OnAccountProviderEndElement();
+       }
+
+       return true;
+}
+
+bool
+ManifestAccountsParser::OnCharacters(const char *pCharacters)
+{
+       TryReturn(pCharacters, true, "[osp-installer] pCharacters is null");
+       bool status = true;
+
+       ManifestHandler* pHandler = GetHandler();
+       TryReturn(pHandler, false, "[osp-installer] pHandler is null");
+
+       char *pName = pHandler->GetElementName();
+       TryReturn(pName, false, "[osp-installer] pName is null");
+
+       if (strcasecmp(pName, "DisplayName") == 0)
+       {
+               status = OnDisplayNameValue(pCharacters);
+       }
+       else if (strcasecmp(pName, "Icon") == 0)
+       {
+               status = OnIconValue(pCharacters);
+       }
+
+       return true;
+}
+
+bool
+ManifestAccountsParser::OnAccountsStartElement(void)
+{
+       ManifestHandler* __pHandler = GetHandler();
+       TryReturn(__pHandler, false, "[osp-installer] __pHandler is null");
+
+       __pContext = __pHandler->GetContext();
+       TryReturn(__pContext, false, "[osp-installer] __pContext is null");
+
+       AppLogTag(OSP_INSTALLER, "  <Accounts>");
+
+       return true;
+}
+
+bool
+ManifestAccountsParser::OnAccountProviderStartElement(void)
+{
+       XmlAttribute *pAttr = null;
+
+       __pAccountData = new (std::nothrow) AccountData;
+       TryReturn(__pAccountData, false, "[osp-installer] __pAccountData is null");
+
+       ManifestHandler* pHandler = GetHandler();
+       TryReturn(pHandler, false, "[osp-installer] pHandler is null");
+
+       pAttr = pHandler->GetAttribute();
+       TryReturn(pAttr, true, "[osp-installer] pAttr is null");
+
+       AppLogTag(OSP_INSTALLER, "  <AccountProvider>");
+
+       char *pProviderId = pAttr->Find("ProviderId");
+       if (pProviderId)
+       {
+               __pAccountData->__providerId = pProviderId;
+               AppLogTag(OSP_INSTALLER, "   - ProviderId=%s", pProviderId);
+       }
+
+       char *pMultipleAccountsSupport = pAttr->Find("MultipleAccountsSupport");
+       if (pMultipleAccountsSupport)
+       {
+               __pAccountData->__multipleAccountsSupport = pMultipleAccountsSupport;
+               AppLogTag(OSP_INSTALLER, "   - MultipleAccountsSupport=%s", pMultipleAccountsSupport);
+       }
+
+       return true;
+}
+
+bool
+ManifestAccountsParser::OnAccountsEndElement(void)
+{
+       AppLogTag(OSP_INSTALLER, "  </Accounts>");
+
+       return true;
+}
+
+bool
+ManifestAccountsParser::OnAccountProviderEndElement(void)
+{
+       ManifestHandler* pHandler = GetHandler();
+       TryReturn(pHandler, false, "[osp-installer] pHandler is null");
+
+       AppData* pAppData = pHandler->GetAppData();
+       TryReturn(pAppData, false, "[osp-installer] pAppData is null");
+
+       pAppData->__pAccountDataList->Add(__pAccountData);
+       __pAccountData = null;
+       AppLogTag(OSP_INSTALLER, "  </AccountProvider>");
+
+       return true;
+}
+
+bool
+ManifestAccountsParser::OnDisplayNameValue(const char *pCharacters)
+{
+       XmlAttribute* pAttr = 0;
+       char* pAttrValue = 0;
+
+       ManifestHandler* pHandler = GetHandler();
+       TryReturn(pHandler, false, "[osp-installer] pHandler is null");
+
+       pAttr = pHandler->GetAttribute();
+       TryReturn(pAttr, true, "[osp-installer] pAttr is null");
+
+       pAttrValue = pAttr->Find("Locale");
+       TryReturn(pAttrValue, true, "[osp-installer] pAttrValue is null");
+
+       String* pValue = new (std::nothrow) String;
+       StringUtil::Utf8ToString(pCharacters, *pValue);
+       __pAccountData->__pNameList->Add(new (std::nothrow) String(pAttrValue), pValue);
+
+       AppLogTag(OSP_INSTALLER, "  <DisplayName>%s</DisplayName>", pCharacters);
+
+       return true;
+}
+
+bool
+ManifestAccountsParser::OnIconValue(const char *pCharacters)
+{
+       XmlAttribute* pAttr = 0;
+       char* pSectionValue = 0;
+       char* pTypeValue = 0;
+
+       ManifestHandler* pHandler = GetHandler();
+       TryReturn(pHandler, false, "[osp-installer] pHandler is null");
+
+       pAttr = pHandler->GetAttribute();
+       TryReturn(pAttr, true, "[osp-installer] pAttr is null");
+
+       pSectionValue = pAttr->Find("Section");
+       TryReturn(pSectionValue, true, "[osp-installer] pSectionValue is null");
+
+       pTypeValue = pAttr->Find("Type");
+       TryReturn(pTypeValue, true, "[osp-installer] pTypeValue is null");
+
+       char* pDefaultIconType = pHandler->GetDefaultIconType();
+       TryReturn(pDefaultIconType, false, "[osp-installer] pDefaultIconType is null");
+
+       String icon;
+       if (strcasecmp(pTypeValue, "Xhigh") == 0)
+       {
+               icon.Format(1024, L"%s/%s", "screen-density-xhigh", pCharacters);
+       }
+       else if (strcasecmp(pTypeValue, "High") == 0)
+       {
+               icon.Format(1024, L"%s/%s", "screen-density-high", pCharacters);
+       }
+       else
+       {
+               AppLogTag(OSP_INSTALLER, "Invalid Type [%s]", pDefaultIconType);
+               return false;
+       }
+
+       if (strcasecmp(pSectionValue, "Account") == 0)
+       {
+               if (__isAccountIconSelected == false)
+               {
+                       __pAccountData->__accountIcon = icon;
+               }
+
+               if (strcasecmp(pTypeValue, pDefaultIconType) == 0)
+               {
+                       __isAccountIconSelected = true;
+               }
+       }
+       else if (strcasecmp(pSectionValue, "AccountSmall") == 0)
+       {
+               if (__isAccountSmallIconSelected == false)
+               {
+                       __pAccountData->__accountSmallIcon = icon;
+               }
+
+               if (strcasecmp(pTypeValue, pDefaultIconType) == 0)
+               {
+                       __isAccountSmallIconSelected = true;
+               }
+       }
+
+       AppLogTag(OSP_INSTALLER, "  <Icon Section=\"%s\" Type=\"%s\">%s</Icon>", pSectionValue, pTypeValue, pCharacters);
+
+       return true;
+}
diff --git a/src/XmlHandler/Parser/ManifestAccountsParser.h b/src/XmlHandler/Parser/ManifestAccountsParser.h
new file mode 100755 (executable)
index 0000000..74e90cb
--- /dev/null
@@ -0,0 +1,69 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file ManifestAccountsParser.h
+ * @brief      This is the header file for the %ManifestAccountsParser class.
+ *
+ * This header file contains the declarations of the %ManifestAccountsParser class.
+ */
+#ifndef _MANIFEST_ACCOUNTS_PARSER_H_
+#define _MANIFEST_ACCOUNTS_PARSER_H_
+
+#include <FBaseString.h>
+
+#include <FAppPkg_PackageInfoImpl.h>
+
+#include "ManifestParser.h"
+#include "InstallationContext.h"
+
+/**
+ * @class              ManifestAccountsParser
+ * @brief              This class represents the class of ManifestAccountsParser.
+ * @since              1.0
+ *
+ * This class represents the class of ManifestAccountsParser.
+ *
+ */
+class ManifestAccountsParser
+       : public ManifestParser
+{
+public:
+       ManifestAccountsParser(void);
+       virtual ~ManifestAccountsParser(void);
+
+       virtual bool OnStartElement(const char *pName);
+       virtual bool OnEndElement(const char *pName);
+       virtual bool OnCharacters(const char *pCharacters);
+
+private:
+       bool OnAccountsStartElement(void);
+       bool OnAccountProviderStartElement(void);
+       bool OnAccountsEndElement(void);
+       bool OnAccountProviderEndElement(void);
+
+       bool OnDisplayNameValue(const char *pCharacters);
+       bool OnIconValue(const char *pCharacters);
+
+private:
+       InstallationContext* __pContext;
+       AccountData* __pAccountData;
+       bool __isAccountIconSelected;
+       bool __isAccountSmallIconSelected;
+
+}; // ManifestAccountsParser
+
+#endif // _MANIFEST_ACCOUNTS_PARSER_H_
diff --git a/src/XmlHandler/Parser/ManifestLiveboxesParser.cpp b/src/XmlHandler/Parser/ManifestLiveboxesParser.cpp
new file mode 100755 (executable)
index 0000000..ce03cbc
--- /dev/null
@@ -0,0 +1,243 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file       ManifestLiveboxesParser.cpp
+ * @brief      This is the implementation file for %ManifestLiveboxesParser class.
+ */
+
+#include <FIoFile.h>
+#include <FSys_SystemInfoImpl.h>
+#include <FAppPkg_PackageInfoImpl.h>
+#include <FBase_StringConverter.h>
+
+#include "ManifestLiveboxesParser.h"
+#include "InstallerUtil.h"
+#include "XmlAttribute.h"
+#include "ManifestHandler.h"
+#include "InstallationContextData.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Base::Utility;
+using namespace Tizen::App::Package;
+using namespace Tizen::Io;
+using namespace Tizen::System;
+
+ManifestLiveboxesParser::ManifestLiveboxesParser(void)
+:__pContext(null)
+,__pLiveboxDataList(null)
+,__pLiveboxData(null)
+{
+}
+
+ManifestLiveboxesParser::~ManifestLiveboxesParser(void)
+{
+}
+
+bool
+ManifestLiveboxesParser::OnStartElement(const char *pName)
+{
+       TryReturn(pName, true, "[osp-installer] pName is null");
+
+       bool status = true;
+
+       if (strcasecmp(pName, "Liveboxes") == 0)
+       {
+               status = OnLiveboxesStartElement();
+       }
+       else if (strcasecmp(pName, "Livebox") == 0)
+       {
+               status = OnLiveboxStartElement();
+       }
+
+       return status;
+}
+
+bool
+ManifestLiveboxesParser::OnEndElement(const char *pName)
+{
+       TryReturn(pName, true, "[osp-installer] pName is null");
+
+       bool status = true;
+
+       if (strcasecmp(pName, "Liveboxes") == 0)
+       {
+               status = OnLiveboxesEndElement();
+       }
+       else if (strcasecmp(pName, "Livebox") == 0)
+       {
+               status = OnLiveboxEndElement();
+       }
+
+       return status;
+}
+
+bool
+ManifestLiveboxesParser::OnCharacters(const char *pCharacters)
+{
+       TryReturn(pCharacters, true, "[osp-installer] pCharacters is null");
+
+       bool status = true;
+
+       ManifestHandler* pHandler = GetHandler();
+       TryReturn(pHandler, false, "[osp-installer] pHandler is null");
+
+       char *pName = pHandler->GetElementName();
+       TryReturn(pName, false, "[osp-installer] pName is null");
+
+       if (strcasecmp(pName, "DisplayName") == 0)
+       {
+               status = OnDisplayNameValue(pCharacters);
+       }
+       else if (strcasecmp(pName, "Size") == 0)
+       {
+               status = OnSizeValue(pCharacters);
+       }
+       else if (strcasecmp(pName, "ConfigurationAppControlAppId") == 0)
+       {
+               status = OnConfigurationAppControlAppIdValue(pCharacters);
+       }
+
+       return status;
+}
+
+bool
+ManifestLiveboxesParser::OnLiveboxesStartElement()
+{
+       ManifestHandler* __pHandler = GetHandler();
+       TryReturn(__pHandler, false, "[osp-installer] __pHandler is null");
+
+       __pContext = __pHandler->GetContext();
+       TryReturn(__pContext, false, "[osp-installer] __pContext is null");
+
+       __pLiveboxDataList = new (std::nothrow) ArrayList;
+       TryReturn(__pLiveboxDataList, false, "[osp-installer] __pLiveboxDataList is null");
+
+       AppLogTag(OSP_INSTALLER, "  <Liveboxes>");
+
+       return true;
+}
+
+bool
+ManifestLiveboxesParser::OnLiveboxStartElement(void)
+{
+       XmlAttribute *pAttr = null;
+
+       __pLiveboxData = new (std::nothrow) LiveboxData;
+       TryReturn(__pLiveboxData, false, "[osp-installer] __pLiveboxData is null");
+
+       ManifestHandler* pHandler = GetHandler();
+       TryReturn(pHandler, false, "[osp-installer] pHandler is null");
+
+       pAttr = pHandler->GetAttribute();
+       TryReturn(pAttr, true, "[osp-installer] pAttr is null");
+
+       AppLogTag(OSP_INSTALLER, "  <Livebox>");
+
+       char *pProviderName = pAttr->Find("ProviderName");
+       if (pProviderName)
+       {
+               __pLiveboxData->SetName(pProviderName);
+               AppLogTag(OSP_INSTALLER, "   - ProviderName=%s", pProviderName);
+       }
+
+       char *pUpdatePeriod = pAttr->Find("UpdatePeriod");
+       if (pUpdatePeriod)
+       {
+               long long updatePeriod = atoll(pUpdatePeriod);
+               __pLiveboxData->SetUpdatePeriod(updatePeriod);
+               AppLogTag(OSP_INSTALLER, "   - UpdatePeriod=%lld", updatePeriod);
+       }
+
+       char *pLiveboxPopupEnabled = pAttr->Find("LiveboxPopupEnabled");
+       if (pLiveboxPopupEnabled)
+       {
+               __pLiveboxData->SetPopupEnabled(pLiveboxPopupEnabled);
+               AppLogTag(OSP_INSTALLER, "   - LiveboxPopupEnabled=%s", pLiveboxPopupEnabled);
+       }
+
+       char *pMain = pAttr->Find("Main");
+       if (pMain)
+       {
+               __pLiveboxData->__main = pMain;
+               AppLogTag(OSP_INSTALLER, "   - Main=%s", pMain);
+       }
+
+       return true;
+}
+
+bool
+ManifestLiveboxesParser::OnLiveboxesEndElement(void)
+{
+       __pContext->SetLiveboxDataList(__pLiveboxDataList);
+       __pLiveboxDataList = null;
+       AppLogTag(OSP_INSTALLER, "  </Liveboxes>");
+
+       return true;
+}
+
+bool
+ManifestLiveboxesParser::OnLiveboxEndElement(void)
+{
+       __pLiveboxDataList->Add(*__pLiveboxData);
+       __pLiveboxData = null;
+       AppLogTag(OSP_INSTALLER, "  </Livebox>");
+
+       return true;
+}
+
+bool
+ManifestLiveboxesParser::OnSizeValue(const char *pCharacters)
+{
+       __pLiveboxData->AddSize(*(new (std::nothrow) String(pCharacters)));
+
+       AppLogTag(OSP_INSTALLER, "  <Size>%s</Size>", pCharacters);
+       return true;
+}
+
+bool
+ManifestLiveboxesParser::OnDisplayNameValue(const char *pCharacters)
+{
+       XmlAttribute* pAttr = 0;
+       char* pAttrValue = 0;
+
+       ManifestHandler* pHandler = GetHandler();
+       TryReturn(pHandler, false, "[osp-installer] pHandler is null");
+
+       pAttr = pHandler->GetAttribute();
+       TryReturn(pAttr, true, "[osp-installer] pAttr is null");
+
+       pAttrValue = pAttr->Find("Locale");
+       TryReturn(pAttrValue, true, "[osp-installer] pAttrValue is null");
+
+       String* pValue = new (std::nothrow) String;
+       StringUtil::Utf8ToString(pCharacters, *pValue);
+       __pLiveboxData->AddName(*(new (std::nothrow) String(pAttrValue)), *pValue);
+
+       AppLogTag(OSP_INSTALLER, "  <DisplayName>%s</DisplayName>", pCharacters);
+
+       return true;
+}
+
+bool
+ManifestLiveboxesParser::OnConfigurationAppControlAppIdValue(const char* pCharacters)
+{
+       __pLiveboxData->__configurationAppControlAppId = pCharacters;
+       AppLogTag(OSP_INSTALLER, "  <ConfigurationAppControlAppId>%s</ConfigurationAppControlAppId>", pCharacters);
+
+       return true;
+}
diff --git a/src/XmlHandler/Parser/ManifestLiveboxesParser.h b/src/XmlHandler/Parser/ManifestLiveboxesParser.h
new file mode 100755 (executable)
index 0000000..ad61c64
--- /dev/null
@@ -0,0 +1,70 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file ManifestLiveboxesParser.h
+ * @brief      This is the header file for the %ManifestLiveboxesParser class.
+ *
+ * This header file contains the declarations of the %ManifestLiveboxesParser class.
+ */
+#ifndef _MANIFEST_LIVEBOXES_PARSER_H_
+#define _MANIFEST_LIVEBOXES_PARSER_H_
+
+#include <FBaseString.h>
+
+#include <FAppPkg_PackageInfoImpl.h>
+
+#include "ManifestParser.h"
+#include "InstallationContext.h"
+
+/**
+ * @class              ManifestLiveboxesParser
+ * @brief              This class represents the class of ManifestLiveboxesParser.
+ * @since              1.0
+ *
+ * This class represents the class of ManifestLiveboxesParser.
+ *
+ */
+class ManifestLiveboxesParser
+       : public ManifestParser
+{
+public:
+       ManifestLiveboxesParser(void);
+       virtual ~ManifestLiveboxesParser(void);
+
+       virtual bool OnStartElement(const char *pName);
+       virtual bool OnEndElement(const char *pName);
+       virtual bool OnCharacters(const char *pCharacters);
+
+private:
+       bool OnLiveboxesStartElement(void);
+       bool OnLiveboxStartElement(void);
+
+       bool OnLiveboxesEndElement(void);
+       bool OnLiveboxEndElement(void);
+
+       bool OnSizeValue(const char *pCharacters);
+       bool OnDisplayNameValue(const char *pCharacters);
+       bool OnConfigurationAppControlAppIdValue(const char* pCharacters);
+
+private:
+       InstallationContext* __pContext;
+       Tizen::Base::Collection::ArrayList* __pLiveboxDataList;
+       LiveboxData* __pLiveboxData;
+
+}; // ManifestLiveboxesParser
+
+#endif // _MANIFEST_LIVEBOXES_PARSER_H_
diff --git a/src/XmlHandler/Parser/ManifestParser.cpp b/src/XmlHandler/Parser/ManifestParser.cpp
new file mode 100755 (executable)
index 0000000..f5be175
--- /dev/null
@@ -0,0 +1,77 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file       ManifestParser.cpp
+ * @brief      This is the implementation file for %ManifestParser class.
+ */
+
+#include <FIoFile.h>
+#include <FSys_SystemInfoImpl.h>
+#include <FAppPkg_PackageInfoImpl.h>
+#include <FBase_StringConverter.h>
+
+#include "ManifestParser.h"
+#include "InstallerUtil.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Base::Utility;
+using namespace Tizen::App::Package;
+using namespace Tizen::Io;
+using namespace Tizen::System;
+
+ManifestParser::ManifestParser(void)
+:__pManifestHandler(null)
+{
+}
+
+ManifestParser::~ManifestParser(void)
+{
+}
+
+bool
+ManifestParser::Construct(ManifestHandler* pManifestHandler)
+{
+       __pManifestHandler = pManifestHandler;
+
+       return true;
+}
+
+ManifestHandler*
+ManifestParser::GetHandler(void)
+{
+       return __pManifestHandler;
+}
+
+bool
+ManifestParser::OnStartElement(const char *pName)
+{
+       return true;
+}
+
+bool
+ManifestParser::OnEndElement(const char *pName)
+{
+       return true;
+}
+
+bool
+ManifestParser::OnCharacters(const char *pCharacters)
+{
+       return true;
+}
+
diff --git a/src/XmlHandler/Parser/ManifestParser.h b/src/XmlHandler/Parser/ManifestParser.h
new file mode 100755 (executable)
index 0000000..2033d6f
--- /dev/null
@@ -0,0 +1,60 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file ManifestParser.h
+ * @brief      This is the header file for the %ManifestParser class.
+ *
+ * This header file contains the declarations of the %ManifestParser class.
+ */
+#ifndef _MANIFEST_PARSER_H_
+#define _MANIFEST_PARSER_H_
+
+#include <FBaseString.h>
+
+#include <FAppPkg_PackageInfoImpl.h>
+
+#include "InstallationContext.h"
+
+class ManifestHandler;
+
+/**
+ * @class              ManifestParser
+ * @brief              This class represents the class of ManifestParser.
+ * @since              1.0
+ *
+ * This class represents the class of ManifestParser.
+ *
+ */
+class ManifestParser
+{
+public:
+       ManifestParser(void);
+       virtual ~ManifestParser(void);
+
+       bool Construct(ManifestHandler* pManifestHandler);
+       ManifestHandler* GetHandler(void);
+
+       virtual bool OnStartElement(const char *pName);
+       virtual bool OnEndElement(const char *pName);
+       virtual bool OnCharacters(const char *pCharacters);
+
+private:
+       ManifestHandler* __pManifestHandler;
+
+}; // ManifestParser
+
+#endif // _MANIFEST_PARSER_H_
old mode 100644 (file)
new mode 100755 (executable)
index 57ddba5..1a4ed3b
@@ -63,6 +63,11 @@ public:
        void SetError(void);
        bool GetError(void);
 
+       char* GetElementName(void);
+       XmlAttribute* GetAttribute(void);
+       Tizen::Base::Collection::IEnumerator* GetElementEnumeratorN(void);
+       int GetElementCount(void);
+
 protected:
        bool ParseDocument(const char *pFilepath);
        bool ParseNormalizedDocument(const char* pFilepath);
@@ -70,16 +75,11 @@ protected:
        int Normalize(const char* pBuf, int size, char* pNormalizedBuf);
 
        bool SetElementName(const char *pElementName);
-       char* GetElementName(void);
        void DeleteElement(void);
 
        void SetAttribute(XmlAttribute *pAttr);
-       XmlAttribute* GetAttribute(void);
        void DeleteAttribute(void);
 
-       Tizen::Base::Collection::IEnumerator* GetElementEnumeratorN(void);
-       int GetElementCount(void);
-
 private:
        XmlHandler(const XmlHandler& value);
        XmlHandler& operator =(const XmlHandler& source);
index 4fe216f..db0db70 100755 (executable)
@@ -51,7 +51,7 @@ XmlWriter::~XmlWriter(void)
        err = xmlTextWriterEndDocument(__pXmlWriter);
        if (err != 0)
        {
-               AppLogTag(OSP_INSTALLER, "xmlTextWriterEndDocument() is failed");
+               AppLogTag(OSP_INSTALLER, "xmlTextWriterEndDocument() is failed(%d)", err);
        }
 
        File file;