DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:struct:remote_api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:struct:remote_api [2017-07-12 11:34] – [Methods] saveData() added grosseplugin:struct:remote_api [2023-11-23 00:20] (current) – Reformatted Klap-in
Line 1: Line 1:
 +<= [[plugin:struct|Struct Plugin]]
 +
 ====== remote API ====== ====== remote API ======
 +
 The struct plugin exposes several methods that can be accessed via the [[devel:xmlrpc|XML-RPC API]]. You can find the current code in the [[https://github.com/cosmocode/dokuwiki-plugin-struct/blob/master/remote.php|remote.php]] The struct plugin exposes several methods that can be accessed via the [[devel:xmlrpc|XML-RPC API]]. You can find the current code in the [[https://github.com/cosmocode/dokuwiki-plugin-struct/blob/master/remote.php|remote.php]]
  
 +Note: The method names are prefixed with ''plugin.struct.'', for example ''plugin.struct.getSchema''
 ===== Methods ===== ===== Methods =====
   * **''getData()''** //Get the structured data of a given page//   * **''getData()''** //Get the structured data of a given page//
     - parameter: **string** //The page to get data for//     - parameter: **string** //The page to get data for//
     - parameter: **string** //The schema to use, empty for all//     - parameter: **string** //The schema to use, empty for all//
-    - paramter: **int** //A timestamp if you want historic data (0 for now)//+    - parameter: **int** //A timestamp if you want historic data (0 for now)//
     * returns: **array** ''('schema' => ( 'fieldlabel' => 'value', ...))''     * 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.   * **''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.
Line 13: Line 17:
     - parameter: **string** //summary//     - parameter: **string** //summary//
     * return **bool** //returns always true//     * return **bool** //returns always true//
 +  * **''getSchema()''** //Get info about existing schemas columns//\\ Returns only current, enabled columns
 +    - parameter: **string** //the schema to query, empty for all//
 +    * return **array**
 +  * **''getAggregationData()''** //Get the data that would be shown in an aggregation//
 +    - parameter: **array** //array of strings with the schema-names//
 +    - parameter: **array** //array of strings with the columns//
 +    - parameter: **array** //array of arrays with// ''['logic'=> 'and'|'or', 'condition' => 'your condition']''
 +    - 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:
 +
 +<code>
 +<?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>
 +</code>
  
plugin/struct/remote_api.1499852052.txt.gz · Last modified: 2017-07-12 11:34 by grosse

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