Add Database Manager
authorDuyoung Jang <duyoung.jang@samsung.com>
Wed, 13 Feb 2013 05:40:21 +0000 (14:40 +0900)
committerDuyoung Jang <duyoung.jang@samsung.com>
Thu, 14 Feb 2013 00:45:25 +0000 (09:45 +0900)
Change-Id: Ib830a8a503af8f699fd505b4417524ffee46b0da
Signed-off-by: Duyoung Jang <duyoung.jang@samsung.com>
33 files changed:
CMakeLists.txt
inc/InstallerDefs.h
plugin/osp-installer-plugin.cpp
src/Context/InstallationContext.cpp
src/Context/InstallationContext.h
src/Context/InstallationContextData.cpp
src/Context/InstallationContextData.h
src/Installer/DirectoryInstaller.cpp
src/Installer/Installer.cpp
src/Manager/ConfigurationManager.cpp
src/Manager/ConfigurationManager.h
src/Manager/DatabaseManager.cpp [new file with mode: 0755]
src/Manager/DatabaseManager.h [new file with mode: 0755]
src/Manager/InstallerManager.cpp
src/Manager/InstallerManager.h
src/Manager/PermissionManager.cpp
src/Manager/PermissionManager.h [changed mode: 0644->0755]
src/Step/ManifestXmlStep.cpp
src/Step/SignatureStep.cpp
src/Step/UninstallStep.cpp
src/Step/UnpackStep.cpp
src/XmlHandler/ManifestGenerator.cpp
src/XmlHandler/ManifestGenerator.h
src/XmlHandler/ManifestHandler.cpp
src/XmlHandler/ManifestHandler.h
src/XmlHandler/Parser/ManifestAccountsParser.cpp
src/XmlHandler/Parser/ManifestAccountsParser.h
src/XmlHandler/Parser/ManifestAppControlsParser.cpp
src/XmlHandler/Parser/ManifestAppControlsParser.h
src/XmlHandler/Parser/ManifestLiveboxesParser.cpp
src/XmlHandler/Parser/ManifestLiveboxesParser.h
src/XmlHandler/Parser/ManifestParser.cpp
src/XmlHandler/Parser/ManifestParser.h

index 8b88653..3e52ec1 100755 (executable)
@@ -42,6 +42,7 @@ SET (${this_target}_SOURCE_FILES
        src/Installer/PreloadedInstaller.cpp
        src/Installer/RestorationInstaller.cpp
        src/Manager/ConfigurationManager.cpp
+       src/Manager/DatabaseManager.cpp
        src/Manager/InstallerManager.cpp
        src/Manager/PermissionManager.cpp
        src/Manager/SignatureManager.cpp
index f69aa44..21e59c6 100755 (executable)
@@ -23,7 +23,7 @@
 
 #include "InstallerUtil.h"
 
-#define OSP_INSTALLER_VERSION "version=[20130205.2]"
+#define OSP_INSTALLER_VERSION "version=[20130214.1]"
 
 #define DIR_BIN                                L"/bin"
 #define DIR_INFO                       L"/info"
index 6d2d1ac..43210c9 100755 (executable)
@@ -25,6 +25,7 @@
 #include <dirent.h>
 #include <package-manager-plugin.h>
 
+#include <FAppTypes.h>
 #include <FBaseString.h>
 #include <FIoDirectory.h>
 #include <FAppPkg_PackageInfoImpl.h>
index b9091f7..b9bba8d 100755 (executable)
 #include "UninstallStep.h"
 #include "UnpackStep.h"
 
-#include <FAppPkg_PackageInfoImpl.h>
-
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Io;
 using namespace Tizen::Security::Cert;
 using namespace Tizen::App;
-using namespace Tizen::App::Package;
 
 InstallationContext::InstallationContext(void)
 :__pStep(null)
@@ -47,9 +44,7 @@ InstallationContext::InstallationContext(void)
 ,__state(INSTALLER_STATE_RUNNING)
 ,__stepChanged(true)
 ,__continue(true)
-,__pPackageData(null)
 ,__pAppDataList(null)
-,__isSubMode(false)
 ,__isOspCompat(false)
 ,__isPreloaded(false)
 ,__isHybridService(false)
@@ -63,7 +58,7 @@ InstallationContext::InstallationContext(void)
 ,__pContentDataList(null)
 ,__pAuthorCertPath(null)
 ,__pDistributorCertPath(null)
-,__pPackageInfoImpl(null)
+,__certType(0)
 {
 }
 
@@ -95,12 +90,6 @@ InstallationContext::~InstallationContext(void)
                __pLiveboxDataList = null;
        }
 
