欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Liferay学习笔记

程序员文章站 2022-07-15 13:21:56
...

https://dev.liferay.com/zh/develop/tutorials/-/knowledge_base/7-0/liferay-mvc-portlet

Liferay看文档艰难自学进度

Portlets

目录

Portlets

1.1Liferay MVC Portlet


1.1Liferay MVC Portlet

  1.1.1 Liferay MVC Portlet

  1.1.2 MVC Layers and Modularity(MVC层与模块化)

  1.1.3 Liferay MVC Command Classes(Liferay MVC命令类)

           *Liferay 提供MVC命令类分解控制器功能

           MVCActionCommand: 由URL调用保存-ActionCommand类中的操作

           MVCRenderCommand:-RenderCommand类响应URL,分派JSP,实现跳转

           MVCResourceCommand: 使用-resourcecommand类通过响应资源URL来执行MVC portlet中的资源服务

 1.1.4 Liferay MVC Portlet Component(Liferay MVC Portlet组件)

           Simple example:

@Component(
    immediate = true,
    property = {
        "com.liferay.portlet.css-class-wrapper=portlet-hello-world",
        "com.liferay.portlet.display-category=category.sample",
        "com.liferay.portlet.icon=/icons/hello_world.png",
        "com.liferay.portlet.preferences-owned-by-group=true",
        "com.liferay.portlet.private-request-attributes=false",
        "com.liferay.portlet.private-session-attributes=false",
        "com.liferay.portlet.remoteable=true",
        "com.liferay.portlet.render-weight=50",
        "com.liferay.portlet.use-default-template=true",
        "javax.portlet.display-name=Hello World",
        "javax.portlet.expiration-cache=0",
        "javax.portlet.init-param.always-display-default-configuration-icons=true",
        "javax.portlet.name=" + HelloWorldPortletKeys.HELLO_WORLD,
        "javax.portlet.resource-bundle=content.Language",
        "javax.portlet.security-role-ref=guest,power-user,user",
        "javax.portlet.supports.mime-type=text/html"
    },
    service = Portlet.class
)
public class HelloWorldPortlet extends MVCPortlet {
}

           Liferay的服务注册表希望导入的类是javax.portlet.portlet,而不是com.liferay.portal.kernel.model.portlet。

 

 

相关标签: liferay