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
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)
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 <<
using namespace DPL::DB::ORM::wrt;
WRT_DB_DELETE(del, WidgetPreference, &WrtDatabase::interface())
del->Where(And(
- Equals<WidgetPreference::pkgname>(pkgName),
+ Equals<WidgetPreference::tizen_appid>(tzAppid),
Equals<WidgetPreference::key_name>(key)));
del->Execute();
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;
DPL::DB::ORM::wrt::ScopedTransaction transaction(&WrtDatabase::interface());
DPL::OptionalInt readonly = PropertyDAOReadOnly::CheckPropertyReadFlag(
- pkgName,
+ tzAppid,
key);
if (!readonly.IsNull() && *readonly == 1) {
LogError("'" << key <<
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);
WRT_DB_UPDATE(update, WidgetPreference, &WrtDatabase::interface())
update->Where(And(
- Equals<WidgetPreference::pkgname>(pkgName),
+ Equals<WidgetPreference::tizen_appid>(tzAppid),
Equals<WidgetPreference::key_name>(key)));
update->Values(row);
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
{
{ // 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;
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();
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<WidgetPreference::pkgname>(pkgName),
+ select->Where(And(Equals<WidgetPreference::tizen_appid>(tzAppid),
Equals<WidgetPreference::key_name>(key)));
return select->GetSingleValue<WidgetPreference::readonly>();
//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<WidgetPreference::pkgname>(pkgName));
+ select->Where(Equals<WidgetPreference::tizen_appid>(tzAppid));
keyList = select->GetValueList<WidgetPreference::key_name>();
WidgetPropertyKeyList retKeyList;
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<WidgetPreference::pkgname>(pkgName));
+ select->Where(Equals<WidgetPreference::tizen_appid>(tzAppId));
ORMWidgetPreferenceList ormPrefList = select->GetRowList();
WidgetPreferenceList prefList;
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<WidgetPreference::pkgname>(pkgName),
+ select->Where(And(Equals<WidgetPreference::tizen_appid>(tzAppid),
Equals<WidgetPreference::key_name>(key)));
ORMWidgetPropertyValue ormPropValue =
{
}
-WidgetDAO::WidgetDAO(DPL::String pkgName) :
- WidgetDAOReadOnly(WidgetDAOReadOnly::getHandle(pkgName))
+WidgetDAO::WidgetDAO(DPL::String tzAppId) :
+ WidgetDAOReadOnly(WidgetDAOReadOnly::getHandle(tzAppId))
{
}
}
}
-void WidgetDAO::setPkgName(const WidgetPkgName& pkgName)
+void WidgetDAO::setTizenAppId(const DPL::OptionalString& tzAppId)
{
SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
{
}
wrt::WidgetInfo::Row row;
- row.Set_pkgname(pkgName);
+ row.Set_tizen_appid(*tzAppId);
WRT_DB_UPDATE(update, wrt::WidgetInfo, &WrtDatabase::interface())
update->Where(
}
void WidgetDAO::registerWidget(
- const WidgetPkgName & widgetPkgname,
+ const TizenAppId & tzAppId,
const WidgetRegisterInfo &widgetRegInfo,
const IWacSecurity &wacSecurity)
{
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")
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<DbWidgetHandle> 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);
}
void WidgetDAO::registerOrUpdateWidget(
- const WidgetPkgName & widgetName,
+ const TizenAppId & widgetName,
const WidgetRegisterInfo &widgetRegInfo,
const IWacSecurity &wacSecurity)
{
}
DbWidgetHandle WidgetDAO::registerWidgetInfo(
- const WidgetPkgName & widgetName,
+ const TizenAppId & tzAppId,
const WidgetRegisterInfo ®Info,
const IWacSecurity &wacSecurity,
const DPL::Optional<DbWidgetHandle> handle)
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;
{
//get autoincremented value of widgetHandle
WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface())
- select->Where(Equals<WidgetInfo::pkgname>(widgetName));
+ select->Where(Equals<WidgetInfo::tizen_appid>(tzAppId));
return select->GetSingleValue<WidgetInfo::app_id>();
}
else
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")
}
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())
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
{
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")
{
}
-WidgetDAOReadOnly::WidgetDAOReadOnly(DPL::String pkgName) :
- m_widgetHandle(WidgetDAOReadOnly::getHandle(pkgName))
+WidgetDAOReadOnly::WidgetDAOReadOnly(DPL::String tzAppid) :
+ m_widgetHandle(WidgetDAOReadOnly::getHandle(tzAppid))
{
}
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<WidgetInfo::pkgname>(pkgName));
+ select->Where(Equals<WidgetInfo::tizen_appid>(tzAppId));
WidgetInfo::Select::RowList rowList = select->GetRowList();
if (rowList.empty()) {
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
SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
{
WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface())
- return select->GetValueList<WidgetInfo::pkgname>();
+ return select->GetValueList<WidgetInfo::tizen_appid>();
}
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<WidgetInfo::tizen_appid>();
+ }
+ SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get Pkgname list")
+}
DbWidgetDAOReadOnlyList WidgetDAOReadOnly::getWidgetList()
{
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<WidgetInfo::pkgname>(pkgName));
+ select->Where(Equals<WidgetInfo::tizen_appid>(tzAppId));
WidgetInfo::Select::RowList rows = select->GetRowList();
return row.Get_widget_id();
}
+DPL::OptionalString WidgetDAOReadOnly::getTizenAppId() const
+{
+ return DPL::OptionalString(getTzAppId());
+}
+
DPL::OptionalString WidgetDAOReadOnly::getDefaultlocale() const
{
WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle);
using namespace WrtDB::WidgetConfig;
std::ostringstream path;
- WidgetPkgName pkgname = getPkgName();
+ TizenAppId tzAppId = getTzAppId();
- path << GetWidgetPersistentStoragePath(pkgname);
+ path << GetWidgetPersistentStoragePath(tzAppId);
path << "/";
path << GlobalConfig::GetCookieDatabaseFile();
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();
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
}
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
* FindWidgetModel routine.
*/
typedef int DbWidgetHandle;
+typedef DPL::String TizenPkgId;
+typedef DPL::String TizenAppId;
typedef DPL::String WidgetPkgName;
/**
typedef std::list<DbWidgetHandle> DbWidgetHandleList;
typedef std::list<WidgetPkgName> WidgetPkgNameList; //TODO: this cannot be null -> appropriate changes in db schema needed
+typedef std::list<TizenAppId> TizenAppIdList; //TODO: this cannot be null -> appropriate changes in db schema needed
class WidgetDAOReadOnly; //forward declaration
typedef std::shared_ptr<WidgetDAOReadOnly> WidgetDAOReadOnlyPtr;
// 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.
typedef std::list<WidgetPropertyKey> WidgetPropertyKeyList;
struct WidgetPreferenceRow {
- WidgetPkgName pkgname;
+ TizenAppId tizen_appid;
WidgetPropertyKey key_name;
WidgetPropertyValue key_value;
DPL::OptionalInt readonly;
/* This method checks read only flag for given property
*/
-DPL::OptionalInt CheckPropertyReadFlag(WidgetPkgName pkgName,
+DPL::OptionalInt CheckPropertyReadFlag(TizenAppId tzAppid,
const WidgetPropertyKey &key);
//deprecated
/* This method gets widget property key list
*/
-WidgetPropertyKeyList GetPropertyKeyList(WidgetPkgName pkgName);
+WidgetPropertyKeyList GetPropertyKeyList(TizenAppId tzAppid);
//deprecated
/* This method gets widget property list
/* This method gets widget property list
*/
-WidgetPreferenceList GetPropertyList(WidgetPkgName pkgName);
+WidgetPreferenceList GetPropertyList(TizenAppId tzAppid);
//deprecated
/* This method get widget property value
/* This method get widget property value
*/
-WidgetPropertyValue GetPropertyValue(WidgetPkgName pkgName,
+WidgetPropertyValue GetPropertyValue(TizenAppId tzAppid,
const WidgetPropertyKey &key);
} // PropertyDAOReadOnly
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();
}
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();
}
DPL::OptionalString pkgname;
WidgetPkgName pkgName;
+ TizenPkgId tzPkgid;
+ TizenAppId tzAppid;
time_t installedTime;
PackagingType packagingType;
*/
WidgetDAOReadOnly(DbWidgetHandle widgetHandle);
WidgetDAOReadOnly(DPL::OptionalString widgetGUID);
- WidgetDAOReadOnly(DPL::String pkgName);
+ WidgetDAOReadOnly(DPL::String tzAppid);
/**
* Destructor
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);
/**
+ * 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
* This method returns list of pkgname of installed packages
* @return list of pkgname of installed packages
*/
+ static TizenAppIdList getTizenAppidList();
static WidgetPkgNameList getPkgnameList();
/**
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.
*
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
* @return path of widget installed
*/
DPL::OptionalString getWidgetInstalledPath() const;
+
+ /**
+ * This method returns tizen package id
+ *
+ * @return tizen package id
+ */
+ TizenPkgId getTizenPkgId() const;
};
} // namespace WrtDB
const PropertyDAOReadOnly::WidgetPropertyKey &key)
__attribute__((deprecated));
-void RemoveProperty(WidgetPkgName pkgName,
+void RemoveProperty(TizenAppId tzAppid,
const PropertyDAOReadOnly::WidgetPropertyKey &key);
//deprecated
/* This method sets widget property
*/
-void SetProperty(WidgetPkgName pkgName,
+void SetProperty(TizenAppId tzAppid,
const PropertyDAOReadOnly::WidgetPropertyKey &key,
const PropertyDAOReadOnly::WidgetPropertyValue &value,
bool readOnly = false);
/* 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
WidgetDAO(DbWidgetHandle handle);
WidgetDAO(DPL::OptionalString widgetGUID);
- WidgetDAO(DPL::String pkgName);
+ WidgetDAO(DPL::String tzAppId);
/**
* Destructor
*
* @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);
*
* @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);
* 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);
* 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));
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
private:
//Methods used during widget registering
static DbWidgetHandle registerWidgetInfo(
- const WidgetPkgName & widgetName,
+ const TizenAppId & widgetName,
const WidgetRegisterInfo ®Info,
const IWacSecurity &wacSecurity,
const DPL::Optional<DbWidgetHandle> handle = DPL::Optional<DbWidgetHandle>());
static void registerWidgetInternal(
- const WidgetPkgName & widgetName,
+ const TizenAppId & tzAppId,
const WidgetRegisterInfo &widgetRegInfo,
const IWacSecurity &wacSecurity,
const DPL::Optional<DbWidgetHandle> handle = DPL::Optional<DbWidgetHandle>());
static void unregisterWidgetInternal(
- const WidgetPkgName & pkgName);
+ const TizenAppId & tzAppId);
};
} // namespace WrtDB
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)
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()