User Tools

Site Tools


05_developer_tutorials:dev-guide:add-content-registry-descriptor

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
05_developer_tutorials:dev-guide:add-content-registry-descriptor [2025/02/19 15:51] – removed - external edit (Unknown date) 127.0.0.105_developer_tutorials:dev-guide:add-content-registry-descriptor [2025/02/19 15:51] (current) – ↷ Page moved from 04_developer_documentation:dev-guide:add-content-registry-descriptor to 05_developer_tutorials:dev-guide:add-content-registry-descriptor gaetan
Line 1: Line 1:
 +GroIMP load doclet.xml files on startup that contains description of methods and classes. 
  
 +==== Access Descriptor files in runtime ====
 +
 +The loaded content is added in the runtime registry under ''/plugins/statics''. This directory should have the three directories: ''methods'', ''fields'', and ''classes''. The java objects used are [[https://javadoc.grogra.de/platform.core/de/grogra/pf/registry/ContentDescriptionType.html|ContentDescriptionType]]
 +
 +==== Generating a doclet xml file ==== 
 +
 +The doclets files are automatically created with the maven build of a project, if it contains the following information:
 +  * List of files to includes
 +  * Plugin execution in pom
 +
 +Both steps are defined in the pom.xml file of your project. They are added in the <build> section.
 +
 +=== Add files to be included ===
 +
 +The included files are moved from the source code to the correct repository by maven with the plugin:
 +
 +<code xml>
 +<plugin>
 + <artifactId>maven-resources-plugin</artifactId>
 + <version>3.0.2</version>
 + <executions>
 + <execution>
 + <id>copy-class-for-xmldoc</id>
 + <phase>generate-sources</phase>
 + <goals>
 + <goal>copy-resources</goal>
 + </goals>
 + <configuration>
 + <outputDirectory>${basedir}/target/source-xmldoc/de/grogra</outputDirectory>
 + <resources>
 + <resource>
 + <directory>src/main/java/de/grogra</directory>
 + <includes>
 + <include>rgg/Library.java</include>
 +                                                        
 +                                                        ...
 +                                                        
 +                                                        <include> OTHER FILES </includes>
 +                                                        
 +                                                        ...
 +                                                        
 +                                                <includes>
 + </resource>
 + </resources>
 + </configuration>
 + </execution>
 + <execution>
 + <id>move-xmldoc</id>
 + <phase>prepare-package</phase>
 + <goals>
 + <goal>copy-resources</goal>
 + </goals>
 + <configuration>
 + <outputDirectory>${basedir}/target/classes/xmldoc</outputDirectory>
 + <resources>
 + <resource>
 + <directory>${basedir}/target/site/apidocs/xmldoc</directory>
 + <includes>
 + <include>doclet.xml</include>
 + </includes>
 + </resource>
 + </resources>
 + </configuration>
 + </execution>
 + </executions>
 +</plugin>
 +</code>
 +
 +=== Declare the plugin execution ===
 +
 +This do not need to be modified:
 +
 +<code xml>
 +
 +<plugin>
 + <groupId>org.apache.maven.plugins</groupId>
 + <artifactId>maven-javadoc-plugin</artifactId>
 +        <configuration>
 +          <doclet>com.saxonica.xmldoclet.XmlDoclet</doclet>
 +          <useStandardDocletOptions>false</useStandardDocletOptions>
 +          <docletArtifacts>
 +     <docletArtifact>
 + <groupId>com.saxonica</groupId>
 + <artifactId>xmldoclet</artifactId>
 + <version>0.4.0</version>
 +     </docletArtifact>
 +   <docletArtifact>
 + <groupId>com.github.javaparser</groupId>
 + <artifactId>javaparser-core</artifactId>
 +        <version>3.25.4</version>
 +     </docletArtifact>
 +          </docletArtifacts>
 +          <doclint>none</doclint>
 + <destDir>xmldoc</destDir>
 + <overview></overview>
 + <sourcepath>${basedir}/target/source-xmldoc</sourcepath>
 + <additionalDependencies>
 + <additionalDependency>
 + <groupId>${project.groupId}</groupId>
 + <artifactId>${project.artifactId}</artifactId>
 + <version>${project.version}</version>
 + </additionalDependency>
 + </additionalDependencies>
 +      </configuration>
 + <executions>
 + <execution>
 + <id>generate-xml-doclet</id>
 + <phase>process-classes</phase>
 + <goals>
 + <goal>javadoc</goal>
 + </goals>
 + </execution>
 + </executions>
 +</plugin>
 +      
 +</code>
 +
 +=== Complete pom file example ===
 +
 +Look at the RGG plugin pom.xml file.