Plugin samples
Introduction
This document will explain how a developer can add samples to the plugins in the source code so that they will end up in the
project in the Hop client distribution assembly.samples
The Samples project
The
project in the Hop distribution is located in the config/projects/samples folder. Its parent is the samples
project. This means that it’s not needed to add any metadata objects (like run configurations) to the default
projects that are already present in the samples
project.default
Plugin samples
If a plugin places a
folder under the samples/
folder its content will be picked up and copied over the src/main/
project folder. The content will end up exactly in the same folder structure. A few examples:samples
Source | Target |
---|---|
|
|
|
|
As you can see it’s easy to add extra metadata simply by putting it in the
folder under your samples/ folder in the plugin. The same goes for test data metadata/
and so on.datasets
Standard project content
If you have metadata objects, sample input files data sets or files that you might want to make available for all plugins, please add them to the following place in the source code:
assemblies/static/src/main/resources/config/projects/samples
Naming standard
When naming samples and folders please stick to the following basic rules:
-
The filenames start with the name of the transform, action or plugin
-
All lowercase
-
No spaces in the filename or underscores: use dashes (-)
-
Put plugins in the right folders: transform samples to in transforms/, action samples go in actions/ and so on. Keep things clean.
-
If you need to add input files for your sample put them in a files/ sub-folder like
transforms/files
-
Please use our best practices guide to create the examples.
-
Create notes in pipelines and workflows explaining what happens. Make the note font large enough: 11 or higher.
Set the HOP_LICENSE_HEADER_FILE
project variable
All files that are shipped with Apache software need to contain the Apache Software Foundation’s header.
This also applies to all workflows and pipelines that are shipped as integration tests, samples or in any other form.
To spare contributors the pain of manually having to add the ASF license header in workflows and pipeline, Hop Gui supports the HOP_LICENSE_HEADER_FILE
project variable.
Set this variable in your project and point it to a file containing the ASF Header’s text, e.g. integration-tests/asf-header.txt
to let Hop include the ASF header in all of your workflows and pipelines.
As with any other piece of code, run mvn apache-rat:check
to verify all files contain the correct headers before contributing your test or sample workflows and pipelines.