1.Liferay Portal Framework Analysis

Preface ... 5

The first part of the Liferay Portal Framework Analysis ... 6

Chapter Liferay Portal. 6

Section 6 Portal specifications ...

1.1.1 JSR168. 6

1.1.2 WSRP. 6

What is Portal7 II

1.2.1 Portal Server ... 7

1.2.2 Portlet Container ... 7

What is Portlet8 III

1.3.1 Portlet8

1.3.2 Portlet and Servlet relationship ... 8

1.3.3 Portlet life cycle ... 9

IV Liferay Portal works ... 9

1.4.1 Portlet style and window state ... 10

1.4.2 Portal Page ... 11

Liferay Portal's use of Chapter 13 ...

Section Liferay Portal Installation ... 13

Liferay Portal user strategy II ... 14

2.2.1 User defined ... 14

2.2.2 Add Users ... 15

2.2.3 modify the user ... 15

2.2.4 the definition of user groups ... 18

2.2.5 add, rename, user group ... 19

2.2.6 modify the user group ... 19

2.2.7 define the role ... 21

2.2.8 add, rename, role ... 21

2.2.9 modify the role of user groups ... 21

2.2.10 Portlet definition of the role of ... 22

Liferay Portal content and layout of the third quarter ... 24

2.3.1 What is the layout ... 24

2.3.2 What is the content ... 26

2.3.3 Portlet layout and content of the relationship between ... 27

2.3.4 Select the content and layout ... 28

Liferay Portal IV desktop ... 28

2.4.1 What is the Desktop ... 28

2.4.2 Definition personalized desktop ... 29

Liferay Portal V quality ... 29

2.5.1 What is quality ... 30

2.5.2 quality and Portlet, Portal's relationship ... 30

2.5.3 Definition of quality personalized ... 30

Section VI Liferay Portal deployment descriptor ... 31

2.6.1 web.xml31

2.6.2 portlet.xml32

2.6.3 liferay-Portlet.xml33

2.6.4 liferay-display.xml34

2.6.5 liferay-layout-templates.xml35

2.6.7 liferay-look-and-feel. xml35

The second part of the Liferay Portal Second Development ... 36

Chapter III to develop their own Portlet. 36

Section important base class: GenericPortlet36

Section Portlet tag ... 37

3.2.1 defineObjects 37 tags ...

3.2.2 renderURL 37 tags ...

3.2.3 actionURL 38 tags ...

3.2.4 param tag ... 38

3.2.5 namespace tag ... 38

Section 38 Portal objects ...

3.3.1 Request Object ... 39

3.3.2 Response object ... 41

3.3.3 PortletConfig object ... 41

3.3.4 Session objects ... 41

3.3.5 Preference objects ... 43

Portlet class IV to write your own ... 44

3.4.1 Development Environment ... 44

3.4.2 preparations ... 44

3.4.3 HelloWorldPortlet46

3.4.4 HelloJSPPortlet47

Section V Web deployment descriptor changes ... 48

Section VI Liferay Portal deployment descriptor to create ... 49

The third part of the Liferay Portal deployment ... 54

Chapter deploy their own Portlet. 54

Section 54 Manual deployment ...

Ant II automatic deployment ... 55

Section III joined the Liferay Portal's own list ... 55

Section IV General Java Web application into a Portlet Application ... 56

Part IV Appendix ... 58

Chapter 58 related resources ...

Section 58 Resource Site ...

Section 58 of the sample ...

Chapter 59 References ...


The first part of the Liferay Portal Framework Analysis

This part of the main content

Portal Server Portal Portlet Container

Chapter Liferay Portal

Portal as an open source product, Liferay Portal provides the contents of multiple independent systems integration, to help various organizations to achieve more effective cooperation. Portal products to other businesses than, Liferay Portal has a number of good features, but do not pay.

Section Portal Specification

With the rise of Portal, a growing number of companies are involved in product development, Portal and the Portal components and set up their own based on its products, such as IBM, BEA, MicroSoft, SAP, Apache, etc.. Various manufacturers are not compatible interface to software developers and developers inconvenience.

1.1.1 JSR168

To this end, JCP group released JSR168 (Java Specification Request), Portlet Specification V1.0, used to provide different between Portal and Portlet interoperability. As long as follow the development of Portlet JSR168, you can all follow to deploy JSR168's Portal to run.

Portal JSR168 implementation defined specifications and interfaces, and the ideal Portlet carried out a detailed plan and description.

1.1.2 WSRP

WSRP is the OASIS Web Service for Remote Portlet initials. WSRP is a Web Service of a new business application, a new standard, mainly used to simplify the Portal for the integration of resources or the complexity of procedures, to avoid programming brought about the integration problems and issues. And Portal administrators can select the mass of WSRP services need to integrate the functions of the Portal in the currently used. It has three roles:

