... |
... |
@@ -1,3
+1,5 @@ |
|
1 |
+Hinweis zum Name: Es ist ein Plugin zum Deployen von Plugins in FORMCYCLE, daher //FORMCYCLE-Deploy-Plugin-Plugin//. |
|
2 |
+ |
1 |
1 |
{{content/}} |
2 |
2 |
|
3 |
3 |
Mit dem Deploy-Plugin können Plugins automatisch in die FORMCYCLE-Anwendung hochgeladen und dort installiert werden. Dies hat gegenüber der manuellen Installation über das entsprechende [[Menü im Backend>>doc:Formcycle.UserInterface.Client.Plugins]] einige Vorteile: |
... |
... |
@@ -174,6
+174,7 @@ |
174 |
174 |
|
175 |
175 |
; update-properties |
176 |
176 |
: 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: |
|
179 |
+ |
177 |
177 |
((( |
178 |
178 |
{{code language="bash"}} |
179 |
179 |
# Löscht alle vorhandenen Plugin-Eigenschaften und setzt dann die Eigenschaft "foo" auf den Wert "bar" |
... |
... |
@@ -297,24
+297,24 @@ |
297 |
297 |
|
298 |
298 |
{{code language="json"}} |
299 |
299 |
{ |
300 |
|
- "success": true, |
301 |
|
- "requestParameters": { |
302 |
|
- "plugin-ident": ["manifest"], |
303 |
|
- "name": ["deploy-plugin"], |
304 |
|
- "client-id": ["1"], |
305 |
|
- "deploy-action": ["save"], |
306 |
|
- "plugin-identifier": ["Implementation-Title=com.example:plugin"], |
307 |
|
- "token": ["admin"] |
308 |
|
- }, |
309 |
|
- "details": { |
310 |
|
- "name": "my-plugin.jar", |
311 |
|
- "active": true, |
312 |
|
- "id": 203, |
313 |
|
- "message": "Plugin saved successfully.", |
314 |
|
- "uuid": "2fe3e1ba-cb32-434e-9f59-4422f8dabcad" |
315 |
|
- }, |
316 |
|
- "message": "Plugin saved successfully.", |
317 |
|
- "statusCode": 200 |
|
303 |
+ "success": true, |
|
304 |
+ "requestParameters": { |
|
305 |
+ "plugin-ident": ["manifest"], |
|
306 |
+ "name": ["deploy-plugin"], |
|
307 |
+ "client-id": ["1"], |
|
308 |
+ "deploy-action": ["save"], |
|
309 |
+ "plugin-identifier": ["Implementation-Title=com.example:plugin"], |
|
310 |
+ "token": ["admin"] |
|
311 |
+ }, |
|
312 |
+ "details": { |
|
313 |
+ "name": "my-plugin.jar", |
|
314 |
+ "active": true, |
|
315 |
+ "id": 203, |
|
316 |
+ "message": "Plugin saved successfully.", |
|
317 |
+ "uuid": "2fe3e1ba-cb32-434e-9f59-4422f8dabcad" |
|
318 |
+ }, |
|
319 |
+ "message": "Plugin saved successfully.", |
|
320 |
+ "statusCode": 200 |
318 |
318 |
} |
319 |
319 |
{{/code}} |
320 |
320 |
|
... |
... |
@@ -322,21
+322,21 @@ |
322 |
322 |
|
323 |
323 |
{{code language="json"}} |
324 |
324 |
{ |
325 |
|
- "success": false, |
326 |
|
- "requestParameters": { |
327 |
|
- "plugin-ident": ["manifest"], |
328 |
|
- "name": ["deploy-plugin"], |
329 |
|
- "client-id": ["1"], |
330 |
|
- "deploy-action": ["delete"], |
331 |
|
- "plugin-identifier": ["Implementation-Title=com.example:plugin"], |
332 |
|
- "token": ["admin"] |
333 |
|
- }, |
334 |
|
- "details": { |
335 |
|
- "exceptionType": "java.lang.IllegalArgumentException", |
336 |
|
- "exceptionMessage": "Deploy action 'delete' requires an existing pluign, but none was found." |
337 |
|
- }, |
338 |
|
- "message": "class java.lang.IllegalArgumentException: Deploy action 'delete' requires an existing pluign, but none was found.", |
339 |
|
- "statusCode": 404 |
|
328 |
+ "success": false, |
|
329 |
+ "requestParameters": { |
|
330 |
+ "plugin-ident": ["manifest"], |
|
331 |
+ "name": ["deploy-plugin"], |
|
332 |
+ "client-id": ["1"], |
|
333 |
+ "deploy-action": ["delete"], |
|
334 |
+ "plugin-identifier": ["Implementation-Title=com.example:plugin"], |
|
335 |
+ "token": ["admin"] |
|
336 |
+ }, |
|
337 |
+ "details": { |
|
338 |
+ "exceptionType": "java.lang.IllegalArgumentException", |
|
339 |
+ "exceptionMessage": "Deploy action 'delete' requires an existing pluign, but none was found." |
|
340 |
+ }, |
|
341 |
+ "message": "class java.lang.IllegalArgumentException: Deploy action 'delete' requires an existing pluign, but none was found.", |
|
342 |
+ "statusCode": 404 |
340 |
340 |
} |
341 |
341 |
{{/code}} |
342 |
342 |
|
... |
... |
@@ -358,18
+358,18 @@ |
358 |
358 |
|
359 |
359 |
{{code language="json"}} |
360 |
360 |
{ |
361 |
|
- "success": true, |
362 |
|
- "requestParameters": { |
363 |
|
- "name": ["create-token"], |
364 |
|
- "client-id": ["1"], |
365 |
|
- "token": ["admin"] |
366 |
|
- }, |
367 |
|
- "details": { |
368 |
|
- "method": "sha256", |
369 |
|
- "token": "sha256:S+32GI3fWXwHHulUMtWmjpQ15EqMvgVYguuO9SKxfNw+ckAGQljP6tKlf1EITnU7" |
370 |
|
- }, |
371 |
|
- "message": "Hash token created successfully", |
372 |
|
- "statusCode": 200 |
|
364 |
+ "success": true, |
|
365 |
+ "requestParameters": { |
|
366 |
+ "name": ["create-token"], |
|
367 |
+ "client-id": ["1"], |
|
368 |
+ "token": ["admin"] |
|
369 |
+ }, |
|
370 |
+ "details": { |
|
371 |
+ "method": "sha256", |
|
372 |
+ "token": "sha256:S+32GI3fWXwHHulUMtWmjpQ15EqMvgVYguuO9SKxfNw+ckAGQljP6tKlf1EITnU7" |
|
373 |
+ }, |
|
374 |
+ "message": "Hash token created successfully", |
|
375 |
+ "statusCode": 200 |
373 |
373 |
} |
374 |
374 |
{{/code}} |
375 |
375 |
|
... |
... |
@@ -377,7
+377,7 @@ |
377 |
377 |
|
378 |
378 |
Um ein Plugin nach dem Bauen über Maven in FORMCYCLE hochzuladen, gibt es auch ein Maven-Plugin, welches das Deploy-Servlet anspricht. Dieses ist über die Artifactory von XIMA erhältlich, falls man die entsprechenden Rechte hierfür hat: |
379 |
379 |
|
380 |
|
-=== Konfiguration |
|
383 |
+=== Konfiguration === |
381 |
381 |
|
382 |
382 |
{{code language="xml"}} |
383 |
383 |
<plugin> |
... |
... |
@@ -433,7
+433,7 @@ |
433 |
433 |
; properties |
434 |
434 |
: Key-Value-Paare mit Eigenschaften, die an dem Plugin gesetzt werden sollen. Entspricht dem Parameter //clear-properties// des Deploy-Plugins, siehe oben. |
435 |
435 |
|
436 |
|
-=== Empfehlung für Plugin-Projekt |
|
439 |
+=== Empfehlung für Plugin-Projekt === |
437 |
437 |
|
438 |
438 |
Während das Plugin zahlreiche Einstellunsgmöglichkeiten anbietet, reichen meist die Standardwerte aus. Empfohlen wird das folgende Vorgehen bei der Entwicklung von Plugin-Projekten. |
439 |
439 |
|
... |
... |
@@ -440,108
+440,108 @@ |
440 |
440 |
Folgendes Schnippsel sollte in der Profil-Sektion der //pom.xml// eingefügt werden: |
441 |
441 |
|
442 |
442 |
{{code language="xml"}} |
443 |
|
- <properties> |
444 |
|
- <fc-deploy-plugin-maven-plugin.version>1.1.0</fc-deploy-plugin-maven-plugin.version> |
445 |
|
- </properties> |
|
446 |
+ <properties> |
|
447 |
+ <fc-deploy-plugin-maven-plugin.version>1.1.0</fc-deploy-plugin-maven-plugin.version> |
|
448 |
+ </properties> |
446 |
446 |
|
447 |
|
- <profiles> |
448 |
|
- <profile> |
449 |
|
- <id>fc-deploy</id> |
450 |
|
- <activation> |
451 |
|
- <property> |
452 |
|
- <name>fcDeployUrl</name> |
453 |
|
- </property> |
454 |
|
- </activation> |
455 |
|
- <build> |
456 |
|
- <plugins> |
457 |
|
- <plugin> |
458 |
|
- <groupId>de.xima.fc.maven.plugin</groupId> |
459 |
|
- <artifactId>fc-deploy-plugin-maven-plugin</artifactId> |
460 |
|
- <version>${fc-deploy-plugin-maven-plugin.version}</version> |
461 |
|
- <executions> |
462 |
|
- <execution> |
463 |
|
- <goals> |
464 |
|
- <goal>install</goal> |
465 |
|
- </goals> |
466 |
|
- </execution> |
467 |
|
- </executions> |
468 |
|
- </plugin> |
469 |
|
- </plugins> |
470 |
|
- </build> |
471 |
|
- </profile> |
472 |
|
- </profiles> |
|
450 |
+ <profiles> |
|
451 |
+ <profile> |
|
452 |
+ <id>fc-deploy</id> |
|
453 |
+ <activation> |
|
454 |
+ <property> |
|
455 |
+ <name>fcDeployUrl</name> |
|
456 |
+ </property> |
|
457 |
+ </activation> |
|
458 |
+ <build> |
|
459 |
+ <plugins> |
|
460 |
+ <plugin> |
|
461 |
+ <groupId>de.xima.fc.maven.plugin</groupId> |
|
462 |
+ <artifactId>fc-deploy-plugin-maven-plugin</artifactId> |
|
463 |
+ <version>${fc-deploy-plugin-maven-plugin.version}</version> |
|
464 |
+ <executions> |
|
465 |
+ <execution> |
|
466 |
+ <goals> |
|
467 |
+ <goal>install</goal> |
|
468 |
+ </goals> |
|
469 |
+ </execution> |
|
470 |
+ </executions> |
|
471 |
+ </plugin> |
|
472 |
+ </plugins> |
|
473 |
+ </build> |
|
474 |
+ </profile> |
|
475 |
+ </profiles> |
473 |
473 |
{{/code}} |
474 |
474 |
|
475 |
475 |
Das Plugin wird dann anhand des Eintrags //Implementation-Title// im Manifest identifiziert. Hierzu muss der Wert korrekt im Manifest gesetzt werden. Dies kann entweder über das maven-jar-plugin oder über das maven-assembly-plugin geschehen, je nachdem, welches von diesen im Plugin-Projekt genutzt wird: |
476 |
476 |
|
477 |
477 |
{{code language="xml"}} |
478 |
|
- <properties> |
479 |
|
- <xfc.version>6.4.0-SNAPSHOT</xfc.version> |
480 |
|
- <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version> |
481 |
|
- <maven-assembly-plugin.version>3.2.0</maven-assembly-plugin.version> |
482 |
|
- </properties> |
|
481 |
+ <properties> |
|
482 |
+ <xfc.version>6.4.0-SNAPSHOT</xfc.version> |
|
483 |
+ <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version> |
|
484 |
+ <maven-assembly-plugin.version>3.2.0</maven-assembly-plugin.version> |
|
485 |
+ </properties> |
483 |
483 |
|
484 |
|
- <build> |
485 |
|
- <plugins> |
|
487 |
+ <build> |
|
488 |
+ <plugins> |
486 |
486 |
|
487 |
|
- <!-- If using the maven-jar-plugin --> |
488 |
|
- <plugin> |
489 |
|
- <groupId>org.apache.maven.plugins</groupId> |
490 |
|
- <artifactId>maven-jar-plugin</artifactId> |
491 |
|
- <version>${maven-jar-plugin.version}</version> |
492 |
|
- <configuration> |
493 |
|
- <outputDirectory>${basedir}</outputDirectory> |
494 |
|
- <finalName>${project.artifactId}</finalName> |
495 |
|
- <archive> |
496 |
|
- <manifest> |
497 |
|
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries> |
498 |
|
- </manifest> |
499 |
|
- <manifestEntries> |
500 |
|
- <formcycle-version-requirement>${xfc.version}</formcycle-version-requirement> |
501 |
|
- <Implementation-Title>${project.groupId}:${project.artifactId}</Implementation-Title> |
502 |
|
- <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id> |
503 |
|
- <Implementation-Version>${project.version}</Implementation-Version> |
504 |
|
- <Build-Timestamp>${maven.build.timestamp}</Build-Timestamp> |
505 |
|
- </manifestEntries> |
506 |
|
- </archive> |
507 |
|
- </configuration> |
508 |
|
- </plugin> |
|
490 |
+ <!-- If using the maven-jar-plugin --> |
|
491 |
+ <plugin> |
|
492 |
+ <groupId>org.apache.maven.plugins</groupId> |
|
493 |
+ <artifactId>maven-jar-plugin</artifactId> |
|
494 |
+ <version>${maven-jar-plugin.version}</version> |
|
495 |
+ <configuration> |
|
496 |
+ <outputDirectory>${basedir}</outputDirectory> |
|
497 |
+ <finalName>${project.artifactId}</finalName> |
|
498 |
+ <archive> |
|
499 |
+ <manifest> |
|
500 |
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries> |
|
501 |
+ </manifest> |
|
502 |
+ <manifestEntries> |
|
503 |
+ <formcycle-version-requirement>${xfc.version}</formcycle-version-requirement> |
|
504 |
+ <Implementation-Title>${project.groupId}:${project.artifactId}</Implementation-Title> |
|
505 |
+ <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id> |
|
506 |
+ <Implementation-Version>${project.version}</Implementation-Version> |
|
507 |
+ <Build-Timestamp>${maven.build.timestamp}</Build-Timestamp> |
|
508 |
+ </manifestEntries> |
|
509 |
+ </archive> |
|
510 |
+ </configuration> |
|
511 |
+ </plugin> |
509 |
509 |
|
510 |
510 |
<!-- If using the maven-assembly-plugin --> |
511 |
|
- <plugin> |
512 |
|
- <groupId>org.apache.maven.plugins</groupId> |
513 |
|
- <artifactId>maven-assembly-plugin</artifactId> |
514 |
|
- <version>${maven-assembly-plugin.version}</version> |
515 |
|
- <executions> |
516 |
|
- <execution> |
517 |
|
- <id>fat-jar</id> |
518 |
|
- <phase>package</phase> |
519 |
|
- <goals> |
520 |
|
- <goal>single</goal> |
521 |
|
- </goals> |
522 |
|
- <configuration> |
523 |
|
- <outputDirectory>${basedir}</outputDirectory> |
524 |
|
- <finalName>${project.artifactId}</finalName> |
525 |
|
- <descriptorRefs> |
526 |
|
- <descriptorRef>jar-with-dependencies</descriptorRef> |
527 |
|
- </descriptorRefs> |
528 |
|
- <appendAssemblyId>false</appendAssemblyId> |
529 |
|
- <archive> |
530 |
|
- <manifestEntries> |
531 |
|
- <Build-Timestamp>${maven.build.timestamp}</Build-Timestamp> |
532 |
|
- <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id> |
533 |
|
- <Implementation-Title>${project.groupId}:${project.artifactId}</Implementation-Title> |
534 |
|
- <Implementation-Version>${project.version}</Implementation-Version> |
535 |
|
- <formcycle-version-requirement>${xfc.version}</formcycle-version-requirement> |
536 |
|
- </manifestEntries> |
537 |
|
- </archive> |
538 |
|
- </configuration> |
539 |
|
- </execution> |
540 |
|
- </executions> |
541 |
|
- </plugin> |
|
514 |
+ <plugin> |
|
515 |
+ <groupId>org.apache.maven.plugins</groupId> |
|
516 |
+ <artifactId>maven-assembly-plugin</artifactId> |
|
517 |
+ <version>${maven-assembly-plugin.version}</version> |
|
518 |
+ <executions> |
|
519 |
+ <execution> |
|
520 |
+ <id>fat-jar</id> |
|
521 |
+ <phase>package</phase> |
|
522 |
+ <goals> |
|
523 |
+ <goal>single</goal> |
|
524 |
+ </goals> |
|
525 |
+ <configuration> |
|
526 |
+ <outputDirectory>${basedir}</outputDirectory> |
|
527 |
+ <finalName>${project.artifactId}</finalName> |
|
528 |
+ <descriptorRefs> |
|
529 |
+ <descriptorRef>jar-with-dependencies</descriptorRef> |
|
530 |
+ </descriptorRefs> |
|
531 |
+ <appendAssemblyId>false</appendAssemblyId> |
|
532 |
+ <archive> |
|
533 |
+ <manifestEntries> |
|
534 |
+ <Build-Timestamp>${maven.build.timestamp}</Build-Timestamp> |
|
535 |
+ <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id> |
|
536 |
+ <Implementation-Title>${project.groupId}:${project.artifactId}</Implementation-Title> |
|
537 |
+ <Implementation-Version>${project.version}</Implementation-Version> |
|
538 |
+ <formcycle-version-requirement>${xfc.version}</formcycle-version-requirement> |
|
539 |
+ </manifestEntries> |
|
540 |
+ </archive> |
|
541 |
+ </configuration> |
|
542 |
+ </execution> |
|
543 |
+ </executions> |
|
544 |
+ </plugin> |
542 |
542 |
|
543 |
|
- </plugins> |
544 |
|
- </build> |
|
546 |
+ </plugins> |
|
547 |
+ </build> |
545 |
545 |
{{/code}} |
546 |
546 |
|
547 |
547 |
Nun kann das Plugin über Maven gebaut und hochgeladen werden. Die URL auf FORMCYCLE, die Mandant-ID und das Token (Passwort) wird dynamisch über Parameter an Maven übergeben: |