public class TextImage extends AbstractFoundationComponent
/libs/foundation/components/textimage in the repository for implementation details.| Modifier and Type | Field and Description |
|---|---|
static String |
PROP_CSS_CLASS |
static String |
PROP_IMAGE_NODE_LOCATION |
static String |
PROP_IMAGE_NODE_NAME |
static String |
PROP_TEXT |
static String |
PROP_TEXT_IS_RICH |
static String |
PROP_TITLE |
static String |
RESOURCE_TYPE |
protected Image |
testImage
Default Image object used in the component
|
changeProperties, client, componentPath, DEFAULT_LOCATION, jsonNode, location, pagePath| Constructor and Description |
|---|
TextImage(ComponentClient client,
String pagePath,
String location,
String nameHint)
The constructor stores all the component path information like parentPage, name etc.
|
| Modifier and Type | Method and Description |
|---|---|
Image |
getImage() |
String |
getResourceType()
The resource type for the component, e.g.
|
org.apache.sling.testing.clients.SlingHttpResponse |
save(int... expectedStatus)
Submits all editable values to the server.
|
void |
setDeleteImage()
Sets properties to remove image upon save.
|
org.apache.sling.testing.clients.SlingHttpResponse |
uploadImage(String mimeType,
String imageName,
String resourcePath) |
create, getClient, getComponentNode, getComponentPath, getCreateFormEntity, getFirstChild, getLocation, getName, getNext, getNextNodePath, getPagePath, getParentPath, getPrevious, getPreviousNodePath, getProperty, getPropertyAsString, getPropertyAsStringArray, reorder, setProperty, setPropertypublic static final String RESOURCE_TYPE
public static final String PROP_TEXT
public static final String PROP_TEXT_IS_RICH
public static final String PROP_TITLE
public static final String PROP_CSS_CLASS
public static final String PROP_IMAGE_NODE_LOCATION
public static final String PROP_IMAGE_NODE_NAME
protected Image testImage
public TextImage(ComponentClient client, String pagePath, String location, String nameHint)
client - The FoundationClient that's
creating this
instance.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 (String,int...) has been called.public org.apache.sling.testing.clients.SlingHttpResponse uploadImage(String mimeType, String imageName, String resourcePath) throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientExceptionpublic void setDeleteImage()
throws org.apache.sling.testing.clients.ClientException,
InterruptedException
org.apache.sling.testing.clients.ClientException - if the request failsInterruptedException - to mark this method as waitingpublic Image getImage()
public String getResourceType()
AbstractComponentsling:resourceType property of the node.getResourceType in class AbstractComponentpublic org.apache.sling.testing.clients.SlingHttpResponse save(int... expectedStatus)
throws org.apache.sling.testing.clients.ClientException,
InterruptedException
AbstractComponentOK button on the edit dialog
of a component.save in class AbstractComponentexpectedStatus - list of allowed HTTP Status to be returned. if not set, status 200 is assumedorg.apache.sling.testing.clients.ClientException - If something fails during request/response cycleInterruptedException - to mark this method as waitingCopyright © 2018. All rights reserved.