原创

Liferay6.2常用功能笔记记录

一、安装环境资源文件准备

相关文件下载: https://sourceforge.net/projects/lportal/files/Liferay%20Portal/

二、Liferay6.2API文档

文档访问地址:https://docs.liferay.com/portal/6.2/javadocs/
标签相关:https://docs.liferay.com/portal/6.2/taglibs/ 系统配置文件:https://docs.liferay.com/portal/6.2/propertiesdoc/

三、Liferay 相关网站链接

网址链接:https://liferay.dev/search?q=liferay
帮助中心:https://help.liferay.com/hc/zh-cn
官方网站:https://portal.liferay.dev/

四、Liferay6.2常用代码

// liferay打印日志
private static Log _log = LogFactoryUtil.getLog(Test.class);

// 该类ServiceContext是用于传递服务的上下文信息的参数类。使用参数类可以让您将具有不同可选参数集的许多不同方法合并到一个更易于使用的方法中。该类还汇总了 Liferay 核心 portlet 中使用的功能所需的信息,例如权限、标记、分类等。

ServiceContext serviceContext = new ServiceContext();

ServiceContext serviceContext = ServiceContextFactory.getInstance(BlogsEntry.class.getName(), portletRequest);

// 在portlet中获取参数

long locationId = ParamUtil.getLong(request, "locationId" ,默认值);

// 该ThemeDisplay对象提供有关门户的许多方面的信息。它可以识别门户实例、当前用户、用户的语言和用户的导航上下文。它可以告诉您portlet 的脚本和图像、主题的图像和文件以及门户的主文件夹的路径。它还可以让您知道用户是否已登录以及该用户是否被冒充。

ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);


// Liferay获取时间

Calendar calendar = CalendarFactoryUtil.getCalendar();
int displayDateMonth = calendar.get(Calendar.MONTH);
int displayDateDay = calendar.get(Calendar.DAY_OF_MONTH);
int displayDateYear = calendar.get(Calendar.YEAR);
int displayDateHour = calendar.get(Calendar.HOUR_OF_DAY);
int displayDateMinute = calendar.get(Calendar.MINUTE);




正文到此结束
本文目录