Initial liferay Analysis

Source: Internet
Author: User
Tags i18n
Document directory
  • 1. Determine whether the user has logged on to liferay. The corresponding model user _
  • 2. Load the static resource file barebone. jsp, everything. jsp
  • 3. i18n
1. Determine whether the user has logged on to liferay. The corresponding model user _

User user = portalutil.Getuser(Request );

2. Load the static resource file barebone. jsp, everything. jsp

When loading JS files, liferay was optimized. a js file that only introduced the least needed was finally combined into barebone. JSP. One is to introduce all JS files and combine them into everything. JSP,

In portal-Web/docroot/html/common/themes/top_js.jspf, you can judge the JS

There is a configuration item in the Portlet. properties.

Javascript. barebone. Enabled = true

When set to true, the file is loaded from the path specified by JavaScript. barebone. Files.

When set to false, the file in the path specified by JavaScript. Everything. files will be loaded.

The number of files in "javascript. barebone. Files" is indeed more than that in "javascript. Everything. Files", but the comment is not displayed.

 

3. Load i18n in the i18njs File

Liferay.Language.get('add-account')

Sends an IO request, which is placed in the JS object cache of the current page.

Loading i18n from JSP files

<liferay-ui:message key="unable-to-connect-with-mail-server" />

Pre-compilation method, fast loading

 

Load i18n In the AuI script

<aui:input label="use-secure-incoming-connection" name="incomingSecure" type="checkbox" />

You can specify a label, and the corresponding label will be automatically parsed. If no label Label is specified, the name will be used as the label to query the corresponding i18n

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.