Plugin Examples

Last Updated: Sep 29, 2023
documentation for the dotCMS Content Management System

A number of “seed” plugins are provided in the plugin-seeds repo in the corporate dotCMS Github repository. These examples provide example code to create the most common types of plugins for dotCMS and show the breadth of what you can do with dotCMS plugins.

For more information on each of these seed examples, including configuration or additional installation steps beyond the Installation section below, please see the plugin's individual documentation.

Additionally, dotCMS has a github repo dedicated to various working plugin examples. This is a good source of information and most provide concrete functionality that is easy to replicate and understand.

⚠️ Note: All example plugins are presented as just that — examples. Plugins, even those that are developed by dotCMS, live outside of the dotCMS core system and are not supported by dotCMS without an additional OSGi support engagement. dotCMS Plugins are made available as examples; are not guaranteed to work; and are updated “lazily”, or as needed, by dotCMS staff.

General Installation

Begin by cloning the relevant plugin repository. For example, let's use the OWASP Encoder repo. Next, run the gradle scripts to constitute the .jar files: gradlew jar. The results will appear within in the local clone under /build/libs.

Note: Your IDE of choice may have a plugin, such as IntelliJ's Gradle Tool or Eclipse's Gradle Integration, to assist behind the scenes with some of the minutiae of Gradle wrapper scripts, automatically handling certain hitches. If you find yourself encountering errors when building the project through your local terminal, attempting the build via these tools may prove the quickest solution.

Upload and deploy the resultant JAR file — in this case com.dotcms.owasp.encoder-0.2.jar — via the admin panel under Dev Tools → Plugins.

Dev Tools Plugins pane with Upload button highlighted.

Alternately, you can load the JAR file headlessly through an API call; simply POST to the /api/osgi endpoint, such as in the example below:

curl -X POST -u admin@dotcms.com:admin -H "Content-Type: multipart/form-data" -F "file=@/com.dotcms.owasp.encoder-0.2.jar" https://demo.dotcms.com/api/osgi

dotCMS Provided Examples

Documentation

On this page

×

We Dig Feedback

Selected excerpt:

×