Content Repository Services

You can work with the solution repository through this service:

 /pentaho/SolutionRepositoryService?component=<value>

This service is implemented by org.pentaho.platform.web.servlet.SolutionRepositoryService. Please refer to SolutionRepositoryService.java to keep this page updated.

Component parameter

Using the component parameter, you can specify what action to perform. The following values are valid for the component parameter:

All of these services can be accessed using the HTTP GET method (yes, that's not how it ought to be for creating and deleting objects, but that is how it works for some reason).

Additional parameters

The createNewFolder and delete services require extra parameters to identify the repository item to which the action is applied:

In addition, the createNewFolder service accepts an additional desc parameter to set the description of the new folder.

The getSolutionRepositoryFileDetails also applies to a particular respository item, but in this case the item is identified by the fullPath parameter (and not by solution / path / name as I would expect)

Response

The delete and createNewFolder service return an XML document to indicate success or failure:

The getSolutionRepositoryDoc returns and XML document representing the folders and items contained in the repository. The schema of this response is shown below:

(In the schema description above, elements are denoted as tagnames enclosed within angle brackets, and attributes are indicated with a leading @ sign)

Example getSolutionRepositoryDoc Response

The getSolutionRepositoryDoc service returns this XML fragment for the ChartComponent_ChartTypes.xaction that sits in the charts folder in the bi-developers solution:

<file
  description="This demonstrates multiple chart types using the ChartComponent in the action sequence"
  isDirectory="false"
  lastModifiedDate="1291368356000"
  localized-name="Chart Pick List"
  name="ChartComponent_ChartTypes.xaction"
  param-service-url="/pentaho/ServiceAction?solution=steel-wheels&path=charts&action=ChartComponent_ChartTypes.xaction&component=xaction-parameter"
  url="/pentaho/ViewAction?solution=steel-wheels&path=charts&action=ChartComponent_ChartTypes.xaction"
  visible="true"
/>

Param Service URL

The value of the param-service-url attribute of the <file> items returned by the getSolutionRepositoryDoc service contain a url that may be used to discover the available parameters for that item. The form of the param-service-urls depends on the type of item:

So you need to call a different service depending on the type of item, and each has a number of service-specific parameters. The solution and path parameters are common to all param-service-url services.

Param Service URL Response

Note: there is more documentation pertaining to this topic in the Pentaho Reporting wiki. See http://wiki.pentaho.com/display/Reporting/Specification+for+the+BI-Server+Plugin+Parameter-XML+format for more information.

The response for this service is an XML document which has the following format:

Param Service Response Example

In the getSolutionRepositoryDoc example, the value of the param-service-url attribute is:

/pentaho/ServiceAction?solution=steel-wheels&path=charts&action=ChartComponent_ChartTypes.xaction&component=xaction-parameter

By way of example, here's a fragment of the response:
<parameters>
  <parameter name="chart_type" type="java.lang.String">
    <attribute 
      namespace="http://reporting.pentaho.org/namespaces/engine/parameter-attributes/core"
      name="role" value="user"
    />
    <attribute
      namespace="http://reporting.pentaho.org/namespaces/engine/parameter-attributes/core"
      name="parameter-group" value="parameters"
    />
    <attribute
      namespace="http://reporting.pentaho.org/namespaces/engine/parameter-attributes/core"
      name="parameter-group-label" value="Parameters"
    />
    <values>
      <value type="java.lang.String" value="bar" selected="true" />
    </values>
  </parameter>
  
  <parameter>
    ...more attributes and values here...
  </parameter>
  
  ...more parameters here...
</parameters>