Änderungen von Dokument Plugin-Entwicklung


Von Version 3.1
bearbeitet von awa
am 25.02.2022, 11:37
Änderungskommentar: settings.xml
Auf Version 1.1
bearbeitet von gru
am 20.01.2021, 16:18
Änderungskommentar: Imported from XAR

Zusammenfassung

Details

Seiteneigenschaften
Dokument-Autor
... ... @@ -1,1 +1,1 @@
1 -XWiki.awa
1 +XWiki.gru
Inhalt
... ... @@ -10,80 +10,85 @@
10 10  
11 11  == Projekt-Setup ==
12 12  
13 -Zu Beginn der Entwicklung eines Plugins ist es nötig das entsprechende Entwicklungsprojekt aufzusetzten und zu konfigurieren.
13 +Zu Beginn der Entwicklung eines Plugins ist es nötig das entsprechende Entwicklungsprojekt aufzusetzten und zu konfigurieren. Für letzteres kommt hierbei das Build-Management-Tool [[Apache Maven>>url:https://maven.apache.org/||rel="__blank"]] zum Einsatz. Um die entsprechenden Abhängigkeiten zu {{formcycle case="dat"/}} bereitzustellen ist ein Repository unter der URL [[https:~~/~~/artifactory.xima-services.de/artifactory/fc-plugin-dev>>url:https://artifactory.xima-services.de/artifactory/fc-plugin-dev]] zu benutzen. Dieses beinhaltet alle öffentlich zur Verfügung stehenden Artefakte welche dem Plugin zur Laufzeit bereitgestellt und während der Entwicklung benötigt werden. Augangspunkt ist hierbei das Artefakt //fc-plugin-common//, welches die einzelnen Plugin-Schnittstellen beinhaltet und auch auf [[unserere Downloadseite zur Verfügung steht>>url:http://artifactory.xima-services.de/artifactory/fc-plugin-dev/de/xima/fc/fc-plugin-common/]]. Ein Auszug des Project Object Models (pom.xml) sieht dem entsprechend beispielhaft wie folgt aus:
14 14  
15 -Für letzteres empfehlen wir hierbei das Build-Management-Tool [[Apache Maven>>url:https://maven.apache.org/||rel="__blank"]] zum Einsatz. Andere Build-Tools können prinzipiell benutzt werden, hier können wir aber keine Hilfe bereitstellen.
15 +{{panel title="Beispiel für pom.xml" initial="hidden" triggerable="true" fullwidth="true"}}
16 +{{code language="xml"}}
17 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
16 16  
17 -Um die entsprechenden Abhängigkeiten zu {{formcycle case="dat"/}} bereitzustellen, ist das Repository unter der URL [[https:~~/~~/artifactory.xima-services.de/artifactory/fc-plugin-dev>>url:https://artifactory.xima-services.de/artifactory/fc-plugin-dev]] zu benutzen. Dieses enthält alle öffentlich zur Verfügung stehenden Artefakte, welche dem Plugin zur Laufzeit bereitgestellt und während der Entwicklung benötigt werden. Ausgangspunkt ist hierbei das Artefakt //fc-plugin-common//, welches die einzelnen Plugin-Schnittstellen beinhaltet und auch auf [[unserere Downloadseite zur Verfügung steht>>url:http://artifactory.xima-services.de/artifactory/fc-plugin-dev/de/xima/fc/fc-plugin-common/]].
20 +...
18 18  
19 -Damit das Repository auch beim Bauen mit Maven verwendet wird, sollte folgendes in die Maven-Konfigurationsdatei //settings.xml// geschrieben werden. Diese Datei findet sich in der Regeln im //.m2//-Ordner im Home-Verzeichnis des aktuellen Nutzers. Unter Linux //~/.m2/settings.xml// und unter Windows //%homepath%\.m2\settings.xml//:
22 + <properties>
23 + <!-- Configuration -->
24 + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
20 20  
21 -{{panel title="~/.m2/settings.xml" fullwidth="true" initial="hidden" triggerable="true"}}
22 -{{code language="xml"}}
23 -<?xml version="1.0" encoding="UTF-8"?>
24 -<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
25 - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
26 + <!-- Dependencies -->
27 + <xfc.version>6.0.0</xfc.version>
26 26  
27 - <!-- Add XIMA artifactory -->
28 - <profiles>
29 - <profile>
30 - <repositories>
31 - <repository>
32 - <snapshots>
33 - <enabled>false</enabled>
34 - </snapshots>
35 - <id>xima</id>
36 - <name>libs-release</name>
37 - <url>https://artifactory.xima-services.de/artifactory/fc-plugin-dev</url>
38 - </repository>
39 - </repositories>
40 - <pluginRepositories>
41 - <pluginRepository>
42 - <snapshots>
43 - <enabled>false</enabled>
44 - </snapshots>
45 - <id>xima</id>
46 - <name>plugins-release</name>
47 - <url>https://artifactory.xima-services.de/artifactory/fc-plugin-dev</url>
48 - </pluginRepository>
49 - </pluginRepositories>
50 - <id>xima-artifactory</id>
51 - </profile>
52 - </profiles>
29 + <!-- Plugins -->
30 + <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
31 + <maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
32 + </properties>
53 53  
54 - <!-- Enable XIMA artifactory by default -->
55 - <activeProfiles>
56 - <activeProfile>xima-artifactory</activeProfile>
57 - </activeProfiles>
34 + <repositories>
35 + <repository>
36 + <id>xima</id>
37 + <name>fc-plugin-dev</name>
38 + <url>https://artifactory.xima-services.de/artifactory/fc-plugin-dev</url>
39 + </repository>
40 + </repositories>
58 58  
59 - <!-- FORMCYCLE specific Maven plugins provided by XIMA -->
60 - <pluginGroups>
61 - <pluginGroup>de.xima.fc.maven.plugin</pluginGroup>
62 - </pluginGroups>
63 -</settings>
64 -{{/code}}
65 -{{/panel}}
42 + <dependencies>
43 + <dependency>
44 + <groupId>de.xima.fc</groupId>
45 + <artifactId>fc-plugin-common</artifactId>
46 + <version>${xfc.version}</version>
47 + <scope>provided</scope>
48 + </dependency>
49 + </dependencies>
66 66  
67 -In der //pom.xml// des Plugin-Projekts kann die Abhängigkeit dann wie folgt eingebunden werden:
51 + <build>
52 + <plugins>
53 + <plugin>
54 + <groupId>org.apache.maven.plugins</groupId>
55 + <artifactId>maven-compiler-plugin</artifactId>
56 + <version>${maven-compiler-plugin.version}</version>
57 + <configuration>
58 + <source>1.8</source>
59 + <target>1.8</target>
60 + <encoding>UTF-8</encoding>
61 + </configuration>
62 + </plugin>
68 68  
69 -{{code language="xml"}}
70 - <properties>
71 - <xfc.version>7.0.10</xfc.version>
72 - </properties>
64 + <plugin>
65 + <groupId>org.apache.maven.plugins</groupId>
66 + <artifactId>maven-jar-plugin</artifactId>
67 + <version>${maven-jar-plugin.version}</version>
68 + <configuration>
69 + <archive>
70 + <manifest>
71 + <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
72 + </manifest>
73 + <manifestEntries>
74 + <formcycle-version-requirement>${xfc.version}</formcycle-version-requirement>
75 + <Build-Time>${maven.build.timestamp}</Build-Time>
76 + </manifestEntries>
77 + </archive>
78 + </configuration>
79 + </plugin>
73 73  
74 - <dependencies>
75 - <dependency>
76 - <groupId>de.xima.fc</groupId>
77 - <artifactId>fc-plugin-common</artifactId>
78 - <version>${xfc.version}</version>
79 - <scope>provided</scope>
80 - </dependency>
81 - </dependencies>
81 + </plugins>
82 + </build>
83 +</project>
84 +
82 82  {{/code}}
86 +{{/panel}}
83 83  
84 84  Ferner steht je nach Tiefe der Integration in die bestehende Umgebung von {{formcycle case="dat"/}} und dessen Benutzung als höchste Implementierung das Artefakt //fc-logic// zur Verfügung. Dieses wird wie folgt als weitere (oder einzige) Abhängigkeit definiert:
85 85  
86 86  {{code language="xml"}}
91 +...
87 87   <dependency>
88 88   <groupId>de.xima.fc</groupId>
89 89   <artifactId>fc-logic</artifactId>
... ... @@ -90,6 +90,7 @@
90 90   <version>${xfc.version}</version>
91 91   <scope>provided</scope>
92 92   </dependency>
98 +...
93 93  {{/code}}
94 94  
95 95  Eine entsprechende Benutzung ist vor allem bei der Verwendung der Datenbankschnittstelle sowie bei der Implementierung von eigenen Verarbeitungen nötig. Eine Vorlage für ein somit entstehendes Project Object Model finden Sie [[hier>>attach:pom.xml||rel="__blank"]].
... ... @@ -102,8 +102,6 @@
102 102  
103 103  Basierend auf der hiermit zur Verfügung stehenden Infrastruktur steht der Entwicklung von eigenen Plugin-Implementierungen nichts mehr im Wege. Die Installation erfolgt anschließend je nach Verwendungszweck über die Oberflächen [[Mandant-Plugins>>doc:Formcycle.UserInterface.Client.Plugins]] oder [[System-Plugins>>doc:Formcycle.SystemSettings.UserInterface.SystemPlugins]].
104 104  
105 -== Archetypes ==
111 +== Demo-Plugins ==
106 106  
107 -TODO
108 -
109 -Um einen besseren Einstieg in die Plugin-Entwicklung zu finden, [[bieten wir auf unserer Downloadseite>>url:https://customer.formcycle.eu/index.php/s/PgdMrNOvbYEzhmr]]
113 +Um einen besseren Einstieg in die Plugin-Entwicklung zu finden, [[bieten wir auf unserer Downloadseite>>url:https://customer.formcycle.eu/index.php/s/PgdMrNOvbYEzhmr]] auch für jeden Plugintyp ein kommentiertes Demo-Maven-Projekt an. Sie können diese herunterladen und in der Entwicklungsumgebung ihrer Wahl einsehen und kompilieren.
pom.xml
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.rth
1 +XWiki.ximaadmin
Größe
... ... @@ -1,1 +1,1 @@
1 -2.2 KB
1 +2.1 KB
Inhalt
... ... @@ -14,11 +14,11 @@
14 14   <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15 15  
16 16   <!-- Dependencies -->
17 - <xfc-version>7.0.9</xfc-version>
17 + <xfc-version>4.2.3</xfc-version>
18 18  
19 19   <!-- Plugins -->
20 - <maven-compiler-plugin-version>3.8.1</maven-compiler-plugin-version>
21 - <maven-jar-plugin-version>3.1.0</maven-jar-plugin-version>
20 + <maven-compiler-plugin-version>3.3</maven-compiler-plugin-version>
21 + <maven-jar-plugin-version>2.4</maven-jar-plugin-version>
22 22   </properties>
23 23  
24 24   <repositories>
... ... @@ -52,7 +52,8 @@
52 52   <artifactId>maven-compiler-plugin</artifactId>
53 53   <version>${maven-compiler-plugin-version}</version>
54 54   <configuration>
55 - <release>11</release>
55 + <source>1.7</source>
56 + <target>1.7</target>
56 56   <encoding>UTF-8</encoding>
57 57   <showDeprecation>true</showDeprecation>
58 58   <showWarnings>true</showWarnings>
... ... @@ -77,3 +77,5 @@
77 77   </plugins>
78 78   </build>
79 79  </project>
81 +
82 +