1 :
2 :
3 :
4 :
5 :
6 :
7 :
8 :
9 :
10 :
11 :
Java/Servlet/OS
环境信息。这个标签是通过标准的
System.getProperty(value)
来获得 Java 虚拟机信息的。如果给出的 property 的值没有对应的键值时,会返回错误信息。
二、一些问题
1. 路径问题: 代码:
如果在OPENCMS后台打开JSP页面时,该param下内容无法显示,须另开窗口,对应URL才可显示。
2.如何显示目录下的内容。
<% if (getResourceCount(__cms, " TEEMA_Ad/Home/Wide_Block_1/|teemaAd " , false ) > 0 ) { %>
< cms:contentload collector = " allInFolderDateReleasedDesc " param = " TEEMA_Ad/Home/Wide_Block_1/|teemaAd "
editable = " true " >
< img src = " /eeonline/cms
<% } %>
<%
}
%>
3 .创建文件类别 在opencms-modules.xml中:
< explorertype name = " teemaNews " key = " fileicon.teemaNews " icon = " article.gif " reference = " xmlcontent " >
< newresource page = " structurecontent " uri = " newresource_xmlcontent.jsp?newresourcetype=teemaNews " order = " 4 "
autosetnavigation = " false " autosettitle = " false " />
< accesscontrol >
< accessentry principal = " GROUP.Administrators " permissions = " +r+v+w+c " />
< accessentry principal = " GROUP.Projectmanagers " permissions = " +r+v+w+c " />
< accessentry principal = " GROUP.Users " permissions = " +r+v+w+c " />
===============================================
< type class = " org.opencms.file.types.CmsResourceTypeXmlContent " name = " teemaNews " id = " 1003 " >
< properties >
< property >
< name > content - conversion
< value type = " shared " >
< property >
< name > template - elements
< value type = " shared " >
< param name = " schema " >/ system / modules / com.teema.eeonline / schemas / teemaNews.xsd
在后台schemas中,新建文件,类别为xsd,然后eidt source。代码请参考相关文件。
4 .模板文件的使用 选择文件,右键属性->高级
然后在template中输入对应的模板路径。
本工程的模板目录路径为上图所示,每个模板的功能,都有相应的说明。
5 . 文件包含与变量问题
a) 不能在包含的js文件里,引用父JSP文件的变量。
b) 最好不要用
6. 关于文件发布
a) 同步后,要进行发布,更改后的文件才能生效。
b) 个别文件的改动发布,如果改动到模块文件所包含的文件,发布时,不能只发布包含文件 ,而模板文件也要改动再发布。
7 .关于 ContentLoad Tag 中的变量
1) go to WEB-INF/opencms.tld and add
2) Alternatively you could put the value into the pageContext (
and then use a macro "
8 . Accessing files with a new CmsObject instance
import org.opencms.file.CmsObject;
import org.opencms.file.CmsProject;
import org.opencms.main.CmsException;
import org.opencms.main.OpenCms;
// ...
cmsObject = OpenCms.initCmsObject( "Guest" );
cmsObject.loginUser( "Admin", "admin" );
CmsProject cmsProject = cmsObject.readProject( "Offline" );
cmsObject.getRequestContext().setCurrentProject( cmsProject );
cmsObject.getRequestContext().setSiteRoot( "/" );
9. 后台页面form文本域的提交,所在的类CmsToolManager.initParams(CmsToolDialog wp)