Class ModeUtil

java.lang.Object
com.adobe.acs.commons.util.ModeUtil

@ProviderType public final class ModeUtil extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    configure(org.apache.sling.settings.SlingSettingsService slingSettings)
     
    static com.day.cq.wcm.api.WCMMode
    getMode(org.apache.sling.api.SlingHttpServletRequest req)
     
    static boolean
    isAnalytics(org.apache.sling.api.SlingHttpServletRequest request)
    Checks if the request is in mode WCMMode.ANALYTICS
    static boolean
    Is AEM runmode author.
    static boolean
    isClassic(org.apache.sling.api.SlingHttpServletRequest request)
    Checks if the request is in AuthoringUIMode.CLASSIC
    static boolean
    isDesign(org.apache.sling.api.SlingHttpServletRequest request)
    Checks if the request is in mode WCMMode.DESIGN
    static boolean
    isDisabled(org.apache.sling.api.SlingHttpServletRequest request)
    Checks if the request is in mode WCMMode.DISABLED
    static boolean
    isEdit(org.apache.sling.api.SlingHttpServletRequest request)
    Checks if the request is in mode WCMMode.EDIT
    static boolean
    isPreview(org.apache.sling.api.SlingHttpServletRequest request)
    Checks if the request is in mode WCMMode.PREVIEW
    static boolean
    Is AEM runmode publish.
    static boolean
    isReadOnly(org.apache.sling.api.SlingHttpServletRequest request)
    Checks if the request is in mode WCMMode.READ_ONLY
    static boolean
    Helper method to check for given runmode.
    static boolean
    isTouch(org.apache.sling.api.SlingHttpServletRequest request)
    Checks if the request is in AuthoringUIMode.TOUCH

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ModeUtil

      public ModeUtil()
  • Method Details

    • getMode

      public static com.day.cq.wcm.api.WCMMode getMode(org.apache.sling.api.SlingHttpServletRequest req)
    • isAuthor

      public static boolean isAuthor()
      Is AEM runmode author.
      Returns:
      true if runmode author is present
    • isPublish

      public static boolean isPublish()
      Is AEM runmode publish.
      Returns:
      true if runmode publish is present
    • isRunmode

      public static boolean isRunmode(String mode)
      Helper method to check for given runmode.
      Parameters:
      mode - the mode to check
      Returns:
      true if the specified mode is present
    • isAnalytics

      public static boolean isAnalytics(org.apache.sling.api.SlingHttpServletRequest request)
      Checks if the request is in mode WCMMode.ANALYTICS
      Parameters:
      request - request to check
      Returns:
      true if the request is in analytics mode
    • isDesign

      public static boolean isDesign(org.apache.sling.api.SlingHttpServletRequest request)
      Checks if the request is in mode WCMMode.DESIGN
      Parameters:
      request - request to check
      Returns:
      true if the request is in design mode
    • isDisabled

      public static boolean isDisabled(org.apache.sling.api.SlingHttpServletRequest request)
      Checks if the request is in mode WCMMode.DISABLED
      Parameters:
      request - request to check
      Returns:
      true if the request is in disabled mode
    • isEdit

      public static boolean isEdit(org.apache.sling.api.SlingHttpServletRequest request)
      Checks if the request is in mode WCMMode.EDIT
      Parameters:
      request - request to check
      Returns:
      true if the request is in edit mode
    • isPreview

      public static boolean isPreview(org.apache.sling.api.SlingHttpServletRequest request)
      Checks if the request is in mode WCMMode.PREVIEW
      Parameters:
      request - request to check
      Returns:
      true if the request is in preview mode
    • isReadOnly

      public static boolean isReadOnly(org.apache.sling.api.SlingHttpServletRequest request)
      Checks if the request is in mode WCMMode.READ_ONLY
      Parameters:
      request - request to check
      Returns:
      true if the request is in read-only mode
    • isClassic

      public static boolean isClassic(org.apache.sling.api.SlingHttpServletRequest request)
      Checks if the request is in AuthoringUIMode.CLASSIC
      Parameters:
      request - request to check
      Returns:
      true if the request is in Classic authoring mode
    • isTouch

      public static boolean isTouch(org.apache.sling.api.SlingHttpServletRequest request)
      Checks if the request is in AuthoringUIMode.TOUCH
      Parameters:
      request - request to check
      Returns:
      true if the request is in Touch authoring mode
    • configure

      public static void configure(org.apache.sling.settings.SlingSettingsService slingSettings) throws org.osgi.service.cm.ConfigurationException
      Throws:
      org.osgi.service.cm.ConfigurationException