ZenPack Standards

From Zenoss Wiki
This is the approved revision of this page, as well as being the most recent.
Jump to: navigation, search

This document describes all requirements and recommendations for ZenPack development. The intended audience is all Zenoss, Inc. employees who create or modify ZenPacks including engineering, services and support. The intended audience also includes any third-parties that create or modify ZenPacks that are delivered to Zenoss customers by Zenoss, Inc.



Assumptions


Some assumptions are made in this document regarding access to test facilities.


Product Inclusion

ZenPacks must always be developed with the understanding that the potential exists for them to become part of the product. Even in cases were ownership of the ZenPack does not rest with Zenoss this must be observed because ownership can change in the future. For this reason, special attention must be paid to document the inclusion of any sensitive company data in ZenPacks.



Access to Test Environment

In cases where the ZenPack developer(s) do not have access to endpoints necessary for integration and testing work some standard operating procedures must be suspended.



File Locations

The location of specific files within a ZenPack’s directory structure is technically mandated in some circumstances, and open to the developer’s desires in others. To make it easier for other developers to more easily get up to speed with the ZenPack in the future, the following recommendations for file locations should be used.




ZenPacks.<namespace.PackName>/
ZenPacks.<namespace.PackName>/ZenPacks/namespace/PackName/
browser/
configure.zcml All ZCML definitions related to defining browser views or wiring browser-only concerns. This configure.zcml should be included by the default configure.zcml in its parent directory.


resources/
css/ - All stylesheets loaded by users’ browsers.
img/ - All images loaded by users’ browsers.
js/ - All javascript loaded by users’ browser.
lib/ Any third-party modules included with the ZenPack should be located in this directory. In the case of pure-Python modules they can be located directly here. In the case of binary modules the build process must install them here. See the section of License Compliance below for more information on how to properly handle third-party content.
libexec/
Any scripts intended to be run by the zencommand daemon must be located in this directory.


objects/
There should only ever be a single file called objects.xml in this directory. While the ZenPack installation code will load objects from any file in this directory with a .xml extension, the ZenPack export code will dump all objects back to objects.xml so creating other files only creates future confusion between installation and export.
facades.py
All facades (classes implementing Products.Zuul.interfaces.IFacade) should be defined in this file. In ZenPacks where this single file becomes hard to maintain, a facades/ directory should be created containing individual files named for the group of facades they contain.
info.py
All info adapters (classes implementing Products.Zuul.interfaces.IInfo) should be defined in this file. In ZenPacks where this single file becomes hard to maintain, an info/ directory should be created containing individual files named for the group of info adapters they contain.


interfaces.py
All interfaces (classes extending zope.interface.Interface) should be defined in this file. In ZenPacks where this single file becomes hard to maintain, an interfaces/ directory should be created containing individual files named for the group of interfaces they contain.
routers.py
All routers (classes extending Products.ZenUtils.Ext.DirectRouter) should be defined in this file. In ZenPacks where this single file becomes hard to maintain, a routers/ directory should be created containing individual files named for the group of routers they contain.