}
}
-void GlobalDAO::AddWhiteURI(const std::string &uri, bool subDomain)
-{
- LogDebug("Add White URI : " << uri);
- Try {
- using namespace DPL::DB::ORM;
- using namespace DPL::DB::ORM::wrt;
- WidgetWhiteURIList::Row row;
- row.Set_uri(DPL::FromASCIIString(uri));
- row.Set_subdomain_access(static_cast<int>(subDomain));
- wrt::ScopedTransaction transaction(&WrtDatabase::interface());
-
- WRT_DB_INSERT(insert, WidgetWhiteURIList, &WrtDatabase::interface())
-
- insert->Values(row);
- insert->Execute();
- transaction.Commit();
- }
- Catch(DPL::DB::SqlConnection::Exception::Base){
- ReThrowMsg(GlobalDAO::Exception::DatabaseError,
- "Failed to add white URI");
- }
-}
-
-void GlobalDAO::RemoveWhiteURI(const std::string &uri)
-{
- LogDebug("Remove White URI : " << uri);
- Try {
- using namespace DPL::DB::ORM;
- using namespace DPL::DB::ORM::wrt;
-
- WRT_DB_DELETE(deleteFrom, WidgetWhiteURIList, &WrtDatabase::interface())
- deleteFrom->Where(Equals<WidgetWhiteURIList::uri>(DPL::FromASCIIString(
- uri)));
- deleteFrom->Execute();
- } Catch(DPL::DB::SqlConnection::Exception::Base) {
- ReThrowMsg(GlobalDAO::Exception::DatabaseError,
- "Failed to removed white URI from AdultBlackList");
- }
-}
-
void GlobalDAO::SetCookieSharingMode(bool mode)
{
LogDebug("updating Cookie Sharing mode to:" << mode);
}
}
-WidgetAccessInfoList GlobalDAOReadOnly::GetWhiteURIList()
-{
- LogDebug("Getting WhiteURIList.");
- Try {
- using namespace DPL::DB::ORM;
- using namespace DPL::DB::ORM::wrt;
- WRT_DB_SELECT(select, WidgetWhiteURIList, &WrtDatabase::interface())
-
- WidgetAccessInfoList resultList;
- typedef std::list<WidgetWhiteURIList::Row> RowList;
- RowList list = select->GetRowList();
-
- for (RowList::iterator i = list.begin(); i != list.end(); ++i) {
- WidgetAccessInfo whiteURI;
- whiteURI.strIRI = i->Get_uri();
- whiteURI.bSubDomains = i->Get_subdomain_access();
- resultList.push_back(whiteURI);
- LogDebug("[uri] : " << whiteURI.strIRI <<
- ", [subdomain] : " << whiteURI.bSubDomains);
- }
- return resultList;
- } Catch(DPL::DB::SqlConnection::Exception::Base) {
- ReThrowMsg(GlobalDAOReadOnly::Exception::DatabaseError,
- "Failed to get whiteURI list");
- }
-}
-
bool GlobalDAOReadOnly::GetCookieSharingMode()
{
LogDebug("Getting Cookie Sharing mode");
static bool GetSecureByDefault() DPL_DEPRECATED;
- static WidgetAccessInfoList GetWhiteURIList() DPL_DEPRECATED;
-
static bool GetCookieSharingMode() DPL_DEPRECATED;
enum NetworkAccessMode
public:
static void SetSecureByDefault(bool secureByDefault) DPL_DEPRECATED;
- static void AddWhiteURI(const std::string &value, bool subDomain) DPL_DEPRECATED;
-
- static void RemoveWhiteURI(const std::string &uri) DPL_DEPRECATED;
-
/**
* This method changes network access mode while roaming is enabled.
*
)
CREATE_TABLE_END()
-CREATE_TABLE(WidgetWhiteURIList)
- COLUMN_NOT_NULL(uri, VARCHAR(65536), primary key)
- COLUMN_NOT_NULL(subdomain_access, INT, CHECK(subdomain_access between 0 and 1))
-CREATE_TABLE_END()
-
CREATE_TABLE(EncryptedResourceList)
COLUMN_NOT_NULL(app_id, INT,)
COLUMN_NOT_NULL(resource, TEXT,)
)
CREATE_TABLE_END()
-SQL(
- INSERT INTO WidgetWhiteURIList VALUES("http://samsung.com", 1);
- INSERT INTO WidgetWhiteURIList VALUES("http://orange.fr", 1);
- INSERT INTO WidgetWhiteURIList VALUES("http://orange.co.uk", 1);
-)
-
/*TODO: It will be removed when user agent is fixed. User agent MUST be configurable in development...*/
CREATE_TABLE(UserAgents)
COLUMN_NOT_NULL(key_name, TEXT,)