opencms 安装与使用

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 availablemodules 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 的学习。

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

<shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><stroke joinstyle="miter"></stroke><formulas><f eqn="if lineDrawn pixelLineWidth 0"></f><f eqn="sum @0 1 0"></f><f eqn="sum 0 0 @1"></f><f eqn="prod @2 1 2"></f><f eqn="prod @3 21600 pixelWidth"></f><f eqn="prod @3 21600 pixelHeight"></f><f eqn="sum @0 0 1"></f><f eqn="prod @6 1 2"></f><f eqn="prod @7 21600 pixelWidth"></f><f eqn="sum @8 21600 0"></f><f eqn="prod @7 21600 pixelHeight"></f><f eqn="sum @10 21600 0"></f></formulas><path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></path><lock aspectratio="t" v:ext="edit"></lock></shapetype><shape id="_x0000_s1026" style="MARGIN-TOP: -87.6pt; Z-INDEX: 1; LEFT: 0px; MARGIN-LEFT: -90pt; WIDTH: 12pt; POSITION: absolute; HEIGHT: 12pt; TEXT-ALIGN: left; mso-wrap-distance-left: 0; mso-wrap-distance-right: 0; mso-position-vertical-relative: line" o:allowoverlap="f" alt="" type="#_x0000_t75"><font size="3"><imagedata o:title="folder_open" src="file:///C:%5CDOCUME~1%5Cpowinder%5CLOCALS~1%5CTemp%5Cmsohtml1%5C01%5Cclip_image001.gif"></imagedata><wrap type="square"></wrap></font></shape>sites <shape id="_x0000_s1027" style="MARGIN-TOP: -87.6pt; Z-INDEX: 2; LEFT: 0px; MARGIN-LEFT: -90pt; WIDTH: 12pt; POSITION: absolute; HEIGHT: 12pt; TEXT-ALIGN: left; mso-wrap-distance-left: 0; mso-wrap-distance-right: 0; mso-position-vertical-relative: line; mso-position-horizontal-relative: text" o:allowoverlap="f" alt="" type="#_x0000_t75"><imagedata o:title="line" src="file:///C:%5CDOCUME~1%5Cpowinder%5CLOCALS~1%5CTemp%5Cmsohtml1%5C01%5Cclip_image002.gif"></imagedata><wrap type="square"></wrap></shape><shape id="_x0000_s1028" style="MARGIN-TOP: -87.6pt; Z-INDEX: 3; LEFT: 0px; MARGIN-LEFT: -90pt; WIDTH: 12pt; POSITION: absolute; HEIGHT: 12pt; TEXT-ALIGN: left; mso-wrap-distance-left: 0; mso-wrap-distance-right: 0; mso-position-vertical-relative: line; mso-position-horizontal-relative: text" href="javascript:parent.loadNode(document,%20542529696);" o:allowoverlap="f" alt="" type="#_x0000_t75" o:button="t"><imagedata o:title="upcross" src="file:///C:%5CDOCUME~1%5Cpowinder%5CLOCALS~1%5CTemp%5Cmsohtml1%5C01%5Cclip_image003.gif"></imagedata><wrap type="square"></wrap></shape><shape id="_x0000_s1029" style="MARGIN-TOP: -87.6pt; Z-INDEX: 4; LEFT: 0px; MARGIN-LEFT: -90pt; WIDTH: 12pt; POSITION: absolute; HEIGHT: 12pt; TEXT-ALIGN: left; mso-wrap-distance-left: 0; mso-wrap-distance-right: 0; mso-position-vertical-relative: line; mso-position-horizontal-relative: text" o:allowoverlap="f" alt="" type="#_x0000_t75"><imagedata o:title="ufolder" src="file:///C:%5CDOCUME~1%5Cpowinder%5CLOCALS~1%5CTemp%5Cmsohtml1%5C01%5Cclip_image004.gif"></imagedata><wrap type="square"></wrap></shape>:

default <shape id="_x0000_s1030" style="MARGIN-TOP: -87.6pt; Z-INDEX: 5; LEFT: 0px; MARGIN-LEFT: -90pt; WIDTH: 12pt; POSITION: absolute; HEIGHT: 12pt; TEXT-ALIGN: left; mso-wrap-distance-left: 0; mso-wrap-distance-right: 0; mso-position-vertical-relative: line; mso-position-horizontal-relative: text" o:allowoverlap="f" alt="" type="#_x0000_t75"><imagedata o:title="line" src="file:///C:%5CDOCUME~1%5Cpowinder%5CLOCALS~1%5CTemp%5Cmsohtml1%5C01%5Cclip_image002.gif"></imagedata><wrap type="square"></wrap></shape><shape id="_x0000_s1031" style="MARGIN-TOP: -87.6pt; Z-INDEX: 6; LEFT: 0px; MARGIN-LEFT: -90pt; WIDTH: 12pt; POSITION: absolute; HEIGHT: 12pt; TEXT-ALIGN: left; mso-wrap-distance-left: 0; mso-wrap-distance-right: 0; mso-position-vertical-relative: line; mso-position-horizontal-relative: text" o:allowoverlap="f" alt="" type="#_x0000_t75"><imagedata o:title="end" src="file:///C:%5CDOCUME~1%5Cpowinder%5CLOCALS~1%5CTemp%5Cmsohtml1%5C01%5Cclip_image005.gif"></imagedata><wrap type="square"></wrap></shape><shape id="_x0000_s1032" style="MARGIN-TOP: -87.6pt; Z-INDEX: 7; LEFT: 0px; MARGIN-LEFT: -90pt; WIDTH: 12pt; POSITION: absolute; HEIGHT: 12pt; TEXT-ALIGN: left; mso-wrap-distance-left: 0; mso-wrap-distance-right: 0; mso-position-vertical-relative: line; mso-position-horizontal-relative: text" o:allowoverlap="f" alt="" type="#_x0000_t75"><imagedata o:title="folder" src="file:///C:%5CDOCUME~1%5Cpowinder%5CLOCALS~1%5CTemp%5Cmsohtml1%5C01%5Cclip_image006.gif"></imagedata><wrap type="square"></wrap></shape>

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开发的知。。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值