①, producers provide Portlet à

②, consumers use the Portlet à

③, the end-user end-user à

It features the producer is the consumer needs information through WSRP returned to the consumer, the information is relatively tag fragments, such as HTML, XHTML, etc., can be embedded directly the user's page, without resorting to develop a client Web Service Yiyang interfaces.

Achieve this standard, Portal can deal with a variety of data sources, a complete end to the dilemma of information island.

II What is the Portal

Portal is a Web-based order "application integration" and "to eliminate islands of information" as the ultimate goal, to provide single sign-on, content aggregation, personalization features such as portal customized integrated information system.

Usually complete by the Portal Server Portal, Portlet Container, Portlet form.

1.2.1 Portal Server

Portal Server is up Portlet container Portlet rendering support to the general or special Web server. Portal servers typically provide personalization, single sign-on, content aggregation, information dissemination, rights management and other functions, supports a variety of information sources of data and data on the pages of these combinations, to provide personalized content tailored different permissions visitors can browse the contents of different information. Usually, Portal provides the following features:

Single Sign: Portal usually Caiyong ACL, SSL, LDAP and other industry-standard security technology, provides access to all existing application security Ji Cheng, only the single entry in the Portal Shangdeng Lu once and can access all applications and data . For higher security requirements of applications such as e-commerce platforms, trading systems, by extending the interface to pass user identity information, such as digital certificate, digital signature information, the secondary authentication, to ensure the safety of single-point landing .

Access Control: System, LDAP right resources, a unified user management interface to provide secondary development, with other application systems user management module docking, and can Sui Xiang Guan business Xitongshishi update the access permissions. Through the improvement of the licensing mechanism and access control, user access control to field level to ensure that users can only access the applications with permissions and related information.

Content Management: Implementing real-time exchange of information between applications. Using a variety of caching mechanisms to guarantee the performance and accuracy of the content of the exchange. XML-based Rich Site Summary (RSS) standards, and rapidly spread among the various applications the latest changes.

News: Implementing a dynamic information portal content maintenance. Dynamic Website System collaboration with OA office systems, knowledge management systems integration, Web site information is subject to the approval process for transfer of OA system, or after the adoption of knowledge management platform settings with external share permissions Caike officially released, realize simultaneous internal and external information distribution .

Document Management: System for seamless integration of multiple data sources, including: databases, documents (Office documents, PDF, AutoCAD, and even ZIP document), Web pages, FTP sites, etc., and to data by business requirements and analyze the characteristics of finishing functions , take the initiative to push through a unified Web interface (Push) to the user's portal desktop to help users make timely and correct decisions.

1.2.2 Portlet Container

Portlet Portlet container provides the execution environment, including many Portlet and manage their life cycle, preservation Portlet customized information.

A Portal Portal container receives a request from then passes the request to the existence of this Portal Portlet container implementation. Portlet container Portlet no obligation to portfolio generated content, this work must be handled by the Portal. Portal and Portal Container can be put together as a single system component, or separate into two independent components.

Portlet container is an extension of ordinary Web Servlet container, so a Portlet container can be built on an existing Servlet container or may be all the Web Servlet container to achieve full functionality. Portlet containers regardless of how achieved, its operating environment is always assumed that it supports Servlet2.3 specification.

Usually, Portlet Container Servlet container extended from the ordinary.

III What is the Portlet

Portal Portlet is the most important component, is responsible for the content of the Portal in the present information, there is a corresponding life cycle. Through custom Portlet, users can easily define personalized Portal page. Managed by the Portlet container Portlet, processing the request and returns the dynamic page that can be plug and play as the Portal of the interface components.

1.3.1 Portlet

A Portlet is a Java technology for technology's Web component, managed by the Portlet container, specializing in customer information request and produce a variety of dynamic content. Portlet for the Pluggable client interface components to provide a presentation layer of information systems.

The content generated by the Portlet is called segment, while the fragment is marked with a number of rules (HTML, XHTML, WML), and other fragments can be composed of a complex document. One or more of the Portlet's content aggregation to become a Portal page. The Portlet Portlet life cycle are managed by the container control.

Interaction between the client and by the Portal Portlet The typical request/response be achieved, the normal term, for the customers and the Portlet Chansheng the Neironghudong, example, according to the next step of the connection or is Queren send the form, the results Portal Portlet action will be received, the status of turning this into the target Portlet. The Portlet generate the content for different users may have different changes, in full accordance with customer for the Portlet settings.

1.3.2 Portlet and Servlet relationship

