}
}
-//user agent strings are stored in db...
-//and it is configurable for test in development.
-DPL::String GlobalDAOReadOnly::GetUserAgentValue(const DPL::String &key)
-{
- LogDebug("Get User Agent Value : " << key);
- Try {
- using namespace DPL::DB::ORM;
- using namespace DPL::DB::ORM::wrt;
- WRT_DB_SELECT(select, UserAgents, &WrtDatabase::interface())
- select->Where(Equals<UserAgents::key_name>(key));
- DPL::Optional<DPL::String> agent =
- select->GetSingleValue<UserAgents::key_value>();
- if (agent.IsNull()) {
- return DPL::FromUTF8String("");
- } else {
- return *agent;
- }
- }
- Catch(DPL::DB::SqlConnection::Exception::Base){
- ReThrowMsg(GlobalDAOReadOnly::Exception::DatabaseError,
- "Failed to get user agent string");
- }
-}
-
DeviceCapabilitySet GlobalDAOReadOnly::GetDeviceCapability(
const DPL::String &apifeature)
{
)
CREATE_TABLE_END()
-/*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,)
- COLUMN(key_value, TEXT, DEFAULT '')
-
- TABLE_CONSTRAINTS(PRIMARY KEY(key_name))
-CREATE_TABLE_END()
-
SQL(
- INSERT INTO UserAgents VALUES("Galaxy S", "Mozilla/5.0 (Linux; U; Android 2.3.7; en-gb; GT-I9000 Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1");
- INSERT INTO UserAgents VALUES("Galaxy S II", "Mozilla/5.0 (Linux; U; Android 2.3.5; en-gb; GT-I9100 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1");
- INSERT INTO UserAgents VALUES("Galaxy S III", "Mozilla/5.0 (Linux; U; Android 4.0.4; en-gb; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30");
- INSERT INTO UserAgents VALUES("SLP Galaxy", "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; GT-I9500 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1");
- INSERT INTO UserAgents VALUES("Tizen", "Mozilla/5.0 (Linux; U; Tizen 2.1; en-us; SAMSUNG GT-I8800) AppleWebKit/537.1 (KHTML, like Gecko) Version/2.1.0 Mobile");
- INSERT INTO UserAgents VALUES("Galaxy Nexus", "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; Galaxy Nexus Build/IML74K) AppleWebKit/535.7 (KHTML, like Gecko) Mobile Safari/535.7");
- INSERT INTO UserAgents VALUES("Samsung", "Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-I9200/1.0; U; Linux/SLP/2.0; ko-kr) AppleWebKit/534.4 (KHTML, like Gecko) Dolfin/2.0 Mobile");
- INSERT INTO UserAgents VALUES("Samsung Dolfin", "SAMSUNG-GT-S8500/S8500XXJD2 SHP/VPP/R5 Dolfin/2.0 Nextreaming SMM-MMS/1.2.0 profile/MIDP-2.1 configuration/CLDC-1.1");
- INSERT INTO UserAgents VALUES("Apple iPhone 3", "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_3 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7E18 Safari/528.16");
- INSERT INTO UserAgents VALUES("Apple iPhone 4", "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8L1 Safari/6533.18.5");
- INSERT INTO UserAgents VALUES("Apple iOS 5", "Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3");
- INSERT INTO UserAgents VALUES("Android 2.3 (Nexus One)", "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Nexus One Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1");
- INSERT INTO UserAgents VALUES("Opera Mobi", "Opera/9.80 (Windows NT 6.1; U; Edition IBIS; en) Presto/2.6.30 Version/10.63");
- INSERT INTO UserAgents VALUES("Samsung Bada", "Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-S8500/1.0; U; Bada/1.0; en-us) AppleWebKit/533.1 (KHTML, like Gecko) Dolfin/2.0 Mobile WVGA SMM-MMS/1.2.0 OPN-B");
- INSERT INTO UserAgents VALUES("Orange TV 3.2 iPhone", "Mozilla/5.0 (OrangeTVPlayer4iPhone/iPhone2,1; U; CPU iPhone OS 4_3 like Mac OS X; fr) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5F136 Safari/525.20 OrangeAppliTVHTTPLS/3.2.16");
- INSERT INTO UserAgents VALUES("Orange TV 3.2 iPad", "Mozilla/5.0 (OrangeTVPlayer4iPhone/iPad1,1; U; CPU iPhone OS 4_3 like Mac OS X; fr) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5F136 Safari/525.20 iPad=SIMENABLED OrangeAppliTVHTTPLS/3.2.16");
- INSERT INTO UserAgents VALUES("Orange TV 3.3 iOS", "OrangeTVPlayer4iPhone/_iOS_3.3.3_Apple_iPhone2,1_4.1_OrangeAppliTVHTTPLS/3.3.3");
- INSERT INTO UserAgents VALUES("Chrome Browser for android", "Mozilla/5.0 (Linux; U; Android 4.0.1; ko-kr; Galaxy Nexus Build/ITL41F) AppleWebKit/535.7 (KHTML, like Gecko) CrMo/16.0.912.75 Mobile Safari/535.7");
- INSERT INTO UserAgents VALUES("MANGO(Nokia 800C)", "Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; Nokia; 800C)");
- INSERT INTO UserAgents VALUES("Orange TV 3.2 Tizen", "Mozilla/5.0 (Linux; U; Tizen 1.0; fr-fr; GT-I8800) AppleWebKit/534.46 (KHTML, like Gecko) Mobile Tizen Browser/1.0 OrangeAppliTV/3.2.0");
- INSERT INTO UserAgents VALUES("System user agent", "");
- INSERT INTO UserAgents VALUES("Samsung Bada 2.0", "Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-S8500/1.0; U; Bada/2.0; en-us) AppleWebKit/534.20 (KHTML, like Gecko) Mobile WVGA SMM-MMS/1.2.0 OPN-B Dolfin/3.0");
- INSERT INTO UserAgents VALUES("Samsung Desktop", "Mozilla/5.0 (U; Linux/SLP/2.0; ko-kr) AppleWebKit/533.1 (KHTML, like Gecko)");
- INSERT INTO UserAgents VALUES("Firefox 5", "Mozilla/5.0 (Windows NT 6.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1");
- INSERT INTO UserAgents VALUES("Firefox 5 Fennec(Mobile)", "Mozilla/5.0 (Android; Linux armv7l; rv:5.0) Gecko/20110615 Firefox/5.0 Fennec/5.0");
- INSERT INTO UserAgents VALUES("Safari 5.0", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7");
- INSERT INTO UserAgents VALUES("Google Chrome 18.0", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.16 (KHTML, like Gecko) Chrome/18.0.1003.1 Safari/535.16");
- INSERT INTO UserAgents VALUES("Internet Explorer 9", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)");
- INSERT INTO UserAgents VALUES("Galaxy Tab 10.1", "Mozilla/5.0 (Linux; U; Android 3.0.1; en-us; GT-P7100 Build/HRI83) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13");
- INSERT INTO UserAgents VALUES("iPad 2", "Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8L1 Safari/6533.18.5");
-)
- SQL(
COMMIT;
)