Interface LongFormTextComponent


  • @ProviderType
    public interface LongFormTextComponent
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      String[] getTextParagraphs​(String text)
      Splits long form text into a series of "chunks" delimited.
      boolean hasContents​(org.apache.sling.api.resource.Resource resource, int index)
      Determines if the specified long form text parsys has content.
      void mergeParagraphSystems​(org.apache.sling.api.resource.Resource resource, int numParagraphCount)
      Housekeeping for the Long Form Text responsible for merging dangling par resource up when the number of <p> decreases.
    • Method Detail

      • getTextParagraphs

        String[] getTextParagraphs​(String text)
        Splits long form text into a series of "chunks" delimited. Note: this method does not support intelligence for managing nested <p>'s in <p>'s
        Parameters:
        text - The HTML text to split
        Returns:
        A string array of HTML paragraphs including the surrounding <p>...</p>
      • mergeParagraphSystems

        void mergeParagraphSystems​(org.apache.sling.api.resource.Resource resource,
                                   int numParagraphCount)
                            throws javax.jcr.RepositoryException
        Housekeeping for the Long Form Text responsible for merging dangling par resource up when the number of <p> decreases.
        Parameters:
        resource - the long form text resource
        numParagraphCount - the number of text paragraphs
        Throws:
        javax.jcr.RepositoryException
      • hasContents

        boolean hasContents​(org.apache.sling.api.resource.Resource resource,
                            int index)
        Determines if the specified long form text parsys has content.
        Parameters:
        resource - the long form text resource
        index - the index of the long-form-text parsys to inspect
        Returns:
        true to include the parsys