-       if (__pPackageData)
-       {
-               delete __pPackageData;
-               __pPackageData = null;
-       }
-
        if (__pAppDataList)
        {
                __pAppDataList->RemoveAll();
@@ -111,12 +100,6 @@ InstallationContext::~InstallationContext(void)
 InstallerError
 InstallationContext::Construct(void)
 {
-       __pPackageInfoImpl = new (std::nothrow) _PackageInfoImpl();
-       TryReturn(__pPackageInfoImpl, INSTALLER_ERROR_OUT_OF_MEMORY, "__pPackageInfoImpl is null.");
-
-       __pPackageData = new (std::nothrow) PackageData;
-       TryReturn(__pPackageData, INSTALLER_ERROR_OUT_OF_MEMORY, "__pPackageData is null");
-
        __pAppDataList = new (std::nothrow) ArrayListT<AppData*>;
        TryReturn(__pAppDataList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pAppDataList is null");
 
@@ -262,18 +245,6 @@ InstallationContext::SetContinue(bool cont)
        __continue = cont;
 }
 
-const PackageId&
-InstallationContext::GetId(void) const
-{
-       return __packageId;
-}
-
-void
-InstallationContext::SetId(const PackageId& packageId)
-{
-       __packageId = packageId;
-}
-
 String
 InstallationContext::GetSignatureXmlPath(void)
 {
@@ -353,9 +324,3 @@ InstallationContext::SetDistributorCertPath(X509CertificatePath* pDistributorCer
 {
        __pDistributorCertPath = pDistributorCertPath;
 }
-
-_PackageInfoImpl*
-InstallationContext::GetPackageInfoImpl(void) const
-{
-       return __pPackageInfoImpl;
-}
index 555f438..13ea6b8 100755 (executable)
@@ -23,9 +23,7 @@
 #ifndef _INSTALLATION_CONTEXT_H_
 #define _INSTALLATION_CONTEXT_H_
 
-// #include <app2ext_interface.h>
 #include <FAppTypes.h>
-#include <FAppPkg_PackageInfoImpl.h>
 #include <FSecCertX509CertificatePath.h>
 
 #include "InstallerDefs.h"
@@ -74,9 +72,6 @@ public:
        Tizen::Base::String GetSignatureXmlPath(void);
        Tizen::Base::String GetAuthorSignatureXmlPath(void);
 
-       const Tizen::App::PackageId& GetId(void) const;
-       void SetId(const  Tizen::App::PackageId& packageId);
-
        const Tizen::Base::Collection::ArrayList* GetPrivilegeList(void) const;
        void SetPrivilegeList(Tizen::Base::Collection::ArrayList* privilegeList);
 
@@ -92,8 +87,6 @@ public:
        Tizen::Security::Cert::X509CertificatePath* GetDistributorCertPath(void) const;
        void SetDistributorCertPath(Tizen::Security::Cert::X509CertificatePath* pDistributorCertPath);
 
-       Tizen::App::Package::_PackageInfoImpl* GetPackageInfoImpl(void) const;
-
 private:
        InstallationContext(const InstallationContext& value);
        InstallationContext& operator =(const InstallationContext& source);
@@ -108,10 +101,8 @@ private:
        bool __continue;
 
 public:
-       PackageData* __pPackageData;
        Tizen::Base::Collection::IListT<AppData *>* __pAppDataList;
 
-       bool __isSubMode;
        bool __isOspCompat;
 
        bool __isPreloaded;
@@ -129,9 +120,7 @@ public:
        Tizen::Base::Collection::ArrayList* __pContentDataList;
        Tizen::Security::Cert::X509CertificatePath* __pAuthorCertPath;
        Tizen::Security::Cert::X509CertificatePath* __pDistributorCertPath;
-       Tizen::App::Package::_PackageInfoImpl* __pPackageInfoImpl;
 
-       Tizen::Base::String __subModeAppName;
        Tizen::Base::String __coreXmlPath;
        Tizen::Base::String __inputPath;
        Tizen::Base::String __packagePath;
@@ -140,9 +129,18 @@ public:
        Tizen::Base::String __installDir;
        Tizen::Base::String __workingDir;
        Tizen::App::PackageId __packageId;
-       Tizen::Base::String __appVersion;
-       Tizen::Base::String __appRootPath;
+       Tizen::Base::String __version;
+       Tizen::Base::String __rootPath;
        Tizen::Base::String __mainAppName;
+       Tizen::Base::String __apiVersion;
+       Tizen::Base::String __displayName;
+       Tizen::Base::String __privileges;
+       Tizen::Base::String __hmacPrivileges;
+       Tizen::Base::String __author;
+       Tizen::Base::String __url;
+       Tizen::Base::String __description;
+
+       int __certType;
 
 }; // InstallationContext
 
index 57675a6..668ac96 100755 (executable)
@@ -26,7 +26,6 @@ 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()
@@ -174,6 +173,185 @@ LiveboxData::GetSizeList(void) const
        return __pSizeList;
 }
 
+
+_AppControlResolutionInfo::_AppControlResolutionInfo(void)
+       : __pUriScheme(null)
+       , __pMimeType(null)
+{
+
+}
+
+_AppControlResolutionInfo::~_AppControlResolutionInfo(void)
+{
+               delete __pUriScheme;
+               delete __pMimeType;
+}
+
+String*
+_AppControlResolutionInfo::GetUriScheme(void) const
+{
+       return __pUriScheme;
+}
+
+result
+_AppControlResolutionInfo::SetUriScheme(String* pUriScheme)
+{
+       __pUriScheme = pUriScheme;
+       return E_SUCCESS;
+}
+
+String*
+_AppControlResolutionInfo::GetMimeType(void) const
+{
+       return __pMimeType;
+}
+
+result
+_AppControlResolutionInfo::SetMimeType(String* pMimeType)
+{
+       __pMimeType = pMimeType;
+       return E_SUCCESS;
+}
+
+_AppControlCapabilityInfo::_AppControlCapabilityInfo(void)
+       : __appControlId(0)
+       ,__pResolutionList(null)
+{
+       __pResolutionList = new (std::nothrow) ArrayList;
+       TryReturnVoidResult(__pResolutionList != null, E_OUT_OF_MEMORY, "__pResolutionList instance must not be null.");
+       __pResolutionList->Construct();
+}
+
+_AppControlCapabilityInfo::~_AppControlCapabilityInfo(void)
+{
+       __pResolutionList->RemoveAll(true);
+       delete __pResolutionList;
+}
+
+int
+_AppControlCapabilityInfo::GetAppControlId(void) const
+{
+       return __appControlId;
+}
+
+result
+_AppControlCapabilityInfo::SetAppControlId(int appControlId)
+{
+       __appControlId = appControlId;
+       return E_SUCCESS;
+}
+
+const String&
+_AppControlCapabilityInfo::GetOperationId(void) const
+{
+       return __operationId;
+}
+
+result
+_AppControlCapabilityInfo::SetOperationId(const String& operationId)
+{
+       __operationId = operationId;
+       return E_SUCCESS;
+}
+
+ArrayList*
+_AppControlCapabilityInfo::GetResolutionList(void) const
+{
+       return __pResolutionList;
+}
+
+result
+_AppControlCapabilityInfo::AddResolution(_AppControlResolutionInfo* pResolutionImpl)
+{
+       result r = E_SUCCESS;
+       r = __pResolutionList->Add(*pResolutionImpl);
+       TryReturn(!IsFailed(r), r, "__pResolutionList->Add() is failed.");
+
+       return r;
+}
+
+_AppControlInfo::_AppControlInfo(void)
+       : __pCapabilityList(null)
+{
+       __pCapabilityList = new (std::nothrow) ArrayList;
+       TryReturnVoidResult(__pCapabilityList != null, E_OUT_OF_MEMORY, "__pCapabilityList instance must not be null.");
+       __pCapabilityList->Construct();
+}
+
+_AppControlInfo::~_AppControlInfo(void)
+{
+       __pCapabilityList->RemoveAll(true);
+       delete __pCapabilityList;
+}
+
+const String&
+_AppControlInfo::GetProviderId(void) const
+{
+       return __providerId;
+}
+
+result
+_AppControlInfo::SetProviderId(const String& providerId)
+{
+       __providerId = providerId;
+       return E_SUCCESS;
+}
+
+const String&
+_AppControlInfo::GetCategory(void) const
+{
+       return __category;
+}
+
+result
+_AppControlInfo::SetCategory(const String& category)
+{
+       __category = category;
+       return E_SUCCESS;
+}
+
+ArrayList*
+_AppControlInfo::GetCapabilityList(void) const
+{
+       return __pCapabilityList;
+}
+
+result
+_AppControlInfo::AddCapability(_AppControlCapabilityInfo* pCapability)
+{
+       result r = E_SUCCESS;
+       r = __pCapabilityList->Add(*pCapability);
+       TryReturn(!IsFailed(r), r, "__pCapabilityList->Add() is failed.");
+
+       return r;
+}
+
+
+DataControlType::DataControlType(void)
+{
+
+}
+
+DataControlType::~DataControlType(void)
+{
+
+}
+
+
+DataControlInfo::DataControlInfo(void)
+       : __pControlTypeList(null)
+{
+       __pControlTypeList = new (std::nothrow) ArrayListT<DataControlType*>;
+       TryReturnVoidResult(__pControlTypeList != null, E_OUT_OF_MEMORY, "__pControlTypeList instance must not be null.");
+}
+
+DataControlInfo::~DataControlInfo(void)
+{
+       __pControlTypeList->RemoveAll();
+       delete __pControlTypeList;
+}
+
+
 ContentData::ContentData(void)
 :__pNameList(null)
 {
@@ -234,22 +412,107 @@ AppData::AppData()
 :__pCategoryList(null)
 ,__pAccountDataList(null)
 ,__pAppControlDataList(null)
+,__feature(0)
+,__isSubMode(false)
 ,__legacyAppControls(false)
 ,__isSystemService(false)
 {
-       __pCategoryList = new (std::nothrow) ArrayListT<String*>;
-       __pAccountDataList = new (std::nothrow) ArrayListT<AccountData*>;
-       __pAppControlDataList = new (std::nothrow) ArrayListT<AppControlData*>;
 }
 
 AppData::~AppData()
 {
-       __pCategoryList->RemoveAll();
-       delete __pCategoryList;
+       if (__pCategoryList)
+       {
+               __pCategoryList->RemoveAll();
+               delete __pCategoryList;
+       }
+
+       if (__pAccountDataList)
+       {
+               __pAccountDataList->RemoveAll();
+               delete __pAccountDataList;
+       }
+
+       if (__pAppControlDataList)
+       {
+               __pAppControlDataList->RemoveAll();
+               delete __pAppControlDataList;
+       }
+
+       if (__pAppControlImplList)
+       {
+               __pAppControlImplList->RemoveAll();
+               delete __pAppControlImplList;
+       }
+
+       if (__pDataControlList)
+       {
+               __pDataControlList->RemoveAll();
+               delete __pDataControlList;
+       }
+
+       if (__pSubModeAppControlDataList)
+       {
+               __pSubModeAppControlDataList->RemoveAll();
+               delete __pSubModeAppControlDataList;
+       }
+
+       if (__pNameList)
+       {
+               __pNameList->RemoveAll();
+               delete __pNameList;
+       }
+
+       if (__pFeatureList)
+       {
+               __pFeatureList->RemoveAll();
+               delete __pFeatureList;
+       }
+
+       if (__pLaunchConditionList)
+       {
+               __pLaunchConditionList->RemoveAll();
+               delete __pLaunchConditionList;
+       }
+}
+
+InstallerError
+AppData::Construct(void)
+{
+       result r = E_SUCCESS;
+
+       __pCategoryList = new (std::nothrow) ArrayListT<String*>;
+       TryReturn(__pCategoryList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pCategoryList is null.");
+
+       __pAccountDataList = new (std::nothrow) ArrayListT<AccountData*>;
+       TryReturn(__pAccountDataList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pAccountDataList is null.");
+
+       __pAppControlDataList = new (std::nothrow) ArrayListT<AppControlData*>;
+       TryReturn(__pAppControlDataList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pAppControlDataList is null.");
+
+       __pAppControlImplList = new (std::nothrow) ArrayListT<_AppControlInfo*>;
+       TryReturn(__pAppControlImplList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pAppControlImplList is null.");
+
+       __pDataControlList = new (std::nothrow) ArrayListT<DataControlInfo*>;
+       TryReturn(__pDataControlList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pDataControlList is null.");
+
+       __pSubModeAppControlDataList = new (std::nothrow) ArrayListT<AppControlData*>;
+       TryReturn(__pSubModeAppControlDataList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pSubModeAppControlDataList is null.");
+
+       __pNameList = new (std::nothrow) HashMap(SingleObjectDeleter);
+       TryReturn(__pNameList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pNameList is null.");
+       r = __pNameList->Construct();
+       TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pNameList->Construct() failed.");
+
+       __pFeatureList = new (std::nothrow) HashMap(SingleObjectDeleter);
+       TryReturn(__pFeatureList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pFeatureList is null.");
+       r = __pFeatureList->Construct();
+       TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pFeatureList->Construct() failed.");
 
-       __pAccountDataList->RemoveAll();
-       delete __pAccountDataList;
+       __pLaunchConditionList = new (std::nothrow) HashMap(SingleObjectDeleter);
+       TryReturn(__pLaunchConditionList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pLaunchConditionList is null.");
+       r = __pLaunchConditionList->Construct();
+       TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pLaunchConditionList->Construct() failed.");
 
-       __pAppControlDataList->RemoveAll();
-       delete __pAppControlDataList;
+       return INSTALLER_ERROR_NONE;
 }
index dbb73c6..869dd82 100755 (executable)
@@ -23,7 +23,6 @@
 #ifndef _INSTALLATION_CONTEXT_DATA_H_
 #define _INSTALLATION_CONTEXT_DATA_H_
 
-#include <FAppPkg_PackageInfoImpl.h>
 #include <FSecCertX509CertificatePath.h>
 
 #include "InstallerDefs.h"
@@ -99,6 +98,117 @@ public:
 };
 
 
+class _AppControlResolutionInfo
+       : public Tizen::Base::Object
+{
+public:
+       _AppControlResolutionInfo(void);
+       virtual ~_AppControlResolutionInfo(void);
+
+       Tizen::Base::String* GetUriScheme(void) const;
+       result SetUriScheme(Tizen::Base::String* pUriScheme);
+
+       Tizen::Base::String* GetMimeType(void) const;
+       result SetMimeType(Tizen::Base::String* pMimeType);
+
+private:
+       _AppControlResolutionInfo(const _AppControlResolutionInfo& value);
+       _AppControlResolutionInfo& operator =(const _AppControlResolutionInfo& source);
+
+       Tizen::Base::String* __pUriScheme;
+       Tizen::Base::String* __pMimeType;
+
+};
+
+
+class _AppControlCapabilityInfo
+       : public Tizen::Base::Object
+{
+public:
+       _AppControlCapabilityInfo(void);
+       virtual ~_AppControlCapabilityInfo(void);
+
+       int GetAppControlId(void) const;
+       result SetAppControlId(int uniqueId);
+
+       const Tizen::Base::String& GetOperationId(void) const;
+       result SetOperationId(const Tizen::Base::String& operationId);
+
+       Tizen::Base::Collection::ArrayList* GetResolutionList(void) const;
+       result AddResolution(_AppControlResolutionInfo* pResolution);
+
+private:
+       _AppControlCapabilityInfo(const _AppControlCapabilityInfo& value);
+       _AppControlCapabilityInfo& operator =(const _AppControlCapabilityInfo& source);
+
+       int __appControlId;
+       Tizen::Base::String __operationId;
+       Tizen::Base::Collection::ArrayList* __pResolutionList;
+
+};
+
+
+class _AppControlInfo
+       : public Tizen::Base::Object
+{
+public:
+       _AppControlInfo(void);
+       virtual ~_AppControlInfo(void);
+
+       const Tizen::Base::String& GetProviderId(void) const;
+       result SetProviderId(const Tizen::Base::String& providerId);
+
+       const Tizen::Base::String& GetCategory(void) const;
+       result SetCategory(const Tizen::Base::String& category);
+
+       Tizen::Base::Collection::ArrayList* GetCapabilityList(void) const;
+       result AddCapability(_AppControlCapabilityInfo* pCapability);
+
+private:
+       _AppControlInfo(const _AppControlInfo& value);
+       _AppControlInfo& operator =(const _AppControlInfo& source);
+
+       Tizen::Base::String __providerId;
+       Tizen::Base::String __category;
+       Tizen::Base::Collection::ArrayList* __pCapabilityList;
+
+};
+
+
+class DataControlType
+       : public Tizen::Base::Object
+{
+public:
+               DataControlType(void);
+       virtual ~DataControlType(void);
+
+       Tizen::Base::String __type;
+       Tizen::Base::String __access;
+
+private:
+       DataControlType(const DataControlType& value);
+       DataControlType& operator =(const DataControlType& source);
+
+};
+
+
+class DataControlInfo
+       : public Tizen::Base::Object
+{
+public:
+               DataControlInfo(void);
+       virtual ~DataControlInfo(void);
+
+       Tizen::Base::String __providerId;
+       Tizen::Base::Collection::IListT<DataControlType*>* __pControlTypeList;
+
+private:
+       DataControlInfo(const DataControlInfo& value);
+       DataControlInfo& operator =(const DataControlInfo& source);
+
+};
+
+
 class ContentData
        : public Tizen::Base::Object
 {
@@ -133,27 +243,37 @@ class AppData
 public:
        AppData();
        virtual ~AppData();
+       InstallerError Construct(void);
 
-       Tizen::Base::String name;
+       Tizen::Base::String __main;
+       Tizen::Base::String __name;
        Tizen::Base::String __appId;
+       Tizen::Base::String __displayName;
+       Tizen::Base::String __mainmenuIcon;
+       Tizen::Base::String __settingIcon;
+       Tizen::Base::String __notificationIcon;
+       Tizen::Base::String __type;
+       Tizen::Base::String __subModeAppName;
+
        Tizen::Base::Collection::IListT<Tizen::Base::String*>* __pCategoryList;
        Tizen::Base::Collection::IListT<AccountData*>* __pAccountDataList;
        Tizen::Base::Collection::IListT<AppControlData*>* __pAppControlDataList;
+       Tizen::Base::Collection::IListT<_AppControlInfo*>* __pAppControlImplList;
+       Tizen::Base::Collection::IListT<DataControlInfo*>* __pDataControlList;
+       Tizen::Base::Collection::IListT<AppControlData*>* __pSubModeAppControlDataList;
+
+       Tizen::Base::Collection::HashMap* __pNameList;
+       Tizen::Base::Collection::HashMap* __pFeatureList;
+       Tizen::Base::Collection::HashMap* __pLaunchConditionList;
+
+       int __feature;
 
+       bool __isSubMode;
        bool __legacyAppControls;
        bool __isSystemService;
+       bool __mainmenuVisible;
 
 private:
 };
 
-
-class PackageData
-       : public Tizen::Base::Object
-{
-public:
-       PackageData(){};
-       virtual ~PackageData(){};
-};
-
-
 #endif // _INSTALLATION_CONTEXT_DATA_H_
index b0df3ff..39d72ec 100755 (executable)
 #include <FIoFile.h>
 #include <FIoDirectory.h>
 #include <FIo_FileImpl.h>
-#include <FAppPkg_PackageInfoImpl.h>
 
 #include "DirectoryInstaller.h"
 #include "InstallerUtil.h"
 
-using namespace Tizen::App::Package;
 using namespace Tizen::Base;
 using namespace Tizen::Io;
 
@@ -78,10 +76,7 @@ DirectoryInstaller::OnInit(void)
        String newInstallPath;
        InstallerUtil::CreateSymlinkForAppDirectory(installPath, newInstallPath);
        pContext->__installDir = newInstallPath;
-
-       _PackageInfoImpl *pPackageInfoImpl = null;
-       pPackageInfoImpl = pContext->GetPackageInfoImpl();
-       pPackageInfoImpl->SetAppRootPath(newInstallPath);
+       pContext->__rootPath = newInstallPath;
 
        // remove in /info/*.info files
        RemoveInfoFiles();
@@ -135,17 +130,12 @@ DirectoryInstaller::RemoveInfoFiles(void)
        int res = false;
        String appid;
        String path;
-
-       _PackageInfoImpl* pPackageInfoImpl = null;
        InstallationContext* pContext = null;
 
        pContext = GetContext();
        TryCatch(pContext, res = false, "pContext is null");
 
-       pPackageInfoImpl = pContext->GetPackageInfoImpl();
-       TryCatch(pPackageInfoImpl, res = false, "pPackageInfoImpl is null");
-
-       path = pPackageInfoImpl->GetAppRootPath() + DIR_INFO;
+       path = pContext->__rootPath + DIR_INFO;
 
        pDir = new (std::nothrow) Directory; // Allocate %Directory instance
        TryCatch(pDir, res = false, "pDir is null");
index 7f71da6..7482bc2 100755 (executable)
 
 #include <FIoFile.h>
 #include <FIoDirectory.h>
-#include <FAppPkg_PackageInfoImpl.h>
-#include <FAppPkg_PackageManagerImpl.h>
 
 #include "Installer.h"
 #include "PermissionManager.h"
 #include "ConfigurationManager.h"
+#include "DatabaseManager.h"
 #include "InstallerUtil.h"
 
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
-using namespace Tizen::App::Package;
 using namespace Tizen::Io;
 
 Installer::Installer(void)
@@ -108,18 +106,16 @@ Installer::OnRegister(void)
 
        InstallerOperation operation = pContext->GetInstallerOperation();
 
-       _PackageManagerImpl *pManagerImpl = null;
-       pManagerImpl = pManagerImpl->GetInstance();
-       TryReturn(pManagerImpl, INSTALLER_ERROR_INTERNAL_STATE, "pManagerImpl is null");
+       DatabaseManager databaseManager;
 
        if (operation == INSTALLER_OPERATION_INSTALL)
        {
-               pManagerImpl->UnregisterPackageInfo(pContext->GetId());
-               pManagerImpl->RegisterPackageInfo(*pContext->GetPackageInfoImpl());
+               databaseManager.UnregisterPackageInfo(pContext);
+               databaseManager.RegisterPackageInfo(pContext);
        }
        else
        {
-               pManagerImpl->UnregisterPackageInfo(pContext->GetId());
+               databaseManager.UnregisterPackageInfo(pContext);
        }
        AppLog("Installer::OnRegister() - END");
        AppLog("------------------------------------------");
index c417998..ff62c9a 100755 (executable)
@@ -33,8 +33,6 @@
 #include <FIoDirectory.h>
 #include <FSecCertX509CertificatePath.h>
 #include <FApp_Aul.h>
-#include <FAppPkg_PackageInfoImpl.h>
-#include <FAppPkg_PackageManagerImpl.h>
 #include <FBase_StringConverter.h>
 
 #include "ConfigurationManager.h"
@@ -46,7 +44,6 @@ using namespace Tizen::Base::Collection;
 using namespace Tizen::Base::Utility;
 using namespace Tizen::Security::Cert;
 using namespace Tizen::App;
-using namespace Tizen::App::Package;
 using namespace Tizen::Io;
 
 ConfigurationManager::ConfigurationManager(void)
@@ -62,15 +59,11 @@ ConfigurationManager::CreateFile(InstallationContext* pContext)
 {
        int err = 0;
 
-       _PackageInfoImpl *pPackageInfoImpl = null;
-       pPackageInfoImpl = pContext->GetPackageInfoImpl();
-       TryReturn(pPackageInfoImpl, false, "pPackageInfoImpl is null.");
-
        String rootPath;
-       rootPath = pPackageInfoImpl->GetAppRootPath();
+       rootPath = pContext->__rootPath;
 
        String apiVersion;
-       apiVersion = pPackageInfoImpl->GetAppApiVersion();
+       apiVersion = pContext->__apiVersion;
        String versionInfoFile;
        versionInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), VERSION_INFO_FILE);
        CreateInfoFile(versionInfoFile, &apiVersion);
@@ -97,114 +90,110 @@ ConfigurationManager::CreateFile(InstallationContext* pContext)
        IListT<AppData*>* pAppDataList = pContext->__pAppDataList;
        TryReturn(pAppDataList, false, "pAppDataList is null");
 
-       // legacy
-       _PackageAppInfoImpl* pAppInfoImpl = null;
-       ArrayList* pAppList = null;
-       pAppList = pPackageInfoImpl->GetAppInfoList();
-       for (int i = 0 ; i < pAppList->GetCount(); i++)
+       for (int i = 0 ; i < pAppDataList->GetCount(); i++)
        {
                AppData* pAppData = null;
                pAppDataList->GetAt(i, pAppData);
                TryReturn(pAppData, false, "pAppData is null");
 
-               pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pAppList->GetAt(i));
-               if (pAppInfoImpl)
+               String appName = pAppData->__name;
+               String appType = pAppData->__type;
+               AppId appId = pAppData->__appId;
+
+               String binaryPath;
+               binaryPath.Format(1024, L"%ls%ls/%ls", rootPath.GetPointer(), DIR_BIN, appName.GetPointer());
+
+               if (File::IsFileExist(binaryPath) == true)
+               {
+                       InstallerUtil::Remove(binaryPath);
+               }
+
+               if (appType == L"UiApp")
                {
-                       String appName = pAppInfoImpl->GetName();
-                       String appType = pAppInfoImpl->GetType();
-                       String appId = pAppData->__appId;
+                       //err = symlink(UIAPP_LOADER_PATH, pBinaryPath);
 
-                       String binaryPath;
-                       binaryPath.Format(1024, L"%ls%ls/%ls", rootPath.GetPointer(), DIR_BIN, appName.GetPointer());
+                       AppLog("copy ui app loader");
+                       InstallerUtil::Copy(UIAPP_LOADER_PATH, binaryPath);
 
-                       if (File::IsFileExist(binaryPath) == true)
-                       {
-                               InstallerUtil::Remove(binaryPath);
-                       }
+                       HashMap* pFeatureList = pAppData->__pFeatureList;
+                       TryReturn(pFeatureList, false, "pFeatureList is null");
 
-                       if (appType == L"UiApp")
+                       String coordinateSystem;
+                       String baseScreenSize;
+                       String logicalCoordinate;
+
+                       std::unique_ptr< IMapEnumerator > pEnum(pFeatureList->GetMapEnumeratorN());
+                       TryReturn(pEnum, false, "GetMapEnumeratorN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+                       while (pEnum->MoveNext() == E_SUCCESS)
                        {
-                               //err = symlink(UIAPP_LOADER_PATH, pBinaryPath);
+                               String* pKey = static_cast< String* > (pEnum->GetKey());
+                               TryReturn(pEnum, false, "GetKey() failed. [%s]", GetErrorMessage(GetLastResult()));
 
-                               AppLog("copy ui app loader");
-                               InstallerUtil::Copy(UIAPP_LOADER_PATH, binaryPath);
+                               String* pValue = static_cast< String* > (pEnum->GetValue());
+                               TryReturn(pEnum, false, "GetValue() failed. [%s]", GetErrorMessage(GetLastResult()));
 
-                               ArrayList* pFeatureList = pAppInfoImpl->GetAppFeatureList();
-                               TryReturn(pFeatureList, false, "pFeatureList is null");
+                               if ((*pKey) == L"CoordinateSystem")
+                               {
+                                       coordinateSystem = (*pValue);
+                               }
 
-                               String coordinateSystem;
-                               String baseScreenSize;
-                               String logicalCoordinate;
+                               if ((*pKey) == L"BaseScreenSize")
+                               {
+                                       baseScreenSize = (*pValue);
+                               }
 
-                               for (int j = 0; j < pFeatureList->GetCount(); j++)
+                               if ((*pKey) == L"LogicalCoordinate")
                                {
-                                       _AppFeatureInfoImpl* pAppFeature = dynamic_cast<_AppFeatureInfoImpl*>(pFeatureList->GetAt(j));
-
-                                       if (pAppFeature != null)
-                                       {
-                                               if (pAppFeature->GetName() == L"CoordinateSystem")
-                                               {
-                                                       coordinateSystem = pAppFeature->GetValue();
-                                               }
-
-                                               if (pAppFeature->GetName() == L"BaseScreenSize")
-                                               {
-                                                       baseScreenSize = pAppFeature->GetValue();
-                                               }
-
-                                               if (pAppFeature->GetName() == L"LogicalCoordinate")
-                                               {
-                                                       logicalCoordinate = pAppFeature->GetValue();
-                                               }
-                                       }
+                                       logicalCoordinate = (*pValue);
                                }
+                       }
 
-                               String uiScalability;
-                               uiScalability.Format(1024, UISCALABILITY_INFO, coordinateSystem.GetPointer(), baseScreenSize.GetPointer(), logicalCoordinate.GetPointer());
+                       String uiScalability;
+                       uiScalability.Format(1024, UISCALABILITY_INFO, coordinateSystem.GetPointer(), baseScreenSize.GetPointer(), logicalCoordinate.GetPointer());
 
-                               String uiScalabilityInfoFile;
-                               uiScalabilityInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), UISCALABILITY_INFO_FILE);
+                       String uiScalabilityInfoFile;
+                       uiScalabilityInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), UISCALABILITY_INFO_FILE);
 
-                               CreateInfoFile(uiScalabilityInfoFile, &uiScalability);
+                       CreateInfoFile(uiScalabilityInfoFile, &uiScalability);
 
-                               int categoryType = pAppInfoImpl->GetAppFeature();
-                               if (categoryType != CATEGORY_TYPE_NONE)
-                               {
-                                       String category = InstallerUtil::GetCategory(categoryType);
-                                       category.ToLowerCase();
+                       int categoryType = pAppData->__feature;
+                       if (categoryType != CATEGORY_TYPE_NONE)
+                       {
+                               String category = InstallerUtil::GetCategory(categoryType);
+                               category.ToLowerCase();
 
-                                       int type = _Aul::GetAppType(category);
+                               int type = _Aul::GetAppType(category);
 
-                                       if (category == L"ime")
-                                       {
-                                               CreateImeSymlink(binaryPath, appId);
-                                       }
+                               if (category == L"ime")
+                               {
+                                       CreateImeSymlink(binaryPath, appId);
+                               }
 
-                                       String typeInfo;
-                                       typeInfo.Format(1024, L"%d", type);
+                               String typeInfo;
+                               typeInfo.Format(1024, L"%d", type);
 
-                                       String typeInfoFile;
-                                       typeInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), TYPE_INFO_FILE);
+                               String typeInfoFile;
+                               typeInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), TYPE_INFO_FILE);
 
-                                       CreateInfoFile(typeInfoFile, &typeInfo);
-                               }
+                               CreateInfoFile(typeInfoFile, &typeInfo);
                        }
-                       else if (appType == L"ServiceApp")
+               }
+               else if (appType == L"ServiceApp")
+               {
+                       if (pContext->__isPreloaded == true || pAppData->__isSystemService == true)
                        {
-                               if (pContext->__isPreloaded == true || pAppData->__isSystemService == true)
-                               {
-                                       AppLog("copy system service loader");
-                                       InstallerUtil::Copy(SYSTEMSERIVCE_LOADER_PATH, binaryPath);
-                               }
-                               else
-                               {
-                                       AppLog("copy service app loader");
-                                       InstallerUtil::Copy(SERVICEAPP_LOADER_PATH, binaryPath);
-                               }
+                               AppLog("copy system service loader");
+                               InstallerUtil::Copy(SYSTEMSERIVCE_LOADER_PATH, binaryPath);
+                       }
+                       else
+                       {
+                               AppLog("copy service app loader");
+                               InstallerUtil::Copy(SERVICEAPP_LOADER_PATH, binaryPath);
                        }
-
-                       InstallerUtil::ChangeMode(binaryPath, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
                }
+
+               InstallerUtil::ChangeMode(binaryPath, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
        }
 
        ArrayList* pContentDataList = pContext->GetContentDataList();
@@ -226,7 +215,7 @@ ConfigurationManager::CreateFile(InstallationContext* pContext)
                                }
 
                                String newPath = SLP_FONT_PATH;
-                               newPath += L"/" + pContext->GetId();
+                               newPath += L"/" + pContext->__packageId;
                                Directory::Create(newPath, false);
                                InstallerUtil::ChangeMode(newPath, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
 
@@ -239,11 +228,11 @@ ConfigurationManager::CreateFile(InstallationContext* pContext)
 
        if (pContext->__isPreloaded == true)
        {
-               pContext->__coreXmlPath.Format(1024, DIR_RO_PACKAGE_SYSTEM_MANIFEST, pContext->GetId().GetPointer());
+               pContext->__coreXmlPath.Format(1024, DIR_RO_PACKAGE_SYSTEM_MANIFEST, pContext->__packageId.GetPointer());
        }
        else
        {
-               pContext->__coreXmlPath.Format(1024, DIR_RW_PACKAGE_SYSTEM_MANIFEST, pContext->GetId().GetPointer());
+               pContext->__coreXmlPath.Format(1024, DIR_RW_PACKAGE_SYSTEM_MANIFEST, pContext->__packageId.GetPointer());
        }
 
        std::unique_ptr<char[]> pXmlPath(_StringConverter::CopyToCharArrayN(pContext->__coreXmlPath));
@@ -302,11 +291,11 @@ ConfigurationManager::RemoveFile(InstallationContext* pContext)
 {
        if (pContext->__isPreloaded == true)
        {
-               pContext->__coreXmlPath.Format(1024, DIR_RO_PACKAGE_SYSTEM_MANIFEST, pContext->GetId().GetPointer());
+               pContext->__coreXmlPath.Format(1024, DIR_RO_PACKAGE_SYSTEM_MANIFEST, pContext->__packageId.GetPointer());
        }
        else
        {
-               pContext->__coreXmlPath.Format(1024, DIR_RW_PACKAGE_SYSTEM_MANIFEST, pContext->GetId().GetPointer());
+               pContext->__coreXmlPath.Format(1024, DIR_RW_PACKAGE_SYSTEM_MANIFEST, pContext->__packageId.GetPointer());
        }
 
        std::unique_ptr<char[]> pXmlPath(_StringConverter::CopyToCharArrayN(pContext->__coreXmlPath));
@@ -360,7 +349,7 @@ ConfigurationManager::RegisterCertInfo(InstallationContext* pContext) const
        int res = 0;
        bool result = true;
        pkgmgr_instcertinfo_h handle = null;
-       String appId = pContext->GetId();
+       String appId = pContext->__packageId;
        X509CertificatePath* pAuthorCertPath = pContext->GetAuthorCertPath();
        X509CertificatePath* pDistributorCertPath = pContext->GetDistributorCertPath();
 
@@ -470,7 +459,7 @@ ConfigurationManager::UnregisterCertInfo(InstallationContext* pContext) const
        AppLog("UnregisterCertInfo - START");
        int res = 0;
        bool result = true;
-       String appId = pContext->GetId();
+       String appId = pContext->__packageId;
 
        char* pAppId = _StringConverter::CopyToCharArrayN(appId);
        TryCatch(pAppId, result = false, "pAppId is null");
@@ -492,7 +481,7 @@ ConfigurationManager::PostInstall(InstallationContext* pContext, bool error) con
        app2ext_handle* pHandle = (app2ext_handle*)pContext->__pApp2ExtHandle;
        if (pHandle)
        {
-               String appId = pContext->GetId();
+               String appId = pContext->__packageId;
                std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
                TryReturn(pAppId, false, "pAppId is null");
 
@@ -519,7 +508,7 @@ ConfigurationManager::PostUninstall(InstallationContext* pContext) const
        app2ext_handle* pHandle = (app2ext_handle*)pContext->__pApp2ExtHandle;
        if (pHandle)
        {
-               String appId = pContext->GetId();
+               String appId = pContext->__packageId;
                std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
                TryReturn(pAppId, false, "pAppId is null");
 
index 80c0558..a36379b 100755 (executable)
 #ifndef _CONFIGURATION_MANAGER_H_
 #define _CONFIGURATION_MANAGER_H_
 
-#include <FAppPkg_PackageAppInfoImpl.h>
-
 #include "InstallationContext.h"
 
-
 /**
  * @class              ConfigurationManager
  * @brief              This class represents the class of ConfigurationManager.
diff --git a/src/Manager/DatabaseManager.cpp b/src/Manager/DatabaseManager.cpp
new file mode 100755 (executable)
index 0000000..eb2bc1a
--- /dev/null
@@ -0,0 +1,667 @@
+//
+// 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       DatabaseManager.cpp
+ * @brief      This is the implementation file for %DatabaseManager class.
+ */
+
+#include <unique_ptr.h>
+
+#include <FIoDatabase.h>
+#include <FIoDbStatement.h>
+#include <FIoDbEnumerator.h>
+#include <FIoFile.h>
+
+#include <FAppPkg_PackageManagerImpl.h>
+
+#include "DatabaseManager.h"
+
+using namespace Tizen::App;
+using namespace Tizen::App::Package;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Io;
+
+DatabaseManager::DatabaseManager(void)
+{
+       CreatePackageTables();
+}
+
+DatabaseManager::~DatabaseManager(void)
+{
+}
+
+bool
+DatabaseManager::RegisterPackageInfo(InstallationContext* pContext) const
+{
+       bool res = true;
+       Database db;
+       String query;
+
+       result r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r+");
+       TryReturn(r == E_SUCCESS, false, "db.Construct failed. [%s]", GetErrorMessage(r));
+
+       query.Format(1024, L"INSERT INTO PkgInfo "
+                         "(PKG_ID, PKG_SECRET, PKG_VERSION, PKG_TYPE, PKG_MIMETYPE, PKG_APIVERSION, PKG_NAME, PKG_VENDOR, PKG_DESCRIPTION, PKG_URL, PKG_CID, PKG_READONLY_SIZE, PKG_DATA_SIZE, PKG_PARENT_ID,"
+                         " PKG_ATTRIBUTE, PKG_ROOTPATH, PKG_STORAGE_TYPE, PKG_INSTALLATION_DATE, PKG_STATE, PKG_INITIATOR) "
+                         "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
+
+       std::unique_ptr< DbStatement > pStmt(_PackageManagerImpl::CreateStatementN(db, query));
+       TryReturn(pStmt, false, "CreateStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+       PackageId packageId = pContext->__packageId;
+       String version = pContext->__version;
+       String apiVersion = pContext->__apiVersion;
+       String name = pContext->__displayName;
+       String rootPath = pContext->__rootPath;
+
+       if (!packageId.IsEmpty())
+       {
+               r = pStmt.get()->BindString(0, packageId);
+               TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+       }
+
+       if (!version.IsEmpty())
+       {
+               r = pStmt->BindString(2, version);
+               TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+       }
+
+       if (!apiVersion.IsEmpty())
+       {
+               r = pStmt->BindString(5, apiVersion);
+               TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+       }
+
+       if (!name.IsEmpty())
+       {
+               r = pStmt->BindString(6, name);
+               TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+       }
+
+       if (!rootPath.IsEmpty())
+       {
+               r = pStmt->BindString(15, rootPath);
+               TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+       }
+
+       std::unique_ptr< DbEnumerator > pEnum(_PackageManagerImpl::ExecuteStatementN(db, pStmt.get()));
+       TryReturn(!IsFailed(GetLastResult()), false, "ExecuteStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+       res = RegisterPrivilegeInfo(pContext, db);
+       TryReturn(res == true, false, "RegisterPrivilegeInfo() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+       res = RegisterAppInfoList(pContext, db);
+       TryReturn(res == true, false, "RegisterAppInfoList() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+       return true;
+}
+
+bool
+DatabaseManager::RegisterPrivilegeInfo(InstallationContext* pContext, Database& db) const
+{
+       result r = E_SUCCESS;
+       String query;
+       PackageId packageId = pContext->__packageId;
+
+       query.Format(1024, L"INSERT INTO PkgPrivileges (ID, PRIVILEGES, HMAC_PPRIVILEGES, CERTIFICATE_TYPE) "
+                       "VALUES ((SELECT PkgInfo.UNIQUE_ID FROM PkgInfo WHERE PkgInfo.PKG_ID = '%ls'), ?, ?, ?)", packageId.GetPointer());
+
+       std::unique_ptr< DbStatement > pStmt(_PackageManagerImpl::CreateStatementN(db, query));
+       TryReturn(pStmt, false, "CreateStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+       String privileges = pContext->__privileges;
+       String hmacPrivileges = pContext->__hmacPrivileges;
+       int certType = pContext->__certType;
+
+       if (!privileges.IsEmpty())
+       {
+               r = pStmt->BindString(0, privileges);
+               TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+       }
+
+       if (!hmacPrivileges.IsEmpty())
+       {
+               r = pStmt->BindString(1, hmacPrivileges);
+               TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+       }
+
+       if (certType != 0)
+       {
+               r = pStmt->BindInt(2, certType);
+               TryReturn(r == E_SUCCESS, false, "BindInt() failed. [%s]", GetErrorMessage(r));
+       }
+
+       std::unique_ptr< DbEnumerator > pEnum(_PackageManagerImpl::ExecuteStatementN(db, pStmt.get()));
+       TryReturn(!IsFailed(GetLastResult()), false, "ExecuteStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+       return true;
+}
+
+bool
+DatabaseManager::RegisterAppInfoList(InstallationContext* pContext, Database& db) const
+{
+       result r = E_SUCCESS;
+       bool res = true;
+       String query;
+
+       IListT<AppData*>* pAppDataList = pContext->__pAppDataList;
+       TryReturn(pAppDataList, false, "pAppDataList is null");
+
+       int count = pAppDataList->GetCount();
+
+       for (int i = 0; i < count; i++)
+       {
+               AppData* pAppData = null;
+               pAppDataList->GetAt(i, pAppData);
+
+               if (pAppData)
+               {
+                       String name = pAppData->__name;
+                       String main = pAppData->__main;
+                       String mainmenuIcon = pAppData->__mainmenuIcon;
+                       String settingIcon = pAppData->__settingIcon;
+                       String notificationIcon = pAppData->__notificationIcon;
+                       int feature = pAppData->__feature;
+                       String appId = pAppData->__appId;
+                       String type = pAppData->__type;
+
+                       query.Format(1024, L"INSERT INTO AppInfo "
+                                         "(ID, APP_NAME, APP_DEFAULT, APP_MAINMENU_ICON, APP_SETTING_ICON, APP_TICKER_ICON, APP_QUICKPANEL_ICON, APP_LAUNCHIMAGE_ICON, APP_FEATURE, PACKAGE_NAME, APP_TYPE) "
+                                         "VALUES ((SELECT PkgInfo.UNIQUE_ID FROM PkgInfo WHERE PkgInfo.PKG_ID = '%ls'),?,?,?,?,?,?,?,?,?,?)", pContext->__packageId.GetPointer());
+
+                       std::unique_ptr< DbStatement > pStmt(_PackageManagerImpl::CreateStatementN(db, query));
+                       TryReturn(pStmt, false, "CreateStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+                       if (!name.IsEmpty())
+                       {
+                               r = pStmt->BindString(0, name);
+                               TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+                       }
+
+                       if (!main.IsEmpty())
+                       {
+                               r = pStmt->BindString(1, main);
+                               TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+                       }
+
+                       if (!mainmenuIcon.IsEmpty())
+                       {
+                               r = pStmt->BindString(2, mainmenuIcon);
+                               TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+                       }
+
+                       if (!settingIcon.IsEmpty())
+                       {
+                               r = pStmt->BindString(3, settingIcon);
+                               TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+                       }
+
+                       if (!notificationIcon.IsEmpty())
+                       {
+                               r = pStmt->BindString(5, notificationIcon);
+                               TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+                       }
+
+                       if (feature != 0)
+                       {
+                               r = pStmt->BindInt(7, feature);
+                               TryReturn(r == E_SUCCESS, false, "BindInt() failed. [%s]", GetErrorMessage(r));
+                       }
+
+                       if (!appId.IsEmpty())
+                       {
+                               r = pStmt->BindString(8, appId);
+                               TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+                       }
+
+                       if (!type.IsEmpty())
+                       {
+                               r = pStmt->BindString(9, type);
+                               TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+                       }
+
+                       std::unique_ptr< DbEnumerator > pEnum(_PackageManagerImpl::ExecuteStatementN(db, pStmt.get()));
+                       TryReturn(!IsFailed(GetLastResult()), false, "ExecuteStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+                       if (pAppData->__pLaunchConditionList)
+                       {
+                               res = RegisterLaunchConditionList(pAppData, db);
+                               TryReturn(res == true, false, "RegisterLaunchConditionList() failed. [%s]", GetErrorMessage(r));
+                       }
+
+                       if (pAppData->__pFeatureList)
+                       {
+                               res = RegisterAppFeatureList(pAppData, db);
+                               TryReturn(res == true, false, "RegisterAppFeatureList() failed. [%s]", GetErrorMessage(r));
+                       }
+
+                       if (pAppData->__pDataControlList)
+                       {
+                               res = RegisterDataControlList(pAppData, db);
+                               TryReturn(res == true, false, "RegisterDataControlList() failed. [%s]", GetErrorMessage(r));
+                       }
+               }
+       }
+
+       return true;
+}
+
+bool
+DatabaseManager::RegisterLaunchConditionList(AppData* pAppData, Database& db) const
+{
+       TryReturn(pAppData, E_SYSTEM, "pAppData is null.");
+       TryReturn(pAppData->__pLaunchConditionList, E_SYSTEM, "__pLaunchConditionList is null.");
+
+       result r = E_SUCCESS;
+       HashMap* pList = pAppData->__pLaunchConditionList;
+
+       std::unique_ptr< IMapEnumerator > pEnum(pList->GetMapEnumeratorN());
+       TryReturn(pEnum, false, "GetMapEnumeratorN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+       while (pEnum->MoveNext() == E_SUCCESS)
+       {
+               String* pKey = static_cast< String* > (pEnum->GetKey());
+               TryReturn(pEnum, false, "GetKey() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+               String* pValue = static_cast< String* > (pEnum->GetValue());
+               TryReturn(pEnum, false, "GetValue() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+               String query;
+               query.Format(1024, L"INSERT INTO LaunchCondition (ID, NAME, VALUE) VALUES ((SELECT AppInfo.UNIQUE_ID FROM AppInfo WHERE AppInfo.PACKAGE_NAME = '%ls'),?,?)", pAppData->__appId.GetPointer());
+
+               std::unique_ptr< DbStatement > pStmt(_PackageManagerImpl::CreateStatementN(db, query));
+               TryReturn(pStmt, false, "CreateStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+               if (!(pKey->IsEmpty()))
+               {
+                       r = pStmt->BindString(0, *pKey);
+                       TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+               }
+
+               if (!(pValue->IsEmpty()))
+               {
+                       r = pStmt->BindString(1, *pValue);
+                       TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+               }
+
+               std::unique_ptr< DbEnumerator > pEnum(_PackageManagerImpl::ExecuteStatementN(db, pStmt.get()));
+               TryReturn(!IsFailed(GetLastResult()), false, "ExecuteStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+       }
+
+       return true;
+}
+
+bool
+DatabaseManager::RegisterAppFeatureList(AppData* pAppData, Database& db) const
+{
+       TryReturn(pAppData, E_SYSTEM, "pAppData is null.");
+       TryReturn(pAppData->__pFeatureList, E_SYSTEM, "__pFeatureList is null.");
+
+       result r = E_SUCCESS;
+       HashMap* pList = pAppData->__pFeatureList;
+
+       std::unique_ptr< IMapEnumerator > pEnum(pList->GetMapEnumeratorN());
+       TryReturn(pEnum, false, "GetMapEnumeratorN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+       while (pEnum->MoveNext() == E_SUCCESS)
+       {
+               String* pKey = static_cast< String* > (pEnum->GetKey());
+               TryReturn(pEnum, false, "GetKey() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+               String* pValue = static_cast< String* > (pEnum->GetValue());
+               TryReturn(pEnum, false, "GetValue() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+               String query;
+               query.Format(1024, L"INSERT INTO AppFeature (ID, NAME, VALUE) VALUES ((SELECT AppInfo.UNIQUE_ID FROM AppInfo WHERE AppInfo.PACKAGE_NAME = '%ls'),?,?)", pAppData->__appId.GetPointer());
+
+               std::unique_ptr< DbStatement > pStmt(_PackageManagerImpl::CreateStatementN(db, query));
+               TryReturn(pStmt, false, "CreateStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+               if (!(pKey->IsEmpty()))
+               {
+                       r = pStmt->BindString(0, *pKey);
+                       TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+               }
+
+               if (!(pValue->IsEmpty()))
+               {
+                       r = pStmt->BindString(1, *pValue);
+                       TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+               }
+
+               std::unique_ptr< DbEnumerator > pEnum(_PackageManagerImpl::ExecuteStatementN(db, pStmt.get()));
+               TryReturn(!IsFailed(GetLastResult()), false, "ExecuteStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+       }
+
+       return true;
+}
+
+bool
+DatabaseManager::RegisterDataControlList(AppData* pAppData, Database& db) const
+{
+       TryReturn(pAppData, E_SYSTEM, "pAppData is null.");
+       TryReturn(pAppData->__pDataControlList, E_SYSTEM, "__pDataControlList is null.");
+
+       result r = E_SUCCESS;
+
+       IListT<DataControlInfo*>* pDataControlList = pAppData->__pDataControlList;
+       TryReturn(pDataControlList, false, "pDataControlList is null.");
+
+       for (int i = 0; i < pDataControlList->GetCount(); i++)
+       {
+               DataControlInfo* pDataControlInfo = null;
+               pDataControlList->GetAt(i, pDataControlInfo);
+               TryReturn(pDataControlInfo, false, "pDataControlInfo is null.");
+
+               String providerId = pDataControlInfo->__providerId;
+               IListT<DataControlType*>* pTypeList = pDataControlInfo->__pControlTypeList;
+               TryReturn(pTypeList, false, "pTypeList is null.");
+
+               for (int j = 0; j < pTypeList->GetCount(); j++)
+               {
+                       DataControlType* pDataControlType = null;
+                       pTypeList->GetAt(j, pDataControlType);
+                       TryReturn(pDataControlType, false, "pDataControlType is null.");
+
+                       String access = pDataControlType->__access;
+                       String type = pDataControlType->__type;
+
+                       String query;
+                       query.Format(1024, L"INSERT INTO DataControl (ID, PROVIDER_ID, TYPE, ACCESS) VALUES ((SELECT AppInfo.UNIQUE_ID FROM AppInfo WHERE AppInfo.PACKAGE_NAME = '%ls'),?,?,?)", pAppData->__appId.GetPointer());
+
+                       std::unique_ptr< DbStatement > pStmt(_PackageManagerImpl::CreateStatementN(db, query));
+                       TryReturn(pStmt, false, "CreateStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+                       if (!providerId.IsEmpty())
+                       {
+                               r = pStmt->BindString(0, providerId);
+                               TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+                       }
+
+                       if (!type.IsEmpty())
+                       {
+                               r = pStmt->BindString(1, type);
+                               TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+                       }
+
+                       if (!access.IsEmpty())
+                       {
+                               r = pStmt->BindString(2, access);
+                               TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+                       }
+
+                       std::unique_ptr< DbEnumerator > pEnum(_PackageManagerImpl::ExecuteStatementN(db, pStmt.get()));
+                       TryReturn(!IsFailed(GetLastResult()), false, "ExecuteStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+               }
+       }
+
+       return true;
+}
+
+bool
+DatabaseManager::UnregisterPackageInfo(InstallationContext* pContext) const
+{
+       Database db;
+       String query;
+       PackageId packageId = pContext->__packageId;
+
+       result r = db.Construct(L"/opt/usr/dbspace/.app-package.db", "r+");
+       TryReturn(r == E_SUCCESS, false, "db.Construct failed. [%s]", GetErrorMessage(r));
+
+       // DataControl
+       query.Format(1024, L"DELETE FROM DataControl WHERE DataControl.ID IN "
+                       "(SELECT AppInfo.UNIQUE_ID FROM PkgInfo, AppInfo "
+                       "WHERE AppInfo.ID = PkgInfo.UNIQUE_ID and PkgInfo.PKG_ID = '%ls')", packageId.GetPointer());
+       r = db.ExecuteSql(query, true);
+       if (r != E_SUCCESS)
+       {
+               AppLog("ExecuteSql() failed. [%ls][%s]", query.GetPointer(), GetErrorMessage(r));
+       }
+       query.Clear();
+
+       // LaunchCondition
+       query.Format(1024, L"DELETE FROM LaunchCondition WHERE LaunchCondition.ID IN "
+                       "(SELECT AppInfo.UNIQUE_ID FROM PkgInfo, AppInfo "
+                       "WHERE AppInfo.ID = PkgInfo.UNIQUE_ID and PkgInfo.PKG_ID = '%ls')", packageId.GetPointer());
+       r = db.ExecuteSql(query, true);
+       if (r != E_SUCCESS)
+       {
+               AppLog("ExecuteSql() failed. [%ls][%s]", query.GetPointer(), GetErrorMessage(r));
+       }
+       query.Clear();
+
+       // Notification
+       query.Format(1024, L"DELETE FROM Notification WHERE Notification.ID IN "
+                       "(SELECT AppInfo.UNIQUE_ID FROM PkgInfo, AppInfo "
+                       "WHERE AppInfo.ID = PkgInfo.UNIQUE_ID and PkgInfo.PKG_ID = '%ls')", packageId.GetPointer());
+       r = db.ExecuteSql(query, true);
+       if (r != E_SUCCESS)
+       {
+               AppLog("ExecuteSql() failed. [%ls][%s]", query.GetPointer(), GetErrorMessage(r));
+       }
+       query.Clear();
+
+       // AppFeature
+       query.Format(1024, L"DELETE FROM AppFeature WHERE AppFeature.ID IN "
+                       "(SELECT AppInfo.UNIQUE_ID FROM PkgInfo, AppInfo "
+                       "WHERE AppInfo.ID = PkgInfo.UNIQUE_ID and PkgInfo.PKG_ID = '%ls')", packageId.GetPointer());
+       r = db.ExecuteSql(query, true);
+       if (r != E_SUCCESS)
+       {
+               AppLog("ExecuteSql() failed. [%ls][%s]", query.GetPointer(), GetErrorMessage(r));
+       }
+       query.Clear();
+
+       // AppInfo
+       query.Format(1024, L"DELETE FROM AppInfo WHERE AppInfo.ID IN "
+                       "(SELECT PkgInfo.UNIQUE_ID FROM PkgInfo, AppInfo "
+                       "WHERE PkgInfo.UNIQUE_ID = AppInfo.ID and PkgInfo.PKG_ID = '%ls')", packageId.GetPointer());
+       r = db.ExecuteSql(query, true);
+       if (r != E_SUCCESS)
+       {
+               AppLog("ExecuteSql() failed. [%ls][%s]", query.GetPointer(), GetErrorMessage(r));
+       }
+       query.Clear();
+
+       // PkgPrivileges
+       query.Format(1024, L"DELETE FROM PkgPrivileges WHERE PkgPrivileges.ID IN "
+                       "(SELECT PkgInfo.UNIQUE_ID FROM PkgInfo, PkgPrivileges "
+                       "WHERE PkgInfo.UNIQUE_ID = PkgPrivileges.ID and PkgInfo.PKG_ID = '%ls')", packageId.GetPointer());
+       r = db.ExecuteSql(query, true);
+       if (r != E_SUCCESS)
+       {
+               AppLog("ExecuteSql() failed. [%ls][%s]", query.GetPointer(), GetErrorMessage(r));
+       }
+       query.Clear();
+
+       // PkgInfo
+       query.Format(1024, L"DELETE FROM PkgInfo WHERE PKG_ID = '%ls'", packageId.GetPointer());
+       r = db.ExecuteSql(query, true);
+       if (r != E_SUCCESS)
+       {
+               AppLog("ExecuteSql() failed. [%ls][%s]", query.GetPointer(), GetErrorMessage(r));
+       }
+       query.Clear();
+
+       return true;
+}
+
+bool
+DatabaseManager::CreatePackageTables(void) const
+{
+       if (File::IsFileExist(PACKAGE_DATABASE_FILE_NAME) == true)
+       {
+               return true;
+       }
+
+       result r = E_SUCCESS;
+       Database db;
+       String createQuery;
+
+       r = db.Construct(PACKAGE_DATABASE_FILE_NAME, true);
+       TryReturn(r == E_SUCCESS, false, "db.Construct is failed. [%s]", GetErrorMessage(r));
+
+       // PkgInfo
+       createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS PkgInfo"
+                                                        "( UNIQUE_ID                                   INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"
+                                                        "PKG_ID                        TEXT,"
+                                                        "PKG_SECRET                    TEXT,"
+                                                        "PKG_VERSION                   TEXT,"
+                                                        "PKG_TYPE                  TEXT,"
+                                                        "PKG_MIMETYPE              TEXT,"
+                                                        "PKG_APIVERSION                TEXT,"
+                                                        "PKG_NAME                  TEXT,"
+                                                        "PKG_VENDOR                    TEXT,"
+                                                        "PKG_DESCRIPTION           TEXT,"
+                                                        "PKG_URL                       TEXT,"
+                                                        "PKG_CID                       TEXT,"
+                                                        "PKG_READONLY_SIZE             INTEGER,"
+                                                        "PKG_DATA_SIZE                 INTEGER,"
+                                                        "PKG_PARENT_ID                         TEXT,"
+                                                        "PKG_ATTRIBUTE                         INTEGER,"
+                                                        "PKG_ROOTPATH              TEXT,"
+                                                        "PKG_STORAGE_TYPE          INTEGER,"
+                                                        "PKG_INSTALLATION_DATE         TEXT,"
+                                                        "PKG_STATE                     INTEGER,"
+                                                        "PKG_INITIATOR                 INTEGER )");
+       r = db.ExecuteSql(createQuery, true);
+       TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+       createQuery.Clear();
+
+       // PkgPrivileges
+       createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS PkgPrivileges"
+                                                        "( ID                          INTEGER,"
+                                                        "PRIVILEGES                                    TEXT,"
+                                                        "HMAC_PPRIVILEGES                      TEXT,"
+                                                        "CERTIFICATE_TYPE              INTEGER )");
+       r = db.ExecuteSql(createQuery, true);
+       TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+       createQuery.Clear();
+
+       // PkgIntegrity
+       createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS PkgIntegrity"
+                                                        "( ID                          INTEGER,"
+                                                        "HMAC_APPID                                    TEXT,"
+                                                        "HMAC_APPSECRET                                TEXT,"
+                                                        "HMAC_HTB                                              TEXT,"
+                                                        "SLOT_NUM                              INTEGER )");
+       r = db.ExecuteSql(createQuery, true);
+       TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+       createQuery.Clear();
+
+       // AppInfo
+       createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS AppInfo"
+                                                        "( UNIQUE_ID                                   INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"
+                                                        "ID                            INTEGER,"
+                                                        "APP_NAME                  TEXT,"
+                                                        "APP_TYPE                  TEXT,"
+                                                        "APP_DEFAULT                   TEXT,"
+                                                        "APP_MAINMENU_ICON             TEXT,"
+                                                        "APP_SETTING_ICON          TEXT,"
+                                                        "APP_TICKER_ICON                               TEXT,"
+                                                        "APP_QUICKPANEL_ICON                   TEXT,"
+                                                        "APP_LAUNCHIMAGE_ICON      TEXT,"
+                                                        "APP_FEATURE               INTEGER,"
+                                                        "PACKAGE_NAME              TEXT )");
+       r = db.ExecuteSql(createQuery, true);
+       TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+       createQuery.Clear();
+
+       // Notification
+       createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS Notification"
+                                                        "( ID                          INTEGER,"
+                                                        "NAME                      TEXT,"
+                                                        "VALUE                     TEXT )");
+       r = db.ExecuteSql(createQuery, true);
+       TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+       createQuery.Clear();
+
+       // AppFeature
+       createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS AppFeature"
+                                                        "( ID                          INTEGER,"
+                                                        "NAME                      TEXT,"
+                                                        "VALUE                     TEXT )");
+       r = db.ExecuteSql(createQuery, true);
+       TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+       createQuery.Clear();
+
+       // LaunchCondition
+       createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS LaunchCondition"
+                                                        "( ID                          INTEGER,"
+                                                        "NAME                      TEXT,"
+                                                        "VALUE                     TEXT )");
+       r = db.ExecuteSql(createQuery, true);
+       TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+       createQuery.Clear();
+
+       // DataControl
+       createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS DataControl"
+                                                        "( ID INTEGER,"
+                                                        "PROVIDER_ID TEXT,"
+                                                        "TYPE TEXT,"
+                                                        "ACCESS TEXT )");
+       r = db.ExecuteSql(createQuery, true);
+       TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+       createQuery.Clear();
+
+       // Capability
+       createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS Capability"
+                                                        "( ID                          INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"
+                                                        "OPERATION_ID                          TEXT )");
+       r = db.ExecuteSql(createQuery, true);
+       TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+       createQuery.Clear();
+
+       // ResolutionUriScheme
+       createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS ResolutionUriScheme"
+                                                        "( ID                          INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"
+                                                        "URI_SCHEME                            TEXT )");
+       r = db.ExecuteSql(createQuery, true);
+       TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+       createQuery.Clear();
+
+       // ResolutionMimeType
+       createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS ResolutionMimeType"
+                                                        "( ID                          INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"
+                                                        "MIME_TYPE                             TEXT )");
+       r = db.ExecuteSql(createQuery, true);
+       TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+       createQuery.Clear();
+
+       // AppControl
+       createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS AppControl"
+                                                        "( ID                          INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"
+                                                        "PROVIDER_ID                   TEXT,"
+                                                        "CATEGORY                                      TEXT )");
+       r = db.ExecuteSql(createQuery, true);
+       TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+       createQuery.Clear();
+
+       // AppInfoLookup
+       createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS AppInfoLookup"
+                                                        "( AppInfoID                   INTEGER,"
+                                                        "CapabilityID              INTEGER,"
+                                                        "ResolutionUriSchemeID         INTEGER,"
+                                                        "ResolutionMimeTypeID      INTEGER,"
+                                                        "AppControlID                              INTEGER )");
+       r = db.ExecuteSql(createQuery, true);
+       TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+       createQuery.Clear();
+
+       return r;
+}
diff --git a/src/Manager/DatabaseManager.h b/src/Manager/DatabaseManager.h
new file mode 100755 (executable)
index 0000000..83653fe
--- /dev/null
@@ -0,0 +1,53 @@
+//
+// 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       DatabaseManager.h
+ * @brief      This is the header file for the %DatabaseManager class.
+ *
+ * This header file contains the declarations of the %DatabaseManager class.
+ */
+#ifndef _DATABASE_MANAGER_H_
+#define _DATABASE_MANAGER_H_
+
+#include "InstallationContext.h"
+
+namespace Tizen { namespace Io
+{
+class Database;
+}}
+
+class DatabaseManager
+{
+public:
+       DatabaseManager(void);
+       virtual ~DatabaseManager(void);
+
+       bool RegisterPackageInfo(InstallationContext* pContext) const;
+       bool UnregisterPackageInfo(InstallationContext* pContext) const;
+
+private:
+       bool RegisterPrivilegeInfo(InstallationContext* pContext, Tizen::Io::Database& db) const;
+       bool RegisterAppInfoList(InstallationContext* pContext, Tizen::Io::Database& db) const;
+       bool RegisterLaunchConditionList(AppData* pAppData, Tizen::Io::Database& db) const;
+       bool RegisterAppFeatureList(AppData* pAppData, Tizen::Io::Database& db) const;
+       bool RegisterDataControlList(AppData* pAppData, Tizen::Io::Database& db) const;
+
+       bool CreatePackageTables(void) const;
+
+}; // DatabaseManager
+
+#endif // _DATABASE_MANAGER_H_
index 467d8ef..20c6aae 100755 (executable)
@@ -157,7 +157,7 @@ InstallerManager::Construct(const String& path, InstallerOperation operation, In
 
                AppLog("operation is INSTALLER_OPERATION_UNINSTALL");
                __pContext->SetCurrentInstallationStep(INSTALLER_STEP_INIT_UNINSTALL);
-               __pContext->SetId(newPath);
+               __pContext->__packageId = newPath;
        }
 
        __pContext->SetInstallerOperation(operation);
@@ -513,70 +513,6 @@ CATCH:
 }
 
 void
-InstallerManager::PrintPackageInfo(const char* appId)
-{
-       _PackageInfoImpl* pPackageInfoImpl = null;
-       ArrayList* pAppList = null;
-       int totalCount = 0;
-
-       pPackageInfoImpl = new (std::nothrow) _PackageInfoImpl;
-       if (pPackageInfoImpl == null)
-       {
-               return;
-       }
-
-       pPackageInfoImpl->Construct(appId);
-
-       AppLog("------------------------------------------");
-       AppLog("PackageInfo");
-       AppLog("------------------------------------------");
-       AppLog("# id = [%S]",  pPackageInfoImpl->GetId().GetPointer());
-       AppLog("# version = [%S]", pPackageInfoImpl->GetAppVersion().GetPointer());
-       AppLog("# name = [%S]", pPackageInfoImpl->GetAppName().GetPointer());
-       AppLog("# vendor = [%S]", pPackageInfoImpl->GetAppVendor().GetPointer());
-       AppLog("# description = [%S]", pPackageInfoImpl->GetAppDescription().GetPointer());
-       AppLog("# mimeType = [%S]", pPackageInfoImpl->GetAppMimeType().GetPointer());
-       AppLog("# api version = [%S]", pPackageInfoImpl->GetAppApiVersion().GetPointer());
-       AppLog("# uri = [%S]", pPackageInfoImpl->GetAppUrl().GetPointer());
-       AppLog("# cid = [%S]",  pPackageInfoImpl->GetAppCid().GetPointer());
-       AppLog("# installationDate = [%S]", pPackageInfoImpl->GetAppInstallationTime().ToString().GetPointer());
-       AppLog("# rootpath = [%S]", pPackageInfoImpl->GetAppRootPath().GetPointer());
-       AppLog("# storageType = [%d]", pPackageInfoImpl->GetAppStorageType());
-       AppLog("------------------------------------------");
-
-       pAppList = pPackageInfoImpl->GetAppInfoListN();
-       if (pAppList == null)
-       {
-               delete pPackageInfoImpl;
-               return;
-       }
-
-       totalCount = pAppList->GetCount();
-
-       for (int i = 0; i < totalCount; i++)
-       {
-               _PackageAppInfoImpl* pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pAppList->GetAt(i));
-
-               AppLog("------------------------------------------");
-               AppLog("AppInfo(%d/%d)", i+1, totalCount);
-               AppLog("------------------------------------------");
-               AppLog("# default = [%S]", pAppInfoImpl->GetDefault().GetPointer());
-               AppLog("# appname = [%S]", pAppInfoImpl->GetName().GetPointer());
-               AppLog("# packagename = [%S]", pAppInfoImpl->GetPackageName().GetPointer());
-               AppLog("# mainmenu icon = [%S]", pAppInfoImpl->GetMainmenuIcon().GetPointer());
-               AppLog("# setting icon = [%S]", pAppInfoImpl->GetSettingIcon().GetPointer());
-               AppLog("# quickpanel icon = [%S]", pAppInfoImpl->GetQuickpanelIcon().GetPointer());
-               AppLog("------------------------------------------");
-       }
-
-       pAppList->RemoveAll();
-       delete pAppList;
-       pAppList = null;
-
-       delete pPackageInfoImpl;
-}
-
-void
 InstallerManager::PrintResult(void)
 {
        int errorType = GetErrorType();
@@ -588,9 +524,9 @@ InstallerManager::PrintResult(void)
        (operation == INSTALLER_OPERATION_INSTALL)? (pOperation = "Install"): (pOperation = "Uninstall");
 
        const wchar_t* pPackageId = L"Unknown";
-       if (__pContext && !__pContext->GetId().IsEmpty())
+       if (__pContext && !__pContext->__packageId.IsEmpty())
        {
-               pPackageId = __pContext->GetId().GetPointer();
+               pPackageId = __pContext->__packageId.GetPointer();
        }
 
        const wchar_t* pMainAppName = L"Unknown";
@@ -778,7 +714,7 @@ InstallerManager::Request(const String& path, InstallerOperation operation, Inst
 
        pContext = pInstallManager->GetContext();
        TryCatch(pContext, errorType = INSTALLER_ERROR_INTERNAL_STATE, "pInstallManager->GetContext failed.");
-       packageId = pContext->GetId();
+       packageId = pContext->__packageId;
 
 CATCH:
        pInstallManager->SetErrorType(errorType);
index d8c95c8..3c62391 100755 (executable)
@@ -46,7 +46,6 @@ public:
 
        bool RemoveGarbage(const Tizen::Base::String& filePath);
 
-       void PrintPackageInfo(const char* appId);
        void PrintResult(void);
        void PrintError(int errorType);
 
index fad59ee..e3486a1 100755 (executable)
@@ -29,9 +29,6 @@
 #include <FIoDirectory.h>
 #include <FBase_StringConverter.h>
 #include <FIo_FileImpl.h>
-#include <FAppPkg_PackageManagerImpl.h>
-#include <FAppPkg_PackageInfoImpl.h>
-#include <FAppPkg_PackageAppInfoImpl.h>
 
 #include "PermissionManager.h"
 #include "InstallerUtil.h"
@@ -40,7 +37,7 @@ using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Base::Utility;
 using namespace Tizen::Io;
-using namespace Tizen::App::Package;
+using namespace Tizen::App;
 
 PermissionManager::PermissionManager(void)
 {
@@ -57,11 +54,9 @@ PermissionManager::SetDirectory(InstallationContext* pContext)
 
        String destPath;
        String appRootPath;
-       _PackageInfoImpl *pPackageInfoImpl = null;
        FileAttributes attribute;
 
-       pPackageInfoImpl = pContext->GetPackageInfoImpl();
-       appRootPath = pPackageInfoImpl->GetAppRootPath();
+       appRootPath = pContext->__rootPath;
 
        // appRoot
        // InstallerUtil::ChangeOwner(appRootPath);
@@ -109,7 +104,7 @@ PermissionManager::SetDirectory(InstallationContext* pContext)
        r = File::GetAttributes(destPath, attribute);
        if (r == E_SUCCESS)
        {
-               String appVersion = pPackageInfoImpl->GetVersion();
+               String appVersion = pContext->__version;
                String srcPath;
                String settingXmlPath;
 
@@ -131,19 +126,19 @@ PermissionManager::SetDirectory(InstallationContext* pContext)
        }
        InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE, true);
 
-       String appId = pContext->GetId();
-       String apiVersion = pPackageInfoImpl->GetAppApiVersion();
+       PackageId packageId = pContext->__packageId;
+       String apiVersion = pContext->__apiVersion;
 
        AppLog("------------------------------------------");
        AppLog("[Tizen::Io] # path = [%ls]", appRootPath.GetPointer());
-       AppLog("[Tizen::Io] # appId = [%ls]", appId.GetPointer());
+       AppLog("[Tizen::Io] # packageId = [%ls]", packageId.GetPointer());
        AppLog("[Tizen::Io] # apiVersion = [%ls]", apiVersion.GetPointer());
 
        if (pContext->__isOspCompat == true)
        {
                AppLog("[Tizen::Io] OSP 2.0 application");
 
-               if (_FileImpl::PrepareDataCaging(appRootPath, appId) == false)
+               if (_FileImpl::PrepareDataCaging(appRootPath, packageId) == false)
                {
                        AppLog("[Tizen::Io] _FileImpl::PrepareDataCaging() failed");
                        return false;
@@ -155,7 +150,7 @@ PermissionManager::SetDirectory(InstallationContext* pContext)
        {
                AppLog("[Tizen::Io] apiVersion is equal to or greater than Tizen 2.0");
 
-               if (_FileImpl::CreateOspApplicationDirectories(appRootPath, appId) == false)
+               if (_FileImpl::CreateOspApplicationDirectories(appRootPath, packageId) == false)
                {
                        AppLog("[Tizen::Io] _FileImpl::CreateOspApplicationDirectories() failed");
                        return false;
@@ -163,10 +158,6 @@ PermissionManager::SetDirectory(InstallationContext* pContext)
        }
        AppLog("------------------------------------------");
 
-       // Create AppId.ExecutableName directory
-       // This will be removed.
-       // CreateSystemDirectory(pContext, appRootPath);
-
        return true;
 }
 
@@ -174,55 +165,22 @@ bool
 PermissionManager::SetFile(InstallationContext* pContext)
 {
        String destPath;
+       String appRootPath = pContext->__rootPath;
 
-       _PackageInfoImpl *pPackageInfoImpl = null;
-       _PackageAppInfoImpl* pAppInfoImpl = null;
-       ArrayList* pAppList = null;
-
-       pPackageInfoImpl = pContext->GetPackageInfoImpl();
-       TryReturn(pPackageInfoImpl, false, "pPackageInfoImpl is null.");
+       IListT<AppData*>* pAppDataList = pContext->__pAppDataList;
+       TryReturn(pAppDataList, false, "pAppDataList is null");
 
-       String appRootPath;
-       appRootPath = pPackageInfoImpl->GetAppRootPath();
-
-       pAppList = pPackageInfoImpl->GetAppInfoList();
-       for (int i = 0 ; i < pAppList->GetCount(); i++)
+       for (int i = 0 ; i < pAppDataList->GetCount(); i++)
        {
-               pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pAppList->GetAt(i));
-               if (pAppInfoImpl)
-               {
-                       // set permission(755) to bin file.
-                       destPath = appRootPath + DIR_BIN + L"/" + pAppInfoImpl->GetName() + L".exe";
-                       InstallerUtil::ChangeMode(destPath, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
-               }
-       }
-
-       return true;
-}
-
-bool
-PermissionManager::CreateSystemDirectory(InstallationContext* pContext, const Tizen::Base::String& rootpath)
-{
-       _PackageInfoImpl *pPackageInfoImpl = null;
-       _PackageAppInfoImpl* pAppInfoImpl = null;
-       ArrayList* pAppList = null;
-
-       pPackageInfoImpl = pContext->GetPackageInfoImpl();
-       TryReturn(pPackageInfoImpl, false, "pPackageInfoImpl is null.");
+               AppData* pAppData = null;
+               pAppDataList->GetAt(i, pAppData);
+               TryReturn(pAppData, false, "pAppData is null");
 
-       pAppList = pPackageInfoImpl->GetAppInfoList();
-       TryReturn(pAppList, false, "pAppList is null.");
-
-       for (int i = 0 ; i < pAppList->GetCount(); i++)
-       {
-               pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pAppList->GetAt(i));
-               if (pAppInfoImpl)
+               // set permission(755) to bin file.
+               destPath = appRootPath + DIR_BIN + L"/" + pAppData->__name + L".exe";
+               if (File::IsFileExist(destPath) == true)
                {
-                       String destPath =  SLP_APP_PATH;
-                       destPath += L"/" + pAppInfoImpl->GetPackageName();
-
-                       InstallerUtil::Remove(destPath);
-                       InstallerUtil::CreateSymlink(pPackageInfoImpl->GetAppRootPath(), destPath);
+                       InstallerUtil::ChangeMode(destPath, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
                }
        }
 
@@ -234,9 +192,7 @@ PermissionManager::SetSymLink(InstallationContext* pContext)
 {
        String oldPath;
        String newPath;
-
-       _PackageInfoImpl* pPackageInfoImpl = pContext->GetPackageInfoImpl();
-       String appRootPath = pPackageInfoImpl->GetAppRootPath();
+       String appRootPath = pContext->__rootPath;
 
 #if 0
        oldPath = appRootPath + DIR_RES;
old mode 100644 (file)
new mode 100755 (executable)
index 379493d..c173717
@@ -43,7 +43,6 @@ public:
        static bool SetFile(InstallationContext* pContext);
 
 private:
-       static bool CreateSystemDirectory(InstallationContext* pContext, const Tizen::Base::String& rootpath);
        static bool SetSymLink(InstallationContext* pContext);
     static bool PrepareDataCaging(InstallationContext* pContext);
 
index 1a55a8f..d15f970 100755 (executable)
 #include <FIoFile.h>
 
 #include <FBase_StringConverter.h>
-#include <FAppPkg_PackageInfoImpl.h>
 
 #include "InstallationContext.h"
 #include "ManifestHandler.h"
 #include "ManifestXmlStep.h"
 
 using namespace Tizen::Base;
-using namespace Tizen::App::Package;
 using namespace Tizen::Io;
 
 ManifestXmlStep::ManifestXmlStep(void)
@@ -101,7 +99,6 @@ ManifestXmlStep::OnStateManifestXml(void)
 {
        InstallerError error = INSTALLER_ERROR_NONE;
        bool ret = false;
-       _PackageInfoImpl *pPackageInfoImpl = null;
        String manifestXmlPath;
        result r = E_SUCCESS;
 
@@ -121,10 +118,6 @@ ManifestXmlStep::OnStateManifestXml(void)
        ret = manifestHandler.Parse(pFilepath.get());
        TryReturn(ret == true, INSTALLER_ERROR_MANIFEST_INVALID, "manifestHandler.Parse() failed");
 
-       pPackageInfoImpl = __pContext->GetPackageInfoImpl();
-       TryReturn(pPackageInfoImpl, error = INSTALLER_ERROR_INTERNAL_STATE, "pPackageInfoImpl is null");
-       __pContext->SetId(pPackageInfoImpl->GetId());
-
        GoNextState();
 
        return error;
index 82f1dd2..81cb98e 100755 (executable)
@@ -20,7 +20,6 @@
  */
 
 #include <FIoFile.h>
-#include <FAppPkg_PackageInfoImpl.h>
 #include <FBase_StringConverter.h>
 
 #include "InstallationContext.h"
@@ -28,7 +27,7 @@
 #include "SignatureHandler.h"
 #include "SignatureStep.h"
 
-using namespace Tizen::App::Package;
+using namespace Tizen::App;
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Io;
@@ -155,17 +154,17 @@ SignatureStep::OnStateRootCert(void)
 
        const ArrayList* pPrivilegeList = __pContext->GetPrivilegeList();
        RootCertificateType certType = __pContext->__rootCertType;
-       _PackageInfoImpl* pPackageInfoImpl = __pContext->GetPackageInfoImpl();
-       String appId = pPackageInfoImpl->GetId();
+       PackageId packageId = __pContext->__packageId;
        int apiVisibility = GetApiVisibility(certType);
 
-       AppLog("AppId = [%ls], CertType = [%d], ApiVisibility = [%d]", appId.GetPointer(), certType, apiVisibility);
+       AppLog("PackageId = [%ls], CertType = [%d], ApiVisibility = [%d]", packageId.GetPointer(), certType, apiVisibility);
 
-       r = PrivilegeHandler::GenerateCipherPrivilege(appId, *pPrivilegeList, apiVisibility, privileges, hmacPrivileges);
+       r = PrivilegeHandler::GenerateCipherPrivilege(packageId, *pPrivilegeList, apiVisibility, privileges, hmacPrivileges);
        TryCatch(!IsFailed(r), error = INSTALLER_ERROR_PRIVILEGE_INVALID, "privMgr.GeneratePrivilegeString() failed");
 
-       pPackageInfoImpl->SetPrivilegesValue(privileges, hmacPrivileges);
-       pPackageInfoImpl->SetCertType(apiVisibility);
+       __pContext->__privileges = privileges;
+       __pContext->__hmacPrivileges = hmacPrivileges;
+       __pContext->__certType = apiVisibility;
 
 CATCH:
        GoNextState();
index 02bf14c..236ddec 100755 (executable)
@@ -36,6 +36,7 @@
 
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
+using namespace Tizen::App;
 using namespace Tizen::App::Package;
 using namespace Tizen::Io;
 
@@ -120,16 +121,16 @@ InstallerError
 UninstallStep::OnStateGetPackageInfo(void)
 {
        InstallerError error = INSTALLER_ERROR_NONE;
-       String appId = __pContext->GetId();
+       PackageId packageId = __pContext->__packageId;
 
-       _PackageInfoImpl* pPackageInfoImpl = __pContext->GetPackageInfoImpl();
-       TryReturn(pPackageInfoImpl, INSTALLER_ERROR_INTERNAL_STATE, "pPackageInfoImpl is null");
+       std::unique_ptr< _PackageInfoImpl > pPackageInfoImpl(new (std::nothrow) _PackageInfoImpl());
+       TryReturn(pPackageInfoImpl, INSTALLER_ERROR_OUT_OF_MEMORY, "pPackageInfoImpl is null.");
 
-       AppLog("appId = %ls", appId.GetPointer());
-       pPackageInfoImpl->Construct(appId);
+       AppLog("packageId = %ls", packageId.GetPointer());
+       pPackageInfoImpl->Construct(packageId);
 
-       String rootPath = pPackageInfoImpl->GetAppRootPath();
-       if (rootPath.StartsWith(PATH_USR_APPS, 0) == true)
+       __pContext->__rootPath = pPackageInfoImpl->GetAppRootPath();
+       if (__pContext->__rootPath.StartsWith(PATH_USR_APPS, 0) == true)
        {
                __pContext->__isPreloaded = true;
        }
@@ -146,18 +147,18 @@ UninstallStep::OnStateGetPackageInfo(void)
                int res = 0;
                app2ext_handle* pHandle = null;
 
-               std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
-               TryReturn(pAppId, INSTALLER_ERROR_INTERNAL_STATE, "pAppId is null");
+               std::unique_ptr<char[]> pPackageId(_StringConverter::CopyToCharArrayN(packageId));
+               TryReturn(pPackageId, INSTALLER_ERROR_INTERNAL_STATE, "pAppId is null");
 
                pHandle = app2ext_init(APP2EXT_SD_CARD);
                TryReturn(pHandle, INSTALLER_ERROR_INTERNAL_STATE, "app2ext_init() failed");
 
-               res = pHandle->interface.pre_uninstall(pAppId.get());
+               res = pHandle->interface.pre_uninstall(pPackageId.get());
                TryReturn(res == 0, INSTALLER_ERROR_INTERNAL_STATE, "pHandle->interface.pre_uninstall() failed [%d]", res);
 
                __pContext->__pApp2ExtHandle = (void*)pHandle;
 
-               AppLog("[app2sd] pre_uninstall(%s)", pAppId.get());
+               AppLog("[app2sd] pre_uninstall(%s)", pPackageId.get());
        }
 
        ArrayList* pList = pPackageInfoImpl->GetAppInfoListN();
@@ -168,10 +169,19 @@ UninstallStep::OnStateGetPackageInfo(void)
                _PackageAppInfoImpl* pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pList->GetAt(i));
                if (pAppInfoImpl)
                {
-                       pPackageInfoImpl->AddAppInfo(*pAppInfoImpl);
-                       pAppInfoImpl = null;
+                       AppData* pAppData = new (std::nothrow) AppData;
+                       TryReturn(pAppData, INSTALLER_ERROR_OUT_OF_MEMORY, "pAppData is null");
+
+                       error = pAppData->Construct();
+                       TryReturn(error == INSTALLER_ERROR_NONE, INSTALLER_ERROR_INTERNAL_STATE, "pAppData->Construct() failed.");
+
+                       pAppData->__appId = pAppInfoImpl->GetPackageName();
+                       pAppData->__feature = pAppInfoImpl->GetAppFeature();
+
+                       __pContext->__pAppDataList->Add(pAppData);
                }
        }
+       delete pList;
 
        __state = STATE_DELETE_DIR;
 
@@ -211,12 +221,9 @@ UninstallStep::OnStateRemoveDir(void)
 {
        InstallerError error = INSTALLER_ERROR_NONE;
 
-       _PackageInfoImpl* pPackageInfoImpl = __pContext->GetPackageInfoImpl();
-       TryReturn(pPackageInfoImpl, INSTALLER_ERROR_INTERNAL_STATE, "pPackageInfoImpl is null");
-
        String rootPath;
-       rootPath = pPackageInfoImpl->GetAppRootPath();
-       AppLog("rootPath[%ls]", rootPath.GetPointer());
+       rootPath = __pContext->__rootPath;
+       AppLog("rootPath = [%ls]", rootPath.GetPointer());
 
        String compatPath(rootPath);
        compatPath.Append(L"/info/compat.info");
@@ -258,28 +265,26 @@ UninstallStep::OnStateRemoveDir(void)
                InstallerUtil::Remove(rootPath);
        }
 
-       _PackageAppInfoImpl* pAppInfoImpl = null;
-       ArrayList* pAppList = null;
+       IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
+       TryReturn(pAppDataList, INSTALLER_ERROR_INTERNAL_STATE, "pAppDataList is null");
 
-       pAppList = pPackageInfoImpl->GetAppInfoList();
-       for (int i = 0 ; i < pAppList->GetCount(); i++)
+       int count = pAppDataList->GetCount();
+       for (int i = 0; i < count; i++)
        {
-               pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pAppList->GetAt(i));
-               if (pAppInfoImpl)
-               {
-                       String packageName = pAppInfoImpl->GetPackageName();
-                       String destPath;
-                       destPath.Format(1024, L"%S/%S", SLP_APP_PATH, packageName.GetPointer());
-                       InstallerUtil::Remove(destPath);
+               AppData* pAppData = null;
+               pAppDataList->GetAt(i, pAppData);
 
-                       if (pAppInfoImpl->GetAppFeature() == CATEGORY_TYPE_IME)
+               if (pAppData)
+               {
+                       if (pAppData->__feature == CATEGORY_TYPE_IME)
                        {
                                String symlinkPath;
-                               symlinkPath.Format(1024, L"%s/%ls.so", IME_PATH, packageName.GetPointer());
+                               symlinkPath.Format(1024, L"%s/%ls.so", IME_PATH, pAppData->__appId.GetPointer());
                                InstallerUtil::Remove(symlinkPath);
                        }
                }
        }
+
        AppLog("Directory::Remove - END");
 
        GoNextState();
index 5e9564a..28e5444 100755 (executable)
@@ -27,7 +27,6 @@
 #include <FIoDirectory.h>
 #include <FBaseResult.h>
 #include <FBaseUtilFileUnzipper.h>
-#include <FAppPkg_PackageInfoImpl.h>
 #include <FBase_StringConverter.h>
 
 #include "InstallationContext.h"
@@ -37,7 +36,7 @@
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Base::Utility;
-using namespace Tizen::App::Package;
+using namespace Tizen::App;
 using namespace Tizen::Io;
 
 UnpackStep::UnpackStep(void)
@@ -135,14 +134,13 @@ InstallerError
 UnpackStep::OnUnzip(void)
 {
        InstallerError error = INSTALLER_ERROR_NONE;
-       _PackageInfoImpl *pPackageInfoImpl = null;
        String newInstallPath;
        app2ext_handle* pHandle = null;
 
        String installPath;
        installPath = PATH_OPT_USR_APPS;
        installPath += "/";
-       installPath += __pContext->GetId();
+       installPath += __pContext->__packageId;
 
        result r = E_SUCCESS;
        FileUnzipper unzipper;
@@ -152,10 +150,10 @@ UnpackStep::OnUnzip(void)
        if (__pContext->__storage == INSTALLATION_STORAGE_EXTERNAL)
        {
                int res = 0;
-               String appId = __pContext->GetId();
+               PackageId packageId = __pContext->__packageId;
 
-               std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
-               TryReturn(pAppId, INSTALLER_ERROR_INTERNAL_STATE, "pAppId is null");
+               std::unique_ptr<char[]> pPackageId(_StringConverter::CopyToCharArrayN(packageId));
+               TryReturn(pPackageId, INSTALLER_ERROR_INTERNAL_STATE, "pPackageId is null");
 
                GetUncompressedInfo(unzipper);
                TryReturn((__pDirectoryList && (__uncompressedSize > 0)), INSTALLER_ERROR_INTERNAL_STATE, "GetUncompressedInfo() failed");
@@ -165,10 +163,10 @@ UnpackStep::OnUnzip(void)
 
                __pContext->__pApp2ExtHandle = (void*)pHandle;
 
-               res = pHandle->interface.pre_install(pAppId.get(), __pDirectoryList, __uncompressedSize);
+               res = pHandle->interface.pre_install(pPackageId.get(), __pDirectoryList, __uncompressedSize);
                TryReturn(res == 0, INSTALLER_ERROR_INTERNAL_STATE, "pHandle->interface.pre_install() failed [%d]", res);
 
-               AppLog("[app2sd] pre_install(%s)", pAppId.get());
+               AppLog("[app2sd] pre_install(%s)", pPackageId.get());
        }
 
        if (File::IsFileExist(installPath) == false)
@@ -179,9 +177,7 @@ UnpackStep::OnUnzip(void)
 
        InstallerUtil::CreateSymlinkForAppDirectory(installPath, newInstallPath);
        __pContext->__installDir = newInstallPath;
-
-       pPackageInfoImpl = __pContext->GetPackageInfoImpl();
-       pPackageInfoImpl->SetAppRootPath(newInstallPath);
+       __pContext->__rootPath = newInstallPath;
 
        AppLog("UnzipTo - START");
        unzipper.UnzipTo(newInstallPath);
index aed5246..506e959 100755 (executable)
  * @brief      This is the implementation file for %ManifestGenerator class.
  */
 
+#include <unique_ptr.h>
 #include <sys/stat.h>
 
 #include <FLclLocale.h>
 #include <FApp_Aul.h>
-#include <FAppPkg_PackageInfoImpl.h>
 #include <FIoFile.h>
 
 #include "ManifestGenerator.h"
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::App;
-using namespace Tizen::App::Package;
 using namespace Tizen::Locales;
 using namespace Tizen::Io;
 
 ManifestGenerator::ManifestGenerator(void)
 :__pContext(null)
-,__pPackageInfoImpl(null)
 ,__pWriter(null)
 {
 }
@@ -53,8 +51,6 @@ bool
 ManifestGenerator::Construct(InstallationContext* pContext)
 {
        __pContext = pContext;
-       __pPackageInfoImpl = pContext->GetPackageInfoImpl();
-       TryReturn(__pPackageInfoImpl, false, "__pPackageInfoImpl is null.");
 
        __pWriter = new (std::nothrow) XmlWriter;
        TryReturn(__pWriter, false, "__pWriter is null.");
@@ -80,94 +76,74 @@ ManifestGenerator::Write()
 
        __pWriter->StartElement("manifest");
        __pWriter->WriteAttribute("xmlns", "http://tizen.org/ns/packages");
-       __pWriter->WriteAttribute("package", __pContext->GetId());
+       __pWriter->WriteAttribute("package", __pContext->__packageId);
        __pWriter->WriteAttribute("type", "tpk");
-       __pWriter->WriteAttribute("version", __pPackageInfoImpl->GetVersion());
+       __pWriter->WriteAttribute("version", __pContext->__version);
        __pWriter->WriteAttribute("install-location", location);
 
        __pWriter->StartElement("label");
-       __pWriter->WriteString(__pPackageInfoImpl->GetDisplayName());
+       __pWriter->WriteString(__pContext->__displayName);
        __pWriter->EndElement();
 
        __pWriter->StartElement("author");
        __pWriter->EndElement();
 
        __pWriter->StartElement("description");
-       __pWriter->WriteString(__pPackageInfoImpl->GetDescription());
+       __pWriter->WriteString(__pContext->__description);
        __pWriter->EndElement();
 
-       ArrayList* pAppList = __pPackageInfoImpl->GetAppInfoList();
-       int appCount = pAppList->GetCount();
+       IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
+       TryReturn(pAppDataList, false, "pAppDataList is null");
+
+       int appCount = pAppDataList->GetCount();
        AppLog("Write(): appCount=%d", appCount);
 
        for (int i = 0 ; i < appCount; i++)
        {
-               _PackageAppInfoImpl* pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pAppList->GetAt(i));
-               if (pAppInfoImpl)
+               AppData* pAppData = null;
+               pAppDataList->GetAt(i, pAppData);
+               TryReturn(pAppData, false, "pAppData is null");
+
+               WriteApp(i, pAppData);
+
+               if (pAppData->__isSubMode == true)
                {
-                       WriteApp(i, pAppInfoImpl);
+                       AppLog("Write(): pAppData->__isSubMode is detected");
+                       WriteSubModeApp(i, pAppData);
                }
        }
 
-       if (__pContext->__isSubMode == true)
-       {
-               AppLog("Write(): __pContext->__isSubMode is detected");
-               WriteSubModeApp(appCount);
-       }
-
        __pWriter->EndElement();
 
        return true;
 }
 
-bool
-ManifestGenerator::FindFeatureValue(ArrayList* pFeatureList, const String& feature, const String& value) const
-{
-       TryReturn(pFeatureList, false, "pFeatureList is null.");
-
-       _AppFeatureInfoImpl* pFeature = null;
-
-       for (int i = 0 ; i < pFeatureList->GetCount(); i++)
-       {
-               pFeature = dynamic_cast<_AppFeatureInfoImpl*>(pFeatureList->GetAt(i));
-               if (pFeature)
-               {
-                       if ((pFeature->GetName() == feature) && (pFeature->GetValue() == value))
-                       {
-                               AppLog("Find - feature=[%ls], value=[%ls]", feature.GetPointer(), value.GetPointer());
-                               return true;
-                       }
-               }
-       }
-
-       return false;
-}
-
 String
-ManifestGenerator::GetGlFrameValue(ArrayList* pFeatureList) const
+ManifestGenerator::GetGlFrameValue(HashMap* pFeatureList) const
 {
        if (pFeatureList == null)
        {
                return "use-system-setting";
        }
 
-       _AppFeatureInfoImpl* pFeature = null;
-       for (int i = 0 ; i < pFeatureList->GetCount(); i++)
+       std::unique_ptr< IMapEnumerator > pEnum(pFeatureList->GetMapEnumeratorN());
+       TryReturn(pEnum, "use-system-setting", "GetMapEnumeratorN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+       while (pEnum->MoveNext() == E_SUCCESS)
        {
-               pFeature = dynamic_cast<_AppFeatureInfoImpl*>(pFeatureList->GetAt(i));
-               if (pFeature == null)
-               {
-                       return "use-system-setting";
-               }
+               String* pKey = static_cast< String* > (pEnum->GetKey());
+               TryReturn(pEnum, "use-system-setting", "GetKey() failed. [%s]", GetErrorMessage(GetLastResult()));
 
-               if (pFeature->GetName() == L"HwAcceleration" || pFeature->GetName() == L"GlFrame")
+               if ((*pKey) == L"HwAcceleration" || (*pKey) == L"GlFrame")
                {
-                       String value = pFeature->GetValue();
-                       if (value == L"On")
+                       String* pValue = static_cast< String* > (pEnum->GetValue());
+                       TryReturn(pEnum, "use-system-setting", "GetValue() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+                       if ((*pValue) == L"On")
                        {
                                return "use-GL";
                        }
-                       else if (value == L"Off")
+                       else if ((*pValue) == L"Off")
                        {
                                return "not-use-GL";
                        }
@@ -221,7 +197,7 @@ ManifestGenerator::WriteLanguageValue(IMap* pList, const String& element) const
 }
 
 bool
-ManifestGenerator::WriteLiveboxes(_PackageAppInfoImpl* pAppInfoImpl) const
+ManifestGenerator::WriteLiveboxes(AppData* pAppData) const
 {
        TryReturn(__pContext, false, "__pContext is null.");
        TryReturn(__pWriter, false, "__pWriter is null.");
@@ -252,7 +228,7 @@ ManifestGenerator::WriteLiveboxes(_PackageAppInfoImpl* pAppInfoImpl) const
 
                __pWriter->StartElement("livebox");
 
-               __pWriter->WriteAttribute("appid", pAppInfoImpl->GetPackageName() + "." + pLiveboxData->GetProviderName());
+               __pWriter->WriteAttribute("appid", pAppData->__appId + "." + pLiveboxData->GetProviderName());
                __pWriter->WriteAttribute("period", period);
                __pWriter->WriteAttribute("pinup", "false");
 
@@ -267,11 +243,11 @@ ManifestGenerator::WriteLiveboxes(_PackageAppInfoImpl* pAppInfoImpl) const
 
                WriteLanguageValue(pLiveboxNameList, label);
 
-               String menuIcon = pAppInfoImpl->GetMainmenuIcon();
+               String menuIcon = pAppData->__mainmenuIcon;
                if (menuIcon.IsEmpty() == false)
                {
                        String menuIconPath;
-                       menuIconPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, menuIcon.GetPointer());
+                       menuIconPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_SHARED_RES, menuIcon.GetPointer());
 
                        __pWriter->StartElement("icon");
                        __pWriter->WriteString(menuIconPath);
@@ -285,7 +261,7 @@ ManifestGenerator::WriteLiveboxes(_PackageAppInfoImpl* pAppInfoImpl) const
                        __pWriter->StartElement("box");
                        __pWriter->WriteAttribute("type", "buffer");
 
-                       previewDir.Format(1024, L"%ls%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES);
+                       previewDir.Format(1024, L"%ls%ls", __pContext->__rootPath.GetPointer(), DIR_SHARED_RES);
                        WriteLiveboxSizeValue(pSizeList, "size", previewDir);
 
                        __pWriter->EndElement();
@@ -324,7 +300,6 @@ ManifestGenerator::WriteLiveboxSizeValue(IMap* pList, const String& element, con
        IMapEnumerator* pMapEnum = pList->GetMapEnumeratorN();
        TryReturn(pMapEnum, true, "pMapEnum is null.");
 
-       int count = 0;
        while (pMapEnum->MoveNext() == E_SUCCESS)
        {
                String* pSize = static_cast<String*> (pMapEnum->GetKey());
@@ -346,14 +321,15 @@ ManifestGenerator::WriteLiveboxSizeValue(IMap* pList, const String& element, con
 }
 
 bool
-ManifestGenerator::WriteAppControl(_PackageAppInfoImpl* pAppInfoImpl) const
+ManifestGenerator::WriteAppControl(AppData* pAppData) const
 {
-       TryReturn(pAppInfoImpl, false, "pAppInfoImpl is null.");
+       TryReturn(pAppData, false, "pAppData is null.");
 
-       ArrayList* pAppControlImplList = pAppInfoImpl->GetAppControlList();
+       IListT<_AppControlInfo*>* pAppControlImplList = pAppData->__pAppControlImplList;
        TryReturn(pAppControlImplList, false, "pAppControlImplList is null.");
 
-       _AppControlInfoImpl* pAppControl = dynamic_cast<_AppControlInfoImpl*>(pAppControlImplList->GetAt(0));
+       _AppControlInfo* pAppControl = null;
+       pAppControlImplList->GetAt(0, pAppControl);
        TryReturn(pAppControl, false, "pAppControl is null.");
 
        ArrayList* pCapabilityList = pAppControl->GetCapabilityList();
@@ -362,7 +338,7 @@ ManifestGenerator::WriteAppControl(_PackageAppInfoImpl* pAppInfoImpl) const
        int capaCount = pCapabilityList->GetCount();
        for (int capaIndex = 0 ; capaIndex < capaCount; capaIndex++)
        {
-               _AppControlCapabilityInfoImpl* pCapability = dynamic_cast<_AppControlCapabilityInfoImpl*>(pCapabilityList->GetAt(capaIndex));
+               _AppControlCapabilityInfo* pCapability = dynamic_cast<_AppControlCapabilityInfo*>(pCapabilityList->GetAt(capaIndex));
                if (pCapability == null) continue;
 
                String operationId = pCapability->GetOperationId();
@@ -387,7 +363,7 @@ ManifestGenerator::WriteAppControl(_PackageAppInfoImpl* pAppInfoImpl) const
                        __pWriter->WriteAttribute("name", operationId);
                        __pWriter->EndElement();
 
-                       _AppControlResolutionInfoImpl* pResolution = dynamic_cast <_AppControlResolutionInfoImpl*>(pResolutionList->GetAt(resIndex));
+                       _AppControlResolutionInfo* pResolution = dynamic_cast <_AppControlResolutionInfo*>(pResolutionList->GetAt(resIndex));
                        if (pResolution == null) continue;
 
                        String* pUriScheme = pResolution->GetUriScheme();
@@ -475,22 +451,22 @@ ManifestGenerator::FindCategory(int index, const String& category) const
 }
 
 bool
-ManifestGenerator::WriteApp(int index, Tizen::App::Package::_PackageAppInfoImpl* pAppInfoImpl)
+ManifestGenerator::WriteApp(int index, AppData* pAppData)
 {
-       IMap* pNameList = pAppInfoImpl->GetNameList();
+       IMap* pNameList = pAppData->__pNameList;
        String label("label");
        String type("c++app");
        String binaryPath;
-       binaryPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_BIN, pAppInfoImpl->GetName().GetPointer());
+       binaryPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_BIN, pAppData->__name.GetPointer());
 
-       if (pAppInfoImpl->GetDefault() == L"True")
+       if (pAppData->__main == L"True")
        {
                WriteLanguageValue(pNameList, label);
 
-               if (pAppInfoImpl->GetMainmenuIcon().IsEmpty() == false)
+               if (pAppData->__mainmenuIcon.IsEmpty() == false)
                {
                        String iconPath;
-                       iconPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, pAppInfoImpl->GetMainmenuIcon().GetPointer());
+                       iconPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_SHARED_RES, pAppData->__mainmenuIcon.GetPointer());
 
                        __pWriter->StartElement("icon");
                        __pWriter->WriteString(iconPath);
@@ -503,11 +479,11 @@ ManifestGenerator::WriteApp(int index, Tizen::App::Package::_PackageAppInfoImpl*
        String category;
        String mainapp("true");
 
-       if (pAppInfoImpl->GetType() == L"UiApp")
+       if (pAppData->__type == L"UiApp")
        {
                taskmanage = L"true";
 
-               if (pAppInfoImpl->IsMainmenuVisible() == true)
+               if (pAppData->__mainmenuVisible == true)
                {
                        nodisplay = L"false";
                        taskmanage = L"true";
@@ -549,16 +525,16 @@ ManifestGenerator::WriteApp(int index, Tizen::App::Package::_PackageAppInfoImpl*
                }
        }
 
-       if (pAppInfoImpl->GetDefault() != L"True")
+       if (pAppData->__main != L"True")
        {
                mainapp = L"false";
        }
 
-       ArrayList* pFeatureList = pAppInfoImpl->GetAppFeatureList();
+       HashMap* pFeatureList = pAppData->__pFeatureList;
        String glFrame = GetGlFrameValue(pFeatureList);
 
        __pWriter->StartElement("ui-application");
-       __pWriter->WriteAttribute("appid", pAppInfoImpl->GetPackageName());
+       __pWriter->WriteAttribute("appid", pAppData->__appId);
        __pWriter->WriteAttribute("exec", binaryPath);
        __pWriter->WriteAttribute("nodisplay", nodisplay);
        __pWriter->WriteAttribute("taskmanage", taskmanage);
@@ -623,20 +599,20 @@ ManifestGenerator::WriteApp(int index, Tizen::App::Package::_PackageAppInfoImpl*
 
        WriteLanguageValue(pNameList, label);
 
-       if (pAppInfoImpl->GetMainmenuIcon().IsEmpty() == false)
+       if (pAppData->__mainmenuIcon.IsEmpty() == false)
        {
                String iconPath;
-               iconPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, pAppInfoImpl->GetMainmenuIcon().GetPointer());
+               iconPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_SHARED_RES, pAppData->__mainmenuIcon.GetPointer());
 
                __pWriter->StartElement("icon");
                __pWriter->WriteString(iconPath);
                __pWriter->EndElement();
        }
 
-       if (pAppInfoImpl->GetSettingIcon().IsEmpty() == false)
+       if (pAppData->__settingIcon.IsEmpty() == false)
        {
                String iconPath;
-               iconPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, pAppInfoImpl->GetSettingIcon().GetPointer());
+               iconPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_SHARED_RES, pAppData->__settingIcon.GetPointer());
 
                __pWriter->StartElement("icon");
                __pWriter->WriteAttribute("section", "setting");
@@ -644,10 +620,10 @@ ManifestGenerator::WriteApp(int index, Tizen::App::Package::_PackageAppInfoImpl*
                __pWriter->EndElement();
        }
 
-       if (pAppInfoImpl->GetQuickpanelIcon().IsEmpty() == false)
+       if (pAppData->__notificationIcon.IsEmpty() == false)
        {
                String iconPath;
-               iconPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, pAppInfoImpl->GetQuickpanelIcon().GetPointer());
+               iconPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_SHARED_RES, pAppData->__notificationIcon.GetPointer());
 
                __pWriter->StartElement("icon");
                __pWriter->WriteAttribute("section", "notification");
@@ -655,17 +631,10 @@ ManifestGenerator::WriteApp(int index, Tizen::App::Package::_PackageAppInfoImpl*
                __pWriter->EndElement();
        }
 
-       IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
-       TryReturn(pAppDataList, false, "pAppDataList is null");
-
-       AppData* pAppData = null;
-       pAppDataList->GetAt(index, pAppData);
-       TryReturn(pAppData, false, "pAppData is null");
-
        if (pAppData->__legacyAppControls == true)
        {
                AppLog("Write(): AppControls spec is legacy");
-               WriteAppControl(pAppInfoImpl);
+               WriteAppControl(pAppData);
        }
        else
        {
@@ -674,9 +643,9 @@ ManifestGenerator::WriteApp(int index, Tizen::App::Package::_PackageAppInfoImpl*
 
        __pWriter->EndElement();
 
-       if (pAppInfoImpl->GetType() == L"ServiceApp")
+       if (pAppData->__type == L"ServiceApp")
        {
-               WriteLiveboxes(pAppInfoImpl);
+               WriteLiveboxes(pAppData);
        }
 
        WriteAccounts(index);
@@ -685,14 +654,14 @@ ManifestGenerator::WriteApp(int index, Tizen::App::Package::_PackageAppInfoImpl*
 }
 
 bool
-ManifestGenerator::WriteSubModeApp(int index)
+ManifestGenerator::WriteSubModeApp(int index, AppData* pAppData)
 {
        // SUB_MODE_APPCONTROL_NAME -> AppName
        String subBinaryPath;
-       subBinaryPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_BIN, SUB_MODE_APPCONTROL_NAME);
+       subBinaryPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_BIN, SUB_MODE_APPCONTROL_NAME);
 
        String binaryPath;
-       binaryPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_BIN, __pContext->__subModeAppName.GetPointer());
+       binaryPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_BIN, pAppData->__subModeAppName.GetPointer());
 
        if (File::IsFileExist(subBinaryPath) == true)
        {
@@ -710,16 +679,7 @@ ManifestGenerator::WriteSubModeApp(int index)
        }
        InstallerUtil::CreateSymlink(binaryExecPath, subBinaryExecPath);
 
-       IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
-       TryReturn(pAppDataList, false, "pAppDataList is null");
-
-       AppLog("WriteSubModeApp(): appCount=%d", pAppDataList->GetCount());
-
-       AppData* pAppData = null;
-       pAppDataList->GetAt(index, pAppData);
-       TryReturn(pAppData, false, "pAppData is null");
-
-       PackageId packageId = __pContext->GetId();
+       PackageId packageId = __pContext->__packageId;
        AppId appId = packageId + L"." + SUB_MODE_APPCONTROL_NAME;
 
        __pWriter->StartElement("ui-application");
@@ -731,25 +691,20 @@ ManifestGenerator::WriteSubModeApp(int index)
        __pWriter->WriteAttribute("type", "c++app");
 
        __pWriter->StartElement("label");
-       __pWriter->WriteString(__pPackageInfoImpl->GetDisplayName());
+       __pWriter->WriteString(__pContext->__displayName);
        __pWriter->EndElement();
 
-       ArrayList* pAppList = __pPackageInfoImpl->GetAppInfoList();
-       _PackageAppInfoImpl* pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pAppList->GetAt(0));
-       if (pAppInfoImpl)
+       if (pAppData->__mainmenuIcon.IsEmpty() == false)
        {
-               if (pAppInfoImpl->GetMainmenuIcon().IsEmpty() == false)
-               {
-                       String iconPath;
-                       iconPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, pAppInfoImpl->GetMainmenuIcon().GetPointer());
+               String iconPath;
+               iconPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_SHARED_RES, pAppData->__mainmenuIcon.GetPointer());
 
-                       __pWriter->StartElement("icon");
-                       __pWriter->WriteString(iconPath);
-                       __pWriter->EndElement();
-               }
+               __pWriter->StartElement("icon");
+               __pWriter->WriteString(iconPath);
+               __pWriter->EndElement();
        }
 
-       WriteAppControl(index);
+       WriteAppControl(index, true);
 
        __pWriter->EndElement();        // end of "ui-application"
 
@@ -757,7 +712,7 @@ ManifestGenerator::WriteSubModeApp(int index)
 }
 
 bool
-ManifestGenerator::WriteAppControl(int index)
+ManifestGenerator::WriteAppControl(int index, bool subMode)
 {
        IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
        TryReturn(pAppDataList, false, "pAppDataList is null");
@@ -766,8 +721,18 @@ ManifestGenerator::WriteAppControl(int index)
        pAppDataList->GetAt(index, pAppData);
        TryReturn(pAppData, false, "pAppData is null");
 
-       IListT<AppControlData*>* pAppControlDataList = pAppData->__pAppControlDataList;
-       TryReturn(pAppControlDataList, false, "pAppControlDataList is null");
+       IListT<AppControlData*>* pAppControlDataList = null;
+
+       if (subMode == false)
+       {
+               pAppControlDataList = pAppData->__pAppControlDataList;
+               TryReturn(pAppControlDataList, false, "pAppControlDataList is null");
+       }
+       else
+       {
+               pAppControlDataList = pAppData->__pSubModeAppControlDataList;
+               TryReturn(pAppControlDataList, false, "pAppControlDataList is null");
+       }
 
        for (int i = 0; i < pAppControlDataList->GetCount(); i++)
        {
@@ -866,7 +831,7 @@ ManifestGenerator::WriteAccounts(int index)
                if (accountIcon.IsEmpty() == false)
                {
                        String accountIconPath;
-                       accountIconPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, accountIcon.GetPointer());
+                       accountIconPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_SHARED_RES, accountIcon.GetPointer());
 
                        __pWriter->StartElement("icon");
                        __pWriter->WriteAttribute("section", "account");
@@ -878,7 +843,7 @@ ManifestGenerator::WriteAccounts(int index)
                if (accountSmallIcon.IsEmpty() == false)
                {
                        String accountSmallIconPath;
-                       accountSmallIconPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, accountSmallIcon.GetPointer());
+                       accountSmallIconPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_SHARED_RES, accountSmallIcon.GetPointer());
 
                        __pWriter->StartElement("icon");
                        __pWriter->WriteAttribute("section", "account-small");
index 621a022..c3cda00 100755 (executable)
@@ -23,9 +23,6 @@
 #ifndef _MANIFEST_GENERATOR_H_
 #define _MANIFEST_GENERATOR_H_
 
-#include <FAppPkg_PackageInfoImpl.h>
-#include <FAppPkg_PackageAppInfoImpl.h>
-
 #include "InstallationContext.h"
 #include "XmlWriter.h"
 
@@ -50,24 +47,22 @@ private:
        ManifestGenerator(const ManifestGenerator& value);
        ManifestGenerator& operator =(const ManifestGenerator& source);
 
-       bool FindFeatureValue(Tizen::Base::Collection::ArrayList* pFeatureList, const Tizen::Base::String& feature, const Tizen::Base::String& value) const;
        bool WriteLanguageValue(Tizen::Base::Collection::IMap* pList, const Tizen::Base::String& label) const;
-       bool WriteLiveboxes(Tizen::App::Package::_PackageAppInfoImpl* pAppInfoImpl) const;
+       bool WriteLiveboxes(AppData* pAppData) const;
        bool WriteLiveboxSizeValue(Tizen::Base::Collection::IMap* pList, const Tizen::Base::String& element, const Tizen::Base::String& previewDir) const;
-       bool WriteAppControl(Tizen::App::Package::_PackageAppInfoImpl* pAppInfoImpl) const;
-       Tizen::Base::String GetGlFrameValue(Tizen::Base::Collection::ArrayList* pFeatureList) const;
+       bool WriteAppControl(AppData* pAppData) const;
+       Tizen::Base::String GetGlFrameValue(Tizen::Base::Collection::HashMap* pFeatureList) const;
 
        bool WriteCategory(int index) const;
        bool FindCategory(int index, const Tizen::Base::String& category) const;
 
-       bool WriteApp(int index, Tizen::App::Package::_PackageAppInfoImpl* pAppInfoImpl);
-       bool WriteSubModeApp(int index);
-       bool WriteAppControl(int index);
+       bool WriteApp(int index, AppData* pAppData);
+       bool WriteSubModeApp(int index, AppData* pAppData);
+       bool WriteAppControl(int index, bool subMode = false);
        bool WriteAccounts(int index);
 
 private:
        InstallationContext* __pContext;
-       Tizen::App::Package::_PackageInfoImpl* __pPackageInfoImpl;
        XmlWriter* __pWriter;
 
 }; // ManifestGenerator
index 9f58b52..b26d7f7 100755 (executable)
@@ -21,7 +21,6 @@
 
 #include <FIoFile.h>
 #include <FSys_SystemInfoImpl.h>
-#include <FAppPkg_PackageInfoImpl.h>
 #include <FBase_StringConverter.h>
 
 #include "ManifestHandler.h"
@@ -34,7 +33,7 @@
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Base::Utility;
-using namespace Tizen::App::Package;
+using namespace Tizen::App;
 using namespace Tizen::Io;
 using namespace Tizen::System;
 
@@ -42,15 +41,11 @@ ManifestHandler::ManifestHandler(void)
 :__pContext(null)
 ,__pPrivilegeList(null)
 ,__pContentDataList(null)
-,__pPackageInfoImpl(null)
-,__pPackageAppInfoImpl(null)
 ,__pAppControlInfoImpl(null)
 ,__pAppControlCapabilityInfoImpl(null)
 ,__pAppControlResolutionInfoImpl(null)
-,__pDataControlInfoImpl(null)
-,__pDataControlTypeImpl(null)
-,__pLaunchConditionImpl(null)
-,__pNotificationImpl(null)
+,__pDataControlInfo(null)
+,__pDataControlType(null)
 ,__pContentData(null)
 ,__pDefaultIconType(null)
 ,__isDefaultMainmenu(false)
@@ -61,8 +56,8 @@ ManifestHandler::ManifestHandler(void)
 ,__isDefaultName(false)
 ,__isDefaultAppDetected(false)
 ,__pAppData(null)
-,__pSubModeAppControlDataList(null)
 ,__isParserMode(false)
+,__pParser(null)
 {
 }
 
@@ -70,19 +65,12 @@ ManifestHandler::~ManifestHandler(void)
 {
        delete[] __pDefaultIconType;
        __pDefaultIconType = null;
-
-       if (__pPackageAppInfoImpl)
-       {
-               delete __pPackageAppInfoImpl;
-               __pPackageAppInfoImpl = null;
-       }
 }
 
 bool
 ManifestHandler::Construct(InstallationContext* pContext)
 {
        __pContext = pContext;
-       __pPackageInfoImpl = pContext->GetPackageInfoImpl();
 
        return true;
 }
@@ -229,14 +217,6 @@ ManifestHandler::OnEndElement(const char *pName)
        {
                status = OnDataControlTypeEndElement();
        }
-       else if (strcasecmp(pName, "Condition") == 0)
-       {
-               status = OnConditionEndElement();
-       }
-       else if (strcasecmp(pName, "Notification") == 0)
-       {
-               status = OnNotificationEndElement();
-       }
        else if (strcasecmp(pName, "Apps") == 0)
        {
                status = OnAppsEndElement();
@@ -371,12 +351,12 @@ ManifestHandler::OnPrivilegesStartElement(void)
 bool
 ManifestHandler::OnUiAppStartElement(void)
 {
-       __pPackageAppInfoImpl = new (std::nothrow) _PackageAppInfoImpl;
-       TryReturn(__pPackageAppInfoImpl, false, "__pPackageAppInfoImpl is null");
-
        __pAppData = new (std::nothrow) AppData;
        TryReturn(__pAppData, false, "__pAppData is null");
 
+       InstallerError error = __pAppData->Construct();
+       TryReturn(error == INSTALLER_ERROR_NONE, false, "pAppData->Construct() failed.");
+
        AppLog("<UiApp>");
 
        XmlAttribute *pAttr = GetAttribute();
@@ -390,12 +370,12 @@ ManifestHandler::OnUiAppStartElement(void)
 bool
 ManifestHandler::OnServiceAppStartElement(void)
 {
-       __pPackageAppInfoImpl = new (std::nothrow) _PackageAppInfoImpl;
-       TryReturn(__pPackageAppInfoImpl, false, "__pPackageAppInfoImpl is null");
-
        __pAppData = new (std::nothrow) AppData;
        TryReturn(__pAppData, false, "__pAppData is null");
 
+       InstallerError error = __pAppData->Construct();
+       TryReturn(error == INSTALLER_ERROR_NONE, false, "pAppData->Construct() failed.");
+
        AppLog("<ServiceApp>");
 
        XmlAttribute *pAttr = GetAttribute();
@@ -446,9 +426,9 @@ bool
 ManifestHandler::OnUiScalabilityStartElement(void)
 {
        XmlAttribute *pAttr = null;
-       char *pCoordinateSystem = null;
-       char *pBaseScreenSize = null;
-       char *pLogicalCoordinate = null;
+       charpCoordinateSystem = null;
+       charpBaseScreenSize = null;
+       charpLogicalCoordinate = null;
 
        AppLog("<UiScalability>");
 
@@ -458,42 +438,36 @@ ManifestHandler::OnUiScalabilityStartElement(void)
        pCoordinateSystem = pAttr->Find("CoordinateSystem");
        if (pCoordinateSystem)
        {
-               _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl;
-               TryReturn(pAppFeatureInfo, false, "pAppFeatureInfo is null");
-
-               pAppFeatureInfo->SetName("CoordinateSystem");
-               pAppFeatureInfo->SetValue(pCoordinateSystem);
-
-               __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
+               String* pKey = new (std::nothrow) String("CoordinateSystem");
+               TryReturn(pKey, false, "pKey is null");
+               String* pValue = new (std::nothrow) String(pCoordinateSystem);
+               TryReturn(pValue, false, "pValue is null");
 
+               __pAppData->__pFeatureList->Add(pKey, pValue);
                AppLog("<CoordinateSystem=%s>", pCoordinateSystem);
        }
 
        pBaseScreenSize = pAttr->Find("BaseScreenSize");
        if (pBaseScreenSize)
        {
-               _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl;
-               TryReturn(pAppFeatureInfo, false, "pAppFeatureInfo is null");
-
-               pAppFeatureInfo->SetName("BaseScreenSize");
-               pAppFeatureInfo->SetValue(pBaseScreenSize);
-
-               __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
+               String* pKey = new (std::nothrow) String("BaseScreenSize");
+               TryReturn(pKey, false, "pKey is null");
+               String* pValue = new (std::nothrow) String(pBaseScreenSize);
+               TryReturn(pValue, false, "pValue is null");
 
+               __pAppData->__pFeatureList->Add(pKey, pValue);
                AppLog("<BaseScreenSize=%s>", pBaseScreenSize);
        }
 
        pLogicalCoordinate = pAttr->Find("LogicalCoordinate");
        if (pLogicalCoordinate)
        {
-               _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl;
-               TryReturn(pAppFeatureInfo, false, "pAppFeatureInfo is null");
-
-               pAppFeatureInfo->SetName("LogicalCoordinate");
-               pAppFeatureInfo->SetValue(pLogicalCoordinate);
-
-               __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
+               String* pKey = new (std::nothrow) String("LogicalCoordinate");
+               TryReturn(pKey, false, "pKey is null");
+               String* pValue = new (std::nothrow) String(pLogicalCoordinate);
+               TryReturn(pValue, false, "pValue is null");
 
+               __pAppData->__pFeatureList->Add(pKey, pValue);
                AppLog("<LogicalCoordinate=%s>", pLogicalCoordinate);
        }
 
@@ -515,40 +489,35 @@ ManifestHandler::OnUiThemeStartElement(void)
        pSystemTheme = pAttr->Find("SystemTheme");
        if (pSystemTheme)
        {
-               _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl;
-               TryReturn(pAppFeatureInfo, false, "pAppFeatureInfo is null");
-
-               pAppFeatureInfo->SetName("SystemTheme");
-               pAppFeatureInfo->SetValue(pSystemTheme);
-
-               __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
+               String* pKey = new (std::nothrow) String("SystemTheme");
+               TryReturn(pKey, false, "pKey is null");
+               String* pValue = new (std::nothrow) String(pSystemTheme);
+               TryReturn(pValue, false, "pValue is null");
 
+               __pAppData->__pFeatureList->Add(pKey, pValue);
                AppLog("<SystemTheme=%s>", pSystemTheme);
        }
 
        pUserDefinedTheme = pAttr->Find("UserDefinedTheme");
        if (pUserDefinedTheme)
        {
-               _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl;
-               TryReturn(pAppFeatureInfo, false, "pAppFeatureInfo is null");
-
-               pAppFeatureInfo->SetName("UserDefinedTheme");
-               pAppFeatureInfo->SetValue(pUserDefinedTheme);
-
-               __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
+               String* pKey = new (std::nothrow) String("UserDefinedTheme");
+               TryReturn(pKey, false, "pKey is null");
+               String* pValue = new (std::nothrow) String(pUserDefinedTheme);
+               TryReturn(pValue, false, "pValue is null");
 
+               __pAppData->__pFeatureList->Add(pKey, pValue);
                AppLog("<UserDefinedTheme=%s>", pUserDefinedTheme);
        }
 
        return true;
 }
 
-
 bool
 ManifestHandler::OnDataControlStartElement(void)
 {
-       XmlAttribute *pAttr = null;
-       char *pProviderId = null;
+       XmlAttributepAttr = null;
+       charpProviderId = null;
 
        pAttr = GetAttribute();
        TryReturn(pAttr, true, "pAttr is null");
@@ -556,10 +525,10 @@ ManifestHandler::OnDataControlStartElement(void)
        pProviderId = pAttr->Find("ProviderId");
        TryReturn(pProviderId, true, "pProviderId is null");
 
-       __pDataControlInfoImpl = new (std::nothrow) _DataControlInfoImpl;
-       TryReturn(__pDataControlInfoImpl, false, "__pDataControlInfoImpl is null");
+       __pDataControlInfo = new (std::nothrow) DataControlInfo;
+       TryReturn(__pDataControlInfo, false, "__pDataControlInfo is null");
 
-       __pDataControlInfoImpl->SetProviderId(pProviderId);
+       __pDataControlInfo->__providerId = pProviderId;
 
        AppLog("<DataControl ProviderId=\"%s\">", pProviderId);
 
@@ -666,11 +635,12 @@ ManifestHandler::OnPrivilegesEndElement(void)
                result r = E_SUCCESS;
                String privileges;
                String hmacPrivileges;
-               String appId = __pPackageInfoImpl->GetId();
-               r = PrivilegeHandler::GenerateCipherPrivilege(appId, *__pPrivilegeList, privileges, hmacPrivileges);
+               PackageId packageId = __pContext->__packageId;
+               r = PrivilegeHandler::GenerateCipherPrivilege(packageId, *__pPrivilegeList, privileges, hmacPrivileges);
                TryReturn(!IsFailed(r), false, "privMgr.GeneratePrivilegeString() failed");
 
-               __pPackageInfoImpl->SetPrivilegesValue(privileges, hmacPrivileges);
+               __pContext->__privileges = privileges;
+               __pContext->__hmacPrivileges = hmacPrivileges;
        }
 
        __pContext->SetPrivilegeList(__pPrivilegeList);
@@ -683,16 +653,13 @@ ManifestHandler::OnPrivilegesEndElement(void)
 bool
 ManifestHandler::OnUiAppEndElement(void)
 {
-       if (__pContext->__isSubMode == true)
+       if (__pAppData->__isSubMode == true)
        {
-               __pSubModeAppControlDataList = __pAppData->__pAppControlDataList;
+               __pAppData->__pSubModeAppControlDataList = __pAppData->__pAppControlDataList;
                __pAppData->__pAppControlDataList = null;
-               __pContext->__subModeAppName = __pPackageAppInfoImpl->GetName();
+               __pAppData->__subModeAppName = __pAppData->__name;
        }
 
-       __pPackageInfoImpl->AddAppInfo(*__pPackageAppInfoImpl);
-       __pPackageAppInfoImpl = null;
-
        __isDefaultName = false;
 
        __pContext->__pAppDataList->Add(__pAppData);
@@ -706,16 +673,13 @@ ManifestHandler::OnUiAppEndElement(void)
 bool
 ManifestHandler::OnServiceAppEndElement(void)
 {
-       if (__pContext->__isSubMode == true)
+       if (__pAppData->__isSubMode == true)
        {
-               __pSubModeAppControlDataList = __pAppData->__pAppControlDataList;
+               __pAppData->__pSubModeAppControlDataList = __pAppData->__pAppControlDataList;
                __pAppData->__pAppControlDataList = null;
-               __pContext->__subModeAppName = __pPackageAppInfoImpl->GetName();
+               __pAppData->__subModeAppName = __pAppData->__name;
        }
 
-       __pPackageInfoImpl->AddAppInfo(*__pPackageAppInfoImpl);
-       __pPackageAppInfoImpl = null;
-
        __isDefaultName = false;
 
        __pContext->__pAppDataList->Add(__pAppData);
@@ -729,17 +693,6 @@ ManifestHandler::OnServiceAppEndElement(void)
 bool
 ManifestHandler::OnAppsEndElement(void)
 {
-       if (__pContext->__isSubMode == true)
-       {
-               __pAppData = new (std::nothrow) AppData;
-               TryReturn(__pAppData, false, "__pAppData is null");
-
-               __pAppData->__pAppControlDataList = __pSubModeAppControlDataList;
-               __pSubModeAppControlDataList = null;
-
-               __pContext->__pAppDataList->Add(__pAppData);
-       }
-
        AppLog("</Apps>");
 
        return true;
@@ -756,8 +709,8 @@ ManifestHandler::OnIconsEndElement(void)
 bool
 ManifestHandler::OnDataControlEndElement(void)
 {
-       __pPackageAppInfoImpl->AddDataControl(__pDataControlInfoImpl);
-       __pDataControlInfoImpl = null;
+       __pAppData->__pDataControlList->Add(__pDataControlInfo);
+       __pDataControlInfo = null;
        AppLog("</DataControl>");
 
        return true;
@@ -766,34 +719,14 @@ ManifestHandler::OnDataControlEndElement(void)
 bool
 ManifestHandler::OnDataControlTypeEndElement(void)
 {
-       __pDataControlInfoImpl->AddControlType(__pDataControlTypeImpl);
-       __pDataControlTypeImpl = null;
+       __pDataControlInfo->__pControlTypeList->Add(__pDataControlType);
+       __pDataControlType = null;
        AppLog("</DataControlType>");
 
        return true;
 }
 
 bool
-ManifestHandler::OnConditionEndElement(void)
-{
-       __pPackageAppInfoImpl->AddLaunchCondition(*__pLaunchConditionImpl);
-       __pLaunchConditionImpl = null;
-       AppLog("</Condition>");
-
-       return true;
-}
-
-bool
-ManifestHandler::OnNotificationEndElement(void)
-{
-       __pPackageAppInfoImpl->AddNotification(*__pNotificationImpl);
-       __pNotificationImpl = null;
-       AppLog("</Notification>");
-
-       return true;
-}
-
-bool
 ManifestHandler::OnContentsEndElement(void)
 {
        __pContext->SetContentDataList(__pContentDataList);
@@ -856,7 +789,7 @@ bool
 ManifestHandler::OnIdValue(const char *pCharacters)
 {
        AppLog("<Id>%s</Id>", pCharacters);
-       __pPackageInfoImpl->SetId(pCharacters);
+       __pContext->__packageId = pCharacters;
 
        return true;
 }
@@ -865,7 +798,7 @@ bool
 ManifestHandler::OnVersionValue(const char *pCharacters)
 {
        AppLog("<Version>%s</Version>", pCharacters);
-       __pPackageInfoImpl->SetVersion(pCharacters);
+       __pContext->__version = pCharacters;
 
        return true;
 }
@@ -874,11 +807,10 @@ bool
 ManifestHandler::OnTypeValue(const char *pCharacters)
 {
        AppLog("<Type>%s</Type>", pCharacters);
-       //__pPackageInfoImpl->SetAppType(pCharacters);
 
        if (strcasecmp(pCharacters, "Contents") == 0)
        {
-               __pPackageInfoImpl->SetAppApiVersion("3.0");
+               __pContext->__apiVersion = L"3.0";
        }
 
        return true;
@@ -887,23 +819,8 @@ ManifestHandler::OnTypeValue(const char *pCharacters)
 bool
 ManifestHandler::OnAuthorValue(const char *pCharacters)
 {
-//     XmlAttribute *pAttr = 0;
-//     char *pAttrValue = 0;
-//
-//     pAttr = GetAttribute();
-//     TryReturn(pAttr, true, "pAttr is null");
-//
-//     pAttrValue = pAttr->Find("Locale");
-//     TryReturn(pAttrValue, true, "pAttrValue is null");
-//
-//     if (strcasecmp(pAttrValue, "eng-GB") == 0 || strcasecmp(pAttrValue, "eng-US") == 0)
-//     {
-//             // Set default name
-//             __pPackageInfoImpl->SetAppVendor(pCharacters);
-//     }
-
        AppLog("<Author>%s</Author>", pCharacters);
-       __pPackageInfoImpl->SetAuthor(pCharacters);
+       __pContext->__author = pCharacters;
 
        return true;
 }
@@ -911,7 +828,7 @@ ManifestHandler::OnAuthorValue(const char *pCharacters)
 bool
 ManifestHandler::OnUrlValue(const char *pCharacters)
 {
-       __pPackageInfoImpl->SetUrl(pCharacters);
+       __pContext->__url = pCharacters;
        AppLog("<Url>%s</Url>", pCharacters);
 
        return true;
@@ -920,7 +837,7 @@ ManifestHandler::OnUrlValue(const char *pCharacters)
 bool
 ManifestHandler::OnApiVersionValue(const char *pCharacters)
 {
-       __pPackageInfoImpl->SetAppApiVersion(pCharacters);
+       __pContext->__apiVersion = pCharacters;
        AppLog("<ApiVersion>%s</ApiVersion>", pCharacters);
 
        XmlAttribute *pAttr = GetAttribute();
@@ -1006,15 +923,15 @@ ManifestHandler::OnIconValue(const char *pCharacters)
                {
                        if (strcasecmp(pSection, "MainMenu") == 0)
                        {
-                               __pPackageAppInfoImpl->SetMainmenuIcon(iconRelPath);
+                               __pAppData->__mainmenuIcon = iconRelPath;
                        }
                        else if (strcasecmp(pSection, "Setting") == 0)
                        {
-                               __pPackageAppInfoImpl->SetSettingIcon(iconRelPath);
+                               __pAppData->__settingIcon = iconRelPath;
                        }
                        else if (strcasecmp(pSection, "Notification") == 0)
                        {
-                               __pPackageAppInfoImpl->SetQuickpanelIcon(iconRelPath);
+                               __pAppData->__notificationIcon = iconRelPath;
                        }
                }
                else    // legacy
@@ -1023,7 +940,7 @@ ManifestHandler::OnIconValue(const char *pCharacters)
                        {
                                if (__isDefaultMainmenu == false)
                                {
-                                       __pPackageAppInfoImpl->SetMainmenuIcon(iconRelPath);
+                                       __pAppData->__mainmenuIcon = iconRelPath;
                                }
 
                                if (strcasecmp(pType, __pDefaultIconType) == 0)
@@ -1035,7 +952,7 @@ ManifestHandler::OnIconValue(const char *pCharacters)
                        {
                                if (__isDefaultSetting == false)
                                {
-                                       __pPackageAppInfoImpl->SetSettingIcon(iconRelPath);
+                                       __pAppData->__settingIcon = iconRelPath;
                                }
 
                                if (strcasecmp(pType, __pDefaultIconType) == 0)
@@ -1047,7 +964,7 @@ ManifestHandler::OnIconValue(const char *pCharacters)
                        {
                                if (__isDefaultQuickpanel == false)
                                {
-                                       __pPackageAppInfoImpl->SetQuickpanelIcon(iconRelPath);
+                                       __pAppData->__notificationIcon = iconRelPath;
                                }
 
                                if (strcasecmp(pType, __pDefaultIconType) == 0)
@@ -1087,16 +1004,14 @@ ManifestHandler::OnNameValue(const char *pCharacters)
                {
                        if (__isDefaultName == true)
                        {
-                               __pPackageInfoImpl->SetDisplayName(pCharacters);
+                               __pContext->__displayName = pCharacters;
                        }
                }
 
-               if (__pPackageAppInfoImpl)
-               {
-                       String* pValue = new (std::nothrow) String;
-                       StringUtil::Utf8ToString(pCharacters, *pValue);
-                       __pPackageAppInfoImpl->AddName(*(new (std::nothrow) String(pAttrValue)), *pValue);
-               }
+               String* pValue = new (std::nothrow) String;
+               StringUtil::Utf8ToString(pCharacters, *pValue);
+
+               __pAppData->__pNameList->Add((new (std::nothrow) String(pAttrValue)), pValue);
        }
 
        AppLog("<DisplayName Locale=\"%s\">%s</DisplayName>", pAttrValue, pCharacters);
@@ -1118,8 +1033,7 @@ ManifestHandler::OnDescriptionValue(const char *pCharacters)
 
        if (strcasecmp(pAttrValue, "eng-GB") == 0 || strcasecmp(pAttrValue, "eng-US") == 0)
        {
-               // Set default name
-               __pPackageInfoImpl->SetDescription(pCharacters);
+               __pContext->__description = pCharacters;
        }
 
        AppLog("<Description Locale=\"%s\">%s</Description>", pAttrValue, pCharacters);
@@ -1130,8 +1044,8 @@ ManifestHandler::OnDescriptionValue(const char *pCharacters)
 bool
 ManifestHandler::OnDataControlTypeValue(const char *pCharacters)
 {
-       XmlAttribute *pAttr = null;
-       char *pAccessValue = null;
+       XmlAttributepAttr = null;
+       charpAccessValue = null;
 
        pAttr = GetAttribute();
        TryReturn(pAttr, true, "pAttr is null");
@@ -1139,11 +1053,11 @@ ManifestHandler::OnDataControlTypeValue(const char *pCharacters)
        pAccessValue = pAttr->Find("Access");
        TryReturn(pAccessValue, true, "pAccessValue is null");
 
-       __pDataControlTypeImpl = new (std::nothrow) _DataControlTypeImpl;
-       TryReturn(__pDataControlTypeImpl, false, "__pDataControlTypeImpl is null");
+       __pDataControlType = new (std::nothrow) DataControlType;
+       TryReturn(__pDataControlType, false, "__pDataControlType is null");
 
-       __pDataControlTypeImpl->SetType(pCharacters);
-       __pDataControlTypeImpl->SetAccess(pAccessValue);
+       __pDataControlType->__type = pCharacters;
+       __pDataControlType->__access = pAccessValue;
 
        AppLog("<DataControlType Access=\"%s\", Type=\"%s\">", pAccessValue, pCharacters);
 
@@ -1162,12 +1076,12 @@ ManifestHandler::OnConditionValue(const char *pCharacters)
        pName = pAttr->Find("Name");
        TryReturn(pName, true, "pName is null");
 
-       __pLaunchConditionImpl = new (std::nothrow) _LaunchConditionInfoImpl;
-       TryReturn(__pLaunchConditionImpl, false, "__pLaunchConditionImpl is null");
-
-       __pLaunchConditionImpl->SetName(pName);
-       __pLaunchConditionImpl->SetValue(pCharacters);
+       String* pKey = new (std::nothrow) String(pName);
+       TryReturn(pKey, false, "pKey is null");
+       String* pValue = new (std::nothrow) String(pCharacters);
+       TryReturn(pValue, false, "pValue is null");
 
+       __pAppData->__pLaunchConditionList->Add(pKey, pValue);
        AppLog("<LaunchCondition Name=\"%s\", Value=\"%s\">", pName, pCharacters);
 
        return true;
@@ -1185,12 +1099,6 @@ ManifestHandler::OnNotificationValue(const char *pCharacters)
        pName = pAttr->Find("Name");
        TryReturn(pName, true, "pName is null");
 
-       __pNotificationImpl = new (std::nothrow) _NotificationInfoImpl;
-       TryReturn(__pNotificationImpl, false, "__pNotificationImpl is null");
-
-       __pNotificationImpl->SetName(pName);
-       __pNotificationImpl->SetValue(pCharacters);
-
        AppLog("<Notification Name=\"%s\", Value=\"%s\">", pName, pCharacters);
 
        return true;
@@ -1206,7 +1114,6 @@ ManifestHandler::OnInstallationLocationValue(const char *pCharacters)
        {
                AppLog("INSTALLATION_STORAGE = [EXTERNAL]");
                __pContext->__storage = INSTALLATION_STORAGE_EXTERNAL;
-               __pPackageInfoImpl->SetInstalledInExternalStorage(true);
        }
 
        return true;
@@ -1221,7 +1128,7 @@ ManifestHandler::OnCategoryValue(const char *pCharacters)
 
        if (strcasecmp(pCharacters, TIZEN_CATEGORY_IME) == 0)
        {
-               __pPackageAppInfoImpl->SetAppFeature(CATEGORY_TYPE_IME);
+               __pAppData->__feature = CATEGORY_TYPE_IME;
        }
 
        return true;
@@ -1258,13 +1165,12 @@ ManifestHandler::FindElement(const char *pName)
 bool
 ManifestHandler::AddAppFeature(const Tizen::Base::String& name, const Tizen::Base::String& value)
 {
-       _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl;
-       TryReturn(pAppFeatureInfo, false, "pAppFeatureInfo is null");
-
-       pAppFeatureInfo->SetName(name);
-       pAppFeatureInfo->SetValue(value);
-       __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
+       String* pKey = new (std::nothrow) String(name);
+       TryReturn(pKey, false, "pKey is null");
+       String* pValue = new (std::nothrow) String(value);
+       TryReturn(pValue, false, "pValue is null");
 
+       __pAppData->__pFeatureList->Add(pKey, pValue);
        return true;
 }
 
@@ -1280,8 +1186,8 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp)
        if (pName)
        {
                AppLog(" - Name=%s", pName);
-               __pPackageAppInfoImpl->SetName(pName);
-               __pAppData->__appId = __pPackageInfoImpl->GetId() + L"." + pName;
+               __pAppData->__name = pName;
+               __pAppData->__appId = __pContext->__packageId + L"." + pName;
        }
 
        char* pMain = pAttr->Find("Main");
@@ -1293,8 +1199,7 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp)
        if (pMain)
        {
                AppLog(" - Main=%s", pMain);
-
-               __pPackageAppInfoImpl->SetDefault(pMain);
+               __pAppData->__main = pMain;
 
                if (strcasecmp(pMain, "True") == 0)
                {
@@ -1305,7 +1210,7 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp)
        }
        else
        {
-               __pPackageAppInfoImpl->SetDefault("False");
+               __pAppData->__main = L"False";
        }
 
        char* pHwAcceleration = pAttr->Find("HwAcceleration");
@@ -1343,7 +1248,7 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp)
                }
 
                int categoryType = InstallerUtil::GetCategoryType(pCategory);
-               __pPackageAppInfoImpl->SetAppFeature(categoryType);
+               __pAppData->__feature = categoryType;
        }
 
        char* pSubMode = pAttr->Find("SubMode");
@@ -1351,14 +1256,14 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp)
        {
                if (strcasecmp(pSubMode, "True") == 0)
                {
-                       __pContext->__isSubMode = true;
+                       __pAppData->__isSubMode = true;
                        AppLog(" - SubMode=%s", pSubMode);
                }
        }
 
        if (isUiApp == true)
        {
-               __pPackageAppInfoImpl->SetType("UiApp");
+               __pAppData->__type = L"UiApp";
 
                char* pMenuIconVisible = pAttr->Find("MenuIconVisible");
                if (pMenuIconVisible == null)
@@ -1370,11 +1275,11 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp)
                {
                        if (strcasecmp(pMenuIconVisible, "True") == 0)
                        {
-                               __pPackageAppInfoImpl->SetMainmenuVisible(true);
+                               __pAppData->__mainmenuVisible = true;
                        }
                        else
                        {
-                               __pPackageAppInfoImpl->SetMainmenuVisible(false);
+                               __pAppData->__mainmenuVisible = false;
                        }
 
                        AddAppFeature("MenuIconVisible", pMenuIconVisible);
@@ -1383,8 +1288,8 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp)
        }
        else
        {
-               __pPackageAppInfoImpl->SetType("ServiceApp");
-               __pPackageAppInfoImpl->SetMainmenuVisible(false);
+               __pAppData->__type = L"ServiceApp";
+               __pAppData->__mainmenuVisible = false;
 
                char *pUseUi = pAttr->Find("UseUi");
                if (pUseUi)
@@ -1425,11 +1330,7 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp)
                }
        }
 
-       String appId;
-       appId.Format(1024, PACKAGE_NAME_RULE, __pPackageInfoImpl->GetId().GetPointer(), pName);
-       __pPackageAppInfoImpl->SetPackageName(appId);
-
-       AppLog(" - appId=%ls", appId.GetPointer());
+       AppLog(" - appId=%ls", __pAppData->__appId.GetPointer());
 
        return true;
 }
index 1a3e0a7..ba0b79e 100755 (executable)
@@ -23,7 +23,6 @@
 #ifndef _MANIFEST_HANDLER_H_
 #define _MANIFEST_HANDLER_H_
 
-#include <FAppPkg_PackageInfoImpl.h>
 #include <FBaseString.h>
 
 #include "XmlHandler.h"
@@ -94,8 +93,6 @@ private:
 
        bool OnDataControlEndElement(void);
        bool OnDataControlTypeEndElement(void);
-       bool OnConditionEndElement(void);
-       bool OnNotificationEndElement(void);
 
        bool OnContentsEndElement(void);
        bool OnContentEndElement(void);
@@ -139,15 +136,13 @@ private:
        InstallationContext* __pContext;
        Tizen::Base::Collection::ArrayList* __pPrivilegeList;
        Tizen::Base::Collection::ArrayList* __pContentDataList;
-       Tizen::App::Package::_PackageInfoImpl* __pPackageInfoImpl;
-       Tizen::App::Package::_PackageAppInfoImpl* __pPackageAppInfoImpl;
-       Tizen::App::Package::_AppControlInfoImpl* __pAppControlInfoImpl;
-       Tizen::App::Package::_AppControlCapabilityInfoImpl* __pAppControlCapabilityInfoImpl;
-       Tizen::App::Package::_AppControlResolutionInfoImpl* __pAppControlResolutionInfoImpl;
-       Tizen::App::Package::_DataControlInfoImpl* __pDataControlInfoImpl;
-       Tizen::App::Package::_DataControlTypeImpl* __pDataControlTypeImpl;
-       Tizen::App::Package::_LaunchConditionInfoImpl* __pLaunchConditionImpl;
-       Tizen::App::Package::_NotificationInfoImpl* __pNotificationImpl;
+
+       _AppControlInfo* __pAppControlInfoImpl;
+       _AppControlCapabilityInfo* __pAppControlCapabilityInfoImpl;
+       _AppControlResolutionInfo* __pAppControlResolutionInfoImpl;
+
+       DataControlInfo* __pDataControlInfo;
+       DataControlType* __pDataControlType;
 
        ContentData* __pContentData;
        char* __pDefaultIconType;
@@ -161,7 +156,6 @@ private:
        bool __isDefaultAppDetected;
 
        AppData* __pAppData;
-       Tizen::Base::Collection::IListT<AppControlData*>* __pSubModeAppControlDataList;
 
        bool __isParserMode;
        ManifestParser* __pParser;
index f044fc2..0baf4b1 100755 (executable)
@@ -21,7 +21,6 @@
 
 #include <FIoFile.h>
 #include <FSys_SystemInfoImpl.h>
-#include <FAppPkg_PackageInfoImpl.h>
 #include <FBase_StringConverter.h>
 
 #include "ManifestAccountsParser.h"
@@ -32,7 +31,6 @@
 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;
 
index 74e90cb..103f4e0 100755 (executable)
@@ -25,8 +25,6 @@
 
 #include <FBaseString.h>
 
-#include <FAppPkg_PackageInfoImpl.h>
-
 #include "ManifestParser.h"
 #include "InstallationContext.h"
 
index 8753cf6..3a7aed5 100755 (executable)
@@ -21,7 +21,6 @@
 
 #include <FIoFile.h>
 #include <FSys_SystemInfoImpl.h>
-#include <FAppPkg_PackageInfoImpl.h>
 #include <FBase_StringConverter.h>
 
 #include "ManifestAppControlsParser.h"
@@ -32,7 +31,6 @@
 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;
 
@@ -162,7 +160,7 @@ ManifestAppControlsParser::OnAppControlStartElement(void)
                return true;
        }
 
-       pHandler->__pAppControlInfoImpl = new (std::nothrow) _AppControlInfoImpl;
+       pHandler->__pAppControlInfoImpl = new (std::nothrow) _AppControlInfo;
        TryReturn(pHandler->__pAppControlInfoImpl, false, "pHandler->__pAppControlInfoImpl is null");
 
        char* pProviderId = pAttr->Find("ProviderId");
@@ -204,7 +202,7 @@ ManifestAppControlsParser::OnCapabilityStartElement(void)
        {
                AppLog("   - OperationId=%s", pOperationId);
 
-               pHandler->__pAppControlCapabilityInfoImpl = new (std::nothrow) _AppControlCapabilityInfoImpl;
+               pHandler->__pAppControlCapabilityInfoImpl = new (std::nothrow) _AppControlCapabilityInfo;
                TryReturn(pHandler->__pAppControlCapabilityInfoImpl, false, "pHandler->__pAppControlCapabilityInfoImpl is null");
 
                pHandler->__pAppControlCapabilityInfoImpl->SetOperationId(pOperationId);
@@ -227,7 +225,7 @@ ManifestAppControlsParser::OnResolutionStartElement(void)
        XmlAttribute *pAttr = pHandler->GetAttribute();
        TryReturn(pAttr, true, "pAttr is null");
 
-       pHandler->__pAppControlResolutionInfoImpl = new (std::nothrow) _AppControlResolutionInfoImpl;
+       pHandler->__pAppControlResolutionInfoImpl = new (std::nothrow) _AppControlResolutionInfo;
        TryReturn(pHandler->__pAppControlResolutionInfoImpl, false, "pHandler->__pAppControlResolutionInfoImpl is null");
 
        AppLog("  <Resolution>");
@@ -282,7 +280,7 @@ ManifestAppControlsParser::OnAppControlEndElement(void)
 
        if (__legacyAppControls == true)
        {
-               pHandler->__pPackageAppInfoImpl->AddAppControl(pHandler->__pAppControlInfoImpl);
+               pAppData->__pAppControlImplList->Add(pHandler->__pAppControlInfoImpl);
                pHandler->__pAppControlInfoImpl = null;
        }
        else
index 52ab0cd..58c8c56 100755 (executable)
@@ -25,8 +25,6 @@
 
 #include <FBaseString.h>
 
-#include <FAppPkg_PackageInfoImpl.h>
-
 #include "ManifestParser.h"
 #include "InstallationContext.h"
 
index 3fdfd05..959457c 100755 (executable)
@@ -21,7 +21,6 @@
 
 #include <FIoFile.h>
 #include <FSys_SystemInfoImpl.h>
-#include <FAppPkg_PackageInfoImpl.h>
 #include <FBase_StringConverter.h>
 
 #include "ManifestLiveboxesParser.h"
@@ -33,7 +32,6 @@
 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;
 
index ad61c64..6dee753 100755 (executable)
@@ -25,8 +25,6 @@
 
 #include <FBaseString.h>
 
-#include <FAppPkg_PackageInfoImpl.h>
-
 #include "ManifestParser.h"
 #include "InstallationContext.h"
 
index f5be175..f7ef9b6 100755 (executable)
@@ -21,7 +21,6 @@
 
 #include <FIoFile.h>
 #include <FSys_SystemInfoImpl.h>
-#include <FAppPkg_PackageInfoImpl.h>
 #include <FBase_StringConverter.h>
 
 #include "ManifestParser.h"
@@ -30,7 +29,6 @@
 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;
 
index 2033d6f..0b4c053 100755 (executable)
@@ -25,8 +25,6 @@
 
 #include <FBaseString.h>
 
-#include <FAppPkg_PackageInfoImpl.h>
-
 #include "InstallationContext.h"
 
 class ManifestHandler;