You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: developer_manual/client_apis/ClientIntegration/index.rst
+67-15Lines changed: 67 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,20 +49,23 @@ Hooks
49
49
50
50
Currently only "context-menu" is supported.
51
51
52
+
.. _endpoint-section:
53
+
52
54
Endpoint
53
55
--------
54
56
The endpoint tells the client how the menu entry should look like and how the client can send a request to the server.
55
57
56
58
Requirements:
57
-
- Every text need to be translated by the app
58
-
- Current predefined params are fileId and filePath
59
-
- {fileId} and {filePath} will be replaced on clients with actual values
60
-
- url placeholder are always replaced
61
-
- mimetype_filters is a comma-separated list of filters (matches anything that starts with the filter). If there is no filter, the action is shown for every file/folder.
62
-
- all urls must be relative
63
-
- params is used for body params (currently only POST)
64
-
- Icons are always svgs
65
-
- Method: supports POST/GET
59
+
60
+
- Every text need to be translated by the app itself.
61
+
- Current predefined params are ``fileId`` and ``filePath``,
62
+
- ``{fileId}`` and ``{filePath}`` will be replaced by clients with actual values,
63
+
- ``url`` placeholders are always replaced,
64
+
- ``mimetype_filters`` is a comma-separated list of filters (matches anything that starts with the filter). If there is no filter, the action is shown for every file/folder.
65
+
- All ``urls`` must be relative.
66
+
- ``params`` is used for body params (currently only POST).
67
+
- ``icon`` field should always provide an SVG.
68
+
- ``method`` supports POST/GET.
66
69
67
70
.. code-block:: javascript
68
71
@@ -75,13 +78,13 @@ Requirements:
75
78
'icon'=>'/apps/abc/img/app.svg'
76
79
],
77
80
78
-
Response
79
-
--------
81
+
Responses
82
+
---------
80
83
When clicking on a menu entry the client sends a predefined request to the server.
81
84
The app in question can then handle the request and can send two different response types:
82
85
83
-
Declarative UI
84
-
^^^^^^^^^^^^^^
86
+
Declarative UI response
87
+
^^^^^^^^^^^^^^^^^^^^^^^
85
88
The declarative UI response allows the app to send back a new UI to be rendered by the client:
86
89
- version: Indicates which version it is. Clients will be backwards compatible. If server sends a newer version than the client can understand the response will be ignored.
87
90
- tooltip: Translated text, which will be shown as tooltip / snackbar.
@@ -139,8 +142,8 @@ The tooltip response is a regular DataResponse type, with payload:
139
142
}
140
143
}
141
144
142
-
Example:
143
-
----------
145
+
Example
146
+
---------
144
147
Here is an example of using the Assistant app.
145
148
146
149
**Capabilities:**
@@ -207,8 +210,57 @@ When clicking on the action, the client will send a POST request to the specifie
207
210
}
208
211
}
209
212
213
+
Develop your first app with client integration
214
+
-----------------------------------------------
215
+
216
+
1. Familiarize yourself on how to create an app via `Develop your first Hello World app <https://cloud.nextcloud.com/s/iyNGp8ryWxc7Efa?dir=%2F%2F2%20Develop%20your%20first%20Hello%20World%20app>`_ for more help on that topic:
217
+
218
+
2. Create ``Capabilities.php`` in ``/lib`` folder and add to array in ``getCapabilities()``:
0 commit comments