---
title: "使用liferay开发小记"
author: "fly_ever"
date: "2008-03-30T20:56:11Z"
tags: []
slug: "liferay"
draft: false
lastmod: "2008-12-24T21:13:18Z"
id: 177836
url: "https://fly-ever.iteye.com/blog/177836"
---

使用liferay开发系统时涉及到的对liferay的一些修改信息：

liferay版本4.3.3

1，系统不想使用liferay默认的能自己定制portlet外观信息的选项。

则修改liferay-portal\html\themes\_unstyled\templates下的portlet.vm，并且在

相应的各个风格下面也修改该文件，去掉文件中的$theme.iconPortletCss()。

则在每个portlet上不再有外观样式设置的选项。

2，在对个人或者对社区的页面进行设置时，会发现页面类型。该页面类型由portal.properties属性文件的layout.types属性设定。

3，想去掉我的帐户链接，则可以

	修改\html\themes\_unstyled\templates\init.vm文件，去掉我的帐户相关内容。

4，页面设置中很多功能需要屏蔽掉，修改

/portlet/communities/edit_pages.jsp文件即可。

5,如果想用外观样式功能，但想修改配置界面的内容，则可以按自己需要修改

\html\portlet\portlet_css\view.jsp该页面。

6，风格只保留一个.不要其他风格。

修改配置文件liferay-look-and-feel.xml

7，去掉公开页。保留我的公共(页面)，

修改页面：/html/taglib/ui/my_places/page.jsp，去掉公开页。去掉页面设置中的公开页设置。

8，在为liferay系统添加内容时，想要字体更大，添加内容的页面出现在页面中间。

则修改js文件，js/liferay/layout_configuration.js,修改toggle方法，width:400,noCeneter:false;这样可以使添加内容的页面显示在整个页面中间。

修改\html\portlet\layout_configuration中的view_category.jsp页面，则可以修改添加内容页面的显示内容和样式。

9，权限达到可看不可用的效果。

设置一些portlet的权限，使某些用户能看而不能添加。修改html\portlet\layout_configuration\view_category.jsp页面。

取得所有的portlet ,而不是用户有权限添加的portlet.

在展示用户添加portlet时，设置不可添加的portlet添加按钮不可用。

10，liferay系统中，如果不通过liferay而修改数据库中的数据，则在liferay系统中不能看到实时更新的效果，因为liferay采用缓存机制。

需要修改持久实现类

service.persistence.&times;&times;&times;&times;PersistenceImpl中的对应方法，使用直接查询，而不采用读取缓存的操作，这样才能得到实时更新的数据。

去掉：

       

```java
Object result = FinderCache.getResult(finderClassName,
                finderMethodName, finderParams, finderArgs, getSessionFactory());
        FinderCache.putResult(finderClassName, finderMethodName,
                    finderParams, finderArgs, list);
```




在对持久化对象进行更新操作时，会调用下面的代码，所以可以保持在缓存中的对象是最新的。

           

```java
FinderCache.clearCache(AICustomerReports.class.getName());
```

[![](http://fly-ever.iteye.com/upload/picture/pic/28269/e1d6d17f-acf7-32b9-b489-cd751d8a1de3.jpg)](http://shop35486993.taobao.com/)