Package com.day.cq.wcm.mobile.api.device
Interface DeviceGroup
- 
public interface DeviceGroupADeviceGrouprepresents a segment of mobile devices. The segment is defined by the mobile device capabilities expected by the implementation.- Since:
 - CQ 5.4.0
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static java.lang.StringRESOURCE_TYPE 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddrawHead(PageContext pageContext)This method is to be used in a JSP script drawing the HTML head.java.util.Collection<DeviceCapability>getCapabilities()Returns allDeviceCapabilitys supported by this device group.EmulatorgetDefaultEmulator()Returns theEmulatorconfigured for this device group.java.lang.StringgetDescription()Return the description of this device group as entered by the user.java.util.List<Emulator>getEmulators()Returns the emulators associated with this device.java.lang.String[]getFilterNames()Returns the names of filters as configured on a device group page.intgetMinimumScreenHeight()Returns the minimum screen height devices must support in order to belong to this group.intgetMinimumScreenWidth()Returns the minimum screen width devices must support in order to belong to this group.java.lang.StringgetName()Return the unique name of this device group.java.lang.StringgetPath()Return the path of the content page representing this device group.java.lang.StringgetStaticCssPath()Returns the path of "static.css" if the device group possesses one.java.lang.StringgetTitle()Returns the title of this device group as entered by the user.java.lang.StringgetUserAgent()A device class may optionally specify a mobile client user-agent string which devices must match in order to belong to this group.java.util.regex.PatterngetUserAgentPattern()Returns the regex pattern expected for the mobile device user agent to match.booleanhasCapability(DeviceCapability capability)Checks whether the device group supports the givenDeviceCapability.booleanhasCapability(java.lang.String name)Checks whether the device group supports the givenDeviceCapability.booleanshowEditEmulator()Indicates whether the emulator shall be shown during editing of a page or not. 
 - 
 
- 
- 
Field Detail
- 
RESOURCE_TYPE
static final java.lang.String RESOURCE_TYPE
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
getCapabilities
java.util.Collection<DeviceCapability> getCapabilities()
Returns allDeviceCapabilitys supported by this device group.- Returns:
 - A 
Collectioncontaining all supported capabilities. If no capabilities are defined, an empty collection is returned. 
 
- 
getDefaultEmulator
Emulator getDefaultEmulator()
Returns theEmulatorconfigured for this device group.- Returns:
 - The emulator.
 
 
- 
getDescription
java.lang.String getDescription()
Return the description of this device group as entered by the user.- Returns:
 - The description of this device group or 
nullif not defined. 
 
- 
getEmulators
java.util.List<Emulator> getEmulators()
Returns the emulators associated with this device.- Returns:
 - The emulators.
 
 
- 
getMinimumScreenWidth
int getMinimumScreenWidth()
Returns the minimum screen width devices must support in order to belong to this group. The width is in pixels.- Returns:
 - The minimum screen width in pixels. If not defined, 
0is returned, meaning all widths are accepted. 
 
- 
getMinimumScreenHeight
int getMinimumScreenHeight()
Returns the minimum screen height devices must support in order to belong to this group. The height is in pixels.- Returns:
 - The minimum screen height in pixels. If not defined, 
0is returned, meaning all heights are accepted. 
 
- 
getName
java.lang.String getName()
Return the unique name of this device group.- Returns:
 - A 
Stringrepresenting the name of this device group. 
 
- 
getPath
java.lang.String getPath()
Return the path of the content page representing this device group.- Returns:
 - A 
Stringrepresenting the path of this device group. 
 
- 
getTitle
java.lang.String getTitle()
Returns the title of this device group as entered by the user.- Returns:
 - The device group title or 
nullif not defined. 
 
- 
getUserAgent
java.lang.String getUserAgent()
A device class may optionally specify a mobile client user-agent string which devices must match in order to belong to this group. If no user-agent string is defined,nullis returned.- Returns:
 - A 
Stringrepresenting the user-agent string expected by this device group, ornullif not defined. 
 
- 
hasCapability
boolean hasCapability(DeviceCapability capability)
Checks whether the device group supports the givenDeviceCapability.- Parameters:
 capability- The capability to check whether supported by the device group.- Returns:
 trueif the device group supports the capability.
 
- 
hasCapability
boolean hasCapability(java.lang.String name)
Checks whether the device group supports the givenDeviceCapability.- Parameters:
 name- The name of the capability to check whether supported by the device group.- Returns:
 trueif the device group supports the capability.
 
- 
drawHead
void drawHead(PageContext pageContext) throws java.io.IOException, ServletException
This method is to be used in a JSP script drawing the HTML head. The method will provide all necessary JS and CSS includes and other initialization required for the device group emulator to work (in authoring mode only) and providing custom CSS for rendering.- Parameters:
 pageContext- The JSP page context.- Throws:
 java.io.IOException- If an error occurred during writing to the response.ServletException- If an error occurred including the emulator's init component.
 
- 
showEditEmulator
boolean showEditEmulator()
Indicates whether the emulator shall be shown during editing of a page or not. Even if the emulator is disabled for content editing, it will still be shown for preview modes.- Returns:
 trueif the emulator shall be shown.
 
- 
getUserAgentPattern
java.util.regex.Pattern getUserAgentPattern()
Returns the regex pattern expected for the mobile device user agent to match.- Returns:
 - The pattern.
 
 
- 
getStaticCssPath
java.lang.String getStaticCssPath()
Returns the path of "static.css" if the device group possesses one. The static.css is used for styling device group specifically the content of a page.- Returns:
 - A 
Stringrepresenting the static path of the CSS of this device group, ornullif no CSS is present. 
 
- 
getFilterNames
java.lang.String[] getFilterNames()
Returns the names of filters as configured on a device group page.- Returns:
 - The names.
 - See Also:
 DeviceMapper.getFilters()
 
 - 
 
 -