Class Carousel
- java.lang.Object
-
- com.adobe.cq.testing.client.components.AbstractComponent
-
- com.adobe.cq.testing.client.components.foundation.AbstractFoundationComponent
-
- com.adobe.cq.testing.client.components.foundation.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.
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROP_CONTROLS_TYPE
static String
PROP_LIMIT
static String
PROP_LIST_FROM
static String
PROP_ORDER_BY
static String
PROP_PAGES
static String
PROP_PARENT_PAGE
static String
PROP_PLAY_SPEED
static String
PROP_QUERY
static String
PROP_SAVED_QUERY
static String
PROP_SEARCH_IN
static String
PROP_TRANS_TIME
static String
RESOURCE_TYPE
-
Fields inherited from class com.adobe.cq.testing.client.components.AbstractComponent
changeProperties, client, componentPath, DEFAULT_LOCATION, jsonNode, location, pagePath
-
-
Constructor Summary
Constructors Constructor Description Carousel(ComponentClient client, String pagePath, String location, String nameHint)
The constructor stores all the component path information like parentPage, name etc.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)
Sends an editing request to a carousel component.org.apache.sling.testing.clients.util.FormEntityBuilder
getCreateFormEntity(String order)
Adds an additional parameterparentResourceType
to get properly inherited styles.String
getResourceType()
The resource type for the component, e.g.-
Methods inherited from class com.adobe.cq.testing.client.components.AbstractComponent
create, getClient, getComponentNode, getComponentPath, getFirstChild, getLocation, getName, getNext, getNextNodePath, getPagePath, getParentPath, getPrevious, getPreviousNodePath, getProperty, getPropertyAsString, getPropertyAsStringArray, reorder, save, setProperty, setProperty
-
-
-
-
Field Detail
-
RESOURCE_TYPE
public static final String RESOURCE_TYPE
- See Also:
- Constant Field Values
-
PROP_PLAY_SPEED
public static final String PROP_PLAY_SPEED
- See Also:
- Constant Field Values
-
PROP_TRANS_TIME
public static final String PROP_TRANS_TIME
- See Also:
- Constant Field Values
-
PROP_CONTROLS_TYPE
public static final String PROP_CONTROLS_TYPE
- See Also:
- Constant Field Values
-
PROP_LIST_FROM
public static final String PROP_LIST_FROM
- See Also:
- Constant Field Values
-
PROP_ORDER_BY
public static final String PROP_ORDER_BY
- See Also:
- Constant Field Values
-
PROP_LIMIT
public static final String PROP_LIMIT
- See Also:
- Constant Field Values
-
PROP_PARENT_PAGE
public static final String PROP_PARENT_PAGE
- See Also:
- Constant Field Values
-
PROP_PAGES
public static final String PROP_PAGES
- See Also:
- Constant Field Values
-
PROP_SEARCH_IN
public static final String PROP_SEARCH_IN
- See Also:
- Constant Field Values
-
PROP_QUERY
public static final String PROP_QUERY
- See Also:
- Constant Field Values
-
PROP_SAVED_QUERY
public static final String PROP_SAVED_QUERY
- See Also:
- Constant Field Values
-
-
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. TheAbstractComponent.getName()
method will return the correct name afterAbstractComponent.create(String,int...)
has been called.
-
-
Method Detail
-
getCreateFormEntity
public org.apache.sling.testing.clients.util.FormEntityBuilder getCreateFormEntity(String order)
Adds an additional parameterparentResourceType
to get properly inherited styles.- Overrides:
getCreateFormEntity
in classAbstractComponent
- 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 thesling:resourceType
property of the node.- Specified by:
getResourceType
in classAbstractComponent
- 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)
listFrom
- Allowed values:
- children (Child Pages)
- static (Fixed List)
- search (Search)
- querybuilder (Advanced Search)
orderBy
- Allowed values:
- jcr:title
- jcr:created
- cq:lastModified
- cq:template
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
-
-