From e6b7c0f4c2e379706c4ac51e127779b9591a73f3 Mon Sep 17 00:00:00 2001 From: Soyoung Kim Date: Wed, 23 Jan 2013 21:11:17 +0900 Subject: [PATCH] Change pkgname to appid and add package id PART 1. pkgname API remain for other pakcages. But will be removed. [Issue#] N/A [Problem] pkgname should be appid. [Cause] N/A [Solution] fixed pkgname to appid. [SCMRequest] this package should be imported with wrt-installer. Change-Id: I56e2ab5251c20ac2cacdc82be19fbed5bcde9542 --- .../dao/security_origin_dao.cpp | 6 +- modules/widget_dao/dao/property_dao.cpp | 30 +++---- modules/widget_dao/dao/property_dao_read_only.cpp | 36 ++++---- modules/widget_dao/dao/widget_dao.cpp | 43 +++++----- modules/widget_dao/dao/widget_dao_read_only.cpp | 97 +++++++++++++++------- .../include/dpl/wrt-dao-ro/common_dao_types.h | 3 + .../include/dpl/wrt-dao-ro/config_parser_data.h | 2 + .../dpl/wrt-dao-ro/property_dao_read_only.h | 10 +-- .../include/dpl/wrt-dao-ro/vconf_config.h | 28 +++---- .../include/dpl/wrt-dao-ro/widget_config.h | 20 ++--- .../include/dpl/wrt-dao-ro/widget_dao_read_only.h | 51 ++++++++++-- .../include/dpl/wrt-dao-rw/property_dao.h | 6 +- .../widget_dao/include/dpl/wrt-dao-rw/widget_dao.h | 28 +++---- modules/widget_dao/orm/wrt_db | 11 +-- 14 files changed, 225 insertions(+), 146 deletions(-) diff --git a/modules/security_origin_dao/dao/security_origin_dao.cpp b/modules/security_origin_dao/dao/security_origin_dao.cpp index 377358c..dda13e6 100644 --- a/modules/security_origin_dao/dao/security_origin_dao.cpp +++ b/modules/security_origin_dao/dao/security_origin_dao.cpp @@ -72,16 +72,16 @@ std::string createDatabasePath(int widgetHandle) using namespace WrtDB::WidgetConfig; using namespace WrtDB::GlobalConfig; - WrtDB::WidgetPkgName pkgname; + WrtDB::TizenAppId appid; Try { - pkgname = WrtDB::WidgetDAOReadOnly::getPkgName(widgetHandle); + appid = WrtDB::WidgetDAOReadOnly::getTzAppId(widgetHandle); } Catch(DPL::DB::SqlConnection::Exception::Base) { LogError("Failed to get database Path"); } - return createDatabasePath(pkgname); + return createDatabasePath(appid); } void checkDatabase(std::string databasePath) diff --git a/modules/widget_dao/dao/property_dao.cpp b/modules/widget_dao/dao/property_dao.cpp index b509118..a3cc3a9 100644 --- a/modules/widget_dao/dao/property_dao.cpp +++ b/modules/widget_dao/dao/property_dao.cpp @@ -34,22 +34,22 @@ namespace PropertyDAO { void RemoveProperty(DbWidgetHandle widgetHandle, const PropertyDAOReadOnly::WidgetPropertyKey &key) { - RemoveProperty(WidgetDAOReadOnly::getPkgName(widgetHandle),key); + RemoveProperty(WidgetDAOReadOnly::getTzAppId(widgetHandle),key); } -void RemoveProperty(WidgetPkgName pkgName, +void RemoveProperty(TizenAppId tzAppid, const PropertyDAOReadOnly::WidgetPropertyKey &key) { //TODO below there are two queries. // First query asks if given property can be removed, // Second removes it. Maybe it should be combined two one. - LogDebug("Removing Property. pkgName: " << pkgName << ", key: " << key); + LogDebug("Removing Property. appid: " << tzAppid << ", key: " << key); Try { DPL::DB::ORM::wrt::ScopedTransaction transaction(&WrtDatabase::interface()); DPL::OptionalInt readonly = PropertyDAOReadOnly::CheckPropertyReadFlag( - pkgName, + tzAppid, key); if (!readonly.IsNull() && *readonly == 1) { LogError("'" << key << @@ -64,7 +64,7 @@ void RemoveProperty(WidgetPkgName pkgName, using namespace DPL::DB::ORM::wrt; WRT_DB_DELETE(del, WidgetPreference, &WrtDatabase::interface()) del->Where(And( - Equals(pkgName), + Equals(tzAppid), Equals(key))); del->Execute(); @@ -82,15 +82,15 @@ void SetProperty(DbWidgetHandle widgetHandle, const PropertyDAOReadOnly::WidgetPropertyValue &value, bool readOnly) { - SetProperty(WidgetDAOReadOnly::getPkgName(widgetHandle),key,value,readOnly); + SetProperty(WidgetDAOReadOnly::getTzAppId(widgetHandle),key,value,readOnly); } -void SetProperty(WidgetPkgName pkgName, +void SetProperty(TizenAppId tzAppid, const PropertyDAOReadOnly::WidgetPropertyKey &key, const PropertyDAOReadOnly::WidgetPropertyValue &value, bool readOnly) { - LogDebug("Setting/updating Property. pkgName: " << pkgName << + LogDebug("Setting/updating Property. appid: " << tzAppid << ", key: " << key); Try { using namespace DPL::DB::ORM; @@ -98,7 +98,7 @@ void SetProperty(WidgetPkgName pkgName, DPL::DB::ORM::wrt::ScopedTransaction transaction(&WrtDatabase::interface()); DPL::OptionalInt readonly = PropertyDAOReadOnly::CheckPropertyReadFlag( - pkgName, + tzAppid, key); if (!readonly.IsNull() && *readonly == 1) { LogError("'" << key << @@ -109,7 +109,7 @@ void SetProperty(WidgetPkgName pkgName, if (readonly.IsNull()) { WidgetPreference::Row row; - row.Set_pkgname(pkgName); + row.Set_tizen_appid(tzAppid); row.Set_key_name(key); row.Set_key_value(value); row.Set_readonly(readOnly ? 1 : 0); @@ -123,7 +123,7 @@ void SetProperty(WidgetPkgName pkgName, WRT_DB_UPDATE(update, WidgetPreference, &WrtDatabase::interface()) update->Where(And( - Equals(pkgName), + Equals(tzAppid), Equals(key))); update->Values(row); @@ -141,13 +141,13 @@ void SetProperty(WidgetPkgName pkgName, void RegisterProperties(DbWidgetHandle widgetHandle, const WidgetRegisterInfo ®Info) { - RegisterProperties(WidgetDAOReadOnly::getPkgName(widgetHandle),regInfo); + RegisterProperties(WidgetDAOReadOnly::getTzAppId(widgetHandle),regInfo); } -void RegisterProperties(WidgetPkgName pkgName, +void RegisterProperties(TizenAppId tzAppid, const WidgetRegisterInfo ®Info) { - LogDebug("Registering proferences for widget. pkgName: " << pkgName); + LogDebug("Registering proferences for widget. appid: " << tzAppid); // Try-Catch in WidgetDAO @@ -159,7 +159,7 @@ void RegisterProperties(WidgetPkgName pkgName, { { // Insert into table Widget Preferences WidgetPreference::Row row; - row.Set_pkgname(pkgName); + row.Set_tizen_appid(tzAppid); row.Set_key_name(it->name); row.Set_key_value(it->value); int readonly = true == it->readonly ? 1 : 0; diff --git a/modules/widget_dao/dao/property_dao_read_only.cpp b/modules/widget_dao/dao/property_dao_read_only.cpp index 1bc172c..54ea797 100644 --- a/modules/widget_dao/dao/property_dao_read_only.cpp +++ b/modules/widget_dao/dao/property_dao_read_only.cpp @@ -59,7 +59,7 @@ void convertWidgetPreferenceRow(const ORMWidgetPreferenceList& ormWidgetPrefRow, FOREACH(it, ormWidgetPrefRow) { WidgetPreferenceRow row; - row.pkgname = it->Get_pkgname(); + row.tizen_appid = it->Get_tizen_appid(); row.key_name = it->Get_key_name(); row.key_value = it->Get_key_value(); row.readonly = it->Get_readonly(); @@ -83,21 +83,21 @@ void convertWidgetPropertyKeyList(const ORMWidgetPropertyKeyList& propKeyList, DPL::OptionalInt CheckPropertyReadFlag(DbWidgetHandle widgetHandle, const WidgetPropertyKey &key) { - return CheckPropertyReadFlag(WidgetDAOReadOnly::getPkgName(widgetHandle), + return CheckPropertyReadFlag(WidgetDAOReadOnly::getTzAppId(widgetHandle), key); } -DPL::OptionalInt CheckPropertyReadFlag(WidgetPkgName pkgName, +DPL::OptionalInt CheckPropertyReadFlag(TizenAppId tzAppid, const WidgetPropertyKey &key) { - LogDebug("Checking Property flag. pkgName: " << pkgName << + LogDebug("Checking Property flag. appid: " << tzAppid << ", key: " << key); Try { using namespace DPL::DB::ORM; using namespace DPL::DB::ORM::wrt; WRT_DB_SELECT(select, WidgetPreference, &WrtDatabase::interface()) - select->Where(And(Equals(pkgName), + select->Where(And(Equals(tzAppid), Equals(key))); return select->GetSingleValue(); @@ -111,18 +111,18 @@ DPL::OptionalInt CheckPropertyReadFlag(WidgetPkgName pkgName, //deprecated WidgetPropertyKeyList GetPropertyKeyList(DbWidgetHandle widgetHandle) { - return GetPropertyKeyList(WidgetDAOReadOnly::getPkgName(widgetHandle)); + return GetPropertyKeyList(WidgetDAOReadOnly::getTzAppId(widgetHandle)); } -WidgetPropertyKeyList GetPropertyKeyList(WidgetPkgName pkgName) +WidgetPropertyKeyList GetPropertyKeyList(TizenAppId tzAppid) { - LogDebug("Get PropertyKey list. pkgName: " << pkgName); + LogDebug("Get PropertyKey list. appid: " << tzAppid); Try { using namespace DPL::DB::ORM; using namespace DPL::DB::ORM::wrt; ORMWidgetPropertyKeyList keyList; WRT_DB_SELECT(select, WidgetPreference, &WrtDatabase::interface()) - select->Where(Equals(pkgName)); + select->Where(Equals(tzAppid)); keyList = select->GetValueList(); WidgetPropertyKeyList retKeyList; @@ -140,22 +140,22 @@ WidgetPropertyKeyList GetPropertyKeyList(WidgetPkgName pkgName) WidgetPreferenceList GetPropertyList(DbWidgetHandle widgetHandle) { Try{ - WidgetPkgName pkgName=WidgetDAOReadOnly::getPkgName(widgetHandle); - return GetPropertyList(pkgName); + TizenAppId tzAppid = WidgetDAOReadOnly::getTzAppId(widgetHandle); + return GetPropertyList(tzAppid); }Catch(WidgetDAOReadOnly::Exception::WidgetNotExist){ WidgetPreferenceList empty; return empty; } } -WidgetPreferenceList GetPropertyList(WidgetPkgName pkgName) +WidgetPreferenceList GetPropertyList(TizenAppId tzAppId) { - LogDebug("Get Property list. pkgName: " << pkgName); + LogDebug("Get Property list. tizenAppId: " << tzAppId); Try { using namespace DPL::DB::ORM; using namespace DPL::DB::ORM::wrt; WRT_DB_SELECT(select, WidgetPreference, &WrtDatabase::interface()) - select->Where(Equals(pkgName)); + select->Where(Equals(tzAppId)); ORMWidgetPreferenceList ormPrefList = select->GetRowList(); WidgetPreferenceList prefList; @@ -173,19 +173,19 @@ WidgetPreferenceList GetPropertyList(WidgetPkgName pkgName) WidgetPropertyValue GetPropertyValue(DbWidgetHandle widgetHandle, const WidgetPropertyKey &key) { - return GetPropertyValue(WidgetDAOReadOnly::getPkgName(widgetHandle),key); + return GetPropertyValue(WidgetDAOReadOnly::getTzAppId(widgetHandle),key); } -WidgetPropertyValue GetPropertyValue(WidgetPkgName pkgName, +WidgetPropertyValue GetPropertyValue(TizenAppId tzAppid, const WidgetPropertyKey &key) { - LogDebug("Get Property value. pkgName: " << pkgName << + LogDebug("Get Property value. appid: " << tzAppid << ", key: " << key); Try { using namespace DPL::DB::ORM; using namespace DPL::DB::ORM::wrt; WRT_DB_SELECT(select, WidgetPreference, &WrtDatabase::interface()) - select->Where(And(Equals(pkgName), + select->Where(And(Equals(tzAppid), Equals(key))); ORMWidgetPropertyValue ormPropValue = diff --git a/modules/widget_dao/dao/widget_dao.cpp b/modules/widget_dao/dao/widget_dao.cpp index bd421dd..f22671e 100644 --- a/modules/widget_dao/dao/widget_dao.cpp +++ b/modules/widget_dao/dao/widget_dao.cpp @@ -56,8 +56,8 @@ WidgetDAO::WidgetDAO(DPL::OptionalString widgetGUID) : { } -WidgetDAO::WidgetDAO(DPL::String pkgName) : - WidgetDAOReadOnly(WidgetDAOReadOnly::getHandle(pkgName)) +WidgetDAO::WidgetDAO(DPL::String tzAppId) : + WidgetDAOReadOnly(WidgetDAOReadOnly::getHandle(tzAppId)) { } @@ -96,7 +96,7 @@ void WidgetDAO::setProperty( } } -void WidgetDAO::setPkgName(const WidgetPkgName& pkgName) +void WidgetDAO::setTizenAppId(const DPL::OptionalString& tzAppId) { SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN { @@ -109,7 +109,7 @@ void WidgetDAO::setPkgName(const WidgetPkgName& pkgName) } wrt::WidgetInfo::Row row; - row.Set_pkgname(pkgName); + row.Set_tizen_appid(*tzAppId); WRT_DB_UPDATE(update, wrt::WidgetInfo, &WrtDatabase::interface()) update->Where( @@ -253,7 +253,7 @@ void WidgetDAO::setFileSystemUsage(const SettingsType value) } void WidgetDAO::registerWidget( - const WidgetPkgName & widgetPkgname, + const TizenAppId & tzAppId, const WidgetRegisterInfo &widgetRegInfo, const IWacSecurity &wacSecurity) { @@ -261,7 +261,7 @@ void WidgetDAO::registerWidget( SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN { DPL::DB::ORM::wrt::ScopedTransaction transaction(&WrtDatabase::interface()); - registerWidgetInternal(widgetPkgname, widgetRegInfo, wacSecurity); + registerWidgetInternal(tzAppId, widgetRegInfo, wacSecurity); transaction.Commit(); } SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to register widget") @@ -299,24 +299,24 @@ DbWidgetHandle WidgetDAO::registerWidget( return widgetHandle; } -WidgetPkgName WidgetDAO::registerWidgetGenerateTizenId( +TizenAppId WidgetDAO::registerWidgetGeneratePkgId( const WidgetRegisterInfo &pWidgetRegisterInfo, const IWacSecurity &wacSecurity) { - WidgetPkgName widgetPkgName = generateTizenId(); - registerWidget(widgetPkgName, pWidgetRegisterInfo, wacSecurity); - return widgetPkgName; + TizenAppId tzAppId = generatePkgId(); + registerWidget(tzAppId, pWidgetRegisterInfo, wacSecurity); + return tzAppId; } void WidgetDAO::registerWidgetInternal( - const WidgetPkgName & widgetName, + const TizenAppId & tzAppId, const WidgetRegisterInfo &widgetRegInfo, const IWacSecurity &wacSecurity, const DPL::Optional handle) { //Register into WidgetInfo has to be first //as all other tables depend upon that - DbWidgetHandle widgetHandle = registerWidgetInfo(widgetName, widgetRegInfo, wacSecurity, handle); + DbWidgetHandle widgetHandle = registerWidgetInfo(tzAppId, widgetRegInfo, wacSecurity, handle); registerWidgetExtendedInfo(widgetHandle, widgetRegInfo); @@ -358,7 +358,7 @@ void WidgetDAO::registerWidgetInternal( } void WidgetDAO::registerOrUpdateWidget( - const WidgetPkgName & widgetName, + const TizenAppId & widgetName, const WidgetRegisterInfo &widgetRegInfo, const IWacSecurity &wacSecurity) { @@ -403,7 +403,7 @@ void WidgetDAO::registerWidgetExtendedInfo(DbWidgetHandle widgetHandle, } DbWidgetHandle WidgetDAO::registerWidgetInfo( - const WidgetPkgName & widgetName, + const TizenAppId & tzAppId, const WidgetRegisterInfo ®Info, const IWacSecurity &wacSecurity, const DPL::Optional handle) @@ -442,7 +442,8 @@ DbWidgetHandle WidgetDAO::registerWidgetInfo( row.Set_recognized(wacSecurity.isRecognized()); row.Set_wac_signed(wacSecurity.isWacSigned()); row.Set_distributor_signed(wacSecurity.isDistributorSigned()); - row.Set_pkgname(widgetName); + row.Set_tizen_appid(tzAppId); + row.Set_tizen_pkgid(regInfo.tzPkgid); { std::stringstream tmp; tmp << regInfo.minVersion; @@ -466,7 +467,7 @@ DbWidgetHandle WidgetDAO::registerWidgetInfo( { //get autoincremented value of widgetHandle WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface()) - select->Where(Equals(widgetName)); + select->Where(Equals(tzAppId)); return select->GetSingleValue(); } else @@ -824,13 +825,13 @@ void WidgetDAO::unregisterAllExternalLocations() del->Execute(); } -void WidgetDAO::unregisterWidget(const WidgetPkgName & pkgName) +void WidgetDAO::unregisterWidget(const TizenAppId & tzAppId) { - LogDebug("Unregistering widget from DB. PkgName: " << pkgName); + LogDebug("Unregistering widget from DB. tzAppId: " << tzAppId); SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN { DPL::DB::ORM::wrt::ScopedTransaction transaction(&WrtDatabase::interface()); - unregisterWidgetInternal(pkgName); + unregisterWidgetInternal(tzAppId); transaction.Commit(); } SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to unregister widget") @@ -856,12 +857,12 @@ void WidgetDAO::unregisterWidget(WrtDB::DbWidgetHandle handle) } void WidgetDAO::unregisterWidgetInternal( - const WidgetPkgName & pkgName) + const TizenAppId & tzAppId) { using namespace DPL::DB::ORM; using namespace DPL::DB::ORM::wrt; - DbWidgetHandle handle = getHandle(pkgName); + DbWidgetHandle handle = getHandle(tzAppId); // Delete from table Widget Info WRT_DB_DELETE(del, WidgetInfo, &WrtDatabase::interface()) diff --git a/modules/widget_dao/dao/widget_dao_read_only.cpp b/modules/widget_dao/dao/widget_dao_read_only.cpp index e5a528a..03ed365 100644 --- a/modules/widget_dao/dao/widget_dao_read_only.cpp +++ b/modules/widget_dao/dao/widget_dao_read_only.cpp @@ -113,9 +113,9 @@ WidgetSecuritySettingsRow getWidgetSecuritySettingsRow(int widgetHandle) const int MAX_TIZENID_LENGTH = 10; -WidgetPkgName getPkgNameByHandle(const DbWidgetHandle handle) +TizenAppId getTizenAppIdByHandle(const DbWidgetHandle handle) { - LogDebug("Getting WidgetPkgName by DbWidgetHandle: " << handle); + LogDebug("Getting TizenAppId by DbWidgetHandle: " << handle); SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN { @@ -127,9 +127,9 @@ WidgetPkgName getPkgNameByHandle(const DbWidgetHandle handle) ThrowMsg(WidgetDAOReadOnly::Exception::WidgetNotExist, "Failed to get widget by handle"); } - WidgetPkgName pkgname = rowList.front().Get_pkgname(); + TizenAppId tzAppid = rowList.front().Get_tizen_appid(); - return pkgname; + return tzAppid; } SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed in getHandle") @@ -151,8 +151,8 @@ WidgetDAOReadOnly::WidgetDAOReadOnly(DPL::OptionalString widgetGUID) : { } -WidgetDAOReadOnly::WidgetDAOReadOnly(DPL::String pkgName) : - m_widgetHandle(WidgetDAOReadOnly::getHandle(pkgName)) +WidgetDAOReadOnly::WidgetDAOReadOnly(DPL::String tzAppid) : + m_widgetHandle(WidgetDAOReadOnly::getHandle(tzAppid)) { } @@ -185,14 +185,14 @@ DbWidgetHandle WidgetDAOReadOnly::getHandle(const WidgetGUID GUID) SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed in getHandle") } -DbWidgetHandle WidgetDAOReadOnly::getHandle(const DPL::String pkgName) +DbWidgetHandle WidgetDAOReadOnly::getHandle(const DPL::String tzAppId) { - LogDebug("Getting WidgetHandle by Package Name [" << pkgName << "]"); + LogDebug("Getting WidgetHandle by tizen app id [" << tzAppId << "]"); SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN { WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface()) - select->Where(Equals(pkgName)); + select->Where(Equals(tzAppId)); WidgetInfo::Select::RowList rowList = select->GetRowList(); if (rowList.empty()) { @@ -206,41 +206,56 @@ DbWidgetHandle WidgetDAOReadOnly::getHandle(const DPL::String pkgName) WidgetPkgName WidgetDAOReadOnly::getPkgName() const { - return getPkgNameByHandle(m_widgetHandle); + return getTzAppId(); } WidgetPkgName WidgetDAOReadOnly::getPkgName(const WidgetGUID GUID) { - return getPkgNameByHandle(getHandle(GUID)); + return getTzAppId(GUID); } WidgetPkgName WidgetDAOReadOnly::getPkgName(const DbWidgetHandle handle) { - return getPkgNameByHandle(handle); + return getTzAppId(handle); +} + +TizenAppId WidgetDAOReadOnly::getTzAppId() const +{ + return getTizenAppIdByHandle(m_widgetHandle); +} + +TizenAppId WidgetDAOReadOnly::getTzAppId(const WidgetGUID GUID) +{ + return getTizenAppIdByHandle(getHandle(GUID)); +} + +TizenAppId WidgetDAOReadOnly::getTzAppId(const DbWidgetHandle handle) +{ + return getTizenAppIdByHandle(handle); } PropertyDAOReadOnly::WidgetPropertyKeyList WidgetDAOReadOnly::getPropertyKeyList() const { - return PropertyDAOReadOnly::GetPropertyKeyList(getPkgName()); + return PropertyDAOReadOnly::GetPropertyKeyList(getTzAppId()); } PropertyDAOReadOnly::WidgetPreferenceList WidgetDAOReadOnly::getPropertyList() const { - return PropertyDAOReadOnly::GetPropertyList(getPkgName()); + return PropertyDAOReadOnly::GetPropertyList(getTzAppId()); } PropertyDAOReadOnly::WidgetPropertyValue WidgetDAOReadOnly::getPropertyValue( const PropertyDAOReadOnly::WidgetPropertyKey &key) const { - return PropertyDAOReadOnly::GetPropertyValue(getPkgName(), key); + return PropertyDAOReadOnly::GetPropertyValue(getTzAppId(), key); } DPL::OptionalInt WidgetDAOReadOnly::checkPropertyReadFlag( const PropertyDAOReadOnly::WidgetPropertyKey &key) const { - return PropertyDAOReadOnly::CheckPropertyReadFlag(getPkgName(), key); + return PropertyDAOReadOnly::CheckPropertyReadFlag(getTzAppId(), key); } DPL::String WidgetDAOReadOnly::getPath() const @@ -408,11 +423,21 @@ WidgetPkgNameList WidgetDAOReadOnly::getPkgnameList() SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN { WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface()) - return select->GetValueList(); + return select->GetValueList(); } SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get Pkgname list") } +TizenAppIdList WidgetDAOReadOnly::getTizenAppidList() +{ + LogDebug("Getting Pkgname List "); + SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN + { + WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface()) + return select->GetValueList(); + } + SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get Pkgname list") +} DbWidgetDAOReadOnlyList WidgetDAOReadOnly::getWidgetList() { @@ -439,13 +464,13 @@ bool WidgetDAOReadOnly::isWidgetInstalled(DbWidgetHandle handle) SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to check if widget exist") } -bool WidgetDAOReadOnly::isWidgetInstalled(const WidgetPkgName & pkgName) +bool WidgetDAOReadOnly::isWidgetInstalled(const TizenAppId &tzAppId) { - LogDebug("Checking if widget exist. package name " << pkgName); + LogDebug("Checking if widget exist. tizen app id" << tzAppId); SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN { WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface()) - select->Where(Equals(pkgName)); + select->Where(Equals(tzAppId)); WidgetInfo::Select::RowList rows = select->GetRowList(); @@ -518,6 +543,11 @@ WidgetGUID WidgetDAOReadOnly::getGUID() const return row.Get_widget_id(); } +DPL::OptionalString WidgetDAOReadOnly::getTizenAppId() const +{ + return DPL::OptionalString(getTzAppId()); +} + DPL::OptionalString WidgetDAOReadOnly::getDefaultlocale() const { WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle); @@ -992,9 +1022,9 @@ std::string WidgetDAOReadOnly::getCookieDatabasePath() const using namespace WrtDB::WidgetConfig; std::ostringstream path; - WidgetPkgName pkgname = getPkgName(); + TizenAppId tzAppId = getTzAppId(); - path << GetWidgetPersistentStoragePath(pkgname); + path << GetWidgetPersistentStoragePath(tzAppId); path << "/"; path << GlobalConfig::GetCookieDatabaseFile(); @@ -1004,8 +1034,8 @@ std::string WidgetDAOReadOnly::getCookieDatabasePath() const std::string WidgetDAOReadOnly::getPrivateLocalStoragePath() const { std::ostringstream path; - WidgetPkgName pkgname = getPkgName(); - path << WidgetConfig::GetWidgetWebLocalStoragePath(pkgname); + TizenAppId tzAppId = getTzAppId(); + path << WidgetConfig::GetWidgetWebLocalStoragePath(tzAppId); path << "/"; return path.str(); @@ -1109,18 +1139,18 @@ DPL::OptionalString WidgetDAOReadOnly::getBackgroundPage() const SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get background page") } -WidgetPkgName WidgetDAOReadOnly::generateTizenId() { +TizenPkgId WidgetDAOReadOnly::generatePkgId() { std::string allowed("0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz"); - WidgetPkgName tizenId; - tizenId.resize(MAX_TIZENID_LENGTH); + TizenPkgId pkgId; + pkgId.resize(MAX_TIZENID_LENGTH); do { for (int i = 0; i < MAX_TIZENID_LENGTH; ++i) { - tizenId[i] = allowed[rand() % allowed.length()]; + pkgId[i] = allowed[rand() % allowed.length()]; } - } while (isWidgetInstalled(tizenId)); - return tizenId; + } while (isWidgetInstalled(pkgId)); + return pkgId; } SettingsType WidgetDAOReadOnly::getSecurityPopupUsage(void) const @@ -1182,6 +1212,13 @@ DPL::OptionalString WidgetDAOReadOnly::getWidgetInstalledPath() const } SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get widdget installed path") } + +TizenPkgId WidgetDAOReadOnly::getTizenPkgId() const +{ + WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle); + return row.Get_tizen_pkgid(); +} + #undef SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN #undef SQL_CONNECTION_EXCEPTION_HANDLER_END #undef CHECK_WIDGET_EXISTENCE diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h b/modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h index 3620658..c76b5b5 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h @@ -81,6 +81,8 @@ class PluginObjectsDAO * FindWidgetModel routine. */ typedef int DbWidgetHandle; +typedef DPL::String TizenPkgId; +typedef DPL::String TizenAppId; typedef DPL::String WidgetPkgName; /** @@ -237,6 +239,7 @@ typedef std::multiset DbWidgetFeatureSet; typedef std::list DbWidgetHandleList; typedef std::list WidgetPkgNameList; //TODO: this cannot be null -> appropriate changes in db schema needed +typedef std::list TizenAppIdList; //TODO: this cannot be null -> appropriate changes in db schema needed class WidgetDAOReadOnly; //forward declaration typedef std::shared_ptr WidgetDAOReadOnlyPtr; diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h b/modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h index ad9929d..1f58b2d 100755 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h @@ -307,6 +307,8 @@ class ConfigParserData // tizen id / required platform min version for TIZEN webapp DPL::OptionalString tizenId; DPL::OptionalString tizenMinVersionRequired; + DPL::OptionalString tizenPkgId; + DPL::OptionalString tizenAppId; //Application service model list ServiceInfoList appServiceList; //It will be removed. diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/property_dao_read_only.h b/modules/widget_dao/include/dpl/wrt-dao-ro/property_dao_read_only.h index 4c5a283..69b21c2 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/property_dao_read_only.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/property_dao_read_only.h @@ -38,7 +38,7 @@ typedef DPL::OptionalString WidgetPropertyValue; typedef std::list WidgetPropertyKeyList; struct WidgetPreferenceRow { - WidgetPkgName pkgname; + TizenAppId tizen_appid; WidgetPropertyKey key_name; WidgetPropertyValue key_value; DPL::OptionalInt readonly; @@ -66,7 +66,7 @@ DPL::OptionalInt CheckPropertyReadFlag(DbWidgetHandle widgetHandle, /* This method checks read only flag for given property */ -DPL::OptionalInt CheckPropertyReadFlag(WidgetPkgName pkgName, +DPL::OptionalInt CheckPropertyReadFlag(TizenAppId tzAppid, const WidgetPropertyKey &key); //deprecated @@ -77,7 +77,7 @@ WidgetPropertyKeyList GetPropertyKeyList(DbWidgetHandle widgetHandle) /* This method gets widget property key list */ -WidgetPropertyKeyList GetPropertyKeyList(WidgetPkgName pkgName); +WidgetPropertyKeyList GetPropertyKeyList(TizenAppId tzAppid); //deprecated /* This method gets widget property list @@ -87,7 +87,7 @@ WidgetPreferenceList GetPropertyList(DbWidgetHandle widgetHandle) /* This method gets widget property list */ -WidgetPreferenceList GetPropertyList(WidgetPkgName pkgName); +WidgetPreferenceList GetPropertyList(TizenAppId tzAppid); //deprecated /* This method get widget property value @@ -97,7 +97,7 @@ WidgetPropertyValue GetPropertyValue(DbWidgetHandle widgetHandle, /* This method get widget property value */ -WidgetPropertyValue GetPropertyValue(WidgetPkgName pkgName, +WidgetPropertyValue GetPropertyValue(TizenAppId tzAppid, const WidgetPropertyKey &key); } // PropertyDAOReadOnly diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/vconf_config.h b/modules/widget_dao/include/dpl/wrt-dao-ro/vconf_config.h index a30a84d..e90e737 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/vconf_config.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/vconf_config.h @@ -30,64 +30,64 @@ namespace WrtDB { namespace VconfConfig { -inline std::string GetVconfKeyRootPath(DPL::String pkgName) +inline std::string GetVconfKeyRootPath(DPL::String tzPkgId) { return PathBuilder() .Append(GlobalConfig::GetVconfKeyPrefixPath()) - .Append(DPL::ToUTF8String(pkgName)) + .Append(DPL::ToUTF8String(tzPkgId)) .GetFullPath(); } -inline std::string GetVconfKeyPopupUsage(DPL::String pkgName) +inline std::string GetVconfKeyPopupUsage(DPL::String tzPkgId) { return PathBuilder() .Append(GlobalConfig::GetVconfKeyPrefixPath()) - .Append(DPL::ToUTF8String(pkgName)) + .Append(DPL::ToUTF8String(tzPkgId)) .Concat(GlobalConfig::GetVconfKeyPopupUsagePath()) .GetFullPath(); } -inline std::string GetVconfKeyGeolocationUsage(DPL::String pkgName) +inline std::string GetVconfKeyGeolocationUsage(DPL::String tzPkgId) { return PathBuilder() .Append(GlobalConfig::GetVconfKeyPrefixPath()) - .Append(DPL::ToUTF8String(pkgName)) + .Append(DPL::ToUTF8String(tzPkgId)) .Concat(GlobalConfig::GetVconfKeyGeolocationUsagePath()) .GetFullPath(); } -inline std::string GetVconfKeyWebNotificationUsage(DPL::String pkgName) +inline std::string GetVconfKeyWebNotificationUsage(DPL::String tzPkgId) { return PathBuilder() .Append(GlobalConfig::GetVconfKeyPrefixPath()) - .Append(DPL::ToUTF8String(pkgName)) + .Append(DPL::ToUTF8String(tzPkgId)) .Concat(GlobalConfig::GetVconfKeyWebNotificationUsagePath()) .GetFullPath(); } -inline std::string GetVconfKeyWebDatabaseUsage(DPL::String pkgName) +inline std::string GetVconfKeyWebDatabaseUsage(DPL::String tzPkgId) { return PathBuilder() .Append(GlobalConfig::GetVconfKeyPrefixPath()) - .Append(DPL::ToUTF8String(pkgName)) + .Append(DPL::ToUTF8String(tzPkgId)) .Concat(GlobalConfig::GetVconfKeyWebDatabaseUsagePath()) .GetFullPath(); } -inline std::string GetVconfKeyFilesystemUsage(DPL::String pkgName) +inline std::string GetVconfKeyFilesystemUsage(DPL::String tzPkgId) { return PathBuilder() .Append(GlobalConfig::GetVconfKeyPrefixPath()) - .Append(DPL::ToUTF8String(pkgName)) + .Append(DPL::ToUTF8String(tzPkgId)) .Concat(GlobalConfig::GetVconfKeyFilesystemUsagePath()) .GetFullPath(); } -inline std::string GetVconfKeyMemorySavingMode(DPL::String pkgName) +inline std::string GetVconfKeyMemorySavingMode(DPL::String tzPkgId) { return PathBuilder() .Append(GlobalConfig::GetVconfKeyPrefixPath()) - .Append(DPL::ToUTF8String(pkgName)) + .Append(DPL::ToUTF8String(tzPkgId)) .Concat(GlobalConfig::GetVconfKeyMemorySavingModePath()) .GetFullPath(); } diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/widget_config.h b/modules/widget_dao/include/dpl/wrt-dao-ro/widget_config.h index 7669701..6cdd425 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/widget_config.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/widget_config.h @@ -32,41 +32,41 @@ namespace WrtDB { namespace WidgetConfig { -inline std::string GetWidgetBasePath(DPL::String pkgName) +inline std::string GetWidgetBasePath(DPL::String tzPkgId) { return PathBuilder() .Append(GlobalConfig::GetWidgetUserDataPath()) - .Append(DPL::ToUTF8String(pkgName)) + .Append(DPL::ToUTF8String(tzPkgId)) .GetFullPath(); } -inline std::string GetWidgetWebLocalStoragePath(DPL::String pkgName) +inline std::string GetWidgetWebLocalStoragePath(DPL::String tzPkgId) { - return PathBuilder(GetWidgetBasePath(pkgName)) + return PathBuilder(GetWidgetBasePath(tzPkgId)) .Append(GlobalConfig::GetWidgetLocalStoragePath()) .GetFullPath(); } -inline std::string GetWidgetPersistentStoragePath(DPL::String pkgName) +inline std::string GetWidgetPersistentStoragePath(DPL::String tzPkgId) { - return PathBuilder(GetWidgetBasePath(pkgName)) + return PathBuilder(GetWidgetBasePath(tzPkgId)) .Append(GlobalConfig::GetWidgetPrivateStoragePath()) .GetFullPath(); } -inline std::string GetWidgetTemporaryStoragePath(DPL::String pkgName) +inline std::string GetWidgetTemporaryStoragePath(DPL::String tzPkgId) { return PathBuilder() .Append(GlobalConfig::GetTmpDirPath()) - .Append(DPL::ToUTF8String(pkgName)) + .Append(DPL::ToUTF8String(tzPkgId)) .GetFullPath(); } -inline std::string GetWidgetDesktopFilePath(DPL::String pkgName) +inline std::string GetWidgetDesktopFilePath(DPL::String tzPkgId) { return PathBuilder() .Append(GlobalConfig::GetUserWidgetDesktopPath()) - .Append(DPL::ToUTF8String(pkgName)) + .Append(DPL::ToUTF8String(tzPkgId)) .Concat(".desktop") .GetFullPath(); } diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h b/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h index 8be742c..fa09901 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h @@ -178,6 +178,8 @@ struct WidgetRegisterInfo DPL::OptionalString pkgname; WidgetPkgName pkgName; + TizenPkgId tzPkgid; + TizenAppId tzAppid; time_t installedTime; PackagingType packagingType; @@ -298,7 +300,7 @@ class WidgetDAOReadOnly */ WidgetDAOReadOnly(DbWidgetHandle widgetHandle); WidgetDAOReadOnly(DPL::OptionalString widgetGUID); - WidgetDAOReadOnly(DPL::String pkgName); + WidgetDAOReadOnly(DPL::String tzAppid); /** * Destructor @@ -317,12 +319,25 @@ class WidgetDAOReadOnly static DbWidgetHandle getHandle(const DPL::String pkgName); /** - * Returns pkgname for the specified widget + * Returns tizenAppId for the specified widget * - * @return pkgname + * @return tzAppid; * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table. * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table. */ + + TizenAppId getTzAppId() const; + static TizenAppId getTzAppId(const WidgetGUID GUID); + static TizenAppId getTzAppId(const DbWidgetHandle handle); + + /** + * Returns WidgetPkgName for the specified widget + * + * @return pkgName; + * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table. + * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table. + */ + WidgetPkgName getPkgName() const; static WidgetPkgName getPkgName(const WidgetGUID GUID); static WidgetPkgName getPkgName(const DbWidgetHandle handle); @@ -373,6 +388,15 @@ class WidgetDAOReadOnly /** + * This method returns the App id of the widget. + * + * @return appid + * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table. + * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table. + */ + DPL::OptionalString getTizenAppId() const; + + /** * This method returns the defaultlocale for the widget. * * @return defaultlocale @@ -564,6 +588,7 @@ class WidgetDAOReadOnly * This method returns list of pkgname of installed packages * @return list of pkgname of installed packages */ + static TizenAppIdList getTizenAppidList(); static WidgetPkgNameList getPkgnameList(); /** @@ -701,7 +726,7 @@ class WidgetDAOReadOnly bool getBackSupported() const; static bool isWidgetInstalled(DbWidgetHandle handle); - static bool isWidgetInstalled(const WidgetPkgName & pkgName); + static bool isWidgetInstalled(const TizenAppId & tzAppId); /* This method get path of the splash image. * @@ -749,14 +774,17 @@ class WidgetDAOReadOnly DPL::OptionalString getBackgroundPage() const; /** - * @brief generateTizenId generates new tizen id + * @brief generateTizenId generates new package id * - * If widget do not supplies it's own tizen id, this method can be used, + * If widget do not supplies it's own tizen package id, this method can be used, * although it should be removed in future. * - * @return new tizen id + * @return new tizen package id */ - static WidgetPkgName generateTizenId(); + static TizenPkgId generatePkgId(); + static TizenPkgId generateTizenId() { + return generatePkgId(); + } /** * @brief This method return each value for security setting @@ -779,6 +807,13 @@ class WidgetDAOReadOnly * @return path of widget installed */ DPL::OptionalString getWidgetInstalledPath() const; + + /** + * This method returns tizen package id + * + * @return tizen package id + */ + TizenPkgId getTizenPkgId() const; }; } // namespace WrtDB diff --git a/modules/widget_dao/include/dpl/wrt-dao-rw/property_dao.h b/modules/widget_dao/include/dpl/wrt-dao-rw/property_dao.h index 7046042..95c3b6b 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-rw/property_dao.h +++ b/modules/widget_dao/include/dpl/wrt-dao-rw/property_dao.h @@ -36,7 +36,7 @@ void RemoveProperty(DbWidgetHandle widgetHandle, const PropertyDAOReadOnly::WidgetPropertyKey &key) __attribute__((deprecated)); -void RemoveProperty(WidgetPkgName pkgName, +void RemoveProperty(TizenAppId tzAppid, const PropertyDAOReadOnly::WidgetPropertyKey &key); //deprecated @@ -50,7 +50,7 @@ void SetProperty(DbWidgetHandle widgetHandle, /* This method sets widget property */ -void SetProperty(WidgetPkgName pkgName, +void SetProperty(TizenAppId tzAppid, const PropertyDAOReadOnly::WidgetPropertyKey &key, const PropertyDAOReadOnly::WidgetPropertyValue &value, bool readOnly = false); @@ -66,7 +66,7 @@ void RegisterProperties(DbWidgetHandle widgetHandle, /* This method registers properties for widget. * Properties unregistering is done via "delete cascade" mechanism in SQL */ -void RegisterProperties(WidgetPkgName pkgName, +void RegisterProperties(TizenAppId tzAppid, const WidgetRegisterInfo ®Info); } // namespace PropertyDAO diff --git a/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h b/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h index 3137c24..ec2a673 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h +++ b/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h @@ -46,7 +46,7 @@ class WidgetDAO : public WidgetDAOReadOnly WidgetDAO(DbWidgetHandle handle); WidgetDAO(DPL::OptionalString widgetGUID); - WidgetDAO(DPL::String pkgName); + WidgetDAO(DPL::String tzAppId); /** * Destructor @@ -58,12 +58,12 @@ class WidgetDAO : public WidgetDAOReadOnly * * @see WidgetRegisterInfo * @see UnRegisterWidget() - * @param[in] widgetPkgname Widget Pkgname that will be registered. + * @param[in] TizenAppId Widget app id that will be registered. * @param[in] pWidgetRegisterInfo Specified the widget's information needed to be registered. * @param[in] wacSecurity Widget's security certificates. */ static void registerWidget( - const WidgetPkgName & widgetPkgname, + const TizenAppId& tzAppId, const WidgetRegisterInfo &widgetRegInfo, const IWacSecurity &wacSecurity); @@ -79,9 +79,9 @@ class WidgetDAO : public WidgetDAOReadOnly * * @param pWidgetRegisterInfo registeration information * @param wacSecurity Widget's security certificates. - * @return pkgname generated + * @return tzAppId generated */ - static WidgetPkgName registerWidgetGenerateTizenId( + static TizenAppId registerWidgetGeneratePkgId( const WidgetRegisterInfo &pWidgetRegisterInfo, const IWacSecurity &wacSecurity); @@ -91,12 +91,12 @@ class WidgetDAO : public WidgetDAOReadOnly * It performs unregistration and new registration of widget in db in one transaction. * * @see WidgetRegisterInfo - * @param[in] widgetName Widget pkgname that will be registered. + * @param[in] tzAppId Widget tizen app id that will be registered. * @param[in] pWidgetRegisterInfo Specified the widget's information needed to be registered. * @param[in] wacSecurity Widget's security certificates. */ static void registerOrUpdateWidget( - const WidgetPkgName & widgetName, + const TizenAppId & tzAppId, const WidgetRegisterInfo &widgetRegInfo, const IWacSecurity &wacSecurity); @@ -109,9 +109,9 @@ class WidgetDAO : public WidgetDAOReadOnly * This method removes a widget's information from EmDB. * * @see RegisterWidget() - * @param[in] pkgName widgets name to be unregistered + * @param[in] tzAppId widgets name to be unregistered */ - static void unregisterWidget(const WidgetPkgName & pkgName); + static void unregisterWidget(const TizenAppId & tzAppId); static void unregisterWidget(WrtDB::DbWidgetHandle handle) __attribute__((deprecated)); @@ -130,9 +130,9 @@ class WidgetDAO : public WidgetDAOReadOnly const PropertyDAOReadOnly::WidgetPropertyValue &value, bool readOnly = false); - /* set PkgName + /* set tzAppId */ - void setPkgName(const WidgetPkgName& pkgName); + void setTizenAppId(const DPL::OptionalString& tzAppId); /* This function will update of api-feature status. * If status is true (feature rejected) plugin connected with this @@ -152,7 +152,7 @@ class WidgetDAO : public WidgetDAOReadOnly private: //Methods used during widget registering static DbWidgetHandle registerWidgetInfo( - const WidgetPkgName & widgetName, + const TizenAppId & widgetName, const WidgetRegisterInfo ®Info, const IWacSecurity &wacSecurity, const DPL::Optional handle = DPL::Optional()); @@ -209,12 +209,12 @@ class WidgetDAO : public WidgetDAOReadOnly static void registerWidgetInternal( - const WidgetPkgName & widgetName, + const TizenAppId & tzAppId, const WidgetRegisterInfo &widgetRegInfo, const IWacSecurity &wacSecurity, const DPL::Optional handle = DPL::Optional()); static void unregisterWidgetInternal( - const WidgetPkgName & pkgName); + const TizenAppId & tzAppId); }; } // namespace WrtDB diff --git a/modules/widget_dao/orm/wrt_db b/modules/widget_dao/orm/wrt_db index 46198c7..49ba6ee 100755 --- a/modules/widget_dao/orm/wrt_db +++ b/modules/widget_dao/orm/wrt_db @@ -38,12 +38,13 @@ CREATE_TABLE(WidgetInfo) COLUMN_NOT_NULL(back_supported, TINYINT, DEFAULT 0) COLUMN(access_network, TINYINT, DEFAULT 0) COLUMN(defaultlocale, VARCHAR(256), DEFAULT 0) - COLUMN_NOT_NULL(pkgname, VARCHAR(256), DEFAULT 0 UNIQUE) + COLUMN_NOT_NULL(tizen_pkgid, VARCHAR(256), DEFAULT '') + COLUMN_NOT_NULL(tizen_appid, VARCHAR(256), DEFAULT 0 UNIQUE) COLUMN(pkg_type, INT, DEFAULT 0) CREATE_TABLE_END() SQL( - CREATE INDEX IF NOT EXISTS WidgetInfo_PkgnameIndex ON WidgetInfo(pkgname); + CREATE INDEX IF NOT EXISTS WidgetInfo_AppidIndex ON WidgetInfo(tizen_appid); ) CREATE_TABLE(WidgetCertificate) @@ -98,14 +99,14 @@ CREATE_TABLE(WidgetExtendedInfo) CREATE_TABLE_END() CREATE_TABLE(WidgetPreference) - COLUMN_NOT_NULL(pkgname, VARCHAR(256), DEFAULT 0) + COLUMN_NOT_NULL(tizen_appid, VARCHAR(256), DEFAULT 0) COLUMN_NOT_NULL(key_name, VARCHAR(256),) COLUMN(key_value, VARCHAR(8000), DEFAULT '') COLUMN(readonly, INT, DEFAULT 0) TABLE_CONSTRAINTS( - PRIMARY KEY(pkgname, key_name), - FOREIGN KEY(pkgname) REFERENCES WidgetInfo (pkgname) ON DELETE CASCADE + PRIMARY KEY(tizen_appid, key_name), + FOREIGN KEY(tizen_appid) REFERENCES WidgetInfo (tizen_appid) ON DELETE CASCADE ) CREATE_TABLE_END() -- 2.7.4