src/Installer
src/Manager
src/XmlHandler
+ src/XmlHandler/Parser
src/Step
src/Util
/usr/include/glib-2.0
SET (${this_target}_SOURCE_FILES
src/Context/DrmLicense.cpp
src/Context/InstallationContext.cpp
+ src/Context/InstallationContextData.cpp
src/Installer/DirectoryInstaller.cpp
src/Installer/GuestInstaller.cpp
src/Installer/IDEInstaller.cpp
src/XmlHandler/XmlHandler.cpp
src/XmlHandler/XmlWriter.cpp
src/XmlHandler/PrivilegeHandler.cpp
+ src/XmlHandler/Parser/ManifestParser.cpp
+ src/XmlHandler/Parser/ManifestAccountsParser.cpp
+ src/XmlHandler/Parser/ManifestLiveboxesParser.cpp
src/backend/backend.cpp
src/Util/InstallerUtil.cpp
)
#ifndef _INSTALLER_DEFS_H_
#define _INSTALLER_DEFS_H_
-#define OSP_INSTALLER_VERSION "osp-installer version = [2012/12/28]_RC[1]"
+#define OSP_INSTALLER_VERSION "osp-installer version = [2013/01/03]_[1]"
#define DIR_BIN L"/bin"
#define DIR_INFO L"/info"
,__operation(INSTALLER_OPERATION_INSTALL)
,__storage(INSTALLATION_STORAGE_INTERNAL)
,__pPrivilegeList(null)
-,__pLiveBoxList(null)
-,__pContentInfoList(null)
+,__pLiveboxDataList(null)
+,__pContentDataList(null)
,__pAuthorCertPath(null)
,__pDistributorCertPath(null)
,__rootCertType(ROOT_CERTIFICATE_NONE)
__pPrivilegeList = null;
}
- if (__pLiveBoxList)
+ if (__pLiveboxDataList)
{
- __pLiveBoxList->RemoveAll();
- delete __pLiveBoxList;
- __pLiveBoxList = null;
+ __pLiveboxDataList->RemoveAll();
+ delete __pLiveboxDataList;
+ __pLiveboxDataList = null;
}
if (__pAppDataList)
}
ArrayList*
-InstallationContext::GetLiveBoxList(void) const
+InstallationContext::GetLiveboxDataList(void) const
{
- return __pLiveBoxList;
+ return __pLiveboxDataList;
}
void
-InstallationContext::SetLiveBoxList(ArrayList* pLiveBoxList)
+InstallationContext::SetLiveboxDataList(ArrayList* pLiveboxDataList)
{
- __pLiveBoxList = pLiveBoxList;
+ __pLiveboxDataList = pLiveboxDataList;
}
ArrayList*
-InstallationContext::GetContentInfoList(void) const
+InstallationContext::GetContentDataList(void) const
{
- return __pContentInfoList;
+ return __pContentDataList;
}
void
-InstallationContext::SetContentInfoList(ArrayList* pContentInfoList)
+InstallationContext::SetContentDataList(ArrayList* pContentDataList)
{
- __pContentInfoList = pContentInfoList;
+ __pContentDataList = pContentDataList;
}
X509CertificatePath*
{
return __pPackageInfoImpl;
}
-
-LiveboxInfo::LiveboxInfo(void)
-:__updatePeriod(0)
-,__pNameList(null)
-,__pSizeList(null)
-{
- __pNameList = new (std::nothrow) HashMap;
- TryReturn(__pNameList, , "[osp-installer] __pNameList is null.");
- __pNameList->Construct();
-
- __pSizeList = new (std::nothrow) ArrayList;
- TryReturn(__pSizeList, , "[osp-installer] __pSizeList is null.");
- __pSizeList->Construct();
-}
-
-LiveboxInfo::~LiveboxInfo(void)
-{
- __pNameList->RemoveAll(true);
- delete __pNameList;
-
- __pSizeList->RemoveAll(true);
- delete __pSizeList;
-}
-
-result
-LiveboxInfo::SetUpdatePeriod(long long period)
-{
- __updatePeriod = period;
- return E_SUCCESS;
-}
-
-long long
-LiveboxInfo::GetUpdatePeriod(void) const
-{
- return __updatePeriod;
-}
-
-result
-LiveboxInfo::SetPopupEnabled(const String& value)
-{
- __popupEnabled = value;
- return E_SUCCESS;
-}
-
-const String&
-LiveboxInfo::GetPopupEnabled(void) const
-{
- return __popupEnabled;
-}
-
-result
-LiveboxInfo::SetIcon(const String& icon)
-{
- __icon = icon;
- return E_SUCCESS;
-}
-
-const String&
-LiveboxInfo::GetIcon(void) const
-{
- return __icon;
-}
-
-result
-LiveboxInfo::SetName(const String& name)
-{
- __name = name;
- return E_SUCCESS;
-}
-
-const String&
-LiveboxInfo::GetName(void) const
-{
- return __name;
-}
-
-result
-LiveboxInfo::AddName(const String& language, const String& name)
-{
- result r = E_SUCCESS;
-
- r = __pNameList->Add(language, name);
-
- return r;
-}
-
-HashMap*
-LiveboxInfo::GetNameList(void) const
-{
- return __pNameList;
-}
-
-result
-LiveboxInfo::AddSize(const String& size)
-{
- result r = E_SUCCESS;
-
- r = __pSizeList->Add(size);
-
- return r;
-}
-
-ArrayList*
-LiveboxInfo::GetSizeList(void) const
-{
- return __pSizeList;
-}
-
-ContentInfo::ContentInfo(void)
-:__pNameList(null)
-{
- __pNameList = new (std::nothrow) HashMap;
- TryReturn(__pNameList, , "[osp-installer] __pNameList is null.");
- __pNameList->Construct();
-}
-
-ContentInfo::~ContentInfo(void)
-{
- __pNameList->RemoveAll(true);
- delete __pNameList;
-}
-
-result
-ContentInfo::SetContentId(const String& contentId)
-{
- __contentId = contentId;
- return E_SUCCESS;
-}
-
-const String&
-ContentInfo::GetContentId(void) const
-{
- return __contentId;
-}
-
-result
-ContentInfo::SetIcon(const String& icon)
-{
- __icon = icon;
- return E_SUCCESS;
-}
-
-const String&
-ContentInfo::GetIcon(void) const
-{
- return __icon;
-}
-
-result
-ContentInfo::AddName(const String& language, const String& name)
-{
- result r = E_SUCCESS;
-
- r = __pNameList->Add(language, name);
-
- return r;
-}
-
-HashMap*
-ContentInfo::GetNameList(void) const
-{
- return __pNameList;
-}
-
-AppControlData::AppControlData()
-:__pOperationDataList(null)
-{
- __pOperationDataList = new (std::nothrow) ArrayListT<OperationData*>;
-}
-
-AppControlData::~AppControlData()
-{
- __pOperationDataList->RemoveAll();
- delete __pOperationDataList;
-}
-
-AppData::AppData()
-:__pCategoryList(null)
-,__pAppControlData(null)
-{
- __pCategoryList = new (std::nothrow) ArrayListT<String*>;
- __pAppControlData = new (std::nothrow) AppControlData;
-}
-
-AppData::~AppData()
-{
- __pCategoryList->RemoveAll();
- delete __pCategoryList;
-
- delete __pAppControlData;
-}
// limitations under the License.
//
/**
- * @file InstallerContext.h
- * @brief This is the header file for the %InstallerContext class.
+ * @file InstallationContext.h
+ * @brief This is the header file for the %InstallationContext class.
*
- * This header file contains the declarations of the %InstallerContext class.
+ * This header file contains the declarations of the %InstallationContext class.
*/
#ifndef _INSTALLATION_CONTEXT_H_
#define _INSTALLATION_CONTEXT_H_
#include "InstallerDefs.h"
#include "IInstallationStep.h"
#include "DrmLicense.h"
+#include "InstallationContextData.h"
class IInstallationStep;
-class OperationData
- : public Tizen::Base::Object
-{
-public:
- OperationData(){};
- virtual ~OperationData(){};
-
- Tizen::Base::String __id;
- Tizen::Base::String __mimeType;
- Tizen::Base::String __uri;
-};
-
-class AppControlData
- : public Tizen::Base::Object
-{
-public:
- AppControlData();
- virtual ~AppControlData();
-
- Tizen::Base::Collection::IListT<OperationData*>* __pOperationDataList;
-};
-
-class AppData
- : public Tizen::Base::Object
-{
-public:
- AppData();
- virtual ~AppData();
-
- Tizen::Base::Collection::IListT<Tizen::Base::String*>* __pCategoryList;
- AppControlData* __pAppControlData;
- Tizen::Base::String name;
-
-private:
-};
-
-class PackageData
- : public Tizen::Base::Object
-{
-public:
- PackageData(){};
- virtual ~PackageData(){};
-
-};
-
/**
* @class InstallationContext
* @brief This class represents the class of InstallationContext.
const Tizen::Base::Collection::ArrayList* GetPrivilegeList(void) const;
void SetPrivilegeList(Tizen::Base::Collection::ArrayList* privilegeList);
- Tizen::Base::Collection::ArrayList* GetLiveBoxList(void) const;
- void SetLiveBoxList(Tizen::Base::Collection::ArrayList* pLiveBoxList);
+ Tizen::Base::Collection::ArrayList* GetLiveboxDataList(void) const;
+ void SetLiveboxDataList(Tizen::Base::Collection::ArrayList* pLiveboxDataList);
- Tizen::Base::Collection::ArrayList* GetContentInfoList(void) const;
- void SetContentInfoList(Tizen::Base::Collection::ArrayList* pContentInfoList);
+ Tizen::Base::Collection::ArrayList* GetContentDataList(void) const;
+ void SetContentDataList(Tizen::Base::Collection::ArrayList* pContentDataList);
Tizen::Security::Cert::X509CertificatePath* GetAuthorCertPath(void) const;
void SetAuthorCertPath(Tizen::Security::Cert::X509CertificatePath* pAuthorCertPath);
Tizen::Base::String __appRootPath;
Tizen::Base::Collection::ArrayList* __pPrivilegeList;
- Tizen::Base::Collection::ArrayList* __pLiveBoxList;
- Tizen::Base::Collection::ArrayList* __pContentInfoList;
+ Tizen::Base::Collection::ArrayList* __pLiveboxDataList;
+ Tizen::Base::Collection::ArrayList* __pContentDataList;
Tizen::Security::Cert::X509CertificatePath* __pAuthorCertPath;
Tizen::Security::Cert::X509CertificatePath* __pDistributorCertPath;
RootCertificateType __rootCertType;
}; // InstallationContext
-class LiveboxInfo
- : public Tizen::Base::Object
-{
-public:
- LiveboxInfo(void);
- virtual ~LiveboxInfo(void);
-
- result SetUpdatePeriod(long long period);
- long long GetUpdatePeriod(void) const;
-
- result SetPopupEnabled(const Tizen::Base::String& value);
- const Tizen::Base::String& GetPopupEnabled(void) const;
-
- result SetIcon(const Tizen::Base::String& icon);
- const Tizen::Base::String& GetIcon(void) const;
-
- result SetName(const Tizen::Base::String& name);
- const Tizen::Base::String& GetName(void) const;
-
- result AddName(const Tizen::Base::String& language, const Tizen::Base::String& name);
- Tizen::Base::Collection::HashMap* GetNameList(void) const;
-
- result AddSize(const Tizen::Base::String& size);
- Tizen::Base::Collection::ArrayList* GetSizeList(void) const;
-
- Tizen::Base::String __main;
- Tizen::Base::String __configurationAppControlAppId;
-
-private:
- LiveboxInfo(const LiveboxInfo& value);
- LiveboxInfo& operator =(const LiveboxInfo& source);
-
- long long __updatePeriod;
- Tizen::Base::String __popupEnabled;
- Tizen::Base::String __icon;
- Tizen::Base::String __name;
-
- Tizen::Base::Collection::HashMap* __pNameList;
- Tizen::Base::Collection::ArrayList* __pSizeList;
-
-}; // LiveboxInfo
-
-class ContentInfo
- : public Tizen::Base::Object
-{
-public:
- ContentInfo(void);
- virtual ~ContentInfo(void);
-
- result SetContentId(const Tizen::Base::String& contentId);
- const Tizen::Base::String& GetContentId(void) const;
-
- result SetIcon(const Tizen::Base::String& icon);
- const Tizen::Base::String& GetIcon(void) const;
-
- result AddName(const Tizen::Base::String& language, const Tizen::Base::String& name);
- Tizen::Base::Collection::HashMap* GetNameList(void) const;
-
-private:
- ContentInfo(const ContentInfo& value);
- ContentInfo& operator =(const ContentInfo& source);
-
- Tizen::Base::String __icon;
- Tizen::Base::String __contentId;
-
- Tizen::Base::Collection::HashMap* __pNameList;
-
-}; // ContentInfo
-
#endif // _INSTALLATION_CONTEXT_H_
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file InstallationContextData.cpp
+ * @brief This is the implementation for the InstallationContextData class.
+ */
+
+#include "InstallationContextData.h"
+
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Io;
+using namespace Tizen::Security::Cert;
+using namespace Tizen::App::Package;
+
+
+AppControlData::AppControlData()
+:__pOperationDataList(null)
+{
+ __pOperationDataList = new (std::nothrow) ArrayListT<OperationData*>;
+}
+
+AppControlData::~AppControlData()
+{
+ __pOperationDataList->RemoveAll();
+ delete __pOperationDataList;
+}
+
+
+AccountData::AccountData()
+:__pNameList(null)
+{
+ __pNameList = new (std::nothrow) HashMap;
+ TryReturn(__pNameList, , "[osp-installer] __pNameList is null.");
+ __pNameList->Construct();
+}
+
+AccountData::~AccountData()
+{
+ __pNameList->RemoveAll(true);
+ delete __pNameList;
+}
+
+
+LiveboxData::LiveboxData(void)
+:__updatePeriod(0)
+,__pNameList(null)
+,__pSizeList(null)
+{
+ __pNameList = new (std::nothrow) HashMap;
+ TryReturn(__pNameList, , "[osp-installer] __pNameList is null.");
+ __pNameList->Construct();
+
+ __pSizeList = new (std::nothrow) ArrayList;
+ TryReturn(__pSizeList, , "[osp-installer] __pSizeList is null.");
+ __pSizeList->Construct();
+}
+
+LiveboxData::~LiveboxData(void)
+{
+ __pNameList->RemoveAll(true);
+ delete __pNameList;
+
+ __pSizeList->RemoveAll(true);
+ delete __pSizeList;
+}
+
+result
+LiveboxData::SetUpdatePeriod(long long period)
+{
+ __updatePeriod = period;
+ return E_SUCCESS;
+}
+
+long long
+LiveboxData::GetUpdatePeriod(void) const
+{
+ return __updatePeriod;
+}
+
+result
+LiveboxData::SetPopupEnabled(const String& value)
+{
+ __popupEnabled = value;
+ return E_SUCCESS;
+}
+
+const String&
+LiveboxData::GetPopupEnabled(void) const
+{
+ return __popupEnabled;
+}
+
+result
+LiveboxData::SetIcon(const String& icon)
+{
+ __icon = icon;
+ return E_SUCCESS;
+}
+
+const String&
+LiveboxData::GetIcon(void) const
+{
+ return __icon;
+}
+
+result
+LiveboxData::SetName(const String& name)
+{
+ __name = name;
+ return E_SUCCESS;
+}
+
+const String&
+LiveboxData::GetName(void) const
+{
+ return __name;
+}
+
+result
+LiveboxData::AddName(const String& language, const String& name)
+{
+ result r = E_SUCCESS;
+
+ r = __pNameList->Add(language, name);
+
+ return r;
+}
+
+HashMap*
+LiveboxData::GetNameList(void) const
+{
+ return __pNameList;
+}
+
+result
+LiveboxData::AddSize(const String& size)
+{
+ result r = E_SUCCESS;
+
+ r = __pSizeList->Add(size);
+
+ return r;
+}
+
+ArrayList*
+LiveboxData::GetSizeList(void) const
+{
+ return __pSizeList;
+}
+
+
+ContentData::ContentData(void)
+:__pNameList(null)
+{
+ __pNameList = new (std::nothrow) HashMap;
+ TryReturn(__pNameList, , "[osp-installer] __pNameList is null.");
+ __pNameList->Construct();
+}
+
+ContentData::~ContentData(void)
+{
+ __pNameList->RemoveAll(true);
+ delete __pNameList;
+}
+
+result
+ContentData::SetContentId(const String& contentId)
+{
+ __contentId = contentId;
+ return E_SUCCESS;
+}
+
+const String&
+ContentData::GetContentId(void) const
+{
+ return __contentId;
+}
+
+result
+ContentData::SetIcon(const String& icon)
+{
+ __icon = icon;
+ return E_SUCCESS;
+}
+
+const String&
+ContentData::GetIcon(void) const
+{
+ return __icon;
+}
+
+result
+ContentData::AddName(const String& language, const String& name)
+{
+ result r = E_SUCCESS;
+
+ r = __pNameList->Add(language, name);
+
+ return r;
+}
+
+HashMap*
+ContentData::GetNameList(void) const
+{
+ return __pNameList;
+}
+
+AppData::AppData()
+:__pCategoryList(null)
+,__pAppControlData(null)
+,__pAccountDataList(null)
+{
+ __pCategoryList = new (std::nothrow) ArrayListT<String*>;
+ __pAppControlData = new (std::nothrow) AppControlData;
+ __pAccountDataList = new (std::nothrow) ArrayListT<AccountData*>;
+}
+
+AppData::~AppData()
+{
+ __pCategoryList->RemoveAll();
+ delete __pCategoryList;
+
+ delete __pAppControlData;
+
+ __pAccountDataList->RemoveAll();
+ delete __pAccountDataList;
+}
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file InstallerContextData.h
+ * @brief This is the header file for the context data classes.
+ *
+ * This header file contains the declarations of the the context data classes.
+ */
+#ifndef _INSTALLATION_CONTEXT_DATA_H_
+#define _INSTALLATION_CONTEXT_DATA_H_
+
+#include <FAppPkg_PackageInfoImpl.h>
+#include <FSecCertX509CertificatePath.h>
+
+#include "InstallerDefs.h"
+
+
+class OperationData
+ : public Tizen::Base::Object
+{
+public:
+ OperationData(){};
+ virtual ~OperationData(){};
+
+ Tizen::Base::String __id;
+ Tizen::Base::String __mimeType;
+ Tizen::Base::String __uri;
+};
+
+
+class AppControlData
+ : public Tizen::Base::Object
+{
+public:
+ AppControlData();
+ virtual ~AppControlData();
+
+ Tizen::Base::Collection::IListT<OperationData*>* __pOperationDataList;
+};
+
+
+class AccountData
+ : public Tizen::Base::Object
+{
+public:
+ AccountData();
+ virtual ~AccountData();
+
+ Tizen::Base::String __providerId;
+ Tizen::Base::String __multipleAccountsSupport;
+ Tizen::Base::String __accountIcon;
+ Tizen::Base::String __accountSmallIcon;
+ Tizen::Base::Collection::HashMap* __pNameList;
+};
+
+
+class LiveboxData
+ : public Tizen::Base::Object
+{
+public:
+ LiveboxData(void);
+ virtual ~LiveboxData(void);
+
+ result SetUpdatePeriod(long long period);
+ long long GetUpdatePeriod(void) const;
+
+ result SetPopupEnabled(const Tizen::Base::String& value);
+ const Tizen::Base::String& GetPopupEnabled(void) const;
+
+ result SetIcon(const Tizen::Base::String& icon);
+ const Tizen::Base::String& GetIcon(void) const;
+
+ result SetName(const Tizen::Base::String& name);
+ const Tizen::Base::String& GetName(void) const;
+
+ result AddName(const Tizen::Base::String& language, const Tizen::Base::String& name);
+ Tizen::Base::Collection::HashMap* GetNameList(void) const;
+
+ result AddSize(const Tizen::Base::String& size);
+ Tizen::Base::Collection::ArrayList* GetSizeList(void) const;
+
+ Tizen::Base::String __main;
+ Tizen::Base::String __configurationAppControlAppId;
+
+private:
+ LiveboxData(const LiveboxData& value);
+ LiveboxData& operator =(const LiveboxData& source);
+
+ long long __updatePeriod;
+ Tizen::Base::String __popupEnabled;
+ Tizen::Base::String __icon;
+ Tizen::Base::String __name;
+
+ Tizen::Base::Collection::HashMap* __pNameList;
+ Tizen::Base::Collection::ArrayList* __pSizeList;
+
+};
+
+
+class ContentData
+ : public Tizen::Base::Object
+{
+public:
+ ContentData(void);
+ virtual ~ContentData(void);
+
+ result SetContentId(const Tizen::Base::String& contentId);
+ const Tizen::Base::String& GetContentId(void) const;
+
+ result SetIcon(const Tizen::Base::String& icon);
+ const Tizen::Base::String& GetIcon(void) const;
+
+ result AddName(const Tizen::Base::String& language, const Tizen::Base::String& name);
+ Tizen::Base::Collection::HashMap* GetNameList(void) const;
+
+private:
+ ContentData(const ContentData& value);
+ ContentData& operator =(const ContentData& source);
+
+ Tizen::Base::String __icon;
+ Tizen::Base::String __contentId;
+
+ Tizen::Base::Collection::HashMap* __pNameList;
+
+};
+
+
+class AppData
+ : public Tizen::Base::Object
+{
+public:
+ AppData();
+ virtual ~AppData();
+
+ Tizen::Base::Collection::IListT<Tizen::Base::String*>* __pCategoryList;
+ AppControlData* __pAppControlData;
+ Tizen::Base::String name;
+ Tizen::Base::Collection::IListT<AccountData*>* __pAccountDataList;
+
+private:
+};
+
+
+class PackageData
+ : public Tizen::Base::Object
+{
+public:
+ PackageData(){};
+ virtual ~PackageData(){};
+};
+
+
+#endif // _INSTALLATION_CONTEXT_DATA_H_
char* pXmlPath = null;
int err = 0;
bool hybridService = pContext->IsHybridService();
- ArrayList* pContentInfoList = null;
+ ArrayList* pContentDataList = null;
_PackageInfoImpl *pPackageInfoImpl = null;
pPackageInfoImpl = pContext->GetPackageInfoImpl();
}
}
- pContentInfoList = pContext->GetContentInfoList();
- if (pContentInfoList)
+ pContentDataList = pContext->GetContentDataList();
+ if (pContentDataList)
{
- int contentCount = pContentInfoList->GetCount();
+ int contentCount = pContentDataList->GetCount();
for (int i = 0 ; i < contentCount; i++)
{
- ContentInfo* pContentInfo = static_cast<ContentInfo*>(pContentInfoList->GetAt(i));
- if (pContentInfo)
+ ContentData* pContentData = static_cast<ContentData*>(pContentDataList->GetAt(i));
+ if (pContentData)
{
- String contentId = pContentInfo->GetContentId();
+ String contentId = pContentData->GetContentId();
String oldPath = rootPath + DIR_CONTENTS + L"/" + contentId;
if (File::IsFileExist(SLP_FONT_PATH) == false)
if (__pContext->IsVerificationMode() == false)
{
- AppLogTag(OSP_INSTALLER, "Signature file not found. path = [%ls]\n", __pContext->GetSignatureXmlPath().GetPointer());
+ AppLogTag(OSP_INSTALLER, "no signature file[%ls]\n", __pContext->GetSignatureXmlPath().GetPointer());
return INSTALLER_ERROR_NONE;
}
TryReturn(__pContext, false, "[osp-installer] __pContext is null.");
TryReturn(__pWriter, false, "[osp-installer] __pWriter is null.");
- ArrayList* pLiveboxList = __pContext->GetLiveBoxList();
+ ArrayList* pLiveboxDataList = __pContext->GetLiveboxDataList();
_PackageInfoImpl* pPackageInfoImpl = __pContext->GetPackageInfoImpl();
String label("label");
- if (pLiveboxList == null)
+ if (pLiveboxDataList == null)
{
return true;
}
- for (int j = 0 ; j < pLiveboxList->GetCount(); j++)
+ for (int j = 0 ; j < pLiveboxDataList->GetCount(); j++)
{
- LiveboxInfo* pLiveboxInfo = dynamic_cast<LiveboxInfo*>(pLiveboxList->GetAt(j));
- if (pLiveboxInfo == null)
+ LiveboxData* pLiveboxData = dynamic_cast<LiveboxData*>(pLiveboxDataList->GetAt(j));
+ if (pLiveboxData == null)
{
- AppLogTag(OSP_INSTALLER, "pLiveboxInfo is null [%d]", j);
+ AppLogTag(OSP_INSTALLER, "pLiveboxData is null [%d]", j);
continue;
}
- long long updatePeriod = pLiveboxInfo->GetUpdatePeriod();
+ long long updatePeriod = pLiveboxData->GetUpdatePeriod();
String period = LongLong::ToString(updatePeriod/1000);
- IMap* pLiveboxNameList = pLiveboxInfo->GetNameList();
- ArrayList* pSizeList = pLiveboxInfo->GetSizeList();
- String popupEnabled = pLiveboxInfo->GetPopupEnabled();
- String primary = pLiveboxInfo->__main;
+ IMap* pLiveboxNameList = pLiveboxData->GetNameList();
+ ArrayList* pSizeList = pLiveboxData->GetSizeList();
+ String popupEnabled = pLiveboxData->GetPopupEnabled();
+ String primary = pLiveboxData->__main;
__pWriter->StartElement("livebox");
- __pWriter->WriteAttribute("appid", pAppInfoImpl->GetPackageName() + "." + pLiveboxInfo->GetName() );
+ __pWriter->WriteAttribute("appid", pAppInfoImpl->GetPackageName() + "." + pLiveboxData->GetName() );
__pWriter->WriteAttribute("period", period);
__pWriter->WriteAttribute("pinup", "false");
WriteLanguageValue(pLiveboxNameList, label);
-// if (pLiveboxInfo->GetIcon().IsEmpty() == false)
+// if (pLiveboxData->GetIcon().IsEmpty() == false)
// {
// String liveboxIcon;
-// liveboxIcon.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, pLiveboxInfo->GetIcon().GetPointer());
+// liveboxIcon.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, pLiveboxData->GetIcon().GetPointer());
//
// __pWriter->StartElement("icon");
// __pWriter->WriteString(liveboxIcon);
__pWriter->EndElement();
}
- if (pLiveboxInfo->__configurationAppControlAppId.IsEmpty() == false)
+ if (pLiveboxData->__configurationAppControlAppId.IsEmpty() == false)
{
__pWriter->StartElement("setup");
- __pWriter->WriteString(pLiveboxInfo->__configurationAppControlAppId);
+ __pWriter->WriteString(pLiveboxData->__configurationAppControlAppId);
__pWriter->EndElement();
}
#include "ManifestHandler.h"
#include "PrivilegeHandler.h"
#include "InstallerUtil.h"
-
+#include "ManifestAccountsParser.h"
+#include "ManifestLiveboxesParser.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
ManifestHandler::ManifestHandler(void)
:__pContext(null)
,__pPrivilegeList(null)
-,__pLiveBoxList(null)
-,__pContentInfoList(null)
+,__pContentDataList(null)
,__pPackageInfoImpl(null)
,__pPackageAppInfoImpl(null)
,__pAppControlInfoImpl(null)
,__pDataControlTypeImpl(null)
,__pLaunchConditionImpl(null)
,__pNotificationImpl(null)
-,__pLiveboxInfo(null)
-,__pContentInfo(null)
+,__pContentData(null)
,__pDefaultIconType(null)
,__isDefaultMainmenu(false)
,__isDefaultSetting(false)
,__pAppData(null)
,__pSubModeAppControlData(null)
,__pOperationData(null)
+,__isParserMode(false)
{
}
ManifestHandler::~ManifestHandler(void)
{
+ delete[] __pDefaultIconType;
+ __pDefaultIconType = null;
+
if (__pPackageAppInfoImpl)
{
delete __pPackageAppInfoImpl;
return true;
}
+InstallationContext*
+ManifestHandler::GetContext(void)
+{
+ return __pContext;
+}
+
bool
ManifestHandler::Parse(const char *pFilepath)
{
bool status = true;
+ if (__isParserMode == true)
+ {
+ TryReturn(__pParser, false, "[osp-installer] __pParser is null");
+ return __pParser->OnStartElement(pName);
+ }
+
if (strcasecmp(pName, "Manifest") == 0)
{
AppLogTag(OSP_INSTALLER, "------------------------------------------");
{
status = OnIconsStartElement();
}
- else if (strcasecmp(pName, "LiveBoxes") == 0)
- {
- status = OnLiveBoxesStartElement();
- }
- else if (strcasecmp(pName, "LiveBox") == 0)
- {
- status = OnLiveBoxStartElement();
- }
else if (strcasecmp(pName, "Contents") == 0)
{
status = OnContentsStartElement();
{
status = OnOperationStartElement();
}
+ else if (strcasecmp(pName, "Liveboxes") == 0)
+ {
+ status = OnLiveboxesStartElement(pName);
+ }
+ else if (strcasecmp(pName, "Accounts") == 0)
+ {
+ status = OnAccountsStartElement(pName);
+ }
if (!status)
{
+ __isParserMode = false;
return false;
}
bool status = true;
+ if (__isParserMode == true)
+ {
+ TryReturn(__pParser, false, "[osp-installer] __pParser is null");
+ __pParser->OnEndElement(pName);
+
+ if (strcasecmp(pName, "Accounts") == 0)
+ {
+ status = OnAccountsEndElement();
+ }
+ else if (strcasecmp(pName, "Liveboxes") == 0)
+ {
+ status = OnLiveboxesEndElement();
+ }
+
+ return status;
+ }
+
if (strcasecmp(pName, "Privileges") == 0)
{
status = OnPrivilegesEndElement();
{
status = OnIconsEndElement();
}
- else if (strcasecmp(pName, "LiveBoxes") == 0)
- {
- status = OnLiveBoxesEndElement();
- }
else if (strcasecmp(pName, "Contents") == 0)
{
status = OnContentsEndElement();
}
- else if (strcasecmp(pName, "LiveBox") == 0)
- {
- status = OnLiveBoxEndElement();
- }
else if (strcasecmp(pName, "Content") == 0)
{
status = OnContentEndElement();
ManifestHandler::OnCharacters(const char *pCharacters)
{
bool status = true;
- char *pName = 0;
- pName = GetElementName();
+ if (__isParserMode == true)
+ {
+ TryReturn(__pParser, false, "[osp-installer] __pParser is null");
+ return __pParser->OnCharacters(pCharacters);
+ }
+
+ char *pName = GetElementName();
TryReturn(pName, false, "[osp-installer] pName is null.");
if (strcasecmp(pName, "Id") == 0)
{
status = OnNotificationValue(pCharacters);
}
- else if (strcasecmp(pName, "Size") == 0)
- {
- status = OnSizeValue(pCharacters);
- }
else if (strcasecmp(pName, "InstallationLocation") == 0)
{
status = OnInstallationLocationValue(pCharacters);
{
status = OnUriValue(pCharacters);
}
- else if (strcasecmp(pName, "ConfigurationAppControlAppId") == 0)
- {
- status = OnConfigurationAppControlAppIdValue(pCharacters);
- }
if (!status)
{
bool
ManifestHandler::OnContentsStartElement(void)
{
- __pContentInfoList = new (std::nothrow) ArrayList;
- TryReturn(__pContentInfoList, false, "[osp-installer] __pContentInfoList is null");
+ __pContentDataList = new (std::nothrow) ArrayList;
+ TryReturn(__pContentDataList, false, "[osp-installer] __pContentDataList is null");
AppLogTag(OSP_INSTALLER, "<Contents>");
bool
ManifestHandler::OnContentStartElement(void)
{
- TryReturn(__pContentInfo == null, false, "[osp-installer] __pContentInfo is not null");
+ TryReturn(__pContentData == null, false, "[osp-installer] __pContentData is not null");
XmlAttribute *pAttr = null;
char *pDefault = null;
- __pContentInfo = new (std::nothrow) ContentInfo;
- TryReturn(__pContentInfo, false, "[osp-installer] __pLiveboxInfo is null");
+ __pContentData = new (std::nothrow) ContentData;
+ TryReturn(__pContentData, false, "[osp-installer] __pContentData is null");
pAttr = GetAttribute();
TryReturn(pAttr, true, "[osp-installer] pAttr is null");
char* pId = pAttr->Find("Id");
if (pId)
{
- __pContentInfo->SetContentId(pId);
+ __pContentData->SetContentId(pId);
}
char* pEntryName = pAttr->Find("EntryName");
if (pEntryName)
{
- __pContentInfo->SetContentId(pEntryName);
+ __pContentData->SetContentId(pEntryName);
}
pDefault = pAttr->Find("Default");
}
bool
-ManifestHandler::OnLiveBoxesStartElement(void)
+ManifestHandler::OnLiveboxesStartElement(const char *pName)
{
- __pLiveBoxList = new (std::nothrow) ArrayList;
- TryReturn(__pLiveBoxList, false, "[osp-installer] __pLiveBoxList is null");
+ __pParser = new (std::nothrow) ManifestLiveboxesParser;
+ TryReturn(__pParser, false, "[osp-installer] __pParser is null");
- AppLogTag(OSP_INSTALLER, "<LiveBoxes>");
+ __isParserMode = true;
+ AppLogTag(OSP_INSTALLER, "------------------------------------------");
+ __pParser->Construct(this);
- return true;
+ return __pParser->OnStartElement(pName);
}
bool
-ManifestHandler::OnLiveBoxStartElement(void)
+ManifestHandler::OnAccountsStartElement(const char *pName)
{
- TryReturn(__pLiveboxInfo == null, false, "[osp-installer] __pLiveboxInfo is not null");
-
- XmlAttribute *pAttr = null;
-
- __pLiveboxInfo = new (std::nothrow) LiveboxInfo;
- TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null");
-
- pAttr = GetAttribute();
- TryReturn(pAttr, true, "[osp-installer] pAttr is null");
-
- AppLogTag(OSP_INSTALLER, "<Livebox>");
+ __pParser = new (std::nothrow) ManifestAccountsParser;
+ TryReturn(__pParser, false, "[osp-installer] __pParser is null");
- char *pProviderName = pAttr->Find("ProviderName");
- if (pProviderName)
- {
- __pLiveboxInfo->SetName(pProviderName);
- AppLogTag(OSP_INSTALLER, " - ProviderName=%s", pProviderName);
- }
+ __isParserMode = true;
+ AppLogTag(OSP_INSTALLER, "------------------------------------------");
+ __pParser->Construct(this);
- char *pUpdatePeriod = pAttr->Find("UpdatePeriod");
- if (pUpdatePeriod)
- {
- long long updatePeriod = atoll(pUpdatePeriod);
- __pLiveboxInfo->SetUpdatePeriod(updatePeriod);
- AppLogTag(OSP_INSTALLER, " - UpdatePeriod=%lld", updatePeriod);
- }
-
- char *pLiveboxPopupEnabled = pAttr->Find("LiveBoxPopupEnabled");
- if (pLiveboxPopupEnabled)
- {
- __pLiveboxInfo->SetPopupEnabled(pLiveboxPopupEnabled);
- AppLogTag(OSP_INSTALLER, " - LiveBoxPopupEnabled=%s", pLiveboxPopupEnabled);
- }
-
- char *pMain = pAttr->Find("Main");
- if (pMain)
- {
- __pLiveboxInfo->__main = pMain;
- AppLogTag(OSP_INSTALLER, " - Main=%s", pMain);
- }
-
- return true;
+ return __pParser->OnStartElement(pName);
}
bool
{
if (__pContext->IsVerificationMode() == false)
{
- AppLogTag(OSP_INSTALLER, "Signature file not found. [%ls]\n", __pContext->GetSignatureXmlPath().GetPointer());
+ AppLogTag(OSP_INSTALLER, "no signature file[%ls]\n", __pContext->GetSignatureXmlPath().GetPointer());
result r = E_SUCCESS;
String privileges;
bool
ManifestHandler::OnIconsEndElement(void)
{
- delete[] __pDefaultIconType;
- __pDefaultIconType = null;
AppLogTag(OSP_INSTALLER, "</Icons>");
return true;
bool
ManifestHandler::OnContentsEndElement(void)
{
- __pContext->SetContentInfoList(__pContentInfoList);
- __pContentInfoList = null;
+ __pContext->SetContentDataList(__pContentDataList);
+ __pContentDataList = null;
AppLogTag(OSP_INSTALLER, "</Contents>");
return true;
bool
ManifestHandler::OnContentEndElement(void)
{
- __pContentInfoList->Add(*__pContentInfo);
- __pContentInfo = null;
+ __pContentDataList->Add(*__pContentData);
+ __pContentData = null;
AppLogTag(OSP_INSTALLER, "</Content>");
return true;
}
bool
-ManifestHandler::OnLiveBoxesEndElement(void)
+ManifestHandler::OnAccountsEndElement(void)
{
- __pContext->SetLiveBoxList(__pLiveBoxList);
- __pLiveBoxList = null;
- AppLogTag(OSP_INSTALLER, "</LiveBoxes>");
+ delete __pParser;
+ __isParserMode = false;
+ AppLogTag(OSP_INSTALLER, "------------------------------------------");
return true;
}
bool
-ManifestHandler::OnLiveBoxEndElement(void)
+ManifestHandler::OnLiveboxesEndElement(void)
{
- __pLiveBoxList->Add(*__pLiveboxInfo);
- __pLiveboxInfo = null;
- AppLogTag(OSP_INSTALLER, "</LiveBox>");
+ delete __pParser;
+ __isParserMode = false;
+ AppLogTag(OSP_INSTALLER, "------------------------------------------");
return true;
}
bool
ManifestHandler::OnIdValue(const char *pCharacters)
{
- __pPackageInfoImpl->SetAppId(pCharacters);
AppLogTag(OSP_INSTALLER, "<Id>%s</Id>", pCharacters);
+ __pPackageInfoImpl->SetAppId(pCharacters);
return true;
}
bool
ManifestHandler::OnVersionValue(const char *pCharacters)
{
- __pPackageInfoImpl->SetAppVersion(pCharacters);
AppLogTag(OSP_INSTALLER, "<Version>%s</Version>", pCharacters);
+ __pPackageInfoImpl->SetAppVersion(pCharacters);
return true;
}
bool
ManifestHandler::OnTypeValue(const char *pCharacters)
{
+ AppLogTag(OSP_INSTALLER, "<Type>%s</Type>", pCharacters);
__pPackageInfoImpl->SetAppType(pCharacters);
if (strcasecmp(pCharacters, "Contents") == 0)
__pPackageInfoImpl->SetAppApiVersion("3.0");
}
- AppLogTag(OSP_INSTALLER, "<Type>%s</Type>", pCharacters);
-
return true;
}
// __pPackageInfoImpl->SetAppVendor(pCharacters);
// }
- __pPackageInfoImpl->SetAppVendor(pCharacters);
AppLogTag(OSP_INSTALLER, "<Author>%s</Author>", pCharacters);
+ __pPackageInfoImpl->SetAppVendor(pCharacters);
return true;
}
return false;
}
- if (FindElement("Livebox") == true)
- {
- TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null");
- __pLiveboxInfo->SetIcon(icon);
- }
- else if (FindElement("Content") == true)
+ if (FindElement("Content") == true)
{
- TryReturn(__pContentInfo, false, "[osp-installer] __pContentInfo is null");
- __pContentInfo->SetIcon(icon);
+ TryReturn(__pContentData, false, "[osp-installer] __pContentData is null");
+ __pContentData->SetIcon(icon);
}
else
{
pAttrValue = pAttr->Find("Locale");
TryReturn(pAttrValue, true, "[osp-installer] pAttrValue is null");
- if (FindElement("Livebox") == true)
+ if (FindElement("Content") == true)
{
- TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null");
+ TryReturn(__pContentData, false, "[osp-installer] __pContentData is null");
String* pValue = new (std::nothrow) String;
StringUtil::Utf8ToString(pCharacters, *pValue);
- __pLiveboxInfo->AddName(*(new (std::nothrow) String(pAttrValue)), *pValue);
- }
- else if (FindElement("Content") == true)
- {
- TryReturn(__pContentInfo, false, "[osp-installer] __pContentInfo is null");
-
- String* pValue = new (std::nothrow) String;
- StringUtil::Utf8ToString(pCharacters, *pValue);
- __pContentInfo->AddName(*(new (std::nothrow) String(pAttrValue)), *pValue);
+ __pContentData->AddName(*(new (std::nothrow) String(pAttrValue)), *pValue);
}
else
{
}
bool
-ManifestHandler::OnSizeValue(const char *pCharacters)
-{
- TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null");
-
- __pLiveboxInfo->AddSize(*(new (std::nothrow) String(pCharacters)));
- AppLogTag(OSP_INSTALLER, "<Size>%s</Size>", pCharacters);
-
- return true;
-}
-
-bool
ManifestHandler::OnInstallationLocationValue(const char *pCharacters)
{
AppLogTag(OSP_INSTALLER, "<InstallationLocation>%s</InstallationLocation>", pCharacters);
}
bool
-ManifestHandler::OnConfigurationAppControlAppIdValue(const char* pCharacters)
-{
- TryReturn(__pLiveboxInfo, true, "[osp-installer] __pLiveboxInfo is null");
-
- __pLiveboxInfo->__configurationAppControlAppId = pCharacters;
- AppLogTag(OSP_INSTALLER, "<ConfigurationAppControlAppId>%s</ConfigurationAppControlAppId>", pCharacters);
-
- return true;
-}
-
-bool
ManifestHandler::FindElement(const char *pName)
{
bool res = false;
return true;
}
+
+AppData*
+ManifestHandler::GetAppData(void)
+{
+ return __pAppData;
+}
+
+char*
+ManifestHandler::GetDefaultIconType(void)
+{
+ return __pDefaultIconType;
+}
+
#include "XmlHandler.h"
#include "InstallationContext.h"
+class ManifestParser;
+
/**
* @class ManifestHandler
* @brief This class represents the class of ManifestHandler.
virtual ~ManifestHandler(void);
bool Construct(InstallationContext *pConext);
+ InstallationContext* GetContext(void);
bool Parse(const char *pFilepath);
+ AppData* GetAppData(void);
+ char* GetDefaultIconType(void);
+
private:
ManifestHandler(const ManifestHandler& value);
ManifestHandler& operator =(const ManifestHandler& source);
bool OnContentsStartElement(void);
bool OnContentStartElement(void);
- bool OnLiveBoxesStartElement(void);
- bool OnLiveBoxStartElement(void);
+
+ bool OnLiveboxesStartElement(const char *pName);
+ bool OnAccountsStartElement(const char *pName);
// EndElement
bool OnPrivilegesEndElement(void);
bool OnContentsEndElement(void);
bool OnContentEndElement(void);
- bool OnLiveBoxesEndElement(void);
- bool OnLiveBoxEndElement(void);
+
+ bool OnLiveboxesEndElement(void);
+ bool OnAccountsEndElement(void);
+
bool OnManifestEndElement(void);
// OnValue
private:
InstallationContext* __pContext;
Tizen::Base::Collection::ArrayList* __pPrivilegeList;
- Tizen::Base::Collection::ArrayList* __pLiveBoxList;
- Tizen::Base::Collection::ArrayList* __pContentInfoList;
+ Tizen::Base::Collection::ArrayList* __pContentDataList;
Tizen::App::Package::_PackageInfoImpl* __pPackageInfoImpl;
Tizen::App::Package::_PackageAppInfoImpl* __pPackageAppInfoImpl;
Tizen::App::Package::_AppControlInfoImpl* __pAppControlInfoImpl;
Tizen::App::Package::_DataControlTypeImpl* __pDataControlTypeImpl;
Tizen::App::Package::_LaunchConditionInfoImpl* __pLaunchConditionImpl;
Tizen::App::Package::_NotificationInfoImpl* __pNotificationImpl;
- LiveboxInfo* __pLiveboxInfo;
- ContentInfo* __pContentInfo;
+
+ ContentData* __pContentData;
char* __pDefaultIconType;
bool __isDefaultMainmenu;
AppControlData* __pSubModeAppControlData;
OperationData* __pOperationData;
+ bool __isParserMode;
+ ManifestParser* __pParser;
+
}; // ManifestHandler
#endif // _MANIFEST_HANDLER_H_
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file ManifestAccountsParser.cpp
+ * @brief This is the implementation file for %ManifestAccountsParser class.
+ */
+
+#include <FIoFile.h>
+#include <FSys_SystemInfoImpl.h>
+#include <FAppPkg_PackageInfoImpl.h>
+#include <FBase_StringConverter.h>
+
+#include "ManifestAccountsParser.h"
+#include "InstallerUtil.h"
+#include "InstallationContext.h"
+#include "ManifestHandler.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Base::Utility;
+using namespace Tizen::App::Package;
+using namespace Tizen::Io;
+using namespace Tizen::System;
+
+ManifestAccountsParser::ManifestAccountsParser(void)
+:__pContext(null)
+,__pAccountData(null)
+,__isAccountIconSelected(false)
+,__isAccountSmallIconSelected(false)
+{
+}
+
+ManifestAccountsParser::~ManifestAccountsParser(void)
+{
+ delete __pAccountData;
+}
+
+bool
+ManifestAccountsParser::OnStartElement(const char *pName)
+{
+ TryReturn(pName, true, "[osp-installer] pName is null");
+ bool status = true;
+
+ if (strcasecmp(pName, "Accounts") == 0)
+ {
+ status = OnAccountsStartElement();
+ }
+ else if (strcasecmp(pName, "AccountProvider") == 0)
+ {
+ status = OnAccountProviderStartElement();
+ }
+
+ return status;
+}
+
+bool
+ManifestAccountsParser::OnEndElement(const char *pName)
+{
+ TryReturn(pName, true, "[osp-installer] pName is null");
+ bool status = true;
+
+ if (strcasecmp(pName, "Accounts") == 0)
+ {
+ status = OnAccountsEndElement();
+ }
+ else if (strcasecmp(pName, "AccountProvider") == 0)
+ {
+ status = OnAccountProviderEndElement();
+ }
+
+ return true;
+}
+
+bool
+ManifestAccountsParser::OnCharacters(const char *pCharacters)
+{
+ TryReturn(pCharacters, true, "[osp-installer] pCharacters is null");
+ bool status = true;
+
+ ManifestHandler* pHandler = GetHandler();
+ TryReturn(pHandler, false, "[osp-installer] pHandler is null");
+
+ char *pName = pHandler->GetElementName();
+ TryReturn(pName, false, "[osp-installer] pName is null");
+
+ if (strcasecmp(pName, "DisplayName") == 0)
+ {
+ status = OnDisplayNameValue(pCharacters);
+ }
+ else if (strcasecmp(pName, "Icon") == 0)
+ {
+ status = OnIconValue(pCharacters);
+ }
+
+ return true;
+}
+
+bool
+ManifestAccountsParser::OnAccountsStartElement(void)
+{
+ ManifestHandler* __pHandler = GetHandler();
+ TryReturn(__pHandler, false, "[osp-installer] __pHandler is null");
+
+ __pContext = __pHandler->GetContext();
+ TryReturn(__pContext, false, "[osp-installer] __pContext is null");
+
+ AppLogTag(OSP_INSTALLER, " <Accounts>");
+
+ return true;
+}
+
+bool
+ManifestAccountsParser::OnAccountProviderStartElement(void)
+{
+ XmlAttribute *pAttr = null;
+
+ __pAccountData = new (std::nothrow) AccountData;
+ TryReturn(__pAccountData, false, "[osp-installer] __pAccountData is null");
+
+ ManifestHandler* pHandler = GetHandler();
+ TryReturn(pHandler, false, "[osp-installer] pHandler is null");
+
+ pAttr = pHandler->GetAttribute();
+ TryReturn(pAttr, true, "[osp-installer] pAttr is null");
+
+ AppLogTag(OSP_INSTALLER, " <AccountProvider>");
+
+ char *pProviderId = pAttr->Find("ProviderId");
+ if (pProviderId)
+ {
+ __pAccountData->__providerId = pProviderId;
+ AppLogTag(OSP_INSTALLER, " - ProviderId=%s", pProviderId);
+ }
+
+ char *pMultipleAccountsSupport = pAttr->Find("MultipleAccountsSupport");
+ if (pMultipleAccountsSupport)
+ {
+ __pAccountData->__multipleAccountsSupport = pMultipleAccountsSupport;
+ AppLogTag(OSP_INSTALLER, " - MultipleAccountsSupport=%s", pMultipleAccountsSupport);
+ }
+
+ return true;
+}
+
+bool
+ManifestAccountsParser::OnAccountsEndElement(void)
+{
+ AppLogTag(OSP_INSTALLER, " </Accounts>");
+
+ return true;
+}
+
+bool
+ManifestAccountsParser::OnAccountProviderEndElement(void)
+{
+ ManifestHandler* pHandler = GetHandler();
+ TryReturn(pHandler, false, "[osp-installer] pHandler is null");
+
+ AppData* pAppData = pHandler->GetAppData();
+ TryReturn(pAppData, false, "[osp-installer] pAppData is null");
+
+ pAppData->__pAccountDataList->Add(__pAccountData);
+ __pAccountData = null;
+ AppLogTag(OSP_INSTALLER, " </AccountProvider>");
+
+ return true;
+}
+
+bool
+ManifestAccountsParser::OnDisplayNameValue(const char *pCharacters)
+{
+ XmlAttribute* pAttr = 0;
+ char* pAttrValue = 0;
+
+ ManifestHandler* pHandler = GetHandler();
+ TryReturn(pHandler, false, "[osp-installer] pHandler is null");
+
+ pAttr = pHandler->GetAttribute();
+ TryReturn(pAttr, true, "[osp-installer] pAttr is null");
+
+ pAttrValue = pAttr->Find("Locale");
+ TryReturn(pAttrValue, true, "[osp-installer] pAttrValue is null");
+
+ String* pValue = new (std::nothrow) String;
+ StringUtil::Utf8ToString(pCharacters, *pValue);
+ __pAccountData->__pNameList->Add(new (std::nothrow) String(pAttrValue), pValue);
+
+ AppLogTag(OSP_INSTALLER, " <DisplayName>%s</DisplayName>", pCharacters);
+
+ return true;
+}
+
+bool
+ManifestAccountsParser::OnIconValue(const char *pCharacters)
+{
+ XmlAttribute* pAttr = 0;
+ char* pSectionValue = 0;
+ char* pTypeValue = 0;
+
+ ManifestHandler* pHandler = GetHandler();
+ TryReturn(pHandler, false, "[osp-installer] pHandler is null");
+
+ pAttr = pHandler->GetAttribute();
+ TryReturn(pAttr, true, "[osp-installer] pAttr is null");
+
+ pSectionValue = pAttr->Find("Section");
+ TryReturn(pSectionValue, true, "[osp-installer] pSectionValue is null");
+
+ pTypeValue = pAttr->Find("Type");
+ TryReturn(pTypeValue, true, "[osp-installer] pTypeValue is null");
+
+ char* pDefaultIconType = pHandler->GetDefaultIconType();
+ TryReturn(pDefaultIconType, false, "[osp-installer] pDefaultIconType is null");
+
+ String icon;
+ if (strcasecmp(pTypeValue, "Xhigh") == 0)
+ {
+ icon.Format(1024, L"%s/%s", "screen-density-xhigh", pCharacters);
+ }
+ else if (strcasecmp(pTypeValue, "High") == 0)
+ {
+ icon.Format(1024, L"%s/%s", "screen-density-high", pCharacters);
+ }
+ else
+ {
+ AppLogTag(OSP_INSTALLER, "Invalid Type [%s]", pDefaultIconType);
+ return false;
+ }
+
+ if (strcasecmp(pSectionValue, "Account") == 0)
+ {
+ if (__isAccountIconSelected == false)
+ {
+ __pAccountData->__accountIcon = icon;
+ }
+
+ if (strcasecmp(pTypeValue, pDefaultIconType) == 0)
+ {
+ __isAccountIconSelected = true;
+ }
+ }
+ else if (strcasecmp(pSectionValue, "AccountSmall") == 0)
+ {
+ if (__isAccountSmallIconSelected == false)
+ {
+ __pAccountData->__accountSmallIcon = icon;
+ }
+
+ if (strcasecmp(pTypeValue, pDefaultIconType) == 0)
+ {
+ __isAccountSmallIconSelected = true;
+ }
+ }
+
+ AppLogTag(OSP_INSTALLER, " <Icon Section=\"%s\" Type=\"%s\">%s</Icon>", pSectionValue, pTypeValue, pCharacters);
+
+ return true;
+}
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file ManifestAccountsParser.h
+ * @brief This is the header file for the %ManifestAccountsParser class.
+ *
+ * This header file contains the declarations of the %ManifestAccountsParser class.
+ */
+#ifndef _MANIFEST_ACCOUNTS_PARSER_H_
+#define _MANIFEST_ACCOUNTS_PARSER_H_
+
+#include <FBaseString.h>
+
+#include <FAppPkg_PackageInfoImpl.h>
+
+#include "ManifestParser.h"
+#include "InstallationContext.h"
+
+/**
+ * @class ManifestAccountsParser
+ * @brief This class represents the class of ManifestAccountsParser.
+ * @since 1.0
+ *
+ * This class represents the class of ManifestAccountsParser.
+ *
+ */
+class ManifestAccountsParser
+ : public ManifestParser
+{
+public:
+ ManifestAccountsParser(void);
+ virtual ~ManifestAccountsParser(void);
+
+ virtual bool OnStartElement(const char *pName);
+ virtual bool OnEndElement(const char *pName);
+ virtual bool OnCharacters(const char *pCharacters);
+
+private:
+ bool OnAccountsStartElement(void);
+ bool OnAccountProviderStartElement(void);
+ bool OnAccountsEndElement(void);
+ bool OnAccountProviderEndElement(void);
+
+ bool OnDisplayNameValue(const char *pCharacters);
+ bool OnIconValue(const char *pCharacters);
+
+private:
+ InstallationContext* __pContext;
+ AccountData* __pAccountData;
+ bool __isAccountIconSelected;
+ bool __isAccountSmallIconSelected;
+
+}; // ManifestAccountsParser
+
+#endif // _MANIFEST_ACCOUNTS_PARSER_H_
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file ManifestLiveboxesParser.cpp
+ * @brief This is the implementation file for %ManifestLiveboxesParser class.
+ */
+
+#include <FIoFile.h>
+#include <FSys_SystemInfoImpl.h>
+#include <FAppPkg_PackageInfoImpl.h>
+#include <FBase_StringConverter.h>
+
+#include "ManifestLiveboxesParser.h"
+#include "InstallerUtil.h"
+#include "XmlAttribute.h"
+#include "ManifestHandler.h"
+#include "InstallationContextData.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Base::Utility;
+using namespace Tizen::App::Package;
+using namespace Tizen::Io;
+using namespace Tizen::System;
+
+ManifestLiveboxesParser::ManifestLiveboxesParser(void)
+:__pContext(null)
+,__pLiveboxDataList(null)
+,__pLiveboxData(null)
+{
+}
+
+ManifestLiveboxesParser::~ManifestLiveboxesParser(void)
+{
+}
+
+bool
+ManifestLiveboxesParser::OnStartElement(const char *pName)
+{
+ TryReturn(pName, true, "[osp-installer] pName is null");
+
+ bool status = true;
+
+ if (strcasecmp(pName, "Liveboxes") == 0)
+ {
+ status = OnLiveboxesStartElement();
+ }
+ else if (strcasecmp(pName, "Livebox") == 0)
+ {
+ status = OnLiveboxStartElement();
+ }
+
+ return status;
+}
+
+bool
+ManifestLiveboxesParser::OnEndElement(const char *pName)
+{
+ TryReturn(pName, true, "[osp-installer] pName is null");
+
+ bool status = true;
+
+ if (strcasecmp(pName, "Liveboxes") == 0)
+ {
+ status = OnLiveboxesEndElement();
+ }
+ else if (strcasecmp(pName, "Livebox") == 0)
+ {
+ status = OnLiveboxEndElement();
+ }
+
+ return status;
+}
+
+bool
+ManifestLiveboxesParser::OnCharacters(const char *pCharacters)
+{
+ TryReturn(pCharacters, true, "[osp-installer] pCharacters is null");
+
+ bool status = true;
+
+ ManifestHandler* pHandler = GetHandler();
+ TryReturn(pHandler, false, "[osp-installer] pHandler is null");
+
+ char *pName = pHandler->GetElementName();
+ TryReturn(pName, false, "[osp-installer] pName is null");
+
+ if (strcasecmp(pName, "DisplayName") == 0)
+ {
+ status = OnDisplayNameValue(pCharacters);
+ }
+ else if (strcasecmp(pName, "Size") == 0)
+ {
+ status = OnSizeValue(pCharacters);
+ }
+ else if (strcasecmp(pName, "ConfigurationAppControlAppId") == 0)
+ {
+ status = OnConfigurationAppControlAppIdValue(pCharacters);
+ }
+
+ return status;
+}
+
+bool
+ManifestLiveboxesParser::OnLiveboxesStartElement()
+{
+ ManifestHandler* __pHandler = GetHandler();
+ TryReturn(__pHandler, false, "[osp-installer] __pHandler is null");
+
+ __pContext = __pHandler->GetContext();
+ TryReturn(__pContext, false, "[osp-installer] __pContext is null");
+
+ __pLiveboxDataList = new (std::nothrow) ArrayList;
+ TryReturn(__pLiveboxDataList, false, "[osp-installer] __pLiveboxDataList is null");
+
+ AppLogTag(OSP_INSTALLER, " <Liveboxes>");
+
+ return true;
+}
+
+bool
+ManifestLiveboxesParser::OnLiveboxStartElement(void)
+{
+ XmlAttribute *pAttr = null;
+
+ __pLiveboxData = new (std::nothrow) LiveboxData;
+ TryReturn(__pLiveboxData, false, "[osp-installer] __pLiveboxData is null");
+
+ ManifestHandler* pHandler = GetHandler();
+ TryReturn(pHandler, false, "[osp-installer] pHandler is null");
+
+ pAttr = pHandler->GetAttribute();
+ TryReturn(pAttr, true, "[osp-installer] pAttr is null");
+
+ AppLogTag(OSP_INSTALLER, " <Livebox>");
+
+ char *pProviderName = pAttr->Find("ProviderName");
+ if (pProviderName)
+ {
+ __pLiveboxData->SetName(pProviderName);
+ AppLogTag(OSP_INSTALLER, " - ProviderName=%s", pProviderName);
+ }
+
+ char *pUpdatePeriod = pAttr->Find("UpdatePeriod");
+ if (pUpdatePeriod)
+ {
+ long long updatePeriod = atoll(pUpdatePeriod);
+ __pLiveboxData->SetUpdatePeriod(updatePeriod);
+ AppLogTag(OSP_INSTALLER, " - UpdatePeriod=%lld", updatePeriod);
+ }
+
+ char *pLiveboxPopupEnabled = pAttr->Find("LiveboxPopupEnabled");
+ if (pLiveboxPopupEnabled)
+ {
+ __pLiveboxData->SetPopupEnabled(pLiveboxPopupEnabled);
+ AppLogTag(OSP_INSTALLER, " - LiveboxPopupEnabled=%s", pLiveboxPopupEnabled);
+ }
+
+ char *pMain = pAttr->Find("Main");
+ if (pMain)
+ {
+ __pLiveboxData->__main = pMain;
+ AppLogTag(OSP_INSTALLER, " - Main=%s", pMain);
+ }
+
+ return true;
+}
+
+bool
+ManifestLiveboxesParser::OnLiveboxesEndElement(void)
+{
+ __pContext->SetLiveboxDataList(__pLiveboxDataList);
+ __pLiveboxDataList = null;
+ AppLogTag(OSP_INSTALLER, " </Liveboxes>");
+
+ return true;
+}
+
+bool
+ManifestLiveboxesParser::OnLiveboxEndElement(void)
+{
+ __pLiveboxDataList->Add(*__pLiveboxData);
+ __pLiveboxData = null;
+ AppLogTag(OSP_INSTALLER, " </Livebox>");
+
+ return true;
+}
+
+bool
+ManifestLiveboxesParser::OnSizeValue(const char *pCharacters)
+{
+ __pLiveboxData->AddSize(*(new (std::nothrow) String(pCharacters)));
+
+ AppLogTag(OSP_INSTALLER, " <Size>%s</Size>", pCharacters);
+ return true;
+}
+
+bool
+ManifestLiveboxesParser::OnDisplayNameValue(const char *pCharacters)
+{
+ XmlAttribute* pAttr = 0;
+ char* pAttrValue = 0;
+
+ ManifestHandler* pHandler = GetHandler();
+ TryReturn(pHandler, false, "[osp-installer] pHandler is null");
+
+ pAttr = pHandler->GetAttribute();
+ TryReturn(pAttr, true, "[osp-installer] pAttr is null");
+
+ pAttrValue = pAttr->Find("Locale");
+ TryReturn(pAttrValue, true, "[osp-installer] pAttrValue is null");
+
+ String* pValue = new (std::nothrow) String;
+ StringUtil::Utf8ToString(pCharacters, *pValue);
+ __pLiveboxData->AddName(*(new (std::nothrow) String(pAttrValue)), *pValue);
+
+ AppLogTag(OSP_INSTALLER, " <DisplayName>%s</DisplayName>", pCharacters);
+
+ return true;
+}
+
+bool
+ManifestLiveboxesParser::OnConfigurationAppControlAppIdValue(const char* pCharacters)
+{
+ __pLiveboxData->__configurationAppControlAppId = pCharacters;
+ AppLogTag(OSP_INSTALLER, " <ConfigurationAppControlAppId>%s</ConfigurationAppControlAppId>", pCharacters);
+
+ return true;
+}
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file ManifestLiveboxesParser.h
+ * @brief This is the header file for the %ManifestLiveboxesParser class.
+ *
+ * This header file contains the declarations of the %ManifestLiveboxesParser class.
+ */
+#ifndef _MANIFEST_LIVEBOXES_PARSER_H_
+#define _MANIFEST_LIVEBOXES_PARSER_H_
+
+#include <FBaseString.h>
+
+#include <FAppPkg_PackageInfoImpl.h>
+
+#include "ManifestParser.h"
+#include "InstallationContext.h"
+
+/**
+ * @class ManifestLiveboxesParser
+ * @brief This class represents the class of ManifestLiveboxesParser.
+ * @since 1.0
+ *
+ * This class represents the class of ManifestLiveboxesParser.
+ *
+ */
+class ManifestLiveboxesParser
+ : public ManifestParser
+{
+public:
+ ManifestLiveboxesParser(void);
+ virtual ~ManifestLiveboxesParser(void);
+
+ virtual bool OnStartElement(const char *pName);
+ virtual bool OnEndElement(const char *pName);
+ virtual bool OnCharacters(const char *pCharacters);
+
+private:
+ bool OnLiveboxesStartElement(void);
+ bool OnLiveboxStartElement(void);
+
+ bool OnLiveboxesEndElement(void);
+ bool OnLiveboxEndElement(void);
+
+ bool OnSizeValue(const char *pCharacters);
+ bool OnDisplayNameValue(const char *pCharacters);
+ bool OnConfigurationAppControlAppIdValue(const char* pCharacters);
+
+private:
+ InstallationContext* __pContext;
+ Tizen::Base::Collection::ArrayList* __pLiveboxDataList;
+ LiveboxData* __pLiveboxData;
+
+}; // ManifestLiveboxesParser
+
+#endif // _MANIFEST_LIVEBOXES_PARSER_H_
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file ManifestParser.cpp
+ * @brief This is the implementation file for %ManifestParser class.
+ */
+
+#include <FIoFile.h>
+#include <FSys_SystemInfoImpl.h>
+#include <FAppPkg_PackageInfoImpl.h>
+#include <FBase_StringConverter.h>
+
+#include "ManifestParser.h"
+#include "InstallerUtil.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Base::Utility;
+using namespace Tizen::App::Package;
+using namespace Tizen::Io;
+using namespace Tizen::System;
+
+ManifestParser::ManifestParser(void)
+:__pManifestHandler(null)
+{
+}
+
+ManifestParser::~ManifestParser(void)
+{
+}
+
+bool
+ManifestParser::Construct(ManifestHandler* pManifestHandler)
+{
+ __pManifestHandler = pManifestHandler;
+
+ return true;
+}
+
+ManifestHandler*
+ManifestParser::GetHandler(void)
+{
+ return __pManifestHandler;
+}
+
+bool
+ManifestParser::OnStartElement(const char *pName)
+{
+ return true;
+}
+
+bool
+ManifestParser::OnEndElement(const char *pName)
+{
+ return true;
+}
+
+bool
+ManifestParser::OnCharacters(const char *pCharacters)
+{
+ return true;
+}
+
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file ManifestParser.h
+ * @brief This is the header file for the %ManifestParser class.
+ *
+ * This header file contains the declarations of the %ManifestParser class.
+ */
+#ifndef _MANIFEST_PARSER_H_
+#define _MANIFEST_PARSER_H_
+
+#include <FBaseString.h>
+
+#include <FAppPkg_PackageInfoImpl.h>
+
+#include "InstallationContext.h"
+
+class ManifestHandler;
+
+/**
+ * @class ManifestParser
+ * @brief This class represents the class of ManifestParser.
+ * @since 1.0
+ *
+ * This class represents the class of ManifestParser.
+ *
+ */
+class ManifestParser
+{
+public:
+ ManifestParser(void);
+ virtual ~ManifestParser(void);
+
+ bool Construct(ManifestHandler* pManifestHandler);
+ ManifestHandler* GetHandler(void);
+
+ virtual bool OnStartElement(const char *pName);
+ virtual bool OnEndElement(const char *pName);
+ virtual bool OnCharacters(const char *pCharacters);
+
+private:
+ ManifestHandler* __pManifestHandler;
+
+}; // ManifestParser
+
+#endif // _MANIFEST_PARSER_H_
void SetError(void);
bool GetError(void);
+ char* GetElementName(void);
+ XmlAttribute* GetAttribute(void);
+ Tizen::Base::Collection::IEnumerator* GetElementEnumeratorN(void);
+ int GetElementCount(void);
+
protected:
bool ParseDocument(const char *pFilepath);
bool ParseNormalizedDocument(const char* pFilepath);
int Normalize(const char* pBuf, int size, char* pNormalizedBuf);
bool SetElementName(const char *pElementName);
- char* GetElementName(void);
void DeleteElement(void);
void SetAttribute(XmlAttribute *pAttr);
- XmlAttribute* GetAttribute(void);
void DeleteAttribute(void);
- Tizen::Base::Collection::IEnumerator* GetElementEnumeratorN(void);
- int GetElementCount(void);
-
private:
XmlHandler(const XmlHandler& value);
XmlHandler& operator =(const XmlHandler& source);
err = xmlTextWriterEndDocument(__pXmlWriter);
if (err != 0)
{
- AppLogTag(OSP_INSTALLER, "xmlTextWriterEndDocument() is failed");
+ AppLogTag(OSP_INSTALLER, "xmlTextWriterEndDocument() is failed(%d)", err);
}
File file;