Custom File and Folder Types

(Difference between revisions)
Jump to: navigation, search
Line 14: Line 14:
  
 
== Caveats ==
 
== Caveats ==
Be careful to use a new, unique ID for your resource types. This ID must be identical between your resource class and your module configuration and the number should be high enough to be far away from the standard resource types in order to prevent possible conflicts in the future.
+
Be careful to use a new, unique ID for your resource types. This ID must be identical between your resource class and your module configuration and the number should be high enough to be far away from the standard resource types that are delivered with OpenCms.

Revision as of 01:33, 2 November 2006

OpenCms offers an extension mechanism for creating new Resource Types inside of the Virtual File System.

A resource type consists of two parts, a resource type class and configuration data.

Resource Type Class

The resource type class implements the functionality of a new resource type. This class has to be derived from the abstract class org.opencms.file.types.A_CmsResourceType.

Configuration Data

Opencms needs to know that your resource type exists. For that you have to create a module. After your module has been created, you need to edit the configuration of your module.

Your module configuration is contained in in the file opencms-modules.xml. You find it in the folder WEB-INF/config of the Opencms web application in the Real File System. Whereas many properties of your module can be edited from the opencms workplace, the settings for resource types can be only changed directly in the xml configuration file in the Real File System.

A full install of OpenCms already comes with several resource types and some of these are brought into the systems via a module. Therefore, in opencms-modules.xml you can find good examples, that show how to set the basic technical properties and the context menu behavior of your new resource type.

Caveats

Be careful to use a new, unique ID for your resource types. This ID must be identical between your resource class and your module configuration and the number should be high enough to be far away from the standard resource types that are delivered with OpenCms.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox