OpenCms Core API, version 18.0

This is the API description for the OpenCms core, please read the introdution below to learn about the packages and functions of the API that are intended to be used in OpenCms application development.

Introduction to the OpenCms API

The OpenCms API contains several building blocks:

  • The document repository, called Virtual File System (or just VFS).
  • The JSP based templating system.
  • The module API.
  • The main runtime system.
  • Several utility classes, for example for mail transport or scheduling.
  • A number of low level database connetion methods.
  • The OpenCms Workplace implementation.

Not all packages defined in this API are considered "end user" API functions. For example, to access the OpenCms repository you should use an initialized instance of the CmsObject class, and never access the database directly with SQL. So the database functionalities in the org.opencms.db package are "low level" functions, used by the classes in the org.opencms.file package but usually not directly by an application.

How to start developing OpenCms applications

Here are some basic pointers that should help you identify importants parts in this API documentation that are usually required in OpenCms application development:

You should start with the template functions provided in the org.opencms.jsp package. This contains the OpenCms <cms:> taglib, as well as the CmsJspActionElement (for use with scriptlets). These allow you to easliy access the current users CmsObject from a JSP, and with this you can dynamically build OpenCms front end applications based on the users permissions.

For easy template navigation building, check out the methods CmsJspNavBuilder. You can build full-blown OpenCms applications with the functions from the org.opencms.jsp package and never bother about the rest of the API.

After you have mastered the basics of template development, you should take a closer look at the objects in the org.opencms.file package. These object are the "building blocks" for OpenCms applications, and it certainly helps to understand these in greater detail before moving on to more complex OpenCms applications. As already mentioned, the CmsObject is probably the most important class there.

In case you want to use certain OpenCms "operating system" features, use the OpenCms singleton to gain access to the low level manager classes that handle the system runtime.

The org.opencms.module package contains the OpenCms module API. You do not usually need to "program" a module because a module is most often created using the OpenCms Workplace. However, in case you want to trigger certain module lifecyle events, have a look at the I_CmsModuleAction interface.

There are a couple of utility functions worth to mention here: In case you want to send emails from your application, check out the org.opencms.mail package. You can schedule recurring operations in OpenCms by implementing the I_CmsScheduledJob interface.

The basic OpenCms application design

OpenCms runs as a multi tier application. The database layer that contains the VFS is accessed only through the business logic provided by the CmsObject class. This runs totally independent of any servlet container, there is no database logic whatsoever in the "front end", for example the JSP templates. Check the CmsShell description to see how to access the VFS without a servlet container.

In normal operation, OpenCms runs as a servlet in a servlet container. On the startup of the container, OpenCms initializes itself from the configuration provided in the XML files. After the XML configuration has been read, a singleton instance of the OpenCms object provides access to all OpenCms functionality. This OpenCms singleton instance can be considered the "operating system" of OpenCms.

After the "operating system" is initialized and the OpenCms object is available, all requestes made to the OpenCmsServlet are directly passed to this for authorization. When a request is recieved, it's first authenticated to see which CmsUser has made the request. If the user has not been authenticated so far, the CmsUser object is initialized with "Guest" user permissions. With this user context, an instance of a CmsRequestContext is generated, and with that a CmsObject is initialized. This initialized CmsObject then provides the "users context" for all access operations to the OpenCms VFS. It can also be considered the "shell" of the user to the OpenCms VFS. All access operations to the VFS are done through the CmsObject, and this means that all access operations automatically are done with the authenticated users permissions.

Packages
Package
Description
Contains the compile time classes required to allow synchronous RPC calls.
Contains the acacia editor shared client/server classes.
Contains the acacia editor RPC service interfaces.
Contains the ade configuration classes.
Classes for handling formatter configurations.
 
Contains the container page editor service classes.
Contains classes used for reading and caching inheritance groups.
Contains the shared container page editor classes.
Contains the container page editor service interfaces.
Contains server side classes for the XML content editor.
Contains data beans used on the server side as well as on the client side of the XML content editor.
Contains the RPC service interfaces used by the XML content editor.
Contains functions for the detail pages in OpenCms.
 