Portlet is defined as a new component, with a new interface and behavior clear. In order to integrate as much as possible with the existing Servlet to re-use purposes, Portlet specification use of the Servlet specification, many concepts are similar, combined with Portlet, Servlet and Jsp system at the same site, we called the Portlet Application. Portlet applications in the same, they will share the same class loader (ClassLoader), context (Context) and the Session.

① , Portlet and Servlet similarities

@ Portlet components are Java technology web

@ Portlet is a specific container in the management

@ Portlet can dynamically generate a variety of content

@ Portlet lifecycle managed by the container

@ Portlet and client interaction is through the request / response mechanism

② , Portlet and Servlet are also some different

@ Portlet markup information generated only fragments, not full page document. The Portal will be all the Portlet markup fragments into a comprehensive information Portal website.

@ Portlet will not directly related to URL

@ Client must be through the portal system and Portlet Interaction

@ Portlet some defined request processing, action request and the render request.

@ Portlet Portlet modes and window defined default state can be pointed out that the page on which the Portlet functionality is being implemented and the current state.

@ Portlet can be in the same portal into multiple pages.

③ , Portlet some additional features are not available Servlet

@ Portlet can access and permanent storage of configuration files and custom information.

@ Portlet can access user data

@ Portlet with the URL rewrite functions in the file to dynamically create links that allow portal server do not have to know how to create links among Web pages and fragments of action.

@ Portlet can store temporary data in the Portlet session being, with two different areas:

application-wide scope and Portlet private scope.

④ , Portlet does not have some features, but there is provision of Servlet

@ Servlet has set the output encoding (character set encoding) mode

@ Servlet can set the HTTP header output

@ Servlet able to receive customer requests for the portal URL given

1.3.3 Portlet life cycle

A Portlet has a good life-cycle management, defines how to load, instantiate and initialize, and how to respond to a request from the client and how to send services. The Portlet Life Cycle from the Portlet interface init, processAction, render and destroy means to express.

Loading and instantiation: Portlet Container is responsible for loading and instantiating Portlet. Portlet when the Portlet Container running applications or delay to the needs of service users Portlet request, Portlet will be loaded and instantiated. After loading class Portlet, Portlet class to be instantiated immediately.

Initialization: Portlet class is instantiated, Portlet Container also need to initialize Portlet. To invoke the Portlet to respond to client requests. Portlet container calls the init method of Portlet interface initialization Portlet. The class can be extended out from the PortletConfig defined in the deployment descriptor file in the initialization parameters, and Resource Bundle.

Initialization exception: During initialization the Portlet, Portlet may throw PortletException UnavailableException or abnormal. At this point, Portlet Container Portlet can not be activated into service, and required the release of the Portlet container Portlet. destory method can not be called because the initialization is considered to fail. After the failure occurred, Portlet container will try to re-instantiate and initialize Portlet. The exception handling rules: from a UnavailableException specify a minimum time can not be executed when this exception occurs, Portlet Container Bixu to wait until after the specified time in the past generate and initialize a new Portlet.

Throw in the initialization process of the Runtime Exception exception, be treated as PortletException to deal with.

IV Liferay Portal works

Portal system as required by one or more Portal pages, each Portal page contains zero or more of the Portlet. Each Portlet present their own content, in order to achieve content aggregation. Available by defining the rights of each Portlet realize personalized information customized desktop.

1.4.1 Portlet style and window states

JCP organization of JSR168 Portlet specification defines a standard of achievement. Each Portlet external performance of a small window, have their own default style and window state. Shown above, Portlet has its own title, visit the state to support editing , close, move up, down, maximize, minimize function, edit, state support for return and shut-down. Extracted from various data sources of information to Portlet content in the form presented in the Portal.

Portlet style that is in any mode Portlet, Portlet usually based on the mode in which the implementation of different tasks and have different content.

Portlet Portlet mode to determine what it is that the show and what action the Executive. When calling a Portlet, Portlet Portlet container provides a model for the Portlet. When the action when dealing with a request, Portlet mode can use procedures to change.

JSR168 Portlet Specification defines three modes: view, edit and help, Liferay Portal supports all three modes in which. Portal is also the role of the user to decide is to provide (display) among Portlet mode to the user operation.

For example, anonymous users can browse and help to the operation mode of the contents of the Portlet, but had only authorized users can edit the Portlet mode of operation of the content provided or action.

In view of this Portlet mode, which is expected to provide the function is to generate markup language to represent the state at this time Portlet. For example, Portlet browsing patterns can contain one or more of the screen allows users to view and interact with the user interaction or that do not require a static content.

In the edit mode this Portlet, Portlet need to provide content and logic to allow users to customize the Portlet behavior. Typical that the edit mode will set or update Portlet Portlet parameter settings.

