OpenCms Application Overview

Before undertaking development, it will be helpful to understand the basic design of OpenCms. OpenCms is structured as a typical J2EE web application conforming to a 3-tier web application architecture:

A web server on the front-end tier services incoming requests. The requests are passed through to an application server in the middle tier, where the OpenCms application runs. The OpenCms application utilizes the database on the third tier to read and store its content.

For production, using an array of web servers will typically distribute load to the application server tier. A common choice is to use the Apache web server, utilizing the mod_jk plug-in to distribute load. For development purposes, using a web server is optional, and instead the application server container may be accessed directly. Open Cms supports a wide variety of application servers, including commercial servers such as IBM Websphere and BEA WebLogic. It also supports open source servers such as Tomcat and JBoss. A popular choice among developers is the Apache Tomcat server. We will be using the Apache server for our development environment.

On th e back end, OpenCms supports a variety of databases, including Oracle, Postgreas, and the popular open source database, MySQL. The OpenCms installation setup procedure provides a wizard interface guiding the user through the creation of the database schema. Optionally, it allows for manual creation of the database schema through provided scripts.

This wide variety of choices makes it easy to install and run OpenCms in many mixed environments. It also allows for easy integration with other technologies, such as portals, CRM systems, and document management systems. Next, let's take a look at the file structure of an installed environment.

OpenCms Architecture

OpenCms has a modular architecture centered on a VFS. The file system is considered virtual as it resides inside a database and not on a hard disk. The VFS is similar to a real file system that supports folders, file types, and permissions. Access permission masks on the fi les and folders, and controls access that users and groups have to the files. The OpenCms VFS also provides a feature very similar to symbolic links in a Unix file system. A link is a directory entry that contains meta-information which is kept separate from the file contents.

The core also provides support for basic features such as publishing, access control, and revisions. Layered above this are application level features such as confi guration, the user interface, and module support. Module support is a key feature of OpenCms, providing the ability to extend and modify it. Module support is layered on top of OpenCms. A logical view looks like this:

It is interesting to note that although OpenCms is a web application, it comes with a shell application that provides an interpretive interface to the API from a Java command line interface! Furthermore, it is possible to script this interface to install content into the VFS.

Extensibility through Modules

M odules are a key aspect of the OpenCms design. They provide a way to package together necessary components that may be easily plugged into OpenCms. Modules are the way that new content types, templates, or web capabilities are added to OpenCms. Later in this book, we will go into the details of creating an administration module for OpenCms.

The OpenCms Web Request Process

It would be useful to understand how a request made to OpenCms results in the display of content. The structure of a typical OpenCms URL looks like:

http://[server]:[port]/[context]/[servlet]/[parameters]

For example:
http://mydevserver:8080/opencms/opencms/system/logon/index.html

Server: mydevserver
Port: 8080
Context: opencms
Servlet: opencms
Parameters: /system/logon/index.html

The request will invoke the opencms servlet with the parameter /system/logon/ index.html. When the servlet runs, it goes through the following sequence:

1. Uses the passed in parameter to locate the item in the virtual fi le system
2. Determines its access permissions, and see if it can be accessed by the requestor
3. Determines its file type
4. Based on its fi le type, locates a resource loader for that type
5. Invokes the resource loader to load the file

There is a bit more going on; but for our discussion we will consider only the previous steps. It can be seen that after permission has been established, a resource loader is utilized to load the file. Resource loaders are responsible for encapsulating the knowledge required to load and execute items requested from the VFS. There are several types of resource loaders provided by OpenCms, and there is a one-to-one mapping between an OpenCms fi le type and a resource loader.

Most site content is structured XML, and the assigned loader for this type is the CmsXmlContentLoader. W hen this resource loader is invoked, it examines the properties assigned to the resource, specifi cally looking for the template-elements property. This property must contain the full path to a template used to render the XML content. The resource loader passes control to the template. When the template runs, it takes the responsibility of parsing the original XML resource, and displaying it. Most templates will be JSP fi les, but they are not restricted to this type. In fact, when a template is invoked, it follows the same loading process, resulting in its corresponding resource loader being invoked. This allows for new template languages to be plugged into OpenCms, by writing and adding new resource loaders.

As resource loaders act on file types, the extension of a fi le in the VFS is not signifi cant. This means that a fi le with an HTML extension in the VFS may, in fact, be run as a JSP fi le, or vice versa. A useful way to leverage this, is to create a fi le with a .CSS extension that is in fact a JSP file. The JSP could then dynamically generate the CSS based on browser type.

ref from:

http://careerride.com/OpenCms-Application-Overview.aspx

http://careerride.com/OpenCms-Architecture.aspx

