Skip to content

Views

Purpose

Call and list views.

Methods

Binding name: p6.view


listAll

Returns all view names.

Syntax

List<String> p6.view.listAll()

Note

If the item is related to an application, the name will be appkey.name

Example
p6.view.listAll().each() {
    println "${it}"
}

list

Returns all the view names of an application.

Syntax

List<String> p6.view.list([String appKey])

Tip

Specify an empty appKey to return the unpackaged entries.

Examples

Packaged

p6.view.list("appKey").each() {
    println "${it}"
}

Unpackaged

p6.view.list().each() {
    println "${it}"
}


get

Returns the xml definition of a view.

Syntax

String p6.view.get(String viewName [, String appKey])
Example
def view = p6.view.get("name");

update

Update the xml definition of a view.

Syntax

void p6.view.update(String viewName [, String appKey], String viewXml)
Example
def view = p6.view.get("name");
p6.view.update("name", view.replaceAll("Fee", "Foo"));

updateIndexes

Start the indexation job for the view. A P6Exception is thrown if the job is already running for this view.

Syntax

String p6.view.updateIndexes(String viewName [, String appKey])

Note

The views are cached in the Transaction service and cleared after restarting. To restart the platform6.views and platform6.transactions services take a look to the Service DSL

Examples

Packaged

p6.view.reindex("name", "appKey");

Unpackaged

p6.view.reindex("name");