Interface DeviceGroup


  • public interface DeviceGroup
    A DeviceGroup represents a segment of mobile devices. The segment is defined by the mobile device capabilities expected by the implementation.
    Since:
    CQ 5.4.0
    • Method Detail

      • getCapabilities

        Collection<DeviceCapability> getCapabilities()
        Returns all DeviceCapabilitys supported by this device group.
        Returns:
        A Collection containing all supported capabilities. If no capabilities are defined, an empty collection is returned.
      • getDefaultEmulator

        Emulator getDefaultEmulator()
        Returns the Emulator configured for this device group.
        Returns:
        The emulator.
      • getDescription

        String getDescription()
        Return the description of this device group as entered by the user.
        Returns:
        The description of this device group or null if not defined.
      • getEmulators

        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, 0 is 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, 0 is returned, meaning all heights are accepted.
      • getName

        String getName()
        Return the unique name of this device group.
        Returns:
        A String representing the name of this device group.
      • getPath

        String getPath()
        Return the path of the content page representing this device group.
        Returns:
        A String representing the path of this device group.
      • getTitle

        String getTitle()
        Returns the title of this device group as entered by the user.
        Returns:
        The device group title or null if not defined.
      • getUserAgent

        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, null is returned.
        Returns:
        A String representing the user-agent string expected by this device group, or null if not defined.
      • hasCapability

        boolean hasCapability​(DeviceCapability capability)
        Checks whether the device group supports the given DeviceCapability.
        Parameters:
        capability - The capability to check whether supported by the device group.
        Returns:
        true if the device group supports the capability.
      • hasCapability

        boolean hasCapability​(String name)
        Checks whether the device group supports the given DeviceCapability.
        Parameters:
        name - The name of the capability to check whether supported by the device group.
        Returns:
        true if the device group supports the capability.
      • drawHead

        void drawHead​(PageContext pageContext)
               throws 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:
        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:
        true if the emulator shall be shown.
      • getUserAgentPattern

        Pattern getUserAgentPattern()
        Returns the regex pattern expected for the mobile device user agent to match.
        Returns:
        The pattern.
      • getStaticCssPath

        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 String representing the static path of the CSS of this device group, or null if no CSS is present.
      • getFilterNames

        String[] getFilterNames()
        Returns the names of filters as configured on a device group page.
        Returns:
        The names.
        See Also:
        DeviceMapper.getFilters()