Skip to content

Plugin Development with OPM Packages

In this section, you will learn how to create, install, and distribute your own plugins as OPM packages for Znuny.

Section titled “In this section, you will learn how to create, install, and distribute your own plugins as OPM packages for Znuny.”

The SOPM file (*.sopm) contains all metadata for your package: `.sopm“

  • Name/Version/Framework: Unique package identifier and compatible Znuny version.
  • Filelist: All files that are copied during installation.

Create your package in its own directory, e.g., MyExtension/: *.sopm

  • Kernel/Config/Files/XML/: Registers modules, menus, or Dynamic Fields.
  • Kernel/System/: Business logic class.
  • Kernel/Modules/: Frontend controller.
  • Templates & Language: TT files + translation .pm.

Use the CLI tool to build an OPM from your SOPM: MyExtension/

Admin UI: Upload package under Admin → Settings → Package Manager. Console: Kernel/Config/Files/XML/MyExtension.xml To uninstall or update: Kernel/System/DynamicField/Driver/MyCustomField.pm

Section titled “Admin UI: Upload package under Admin → Settings → Package Manager. Console: Kernel/Config/Files/XML/MyExtension.xml To uninstall or update: Kernel/System/DynamicField/Driver/MyCustomField.pm”

In Kernel/Config/Files/XML/MyExtension.xml, you register a new Dynamic Field Driver: Kernel/System/Event/Handler/MyHandler.pm Implement the driver in Kernel/System/DynamicField/Driver/MyCustomField.pm.

Register your event handler: Run() Implement the handler in Kernel/System/Event/Handler/MyHandler.pm (Run() method).

Kernel/System/Output/Filter/MyFilter.pm Implement the filter in Kernel/System/Output/Filter/MyFilter.pm.

Section titled “Kernel/System/Output/Filter/MyFilter.pm Implement the filter in Kernel/System/Output/Filter/MyFilter.pm.”
  • Repository Index: Create Packages.xml for your own repo: Packages.xml
  • Add your repo URL under SysConfig Package::RepositoryList.
  • OTOpar: Upload your OPM to https://otopar.perl-services.de so that others can install it directly.

  1. Create SOPM with the name MyCalendar.
  2. DB script sql/create_calendar.sql for table calendar_events.
  3. Config XML defines new ticket field “Appointment”.
  4. Core module Kernel/System/CalendarEvent.pm with CRUD methods.
  5. Frontend modules Kernel/Modules/AgentCalendar.pm, template AgentCalendar.tt.
  6. Build package and upload to OTOpar.

  • Adjust version number in the sopm (SemVer).
  • Version DB migrations in sql/ cleanly.
  • Create unit tests for system and module classes.
  • Documentation in README plus POD in Perl modules.
  • Translations in Language/de_*.pm and en_*.pm. With this, you have a solid foundation to develop, distribute, and maintain your own Znuny plugins in customer projects. Have fun!