//it is default one
NONE,
//object should be copied as reference to each iframe
- REFERENCE,
+ REFERENCE, // deprecated
//object should be created for each iframe and NOT inform plugin
CREATE_INSTANCE
} class_definition_iframe_behaviour_t;
typedef enum class_definition_iframe_overlay_e
{
IGNORED,
- USE_OVERLAYED,
- OVERLAYED_BEFORE_ORIGINAL
-} class_definition_iframe_overlay_t;
+ USE_OVERLAYED, //deprecated
+ OVERLAYED_BEFORE_ORIGINAL //deprecated
+} class_definition_iframe_overlay_t; //deprecated
typedef void* js_object_instance_t;
//global_context - id
class_definition_type_t type;
class_definition_iframe_behaviour_t iframe_option;
class_definition_iframe_notice_t iframe_notice;
- class_definition_iframe_overlay_t iframe_overlay;
+ class_definition_iframe_overlay_t iframe_overlay; //deprecated
iframe_loaded_cb cb;
void * private_data;
js_function_impl function;
}
}
+ImplementedObjectsList PluginDAOReadOnly::getImplementedObjects()
+{
+ LogDebug("getImplementedObjects");
+
+ Try
+ {
+ ImplementedObjectsList objectList;
+ using namespace DPL::DB::ORM;
+ using namespace DPL::DB::ORM::wrt;
+
+ WRT_DB_SELECT(select, PluginImplementedObjects, &WrtDatabase::interface())
+ std::list<DPL::String> valueList = select->GetValueList<PluginImplementedObjects::PluginObject>();
+
+ if (!valueList.empty()) {
+ FOREACH(it, valueList)
+ {
+ objectList.push_back(DPL::ToUTF8String(*it));
+ }
+ } else {
+ LogWarning("PluginHandle for object not found");
+ }
+ return objectList;
+ }
+ Catch(DPL::DB::SqlConnection::Exception::Base) {
+ ReThrowMsg(PluginDAOReadOnly::Exception::DatabaseError,
+ "Failed in GetPluginHandleForImplementedObject");
+ }
+}
+
ImplementedObjectsList PluginDAOReadOnly::getImplementedObjectsForPluginHandle(
DbPluginHandle handle)
{
}
}
-//deprecated
-WidgetPreferenceList GetPropertyList(DbWidgetHandle widgetHandle)
-{
- Try {
- TizenAppId tzAppid = WidgetDAOReadOnly::getTzAppId(widgetHandle);
- return GetPropertyList(tzAppid);
- } Catch(WidgetDAOReadOnly::Exception::WidgetNotExist){
- WidgetPreferenceList empty;
- return empty;
- }
-}
-WidgetPreferenceList GetPropertyList(TizenAppId tzAppId)
+WidgetPreferenceList GetPropertyListRows(DbWidgetHandle widgetHandle)
{
- LogDebug("Get Property list. tizenAppId: " << tzAppId);
Try {
using namespace DPL::DB::ORM;
using namespace DPL::DB::ORM::wrt;
-
- DbWidgetHandle widgetHandle(WidgetDAOReadOnly::getHandle(tzAppId));
-
WRT_DB_SELECT(select, WidgetPreference, &WrtDatabase::interface())
- select->Where(Equals<WidgetPreference::app_id>(widgetHandle));
-
+ select->Where(Equals<WidgetPreference::app_id>(widgetHandle));
ORMWidgetPreferenceList ormPrefList = select->GetRowList();
WidgetPreferenceList prefList;
convertWidgetPreferenceRow(ormPrefList, prefList);
-
return prefList;
- }
- Catch(DPL::DB::SqlConnection::Exception::Base){
+ }Catch(DPL::DB::SqlConnection::Exception::Base){
ReThrowMsg(Exception::DatabaseError,
- "Failure during getting property list");
+ "Failure during getting property list");
}
}
+WidgetPreferenceList GetPropertyList(DbWidgetHandle widgetHandle)
+{
+ if(!(WidgetDAOReadOnly::isWidgetInstalled(widgetHandle)))
+ ThrowMsg(WidgetDAOReadOnly::Exception::WidgetNotExist,
+ "Failed to get widget");
+ return GetPropertyListRows(widgetHandle);
+}
+
+WidgetPreferenceList GetPropertyList(TizenAppId tzAppId)
+{
+ LogDebug("Get Property list. tizenAppId: " << tzAppId);
+ DbWidgetHandle widgetHandle(WidgetDAOReadOnly::getHandle(tzAppId));
+ return GetPropertyListRows(widgetHandle);
+}
+
+
WidgetPropertyValue GetPropertyValue(TizenAppId tzAppid,
const WidgetPropertyKey &key)
{
static DbPluginHandle getPluginHandleForImplementedObject(
const std::string& objectName);
+ static ImplementedObjectsList getImplementedObjects();
static ImplementedObjectsList getImplementedObjectsForPluginHandle(
DbPluginHandle handle);
#git:framework/web/wrt-commons
Name: wrt-commons
Summary: Wrt common library
-Version: 0.2.133
+Version: 0.2.134
Release: 1
Group: Development/Libraries
License: Apache License, Version 2.0
#include <dpl/exception.h>
#include <dpl/wrt-dao-rw/property_dao.h>
#include <dpl/wrt-dao-ro/wrt_db_types.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
using namespace WrtDB;
using namespace WrtDB::PropertyDAOReadOnly;
RUNNER_TEST_GROUP_INIT(DAO)
+
/*
* Name: property_dao_get_lists
* Description: tests returning list of properties for given id
RUNNER_TEST(property_dao_get_lists)
{
{ //property list
- std::map<WrtDB::TizenAppId, size_t> prefsMap;
- prefsMap.insert(std::pair<WrtDB::TizenAppId, size_t>(L"tizenid201", 2));
- prefsMap.insert(std::pair<WrtDB::TizenAppId, size_t>(L"tizenid202", 1));
- prefsMap.insert(std::pair<WrtDB::TizenAppId, size_t>(L"tizenid203", 2));
- //no widget
- prefsMap.insert(std::pair<WrtDB::TizenAppId, size_t>(L"non_exists", 0));
-
- FOREACH(it, prefsMap) {
- PropertyDAOReadOnly::WidgetPreferenceList prefs =
- PropertyDAOReadOnly::GetPropertyList(it->first);
- RUNNER_ASSERT(prefs.size() == it->second);
+ struct three_field{
+ WrtDB::TizenAppId tappid;
+ DbWidgetHandle whandleid;
+ size_t nrow;
+ };
+
+ three_field f3;
+ std::list<three_field> prefList;
+ std::list<three_field>::iterator it;
+
+ f3.tappid=L"tizenid201";f3.whandleid=2000;f3.nrow=2;
+ prefList.push_back(f3);
+ f3.tappid=L"tizenid202"; f3.whandleid=2001;f3.nrow=1;
+ prefList.push_back(f3);
+ f3.tappid=L"tizenid203"; f3.whandleid=2002;f3.nrow=2;
+ prefList.push_back(f3);
+ f3.tappid=L"tizenid204"; f3.whandleid=2003;f3.nrow=0;
+ prefList.push_back(f3);
+
+ for(it=prefList.begin();it!=prefList.end();++it)
+ {
+ PropertyDAOReadOnly::WidgetPreferenceList prefs_tid =
+ PropertyDAOReadOnly::GetPropertyList(it->tappid);
+ RUNNER_ASSERT(prefs_tid.size() == it->nrow);
+ PropertyDAOReadOnly::WidgetPreferenceList prefs_aid =
+ PropertyDAOReadOnly::GetPropertyList(it->whandleid);
+ RUNNER_ASSERT(prefs_aid.size() == it->nrow);
}
}
-
{ //property key list
WidgetPropertyKeyList orig_2000;
orig_2000.push_back(DPL::FromUTF8String("key1_for_2000"));
}
}
+
+/*
+ * Name: property_dao_get_list_exceptions
+ * Description: tests returning exception for given tizen_appid if is
+ * not inserted into WidgetInfo table
+ * Expected: procedure passes when is exception. Widget absent in the WidgetInfo
+ * table.
+ */
+RUNNER_TEST(property_dao_get_list_exceptions)
+{
+ {
+ bool assert_flag;
+ WrtDB::TizenAppId app_id_non_exists = L"non_exists";
+
+ assert_flag=true;
+ Try{
+ PropertyDAOReadOnly::WidgetPreferenceList prefs =
+ PropertyDAOReadOnly::GetPropertyList(app_id_non_exists);
+ } Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
+ {
+ assert_flag=false;
+ }
+ RUNNER_ASSERT_MSG(!(assert_flag),"Error, value doesn't make exception");
+ }
+ {
+ bool assert_flag;
+ DbWidgetHandle handle_non_exist(2010);
+ assert_flag=true;
+ Try{
+ PropertyDAOReadOnly::WidgetPreferenceList prefs =
+ PropertyDAOReadOnly::GetPropertyList(handle_non_exist);
+ } Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
+ {
+ assert_flag=false;
+ }
+ RUNNER_ASSERT_MSG(!(assert_flag),"Error, value doesn't make exception");
+ }
+}
+
+
/*
* Name: property_dao_set_update_remove
* Description: tests set new property for widget, updating property and
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(tizen_appid, key_name, key_value, readonly)"
+ INS_ALL_WIDGET_PREF="insert into WidgetPreference(app_id,tizen_appid, key_name, key_value, readonly)"
INS_ALL_WIDGET_FEATURE="insert into WidgetFeature(app_id, name)"
INS_ALL_WIDGET_WINMODES="insert into WidgetWindowModes(app_id, window_mode)"
INS_ALL_WIDGET_WARP="insert into WidgetWARPInfo(app_id, iri, subdomain_access)"
sqlite3 $WRT_DB "${INS_ALL_WIDGET_LOC_STARTFILE} VALUES(2003, 4, 'en', '', '')";
#widget properties
- sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES('tizenid201', 'key1_for_2000', 'value_for_key1_2000', 0)";
- sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES('tizenid201', 'key2_for_2000', 'value_for_key2_2000', 0)";
- sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES('tizenid202', 'key1_for_2001', 'value1_for_key_2001', 1)";
- sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES('tizenid203', 'key1_for_2002', 'value1_for_key_2002', 0)";
- sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES('tizenid203', 'key2_for_2002', 'value2_for_key_2002', 1)";
+ sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES(2000,'tizenid201', 'key1_for_2000', 'value_for_key1_2000', 0)";
+ sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES(2000,'tizenid201', 'key2_for_2000', 'value_for_key2_2000', 0)";
+ sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES(2001,'tizenid202', 'key1_for_2001', 'value1_for_key_2001', 1)";
+ sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES(2002,'tizenid203', 'key1_for_2002', 'value1_for_key_2002', 0)";
+ sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES(2002,'tizenid203', 'key2_for_2002', 'value2_for_key_2002', 1)";
#create if not exists and fix autoincrement value
sqlite3 $WRT_DB "INSERT INTO WidgetInfo(tizen_appid) VALUES('temp')";