Introduction to the OpenCms application structure and tools

From OpenCms Wiki
Jump to: navigation, search



If you start using OpenCms you will notice that the structure of your content shown in the Explorer view does not exist anywhere on your disk (the RFS, real file system). OpenCms stores all content within its Virtual File System (VFS). The VFS is part of the OpenCms database and is not a normal file system like FAT, NTFS or ext3.

For performance reasons, content can be exported from the VFS to the RFS, and mostly to support development, VFS content can be synchronized with the RFS. See the section on RFS Synchronization.

Structure of the OpenCms web application

Initial Structure

When you unpack the binary distribution (ZIP file) of OpenCms you find the file opencms.war. This file contains the initial set of files required for the setup of OpenCms as well as the files for running OpenCms.

Following are the directories within opencms.war along with explanations of their meaning.

File/Folder Explanation
META-INF/ The place for the Manifest. There is nothing you can tune here.
setup/ This folder contains the JSP pages, images and SQL scripts used during the setup of OpenCms. After you finished setup it is a good idea to remove this folder completely.
WEB-INF/ This folder contains the web application and most of the interesting files and folders. It is detailed in the table below.

Details of the folder WEB-INF/

File/Folder Explanation
classes/ This folder is initially empty but later filled with classes and classpath resources when you import and publish modules. It also contains the file which is responsible for the log settings in OpenCms. Shell script for Linux/Windows to start a shell prompt which gives you access to OpenCms
cpappend.bat TODO
logs/ The place where OpenCms keeps its log file, opencms.log. You can influence the name and location of this log file by customizing WEB-INF/classes/
packages/ This folder contains a sub folder, modules/, where all ZIP archives of OpenCms modules are stored. The OpenCms setup will make all modules available for installation which it finds here. The module folder is the place where a module ZIP file ends up when you use the "Export Module" function within the OpenCms Administration UI. After the installation of OpenCms you can safely delete the files here.
config/ The place where OpenCms stores its configuration files. The files are loaded from here and updated as well if you make changes to the configuration via the Administration UI.
lib/ The standard WEB-INF/lib folder. It contains OpenCms's own library dependencies as well as the libraries found in each module's lib directory.
opencms.tld A Taglib Descriptor for the OpenCms custom tag library.
setupdata/ TODO
web.xml Defines the OpenCms servlets.

Runtime structure

OpenCms requires the servlet container to unpack the WAR file or, if the container does not support this, requires you to deploy OpenCms from an unpacked WAR file. The unpacked deployment is required because OpenCms needs to write to the web application directory from which it is run.

If you deploy opencms.war on Tomcat the web application directory is $CATALINA_HOME/webapps/opencms.

The following folders are created there during setup and during static export of files:

File/Folder Explanation
export/ Contains all statically exported files.
resources/ Contains resource files, mostly button and icon images, of the workplace and your modules.

OpenCms creates these folders in order to speed up access to those often needed files.

Structure of the VFS

After installation you can find a structure as follows:

File/Folder Explanation
sites/default Contains the index.jsp and other documentation accessible by default if you point your browser to the OpenCms context URL (default is: http://localhost:8080/opencms).
system/galleries Download, Image, Link, and Table galleries.
system/handler Pages for HTTP response codes 404 and 500.
system/login Login page.
system/lost-found This is (probably) the place where the OOCE integrity check module (available as an extension for money) puts invalid files and folders it finds during check runs in the VFS.
system/modules Contains all installed modules.
system/shared TODO
system/workplace The JSP files, buttons, icons and other files used by OpenCms to create its user interface: the Explorer, the Administration and the Workflow interfaces.

You can customize all files within the VFS, even the system files which are used by OpenCms itself to render its user interface. Of course, you should be very careful about making changes to system files it can break your system.

Personal tools