DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:struct:remote_api

Struct Plugin

remote API

The struct plugin exposes several methods that can be accessed via the XML-RPC API. You can find the current code in the remote.php

Note: The method names are prefixed with plugin.struct., for example plugin.struct.getSchema

Methods

  • getData() Get the structured data of a given page
    1. parameter: string The page to get data for
    2. parameter: string The schema to use, empty for all
    3. parameter: int A timestamp if you want historic data (0 for now)
    • returns: array ('schema' ⇒ ( 'fieldlabel' ⇒ 'value', …))
  • saveData() Saves data for a given page (creates a new revision)
    If this call succeeds you can assume your data has either been saved or it was not necessary to save it because the data already existed in the wanted form or the given schemas are no longer assigned to that page.
    1. parameter: string page
    2. parameter: array ('schema' ⇒ ( 'fieldlabel' ⇒ 'value', …))
    3. parameter: string summary
    • return bool returns always true
  • getSchema() Get info about existing schemas columns
    Returns only current, enabled columns
    1. parameter: string the schema to query, empty for all
    • return array
  • getAggregationData() Get the data that would be shown in an aggregation
    1. parameter: array array of strings with the schema-names
    2. parameter: array array of strings with the columns
    3. parameter: array array of arrays with ['logic'⇒ 'and'|'or', 'condition' ⇒ 'your condition']
    4. parameter: string string indicating the column to sort by
    • return array array of rows, each row is an array of the column values

Postman example for getAggregationData(), as raw data:

<?xml version="1.0"?>
<methodCall>
  <methodName>plugin.struct.getAggregationData</methodName>
  <params>
    <param>
      <value>
        <array>
          <data>
            <value>
              <string>myschema</string>
            </value>
          </data>
        </array>
        <array>
          <data>
            <value>
              <string>colour</string>
            </value>
          </data>
        </array>
        <array>
          <data>
            <value>
              <struct>
                <member>
                  <name>logic</name>
                  <value>
                    <string>and</string>
                  </value>
                </member>
                <member>
                  <name>condition</name>
                  <value>
                    <string>colour=red</string>
                  </value>
                </member>
              </struct>
            </value>
          </data>
        </array>
        <string>colour</string>
      </value>
    </param>
  </params>
</methodCall>
plugin/struct/remote_api.txt · Last modified: 2023-11-23 00:20 by Klap-in

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki