upload tizen1.0 source
[framework/web/wrt-commons.git] / modules / widget_dao / dao / global_dao_read_only.cpp
index cb26a1e..88ce51b 100644 (file)
 
 namespace WrtDB {
 
-ChildProtection::BlackList GlobalDAOReadOnly::GetAdultBlackList()
-{
-    LogDebug("Getting AdultBlackList");
-    Try {
-        using namespace DPL::DB::ORM;
-        using namespace DPL::DB::ORM::wrt;
-        WRT_DB_SELECT(select, ChildProtectionBlacklist, &WrtDatabase::interface())
-        std::list<DPL::String> list =
-            select->GetValueList<ChildProtectionBlacklist::url>();
-        ChildProtection::BlackList blacklist(list.begin(), list.end());
-        return blacklist;
-    }
-    Catch(DPL::DB::SqlConnection::Exception::Base){
-        ReThrowMsg(GlobalDAOReadOnly::Exception::DatabaseError,
-                   "Failed to get AdultBalckList");
-    }
-}
-
-bool GlobalDAOReadOnly::IsElementOnAdultBlackList(const DPL::String &url)
-{
-    Try {
-        using namespace DPL::DB::ORM;
-        using namespace DPL::DB::ORM::wrt;
-        WRT_DB_SELECT(select, ChildProtectionBlacklist, &WrtDatabase::interface())
-        select->Where(Equals<ChildProtectionBlacklist::url>(url));
-
-        return !select->GetRowList().empty();
-    } Catch(DPL::DB::SqlConnection::Exception::Base) {
-        ReThrowMsg(GlobalDAOReadOnly::Exception::DatabaseError,
-                   "Failure during checking if url is on pwoder black list");
-    }
-}
-
 bool GlobalDAOReadOnly::GetDeveloperMode()
 {
     LogDebug("Getting Developer mode");
@@ -96,22 +63,6 @@ WidgetPackageList GlobalDAOReadOnly::GetDefferedWidgetPackageInstallationList()
     }
 }
 
-bool GlobalDAOReadOnly::GetParentalMode()
-{
-    using namespace DPL::DB::ORM;
-    using namespace DPL::DB::ORM::wrt;
-    WRT_DB_SELECT(select, GlobalProperties, &WrtDatabase::interface())
-    return select->GetSingleValue<GlobalProperties::parental_mode>();
-}
-
-DPL::OptionalInt GlobalDAOReadOnly::GetParentalAllowedAge()
-{
-    using namespace DPL::DB::ORM;
-    using namespace DPL::DB::ORM::wrt;
-    WRT_DB_SELECT(select, GlobalProperties, &WrtDatabase::interface())
-    return select->GetSingleValue<GlobalProperties::parental_allowed_age>();
-}
-
 bool GlobalDAOReadOnly::GetSecureByDefault()
 {
     using namespace DPL::DB::ORM;
@@ -186,64 +137,6 @@ bool GlobalDAOReadOnly::IsValidSubTag(const DPL::String& tag, int type)
     }
 }
 
-
-bool GlobalDAOReadOnly::IsPowderRulePresent(
-        const ChildProtection::PowderRules::CategoryRule& powder)
-{
-    Try {
-        using namespace DPL::DB::ORM;
-        using namespace DPL::DB::ORM::wrt;
-
-        if (!powder.context.IsNull()) {
-            WRT_DB_SELECT(selWithContext, PowderRules, &WrtDatabase::interface())
-
-            selWithContext->Where(
-                And(Equals<PowderRules::category>(powder.category),
-                    And(Equals<PowderRules::level>(powder.level),
-                        Equals<PowderRules::context>(powder.context))));
-            return !selWithContext->GetRowList().empty();
-        } else {
-            WRT_DB_SELECT(selWithoutContext, PowderRules, &WrtDatabase::interface())
-            selWithoutContext->Where(
-                And(Equals<PowderRules::category>(powder.category),
-                    And(Equals<PowderRules::level>(powder.level),
-                        Is<PowderRules::context>(powder.context))));
-            return !selWithoutContext->GetRowList().empty();
-        }
-    }
-    Catch(DPL::DB::SqlConnection::Exception::Base) {
-        ReThrowMsg(GlobalDAOReadOnly::Exception::DatabaseError,
-                   "Failure during checking if rule is present");
-    }
-}
-
-ChildProtection::PowderRules GlobalDAOReadOnly::GetPowderRules()
-{
-    ChildProtection::PowderRules powder;
-    powder.ageLimit = GetParentalAllowedAge();
-
-    Try {
-        using namespace DPL::DB::ORM;
-        using namespace DPL::DB::ORM::wrt;
-        typedef std::list<PowderRules::Row> PowderRulesList;
-        WRT_DB_SELECT(select, PowderRules, &WrtDatabase::interface())
-
-        PowderRulesList list = select->GetRowList();
-        FOREACH(it, list) {
-            using namespace Powder;
-            powder.rules.push_back(
-                ChildProtection::PowderRules::CategoryRule(
-                    it->Get_category(),
-                    static_cast<Description::LevelEnum>(it->Get_level()),
-                    it->Get_context()));
-        }
-        return powder;
-    } Catch(DPL::DB::SqlConnection::Exception::Base) {
-        ReThrowMsg(GlobalDAOReadOnly::Exception::DatabaseError,
-                   "Failed to get POWDER rules");
-    }
-}
-
 GlobalDAOReadOnly::NetworkAccessMode
         GlobalDAOReadOnly::GetHomeNetworkDataUsage()
 {
@@ -342,30 +235,6 @@ DeviceCapabilitySet GlobalDAOReadOnly::GetDeviceCapability(
     }
 }
 
-DPL::Optional<GlobalDAOReadOnly::AutoSaveData>
-        GlobalDAOReadOnly::GetAutoSaveIdPasswd(const DPL::String &url)
-{
-    Try{
-        using namespace DPL::DB::ORM;
-        using namespace DPL::DB::ORM::wrt;
-        WRT_DB_SELECT(select, AutoSaveIdPasswd, &WrtDatabase::interface());
-        select->Where(Equals<AutoSaveIdPasswd::address>(url));
-        AutoSaveIdPasswd::Select::RowList rows = select->GetRowList();
-
-        if (rows.empty()) {
-            return DPL::Optional<GlobalDAOReadOnly::AutoSaveData>::Null;
-        }
-
-        GlobalDAOReadOnly::AutoSaveData saveData;
-        saveData.userId = rows.front().Get_userId();
-        saveData.passwd = rows.front().Get_passwd();
-        return saveData;
-    } Catch(DPL::DB::SqlConnection::Exception::Base) {
-        ReThrowMsg(GlobalDAOReadOnly::Exception::DatabaseError,
-                   "Failed to get autosave data string");
-    }
-}
-
 WidgetAccessInfoList GlobalDAOReadOnly::GetWhiteURIList()
 {
     LogDebug("Getting WhiteURIList.");