LifeRay Portal Evaluation Report
Portal
The portal described herein refers to the JCP-JSR168 specification: Portal is a web-based application, typically provides personalization, single sign-on, content integration, and display. Portal technology includes three aspects:
1) Portal Server;
2) Portlet container; (Portlet Container)
3) Portlet.
1) The definition of Portal Server is
A Portal is a web-based system, usually providing personalization settings, single landing, and a variety of different sources or different websites, and put this information on webpage The rendering platform in combination, the portal will have a delicate personalization to provide a customized web page, which will give different information content when different levels of users browse this page.
Responsible for receiving an HTTP request, calling the portlet, and gathering the content generated by the portalet to the portal page to return to the customer.
2) The definition of Portlet Container is
Portlet Container is a environment that provides portlets, containing many portlets and manages their life cycle, and he will always save portlets. After receiving the request from Portal, then pass this request to the existing container Portlet execution. Portlet Container is not obligated to combine the information generated by portlets, which must be processed by portal. Portal and Portlet Container can be placed together as components of the same system, or separate into two separate components.
Responsible for providing the runtime environment of portlet, managing the life cycle of the portlet, and is also responsible for providing portlet persistence.
3) The definition of portlet is
A portlet is a Web component that is technologically technically technically, managed by Portlet Container, dedicated to the customer's request and the information content that produces various dynamic. Portlets are a pluggable client interface component that provides a presentation layer to become an information system. These are also referred to as fragments, while fragments are Fragment, and the fragment is Markup (HTML, XHTML, WML), and can be combined with other fragments into a complex file. The content in the portlet is normal to become a portal web page with the content polymerization of other portlets. The lifecycle of the portlet is controlled by the portlet container. The interaction of client and portlets is implemented by Portal through a typical request / response method. It is normal for the content of the customer and portlets, for example, according to the next connection or a confirmed form, result portal The action of the portlet will be received to turn this processing to the target portlet. The generation of these portlets may vary from different users, which is completely based on the customer's setting for this portlet.
Portal mainly solves the front-end integration of enterprise information and applications, which is responsible for linking the structure and unstructured information of the enterprise background EAI, integrated enterprise, and provides unified access to enterprise information and applications.
The following figure shows the generation process of the Portal page (you can also understand the relationship between portal server, portal container and portlets) (from JSR168 specification document)
The relationship between portlet and servlet
Portlets and servlets are like a brother, but there is a little bit of a little bit, because servlet and portlets are not as good, so the research team decides to define portlets to become a new component, so define a new and clear interface of portlets. behavior. In order to achieve reused purposes as much as possible, the Portlet's specifications use the servlet specification, many concepts are very similar, combined with portlets, servlets, and JSP in the same website system, we call the portlet application. In the same portlet application, they will share the same ClassLoader, Context, and Session.
1) The similarity of portlets and servlets
@ portlets is also a Web component of Java technology @ portlets is also a specific Container in administering @ portlets to dynamically generate various content @ portlets' lifecycle managed by Container @ portlets and client interaction with the REQUEST / RESPONSE
2) Portlets and servlets have some differences
@ portlets only generates a Markup information fragment, not a full web file. Portal will put all the portlet markup information cards into a complete portal page. @ portlets will not have direct relationships with the URL @ client must interact with Portal system and portlets @ portlets has some definition request processing, Action Request, and Render Request. @ Portlets Default Definition Portlet Modes and Window Status You can point out which function of this portlet is executing and now. @ portlets can exist multiple in the same portal web page.
3) Portlet has some additional features that are not available in servlets.
@ Portlets can access and store permanent profiles and customization information. @ portlets You can access user data @ portlets with URL rewrite features to dynamically establish links in the file, allowing Portal Server to do not know how to establish links and actions in the web page segment. @ portlets You can store temporary data in Portlet Session with two different ranges: Application-Wide Scope and Portlet Private Scope.
4) Portlet does not have some functions, but servlets are available
@ servlet has a character set encoding mode @ servlet to set the HTTP output header @ servlet to receive the URL request from Portal.
Advantages of Portal Development Projects
1. Seamless integration can be achieved with newly developed or integrated into Portal.
2, you can share the features of the Portal server and portlet containers. This is dependent on the Portal server provider.
3. Because the portlet is standardized (JSR168), the portlet developed in the application can be deployed on different portal servers. Liferay Portal
Open source J2EE Portal product Liferay Portal (http://www.liferay.com) released version 3.0. From this release, Liferay is divided into two separate products: LifeRay Enterprise Edition and Liferay Professional. Among them, the professional version completely uses a lightweight architecture based on the Spring framework (http://www.springframework.org), using AOP-based infrastructure implementation, so you can completely detach the high-end J2EE application server, run in the form of web applications. Servlet containers (such as Tomcat). From the perspective of technology, this is enough to prove that the Lightweight architecture based on the IOC container and AOP can fully replace EJB to provide enterprise intensity products.
Liferay (http://www.liferay.com) represents a complete J2EE application, using technologies such as Web, EJB, and JMS, especially its front interface part uses Struts framework technology, XML-based portlet configuration files can be freely dynamically Extended, using Web Services to support some remote information acquisition, use APAHCE Lucene to implement full-text search function.
To be characterized:
1. Provide a single landing interface, multiple authentication mode (LDAP or SQL);
2, the administrator can easily manage users, groups, roles through user interface;
3, users can customize personalized portal layout as needed;
4, can run on the mainstream J2EE application server, such as JBoss Jetty / Tomcat, Jonas, Tomcat;
5. Support mainstream databases such as PostgreSQL, MySQL;
6. Use the third release of open source projects such as Hibernate, Lucene, Struts, Spring
7, support a variety of languages including Chinese;
8. Adopt the most advanced technology Java, EJB, JMS, SOAP, XML;
Main drawbacks:
1. Development, custom environment configuration steps are more cumbersome
2, the document is charged in the official website, the free document is relatively small, relatively relatively small framework (such as struts, spring), the discussion area is significantly less,
3, the stability of open source products does not guarantee, I just downloaded the installation package downloaded from the official site, there will be a database operation after the service is started. The reason may only be known after the study code.
Simple customization process
1. Liferay installation and operation
From its website www.liferay.com, several types of applications can be downloaded, the simplest installation is and JBoss, Tomcat integration package: life-EP-
3.1.0
-Jboss-Tomcat.zip. After downloading, decompress a certain directory of this machine, assume that it is C: / Liferay, and then runs C: /LifeRay/bin/run.bat launches Liferay.
After startup, observe the output information of the console, indicating that the startup is completed.
Close the service command: shutdown.bat -shutdown
After Liferay started, knock in the browser: http: // localhost, the default email: test@liferay.com for the login system, password: Test.liferay supports multiple languages, select language in personality settings, ie Changes to the Chinese interface.
2. Use portlets on Liferay to implement a function of "Hello, Portal!".
1) Write the portlet class:
Package my.portlet;
Import java.io.ioException;
Import javax.portlet.actionRequest;
Import javax.portlet.ActionResponse;
Import javax.portlet.GenericPortlet;
Import javax.portlet.PortletException;
Import Javax.Portlet.RenderRequest;
Import javax.portlet.renderResponse;
Public class helloportalportlet extends genericportlet {
Public void doView (RenderRequest Req, RenderResponse Res)
THROWS IOEXCEPTION, portletexception {
Res.SetContentType ("text / html");
Res. Getwriter (). Print ("Hello Portal!");
}
Public Void ProcessAction (ActionRequest Req, ActionResponse RES)
THROWS IOEXCEPTION, portletexception {
}
}
2) Compile the portlet class
To build the standard portlet.jar package when compiling above, the interfaces and classes specified in the JSR168 specification can be downloaded from the JCP website and the search installation directory can also be found. Copy the Class file after compiling:
3) Configure the portlet, the configuration files mentioned below are in the web-inf directory, namely:
a) Join in portlet.xml:
supports>
security-role-ref>
security-role-ref>
portlet>
b) Join in Liferay-Portlet.xml:
c) Join in LifeRay-Display.xml:
category>
3. Restart Liferay, after logging in to the system, add Hello Portal in the content column to see the output content of the above portlet: