[Issue#] PkgName could have been NULL.
[Bug] N/A
[Cause] N/A
[Solution] Changed Pkgname type, changed definition in database to NOT NULL.
[Verification] Build commons, plugins, installer,wrt. Run DAO tests.
Change-Id: Idf342238d6e290c279b2197de233b5eab57d155f
{
std::stringstream filename;
WrtDB::WidgetDAOReadOnly widgetDAO(widgetHandle);
- DPL::Optional<DPL::String> pkgname = widgetDAO.getPkgname();
+ WrtDB::WidgetPkgName pkgname = widgetDAO.getPkgname_TEMPORARY_API();
- filename << GetWidgetPersistentStoragePath(*pkgname)
+ filename << GetWidgetPersistentStoragePath(pkgname)
<< "/"
<< SECURITY_ORIGIN_DB_NAME;
return filename.str();
void WidgetDAO::setPkgName(const DPL::OptionalString& pkgName)
{
+
+ // if(!!pkgName)
+ setPkgName_TEMPORARY_API(*pkgName);
+}
+
+
+void WidgetDAO::setPkgName_TEMPORARY_API(const WidgetPkgName& pkgName)
+{
SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
{
using namespace DPL::DB::ORM;
WidgetPkgNameList WidgetDAOReadOnly::getPkgnameList()
{
LogDebug("Getting Pkgname List");
+ WidgetPkgNameList_TEMPORARY_API pkgnameList_TEMPORARY_API = getPkgnameList_TEMPORARY_API();
+ WidgetPkgNameList pkgnameList;
+ FOREACH(it,pkgnameList_TEMPORARY_API ){
+ pkgnameList.push_back(DPL::Optional<WidgetPkgName>(*it));
+ }
+ return pkgnameList;
+}
+
+WidgetPkgNameList_TEMPORARY_API WidgetDAOReadOnly::getPkgnameList_TEMPORARY_API()
+{
+ LogDebug("Getting Pkgname List ");
SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
{
WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface())
DPL::OptionalString WidgetDAOReadOnly::getPkgname() const
{
+ return DPL::OptionalString(getPkgname_TEMPORARY_API());
+}
+
+WidgetPkgName WidgetDAOReadOnly::getPkgname_TEMPORARY_API() const
+{
WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle);
return row.Get_pkgname();
}
using namespace WrtDB::WidgetConfig;
std::ostringstream path;
- DPL::OptionalString pkgname = getPkgname();
+ WidgetPkgName pkgname = getPkgname_TEMPORARY_API();
- path << GetWidgetPersistentStoragePath(*pkgname);
+ path << GetWidgetPersistentStoragePath(pkgname);
path << "/";
path << GlobalConfig::GetCookieDatabaseFile();
std::string WidgetDAOReadOnly::getPrivateLocalStoragePath() const
{
std::ostringstream path;
- DPL::OptionalString pkgname = getPkgname();
- path << WidgetConfig::GetWidgetWebLocalStoragePath(*pkgname);
+ WidgetPkgName pkgname = getPkgname_TEMPORARY_API();
+ path << WidgetConfig::GetWidgetWebLocalStoragePath(pkgname);
path << "/";
return path.str();
typedef std::list<DbWidgetHandle> DbWidgetHandleList;
typedef std::list<DPL::Optional<WidgetPkgName> > WidgetPkgNameList; //TODO: this cannot be null -> appropriate changes in db schema needed
+typedef std::list<WidgetPkgName> WidgetPkgNameList_TEMPORARY_API; //TODO: this cannot be null -> appropriate changes in db schema needed
class WidgetDAOReadOnly; //forward declaration
typedef std::shared_ptr<WidgetDAOReadOnly> WidgetDAOReadOnlyPtr;
int isTestWidget;
ConfigParserData configInfo;
LocalizationData localizationData;
+
DPL::OptionalString pkgname;
+ WidgetPkgName pkgname_TEMPORARY_API;
+
time_t installedTime;
PackagingType packagingType;
EncryptedFileList encryptedFiles;
* @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table.
*/
DPL::OptionalString getPkgname() const;
+ WidgetPkgName getPkgname_TEMPORARY_API() const;
/**
* This method returns the defaultlocale for the widget.
* @return list of pkgname of installed packages
*/
static WidgetPkgNameList getPkgnameList();
+ static WidgetPkgNameList_TEMPORARY_API getPkgnameList_TEMPORARY_API();
/**
* This method returns a list of all the installed widgets.
/* set PkgName
*/
void setPkgName(const DPL::OptionalString& pkgName);
+ void setPkgName_TEMPORARY_API(const WidgetPkgName& pkgName);
/* This function will update of api-feature status.
* If status is true (feature rejected) plugin connected with this
COLUMN_NOT_NULL(back_supported, TINYINT, DEFAULT 0)
COLUMN(access_network, TINYINT, DEFAULT 0)
COLUMN(defaultlocale, VARCHAR(256), DEFAULT 0)
- COLUMN(pkgname, VARCHAR(256), DEFAULT 0 UNIQUE)
+ COLUMN_NOT_NULL(pkgname, VARCHAR(256), DEFAULT 0 UNIQUE)
COLUMN(pkg_type, INT, DEFAULT 0)
CREATE_TABLE_END()