Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

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:

  • getSolutionRepositoryDoc - describes all files and folders contained in the repostitory that are available within the context the current session
  • getSolutionRepositoryFileDetails - describes one particular file or folder in the repository, including its contents (but also within the context of the current session)
  • createNewFolder - create a new folder.
  • delete - delete an item.

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:

  • solution - the pentaho solution
  • path - the folder path within the solution
  • name - the name of the item found at the path within the solution.

...

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:

  • <result>*true</result>* is returned in case of success
  • <result>*false</result>* is returned in case of failure

...

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:

...

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>