+wrt-commons (0.2.94) unstable; urgency=low
+
+ * Revert "Change pkgname to appid and add package id PART 1."
+ * Revert "change pkgname to appid PART 2."
+ * Fix build break in tests after API has been changed.
+
+ -- Tae-Jeong Lee <taejeong.lee@samsung.com> Fri, 25 Jan 2013 22:32:36 +0900
+
+wrt-commons (0.2.93) unstable; urgency=low
+
+ * Changed PkgName type from Optional<String> to String PART 5
+ * Support for GCC 4.7
+ * Removing hard-coding in ORDER BY statement
+ * Fixing saving locale for each icon
+ * Singleton guard thread removal
+ * Change pkgname to appid and add package id PART 1.
+ * change pkgname to appid PART 2.
+
+ -- Soyoung Kim <sy037.kim@samsung.com> Thu, 24 Jan 2013 15:53:03 +0900
+
wrt-commons (0.2.92) unstable; urgency=low
* Removal of popup implementation
}
typedef Optional<Thread *> OptionalThreadPtr;
- OptionalThreadPtr m_guard;
static Singleton &InternalInstance();
}
static Class &Instance();
-
- // Thread guarding
- static void SetThreadGuard(Thread *thread);
- static void ResetThreadGuard();
};
} // namespace DPL
Class &Singleton<Class>::Instance()
{
Singleton<Class>& instance = Singleton<Class>::InternalInstance();
-
- if (!!instance.m_guard)
- {
- Assert(Thread::GetCurrentThread() == *instance.m_guard &&
- "Singleton thread guard failed. A forbidden call from foreign thread was detected!");
- }
-
return instance;
}
-// Thread guarding
-template<typename Class>
-void Singleton<Class>::SetThreadGuard(Thread *thread)
-{
- Singleton<Class>& instance = Singleton<Class>::InternalInstance();
- instance.m_guard = OptionalThreadPtr(thread);
-}
-
-template<typename Class>
-void Singleton<Class>::ResetThreadGuard()
-{
- Singleton<Class>& instance = Singleton<Class>::InternalInstance();
- instance.m_guard = OptionalThreadPtr::Null;
-}
-
} // namespace DPL
#define IMPLEMENT_SINGLETON(Type) \
template DPL::Singleton<Type>& DPL::Singleton<Type>::InternalInstance(); \
template Type& DPL::Singleton<Type>::Instance(); \
-template void DPL::Singleton<Type>::SetThreadGuard(DPL::Thread *thread); \
-template void DPL::Singleton<Type>::ResetThreadGuard();
#endif // DPL_SINGLETON_IMPL_H
Class &Singleton<Class>::Instance() \
{ \
Singleton<Class>& instance = Singleton<Class>::InternalInstance(); \
- if (!!instance.m_guard) \
- { \
- Assert(Thread::GetCurrentThread() == *instance.m_guard && \
- "Singleton thread guard failed. A forbidden call from foreign thread was detected!");\
- } \
return instance; \
} \
\
-template<> \
-void Singleton<Class>::SetThreadGuard(Thread *thread) \
-{ \
- Singleton<Class>& instance = Singleton<Class>::InternalInstance(); \
- instance.m_guard = OptionalThreadPtr(thread); \
-} \
- \
-template<> \
-void Singleton<Class>::ResetThreadGuard() \
-{ \
- Singleton<Class>& instance = Singleton<Class>::InternalInstance(); \
- instance.m_guard = OptionalThreadPtr::Null; \
-} \
template Singleton<Class>& Singleton<Class>::InternalInstance(); \
template Class& Singleton<Class>::Instance(); \
-template void Singleton<Class>::SetThreadGuard(Thread *thread); \
-template void Singleton<Class>::ResetThreadGuard(); \
} // namespace DPL
typedef std::shared_ptr<Expression> ExpressionPtr;
+namespace OrderingUtils {
+
+template<typename CompoundType> inline std::string OrderByInternal()
+{
+ std::string order = OrderByInternal<typename CompoundType::Tail>();
+ if(!order.empty()) return CompoundType::Head::GetString() + ", " + order;
+ else return CompoundType::Head::GetString();
+}
+
+template<> inline std::string OrderByInternal<TypeListGuard>()
+{
+ return std::string();
+}
+
+}
+
+template<typename ColumnType>
+class __attribute__ ((visibility("hidden"))) OrderingExpression {
+protected:
+ static std::string GetSchemaAndName()
+ {
+ std::string statement;
+ statement += ColumnType::GetTableName();
+ statement += ".";
+ statement += ColumnType::GetColumnName();
+ statement += " ";
+ return statement;
+ }
+public:
+ virtual ~OrderingExpression() {}
+};
+
template<const char* Operator, typename LeftExpression, typename RightExpression>
class __attribute__ ((visibility("hidden"))) BinaryExpression : public Expression {
protected:
ORM_DEFINE_COMPARE_EXPRESSION(Equals, Equal)
ORM_DEFINE_COMPARE_EXPRESSION(Is, Is)
+#define ORM_DEFINE_ORDERING_EXPRESSION(name, value) \
+ template<typename ColumnType> \
+ class __attribute__ ((visibility("hidden"))) name \
+ : OrderingExpression<ColumnType> { \
+ public: \
+ static std::string GetString() \
+ { \
+ std::string statement = OrderingExpression<ColumnType>::GetSchemaAndName(); \
+ statement += value; \
+ return statement; \
+ } \
+ };
+
+ORM_DEFINE_ORDERING_EXPRESSION(OrderingAscending, "ASC")
+ORM_DEFINE_ORDERING_EXPRESSION(OrderingDescending, "DESC")
+
template<typename ColumnData1, typename ColumnData2>
class __attribute__ ((visibility("hidden"))) CompareBinaryColumn {
private:
m_distinctResults = true;
}
- void OrderBy(const std::string& orderBy)
+ template<typename CompoundType>
+ void OrderBy(const CompoundType&)
+ {
+ m_orderBy = OrderingUtils::OrderByInternal<typename CompoundType::Type>();
+ }
+
+ void OrderBy(const std::string & orderBy) //backward compatibility
{
m_orderBy = orderBy;
}
+ void OrderBy(const char * orderBy) //backward compatibility
+ {
+ m_orderBy = std::string(orderBy);
+ }
+
template<typename ColumnList, typename Expression>
void Join(const Expression& expression) {
std::string usedTableNames = TableDefinition::GetName();
#include <stddef.h>
#include <dpl/db/orm.h>
+
namespace DPL {
namespace DB {
namespace ORM {
std::for_each(m_registeredObjects.begin(),
m_registeredObjects.end(),
- [m_connection] (const RegisteredObjects::value_type& value)
+ [this] (const RegisteredObjects::value_type& value)
{
g_dbus_connection_unregister_object(
m_connection,
this->m_storage.Set(value);
- EmitEvent(PropertyEvent<Type>(value, this->m_model),
+ this->EmitEvent(PropertyEvent<Type>(value, this->m_model),
EmitMode::Auto);
}
#include <cstring>
#include <sstream>
#include <sys/time.h>
+#include <unistd.h>
namespace DPL
{
#include <sys/types.h>
#include <errno.h>
#include <ctype.h>
+#include <unistd.h>
#include <dpl/log/log.h>
#include <dpl/utils/wrt_utility.h>
}
}
-void WidgetDAO::setPkgName(const DPL::OptionalString& pkgName)
-{
-
- // if(!!pkgName)
- setPkgName_TEMPORARY_API(*pkgName);
-}
-
-
-void WidgetDAO::setPkgName_TEMPORARY_API(const WidgetPkgName& pkgName)
+void WidgetDAO::setPkgName(const WidgetPkgName& pkgName)
{
SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
{
row.Set_app_id(widgetHandle);
row.Set_icon_id(icon_id);
row.Set_widget_locale(*j);
- WRT_DB_SELECT(select, WidgetLocalizedIcon, &WrtDatabase::interface())
- select->Where(And(Equals<WidgetLocalizedIcon::app_id>(widgetHandle),
- Equals<WidgetLocalizedIcon::widget_locale>(*j)));
- WidgetLocalizedIcon::Select::RowList rows = select->GetRowList();
-
- bool flag = !rows.empty();
-
- if(flag == true)
- {
- // already default icon value of same locale exists
- WRT_DB_UPDATE(update, WidgetLocalizedIcon, &WrtDatabase::interface())
- update->Where(And(Equals<WidgetLocalizedIcon::app_id>(widgetHandle),
- Equals<WidgetLocalizedIcon::widget_locale>(*j)));
- update->Values(row);
- update->Execute();
- }else{
- // any icon value of same locale doesn't exist
- DO_INSERT(row, WidgetLocalizedIcon)
- }
+ DO_INSERT(row, WidgetLocalizedIcon)
}
}
}
SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get Pkgname list")
}
-WidgetPkgNameList_TEMPORARY_API WidgetDAOReadOnly::getPkgnameList_TEMPORARY_API()
-{
- LogDebug("Getting Pkgname List ");
- SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
- {
- WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface())
- return select->GetValueList<WidgetInfo::pkgname>();
- }
- SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get Pkgname list")
-}
DbWidgetDAOReadOnlyList WidgetDAOReadOnly::getWidgetList()
{
return row.Get_widget_id();
}
-DPL::OptionalString WidgetDAOReadOnly::getPkgname() const
-{
- return DPL::OptionalString(getPkgName());
-}
-
DPL::OptionalString WidgetDAOReadOnly::getDefaultlocale() const
{
WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle);
{
WRT_DB_SELECT(select, wrt::WidgetIcon, &WrtDatabase::interface())
select->Where(Equals<wrt::WidgetIcon::app_id>(m_widgetHandle));
+ select->OrderBy(DPL::TypeListDecl<OrderingAscending<wrt::WidgetIcon::icon_id> >());
std::list<WidgetIcon::Row> list =
select->GetRowList();
typedef std::list<DbWidgetHandle> DbWidgetHandleList;
typedef std::list<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;
WidgetGUID getGUID() const;
- /**
- * This method returns the Package name of the 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.
- */
- DPL::OptionalString getPkgname() 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);
+ void setPkgName(const WidgetPkgName& pkgName);
/* This function will update of api-feature status.
* If status is true (feature rejected) plugin connected with this
-#git:framework/web/wrt-commons wrt-commons 0.2.92
+#git:framework/web/wrt-commons wrt-commons 0.2.94
Name: wrt-commons
Summary: Wrt common library
-Version: 0.2.92
+Version: 0.2.94
Release: 1
Group: Development/Libraries
License: Apache License, Version 2.0
};
-WidgetPkgName _registerWidget(const WidgetRegisterInfo& regInfo,
+TizenAppId _registerWidget(const WidgetRegisterInfo& regInfo,
const IWacSecurity& sec,
int line)
{
- WidgetPkgName pkgname;
+ TizenAppId tizenAppId;
Try {
- auto previous = WidgetDAO::getPkgnameList();
+ auto previous = WidgetDAO::getTizenAppidList();
// register widget
- pkgname = WidgetDAO::registerWidgetGenerateTizenId(regInfo, sec);
+ tizenAppId = WidgetDAO::registerWidgetGeneratePkgId(regInfo, sec);
- RUNNER_ASSERT_MSG(!pkgname.empty(),
+ RUNNER_ASSERT_MSG(!tizenAppId.empty(),
"(called from line " << line << ")");
- auto current = WidgetDAO::getPkgnameList();
+ auto current = WidgetDAO::getTizenAppidList();
RUNNER_ASSERT_MSG(previous.size()+1 == current.size(),
"(called from line " << line << ")");
- RUNNER_ASSERT_MSG(WidgetDAO::isWidgetInstalled(pkgname),
- "(called from line " << line << " pkgname: " << pkgname << ")");
+ RUNNER_ASSERT_MSG(WidgetDAO::isWidgetInstalled(tizenAppId),
+ "(called from line " << line << " tizenAppId: " << tizenAppId << ")");
}
Catch (WidgetDAO::Exception::AlreadyRegistered) {
RUNNER_ASSERT_MSG(
false,
"Unexpected exception (called from line " << line << ")");
}
- return pkgname;
+ return tizenAppId;
}
#define REGISTER_WIDGET(regInfo, sec) _registerWidget((regInfo),(sec), __LINE__)
WacSecurityMock sec;
const std::size_t NUMBER_OF_WIDGETS = 5;
- WidgetPkgName lastPkgname;
+ TizenAppId lastTizenAppId;
for (std::size_t number = 0; number < NUMBER_OF_WIDGETS; ++number)
{
WidgetRegisterInfo regInfo;
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- lastPkgname = pkgname;
+ lastTizenAppId = tizenAppId;
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
//TODO check nulls
}
}
regInfo.minVersion = DPL::FromUTF8String("1.0");
regInfo.configInfo.backSupported = true;
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getGUID(), str.str());
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getVersion(), str.str());
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getAuthorName(), str.str());
// regInfo.shareHref = str.str();
regInfo.configInfo.backgroundPage = L"background.html";
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
// RUNNER_ASSERT_WHAT_EQUALS(dao.GetShareHref(), str.str());
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getBackgroundPage(),
std::make_pair(DPL::FromUTF8String("pl"),locDataPl));
}
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
RUNNER_ASSERT_MSG(dao.getLanguageTags().size() == 2,
"language tags list invalid");
WidgetRegisterInfo::LocalizedIcon locIcon(icon,locs);
regInfo.localizationData.icons.push_back(locIcon);
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
WidgetDAOReadOnly::WidgetIconList list = dao.getIconList();
RUNNER_ASSERT(list.size() == regInfo.localizationData.icons.size());
FOREACH(it, features)
regInfo.configInfo.featuresList.insert(*it);
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
WidgetFeatureSet out = dao.getFeaturesList();
RUNNER_ASSERT_MSG(out.size() == features.size(),
"wrong number of features");
{
WacSecurityMock sec;
WidgetRegisterInfo regInfo;
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
RUNNER_ASSERT_MSG(dao.getSecurityPopupUsage() == WrtDB::SETTINGS_TYPE_ON, "SecurityPopupUsage is not deafult on");
RUNNER_ASSERT_MSG(dao.getGeolocationUsage() == WrtDB::SETTINGS_TYPE_ON, "GeolocationUsage is not deafult on");
RUNNER_ASSERT_MSG(dao.getWebNotificationUsage() == WrtDB::SETTINGS_TYPE_ON, "WebNotificationUsage is not deafult on");
FOREACH(it, modes)
regInfo.configInfo.windowModes.insert(*it);
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
std::list<DPL::String> wins = dao.getWindowModes();
RUNNER_ASSERT_MSG(modes.size() == wins.size(),
"wrong number of window modes");
FOREACH(it, orig)
regInfo.configInfo.accessInfoSet.insert(*it);
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
WidgetAccessInfoList out;
dao.getWidgetAccessInfo(out);
certListRef.push_back(cert);
// register widget
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
// certificates
WidgetCertificateDataList recList = dao.getCertificateDataList();
WacSecurityMock sec;
WidgetRegisterInfo regInfo;
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- RUNNER_ASSERT(WidgetDAO::isWidgetInstalled(pkgname));
+ RUNNER_ASSERT(WidgetDAO::isWidgetInstalled(tizenAppId));
}
/*
WidgetRegisterInfo regInfo;
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO::unregisterWidget(pkgname);
+ WidgetDAO::unregisterWidget(tizenAppId);
RUNNER_ASSERT_MSG(handles.size() == WidgetDAO::getHandleList().size(),
"Widget unregister failed");
regInfo2.configInfo.version = L"1.1";
regInfo2.configInfo.authorName = L"BBB";
- WrtDB::WidgetPkgName pkgname(L"abcdefghij");
+ WrtDB::TizenAppId tizenAppId(L"abcdefghij");
//first installation
- WidgetDAO::registerWidget(pkgname, regInfo, sec);
- RUNNER_ASSERT_MSG(WidgetDAO::isWidgetInstalled(pkgname), "Widget is not registered");
+ WidgetDAO::registerWidget(tizenAppId, regInfo, sec);
+ RUNNER_ASSERT_MSG(WidgetDAO::isWidgetInstalled(tizenAppId), "Widget is not registered");
//success full update
- WidgetDAO::registerOrUpdateWidget(pkgname, regInfo2, sec);
- RUNNER_ASSERT_MSG(WidgetDAO::isWidgetInstalled(pkgname), "Widget is not reregistered");
- WidgetDAO dao(pkgname);
+ WidgetDAO::registerOrUpdateWidget(tizenAppId, regInfo2, sec);
+ RUNNER_ASSERT_MSG(WidgetDAO::isWidgetInstalled(tizenAppId), "Widget is not reregistered");
+ WidgetDAO dao(tizenAppId);
RUNNER_ASSERT_MSG(*dao.getVersion() == L"1.1", "Data widget was not updated");
RUNNER_ASSERT_MSG(*dao.getAuthorName() == L"BBB", "Data widget was not updated");
- WidgetDAO::unregisterWidget(pkgname);
+ WidgetDAO::unregisterWidget(tizenAppId);
}
/*
-Name: widget_dao_test_get_widget_pkgname_list
-Description: Tests getPkgnameList API for backendlib
+Name: widget_dao_test_get_widget_tizenAppId_list
+Description: Tests getTizenAppidList API for backendlib
Expected: For all position in database should be returned one item in list
*/
-RUNNER_TEST(widget_dao_test_get_widget_pkgname_list)
+RUNNER_TEST(widget_dao_test_get_widget_tizenAppId_list)
{
- WidgetPkgNameList pkgnames = WidgetDAO::getPkgnameList();
- RUNNER_ASSERT(pkgnames.size() >= 3);
+ TizenAppIdList tizenAppIds = WidgetDAO::getTizenAppidList();
+ RUNNER_ASSERT(tizenAppIds.size() >= 3);
}
/*
Name: widget_dao_test_get_widget_list
-Description: Tests getPkgnameList API for backendlib
+Description: Tests getTizenAppidList API for backendlib
Expected: For all position in database should be returned one item in list
- Those item should contain valid pkgname
+ Those item should contain valid tizenAppId
*/
RUNNER_TEST(widget_dao_test_get_widget_list)
{
RUNNER_TEST(widget_dao_test_get_widget_attributes)
{
{
- WidgetPkgName pkgname = L"tizenid201";
- WidgetDAO dao(pkgname);
+ TizenAppId tizenAppId = L"tizenid201";
+ WidgetDAO dao(tizenAppId);
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getGUID(), "w_id_2000");
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getVersion(), "1.0.0");
regInfo.localizationData.startFiles.push_back(file);
// register widget
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
// check localized icons
WidgetDAO::WidgetLocalizedIconList locList = dao.getLocalizedIconList();
WidgetRegisterInfo regInfo;
{
// register widget
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
+ WidgetDAO dao(tizenAppId);
RUNNER_ASSERT(!dao.isDistributorSigned());
RUNNER_ASSERT(!dao.isRecognized());
sec.setWacSigned(true);
{
// register widget
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
+ WidgetDAO dao(tizenAppId);
RUNNER_ASSERT(dao.isDistributorSigned());
RUNNER_ASSERT(dao.isRecognized());
#Widgets
INS_ALL_WIDGETEXT="insert into WidgetExtendedInfo(app_id, share_href, signature_type)"
- INS_ALL_WIDGET="insert into WidgetInfo(app_id, widget_id, widget_version, widget_width, widget_height, author_name, author_email, author_href, base_folder, webkit_plugins_required, recognized, wac_signed, distributor_signed, min_version, pkgname)"
+ INS_ALL_WIDGET="insert into WidgetInfo(app_id, widget_id, widget_version, widget_width, widget_height, author_name, author_email, author_href, base_folder, webkit_plugins_required, recognized, wac_signed, distributor_signed, min_version, tizen_appid)"
INS_ALL_WIDGET_LOC="insert into LocalizedWidgetInfo(app_id, widget_locale, widget_name, widget_shortname, widget_description, widget_license, widget_license_file, widget_license_href)"
INS_ALL_WIDGET_ICONS="insert into WidgetIcon(app_id, icon_src, icon_width, icon_height)"
INS_ALL_WIDGET_LOC_ICONS="insert into WidgetLocalizedIcon(app_id, icon_id, widget_locale)"
INS_ALL_WIDGET_STARTFILE="insert into WidgetStartFile(app_id, src)"
INS_ALL_WIDGET_LOC_STARTFILE="insert into WidgetLocalizedStartFile(app_id, start_file_id, widget_locale, type, encoding)"
INS_ALL_WIDGET_DEFPREF="insert into WidgetDefaultPreference(app_id, key_name, key_value, readonly)"
- INS_ALL_WIDGET_PREF="insert into WidgetPreference(pkgname, key_name, key_value, readonly)"
+ INS_ALL_WIDGET_PREF="insert into WidgetPreference(tizen_appid, key_name, key_value, readonly)"
INS_ALL_WIDGET_FEATURE="insert into WidgetFeature(app_id, name, required)"
INS_ALL_WIDGET_FEATURE_PARAM="insert into FeatureParam(widget_feature_id, name, value)"
INS_ALL_WIDGET_WINMODES="insert into WidgetWindowModes(app_id, window_mode)"
sqlite3 $WRT_DB "${INS_ALL_WIDGET} VALUES(2000, 'w_id_2000', '1.0.0', 100, 200, 'a_name_2000', 'a_email_2000', 'a_href_2000', 'basef_2000', 1, 1, 1, 1, '1.0', 'tizenid201')";
sqlite3 $WRT_DB "${INS_ALL_WIDGET} VALUES(2001, 'w_id_2001', '2.0.0', 100, 200, 'a_name_2001', 'a_email_2001', 'a_href_2001', 'basef_2001', 1, 1, 1, 1, '0.5', 'tizenid202')";
- sqlite3 $WRT_DB "insert into WidgetInfo(app_id, back_supported, pkgname) VALUES(2002, 0, 'tizenid203')";
- sqlite3 $WRT_DB "insert into WidgetInfo(app_id, back_supported, pkgname) VALUES(2003, 0, 'tizenid204')"; # for properties tests
+ sqlite3 $WRT_DB "insert into WidgetInfo(app_id, back_supported, tizen_appid) VALUES(2002, 0, 'tizenid203')";
+ sqlite3 $WRT_DB "insert into WidgetInfo(app_id, back_supported, tizen_appid) VALUES(2003, 0, 'tizenid204')"; # for properties tests
sqlite3 $WRT_DB "${INS_ALL_WIDGETEXT} VALUES(2000, 'share_href_2000', 0)";
sqlite3 $WRT_DB "${INS_ALL_WIDGETEXT} VALUES(2001, 'share_href_2001', 0)";
sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES('tizenid203', 'key2_for_2002', 'value2_for_key_2002', 1)";
#create if not exists and fix autoincrement value
- sqlite3 $WRT_DB "INSERT INTO WidgetInfo(pkgname) VALUES('temp')";
- sqlite3 $WRT_DB "DELETE FROM WidgetInfo WHERE pkgname = 'temp'";
+ sqlite3 $WRT_DB "INSERT INTO WidgetInfo(tizen_appid) VALUES('temp')";
+ sqlite3 $WRT_DB "DELETE FROM WidgetInfo WHERE tizen_appid = 'temp'";
sqlite3 $WRT_DB "UPDATE sqlite_sequence SET seq = 2004 WHERE name = 'WidgetInfo'";
exit $?
using namespace DPL::DB::ORM;
using namespace DPL::DB::ORM::dpl_orm_test;
TestTableDelete::Select selectStart(interface.get());
- selectStart.OrderBy("ColumnInt2 ASC");
+ selectStart.OrderBy(DPL::TypeListDecl<OrderingAscending<TestTableDelete::ColumnInt2> >());
std::list<TestTableDelete::Row> list = selectStart.GetRowList();
std::list<TestTableDelete::Row> originalList = list;
oss.str(std::string());
}
}
+
+RUNNER_TEST(ORM_SelectOrderByMultipleColumns)
+{
+ SmartAttach interface;
+ using namespace DPL::DB::ORM;
+ using namespace DPL::DB::ORM::dpl_orm_test;
+ {
+ TestTableJoin3::Select select(interface.get());
+
+ // testing: " ORDER BY Value3 ASC, TestID DESC, TestID ASC"
+ select.OrderBy(DPL::TypeListDecl<OrderingAscending<TestTableJoin3::Value3>,
+ OrderingDescending<TestTableJoin3::TestText33>,
+ OrderingAscending<TestTableJoin3::TestID> >());
+
+ std::list<TestTableJoin3::Row> result = select.GetRowList();
+ std::list<TestTableJoin3::Row>::const_iterator iter = result.begin();
+ { //1 row
+ RUNNER_ASSERT_MSG(*iter->Get_TestText33() == DPL::FromASCIIString("test 6"), "Wrong row 1 order");
+ RUNNER_ASSERT_MSG(iter->Get_TestID() == 10, "Wrong row 1 order");
+ iter++;
+ }
+ { //2 row
+ RUNNER_ASSERT_MSG(*iter->Get_TestText33() == DPL::FromASCIIString("test 5"), "Wrong row 2 order");
+ RUNNER_ASSERT_MSG(iter->Get_TestID() == 7, "Wrong row 2 order");
+ iter++;
+ }
+ { //3 row
+ RUNNER_ASSERT_MSG(iter->Get_Value3() == 111, "Wrong row 3 order");
+ RUNNER_ASSERT_MSG(*iter->Get_TestText33() == DPL::FromASCIIString("test 2"), "Wrong row 3 order");
+ RUNNER_ASSERT_MSG(iter->Get_TestID() == 2, "Wrong row 3 order");
+ iter++;
+ }
+ { //4 row
+ RUNNER_ASSERT_MSG(iter->Get_Value3() == 111, "Wrong row 4 order");
+ RUNNER_ASSERT_MSG(*iter->Get_TestText33() == DPL::FromASCIIString("test 1"), "Wrong row 4 order");
+ RUNNER_ASSERT_MSG(iter->Get_TestID() == 1, "Wrong row 4 order");
+ iter++;
+ }
+ { //5 row
+ RUNNER_ASSERT_MSG(iter->Get_Value3() == 222, "Wrong row 5 order");
+ RUNNER_ASSERT_MSG(*iter->Get_TestText33() == DPL::FromASCIIString("test 4"), "Wrong row 5 order");
+ RUNNER_ASSERT_MSG(iter->Get_TestID() == 6, "Wrong row 5 order");
+ iter++;
+ }
+ { //6 row
+ RUNNER_ASSERT_MSG(iter->Get_Value3() == 222, "Wrong row 6 order");
+ RUNNER_ASSERT_MSG(*iter->Get_TestText33() == DPL::FromASCIIString("test 3"), "Wrong row 6 order");
+ RUNNER_ASSERT_MSG(iter->Get_TestID() == 3, "Wrong row 6 order");
+ iter++;
+ }
+ }
+}
*/
DbWidgetHandle getHandle() const { return m_widgetHandle; }
DbWidgetHandle getHandle(const WidgetGUID GUID) const;
- static DbWidgetHandle getHandle(const DPL::String pkgName);
+ static DbWidgetHandle getHandle(const DPL::String tizenAppId);
/**
* This method returns the root directory of widget resource.
return 0;
}
-DbWidgetHandle WidgetDAO::getHandle(const DPL::String /* pkgName */)
+DbWidgetHandle WidgetDAO::getHandle(const DPL::String /* tizenAppId */)
{
LogError("Not implemented!");
return 0;