liferay中的user_personal_bar portlet

user_personal_bar portlet 是portal页面中的用户logo和用户全名,点击打开用户菜单。

是在theme模板中引用的,这是一个自定义的宏命令<@liferay.user_personal_bar />

该portlet的名称在ProductNavigationUserPersonalBarPortletKeys.PRODUCT_NAVIGATION_USER_PERSONAL_BAR中定义,其值是:

com_liferay_product_navigation_user_personal_bar_web_portlet_ProductNavigationUserPersonalBarPortlet

对应的bundle是:com.liferay.product.navigation.user.personal.bar.web

源码在:modules/apps/web-experience/product-navigation/product-navigation-user-personal-bar-web

Telnet localhost 11311后使用gogo shell

! ss | grep bar

显示:

535 ACTIVE    com.liferay.portlet.configuration.toolbar.contributor.locator.api_2.0.3

552 ACTIVE    com.liferay.product.navigation.user.personal.bar.web_2.0.10

627 ACTIVE    com.liferay.staging.bar.web_1.0.20

Bundle id是552

可以停止该portlet模块:

stop 552

刷新portal页面,可以看到用户logo和姓名消失了,然后:

start 552

刷新页面后又回来了。

该portlet中调用getFullname()返回当前用户的全名,对于中文,姓和名之间没有必要有空格,找到方法实现,加上.replaceAll(" ",""),把空格去掉。

你可能感兴趣的:(liferay中的user_personal_bar portlet)