Portal implementation principle

xiaoxiao2021-03-06  42

PORTAL implementation principle 1. Portal use case readers can register their own users on the following three websites, experience Portal's functionality. Http://my.msn.com http://my.yahoo.com http://my.liferay.com My MSN's function is the most flexible, users can arbitrarily drag and drop the operation section (Column) and Content Section (Content The location and number of positions. My Liferay can only select a fixed column (Column) layout, but can move the contents of the content block (CONTENT) in this column. My Yahoo can only select a fixed column (Column) layout, and cannot move the content of the content. The structure of Portal is divided into three layers. (1) Page (2) Column, or PANE (3) Content, or We want to look at the entire operation process of Portal. (1) There is an [Add Content] button below each column to allow users to choose to join your favorite content. From here, we know that there is a public common portlet repository in the Portal system for users. The portlet deployment discriptor is defined in the JSR168 Portlet specification. Common portlet repository is stored in the format of this portlet deployment discriptor. The XREG file for open source project JetSpeed ​​is used to store the definition of Common portlet repository. (2) After adding Content, the user's Page and Column will have more Content. When the next user logs in, I will see my own Portal layout. From here, it can be seen that the Portal system records users' personal portal configuration information - User Portal Config. The PSML file of the open source project JetSpeed ​​is used to store the definition of the USER Portal Config. ------- Find. The entire process of Add Content is: Common portlet repository -> Add Content -> Personal Portal Config Display Portal's entire process for reading users from Personal Portal Config -> According to Portlet ID, from Common Portlet Repository Find detailed portlet definitions -> Display this portlet based on this detailed portlet definition. 2. Portal implementation we consider how to use Java to implement Portal. 2.1 Dynamic Include First, we use the simplest idea, we use 100 JSP files (1.jsp, 2.jsp, 3.jsp, ... 100.jsp, etc.) represent 100 portlets. User page mypage.jsp contains multiple portlets selected by the user. Now, suppose the portlets selected for the portlets of 1.jsp, 3.jsp, 7.jsp, etc. How do we display these portlets in MyPage.JSP? The most intuitive practice is to use JSP: include.

For example:

Due to can only specify fixed The JSP file name cannot dynamically specify the JSP file name. We need to translate as Java Code - RequestDispatcher.InClude (); let's replace this way of writing. Java code
<% Request.getRequestDispatcher ("1.jsp"). Include (Request, Response); />
<% Request .getRequestDispatcher ("3.jsp"). include (Request, Response); />
<% Request.getRequestDispatcher ("7.jsp"). Include (Request, Response); /> further improve myPage.jsp.

<% String [] filenames = {"1.jsp", "3.jsp", "7.jsp"};%>

<% for (int i = 0; i
<% request.getRequestDispatcher (filename) .include (request, response); /> <%} // end for %> The content of FileNames can be various as long as RequestDispatcher is able to process. For example, Velocity, Filenames = {"1.VM", "3.VM", "7.VM"}; such as URL, FileNames = {"/portlet1.do", "/portlet3.do", "/portlet4.do "}; We can see that if we read the contents of FileNames from the user configuration, this is a simple portal implementation.

Java code <% string [] filenames = (String []) session.gettribute ("portlets.config");%>

<% for (int i = 0; i
<% request.getRequestDispatcher (filename) .includ (Request, response); /> <%} // end for%> < /TABLE 2.2 Portlet Interface Let's extend this example. Suppose each portlet specifies a portlet interface.

转载请注明原文地址:https://www.9cbs.com/read-54430.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.036, SQL: 9