Introduction to the OpenCms application structure and tools

From OpenCms Wiki
Revision as of 22:18, 1 November 2006 by Cschoenfeld (Talk | contribs)
Jump to: navigation, search

Contents

RFS and VFS

OpenCms stores all content in the VFS, the Virtual File System, which is actually stored in the database. The structure you can see in the Explorer view does not exist on the RFS (real file system, your disk).

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

Initial structure of the OpenCms web application

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 log4j.properties file which is responsible for the log settings in OpenCms.
cmsshell.sh/bat 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/log4j.properties.
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 of the OpenCms web application

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. See
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.

If you start editing content with OpenCms you will notice that you cannot find it on the disk. This is because OpenCms stores all content within its own Virtual File System (VFS) which is located in the database.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox