[Liferay] Liferay 瘦身,Liferay 精简,取消加载 Portlet

liferay version  :  liferay-portal-6.1.1-ce-ga2

server  : tomcat 7.0.25


Liferay是很庞大,Portal 自带几十个 Portlet, 但是完全可以自己根据需求选择性加载 Portal 自带的 Portlet。


好处就是:

1,启动速度(性能)的提升

2,界面能变得更加简洁,毕竟不需要的 Portlet 都看不到了


看着玄乎其实很简单,就以 Liferay 6.1 版本来说

1. 打开 Portal 的 liferay-portlet.xml

2. 在不需要加载的 Portlet 配置内添加 <include>false</include> 

<portlet>
	<portlet-name>16</portlet-name>
	<icon>/html/icons/currency_converter.png</icon>
	<struts-path>currency_converter</struts-path>
	<preferences-owned-by-group>false</preferences-owned-by-group>
	<use-default-template>false</use-default-template>
	<remoteable>true</remoteable>
	<private-request-attributes>false</private-request-attributes>
	<private-session-attributes>false</private-session-attributes>
	<render-weight>0</render-weight>
	<css-class-wrapper>portlet-currency-converter</css-class-wrapper>
	<include>false</include>
</portlet>


注意 <include>false</include> 在 portlet 里面的得按照规定的顺序,比如上述例子就是在 css-class-wrapper 之后

3. 重启服务看效果吧


有兴趣的可以看看 liferay-portlet.xml 的 dtd 文件 liferay-portlet-app_6_1_0.dtd

里面对 <include> 属性的介绍很详细了。


Set the include value to true to if the portlet is available to the portal. If
set to false, the portlet is not available to the portal. The default value is
true.


Portlets that are not included as part of the portal are never available to the
user to be made active or inactive. As far the user knows, the portlets do not
even exist in the system. This allows the Liferay developers to bundle a lot of
portlets in one core package, and yet allow custom deployments to turn on or off
individual portlets or sets of portlets. This follows the Siebel and Microsoft
model of bundling everything in one core package, but using XML configuration or
registry settings to turn on and off features or sets of features.


We do not recommend that custom deployers modify the core source by removing
specific portlets because this prevents an easy upgrade process in the future.
The best way to turn on and off portlets is to set the include element. The
advantage of this way of doing things is that it becomes very easy to deploy
Liferay. All features are available in one package. The disadvantage is that by
not utilizing all of the portlets, you are wasting disk space and may even take
a small but static memory footprint. However, we feel that the extra disk space
and memory usage is a cheap price to pay in order to provide an easy
installation and upgrade path.


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Liferay 使用手册是指Liferay平台的一份详细说明文档,用于指导用户如何正确安装、配置和使用Liferay平台的各项功能和特性。 Liferay是一种开源的企业门户解决方案,它提供了许多功能和工具,方便用户快速搭建和管理自己的网站、门户或应用程序。然而,对于不熟悉Liferay的用户来说,往往需要一个指导手册来帮助他们更好地理解和使用平台。 Liferay 使用手册通常会包含以下内容: 1. 安装和部署指南:介绍如何正确安装和部署Liferay平台,并提供相应的操作步骤和注意事项。 2. 配置和管理:详细说明如何进行Liferay平台的配置和管理,包括用户管理、权限设置、主题和布局等。 3. 内容管理:介绍如何创建和管理网站的内容,包括新闻、博客、论坛等功能,并提供相应的操作示例。 4. 社交协作:解释如何使用Liferay平台进行协作和合作,包括团队和项目管理、文档共享、日历和通知等。 5. 应用程序开发:指导开发人员如何使用Liferay平台进行应用程序的开发和集成,包括使用API和插件的方式。 6. 故障排除和支持:提供常见问题的解答和故障排除的方法,以及如何获取更多的支持和帮助。 总之,Liferay 使用手册是一份重要的指导文档,它可以帮助用户快速入门和掌握Liferay平台的使用方法,提高工作效率和用户体验。用户可以根据手册中提供的步骤和示例,了解和掌握各个功能的使用方式,从而更好地利用Liferay平台来满足自己的需求。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值