Interface AuthorUIHelper


@ProviderType public interface AuthorUIHelper
A Service that provides centralized logic for generating links to edit Pages and Assets on the author environment. Driven based on an OSGi configuration that allows each implementation to toggle whether to generate links to the Touch UI or Classic UI. Uses the com.day.cq.commons.Externalizer to create absolute URLs.
  • Method Summary

    Modifier and Type
    Method
    Description
    generateEditAssetLink(String assetPath, boolean absoluteUrl, org.apache.sling.api.resource.ResourceResolver resolver)
    Generates a URL to edit a DAM asset in AEM author environment.
    generateEditPageLink(String pagePath, boolean absoluteUrl, org.apache.sling.api.resource.ResourceResolver resolver)
    Generates a URL to edit a page in AEM author environment.
    boolean
    Indicates whether the author experience is using the Touch UI or Classic UI
  • Method Details

    • isTouchUI

      boolean isTouchUI()
      Indicates whether the author experience is using the Touch UI or Classic UI
      Returns:
      true if configured to use Touch UI
    • generateEditPageLink

      String generateEditPageLink(String pagePath, boolean absoluteUrl, org.apache.sling.api.resource.ResourceResolver resolver)
      Generates a URL to edit a page in AEM author environment. Will return a url using either the classic or touch UI url based on configuration properties. Defaults to Touch UI ('/editor.html') appends the '.html' extension to the returned URL String
      Parameters:
      pagePath - the path to the page
      absoluteUrl - if set to true will use the Externalizer to generate an absolute Url with author hostname
      resolver - used by the Externalizer for resource mapping, can be passed as null to avoid extra processing.
      Returns:
      - returns a relative or absolute URL to edit the passed in page path
    • generateEditAssetLink

      String generateEditAssetLink(String assetPath, boolean absoluteUrl, org.apache.sling.api.resource.ResourceResolver resolver)
      Generates a URL to edit a DAM asset in AEM author environment. Will return a url using either the classic or touch UI url based on configuration properties. Defaults to Touch UI ('/assetdetails.html')
      Parameters:
      assetPath - the path to the asset in the DAM
      absoluteUrl - if set to true will use the Externalizer to generate an absolute Url with author hostname
      resolver - used by the Externalizer for resource mapping, can be passed as null to avoid extra processing.
      Returns:
      - returns a relative or absolute URL to edit the passed in asset path