Interface DesignHtmlLibraryManager


  • @ProviderType
    public interface DesignHtmlLibraryManager
    A service interface for looking up client libraries based on a Design.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String PROPERTY_CSS
      Resource name for the CSS library configuration within a configuration resource.
      static String PROPERTY_JS
      Resource name for the JavaScript library configuration within a configuration resource.
      static String RESOURCE_NAME
      Resource name for the client library configuration within a design resource.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      String[] getCssLibraries​(com.day.cq.wcm.api.designer.Design design, PageRegion pageRegion)
      Returns an ordered list of all CSS (as specified on the Design page) client libraries associated with the pageRegion for the design.
      String[] getJsLibraries​(com.day.cq.wcm.api.designer.Design design, PageRegion pageRegion)
      Returns an ordered list of all JS (as specified on the Design page) client libraries associated with the pageRegion for the design.
      String[] getLibraries​(com.day.cq.wcm.api.designer.Design design, PageRegion pageRegion)
      Returns an ordered list of all (CSS and JS; as specified on the Design page) client libraries associated with the pageRegion for the design.
      void writeCssInclude​(org.apache.sling.api.SlingHttpServletRequest request, com.day.cq.wcm.api.designer.Design design, PageRegion pageRegion, Writer writer)
      Writes the CSS include snippets to the given writer.
      void writeIncludes​(org.apache.sling.api.SlingHttpServletRequest request, com.day.cq.wcm.api.designer.Design design, PageRegion pageRegion, Writer writer)
      Writes the include snippets to the given writer.
      void writeJsInclude​(org.apache.sling.api.SlingHttpServletRequest request, com.day.cq.wcm.api.designer.Design design, PageRegion pageRegion, Writer writer)
      Writes the JS include snippets to the given writer.
    • Field Detail

      • RESOURCE_NAME

        static final String RESOURCE_NAME
        Resource name for the client library configuration within a design resource.
        See Also:
        Constant Field Values
      • PROPERTY_CSS

        static final String PROPERTY_CSS
        Resource name for the CSS library configuration within a configuration resource.
        See Also:
        Constant Field Values
      • PROPERTY_JS

        static final String PROPERTY_JS
        Resource name for the JavaScript library configuration within a configuration resource.
        See Also:
        Constant Field Values
    • Method Detail

      • writeCssInclude

        void writeCssInclude​(org.apache.sling.api.SlingHttpServletRequest request,
                             com.day.cq.wcm.api.designer.Design design,
                             PageRegion pageRegion,
                             Writer writer)
                      throws IOException
        Writes the CSS include snippets to the given writer. The paths to the CSS libraries are included that match the given categories for client libraries (as specified on the Design page) associated with the pageRegion for the currentDesign.
        Parameters:
        request - Sling Request obj
        design - the Design to look up appropriate client libs from (usually currentDesign)
        pageRegion - PageRegion enum
        writer - writer to output link and script tags to
        Throws:
        IOException - if an I/O error occurs
      • writeJsInclude

        void writeJsInclude​(org.apache.sling.api.SlingHttpServletRequest request,
                            com.day.cq.wcm.api.designer.Design design,
                            PageRegion pageRegion,
                            Writer writer)
                     throws IOException
        Writes the JS include snippets to the given writer. The paths to the JS libraries are included that match the given categories for client libraries (as specified on the Design page) associated with the pageRegion for the currentDesign.
        Parameters:
        request - Sling Request obj
        design - the Design to look up appropriate client libs from (usually currentDesign)
        pageRegion - PageRegion enum
        writer - writer to output link and script tags to
        Throws:
        IOException - if an I/O error occurs
      • writeIncludes

        void writeIncludes​(org.apache.sling.api.SlingHttpServletRequest request,
                           com.day.cq.wcm.api.designer.Design design,
                           PageRegion pageRegion,
                           Writer writer)
                    throws IOException
        Writes the include snippets to the given writer. The paths to the libraries (CSS and JS) are included that match the given categories for client libraries (as specified on the Design page) associated with the pageRegion for the currentDesign
        Parameters:
        request - Sling Request obj
        design - the Design to look up appropriate client libs from (usually currentDesign)
        pageRegion - PageRegion enum
        writer - writer to output link and script tags to
        Throws:
        IOException - if an I/O error occurs
      • getCssLibraries

        String[] getCssLibraries​(com.day.cq.wcm.api.designer.Design design,
                                 PageRegion pageRegion)
        Returns an ordered list of all CSS (as specified on the Design page) client libraries associated with the pageRegion for the design.
        Parameters:
        design - the Design to look up appropriate client libs from (usually currentDesign)
        pageRegion - PageRegion enum
        Returns:
        an ordered array of client library category names
      • getJsLibraries

        String[] getJsLibraries​(com.day.cq.wcm.api.designer.Design design,
                                PageRegion pageRegion)
        Returns an ordered list of all JS (as specified on the Design page) client libraries associated with the pageRegion for the design.
        Parameters:
        design - the Design to look up appropriate client libs from (usually currentDesign)
        pageRegion - PageRegion enum
        Returns:
        an ordered array of client library category names
      • getLibraries

        String[] getLibraries​(com.day.cq.wcm.api.designer.Design design,
                              PageRegion pageRegion)
        Returns an ordered list of all (CSS and JS; as specified on the Design page) client libraries associated with the pageRegion for the design.
        Parameters:
        design - the Design to look up appropriate client libs from (usually currentDesign)
        pageRegion - PageRegion enum
        Returns:
        an ordered array of client library category names