In helping this mode, Portlet should provide help information on this Portlet. This help information can be related to the Portlet's simple and coherent explanation of Windows or detailed description of the context. The Portlet does not need to have all the help that pattern.

A Portlet window states can decide on one page, how many in the room. When you call when a Portlet, Portlet Container Portlet need to tell the current window state. Portlet window states can then decide how much information to make it the right treatment. In the course of processing the request, Portlet way through the process to change the window state.

1.4.2 Portal Page

Each Portal page contains zero or more Portlet small window presents a complete information page. Portal Portlet after startup configuration file according to information such as the title of such property to Portlet assignment, given Portlet editor, close the other control buttons, so that a standard Portlet Portlet window. Portlet Portlet window of these combined to form a complete document, that Portal page. Each Portlet which are in the appropriate layout, showing pre-defined content, the quality of the performance of Portal public. Portlet can also switch between different layouts. Portlet to respond to client requests, and submit the request to the appropriate URL for logic processing.

Portlet development is completed, the deployment to Portal Server, the Portal server is responsible for organization, access control and presentation. Portal page creation process is as follows:

The implementation of the Portlet container Portlet, Portlet Container Portlet generated content to receive. Portlet containers will normally be submitted to the Portlet the content server, Portlet Portal server set up in accordance with the content page, and then pass it to client presentation. Specific processes as below:

Portal page of the request process is as follows:

Users via client devices (such as browsers) to access Portal, Portal according to the received request to determine which need to be performed Portlet to meet the demand. Portal by Portlet container call Portlet, then the resulting fragments to establish Portal Portlet page, and transmits it back to the client presented to the user. Specific processes as below:

分类:Java 时间:2010-09-17 人气:398
blog comments powered by Disqus


  • Chapter III of the essence of software testing 2009-07-29

    First, test the principle of These principles can be regarded as software testing and software development "rules of the road" or "knowledge of life", each for a thorough understanding of the principle of the whole process is a valuabl

  • Chapter III Servlet Programming 2010-03-29

    Chapter III Servlet Programming 3.2 servlet structure and Servlet-related classes, interfaces are defined in the javax.servlet and javax.servlet.http these two packages, the You can download java ee api documentation to see. javax.servlet package def

  • Chapter III Extjs in the development, how to achieve code reuse (Getting Started tutorial) 2009-10-02

    Chapter III Extjs in the development, how to achieve code reuse (Getting Started tutorial) If you want to achieve the following interface, you will choose the kind of code? Code 1: Code 2: According to the above created object: You will choose? ? Rec

  • Translation How Tomcat Works coder love the first part of Chapter III 2010-11-05

    Chapter III: Connector Before the formal start this application, we first used under the StringManager org.apache.catalina.util package as a start. This class is used to process the application and Cacalina error message itself international. The Str

  • sed and awk rookie notes - Chapter III understand Regular Expressions 2010-12-28

    Chapter III understand Regular Expressions The third chapter is the most important, a lot of regular expressions together with the work of all wonderful, so be sure to learn! P45: Summary of special characters. P54: POSIX character classes ([: space:

  • Select sub-section (Chapter III) 2011-05-29

    In real mode, the logical address space in the memory cell's address within the segment value and the segment offset of two parts. In protected mode, virtual address space (the equivalent of logical address space) in the address storage unit by the s

  • Ruby on Rails Tutorial (Michael Hartl) Chinese translation of Chapter III of static pages (1) 2010-12-20

    (Lazy weekend... This week the third chapter.. Static pages, filling ~) Chapter Mostly static pages In this chapter we will begin to develop a sample program, this program is the book used in the following example. Although this process will ultimate

  • Ruby on Rails Tutorial (Michael Hartl) Chinese translation of static pages of Chapter III (2) 2010-12-22

    3.1.1 Let the real static pages from the static pages really start learning, review Section 1.2.5 on the start of each program on Rails is a very small program (mainly the Rails script credit, such as generator ) and have a default welcome page (addr

  • Learning XNA 4.0 Chapter III (3) 2011-01-13

    Add a wizard in the project Well, I do not say, and this time I'm serious. Let us begin. Your project so far is boring. Now, let's draw a picture to your game screen. XNA all the graphics, sound, special effects and other things that go through somet

  • 5.Liferay Portal deployment descriptor 2010-09-17

    Section VI Liferay Portal deployment descriptor As with all Web applications, Liferay Portal using multiple XML deployment descriptor file, to initialize the deployment of information, standard operating mode, such as Portlet initialization informati

iOS 开发

Android 开发

Python 开发



PHP 开发

Ruby 开发






Javascript 开发

.NET 开发



Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 闽ICP备15018612号

processed in 0.136 (s). 12 q(s)