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
com.google.gwt.user.client.rpc
Contains the compile time classes required to allow synchronous RPC calls.
org.opencms.acacia.shared
Contains the acacia editor shared client/server classes.
org.opencms.acacia.shared.rpc
Contains the acacia editor RPC service interfaces.
org.opencms.ade.configuration
Contains the ade configuration classes.
org.opencms.ade.configuration.formatters
Classes for handling formatter configurations.
org.opencms.ade.configuration.plugins  
org.opencms.ade.containerpage
Contains the container page editor service classes.
org.opencms.ade.containerpage.inherited
Contains classes used for reading and caching inheritance groups.
org.opencms.ade.containerpage.shared
Contains the shared container page editor classes.
org.opencms.ade.containerpage.shared.rpc
Contains the container page editor service interfaces.
org.opencms.ade.contenteditor
Contains server side classes for the XML content editor.
org.opencms.ade.contenteditor.shared
Contains data beans used on the server side as well as on the client side of the XML content editor.
org.opencms.ade.contenteditor.shared.rpc
Contains the RPC service interfaces used by the XML content editor.
org.opencms.ade.detailpage
Contains functions for the detail pages in OpenCms.
org.opencms.ade.editprovider  
org.opencms.ade.galleries
Contains server side classes for the gallery dialogs.
org.opencms.ade.galleries.preview  
org.opencms.ade.galleries.shared
Contains the shared client/server side gallery dialog classes.
org.opencms.ade.galleries.shared.rpc  
org.opencms.ade.postupload  
org.opencms.ade.postupload.shared  
org.opencms.ade.postupload.shared.rpc  
org.opencms.ade.properties  
org.opencms.ade.properties.shared  
org.opencms.ade.publish
This package contains the server-side classes for the publish module.
org.opencms.ade.publish.shared
Classes for the publish dialog which are used by both the client and the server.
org.opencms.ade.publish.shared.rpc
Classes to handle client-side GWT-RPC services.
org.opencms.ade.sitemap
Server side of the sitemap view.
org.opencms.ade.sitemap.shared
Shared Client-Server side of the sitemap view.
org.opencms.ade.sitemap.shared.rpc
Shared RPC interfaces.
org.opencms.ade.upload  
org.opencms.cache
Implementations of specialized caches used in OpenCms.
org.opencms.cmis  
org.opencms.configuration
Reads and writes the XML based OpenCms configuration files.
org.opencms.configuration.preferences
Classes to build the user preferences dialog.
org.opencms.configuration.test  
org.opencms.crypto  
org.opencms.db
Low-level database connection and access functionality.
org.opencms.db.as400
AS400 implementation of the OpenCms database connector.
org.opencms.db.db2
DB2 implementation of the OpenCms database connector.
org.opencms.db.generic
Generic (ANSI-SQL) implementation of the OpenCms database connector.
org.opencms.db.hsqldb
HSQLDB implementation of the OpenCms database connector.
org.opencms.db.log
This package contains the implementation classes for the DB log.
org.opencms.db.mssql
MS SQL implementation of the OpenCms database connector.
org.opencms.db.mysql
MySQL4+ implementation of the OpenCms database connector.
org.opencms.db.oracle
Oracle9+ implementation of the OpenCms database connector.
org.opencms.db.postgresql
PostgreSql implementation of the OpenCms database connector.
org.opencms.db.timing
Utility classes for profiling driver calls.
org.opencms.db.urlname  
org.opencms.db.userpublishlist  
org.opencms.file
This important package provides the methods to access the OpenCms VFS repository with the permissions of an authenticated user.
org.opencms.file.collectors
Collectors allow to gather lists of OpenCms resources from the OpenCms VFS using specific rules.
org.opencms.file.history
This package contains the classes to deal with the OpenCms VFS history archive.
org.opencms.file.types
The implementations of the core resource types for the VFS are located here.
org.opencms.file.wrapper
This package contains classes and interfaces used to access OpenCms through a wrapped CmsObject.
org.opencms.flex
Provides low-level JSP integration funtionality for OpenCms, also implements the FlexCache, a declarative parameter-based cache.
org.opencms.gwt
Provides core support for GWT.
org.opencms.gwt.seo  
org.opencms.gwt.shared
Core shared stuff.
org.opencms.gwt.shared.alias  
org.opencms.gwt.shared.attributeselect  
org.opencms.gwt.shared.categorizedselect  
org.opencms.gwt.shared.property  
org.opencms.gwt.shared.rpc
Shared RPC interfaces.
org.opencms.gwt.shared.sort  
org.opencms.i18n
Classes to handle internalization (i18n) and locale selection in OpenCms.
org.opencms.i18n.tools
Tools for i18n.
org.opencms.importexport
Contains functions to import and export resources from the OpenCms VFS.
org.opencms.jlan  
org.opencms.json
Classes to create JSON objects and arrays for JavaScript in OpenCms.
org.opencms.jsp
The implementation of the OpenCms JSP tag library, with some additional utility classes to help in JSP scriplet code and navigation building.
org.opencms.jsp.decorator
HTML postprocessor, used to tag single words or phrases in the HTML output.
org.opencms.jsp.jsonpart  
org.opencms.jsp.parse
API classes for the <cms:parse> tag.
org.opencms.jsp.search.config
API classes for the configuration of the search form support provided for server-side Solr search.
org.opencms.jsp.search.config.parser
API classes for the configuration parsers of the search form support provided for server-side Solr search.
org.opencms.jsp.search.config.parser.simplesearch
Helpers to convert the list configuration XML content into a suitable bean, used by the CmsSimpleSearchConfigurationParser and the List manager app.
org.opencms.jsp.search.config.parser.simplesearch.daterestrictions
Contains classes for dealing with restrictions in list configurations.
org.opencms.jsp.search.config.parser.simplesearch.preconfiguredrestrictions
Helpers for the preconfigured filter query part of the list configuration (ie.
org.opencms.jsp.search.controller
API classes for the controllers of the search form support provided for server-side Solr search.
org.opencms.jsp.search.result
API classes for the result of the search form support provided for server-side Solr search.
org.opencms.jsp.search.state
API classes for the state of the search form support provided for server-side Solr search.
org.opencms.jsp.userdata  
org.opencms.jsp.util
Utility classes to be used for JSP pages.
org.opencms.letsencrypt
Classes related to the LetsEncrypt docker integration.
org.opencms.loader
Low-level functions to manage the loading of resources from the OpenCms VFS.
org.opencms.lock
The lock state of the resources in the VFS is handled with these classes.
org.opencms.mail
Provides utility classes to generate email messages using the OpenCms email configuration.
org.opencms.main
Provides the main OpenCms "operating system".
org.opencms.module
OpenCms modules provide a powerful, standardized way to extend the core OpenCms functionality.
org.opencms.monitor
Contains functions to monitor the OpenCms system status.
org.opencms.mx  
org.opencms.newsletter
Contains classes to distribute newsletters.
org.opencms.notification
Contains classes for the automatical notification of outdated, expiring or released content.
org.opencms.pdftools  
org.opencms.pdftools.dtds  
org.opencms.publish
Classes to handle the OpenCms publish process.
org.opencms.relations
Classes to represent and validate the internal and external links/relations of resources in the OpenCms VFS.
org.opencms.report
Classes used to generate the OpenCms reports, which are displayed during publish, import, export etc.
org.opencms.report.wrapper  
org.opencms.repository
Package contains all classes and interfaces needed to create or use a repository to access the resources in the VFS.
org.opencms.rmi
The CmsRemoteShell allows to manipulate a running server using OpenCms shell commands.
org.opencms.scheduler
The OpenCms scheduler provides a facility to run jobs in a regular schedule, much like the "cron" faciltiy in UNIX systems.
org.opencms.scheduler.jobs
Some predefined implementations for often used scheduled job tasks.
org.opencms.search
Implements the main full text search and indexing functions available in OpenCms.
org.opencms.search.documents
Handles indexing different sorts of document and resource type from the OpenCms VFS for the full text search.
org.opencms.search.extractors
Contains a generic, low-level framework for extration of plain text content out of various popular file formats.
org.opencms.search.fields
These classes control the mapping of the OpenCms content to the Lucene search fields.
org.opencms.search.galleries
Implements the search functions for the OpenCms Gallery search index, which is used by the Advanced Direct Edit (ADE) functions.
org.opencms.search.solr
The package contains the Solr search integration.
org.opencms.search.solr.spellchecking
Contains the SOLR based spellcheck service classes.
org.opencms.search.solr.updateprocessors  
org.opencms.security
Access control and security classes for the OpenCms ACL permission system.
org.opencms.security.twofactor  
org.opencms.site
Provides access to the multi-site configuration of OpenCms.
org.opencms.site.xmlsitemap
Contains classes related to XML sitemap generation.
org.opencms.staticexport
Contains the functionality for the static HTML page export.
org.opencms.synchronize
Classes used to synchronize the OpenCms VFS with the real file system.
org.opencms.ugc  
org.opencms.ugc.shared  
org.opencms.ugc.shared.rpc  
org.opencms.ui
General code for the Vaadin UI.
org.opencms.ui.actions
Contains classes for workplace actions.
org.opencms.ui.apps
Contains code for workplace apps.
org.opencms.ui.apps.cacheadmin
Contains classes of the cache admin app.
org.opencms.ui.apps.dbmanager
Contains classes of the cache admin app.
org.opencms.ui.apps.dbmanager.sqlconsole  
org.opencms.ui.apps.filehistory
Contains classes of the file history app.
org.opencms.ui.apps.git
This package contains the app classes for the git check in functionality.
org.opencms.ui.apps.linkvalidation
Contains classes of the link validation app.
org.opencms.ui.apps.lists
This package contains the app classes for the list configurations manager.
org.opencms.ui.apps.logfile
Contains classes of the site manager app.
org.opencms.ui.apps.modules
Contains classes of the module manager app.
org.opencms.ui.apps.modules.edit
Contains classes of the module manager app used to edit modules.
org.opencms.ui.apps.projects
The project manager app classes.
org.opencms.ui.apps.publishqueue
Contains classes of the publish queue app.
org.opencms.ui.apps.resourcetypes  
org.opencms.ui.apps.scheduler
The scheduled jobs manager app classes.
org.opencms.ui.apps.search
Contains classes of the source search app.
org.opencms.ui.apps.searchindex
Contains classes of the searchindex app.
org.opencms.ui.apps.sessions
Contains classes of the site manager app.
org.opencms.ui.apps.shell  
org.opencms.ui.apps.sitemanager
Contains classes of the site manager app.
org.opencms.ui.apps.unusedcontentfinder  
org.opencms.ui.apps.user
Contains classes of the user manager app.
org.opencms.ui.apps.userdata  
org.opencms.ui.apps.util  
org.opencms.ui.components
Contains some reusable GUI components for Vaadin UI.
org.opencms.ui.components.categoryselect  
org.opencms.ui.components.codemirror  
org.opencms.ui.components.editablegroup
Contains components for editing a homogeneous list of Vaadin components, often used for multivalued fields in dialogs.
org.opencms.ui.components.extensions
Contains Vaadin UI extensions.
org.opencms.ui.components.fileselect
Contains components for selecting resources.
org.opencms.ui.contextmenu
Contains code for workplace context menu.
org.opencms.ui.dataview  
org.opencms.ui.dialogs
Contains code for workplace dialogs.
org.opencms.ui.dialogs.availability
Contains code for the availability dialog.
org.opencms.ui.dialogs.embedded  
org.opencms.ui.dialogs.history
Contains code for the file history dialog.
org.opencms.ui.dialogs.history.diff
Contains code for the comparison view of the file history dialog.
org.opencms.ui.dialogs.permissions
Contains permission dialog classes.
org.opencms.ui.editors
The available content editors.
org.opencms.ui.editors.messagebundle
The data bindings and logic for the translator editor.
org.opencms.ui.error  
org.opencms.ui.favorites  
org.opencms.ui.login
Contains the user interface components for the Vaadin-based login dialog.
org.opencms.ui.report
Contains the user interface components for reports.
org.opencms.ui.shared  
org.opencms.ui.shared.components
Contains Vaadin component state classes and other RPC classes.
org.opencms.ui.shared.login
Contains the user shared classes for the Vaadin-based login dialog.
org.opencms.ui.shared.rpc
Contains Vaadin RPC interfaces.
org.opencms.ui.sitemap
Vaadin GUI components and utilities for use in the sitemap editor.
org.opencms.ui.util
Utilities for Vaadin workplace code.
org.opencms.ui.util.table
Contains utility classes for dealing with Vaadin tables.
org.opencms.util
Utility functions for String manipulation and other often used tasks.
org.opencms.util.benchmark  
org.opencms.webdav  
org.opencms.widgets
Contains the widget implementations, these are GUI elements used in editors and dialogs of the OpenCms workplace.
org.opencms.widgets.dataview  
org.opencms.widgets.serialdate
Contains the server-side widget implementation, for the serial date widget..
org.opencms.workflow
Classes related to publishing and workflow.
org.opencms.workplace
The base classes for the OpenCms Workplace (standard dialog, tab dialog, report based dialog) and the Workplace configuration classes are located here.
org.opencms.workplace.commons
Contains often used OpenCms Workplace dialogs, for example for file operations, user preferences and project based operations like publishing.
org.opencms.workplace.comparison
Utilities for comparing different versions of resources, used by both the classic workplace and the new Vaadin-based workplace.
org.opencms.workplace.editors
Base classes for the editors (WYSIWYG, plain text, XML content) used in the OpenCms Workplace.
org.opencms.workplace.editors.directedit
Used to control the generation of the HTML for the "direct edit" buttons.
org.opencms.workplace.explorer
Contains the functions that generate the Workplace "Explorer" view, also contains the "New resource" wizard.
org.opencms.workplace.galleries
Contains the various "Galleries" which are available in the editors and widgets of the OpenCms Workplace.
org.opencms.workplace.list
Generates the list views commonly used in the OpenCms Workplace "Administration" tools.
org.opencms.workplace.threads
A collection of thread classes that are used in the OpenCms Workplace, usually in connection with a report.
org.opencms.workplace.tools
Contains the base classes for implementing a tool in the OpenCms Workplace "Administration" view.
org.opencms.workplace.tools.scheduler
This package contains the tool classes for the job management related administration views.
org.opencms.xml
Basic XML functionality and utilities used by OpenCms to maintain XML documents and content.
org.opencms.xml.containerpage
Contains functions for the ADE main pages, commonly called "Container Pages" in OpenCms.
org.opencms.xml.containerpage.mutable  
org.opencms.xml.content
Contains functions for structured content storage using XML, commonly called "XML content" in OpenCms.
org.opencms.xml.page
Contains functions for unstructured content storage using XML, commonly called "XML pages" in OpenCms.
org.opencms.xml.templatemapper  
org.opencms.xml.types
Contains the basic XML content type definitions, used for XML content and XML pages.
org.opencms.xml.xml2json  
org.opencms.xml.xml2json.document  
org.opencms.xml.xml2json.handler  
org.opencms.xml.xml2json.renderer