From: Taejeong Lee Date: Fri, 25 Jan 2013 12:51:00 +0000 (+0900) Subject: Revert "Change pkgname to appid and add package id PART 1." X-Git-Tag: 2.1b_release~6^2~55 X-Git-Url: http://review.tizen.org/git/?p=framework%2Fweb%2Fwrt-commons.git;a=commitdiff_plain;h=244bdcb36530a40d4a3de027cc8f3913d18075a8 Revert "Change pkgname to appid and add package id PART 1." This reverts commit e6b7c0f4c2e379706c4ac51e127779b9591a73f3. Change-Id: I05f0cd22990b789b0e7c2afa19d3daf1257817f5 --- diff --git a/modules/security_origin_dao/dao/security_origin_dao.cpp b/modules/security_origin_dao/dao/security_origin_dao.cpp index dda13e6..377358c 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::TizenAppId appid; + WrtDB::WidgetPkgName pkgname; Try { - appid = WrtDB::WidgetDAOReadOnly::getTzAppId(widgetHandle); + pkgname = WrtDB::WidgetDAOReadOnly::getPkgName(widgetHandle); } Catch(DPL::DB::SqlConnection::Exception::Base) { LogError("Failed to get database Path"); } - return createDatabasePath(appid); + return createDatabasePath(pkgname); } void checkDatabase(std::string databasePath) diff --git a/modules/widget_dao/dao/property_dao.cpp b/modules/widget_dao/dao/property_dao.cpp index a3cc3a9..b509118 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::getTzAppId(widgetHandle),key); + RemoveProperty(WidgetDAOReadOnly::getPkgName(widgetHandle),key); } -void RemoveProperty(TizenAppId tzAppid, +void RemoveProperty(WidgetPkgName pkgName, 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. appid: " << tzAppid << ", key: " << key); + LogDebug("Removing Property. pkgName: " << pkgName << ", key: " << key); Try { DPL::DB::ORM::wrt::ScopedTransaction transaction(&WrtDatabase::interface()); DPL::OptionalInt readonly = PropertyDAOReadOnly::CheckPropertyReadFlag( - tzAppid, + pkgName, key); if (!readonly.IsNull() && *readonly == 1) { LogError("'" << key << @@ -64,7 +64,7 @@ void RemoveProperty(TizenAppId tzAppid, using namespace DPL::DB::ORM::wrt; WRT_DB_DELETE(del, WidgetPreference, &WrtDatabase::interface()) del->Where(And( - Equals(tzAppid), + Equals(pkgName), Equals(key))); del->Execute(); @@ -82,15 +82,15 @@ void SetProperty(DbWidgetHandle widgetHandle, const PropertyDAOReadOnly::WidgetPropertyValue &value, bool readOnly) { - SetProperty(WidgetDAOReadOnly::getTzAppId(widgetHandle),key,value,readOnly); + SetProperty(WidgetDAOReadOnly::getPkgName(widgetHandle),key,value,readOnly); } -void SetProperty(TizenAppId tzAppid, +void SetProperty(WidgetPkgName pkgName, const PropertyDAOReadOnly::WidgetPropertyKey &key, const PropertyDAOReadOnly::WidgetPropertyValue &value, bool readOnly) { - LogDebug("Setting/updating Property. appid: " << tzAppid << + LogDebug("Setting/updating Property. pkgName: " << pkgName << ", key: " << key); Try { using namespace DPL::DB::ORM; @@ -98,7 +98,7 @@ void SetProperty(TizenAppId tzAppid, DPL::DB::ORM::wrt::ScopedTransaction transaction(&WrtDatabase::interface()); DPL::OptionalInt readonly = PropertyDAOReadOnly::CheckPropertyReadFlag( - tzAppid, + pkgName, key); if (!readonly.IsNull() && *readonly == 1) { LogError("'" << key << @@ -109,7 +109,7 @@ void SetProperty(TizenAppId tzAppid, if (readonly.IsNull()) { WidgetPreference::Row row; - row.Set_tizen_appid(tzAppid); + row.Set_pkgname(pkgName); row.Set_key_name(key); row.Set_key_value(value); row.Set_readonly(readOnly ? 1 : 0); @@ -123,7 +123,7 @@ void SetProperty(TizenAppId tzAppid, WRT_DB_UPDATE(update, WidgetPreference, &WrtDatabase::interface()) update->Where(And( - Equals(tzAppid), + Equals(pkgName), Equals(key))); update->Values(row); @@ -141,13 +141,13 @@ void SetProperty(TizenAppId tzAppid, void RegisterProperties(DbWidgetHandle widgetHandle, const WidgetRegisterInfo ®Info) { - RegisterProperties(WidgetDAOReadOnly::getTzAppId(widgetHandle),regInfo); + RegisterProperties(WidgetDAOReadOnly::getPkgName(widgetHandle),regInfo); } -void RegisterProperties(TizenAppId tzAppid, +void RegisterProperties(WidgetPkgName pkgName, const WidgetRegisterInfo ®Info) { - LogDebug("Registering proferences for widget. appid: " << tzAppid); + LogDebug("Registering proferences for widget. pkgName: " << pkgName); // Try-Catch in WidgetDAO @@ -159,7 +159,7 @@ void RegisterProperties(TizenAppId tzAppid, { { // Insert into table Widget Preferences WidgetPreference::Row row; - row.Set_tizen_appid(tzAppid); + row.Set_pkgname(pkgName); 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 54ea797..1bc172c 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.tizen_appid = it->Get_tizen_appid(); + row.pkgname = it->Get_pkgname(); 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::getTzAppId(widgetHandle), + return CheckPropertyReadFlag(WidgetDAOReadOnly::getPkgName(widgetHandle), key); } -DPL::OptionalInt CheckPropertyReadFlag(TizenAppId tzAppid, +DPL::OptionalInt CheckPropertyReadFlag(WidgetPkgName pkgName, const WidgetPropertyKey &key) { - LogDebug("Checking Property flag. appid: " << tzAppid << + LogDebug("Checking Property flag. pkgName: " << pkgName << ", 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(tzAppid), + select->Where(And(Equals(pkgName), Equals(key))); return select->GetSingleValue(); @@ -111,18 +111,18 @@ DPL::OptionalInt CheckPropertyReadFlag(TizenAppId tzAppid, //deprecated WidgetPropertyKeyList GetPropertyKeyList(DbWidgetHandle widgetHandle) { - return GetPropertyKeyList(WidgetDAOReadOnly::getTzAppId(widgetHandle)); + return GetPropertyKeyList(WidgetDAOReadOnly::getPkgName(widgetHandle)); } -WidgetPropertyKeyList GetPropertyKeyList(TizenAppId tzAppid) +WidgetPropertyKeyList GetPropertyKeyList(WidgetPkgName pkgName) { - LogDebug("Get PropertyKey list. appid: " << tzAppid); + LogDebug("Get PropertyKey list. pkgName: " << pkgName); Try { using namespace DPL::DB::ORM; using namespace DPL::DB::ORM::wrt; ORMWidgetPropertyKeyList keyList; WRT_DB_SELECT(select, WidgetPreference, &WrtDatabase::interface()) - select->Where(Equals(tzAppid)); + select->Where(Equals(pkgName)); keyList = select->GetValueList(); WidgetPropertyKeyList retKeyList; @@ -140,22 +140,22 @@ WidgetPropertyKeyList GetPropertyKeyList(TizenAppId tzAppid) WidgetPreferenceList GetPropertyList(DbWidgetHandle widgetHandle) { Try{ - TizenAppId tzAppid = WidgetDAOReadOnly::getTzAppId(widgetHandle); - return GetPropertyList(tzAppid); + WidgetPkgName pkgName=WidgetDAOReadOnly::getPkgName(widgetHandle); + return GetPropertyList(pkgName); }Catch(WidgetDAOReadOnly::Exception::WidgetNotExist){ WidgetPreferenceList empty; return empty; } } -WidgetPreferenceList GetPropertyList(TizenAppId tzAppId) +WidgetPreferenceList GetPropertyList(WidgetPkgName pkgName) { - LogDebug("Get Property list. tizenAppId: " << tzAppId); + LogDebug("Get Property list. pkgName: " << pkgName); Try { using namespace DPL::DB::ORM; using namespace DPL::DB::ORM::wrt; WRT_DB_SELECT(select, WidgetPreference, &WrtDatabase::interface()) - select->Where(Equals(tzAppId)); + select->Where(Equals(pkgName)); ORMWidgetPreferenceList ormPrefList = select->GetRowList(); WidgetPreferenceList prefList; @@ -173,19 +173,19 @@ WidgetPreferenceList GetPropertyList(TizenAppId tzAppId) WidgetPropertyValue GetPropertyValue(DbWidgetHandle widgetHandle, const WidgetPropertyKey &key) { - return GetPropertyValue(WidgetDAOReadOnly::getTzAppId(widgetHandle),key); + return GetPropertyValue(WidgetDAOReadOnly::getPkgName(widgetHandle),key); } -WidgetPropertyValue GetPropertyValue(TizenAppId tzAppid, +WidgetPropertyValue GetPropertyValue(WidgetPkgName pkgName, const WidgetPropertyKey &key) { - LogDebug("Get Property value. appid: " << tzAppid << + LogDebug("Get Property value. pkgName: " << pkgName << ", 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(tzAppid), + select->Where(And(Equals(pkgName), Equals(key))); ORMWidgetPropertyValue ormPropValue = diff --git a/modules/widget_dao/dao/widget_dao.cpp b/modules/widget_dao/dao/widget_dao.cpp index f22671e..bd421dd 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 tzAppId) : - WidgetDAOReadOnly(WidgetDAOReadOnly::getHandle(tzAppId)) +WidgetDAO::WidgetDAO(DPL::String pkgName) : + WidgetDAOReadOnly(WidgetDAOReadOnly::getHandle(pkgName)) { } @@ -96,7 +96,7 @@ void WidgetDAO::setProperty( } } -void WidgetDAO::setTizenAppId(const DPL::OptionalString& tzAppId) +void WidgetDAO::setPkgName(const WidgetPkgName& pkgName) { SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN { @@ -109,7 +109,7 @@ void WidgetDAO::setTizenAppId(const DPL::OptionalString& tzAppId) } wrt::WidgetInfo::Row row; - row.Set_tizen_appid(*tzAppId); + row.Set_pkgname(pkgName); WRT_DB_UPDATE(update, wrt::WidgetInfo, &WrtDatabase::interface()) update->Where( @@ -253,7 +253,7 @@ void WidgetDAO::setFileSystemUsage(const SettingsType value) } void WidgetDAO::registerWidget( - const TizenAppId & tzAppId, + const WidgetPkgName & widgetPkgname, 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(tzAppId, widgetRegInfo, wacSecurity); + registerWidgetInternal(widgetPkgname, widgetRegInfo, wacSecurity); transaction.Commit(); } SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to register widget") @@ -299,24 +299,24 @@ DbWidgetHandle WidgetDAO::registerWidget( return widgetHandle; } -TizenAppId WidgetDAO::registerWidgetGeneratePkgId( +WidgetPkgName WidgetDAO::registerWidgetGenerateTizenId( const WidgetRegisterInfo &pWidgetRegisterInfo, const IWacSecurity &wacSecurity) { - TizenAppId tzAppId = generatePkgId(); - registerWidget(tzAppId, pWidgetRegisterInfo, wacSecurity); - return tzAppId; + WidgetPkgName widgetPkgName = generateTizenId(); + registerWidget(widgetPkgName, pWidgetRegisterInfo, wacSecurity); + return widgetPkgName; } void WidgetDAO::registerWidgetInternal( - const TizenAppId & tzAppId, + const WidgetPkgName & widgetName, 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(tzAppId, widgetRegInfo, wacSecurity, handle); + DbWidgetHandle widgetHandle = registerWidgetInfo(widgetName, widgetRegInfo, wacSecurity, handle); registerWidgetExtendedInfo(widgetHandle, widgetRegInfo); @@ -358,7 +358,7 @@ void WidgetDAO::registerWidgetInternal( } void WidgetDAO::registerOrUpdateWidget( - const TizenAppId & widgetName, + const WidgetPkgName & widgetName, const WidgetRegisterInfo &widgetRegInfo, const IWacSecurity &wacSecurity) { @@ -403,7 +403,7 @@ void WidgetDAO::registerWidgetExtendedInfo(DbWidgetHandle widgetHandle, } DbWidgetHandle WidgetDAO::registerWidgetInfo( - const TizenAppId & tzAppId, + const WidgetPkgName & widgetName, const WidgetRegisterInfo ®Info, const IWacSecurity &wacSecurity, const DPL::Optional handle) @@ -442,8 +442,7 @@ DbWidgetHandle WidgetDAO::registerWidgetInfo( row.Set_recognized(wacSecurity.isRecognized()); row.Set_wac_signed(wacSecurity.isWacSigned()); row.Set_distributor_signed(wacSecurity.isDistributorSigned()); - row.Set_tizen_appid(tzAppId); - row.Set_tizen_pkgid(regInfo.tzPkgid); + row.Set_pkgname(widgetName); { std::stringstream tmp; tmp << regInfo.minVersion; @@ -467,7 +466,7 @@ DbWidgetHandle WidgetDAO::registerWidgetInfo( { //get autoincremented value of widgetHandle WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface()) - select->Where(Equals(tzAppId)); + select->Where(Equals(widgetName)); return select->GetSingleValue(); } else @@ -825,13 +824,13 @@ void WidgetDAO::unregisterAllExternalLocations() del->Execute(); } -void WidgetDAO::unregisterWidget(const TizenAppId & tzAppId) +void WidgetDAO::unregisterWidget(const WidgetPkgName & pkgName) { - LogDebug("Unregistering widget from DB. tzAppId: " << tzAppId); + LogDebug("Unregistering widget from DB. PkgName: " << pkgName); SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN { DPL::DB::ORM::wrt::ScopedTransaction transaction(&WrtDatabase::interface()); - unregisterWidgetInternal(tzAppId); + unregisterWidgetInternal(pkgName); transaction.Commit(); } SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to unregister widget") @@ -857,12 +856,12 @@ void WidgetDAO::unregisterWidget(WrtDB::DbWidgetHandle handle) } void WidgetDAO::unregisterWidgetInternal( - const TizenAppId & tzAppId) + const WidgetPkgName & pkgName) { using namespace DPL::DB::ORM; using namespace DPL::DB::ORM::wrt; - DbWidgetHandle handle = getHandle(tzAppId); + DbWidgetHandle handle = getHandle(pkgName); // 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 03ed365..e5a528a 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; -TizenAppId getTizenAppIdByHandle(const DbWidgetHandle handle) +WidgetPkgName getPkgNameByHandle(const DbWidgetHandle handle) { - LogDebug("Getting TizenAppId by DbWidgetHandle: " << handle); + LogDebug("Getting WidgetPkgName by DbWidgetHandle: " << handle); SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN { @@ -127,9 +127,9 @@ TizenAppId getTizenAppIdByHandle(const DbWidgetHandle handle) ThrowMsg(WidgetDAOReadOnly::Exception::WidgetNotExist, "Failed to get widget by handle"); } - TizenAppId tzAppid = rowList.front().Get_tizen_appid(); + WidgetPkgName pkgname = rowList.front().Get_pkgname(); - return tzAppid; + return pkgname; } SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed in getHandle") @@ -151,8 +151,8 @@ WidgetDAOReadOnly::WidgetDAOReadOnly(DPL::OptionalString widgetGUID) : { } -WidgetDAOReadOnly::WidgetDAOReadOnly(DPL::String tzAppid) : - m_widgetHandle(WidgetDAOReadOnly::getHandle(tzAppid)) +WidgetDAOReadOnly::WidgetDAOReadOnly(DPL::String pkgName) : + m_widgetHandle(WidgetDAOReadOnly::getHandle(pkgName)) { } @@ -185,14 +185,14 @@ DbWidgetHandle WidgetDAOReadOnly::getHandle(const WidgetGUID GUID) SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed in getHandle") } -DbWidgetHandle WidgetDAOReadOnly::getHandle(const DPL::String tzAppId) +DbWidgetHandle WidgetDAOReadOnly::getHandle(const DPL::String pkgName) { - LogDebug("Getting WidgetHandle by tizen app id [" << tzAppId << "]"); + LogDebug("Getting WidgetHandle by Package Name [" << pkgName << "]"); SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN { WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface()) - select->Where(Equals(tzAppId)); + select->Where(Equals(pkgName)); WidgetInfo::Select::RowList rowList = select->GetRowList(); if (rowList.empty()) { @@ -206,56 +206,41 @@ DbWidgetHandle WidgetDAOReadOnly::getHandle(const DPL::String tzAppId) WidgetPkgName WidgetDAOReadOnly::getPkgName() const { - return getTzAppId(); + return getPkgNameByHandle(m_widgetHandle); } WidgetPkgName WidgetDAOReadOnly::getPkgName(const WidgetGUID GUID) { - return getTzAppId(GUID); + return getPkgNameByHandle(getHandle(GUID)); } WidgetPkgName WidgetDAOReadOnly::getPkgName(const DbWidgetHandle 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); + return getPkgNameByHandle(handle); } PropertyDAOReadOnly::WidgetPropertyKeyList WidgetDAOReadOnly::getPropertyKeyList() const { - return PropertyDAOReadOnly::GetPropertyKeyList(getTzAppId()); + return PropertyDAOReadOnly::GetPropertyKeyList(getPkgName()); } PropertyDAOReadOnly::WidgetPreferenceList WidgetDAOReadOnly::getPropertyList() const { - return PropertyDAOReadOnly::GetPropertyList(getTzAppId()); + return PropertyDAOReadOnly::GetPropertyList(getPkgName()); } PropertyDAOReadOnly::WidgetPropertyValue WidgetDAOReadOnly::getPropertyValue( const PropertyDAOReadOnly::WidgetPropertyKey &key) const { - return PropertyDAOReadOnly::GetPropertyValue(getTzAppId(), key); + return PropertyDAOReadOnly::GetPropertyValue(getPkgName(), key); } DPL::OptionalInt WidgetDAOReadOnly::checkPropertyReadFlag( const PropertyDAOReadOnly::WidgetPropertyKey &key) const { - return PropertyDAOReadOnly::CheckPropertyReadFlag(getTzAppId(), key); + return PropertyDAOReadOnly::CheckPropertyReadFlag(getPkgName(), key); } DPL::String WidgetDAOReadOnly::getPath() const @@ -423,21 +408,11 @@ 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() { @@ -464,13 +439,13 @@ bool WidgetDAOReadOnly::isWidgetInstalled(DbWidgetHandle handle) SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to check if widget exist") } -bool WidgetDAOReadOnly::isWidgetInstalled(const TizenAppId &tzAppId) +bool WidgetDAOReadOnly::isWidgetInstalled(const WidgetPkgName & pkgName) { - LogDebug("Checking if widget exist. tizen app id" << tzAppId); + LogDebug("Checking if widget exist. package name " << pkgName); SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN { WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface()) - select->Where(Equals(tzAppId)); + select->Where(Equals(pkgName)); WidgetInfo::Select::RowList rows = select->GetRowList(); @@ -543,11 +518,6 @@ 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); @@ -1022,9 +992,9 @@ std::string WidgetDAOReadOnly::getCookieDatabasePath() const using namespace WrtDB::WidgetConfig; std::ostringstream path; - TizenAppId tzAppId = getTzAppId(); + WidgetPkgName pkgname = getPkgName(); - path << GetWidgetPersistentStoragePath(tzAppId); + path << GetWidgetPersistentStoragePath(pkgname); path << "/"; path << GlobalConfig::GetCookieDatabaseFile(); @@ -1034,8 +1004,8 @@ std::string WidgetDAOReadOnly::getCookieDatabasePath() const std::string WidgetDAOReadOnly::getPrivateLocalStoragePath() const { std::ostringstream path; - TizenAppId tzAppId = getTzAppId(); - path << WidgetConfig::GetWidgetWebLocalStoragePath(tzAppId); + WidgetPkgName pkgname = getPkgName(); + path << WidgetConfig::GetWidgetWebLocalStoragePath(pkgname); path << "/"; return path.str(); @@ -1139,18 +1109,18 @@ DPL::OptionalString WidgetDAOReadOnly::getBackgroundPage() const SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get background page") } -TizenPkgId WidgetDAOReadOnly::generatePkgId() { +WidgetPkgName WidgetDAOReadOnly::generateTizenId() { std::string allowed("0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz"); - TizenPkgId pkgId; - pkgId.resize(MAX_TIZENID_LENGTH); + WidgetPkgName tizenId; + tizenId.resize(MAX_TIZENID_LENGTH); do { for (int i = 0; i < MAX_TIZENID_LENGTH; ++i) { - pkgId[i] = allowed[rand() % allowed.length()]; + tizenId[i] = allowed[rand() % allowed.length()]; } - } while (isWidgetInstalled(pkgId)); - return pkgId; + } while (isWidgetInstalled(tizenId)); + return tizenId; } SettingsType WidgetDAOReadOnly::getSecurityPopupUsage(void) const @@ -1212,13 +1182,6 @@ 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 c76b5b5..3620658 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,8 +81,6 @@ class PluginObjectsDAO * FindWidgetModel routine. */ typedef int DbWidgetHandle; -typedef DPL::String TizenPkgId; -typedef DPL::String TizenAppId; typedef DPL::String WidgetPkgName; /** @@ -239,7 +237,6 @@ 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 1f58b2d..ad9929d 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,8 +307,6 @@ 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 69b21c2..4c5a283 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 { - TizenAppId tizen_appid; + WidgetPkgName pkgname; 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(TizenAppId tzAppid, +DPL::OptionalInt CheckPropertyReadFlag(WidgetPkgName pkgName, const WidgetPropertyKey &key); //deprecated @@ -77,7 +77,7 @@ WidgetPropertyKeyList GetPropertyKeyList(DbWidgetHandle widgetHandle) /* This method gets widget property key list */ -WidgetPropertyKeyList GetPropertyKeyList(TizenAppId tzAppid); +WidgetPropertyKeyList GetPropertyKeyList(WidgetPkgName pkgName); //deprecated /* This method gets widget property list @@ -87,7 +87,7 @@ WidgetPreferenceList GetPropertyList(DbWidgetHandle widgetHandle) /* This method gets widget property list */ -WidgetPreferenceList GetPropertyList(TizenAppId tzAppid); +WidgetPreferenceList GetPropertyList(WidgetPkgName pkgName); //deprecated /* This method get widget property value @@ -97,7 +97,7 @@ WidgetPropertyValue GetPropertyValue(DbWidgetHandle widgetHandle, /* This method get widget property value */ -WidgetPropertyValue GetPropertyValue(TizenAppId tzAppid, +WidgetPropertyValue GetPropertyValue(WidgetPkgName pkgName, 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 e90e737..a30a84d 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 tzPkgId) +inline std::string GetVconfKeyRootPath(DPL::String pkgName) { return PathBuilder() .Append(GlobalConfig::GetVconfKeyPrefixPath()) - .Append(DPL::ToUTF8String(tzPkgId)) + .Append(DPL::ToUTF8String(pkgName)) .GetFullPath(); } -inline std::string GetVconfKeyPopupUsage(DPL::String tzPkgId) +inline std::string GetVconfKeyPopupUsage(DPL::String pkgName) { return PathBuilder() .Append(GlobalConfig::GetVconfKeyPrefixPath()) - .Append(DPL::ToUTF8String(tzPkgId)) + .Append(DPL::ToUTF8String(pkgName)) .Concat(GlobalConfig::GetVconfKeyPopupUsagePath()) .GetFullPath(); } -inline std::string GetVconfKeyGeolocationUsage(DPL::String tzPkgId) +inline std::string GetVconfKeyGeolocationUsage(DPL::String pkgName) { return PathBuilder() .Append(GlobalConfig::GetVconfKeyPrefixPath()) - .Append(DPL::ToUTF8String(tzPkgId)) + .Append(DPL::ToUTF8String(pkgName)) .Concat(GlobalConfig::GetVconfKeyGeolocationUsagePath()) .GetFullPath(); } -inline std::string GetVconfKeyWebNotificationUsage(DPL::String tzPkgId) +inline std::string GetVconfKeyWebNotificationUsage(DPL::String pkgName) { return PathBuilder() .Append(GlobalConfig::GetVconfKeyPrefixPath()) - .Append(DPL::ToUTF8String(tzPkgId)) + .Append(DPL::ToUTF8String(pkgName)) .Concat(GlobalConfig::GetVconfKeyWebNotificationUsagePath()) .GetFullPath(); } -inline std::string GetVconfKeyWebDatabaseUsage(DPL::String tzPkgId) +inline std::string GetVconfKeyWebDatabaseUsage(DPL::String pkgName) { return PathBuilder() .Append(GlobalConfig::GetVconfKeyPrefixPath()) - .Append(DPL::ToUTF8String(tzPkgId)) + .Append(DPL::ToUTF8String(pkgName)) .Concat(GlobalConfig::GetVconfKeyWebDatabaseUsagePath()) .GetFullPath(); } -inline std::string GetVconfKeyFilesystemUsage(DPL::String tzPkgId) +inline std::string GetVconfKeyFilesystemUsage(DPL::String pkgName) { return PathBuilder() .Append(GlobalConfig::GetVconfKeyPrefixPath()) - .Append(DPL::ToUTF8String(tzPkgId)) + .Append(DPL::ToUTF8String(pkgName)) .Concat(GlobalConfig::GetVconfKeyFilesystemUsagePath()) .GetFullPath(); } -inline std::string GetVconfKeyMemorySavingMode(DPL::String tzPkgId) +inline std::string GetVconfKeyMemorySavingMode(DPL::String pkgName) { return PathBuilder() .Append(GlobalConfig::GetVconfKeyPrefixPath()) - .Append(DPL::ToUTF8String(tzPkgId)) + .Append(DPL::ToUTF8String(pkgName)) .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 6cdd425..7669701 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 tzPkgId) +inline std::string GetWidgetBasePath(DPL::String pkgName) { return PathBuilder() .Append(GlobalConfig::GetWidgetUserDataPath()) - .Append(DPL::ToUTF8String(tzPkgId)) + .Append(DPL::ToUTF8String(pkgName)) .GetFullPath(); } -inline std::string GetWidgetWebLocalStoragePath(DPL::String tzPkgId) +inline std::string GetWidgetWebLocalStoragePath(DPL::String pkgName) { - return PathBuilder(GetWidgetBasePath(tzPkgId)) + return PathBuilder(GetWidgetBasePath(pkgName)) .Append(GlobalConfig::GetWidgetLocalStoragePath()) .GetFullPath(); } -inline std::string GetWidgetPersistentStoragePath(DPL::String tzPkgId) +inline std::string GetWidgetPersistentStoragePath(DPL::String pkgName) { - return PathBuilder(GetWidgetBasePath(tzPkgId)) + return PathBuilder(GetWidgetBasePath(pkgName)) .Append(GlobalConfig::GetWidgetPrivateStoragePath()) .GetFullPath(); } -inline std::string GetWidgetTemporaryStoragePath(DPL::String tzPkgId) +inline std::string GetWidgetTemporaryStoragePath(DPL::String pkgName) { return PathBuilder() .Append(GlobalConfig::GetTmpDirPath()) - .Append(DPL::ToUTF8String(tzPkgId)) + .Append(DPL::ToUTF8String(pkgName)) .GetFullPath(); } -inline std::string GetWidgetDesktopFilePath(DPL::String tzPkgId) +inline std::string GetWidgetDesktopFilePath(DPL::String pkgName) { return PathBuilder() .Append(GlobalConfig::GetUserWidgetDesktopPath()) - .Append(DPL::ToUTF8String(tzPkgId)) + .Append(DPL::ToUTF8String(pkgName)) .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 fa09901..8be742c 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,8 +178,6 @@ struct WidgetRegisterInfo DPL::OptionalString pkgname; WidgetPkgName pkgName; - TizenPkgId tzPkgid; - TizenAppId tzAppid; time_t installedTime; PackagingType packagingType; @@ -300,7 +298,7 @@ class WidgetDAOReadOnly */ WidgetDAOReadOnly(DbWidgetHandle widgetHandle); WidgetDAOReadOnly(DPL::OptionalString widgetGUID); - WidgetDAOReadOnly(DPL::String tzAppid); + WidgetDAOReadOnly(DPL::String pkgName); /** * Destructor @@ -319,25 +317,12 @@ class WidgetDAOReadOnly static DbWidgetHandle getHandle(const DPL::String pkgName); /** - * Returns tizenAppId for the specified widget + * Returns pkgname for the specified widget * - * @return tzAppid; + * @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. */ - - 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); @@ -388,15 +373,6 @@ 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 @@ -588,7 +564,6 @@ class WidgetDAOReadOnly * This method returns list of pkgname of installed packages * @return list of pkgname of installed packages */ - static TizenAppIdList getTizenAppidList(); static WidgetPkgNameList getPkgnameList(); /** @@ -726,7 +701,7 @@ class WidgetDAOReadOnly bool getBackSupported() const; static bool isWidgetInstalled(DbWidgetHandle handle); - static bool isWidgetInstalled(const TizenAppId & tzAppId); + static bool isWidgetInstalled(const WidgetPkgName & pkgName); /* This method get path of the splash image. * @@ -774,17 +749,14 @@ class WidgetDAOReadOnly DPL::OptionalString getBackgroundPage() const; /** - * @brief generateTizenId generates new package id + * @brief generateTizenId generates new tizen id * - * If widget do not supplies it's own tizen package id, this method can be used, + * If widget do not supplies it's own tizen id, this method can be used, * although it should be removed in future. * - * @return new tizen package id + * @return new tizen id */ - static TizenPkgId generatePkgId(); - static TizenPkgId generateTizenId() { - return generatePkgId(); - } + static WidgetPkgName generateTizenId(); /** * @brief This method return each value for security setting @@ -807,13 +779,6 @@ 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 95c3b6b..7046042 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(TizenAppId tzAppid, +void RemoveProperty(WidgetPkgName pkgName, const PropertyDAOReadOnly::WidgetPropertyKey &key); //deprecated @@ -50,7 +50,7 @@ void SetProperty(DbWidgetHandle widgetHandle, /* This method sets widget property */ -void SetProperty(TizenAppId tzAppid, +void SetProperty(WidgetPkgName pkgName, 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(TizenAppId tzAppid, +void RegisterProperties(WidgetPkgName pkgName, 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 ec2a673..3137c24 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 tzAppId); + WidgetDAO(DPL::String pkgName); /** * Destructor @@ -58,12 +58,12 @@ class WidgetDAO : public WidgetDAOReadOnly * * @see WidgetRegisterInfo * @see UnRegisterWidget() - * @param[in] TizenAppId Widget app id that will be registered. + * @param[in] widgetPkgname Widget Pkgname 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 TizenAppId& tzAppId, + const WidgetPkgName & widgetPkgname, 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 tzAppId generated + * @return pkgname generated */ - static TizenAppId registerWidgetGeneratePkgId( + static WidgetPkgName registerWidgetGenerateTizenId( 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] tzAppId Widget tizen app id that will be registered. + * @param[in] widgetName Widget pkgname 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 TizenAppId & tzAppId, + const WidgetPkgName & widgetName, 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] tzAppId widgets name to be unregistered + * @param[in] pkgName widgets name to be unregistered */ - static void unregisterWidget(const TizenAppId & tzAppId); + static void unregisterWidget(const WidgetPkgName & pkgName); static void unregisterWidget(WrtDB::DbWidgetHandle handle) __attribute__((deprecated)); @@ -130,9 +130,9 @@ class WidgetDAO : public WidgetDAOReadOnly const PropertyDAOReadOnly::WidgetPropertyValue &value, bool readOnly = false); - /* set tzAppId + /* set PkgName */ - void setTizenAppId(const DPL::OptionalString& tzAppId); + void setPkgName(const WidgetPkgName& pkgName); /* 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 TizenAppId & widgetName, + const WidgetPkgName & 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 TizenAppId & tzAppId, + const WidgetPkgName & widgetName, const WidgetRegisterInfo &widgetRegInfo, const IWacSecurity &wacSecurity, const DPL::Optional handle = DPL::Optional()); static void unregisterWidgetInternal( - const TizenAppId & tzAppId); + const WidgetPkgName & pkgName); }; } // namespace WrtDB diff --git a/modules/widget_dao/orm/wrt_db b/modules/widget_dao/orm/wrt_db index 49ba6ee..46198c7 100755 --- a/modules/widget_dao/orm/wrt_db +++ b/modules/widget_dao/orm/wrt_db @@ -38,13 +38,12 @@ 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(tizen_pkgid, VARCHAR(256), DEFAULT '') - COLUMN_NOT_NULL(tizen_appid, VARCHAR(256), DEFAULT 0 UNIQUE) + COLUMN_NOT_NULL(pkgname, VARCHAR(256), DEFAULT 0 UNIQUE) COLUMN(pkg_type, INT, DEFAULT 0) CREATE_TABLE_END() SQL( - CREATE INDEX IF NOT EXISTS WidgetInfo_AppidIndex ON WidgetInfo(tizen_appid); + CREATE INDEX IF NOT EXISTS WidgetInfo_PkgnameIndex ON WidgetInfo(pkgname); ) CREATE_TABLE(WidgetCertificate) @@ -99,14 +98,14 @@ CREATE_TABLE(WidgetExtendedInfo) CREATE_TABLE_END() CREATE_TABLE(WidgetPreference) - COLUMN_NOT_NULL(tizen_appid, VARCHAR(256), DEFAULT 0) + COLUMN_NOT_NULL(pkgname, 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(tizen_appid, key_name), - FOREIGN KEY(tizen_appid) REFERENCES WidgetInfo (tizen_appid) ON DELETE CASCADE + PRIMARY KEY(pkgname, key_name), + FOREIGN KEY(pkgname) REFERENCES WidgetInfo (pkgname) ON DELETE CASCADE ) CREATE_TABLE_END()