Class Carousel


  • public class Carousel
    extends AbstractFoundationComponent
    Wraps the Carousel foundation component, providing methods for editing it. See /libs/foundation/components/carousel in the repository for implementation details.
    • Constructor Detail

      • Carousel

        public Carousel​(ComponentClient client,
                        String pagePath,
                        String location,
                        String nameHint)
        The constructor stores all the component path information like parentPage, name etc.
        Parameters:
        client - The ComponentClient that will be used for sending the requests.
        pagePath - path to the page that will contain the component.
        location - relative location to the parent node inside the page that will contain the component node.
        nameHint - name to be used for the component node. Might get altered by the server if a naming conflict occurs. The AbstractComponent.getName() method will return the correct name after AbstractComponent.create(String,int...) has been called.
    • Method Detail

      • getCreateFormEntity

        public org.apache.sling.testing.clients.util.FormEntityBuilder getCreateFormEntity​(String order)
        Adds an additional parameter parentResourceType to get properly inherited styles.
        Overrides:
        getCreateFormEntity in class AbstractComponent
        Parameters:
        order - order
        Returns:
        FormEntityBuilder to be used for the create POST request.
      • getResourceType

        public String getResourceType()
        Description copied from class: AbstractComponent
        The resource type for the component, e.g. foundation/components/text. this will be set in the sling:resourceType property of the node.
        Specified by:
        getResourceType in class AbstractComponent
        Returns:
        the resource type
      • edit

        public org.apache.sling.testing.clients.SlingHttpResponse edit​(int playSpeed,
                                                                       int transTime,
                                                                       String controlsType,
                                                                       String listFrom,
                                                                       String orderBy,
                                                                       int limit,
                                                                       String parentPage,
                                                                       String[] fixedList,
                                                                       String searchIn,
                                                                       String query,
                                                                       String savedQuery,
                                                                       int... expectedStatus)
                                                                throws org.apache.sling.testing.clients.ClientException
        Sends an editing request to a carousel component.
        Parameters:
        playSpeed - Time in milliseconds until the next slide is shown. Set 0 to not change.
        transTime - Time in milliseconds for a transition between 2 slides. Set 0 to not change.
        controlsType - Allowed values:
        • pn (prev next)
        • tl (top left)
        • tc (top center)
        • tr (top right)
        • bl (bottom left)
        • bc (bottom center)
        • br (bottom right)
        Set null to not change.
        listFrom - Allowed values:
        • children (Child Pages)
        • static (Fixed List)
        • search (Search)
        • querybuilder (Advanced Search)
        Set null to not change.
        orderBy - Allowed values:
        • jcr:title
        • jcr:created
        • cq:lastModified
        • cq:template
        Set null to not change.
        limit - Maximum number of items displayed in list, set 0 to ignore.
        parentPage - If listFrom = children, defines the parent page.Set null to use current page.
        fixedList - If listFrom = static, set String array of pages that should doGet shown in carousel.
        searchIn - If listFrom = search, where to start search, Set null to use current site (eg. /content/mysite)
        query - If listFrom = search, the search query to execute.
        savedQuery - If listFrom = querybuilder, the querybuilder predicate notation.
        expectedStatus - list of allowed HTTP Status to be returned. if not set, status 200 is assumed
        Returns:
        a SlingHttpResponse wrapping the HTML response returned by Sling
        Throws:
        org.apache.sling.testing.clients.ClientException - If something fails during request/response cycle