|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.opencms.jsp.util.CmsJspDeviceSelector
public class CmsJspDeviceSelector
This class provides the detection for different devices, so that the
<cms:device type="...">-Tag can detect which device sends the HTTP request.
| Field Summary | |
|---|---|
static java.lang.String |
C_CONSOLE
Constant for console detection. |
static java.lang.String |
C_DESKTOP
Constant for desktop detection. |
static java.lang.String |
C_MOBILE
Constant for mobile detection. |
static java.lang.String |
DEVICE_ANDROID
A Smartphone name constant. |
static java.lang.String |
DEVICE_ARCHOS
Constant for other random devices and mobile browsers. |
static java.lang.String |
DEVICE_BB
A Smartphone name constant. |
static java.lang.String |
DEVICE_BREW
Constant for other random devices and mobile browsers. |
static java.lang.String |
DEVICE_DANGER
Constant for other random devices and mobile browsers. |
static java.lang.String |
DEVICE_HIPTOP
Constant for other random devices and mobile browsers. |
static java.lang.String |
DEVICE_IEMOBILE
A Smartphone name constant. |
static java.lang.String |
DEVICE_IPHONE
A Smartphone name constant. |
static java.lang.String |
DEVICE_IPOD
A Smartphone name constant. |
static java.lang.String |
DEVICE_MIDP
Constant for other random devices and mobile browsers. |
static java.lang.String |
DEVICE_NINTENDO
Constant for other random devices and mobile browsers. |
static java.lang.String |
DEVICE_NINTENDO_DS
Constant for other random devices and mobile browsers. |
static java.lang.String |
DEVICE_PALM
A Smartphone name constant. |
static java.lang.String |
DEVICE_PDA
Constant for other random devices and mobile browsers. |
static java.lang.String |
DEVICE_PLAYSTATION
Constant for other random devices and mobile browsers. |
static java.lang.String |
DEVICE_S60
A Smartphone name constant. |
static java.lang.String |
DEVICE_S70
A Smartphone name constant. |
static java.lang.String |
DEVICE_S80
A Smartphone name constant. |
static java.lang.String |
DEVICE_S90
A Smartphone name constant. |
static java.lang.String |
DEVICE_SYMBIAN
A Smartphone name constant. |
static java.lang.String |
DEVICE_WII
Constant for other random devices and mobile browsers. |
static java.lang.String |
DEVICE_WIN_MOBILE
A Smartphone name constant. |
static java.lang.String |
DEVICE_WINDOWS
A Smartphone name constant. |
static java.lang.String |
DEVICE_XBOX
Constant for other random devices and mobile browsers. |
static java.lang.String |
ENGINE_BLAZER
A Smartphone name constant. |
static java.lang.String |
ENGINE_NETFRONT
Constant for other random devices and mobile browsers. |
static java.lang.String |
ENGINE_OPEN_WEB
Constant for other random devices and mobile browsers. |
static java.lang.String |
ENGINE_OPERA
Constant for other random devices and mobile browsers. |
static java.lang.String |
ENGINE_PIE
A Smartphone name constant. |
static java.lang.String |
ENGINE_UP_BROWSER
Constant for other random devices and mobile browsers. |
static java.lang.String |
ENGINE_WEBKIT
A Smartphone name constant. |
static java.lang.String |
ENGINE_XIINO
A Smartphone name constant. |
static java.lang.String |
LINUX
Constant for other random devices and mobile browsers. |
protected java.lang.String |
m_httpAccept
Accept HTTP request header. |
protected java.lang.String |
m_userAgent
User-Agent HTTP request header. |
static java.lang.String |
MAEMO
Constant for other random devices and mobile browsers. |
static java.lang.String |
MAEMO_TABLET
Constant for other random devices and mobile browsers. |
static java.lang.String |
MANU_ERICSSON
Constant for other random devices and mobile browsers. |
static java.lang.String |
MANU_SAMSUNG1
Constant for other random devices and mobile browsers. |
static java.lang.String |
MANU_SONY
Constant for other random devices and mobile browsers. |
static java.lang.String |
MANU_SONY_ERICSSON
Constant for other random devices and mobile browsers. |
static java.lang.String |
MINI
Constant for other random devices and mobile browsers. |
static java.lang.String |
MOBI
Constant for other random devices and mobile browsers. |
static java.lang.String |
MOBILE
Constant for other random devices and mobile browsers. |
static java.lang.String |
MYLO_COM2
Constant for other random devices and mobile browsers. |
static java.lang.String |
QT_EMBEDDED
Constant for other random devices and mobile browsers. |
static java.lang.String |
SVC_DOCOMO
Constant for other random devices and mobile browsers. |
static java.lang.String |
SVC_KDDI
Constant for other random devices and mobile browsers. |
static java.lang.String |
SVC_VODAFONE
Constant for other random devices and mobile browsers. |
static java.lang.String |
UPLINK
Constant for other random devices and mobile browsers. |
static java.lang.String |
VND_RIM
A Smartphone name constant. |
static java.lang.String |
VND_WAP
Constant for mobile-specific content. |
static java.lang.String |
WML
Constant for mobile-specific content. |
| Fields inherited from interface org.opencms.jsp.util.I_CmsJspDeviceSelector |
|---|
REQUEST_ATTRIBUTE_DEVICE |
| Constructor Summary | |
|---|---|
CmsJspDeviceSelector()
|
|
| Method Summary | |
|---|---|
protected boolean |
detectAndroid()
Detects if the current device is an Android OS-based device. |
protected boolean |
detectAndroidWebKit()
Detects if the current device is an Android OS-based device and the browser is based on WebKit. |
protected boolean |
detectArchos()
Detects if the current device is an Archos media player/Internet tablet. |
protected boolean |
detectBlackBerry()
Detects if the current browser is a BlackBerry of some sort. |
protected boolean |
detectBrewDevice()
Detects whether the device is a Brew-powered device. |
protected boolean |
detectDangerHiptop()
Detects the Danger Hiptop device. |
protected boolean |
detectGameConsole()
Detects if the current device is an Internet-capable game console. |
protected boolean |
detectIphone()
Detects if the current device is an iPhone. |
protected boolean |
detectIphoneOrIpod()
Detects if the current device is an iPhone or iPod Touch. |
protected boolean |
detectIpod()
Detects if the current device is an iPod Touch. |
protected boolean |
detectMaemoTablet()
Detects if the current device is on one of the Maemo-based Nokia Internet Tablets. |
protected boolean |
detectMidpCapable()
Detects if the current device supports MIDP, a mobile Java technology. |
protected boolean |
detectMobileLong()
The longer and more thorough way to detect for a mobile device. |
protected boolean |
detectMobileQuick()
The quick way to detect for a mobile device. |
protected boolean |
detectNintendo()
Detects if the current device is a Nintendo game device. |
protected boolean |
detectOperaMobile()
Detects Opera Mobile or Opera Mini. |
protected boolean |
detectPalmOS()
Detects if the current browser is on a PalmOS device. |
protected boolean |
detectS60OssBrowser()
Detects if the current browser is the S60 Open Source Browser. |
protected boolean |
detectSmartphone()
Check to see whether the device is any device in the 'smartphone' category. |
protected boolean |
detectSonyMylo()
Detects if the current browser is a Sony Mylo device. |
protected boolean |
detectSonyPlaystation()
Detects if the current device is a Sony Playstation. |
protected boolean |
detectSymbianOS()
Detects if the current device is any Symbian OS-based device, including older S60, Series 70, Series 80, Series 90, and UIQ, or other browsers running on these devices. |
protected boolean |
detectTierIphone()
The quick way to detect for a tier of devices. |
protected boolean |
detectTierOtherPhones()
The quick way to detect for a tier of devices. |
protected boolean |
detectTierSmartphones()
The quick way to detect for a tier of devices. |
protected boolean |
detectWapWml()
Detects whether the device supports WAP or WML. |
protected boolean |
detectWebkit()
Detects if the current browser is based on WebKit. |
protected boolean |
detectWindowsMobile()
Detects if the current browser is a Windows Mobile device. |
protected boolean |
detectXbox()
Detects if the current device is a Microsoft Xbox. |
java.lang.String |
getDeviceType(javax.servlet.http.HttpServletRequest req)
Returns the name of the device type. |
java.util.List<java.lang.String> |
getDeviceTypes()
Returns an array of device types that can be detected. |
java.lang.String |
getHttpAccept()
Return the lower case HTTP_ACCEPT. |
java.lang.String |
getUserAgent()
Return the lower case HTTP_USER_AGENT. |
void |
init(java.lang.String userAgent,
java.lang.String httpAccept)
Initialize the userAgent and httpAccept variables. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String C_CONSOLE
public static final java.lang.String C_DESKTOP
public static final java.lang.String C_MOBILE
public static final java.lang.String DEVICE_ANDROID
public static final java.lang.String DEVICE_ARCHOS
public static final java.lang.String DEVICE_BB
public static final java.lang.String DEVICE_BREW
public static final java.lang.String DEVICE_DANGER
public static final java.lang.String DEVICE_HIPTOP
public static final java.lang.String DEVICE_IEMOBILE
public static final java.lang.String DEVICE_IPHONE
public static final java.lang.String DEVICE_IPOD
public static final java.lang.String DEVICE_MIDP
public static final java.lang.String DEVICE_NINTENDO
public static final java.lang.String DEVICE_NINTENDO_DS
public static final java.lang.String DEVICE_PALM
public static final java.lang.String DEVICE_PDA
public static final java.lang.String DEVICE_PLAYSTATION
public static final java.lang.String DEVICE_S60
public static final java.lang.String DEVICE_S70
public static final java.lang.String DEVICE_S80
public static final java.lang.String DEVICE_S90
public static final java.lang.String DEVICE_SYMBIAN
public static final java.lang.String DEVICE_WII
public static final java.lang.String DEVICE_WIN_MOBILE
public static final java.lang.String DEVICE_WINDOWS
public static final java.lang.String DEVICE_XBOX
public static final java.lang.String ENGINE_BLAZER
public static final java.lang.String ENGINE_NETFRONT
public static final java.lang.String ENGINE_OPEN_WEB
public static final java.lang.String ENGINE_OPERA
public static final java.lang.String ENGINE_PIE
public static final java.lang.String ENGINE_UP_BROWSER
public static final java.lang.String ENGINE_WEBKIT
public static final java.lang.String ENGINE_XIINO
public static final java.lang.String LINUX
public static final java.lang.String MAEMO
public static final java.lang.String MAEMO_TABLET
public static final java.lang.String MANU_ERICSSON
public static final java.lang.String MANU_SAMSUNG1
public static final java.lang.String MANU_SONY
public static final java.lang.String MANU_SONY_ERICSSON
public static final java.lang.String MINI
public static final java.lang.String MOBI
public static final java.lang.String MOBILE
public static final java.lang.String MYLO_COM2
public static final java.lang.String QT_EMBEDDED
public static final java.lang.String SVC_DOCOMO
public static final java.lang.String SVC_KDDI
public static final java.lang.String SVC_VODAFONE
public static final java.lang.String UPLINK
public static final java.lang.String VND_RIM
public static final java.lang.String VND_WAP
public static final java.lang.String WML
protected java.lang.String m_httpAccept
protected java.lang.String m_userAgent
| Constructor Detail |
|---|
public CmsJspDeviceSelector()
| Method Detail |
|---|
public java.lang.String getDeviceType(javax.servlet.http.HttpServletRequest req)
I_CmsJspDeviceSelector
This will be one option in I_CmsJspDeviceSelector.getDeviceTypes().
getDeviceType in interface I_CmsJspDeviceSelectorreq - the HTTP servlet request to process
I_CmsJspDeviceSelector.getDeviceType(javax.servlet.http.HttpServletRequest)public java.util.List<java.lang.String> getDeviceTypes()
I_CmsJspDeviceSelector
getDeviceTypes in interface I_CmsJspDeviceSelectorI_CmsJspDeviceSelector.getDeviceTypes()public java.lang.String getHttpAccept()
HTTP_ACCEPT.
public java.lang.String getUserAgent()
HTTP_USER_AGENT.
public void init(java.lang.String userAgent,
java.lang.String httpAccept)
userAgent - the User-Agent headerhttpAccept - the Accept headerprotected boolean detectAndroid()
true if the device is an Android, false otherwiseprotected boolean detectAndroidWebKit()
true if the device is an Android OS-based, false otherwiseprotected boolean detectArchos()
true if the current device is an Archos media player/Internet tablet, false otherwiseprotected boolean detectBlackBerry()
true if the current browser is a BlackBerry of some sort, false otherwiseprotected boolean detectBrewDevice()
true if the device is a Brew-powered device, false otherwiseprotected boolean detectDangerHiptop()
true if the device is a Danger Hiptop device, false otherwiseprotected boolean detectGameConsole()
true if the device is an Internet-capable game console, false otherwiseprotected boolean detectIphone()
true if the device is an iPhone, false otherwiseprotected boolean detectIphoneOrIpod()
true if the device is an iPhone or iPod Touch, false otherwiseprotected boolean detectIpod()
true if the device is an iPod Touch, false otherwiseprotected boolean detectMaemoTablet()
true if the current device is on one of the Maemo-based Nokia Internet Tablets, false otherwiseprotected boolean detectMidpCapable()
true if the current device supports MIDP, a mobile Java technology, false otherwiseprotected boolean detectMobileLong()
Will probably detect most feature phones, smartphone-class devices, Internet Tablets, Internet-enabled game consoles, etc. This ought to catch a lot of the more obscure and older devices, also -- but no promises on thoroughness!
true if the current device is a mobile, a tablet or a gameconsole, false otherwiseprotected boolean detectMobileQuick()
Will probably detect most recent/current mid-tier Feature Phones as well as smartphone-class devices.
true if the device is mobile, false otherwiseprotected boolean detectNintendo()
true if the device is a Nintendo game, false otherwiseprotected boolean detectOperaMobile()
true if the browser is a Opera Mobile or Opera Mini, false otherwiseprotected boolean detectPalmOS()
true if the current browser is on a PalmOS device, false otherwiseprotected boolean detectS60OssBrowser()
true if the current browser is the S60 Open Source Browser, false otherwiseprotected boolean detectSmartphone()
true if the device is any device in the 'smartphone', false otherwiseprotected boolean detectSonyMylo()
true if the current device is a Sony Mylo device, false otherwiseprotected boolean detectSonyPlaystation()
true if the device is a Sony Playstation, false otherwiseprotected boolean detectSymbianOS()
true if the current device is any Symbian OS-based device, false otherwiseprotected boolean detectTierIphone()
This method detects for devices which can display iPhone-optimized web content. Includes iPhone, iPod Touch, Android, etc.
true if the current device from the iPhone tier, false otherwiseprotected boolean detectTierOtherPhones()
This method detects for all other types of phones, but excludes the iPhone and Smartphone Tier devices.
true if the current device is mobile but not a iPhone and not a smartphone, false otherwiseprotected boolean detectTierSmartphones()
This method detects for all smartphones, but excludes the iPhone Tier devices.
true if the current device is a smartphone but not a iPhone, false otherwiseprotected boolean detectWapWml()
true if the device supports WAP or WML, false otherwiseprotected boolean detectWebkit()
true if the current browser is based on WebKit, false otherwiseprotected boolean detectWindowsMobile()
true if the current browser is a Windows Mobile device, flase otherwiseprotected boolean detectXbox()
true if the device is a Microsoft Xbox, false otherwise
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||