现在的位置: 首页 > 综合 > 正文

opencms 安装与使用

2013年09月06日 ⁄ 综合 ⁄ 共 4499字 ⁄ 字号 评论关闭

opencms_6.2.2/install.html

 

1. Install the Java 2 SDK, version 1.4 or newer

2Install Tomcat

3 Install MySQL

4Deploy the opencms.war file

Copy the opencms.war file from the binary distribution ZIP file to CATALINA_HOME/webapps/. Replace CATALINA_HOME with the real path to your Tomcat installation.

Start (or restart) Tomcat. Tomcat will now deploy the web application OpenCms.

Important: OpenCms requires that it's *.war file is unpacked. OpenCms can not be deployed as war file only. Make sure Tomcat does unpack the war file and creates the CATALINA_HOME/webapps/opencms/ directory, placing the OpenCms files in this directory. The default configuration for your Servlet containers / environment could be to not unpack the deployed *.war file. If this is so you must unpack the opencms.war file manually. Use an unzip tool for this, *.war files are just *.zip files with a different extension. The OpenCms setup wizard will display a warning and not allow you to continue if you did not unpack the *.war file.

 

//安装OpenCms 6.2.2 for Java 1.4:

Follow the following steps to patch OpenCms 6.2.2 for Java 1.4:

 

1. Shutdown your OpenCms servlet container

The OpenCms Java 1.4 compatibility patch requires that you shut down OpenCms first. You can use the

Broadcast message tool in the 'Administration' view to inform users before the  server is shut down.

 

2. Extract the OpenCms Java 1.4 compatibility patch 'opencms_6.2.2_java_1.4.zip' to

   your web application directory

 

If you extracted the file to an external directory, copy the folder 'WEB-INF' to the OpenCms webapp directory.

Be sure that the files 'lib/*.jar' are replaced with the new versions from the archive before you

continue.

 

3. Start your OpenCms servlet container

 

You should now be able to log into the OpenCms workplace as before.

 

4. Finally, do a quick test if everything works

 

* Preview some pages in the folders demopages/ or modulesdemo/ of the default site.

 

* Edit a resource and modify its content.

 

* Publish one or more resources.

 

* Check the Administration view of OpenCms.

 

 

 

5. Install OpenCms using the Setup-Wizard

Start the Setup-Wizard by pointing your webbrowser to http://localhost:8080/opencms/setup/. Depending on your configuration, you have to replace localhost with your servername. The port 8080 is only used if you start Tomcat in standalone mode.

Follow the instructions of the OpenCms Setup-Wizard. It will set up the OpenCms database and import all available modules into the system. For normal installations with MySql and Tomcat running on the same server all default settings will fit your needs.
If you are using different database users with MySql, be sure that they exist before creating the database tables and importing the modules.

Important: Make sure you disable all popup blockers for the server URL you installed OpenCms on. Otherwise you will not be able to log in to the OpenCms Workplace.

 

step_4_database_setup.bmp 图示

                      user      password

setup connection          root   *******

opencms connection       root   *******

注意 user 上下一致 。如果如 data2.bmp,则会不成功 (可以建数据库,但是不能成功建表)。

 

 

模版设计 openCms java api 的学习。

 

 

 

关于建立网站根目录 :需要注意的地方:


 sites  :

default  

testWeb  ,建立在sites 目录下,即可。

 

 

关于tomcat 无故 down掉的问题。参考 blog.csdn.net/xiaoli_feng .

 

module 模块

template 模板

新建模块 OpenCms模块创建图解

http://blog.csdn.net/qianxuncms/archive/2007/04/06/1554192.aspx
  确定当前不在online状态下,点击新建模块按钮:
  名称是模块包的名称,名称规则应该遵循java包的命名规则,此名称在模块创建后不可以再修改,在模块中可以包含java类,这些类包的名称和模块的名称一定要相同;
  模块名称中可以自由输入,如描述模块功能的名字;
  描述模块的描述信息,可以随意输入;
  模块版本:模块的版本号;
  模块组:用于把属于同类的模块分组,这样在模块列表中可以按模块组进行排序;
  动作类/行为类:在模块初始化或修改时所执行的类,这个类应该包含在模块包中,请参考JavaDoc中的I_CmsModuleAction接口。
  作者姓名作者email”中输入模块创建者的名称与email信息;
  创建模块文件夹:创建模块时在/system/modules/中创建模块包文件夹,如org.opencms.test
  创建"templates"子文件夹:在模块文件夹下创建"templates"子文件夹,用于存放模板;
  创建"elements"子文件夹:在模块文件夹下创建"elements"子文件夹,用于存放共用的元素;
  创建"resources"子文件夹:在模块文件夹下创建"resources"子文件夹,用于存放模块所需的资源;
  创建“classes”子文件夹:在模块文件夹下创建“classes”子文件夹,用于存放模块中的类;
  创建"lib"子文件夹:在模块文件夹下创建"lib"子文件夹,用于存放模块中的jar

 

新建一个简单的JSP模板  OpenCms JSP 模板开发——

JSP模板就是一个普通的JSP页面,在特定的位置使用标签来包含内容。

请注意:JSP模板存放的位置是在模块下的“templates”子文件夹中,只有这样做,在创建页面时模板才会出现在模板选择列表中

 

 

模板文件内容如下:

<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>

<html>

<head>

<title><cms:property name="Title" /></title>

<meta HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; CHARSET=<cms:property name="content-encoding" default="UTF-8" />" />

<link rel="stylesheet" type= "text/css" href="<cms:link>../resources/myStyle.css</cms:link>" />

</head>

<body>

<h2>第一个简单模板的head</h2>

<cms:include element= "body"/>

<h2>第一个简单模板的foot</h2>

</body>

</html>

 

在使用OpenCms标签前一定要如下声明标签: <%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>,关于标签的详细说明,参见

http://blog.csdn.net/qianxuncms/archive/2007/04/09/1557085.aspx

 

<cms:include element="body">标签,它包含一个可编辑的页面元素。

新建一个页面,用到该jsp模板,编辑该页面,也就是编辑页面中的“body”元素,因为JSP模板指定了css,所以此处输入的内容按css样式显示。

Preview的话,除了显示 jsp模板的内容外,还会显示 编辑该页面 所插入的内容。

详情见:

http://blog.csdn.net/qianxuncms/archive/2007/04/09/1557085.aspx

 

温习一下 jsp开发的知。。。。

 

 

 

抱歉!评论已关闭.