- 浏览: 1046884 次
- 性别:
- 来自: 杭州
最新评论
-
nieanan:
感谢,很有帮助。
eclipse 改变JAVA_HOME路径 -
Orange_killer:
写的什么东西,文不对题
Hibernate Search大数据量手动建立索引 -
xiaoasha:
org.eclipse.equinox.servlet.api ...
《OSGI实战》遇到的问题 -
powertech:
写的挺细,有用!
SyntaxError: Non-ASCII character Python、Unicode和中文 -
huang_yong:
public class XMLUtil {
pri ...
XStream 去除生成的XML节点的class="list"
文章列表
我引用两个老外的代码来说明问题:如果你使用这一段代码,试图改变一个xmlcontent的内容的话,你不会成功CmsResource document = (CmsResource) cms.getCmsObject().readResource(xmlcontentPath);
CmsXmlContent xmlContent = CmsXmlContentFactory.unmarshal(cms.getCmsObject(), document, request);
xmlContent.getValue("Date", cms.getRequestContext() ...
- 2008-03-20 14:22
- 浏览 1480
- 评论(2)
直接调用过OpenCms api的肯定知道,org.opencms.xml.content.CmsXmlContent有两种获得value的方法:public CmsXmlContentValueSequence getValueSequence(java.lang.String name, java.util.Locale locale)和public I_CmsXmlContentValue getValue(java.lang.String path, ...
- 2008-03-17 17:53
- 浏览 1532
- 评论(0)
east_java 兄问我static export如何操作,我给他说明一下,其实非常简单: 登陆OpenCms,在最顶上的菜单里面选择:view=Administration 再选择DataBaseManagement,然后在Additional tools里面选择start static export,然后顺着wizard一步一步往下就可以了。如果遇到404问题,可以参照OpenCms static export 404 error 这篇文章。希望对你有帮助。
- 2008-03-17 17:30
- 浏览 3340
- 评论(3)
今天遇到了一个jdbc的异常:
java.sql.SQLException: Data truncated for column 'XXX' at row 1在http://forums.mysql.com/read.php?39,57206,57366上面找到了原因,贴出来和大家共享,原因是column 'XXX'在数据库里面定义的是Float类型,而我在set PreparedStatement的时候,把值设成了string(st.setString(index, value)),实际上应该调用setFloat,和mysql那篇文章犯了同样的错误。
- 2008-03-14 19:42
- 浏览 8865
- 评论(0)
以下代码的作用是使用Java正则表达式从字符串:"fdkaljjdklafj12345.6789afjakfdall34567.89fdsalffsafa"分离出数字。 Matcher m = Pattern.compile("[\\d.]+").matcher("fdkaljjdklafj12345.6789afjakfdall34567.89fdsalffsafa");
m.find();
String value = m.group();
Float lValue = Float.valueOf(v ...
介绍两个用于开发firefox extension 的eclipse 插件:
1.XulBrooster: http://cms.xulbooster.org/
2.Spket IDE: http://www.spket.com/download.html
- 2008-03-13 15:49
- 浏览 1849
- 评论(0)
with 语句通常用来缩短特定情形下必须写的代码量。在下面的例子中,请注意 Math 的重复使用:
x = Math.cos(3 * Math.PI) + Math.sin(Math.LN10)
y = Math.tan(14 * Math.E)
当使用 with 语句时,代码变得更短且更易读:
with (Math){
x = cos(3 * PI) + sin (LN10)
y ...
- 2008-03-12 20:28
- 浏览 1588
- 评论(0)
如果想在OpenCms发布数据的同时do something怎么办呢?你可以使用PublishListener,publish事件监听器,OpenCms有事件的概念,有点类似javascript的listener。下面我就教你怎么写一个完整的Publish监听器。 第一步:创建一个ActionClass继承org.opencms.module.I_CmsModuleActionimport org.opencms.configuration.CmsConfigurationManager;
import org.opencms.db.CmsPublishList;
import org.open ...
if static export is disabled nothing is exported and the rules are notused.For the handeling of the link tags one standard rule is generated withthe url_prefix_http value. So you can still configure the servletpath.staticexport.enabled=truethe static export is controlled by the resource property expo ...
- 2008-03-03 16:05
- 浏览 2088
- 评论(0)
javascript 程序在第一次获得一个页面对象,比如var el = document.getElementById('div1'); 这个时候如果你取el.style.width,你可能得到的值为''值,除非你设置了el.style.width,比如el.style.width="200px";然后你再alert(el.style.width);这时才会弹出'200px'。可是css里面明明设置了这个值为什么没有值呢,原来初始值不再style.width里面,在currentstyle里面,调用以下代码,即使在第一次取style的值也是可行的(IE,FF测试通过):
...
想在save的时候保存,structureId,然后通过StructureId创建一个CmsXmlContent对象,我的思路是:
通过CmsJspActionElement获得CmsObject
调用org.opencms.file.CmsObject 的
public CmsResource readResource(CmsUUID structureID)
throws CmsException
然后调用org.opencms.xml.content.CmsXmlContentFactory 的
public static CmsXml ...
- 2008-02-26 21:07
- 浏览 1537
- 评论(0)
在写一个模版用到了contentLoad collector="allInFolderNavPos "
结果一直报错:
CmsException: Collector "allInFolderNavPos " was not found.
知道为什么吗?就是因为最后多了一个空格,opencms居然不做trim().
- 2008-02-23 14:36
- 浏览 1583
- 评论(0)
String str_nombreUltimo = "";
CmsJspXmlContentBean content = new CmsJspXmlContentBean(pageContext, request, response);
CmsJspTagContentLoad contentlist = (CmsJspTagContentLoad)content.contentload("allInFolder",str_pathCarpeta + "diario_${number}.html|DiarioMural|1", ...
- 2008-02-19 16:47
- 浏览 1537
- 评论(0)
opencms-system.xml里面<sites>
<workplace-server>http://localhost:8080</workplace-server>
<default-uri>/sites/default/</default-uri>
<site server="http://localhost:8080" uri="/sites/default/"/>
</sites>
的localhost全部改成你 ...
- 2008-02-19 14:24
- 浏览 1797
- 评论(0)
在网上找到一段程序是用来OpenCms搜索的,我做了一点改动用来在jsp上面搜索一些xmlcontent的内容。具体searchManage的配置我就不罗嗦了,OpenCms自己有文档,我直接进入主题:CmsJspActionElement cms = new CmsJspActionElement(pageContext,request,response);
String keywords = "test";
CmsSearch search = new CmsSearch();
search.setMatchesPerPage(20);
search.setDispl ...
- 2008-02-18 17:06
- 浏览 2485
- 评论(1)