Contains server side classes for the gallery dialogs.
 
Contains the shared client/server side gallery dialog classes.
 
 
 
 
 
 
This package contains the server-side classes for the publish module.
Classes for the publish dialog which are used by both the client and the server.
Classes to handle client-side GWT-RPC services.
Server side of the sitemap view.
Shared Client-Server side of the sitemap view.
Shared RPC interfaces.
 
Implementations of specialized caches used in OpenCms.
 
Reads and writes the XML based OpenCms configuration files.
Classes to build the user preferences dialog.
 
 
Low-level database connection and access functionality.
AS400 implementation of the OpenCms database connector.
DB2 implementation of the OpenCms database connector.
Generic (ANSI-SQL) implementation of the OpenCms database connector.
HSQLDB implementation of the OpenCms database connector.
This package contains the implementation classes for the DB log.
MS SQL implementation of the OpenCms database connector.
MySQL4+ implementation of the OpenCms database connector.
Oracle9+ implementation of the OpenCms database connector.
PostgreSql implementation of the OpenCms database connector.
Utility classes for profiling driver calls.
 
 
This important package provides the methods to access the OpenCms VFS repository with the permissions of an authenticated user.
Collectors allow to gather lists of OpenCms resources from the OpenCms VFS using specific rules.
This package contains the classes to deal with the OpenCms VFS history archive.
The implementations of the core resource types for the VFS are located here.
This package contains classes and interfaces used to access OpenCms through a wrapped CmsObject.
Provides low-level JSP integration funtionality for OpenCms, also implements the FlexCache, a declarative parameter-based cache.
Provides core support for GWT.
 
Core shared stuff.
 
 
 
 
Shared RPC interfaces.
 
Classes to handle internalization (i18n) and locale selection in OpenCms.
Tools for i18n.
Contains functions to import and export resources from the OpenCms VFS.
 
Classes to create JSON objects and arrays for JavaScript in OpenCms.
The implementation of the OpenCms JSP tag library, with some additional utility classes to help in JSP scriplet code and navigation building.
HTML postprocessor, used to tag single words or phrases in the HTML output.
 
