To create and commit a DTK plugin:A DTK plugin is created and committed by following these steps:
- For agent plugins, create a Configuration Contract, see Configuration Contract for further information about the contents of the configuration contract. For other types of plugins, skip this step.
For agent plugins, generate a Java file from your configuration contract:
Code Block > java -classpath $CLASSPATH com.digitalroute.devkit.tools.ContractGen \ -d . -f MyAgentConfigContract.xml
For other types of plugins, skip this step.
- Create the different Java files required for the type of plugin you want to create. See the chapters describing each plugin for further information.
Note You are required to delete the existing generated code from 8 to avoid duplication error when generating a new one in 9.title Note! Compile all the Java files for your plugin into classes:
Code Block > javac -classpath $CLASSPATH com/mycompany/myagent/*.java
Note title Note! Do It is strongly recommended that the Java code does not use the default package context in the Java code. . All classes in must in must have unique names.
- Create a user defined *.jar file containing the classes, see the section below, Creating a User Defined Jar File.
- Create a user defined *.mzp package containing the *.jar file, see the section below, Creating a User Defined Package.
- Commit your user defined package, see the section below, Committing a User Defined Package.
- If you want to have user documentation for your agent plugin, create the documentation, wrap it into a user defined package and commit the package. See 16. Documentation for Agent Plugins for information about how to create and implement the help content.
Creating a User Defined Jar
For more information, refer to the same section in Creating a DTK Plugin.
Creating a User Defined Package
For more information, refer to the same section in Creating a DTK Plugin.
Committing a User Defined Package
For On-Premise, Non-Containerized environment:
New or updated code is inserted into the system using the mzsh Command Line Tool:
Code Block |
---|
> mzsh username/password pcommit my_agent.mzp |
For Containerized Environment (AWS or private container):
Before committing any user defined packages, your containerized environment needs to have been configured so that the /opt/mz/codeserver-dtk folder is mounted to a persistent storage.
An example configuration for this is provided. Look for the lines "# uncomment in order to load development toolkits from persistent storage" in the following config files:
- mzhome-pvc.yaml
- platform-statefulset.yaml
Example of configs can be download from Release Notes 8.1.
This is a one time configuration. Once done, any user defined package can be committed as per the instructions below.
Transfer the file to the kubernetes container and restart the pod.
Code Block |
---|
> kubectl cp my_agent.mzp delivery/platform-0:/opt/mz/codeserver-dtk/packages/active
> kubectl delete pod platform-0 |