public class TagClient extends CQClient
CQClient which in turn provides a core set of commonly used website and
page functionality.CQClient.Builder, CQClient.InternalBuilder<T extends CQClient>| Modifier and Type | Field and Description |
|---|---|
static String |
TAG_COMMAND_PATH |
static String |
TAG_GARBAGE_COLLECTOR_CRON_EXPRESSION_PROP |
static String |
TAG_GARBAGE_COLLECTOR_DEFAULT_CRON_EXPRESSION |
static String |
TAG_RESOURCE_PATH |
LOG, STATISTICS_ROOT, wcmCommands| Constructor and Description |
|---|
TagClient(org.apache.http.impl.client.CloseableHttpClient http,
org.apache.sling.testing.clients.SlingClientConfig config) |
TagClient(URI serverUrl,
String user,
String password) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.sling.testing.clients.SlingHttpResponse |
activateTag(String path,
int... expectedStatus)
Activates a tag.
|
org.apache.sling.testing.clients.SlingHttpResponse |
addTagCloudComponent(String pageHandle,
int... expectedStatus)
Adds a TagCloud Component to a page.
|
org.apache.sling.testing.clients.SlingHttpResponse |
canCreateTag(String tagId,
int... expectedStatus)
Checks if user can create a specific Tag
|
org.apache.sling.testing.clients.SlingHttpResponse |
canCreateTagByTitle(String tagId,
String locale,
int... expectedStatus)
Checks if user can create a specific Tag based on title
|
org.apache.sling.testing.clients.SlingHttpResponse |
createTag(String tagTitle,
String tagId,
String tagDescr,
String parentTagId,
int... expectedStatus)
Adds a tag
|
org.apache.sling.testing.clients.SlingHttpResponse |
createTagByTitle(String tagId,
String tagTitle,
String locale,
String tagDescr,
int... expectedStatus)
Adds a tag
|
org.apache.sling.testing.clients.SlingHttpResponse |
deactivateTag(String path,
int... expectedStatus)
Deactivates a tag.
|
org.apache.sling.testing.clients.SlingHttpResponse |
deleteTag(String tagPath,
int... expectedStatus)
Removes a tag.
|
org.apache.sling.testing.clients.SlingHttpResponse |
editTagCloudComponent(String componentPath,
boolean showAsLink,
String path,
String display,
int... expectedStatus)
Edits the TagCloud component.
|
org.apache.sling.testing.clients.SlingHttpResponse |
getRefList(Tag tag,
int... expectedStatus)
Gets list of pages referring to a tag.
|
org.apache.sling.testing.clients.SlingHttpResponse |
getRefList2(Tag tag)
Gets list of pages referring to a tag.
|
org.apache.sling.testing.clients.SlingHttpResponse |
getTag(String tagPath,
int... expectedStatus)
Gets tag details.
|
org.codehaus.jackson.JsonNode |
getTagGarbageCollectorConfig(int... expectedStatus) |
org.codehaus.jackson.JsonNode |
getTags(String nodePath,
int... expectedStatus)
Gets list of set tags for the given node.
|
org.apache.sling.testing.clients.SlingHttpResponse |
listTag(String tagPath,
int... expectedStatus)
Gets list of pages referring to a tag path.
|
org.apache.sling.testing.clients.SlingHttpResponse |
listTags(String resourcePath,
String titleSuggestion,
String nameSuggestion,
boolean ignoreCase,
boolean matchWordStart,
String locale,
Boolean count,
int... expectedStatus)
Gets list of tags for the given node.
|
org.apache.sling.testing.clients.SlingHttpResponse |
mergeTag(String path,
String destPath,
int... expectedStatus)
Merge a tag.
|
org.apache.sling.testing.clients.SlingHttpResponse |
moveTag(String from,
String to,
int... expectedStatus)
Moves a tag.
|
org.apache.sling.testing.clients.SlingHttpResponse |
runGc(int... expectedStatus) |
org.apache.sling.testing.clients.SlingHttpResponse |
searchTags(Boolean count,
String locale,
String query,
int... expectedStatus) |
void |
setTag(String page,
String tagHandle,
int... expectedStatus)
Sets a tag on a page
|
org.apache.sling.testing.clients.SlingHttpResponse |
setTagGarbageCollectorCronExpression(String cronExpression,
int... expectedStatus) |
org.apache.sling.testing.clients.SlingHttpResponse |
setTagProperties(Tag tag,
List<String[]> props,
int... expectedStatus)
Sets multiple tag properties.
|
org.apache.sling.testing.clients.SlingHttpResponse |
setTagProperty(Tag tag,
String propName,
String propValue,
int... expectedStatus)
Sets a single Tag property.
|
org.apache.sling.testing.clients.SlingHttpResponse |
setTags(String page,
List<String> tags,
int... expectedStatus)
Sets multiple tag on a page.
|
copyLanguages, copyPage, createPage, createPageWithRetry, createVersion, deletePage, deletePageWithRetry, lockPage, movePage, movePage, resetPageStatistics, restoreTree, restoreVersion, rolloutPage, searchAndReplaceInPages, searchInPages, setPageProperties, setPageProperty, setPagePropertyImage, unlockPage, uploadAsset, uploadFileCQStylecreateFolder, createNode, createNodeRecursive, deletePath, doGetJson, exists, getJsonNode, getJsonNode, getNodeNameFromPath, getParentPath, getUUId, getUUID, importContent, importContent, importJson, move, setPropertiesString, setPropertyString, setPropertyStringArray, upload, waitExists, waitUntilExistsadaptTo, addValue, close, doDelete, doGet, doGet, doGet, doHead, doPatch, doPost, doPost, doPut, doRawRequest, doRequest, doStreamGet, doStreamPost, doStreamRequest, execute, execute, execute, execute, execute, execute, execute, execute, getClientId, getConnectionManager, getCookieStore, getCredentialsProvider, getParams, getPassword, getPath, getPath, getUrl, getUrl, getUrl, getUser, getValue, getValues, hasValuepublic static final String TAG_COMMAND_PATH
public static final String TAG_RESOURCE_PATH
public static String TAG_GARBAGE_COLLECTOR_DEFAULT_CRON_EXPRESSION
public static String TAG_GARBAGE_COLLECTOR_CRON_EXPRESSION_PROP
public TagClient(org.apache.http.impl.client.CloseableHttpClient http,
org.apache.sling.testing.clients.SlingClientConfig config)
throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientExceptionpublic org.apache.sling.testing.clients.SlingHttpResponse addTagCloudComponent(String pageHandle, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
pageHandle - handle of the page that will get a tag cloud component addedexpectedStatus - list of allowed HTTP Status to be returned. If not set, http status 201 (CREATED) is
assumed.org.apache.sling.testing.clients.ClientException - If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse editTagCloudComponent(String componentPath, boolean showAsLink, String path, String display, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
componentPath - the components pathshowAsLink - true if tags should have link tags (execute a search for the tag)path - optional, path of the page, the display values 'page' and 'pagetree' relate to.display - what should be rendered:
expectedStatus - list of allowed HTTP Status to be returned. If not set, http status 201 (CREATED) is assumed.org.apache.sling.testing.clients.ClientException - If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse canCreateTag(String tagId, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
tagId - tag ID. mandatory.expectedStatus - list of allowed HTTP Status to be returned. If not set, http status 200 (OK) is assumed.org.apache.sling.testing.clients.ClientException - If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse canCreateTagByTitle(String tagId, String locale, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
tagId - tag ID. mandatory.locale - i18n locale code.expectedStatus - list of allowed HTTP Status to be returned. If not set, http status 200 (OK) is assumed.org.apache.sling.testing.clients.ClientException - If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse createTag(String tagTitle, String tagId, String tagDescr, String parentTagId, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
tagTitle - title of the Tag. mandatory.tagId - tag ID. mandatory.tagDescr - description of the tag. Set null if not used.parentTagId - parent tag ID. Set null if not used. E.g. stockphotography:animals/birds/expectedStatus - list of allowed HTTP Status to be returned. If not set, http status 200 (OK) is assumed.org.apache.sling.testing.clients.ClientException - If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse createTagByTitle(String tagId, String tagTitle, String locale, String tagDescr, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
tagId - tag ID. mandatory.tagTitle - title of the Tag. mandatory.locale - tag localetagDescr - description of the tag. Set null if not used.expectedStatus - list of allowed HTTP Status to be returned. If not set, http status 200 (OK) is assumed.org.apache.sling.testing.clients.ClientException - If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse deleteTag(String tagPath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
tagPath - path to the tag to delete. E.g. /content/cq:tags/stockphotography/animals/birds/expectedStatus - list of allowed HTTP Status to be returned. If not set, http status 200 (OK) is assumed.org.apache.sling.testing.clients.ClientException - If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse activateTag(String path, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
path - path of the tag to activateexpectedStatus - list of allowed HTTP Status to be returned. If not set, http status 200 (OK) is assumed.org.apache.sling.testing.clients.ClientException - If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse deactivateTag(String path, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
path - path of the tag to deactivateexpectedStatus - list of allowed HTTP Status to be returned. If not set, http status 200 (OK) is assumed.org.apache.sling.testing.clients.ClientException - If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse setTagProperty(Tag tag, String propName, String propValue, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
tag - tag to modifypropName - name of the property to be editedpropValue - value to be setexpectedStatus - list of expected HTTP Status to be returned, if not set, 200 is assumed.SlingHttpResponse wrapping the HTML response returned by Slingorg.apache.sling.testing.clients.ClientException - if something fails during the request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse setTagProperties(Tag tag, List<String[]> props, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
tag - Tag to be editedprops - Array of name/value string pairs to be setexpectedStatus - list of expected HTTP Status to be returned, if not set, 200 is assumed.SlingHttpResponse wrapping the HTML response returned by Slingorg.apache.sling.testing.clients.ClientException - if something fails during the request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse getRefList2(Tag tag) throws org.apache.sling.testing.clients.ClientException
tag - Tag to be editedSlingHttpResponse wrapping the HTML response returned by Slingorg.apache.sling.testing.clients.ClientException - if something fails during the request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse getRefList(Tag tag, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
tag - Tag to be editedexpectedStatus - list of expected http status codesSlingHttpResponse wrapping the HTML response returned by Slingorg.apache.sling.testing.clients.ClientException - if something fails during the request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse listTag(String tagPath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
tagPath - Tag to be editedexpectedStatus - list of expected http status codesSlingHttpResponse wrapping the HTML response returned by Slingorg.apache.sling.testing.clients.ClientException - if something fails during the request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse getTag(String tagPath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
tagPath - Path of the tagexpectedStatus - list of expected http status codesorg.apache.sling.testing.clients.ClientException - if something fails during the request/response cyclepublic org.codehaus.jackson.JsonNode getTags(String nodePath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
nodePath - Path of the nodeexpectedStatus - list of expected http status codesorg.apache.sling.testing.clients.ClientException - if something fails during the request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse listTags(String resourcePath, String titleSuggestion, String nameSuggestion, boolean ignoreCase, boolean matchWordStart, String locale, Boolean count, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
resourcePath - node pathtitleSuggestion - title suggestionnameSuggestion - name suggestionignoreCase - true to ignore casematchWordStart - whether to match word startlocale - tags localecount - countexpectedStatus - list of expected http status codesorg.apache.sling.testing.clients.ClientException - if something fails during the request/response cyclepublic void setTag(String page, String tagHandle, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
page - the page that will doGet the tagtagHandle - The tag handle e.g. itnamespace:testid/testlevel2. NOTE: to add a tag you have to prefix it with
+.expectedStatus - list of allowed HTTP Status to be returned. If not set, http status 201 (CREATED) is
assumed.org.apache.sling.testing.clients.ClientException - If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse setTags(String page, List<String> tags, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
page - the page that will doGet the tagstags - list of tags e.g. itnamespace:testid/testlevel2. NOTE: to doGet a tag you have to prefix it with +,
otherwise with -.expectedStatus - list of allowed HTTP Status to be returned. If not set, http status 201 (CREATED) is
assumed.org.apache.sling.testing.clients.ClientException - If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse moveTag(String from, String to, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
from - tag id or path to moveto - target tag id or pathexpectedStatus - list of allowed HTTP Status to be returned. If not set, http status 200 (OK) is assumed.org.apache.sling.testing.clients.ClientException - If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse mergeTag(String path, String destPath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
path - tag id or path to mergedestPath - target tag id or pathexpectedStatus - list of allowed HTTP Status to be returned. If not set, http status 20O (OK) is assumed.org.apache.sling.testing.clients.ClientException - If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse searchTags(Boolean count, String locale, String query, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientExceptionpublic org.apache.sling.testing.clients.SlingHttpResponse setTagGarbageCollectorCronExpression(String cronExpression, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientExceptionpublic org.codehaus.jackson.JsonNode getTagGarbageCollectorConfig(int... expectedStatus)
throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientExceptionpublic org.apache.sling.testing.clients.SlingHttpResponse runGc(int... expectedStatus)
throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientExceptionCopyright © 2018. All rights reserved.