API classes for the <cms:parse> tag.
API classes for the configuration of the search form support provided for server-side Solr search.
API classes for the configuration parsers of the search form support provided for server-side Solr search.
Helpers to convert the list configuration XML content into a suitable bean, used by the CmsSimpleSearchConfigurationParser and the List manager app.
Contains classes for dealing with restrictions in list configurations.
Helpers for the preconfigured filter query part of the list configuration (ie.
API classes for the controllers of the search form support provided for server-side Solr search.
API classes for the result of the search form support provided for server-side Solr search.
API classes for the state of the search form support provided for server-side Solr search.
 
Utility classes to be used for JSP pages.
Classes related to the LetsEncrypt docker integration.
Low-level functions to manage the loading of resources from the OpenCms VFS.
The lock state of the resources in the VFS is handled with these classes.
Provides utility classes to generate email messages using the OpenCms email configuration.
Provides the main OpenCms "operating system".
OpenCms modules provide a powerful, standardized way to extend the core OpenCms functionality.
Contains functions to monitor the OpenCms system status.
 
Contains classes to distribute newsletters.
Contains classes for the automatical notification of outdated, expiring or released content.
 
 
Classes to handle the OpenCms publish process.
Classes to represent and validate the internal and external links/relations of resources in the OpenCms VFS.
Classes used to generate the OpenCms reports, which are displayed during publish, import, export etc.
 
Package contains all classes and interfaces needed to create or use a repository to access the resources in the VFS.
The CmsRemoteShell allows to manipulate a running server using OpenCms shell commands.
The OpenCms scheduler provides a facility to run jobs in a regular schedule, much like the "cron" faciltiy in UNIX systems.
Some predefined implementations for often used scheduled job tasks.
Implements the main full text search and indexing functions available in OpenCms.
Handles indexing different sorts of document and resource type from the OpenCms VFS for the full text search.
Contains a generic, low-level framework for extration of plain text content out of various popular file formats.
These classes control the mapping of the OpenCms content to the Lucene search fields.
Implements the search functions for the OpenCms Gallery search index, which is used by the Advanced Direct Edit (ADE) functions.
The package contains the Solr search integration.
Contains the SOLR based spellcheck service classes.
 
Access control and security classes for the OpenCms ACL permission system.
 
Provides access to the multi-site configuration of OpenCms.
Contains classes related to XML sitemap generation.
Contains the functionality for the static HTML page export.
Classes used to synchronize the OpenCms VFS with the real file system.
 
 
 
General code for the Vaadin UI.
Contains classes for workplace actions.
 
Contains code for workplace apps.
Contains classes of the cache admin app.
 
Contains classes of the cache admin app.
 
Contains classes of the file history app.
This package contains the app classes for the git check in functionality.
Contains classes of the link validation app.
This package contains the app classes for the list configurations manager.
Contains classes of the site manager app.
Contains classes of the module manager app.
Contains classes of the module manager app used to edit modules.
The project manager app classes.
Contains classes of the publish queue app.
 
The scheduled jobs manager app classes.
Contains classes of the source search app.
Contains classes of the searchindex app.
Contains classes of the site manager app.
 
Contains classes of the site manager app.
 
Contains classes of the user manager app.
 
 
Contains some reusable GUI components for Vaadin UI.
 
 
Contains components for editing a homogeneous list of Vaadin components, often used for multivalued fields in dialogs.
Contains Vaadin UI extensions.
Contains components for selecting resources.
Contains code for workplace context menu.
 
Contains code for workplace dialogs.
Contains code for the availability dialog.
 
Contains code for the file history dialog.
Contains code for the comparison view of the file history dialog.
Contains permission dialog classes.
The available content editors.
The data bindings and logic for the translator editor.
 
 
Contains the user interface components for the Vaadin-based login dialog.
Contains the user interface components for reports.
 
Contains Vaadin component state classes and other RPC classes.
Contains the user shared classes for the Vaadin-based login dialog.
Contains Vaadin RPC interfaces.
Vaadin GUI components and utilities for use in the sitemap editor.
Utilities for Vaadin workplace code.
Contains utility classes for dealing with Vaadin tables.
Utility functions for String manipulation and other often used tasks.
 
 
Contains the widget implementations, these are GUI elements used in editors and dialogs of the OpenCms workplace.
 
Contains the server-side widget implementation, for the serial date widget..
Classes related to publishing and workflow.
The base classes for the OpenCms Workplace (standard dialog, tab dialog, report based dialog) and the Workplace configuration classes are located here.
Contains often used OpenCms Workplace dialogs, for example for file operations, user preferences and project based operations like publishing.
Utilities for comparing different versions of resources, used by both the classic workplace and the new Vaadin-based workplace.
Base classes for the editors (WYSIWYG, plain text, XML content) used in the OpenCms Workplace.
Used to control the generation of the HTML for the "direct edit" buttons.
Contains the functions that generate the Workplace "Explorer" view, also contains the "New resource" wizard.
Contains the various "Galleries" which are available in the editors and widgets of the OpenCms Workplace.
Generates the list views commonly used in the OpenCms Workplace "Administration" tools.
A collection of thread classes that are used in the OpenCms Workplace, usually in connection with a report.
Contains the base classes for implementing a tool in the OpenCms Workplace "Administration" view.
This package contains the tool classes for the job management related administration views.
Basic XML functionality and utilities used by OpenCms to maintain XML documents and content.
Contains functions for the ADE main pages, commonly called "Container Pages" in OpenCms.
 
Contains functions for structured content storage using XML, commonly called "XML content" in OpenCms.
Contains functions for unstructured content storage using XML, commonly called "XML pages" in OpenCms.
 
Contains the basic XML content type definitions, used for XML content and XML pages.