Von Version < 1.13 >
bearbeitet von awa
am 12.03.2020, 11:56
Auf Version < 1.11 >
bearbeitet von awa
am 12.03.2020, 11:09
< >
Änderungskommentar: Es gibt keinen Kommentar für diese Version

Zusammenfassung

Details

Seiteneigenschaften
Inhalt
... ... @@ -16,8 +16,6 @@
16 16  
17 17  Standardmäßig ist eine Servlet-Aktion für alle frei zugänglich. Da es in der Regel unerwünscht ist, dass jeder (auch unangemeldete) Nutzer Plugins installieren kann, kann das Deploy-Plugin durch ein Passwort abgesichert werden. Dazu muss in der Plugin-Konfiguration der Passwort-Hash hinterlegt werden und das Passwort dann im HTTP-POST-Request mitgesendet werden.
18 18  
19 -== Plugin-Konfiguration ==
20 -
21 21  == HTTP-Request-Aufbau ==
22 22  
23 23  Im Folgenden wird der Aufbau des HTTP-Requests beschrieben, um ein Plugin zu installieren, zu aktualisieren oder zu löschen.
... ... @@ -30,7 +30,7 @@
30 30  
31 31  Die //client-id// muss nicht angegeben werden, wenn das Plugin als System-Plugin installiert ist.
32 32  
33 -=== Request-Parameter ===
31 +=== Request-Parameter
34 34  
35 35  Die Parameter können direkt als URL-Parameter, als //multipart/form-data// oder als //application/x-www-form-urlencoded// übergeben werden. Folgende Parameter werden vom Deploy-Plugin unterstützt und können übergeben werden:
36 36  
... ... @@ -59,9 +59,9 @@
59 59  :; plugin-ident=manifest
60 60  :: //plugin-identifier// muss den Namen der Manifest-Eigenschaft und dessen Wert enthalten, im Format //ATTRIBUTE_NAME=VALUE//. Wird zum Beispiel //Implementation-Title=com.example.fc.plugin:my-plugin// übergeben wird, wird nach einem existierenden Plugin gesucht, welches im Manifest in der Eigenschaft //Implementation-Title// den Wert //com.example.fc.plugin:my-plugin// stehen hat.
61 61  :; plugin-ident=id
62 -:: //plugin-identifier// muss die gewünschte ID des Plugins enthalten, etwa //53// oder /893//.//
60 +:: //plugin-identifier// muss die gewünschte ID des Plugins enthalten, etwa //53// oder /893//.
63 63  :; plugin-ident=name
64 -:: //plugin-identifier// muss den gewünschten Names des Plugins enthalten, etwa //my-plugin.jar// oder /foobar.jar//.//
62 +:: //plugin-identifier// muss den gewünschten Names des Plugins enthalten, etwa //my-plugin.jar// oder /foobar.jar//.
65 65  :; plugin-ident=uuid
66 66  :: //plugin-identifier// muss die gewünschte UUID des Plugins enthalten, etwa //03022599-903d-429b-9822-80a324a542fc//.
67 67  Andernfalls wird das Plugin installiert, falls noch nicht vorhanden, oder aktualisiert, falls vorhanden.
... ... @@ -73,17 +73,16 @@
73 73  : Entweder //true// oder //false//. Ist diese Option auf //true// gesetzt und existiert das Plugin noch nicht (bezüglich der angegebenen //plugin-ident// und //plugin-identifier//), wird das Plugin nicht neu installiert und eine Fehlermeldung zurückgegeben. ; locale
74 74  : Die Sprache, welche während der Installation, Aktualisierung oder Löschung des Plugins verwendet werden soll, etwa //en// oder //de//. Beeinflusst nur einige Fehlermeldungen und kann in der Regel weggelassen werden.
75 75  
76 -=== Deploy-Action ===
74 +=== Deploy-Action
77 77  
78 78  Der Wert des Parameters //deploy-action// gibt an, was genau mit dem Plugin geschehen soll. Es gibt dabei die folgenden Möglichkeiten:
79 79  
80 80  ; save
81 81  : Überträgt das angegebene Plugin auf das FORMCYCLE-System. Es muss hierbei eine JAR-Datei übertragen werden. Falls das Plugin noch nicht existiert (und der Parameter //disallow-install// nicht gesetzt ist), wird das Plugin neu installiert und ist dann aktiviert. Andernfalls, falls das Plugin bereits existiert, wird es aktualisiert, dabei bleibt das Plugin aktiviert oder deaktiviert.
82 -
83 83  (((
84 84  {{code language="bash"}}
85 -# Installiert oder aktualisiert das Plugin mit dem Implementation-Title com.example:plugin
86 86   curl -X POST \
83 + # These options are required
87 87   -F deploy-action=save \
88 88   -F token=admin \
89 89   -F plugin-ident=manifest \
... ... @@ -92,14 +92,12 @@
92 92   "http://localhost:8080/formcycle/plugin?client-id=154&name=deploy-plugin"
93 93  {{/code}}
94 94  )))
95 -
96 96  ; delete
97 97  : Löscht das angegebene Plugin. Es darf hierbei keine JAR-Datei übertragen werden. Existiert das angegebene Plugin nicht, wird ein Fehler zurückgegeben. Beispiel:
98 -
99 99  (((
100 100  {{code language="bash"}}
101 -# Löscht das Plugin mit dem Implementation-Title com.example:plugin
102 102   curl -X POST \
97 + # These options are required
103 103   -F deploy-action=delete \
104 104   -F token=admin \
105 105   -F plugin-ident=manifest \
... ... @@ -107,14 +107,12 @@
107 107   "http://localhost:8080/formcycle/plugin?client-id=154&name=deploy-plugin"
108 108  {{/code}}
109 109  )))
110 -
111 111  ; activate
112 -: Aktiviert das angegebene Plugin. Es darf hierbei keine JAR-Datei übertragen werden. Existiert das angegebene Plugin nicht, wird ein Fehler zurückgegeben. Ist das Plugin bereits aktiviert, wird nicht getan und ein Erfolg zurückgegeben. Beispiel:
113 -
106 +: Aktiviert das angegebene Plugin. Es darf hierbei keine JAR-Datei übertragen werden. Existiert das angegebene Plugin nicht, wird ein Fehler zurückgegeben. Beispiel:
114 114  (((
115 115  {{code language="bash"}}
116 -# Aktiviert das Plugin mit dem Implementation-Title com.example:plugin
117 117   curl -X POST \
110 + # These options are required
118 118   -F deploy-action=activate \
119 119   -F token=admin \
120 120   -F plugin-ident=manifest \
... ... @@ -122,14 +122,12 @@
122 122   "http://localhost:8080/formcycle/plugin?client-id=154&name=deploy-plugin"
123 123  {{/code}}
124 124  )))
125 -
126 126  ; deactivate
127 -: Deaktiviert das angegebene Plugin. Es darf hierbei keine JAR-Datei übertragen werden. Existiert das angegebene Plugin nicht, wird ein Fehler zurückgegeben. Ist das Plugin bereits deaktiviert, wird nicht getan und ein Erfolg zurückgegeben. Beispiel:
128 -
119 +: Deaktiviert das angegebene Plugin. Es darf hierbei keine JAR-Datei übertragen werden. Existiert das angegebene Plugin nicht, wird ein Fehler zurückgegeben. Beispiel:
129 129  (((
130 130  {{code language="bash"}}
131 -# Deaktiviert oder aktualisiert das Plugin mit dem Implementation-Title com.example:plugin
132 132   curl -X POST \
123 + # These options are required
133 133   -F deploy-action=deactivate \
134 134   -F token=admin \
135 135   -F plugin-ident=manifest \
... ... @@ -137,10 +137,9 @@
137 137   "http://localhost:8080/formcycle/plugin?client-id=154&name=deploy-plugin"
138 138  {{/code}}
139 139  )))
140 -
141 141  ; update-properties
142 142  : Aktualisiert die Eigenschaften des angegebenen Plugins. Es darf hierbei keine JAR-Datei übertragen werden. Entweder die Eigenschaft //clear-properties// oder //property// sollte gesetzt sein. Existiert das angegebene Plugin nicht, wird ein Fehler zurückgegeben. Beispiel:
143 -(((
133 + (((
144 144  {{code language="bash"}}
145 145  # Löscht alle vorhandenen Plugin-Eigenschaften und setzt dann die Eigenschaft "foo" auf den Wert "bar"
146 146   curl -X POST \
... ... @@ -151,160 +151,10 @@
151 151   -F clear-properties=false \
152 152   -F property=foo=bar \
153 153   "http://localhost:8080/formcycle/plugin?client-id=154&name=deploy-plugin"
154 -{{/code}}
155 -)))
144 +{{/code}})))
156 156  
157 -== Response ==
146 +== Response
158 158  
159 -Das Deploy-Plugin liefert einen Statuscode und ein JSON-Objekt mit den Details zurück. Der Status-Code ist 2xx, falls das Deploy-Plugin erfolgreich ausgeführt wurde.
160 160  
161 -Das JSON-Objekt hat dabei [[die folgende Struktur>>https://json-schema.org/]]:
162 162  
163 -{{code language="json"}}
164 -{
165 - "$schema": "http://json-schema.org/schema",
166 - "description": "Represents the response of the deploy plugin servlet.",
167 - "required": [
168 - "success",
169 - "statusCode",
170 - "details",
171 - "message",
172 - "requestParameters"
173 - ],
174 - "properties": {
175 - "success": {
176 - "type": "boolean",
177 - "title": "Success status",
178 - "description": "true if the deploy plugin servlet was executed successfully, or false otherwise"
179 - },
180 - "statusCode": {
181 - "type": "number",
182 - "title": "HTTP status code",
183 - "description": "The status code of the HTTP request that contains this response."
184 - },
185 - "details": {
186 - "type": "object",
187 - "title": "Result details",
188 - "description": "Detailed information about the plugin processed by the deploy plugin servlet.",
189 - "oneOf": [
190 - {
191 - "description": "If the deploy plugin servlet was successful, details about the successfully executed action.",
192 - "required": [
193 - "id",
194 - "uuid",
195 - "name",
196 - "active",
197 - "message"
198 - ],
199 - "properties": {
200 - "id": {
201 - "type": "number",
202 - "title": "Plugin ID",
203 - "description": "The database ID of the processed plugin."
204 - },
205 - "uuid": {
206 - "type": "string",
207 - "title": "Plugin UUID",
208 - "description": "The UUID of the processed plugin."
209 - },
210 - "name": {
211 - "type": "string",
212 - "title": "Plugin name",
213 - "description": "The name of the processed plugin, i.e. the file name of the plugin JAR file."
214 - },
215 - "active": {
216 - "type": "boolean",
217 - "title": "Plugin activation status",
218 - "description": "true if the plugin is now active, false if it is now inactive."
219 - },
220 - "message": {
221 - "type": "string",
222 - "title": "Result message",
223 - "description": "Human-readable message describing the performed action."
224 - }
225 - }
226 - },
227 - {
228 - "required": [
229 - "exceptionType",
230 - "exceptionMessage"
231 - ],
232 - "description": "If the deploy plugin servlet was unsuccessful, details about the error that occurred.",
233 - "properties": {
234 - "exceptionType": {
235 - "type": "string",
236 - "title": "Exception type",
237 - "description": "The type of the error that occurred, a fully-classified name of the Java exception class."
238 - },
239 - "exceptionMessage": {
240 - "type": "string",
241 - "title": "Exception message",
242 - "description": "The human-readable message of the error that occurred."
243 - }
244 - }
245 - }
246 - ]
247 - },
248 - "message": {
249 - "type": "string",
250 - "title": "Result message",
251 - "description": "A human-readable message that describes this result."
252 - },
253 - "requestParameters": {
254 - "type": "object",
255 - "title": "Request parameters",
256 - "description": "The parameters of the request that triggered this response."
257 - }
258 - }
259 -}
260 -{{/code}}
261 -
262 -Beispiel für die Antwort beim Aktualisieren eines Plugins:
263 -
264 -{{code language="json"}}
265 -{
266 - "success": true,
267 - "requestParameters": {
268 - "plugin-ident": ["manifest"],
269 - "name": ["deploy-plugin"],
270 - "client-id": ["1"],
271 - "deploy-action": ["save"],
272 - "plugin-identifier": ["Implementation-Title=com.example:plugin"],
273 - "token": ["admin"]
274 - },
275 - "details": {
276 - "name": "my-plugin.jar",
277 - "active": true,
278 - "id": 203,
279 - "message": "Plugin saved successfully.",
280 - "uuid": "2fe3e1ba-cb32-434e-9f59-4422f8dabcad"
281 - },
282 - "message": "Plugin saved successfully.",
283 - "statusCode": 200
284 -}
285 -{{/code}}
286 -
287 -Beispiel für die Antwort beim Löschen, falls das angegebene Plugin nicht gefunden wurde:
288 -
289 -{{code language="json"}}
290 -{
291 - "success": false,
292 - "requestParameters": {
293 - "plugin-ident": ["manifest"],
294 - "name": ["deploy-plugin"],
295 - "client-id": ["1"],
296 - "deploy-action": ["delete"],
297 - "plugin-identifier": ["Implementation-Title=com.example:plugin"],
298 - "token": ["admin"]
299 - },
300 - "details": {
301 - "exceptionType": "java.lang.IllegalArgumentException",
302 - "exceptionMessage": "Deploy action 'delete' requires an existing pluign, but none was found."
303 - },
304 - "message": "class java.lang.IllegalArgumentException: Deploy action 'delete' requires an existing pluign, but none was found.",
305 - "statusCode": 404
306 -}
307 -{{/code}}
308 -
309 -
310 310  == Beispiel für Maven ==
Copyright 2000-2025