OpenCms Application dev-ref的更多相关文章

  1. asterisk channel driver dev ref

    入口函数load_module    load_config    ast_channel_register console_tech    ast_cli_register_multiple     ...

  2. Django

    一.Django 简介 Django 是一个由 Python 写成的开放源代码的 Web 应用框架.它最初是被开发来用于管理劳伦斯出版集团旗下的一些以新闻内容为主的网站的,即是 CMS(内容管理系统) ...

  3. Python之路Day20-Django一对一(多)以及Ajax

    上节内容回顾 问题一:Django请求生命周期 -> URL对应关系(匹配) -> 视图函数 -> 返回用户字符串-> URL对应关系(匹配) -> 视图函数 -> ...

  4. python Django教程 之 模型(数据库)、自定义Field、数据表更改、QuerySet API

    python  Django教程  之 模型(数据库).自定义Field.数据表更改.QuerySet API 一.Django 模型(数据库) Django 模型是与数据库相关的,与数据库相关的代码 ...

  5. Django:之Sitemap站点地图、通用视图和上下文渲染器

    Django中自带了sitemap框架,用来生成xml文件 Django sitemap演示: sitemap很重要,可以用来通知搜索引擎页面的地址,页面的重要性,帮助站点得到比较好的收录. 开启si ...

  6. Django之路:模型(数据库)和自定义Field以及数据表的更改

    一.Django 模型(数据库) Django模型是与数据库相关的,与数据库相关的代码一般写在models.py中,Django支持sqlite3,MySQL,PostgreSQL等数据库,只需要在s ...

  7. Django框架全面讲解

    Python的WEB框架有Django.Tornado.Flask 等多种,Django相较与其他WEB框架其优势为:大而全,框架本身集成了ORM.模型绑定.模板引擎.缓存.Session等诸多功能. ...

  8. CentOS7.2非HA分布式部署Openstack Pike版 (实验)

    部署环境 一.组网拓扑 二.设备配置 笔记本:联想L440处理器:i3-4000M 2.40GHz内存:12G虚拟机软件:VMware® Workstation 12 Pro(12.5.2 build ...

  9. [转]django-registration quickstart

    Basic configuration and use--------------------------- Once installed, you can add django-registrati ...

随机推荐

  1. DICOM医学图像处理:DIMSE消息发送与接收“大同小异”之DCMTK fo-dicom mDCM

    背景: 从DICOM网络传输一文开始,相继介绍了C-ECHO.C-FIND.C-STORE.C-MOVE等DIMSE-C服务的简单实现,博文中的代码给出的实例都是基于fo-dicom库来实现的,原因只 ...

  2. 序列化类型为XX的对象时检测到循环引用

    /// 产品列表展示 /// </summary> /// <returns></returns> ) { //获得所有组别 Galasys_IBLL.IT_BIZ ...

  3. C#中如何截取Windows消息来触发自定义事件

    原文 C#中如何截取Windows消息来触发自定义事件 在c#windows开发中,我们常常会遇到拦截windows消息,来触发某个特定任务的问题. 由于目前使用c#的开发人员非常多,而且大多数c#程 ...

  4. BNU 51275 道路修建 Large 并查集

    分析(引入Q神题解  %%%Q) 如果使用可持久化并查集,二分答案判定连通性,复杂度是O(mlog3n),不能在时限内出解.考虑到并查集实际上是一棵树,可以尝试在边上维护一些信息,假设t时刻加了一条边 ...

  5. 2015上海网络赛 A Puzzled Elena

    题意:给定一棵树,求这个节点的所有子树中包括他本身与它互质的节点的个数. 解题思路:题利用dfs序+容斥原理+前缀和性质解决.题目中要求每个结点,和多少个它的子结点互素.如果每次为了求一个点去跑一遍d ...

  6. javascript设计模式6

    单体模式:用来划分命名空间而组织一些方法和属性的对象,如果它能被实例化,只能被实例化一次:但对象不是单体 var Singleton={ attr1:true; attr2:2, method1:fu ...

  7. php框架Symfony资料

    1.http://snippets.symfony-project.org/snippets/tagged/criteria/order_by/date 2.Propel API: http://ap ...

  8. 教程-DelphiXE7如何调用Java Class,JAR等文件?

    源文地址:http://jingyan.baidu.com/article/e4d08ffdb61b040fd3f60d44.html 第一步,我们先在互联网上把java2pas这个工具下载下来. 下 ...

  9. 新浪新闻API接口

    头条 http://api.sina.cn/sinago/list.json?channel=news_toutiao推荐 http://api.sina.cn/sinago/list.json?ch ...

  10. HTML5随笔

    1 首先介绍一下html5,以及为什么用html5, HTML5是HTML最新的修订版本,2014年10月由万维网联盟(W3C)完成标准制定. HTML5的设计目的是为了在移动设备上支持多媒体.HTM ...