public class CommunityClient extends CQClient
CQClient
which in turn provides a core set of commonly used website and page functionality.CQClient.Builder, CQClient.InternalBuilder<T extends CQClient>
LOG, STATISTICS_ROOT, wcmCommands
Constructor and Description |
---|
CommunityClient(org.apache.http.impl.client.CloseableHttpClient http,
org.apache.sling.testing.clients.SlingClientConfig config) |
CommunityClient(URI serverUrl,
String user,
String password) |
Modifier and Type | Method and Description |
---|---|
org.apache.sling.testing.clients.SlingHttpResponse |
addCommentsComponent(String pagePath,
int... expectedStatus)
Adds a Comment component to a page.
|
org.apache.sling.testing.clients.SlingHttpResponse |
configureCommentComponent(String commentPath,
String defaultMessage,
boolean isModerated,
boolean allowReplies,
boolean displayAsTree,
boolean closed,
int... expectedStatus)
Configures the Comment component.
|
org.codehaus.jackson.JsonNode |
createComment(String commentPath,
String comment,
String user,
String url,
String email,
int... expectedStatus)
Adds a single comment to a Comments component.
|
org.apache.sling.testing.clients.SlingHttpResponse |
deleteComment(String commentPath,
int... expectedStatus)
Delete comment
|
org.apache.sling.testing.clients.SlingHttpResponse |
editComment(String command,
String commentPath,
int... expectedStatus)
Edit the comment: approve | deny | markCommentAsSpam | deleteComment
|
org.codehaus.jackson.JsonNode |
getComments(String ugcBasePath,
int limit,
int start,
String predicate,
String view)
List all comments in the
user generated content space,
currently under /content/usergenerated . |
org.apache.sling.testing.clients.SlingHttpResponse |
markCommentAsSpam(String commentPath,
boolean isSpam,
int... expectedStatus)
Mark comment as spam
|
org.apache.sling.testing.clients.SlingHttpResponse |
moderateComment(String commentPath,
boolean approve,
int... expectedStatus)
Moderate comment: approve \ deny
|
copyLanguages, copyPage, createPage, createPageWithRetry, createVersion, deletePage, deletePageWithRetry, lockPage, movePage, movePage, resetPageStatistics, restoreTree, restoreVersion, rolloutPage, searchAndReplaceInPages, searchInPages, setPageProperties, setPageProperty, setPagePropertyImage, unlockPage, uploadAsset, uploadFileCQStyle
createFolder, createNode, createNodeRecursive, deletePath, doGetJson, exists, getJsonNode, getJsonNode, getNodeNameFromPath, getParentPath, getUUId, getUUID, importContent, importContent, importJson, move, setPropertiesString, setPropertyString, setPropertyStringArray, upload, waitExists, waitUntilExists
adaptTo, 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, hasValue
public CommunityClient(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.ClientException
public org.apache.sling.testing.clients.SlingHttpResponse addCommentsComponent(String pagePath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
pagePath
- path to the page where the comment component will be created.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 configureCommentComponent(String commentPath, String defaultMessage, boolean isModerated, boolean allowReplies, boolean displayAsTree, boolean closed, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
commentPath
- path to the comment componentdefaultMessage
- the topic for the commentsisModerated
- true if comments are moderatedallowReplies
- true if replies are alloweddisplayAsTree
- true if the comments are displayed as treeclosed
- true if topic is closed (no posting of comments possible anymore)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 moderateComment(String commentPath, boolean approve, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
commentPath
- the path to the commentapprove
- true if comment should be approved, false if comment should be deniedexpectedStatus
- 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 markCommentAsSpam(String commentPath, boolean isSpam, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
commentPath
- the path to the commentisSpam
- true if comment should be marked as spam, false if notexpectedStatus
- 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 editComment(String command, String commentPath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
command
- available commands: approve | deny | markCommentAsSpam | deleteCommentcommentPath
- the path to the commentexpectedStatus
- 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.codehaus.jackson.JsonNode createComment(String commentPath, String comment, String user, String url, String email, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
commentPath
- path to the comment componentcomment
- the comment textuser
- the user writing the commenturl
- the users urlemail
- the users emailexpectedStatus
- list of allowed HTTP Status to be returned. If not set,
http status 200 (OK) is assumed.JsonNode
mapping to the requested content node.org.apache.sling.testing.clients.ClientException
- If something fails during request/response cyclepublic org.codehaus.jackson.JsonNode getComments(String ugcBasePath, int limit, int start, String predicate, String view) throws org.apache.sling.testing.clients.ClientException
user generated content
space,
currently under /content/usergenerated
.ugcBasePath
- The base path to start listinglimit
- limits the number of nodes below ugcBasePath to be returnedstart
- defines the start node below ugcBasePathpredicate
- Predicate used to filter hierarchy nodes in the siteadmin e.g. siteadminview
- filter: null | approved | denied | spam | notspamJsonNode
mapping to the requested content node.org.apache.sling.testing.clients.ClientException
- If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse deleteComment(String commentPath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
commentPath
- The page where the comments areexpectedStatus
- 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 cycleCopyright © 2018. All rights reserved.