@com.adaptavist.hapi.platform.analytics.Tracked class Pages extends java.lang.Object
Constructor and description |
---|
Pages() |
Type Params | Return Type | Name and description |
---|---|---|
|
static com.atlassian.confluence.pages.Page |
create(java.lang.String spaceKey, java.lang.String pageTitle, groovy.lang.Closure<?> specification) Creates a page with the given title in a space found by space key, example usage: Pages.create("SR", "New Page Title") { setLabels("new-label") setParentPage("Title of a page in the same space") } |
|
static com.atlassian.confluence.pages.Page |
create(com.atlassian.confluence.spaces.Space space, java.lang.String pageTitle, groovy.lang.Closure<?> specification) Creates a page with a given title in a space, example usage: Pages.create(Spaces.getByKey("SR"), "New Page Title") { setLabels("new-label") setParentPage("Title of a page in the same space") } |
|
static com.atlassian.confluence.pages.Page |
getById(long id) Get a page by its ID. |
|
static PageIterator |
search(java.lang.String cql) Executes the CQL and returns matching pages. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Creates a page with the given title in a space found by space key, example usage:
Pages.create("SR", "New Page Title") { setLabels("new-label") setParentPage("Title of a page in the same space") }
spaceKey
- space key of the space to create the page inpageTitle
- title of the page being createdspecification
- closure containing parameters to set on the created pageCreates a page with a given title in a space, example usage:
Pages.create(Spaces.getByKey("SR"), "New Page Title") { setLabels("new-label") setParentPage("Title of a page in the same space") }
space
- space to create the page inpageTitle
- title of the page being createdspecification
- closure containing parameters to set on the created pageGet a page by its ID. Example usage:
Pages.getById(000000) }
id
- A Page idExecutes the CQL and returns matching pages. You can iterate over the pages in the response, for example to edit each one:
Pages.search('title = FOO').each { // do something with it }Or filter them further:
Pages.search('title = FOO').findAll { // condition }If you only need the top N:
Pages.search('title = FOO').take(10)DO NOT attempt to convert a potentially unlimited set to a List, e.g.:
Pages.search('title = FOO').toList()as this could potentially consume a large amount of memory. If you need a list then limit it to the top N:
Pages.search('title = FOO').take(100).toList()
cql
- A CQL query