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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      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.
      String generateEditPageLink​(String pagePath, boolean absoluteUrl, org.apache.sling.api.resource.ResourceResolver resolver)
      Generates a URL to edit a page in AEM author environment.
      boolean isTouchUI()
      Indicates whether the author experience is using the Touch UI or Classic UI
    • Method Detail

      • 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