Skip to content

Views

Purpose

Call and list views.

Methods

Binding name: p6.view


Method: List<String> listAll()

Return all the views name.

Note

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


Method: List<String> list([String appKey])

Return all the views name of an application. If no appKey is given or empty, only the unbundled views will be listed


Method: String get(String viewName [, String appKey])

Return the xml definition of a view.


Method: void update(String viewName [, String appKey], String viewXml)

Update the xml definition of a view.


Method: String updateIndexes(String viewName [, String appKey])

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

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

def view = p6.view.get("myView");
p6.view.update("myView", view.replaceAll("Fee", "Foo"));
p6.view.reindex("myView");