Von Version < 1.25 >
bearbeitet von awa
am 12.03.2020, 13:47
Auf Version < 1.21 >
bearbeitet von awa
am 12.03.2020, 13:30
< >
Änderungskommentar: Es gibt keinen Kommentar für diese Version

Zusammenfassung

Details

Seiteneigenschaften
Titel
... ... @@ -1,1 +1,1 @@
1 -FORMCYCLE-Deploy-Plugin-Plugin
1 +FORMCYCLE-Deploy-Plugin
Inhalt
... ... @@ -1,5 +3,3 @@
1 -Hinweis zum Name: Es ist ein Plugin zum Deployen von Plugins in FORMCYCLE, daher //FORMCYCLE-Deploy-Plugin-Plugin//.
2 -
3 3  {{content/}}
4 4  
5 5  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:
... ... @@ -176,7 +176,6 @@
176 176  
177 177  ; update-properties
178 178  : 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 -
180 180  (((
181 181  {{code language="bash"}}
182 182  # Löscht alle vorhandenen Plugin-Eigenschaften und setzt dann die Eigenschaft "foo" auf den Wert "bar"
... ... @@ -300,24 +300,24 @@
300 300  
301 301  {{code language="json"}}
302 302  {
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
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
321 321  }
322 322  {{/code}}
323 323  
... ... @@ -325,21 +325,21 @@
325 325  
326 326  {{code language="json"}}
327 327  {
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
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
343 343  }
344 344  {{/code}}
345 345  
... ... @@ -361,18 +361,18 @@
361 361  
362 362  {{code language="json"}}
363 363  {
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
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
376 376  }
377 377  {{/code}}
378 378  
... ... @@ -380,8 +380,6 @@
380 380  
381 381  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:
382 382  
383 -=== Konfiguration ===
384 -
385 385  {{code language="xml"}}
386 386  <plugin>
387 387   <groupId>de.xima.fc.maven.plugin</groupId>
... ... @@ -410,13 +410,13 @@
410 410  Das Plugin hat die folgenden Optionen zur Konfiguration:
411 411  
412 412  ; url [Standardwert: //${fcDeployUrl}//]
413 -: URL mit Kontextpfad zum FORMCYCLE-Server, etwa //{{{http://localhost:8080/formcycle}}}//
408 +: URL mit Kontextpfad zum FORMCYCLE-Server, etwa {{{//http://localhost:8080/formcycle//}}}
414 414  ; pluginName [Standardwert: //deploy-plugin//]
415 415  : Der Name des Deploy-Plugins für den URL-Parameter //name//. In der Regel muss diese Option nicht gesetzt werden, der Standardwert ist ausreichend.
416 416  ; clientId [Standardwert: //${fcDeployClientId}//]
417 417  : ID des Mandanten, für den das Plugin installiert, aktualisiert oder gelöscht werden soll. Entspricht dem Parameter //client-id// des Deploy-Plugins, siehe oben.
418 418  ; clientUuid
419 -: Alternative zu //clientID//. UUID des Mandanten, für den das Plugin installiert, aktualisiert oder gelöscht werden soll. Entspricht dem Parameter //client-uuid// des Deploy-Plugins, siehe oben.
414 +: UUID des Mandanten, für den das Plugin installiert, aktualisiert oder gelöscht werden soll. Entspricht dem Parameter //client-uuid// des Deploy-Plugins, siehe oben.
420 420  ; token [Standardwert: //${fcDeployToken}//]
421 421  : Passwort für das Servlet-Plugin, falls in der Konfiguration des Deploy-Plugins ein Passwort gesetzt wurde.
422 422  ; deployAction [Standardwert: //save//]
... ... @@ -435,122 +435,3 @@
435 435  : Löscht die Werte aller Plugin-Eigenschaften. Entspricht dem Parameter //clear-properties// des Deploy-Plugins, siehe oben.
436 436  ; properties
437 437  : Key-Value-Paare mit Eigenschaften, die an dem Plugin gesetzt werden sollen. Entspricht dem Parameter //clear-properties// des Deploy-Plugins, siehe oben.
438 -
439 -=== Empfehlung für Plugin-Projekt ===
440 -
441 -Während das Plugin zahlreiche Einstellunsgmöglichkeiten anbietet, reichen meist die Standardwerte aus. Empfohlen wird das folgende Vorgehen bei der Entwicklung von Plugin-Projekten.
442 -
443 -Folgendes Schnippsel sollte in der Profil-Sektion der //pom.xml// eingefügt werden:
444 -
445 -{{code language="xml"}}
446 - <properties>
447 - <fc-deploy-plugin-maven-plugin.version>1.1.0</fc-deploy-plugin-maven-plugin.version>
448 - </properties>
449 -
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>
476 -{{/code}}
477 -
478 -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:
479 -
480 -{{code language="xml"}}
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>
486 -
487 - <build>
488 - <plugins>
489 -
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>
512 -
513 - <!-- If using the maven-assembly-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>
545 -
546 - </plugins>
547 - </build>
548 -{{/code}}
549 -
550 -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:
551 -
552 -{{code language="bash"}}
553 -mvn clean install -DfcDeployUrl="http://localhost:8080/xima-formcycle" -DfcDeployClientId="1" -DfcDeployToken="admin"
554 -{{/code}}
555 -
556 -Hinweis: IDE wie Eclipse und IntelliJ erlauben es, eine Build-Konfiguration für das Plugin-Projekt zu erstellen, wo die Parameter //fcDeployUrl//, //fcDeployClientId// und //fcDeployToken// hinterlegt werden können.
Copyright 2000-2025