`

Liferay重要对象-Layout

阅读更多
A layout is an instance of a single page, composed of one or more portlets arranged inside of various columns (sometimes referred to as the "narrow" and "wide" columns). A layout is somewhat synonymous with a "page" (i.e. a single web page). They have a unique internal ID known as the "portlet layout Id". They are stored in the Layout table. The primary key of the Layout table (com.liferay.portal.service.persistence.LayoutPK) is composed of the "owner id" and the "layout id". The "owner id" is composed of a prefix indicating if it is "public" (PUB.) or "private" (PRI.), followed by the "group id" (i.e. the community that owns the layout). A "public" layout is one that is shared by more than one user, and thus changes to the layout by the end user should not be persisted. To facilitate this, the portal system will "clone" a temporary version of the public layout for the user to configure. This temporary version survives only for the duration of the session.

Note in version 4.3, most primary keys in tables have been changed to "long", and thus the string key "owner Id" is no longer passed around. The primary key of the Layout table is now simply a "plid" that is a "long". The "owner Id" part has been broken out into an explicit group Id field, and an explicit boolean field named "private" to indicate if the layout is public or private.
The layout Id is a sequential number unique for the specified owner Id.

Every group has both a public and a private layout set associated with it. Thus (theoretically), every group has both a public and a private web site).

Only users who are in the "Power User" category are allowed to create/modify layouts for the portal.

The default user layout name is "Home", defined in portal.properties under default.user.layout.name

Sometimes in the code, you'll see reference to the request parameter p_l_id (which may be represented by the variable plid). The "plid" is an encoded string that contains "owner ID" and "layout id" components concatenated. Call Layout.getLayoutId(plid) or Layout.getOwnerId(plid) to extract the desired component. The owner ID can further be de-composed into the group ID by calling Layout.getGroupId(ownerId) (Layout.getOwnerId(plid) is no longer available (nor needed) in 4.3. Layout.getGroupId() longer requires the plid parameter).

A layout is assigned one of four types:

Portlet: A standard page that is a container for one or more portlets
Embedded: Embeds the contents of another URL into the page (i.e. the page contents will be the page contents of the specified URL).
URL: Selecting this page will redirect the user to the new URL. Unlike Embedded, the browser's address will become the new URL (vs. having the contents found at the URL embedded in the portal).
Article: Unknown purpose. Does not seem to be referenced in the code. (Layout describes it as: This type of layout shows a single content created with Liferay Journal)
Internal code: A layout has an associated "type settings" (type as in class, not as in typeface), which holds type specific configuration. For example, the "type settings" for a Portlet layout is actually a comma separated list of name/value pairs (properties) that contains, among other things, the individual portlets that are contained within the layout. The "type settings" for URL are the URL iteself.

A layout of type "portlet" is configured when you click on the "Add content" menu option in Liferay. That menu option calls a JavaScript function named LayoutConfiguration.toggle(), defined in the file /portal/portal-web/docroot/html/js/portlet/layout_configuration.js. That method initiates an AJAX call to render a special portlet known as the "Layout configuration" portlet. The code that handles the actual contents of the layout configuration portlet is located in /portal/portal-web/docroot/html/portlet/layout_configuration/*.jsp.
==================================================================
Layout Set
Each layout is a member of layout set (com.liferay.portal.model.LayoutSet). A layout set represents a group of layout pages, and thus a layout set can be thought of as a "web site", or more specifically, a "portal instance." Since each user has a private group associated with them, this allows each individual user to maintain their own custom portal.

The theme and color scheme used by a layout can either be set individually for the layout, or it is inherited from its layout set.


分享到:
评论

相关推荐

    liferay+Portal+二次开发指南

    - **liferay-layout-templates.xml**: 布局模板的配置文件。 - **liferay-look-and-feel.xml**: 控制门户外观的配置文件。 #### 四、Liferay Portal 二次开发 ##### 第三章 开发自己的 Portlet - **重要的基类**:...

    liferay-demo-modules

    Liferay 是一个开源的企业...开发者可以查看源代码,了解每个模块的结构、配置文件、Maven 构建脚本等内容,这对于掌握 Liferay 开发环境和开发流程至关重要。此外,这些示例还可以作为教学材料,帮助初学者快速入门。

    liferay

    - **liferay-layout-templates.xml**:定义了可用的布局模板。 - **liferay-look-and-feel.xml**:配置门户的主题和外观。 #### 三、Liferay Portal 二次开发 本部分将详细介绍如何开发自己的 Portlet 并集成到 ...

    LiferayPortal二次开发指南破解版.pdf

    liferay-layout-templates.xml 文件用于配置 Portal 页面的布局模板。 ##### 2.6.7 liferay-look-and-feel.xml liferay-look-and-feel.xml 文件用于定义 Portal 的外观和感觉,包括颜色方案、字体等。 #### 三、...

    liferay 6.0.5 api

    这简化了数据库交互,并支持ORM(对象关系映射)。 2. **Portlet API**: Liferay Portlet API 是基于JSR 168和286标准的,允许开发者创建可重用、可配置的Web组件。这些portlet可以在门户页面上与其他portlet并排...

    Liferay 6.0.5 portal.properties 配置文件详解

    在 Liferay 中,`portal.properties` 文件是一个至关重要的配置文件,它定义了系统的全局属性和行为。对于 Liferay 6.0.5 版本,理解并熟练掌握 `portal.properties` 文件的配置至关重要,因为它直接影响到平台的...

    Access Objects from Velocity

    以下是一些重要的对象及其用途: - `arrayUtil`:提供数组操作的工具类。 - `browserSniffer`:用于浏览器检测。 - `dateFormats`、`dateTool`、`dateUtiles`:提供日期格式化和工具类。 - `escapeTool`:提供HTML...

    J2EE开源框架

    ### J2EE开源框架知识点详解 #### J2EE开发中的基本准则 ...以上是对 J2EE 开发中的一些基本准则以及主流开源软件和框架的详细介绍,这些工具和技术的选择对于构建高效稳定的 J2EE 应用程序至关重要。

    JetSpeed2开发文档的中文翻译

    组件框架随后创建JetspeedEngine对象,负责门户的核心逻辑处理。 #### JetSpeed2的安全机制 虽然文档中没有具体提及安全机制的细节,但基于J2的整体设计原则可以推测,它可能包含一系列标准的安全措施,如认证、...

Global site tag (gtag.js) - Google Analytics