1. Trang chủ
  2. » Công Nghệ Thông Tin

Liferay Portal 6 Enterprise Intranets phần 2 pptx

68 418 1

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 68
Dung lượng 0,91 MB

Nội dung

Chapter 2 [ 45 ] Adding a child page Suppose you need to add a child page called Awards under the Guest community, you can add this page in the following way: • Click on the root Guest. • Select the tab New Page after selecting the Children tab. • Enter the child page name Awards. • Select a type Portlet. • Select the checkbox Hidden if you want to hide the page in the navigation bar. • Click on the Add Page button when you are ready to add a page. Of course, you add more child pages as you had expected. The root, pages, and all child pages form a hierarchical tree, as shown in following screenshot: Setting Up a Home Page and Navigation Structure for the Intranet [ 46 ] Changing the display order You can change the display order of child pages under Manage | Page in the dock bar menu as follows: • Select the tab Display Order. • Click on a child page like Books, and then click on the Move Up button to move the selected page up—or click on the Move Down button to move the selected page down—or click on the Remove button to delete the selected page. • Click on the Update Display Order button when you are ready. Note that the resulting rst page, either public pages or private pages of a given group, must not have one of these types: URL and Link to Page. The resulting rst page must not be hidden—it should not have the value Hidden. Editing a page You can edit a page like Awards under the link Manage | Page in the dock bar menu. For example, if you want to replace the page Awards with the HTML Title with the value Our Awards: • In the left-hand tree structure, locate the page you want to edit. • Click on the page Awards. • Click on the Page tab. • Enter the value Our Awards next to the HTML Title of the page. • Click on the Save button. As you can see, you have options to rename the current page, change the display language of the current page, change the type of the current page, and change the status of the page, whether or not the current page is hidden. Multiple languages The portal is designed to handle as many languages as you want to support. By default, it supports up to 22 languages. When a page is loading, the portal will detect the language it should use, pull up the corresponding language le, and display the text in the correct language. Chapter 2 [ 47 ] For the page Awards, the default language is English (United States). If you select a localized language—German (Germany), then you have the capability to enter the Name and HTML Title in German. In addition, you may type the value for Query String. Optionally, the portal will use this query string when there isn't any other present. This behaves as the default parameter for the page. Friendly URL You can eventually provide a Friendly URL for a page. For example, you could have the URL for the Awards page be http://localhost:8080/web/guest/awards. As many parameters are passed in through the URL, the portal URL is very long and difcult to read. However, you can give your page a Friendly URL to make it easier to read and access. The portal provides a Friendly URL for each group (including community, organization, and user). Therefore, you just type in a Friendly URL for a page (it must also start with "/") /awards. If there is no duplication, you can now access your page using the following URL pattern: http://${server-name}/${group-friendly-url}/${page-friendly-url} Page icon You can upload an icon for the current page and change whether the icon is used or not. For instance, you can upload an image as the icon of the page Awards. Moreover, you have the ability to use the icon by selecting the checkbox Use Icon. Target controls where the page will be displayed when the user follows a link. You can enter the following values for target: _blank, _parent, _self, and _top. Copying pages You already have a page named Awards in the Guest community. On the other hand, you want to set up a page named Others, which is just like the page Awards. In such a case, you can use the Copy Page function. Just select the page (like Awards) that you want to copy from the drop-down next to Copy Page link, and then click on the Save button when editing the page Others. Your current page Others will be an exact copy of the page Awards that you selected, except for the page's name. Setting Up a Home Page and Navigation Structure for the Intranet [ 48 ] Furthermore, you can specify meta tags, JavaScript, and meta robots for a given page. For example, if you need to add a function to redirect to an external website on a page, you could directly add JavaScript code in the JavaScript part of that page as shown in the following line: window.location="http://liferay.cignex.com"; Deleting a page For some reason, say the page similar to Awards doesn't exist anymore, and you need to delete it. You can delete pages under the link Manage Pages. • In the left-hand tree structure, locate the page you want to delete. • Click on the page Awards. • Click on the Page tab. • Click on the Delete button. • A screen will appear asking if you want to delete the selected page. Click on the OK button to conrm the action. Note that deleting a page will delete all child pages related to that page and remove all portlet instances that the page owns. Changing the look and feel: themes At this point, you may have all the portlets you expected on pages. You can now change the look and feel of pages. The portal contributes pre-bundled with different themes that you may apply to pages. As an administrator in the portal, you may want to congure some additional themes. Chapter 2 [ 49 ] In order to change the theme, you can refer to the following instructions: • Click on the link Manage | Page. • Select the page you would like to change the theme for from the left-hand side. Note that, by default, all child pages will inherit a theme from their parent. If you want to inherit the look and feel from the root node, rst click on the Look and Feel tab for that page, then choose Yes for the box Inherit look and feel from the private root node? Otherwise, choose No. • Choose the Look and Feel tab for that page. • You will see a number of bundled themes that are available. Choose your theme and color scheme. You can experiment with it as much as you like until you nd a theme that pleases you. Themes customize the overall look and feel of websites. The portal groups themes into two categories—Regular Browser and Mobile Devices. By default, Regular Browser's themes are further divided into three sub groups—themes, color schemes, and Cascading Style Sheets (CSS). As shown in previous screenshot, there is a theme named Classic, it is the default theme, and it covers three color schemes: Blue, Green, and Orange. You can insert custom CSS that will be loaded after the theme. In addition, the portal provides Wireless Application Protocol (WAP) theme that is designed to run on mobile devices. If you had WAP clients, then the WAP theme would be an ideal choice for the look and feel. You can easily switch among different presentational layers through themes. As a designer or developer, you can deliver an integrated package of HTML with Velocity templates, JavaScript, image and conguration les (that is, a WAR le) that will control all presentation logic and design attributes for a portal community. How do you get additional themes? Refer to http://www.liferay.com/web/guest/downloads/ official_plugins and http://www.liferay.com/web/ guest/downloads/community_plugins. Customizing portlets As an administrator or a normal user from website editorial department at the enterprise "Palm-Tree Publications", you have added a set of portlets in pages. Now, it is time to customize the portlets in a portal page. Setting Up a Home Page and Navigation Structure for the Intranet [ 50 ] As mentioned earlier, the portlet Sign In has tabs—More, Minimize, Maximize, and Remove. These icons are standard links for all portlets. The icon More mostly contains subset options: Look and Feel, Conguration, and Export/Import. Note that some portlets, like Hello World, don't have the icon Export/Import, as there is no real content inside portlet. The function of the link Look and Feel is the same for all portlets. The icon Conguration mostly contains tabs such as setup, permissions, sharing, communication, supported- clients, and scope. The functions of permissions and sharing are the same for all portlets. For example, the Sign In portlet doesn't have the tabs scope, communication, and supported-clients. On the other hand, the Hello World portlet doesn't have the tabs setup, communication, supported-clients, and scope. We will discuss in detail about permissions and scope in coming chapters, and we will address sharing in the next section. In particular, we will address communication and supported-clients in coming chapters. This section focuses on the Look and Feel and setup portlets. Let's say that you are using the portlet Sign In and you want to customize it in the following way: • Change portlet look and feel: The background color, the font, and text size, change the title, and hide the border of portlet • Change portlet conguration setup Portlet Look and Feel In order to change the background color, font, and text size of the portlet, you can simply click on the More | Look and Feel tab that appears in the portlet Sign In rst. The portlet customization screen will appear. Then, by selecting the tab Background Style, you can change the background color, and by selecting the tab Text Style, you can change the font and text size. Click the Save button when you are ready, or click on the Reset button if you want to reset your changes. Chapter 2 [ 51 ] In order to change the title and hiding border of the portlet, you can simply click on the More | Look and Feel link that appears in the portlet Sign In rst. Then, you simply enter a title, select a language, select the checkbox Use Custom Title, and uncheck the checkbox Show Borders. Click on the Save button when you are ready. The portal provides us with the ability to change the look and feel of portlets dynamically with the following possibilities. Eventually, these functions of the portlet CSS are specied by the portlet CSS (with the portlet ID 113). • Portlet conguration: Using a custom title, showing borders, selecting languages for the title, and so on • Text Style: Font, size, color, alignment, text decoration, word spacing, line height, letter spacing, and so on • Background Style: Background color • Border Style: Border width, border style, border color, and so on • Margin and Padding: Padding, margin, and so on • Advanced Styling: Entering in your custom CSS • WAP Styling: Entering in your custom CSS for WAP Setting up portlet conguration As shown in next screenshot, you can carry out the following steps for Portlet conguration setup: • Click on the link More | Conguration | Setup • Under the tab Setup, you can either change the current setup, for example, Current | Authentication Type (which can be Default, By Email Address, By Screen Name, and By User ID) • Or change Current | Email Notication | General and Current | Email Notication | Password Changed Notication. Setting Up a Home Page and Navigation Structure for the Intranet [ 52 ] Eventually, the previously mentioned functions of the portlet conguration are specied by the portlet Conguration (portlet ID 86). Navigating the structure of an intranet site As an administrator or a normal user from the website editorial department at the enterprise "Palm-Tree Publications", you have customized pages in the portal. Now, it is time to navigate the structure of the website. Let's say that your current page is Home and you want to provide the following functions: • Show the structured directory of links to all the pages in the portal. You simply add Site Map portlet (portlet ID 85) in a page if the portlet isn't there • Display a directory of links reecting page structure, with drill down into current page. You can add a Navigation portlet (portlet ID 71) in a page • Displays a trail of parent pages for the current page. You just add the Breadcrumb portlet (portlet ID 73) in a page The Breadcrumb portlet displays a trail of parent pages for the current page. It can be placed on public portal pages as a navigational aid to publish websites. It helps the user visualize the structure of a website and quickly move from a page to a broader grouping of information. A Navigation portlet provides a directory of links to reect page structure, with drill down into current page. Style and appearance are adjustable. The Navigation portlet displays links for other pages outside the current page's trail of parent pages. It helps users visualize the structure of a website and provides links to quickly move from one page to another. Moreover, it displays more information about the current page. Chapter 2 [ 53 ] The Site Map portlet provides us with the ability to display a structured directory of links to all pages of a website. It is used to navigate directly to any page on a website. Furthermore, it can be congured to display the entire site or a sub-section of pages. When do you use these portlets? In order to display a trail of parent pages, for example, for books for the current page like Home, you can use the Breadcrumb portlet. In order to display a trail of parent pages, for example, books for the current page like Home and page structure of current page, you can use the Navigation portlet. In order to display a structured directory of links to all the pages in the portal, use the Site Map portlet. On the other hand, you can change the Display Style of the Breadcrumb portlet by clicking on the link More | Conguration | Setup | Current. Similarly, you can change Display Style and Bullet Style of the portlet Navigation by clicking on the link More | Conguration | Setup | Current—and also you can congure Root Layout, Display Depth, Include Root in Tree, Show Current Page, Use HTML Title, and Show Hidden Pages of the portlet Site Map by clicking on the link More | Conguration | Setup | Current. Conguring portal As an administrator at the enterprise "Palm-Tree Publications", you may need to customize the portal through conguration les in order to satisfy your own requirements. Let's see an example of how to customize the Portal's conguration. As you can see, the default language is English (United States) and the default time zone is UTC (Coordinated Universal Time) when the portal starts. Now, we plan to set the default language as German (Germany) and the default time zone as CET (Central European Time) when the portal starts. We can implement it as follows: 1. Shut the portal down, if the portal is still running, by running $TOMCAT_AS_DIR/bin/shutdown.sh. 2. Clean Tomcat, as mentioned earlier. 3. Create the properties le system-ext.properties in $TOMCAT_AS_DIR/ webapps/ROOT/WEB-INF/classes and open it. 4. Add the following line to the beginning of the properties le system-ext.properties and save it: user.country=DE user.language=de user.timezone=Europe/Paris 5. Restart the portal by running $TOMCAT_AS_DIR/bin/startup.sh. Setting Up a Home Page and Navigation Structure for the Intranet [ 54 ] After clicking on the link Manage | Page, you will see that the Default Language is Deutsch (Deutschland). The previous code set default locale used by the portal to de_DE (German/ Germany). This locale is no longer set at the VM level. It also sets the default time zone used by the portal to CET (Europe/Paris). This time zone is no longer set at the VM level. Of course, you can set a different country, language, and time zone. The portal provides high customizability through website (Administration UI) and conguration les. Let's see how we can customize and congure the portal. Conguring portal paths Before customizing the conguration les, it is better to review and adjust the values of the following properties, shown with their default values at the time of writing. • auto.deploy.deploy.dir=${liferay.home}/deploy for auto-deploy • jdbc.default.url=jdbc:hsqldb:${liferay.home}/data/hsql/lportal for Hypersonic SQL scripts • lucene.dir=${liferay.home}/data/lucene for search and indexing • jcr.jackrabbit.repository.root=${liferay.home}/data/jackrabbit for JCR jackrabbit • image.hook.file.system.root.dir=${liferay.home}/data/images for Image Gallery • dl.hook.file.system.root.dir=${liferay.home}/data/document_ library for Document Library What's the variable liferay.home? What are the folders /data and /deploy used for? By default, the portal has the following settings: liferay.home=$LIFERAY_HOME For this reason, after installing the portal, you will see following folders under $LIFERAY_HOME: • deploy: A folder for hot deploy • data: A folder for runtime data • ee: A folder for license information, used only for Enterprise Edition (EE) • license: A folder for license information, used only for Community Edition (CE) • $APPLICATION_SERVER_DIR: A folder for the application server directory [...]... 1_column: 1 Column 2_ columns_i: 2 Columns(50/50) 2_ columns_ii: 2 Columns(30/70) 2_ columns_iii: 2 Columns(70/30) 3_columns: 3 Columns 1 _2_ columns_i: 1 -2 Columns(30/70) 1 _2_ columns_ii: 1 -2 Columns(70/30) 1 _2_ 1_columns: 1 -2- 1 Columns 2_ 2_columns: 2- 2 Columns Additionally, you can find details about the preceding default layout templates at $PORTAL_ WEB_INF_HOME /liferay- layout-templates.xml As you have experienced,... $AS_WEB_APP_HOME=$GERONIMO_AS_DIR/deploy $PORTAL_ ROOT_HOME=$GERONIMO_AS_DIR/deploy /liferay- portal. war • Glassfish: $AS_WEB_APP_HOME=$GLASSFISH_AS_DIR/domains/domain1/ applications $PORTAL_ ROOT_HOME=$GLASSFISH_AS_DIR/domains/ domain1/applications /liferay- portal • JOnAS: $AS_WEB_APP_HOME=$JONAS_AS_DIR/webapps/autoload $PORTAL_ ROOT_HOME=$JONAS_AS_DIR/webapps/autoload/liferayportal.war • Resin: $AS_WEB_APP_HOME=$RESIN_AS_DIR/webapps $PORTAL_ ROOT_... custom.sql.function.isnull and custom.sql.function isnotnull for a specific database For DB2, you may set the following in portal- ext.properties custom.sql.function.isnull=CAST(? AS VARCHAR(3 26 7 2) ) IS NULL custom.sql.function.isnotnull=CAST(? AS VARCHAR(3 26 7 2) ) IS NOT NULL For Sybase, you may set the following in portal- ext.properties: custom.sql.function.isnull=ISNULL(CONVERT(VARCHAR,?), '1') = '1' custom.sql.function.isnotnull=ISNULL(CONVERT(VARCHAR,?),... private layouts and they will be automatically created [ 64 ] Chapter 2 The following settings are used for the creation of initial private pages: default.user.private.layout.name=Welcome default.user.private.layout.template.id =2_ columns_ii default.user.private.layout.column-1=71_INSTANCE_OY0d, 82, 23 ,61 default.user.private.layout.column -2= 11 ,29 ,8,19 default.user.private.layout.column-3= default.user.private.layout.column-4=... as 2_ columns_ii in portal. properties default.layout.template.id =2_ columns_ii The preceding code sets the default layout template ID as 2_ columns_ii Of course, you can set the template ID to something other than 2_ columns_ii in the properties file portal- ext.properties The following is a list of default layout template IDs: • • • • • • • • • • freeform: Free form 1_column: 1 Column 2_ columns_i: 2 Columns(50/50)... value, get the original system.properties and portal. properties files from the Liferay portal source code or from portal- impl.jar into your application server installation $PORTAL_ ROOT_HOME/WEB-INF/lib Adding extended properties files We can override the settings through properties files and determinately configure the portal through the properties files portal- ext.properties and system-ext properties... templates [ 56 ] Chapter 2 • wap: Main folder for WAP site—including common themes, portal layout, themes mobile, and so on • WEB-INF: Web specification such as web.xml, including the folders classes, lib, and tld The folder html has the following subfolders: • common: Common themes • icons: A set of icon images • js: JavaScript for both portal and portlets • portal: Portal layout and enterprise edition... The property portal. ctx has been set by default in portal. properties as follows: portal. ctx=\ The previous code specifies the path of the portal Servlet context You can set this property at the end of the properties file portal- ext.properties if you deploy the portal to another path besides ROOT As you have seen, a browser was automatically launched to a URL http://localhost:8080 when the portal was... in portal. properties: transaction.isolation .portal= 2 As shown in the previous code, the property transaction.isolation .portal sets the definition of the portal transaction isolation level Note that the portal transaction isolation level isn't a real isolation level It is just a pointer to a real isolation level You can set the value to -1 in order to use the database's default isolation level, to 2. .. the default browser was automatically launched to a URL http://localhost:8080, when the portal was fully initialized, with a context path /web/guest and a string like ;jsessionid=48CFD 425 98E445CD083193C156F54F 6F The string is made up of a parameter key like ;jsessionid= and a session ID 48CFD 425 98E445CD083193C156F54F6F More interestingly, the session ID value will be different from time to time What's . variable liferay. home? What are the folders /data and /deploy used for? By default, the portal has the following settings: liferay. home= $LIFERAY_ HOME For this reason, after installing the portal, . original system.properties and portal. properties les from the Liferay portal source code or from portal- impl.jar into your application server installation $PORTAL_ ROOT_HOME/WEB-INF/lib Adding. $PORTAL_ ROOT_HOME=$GLASSFISH_AS_DIR/domains/ domain1/applications /liferay- portal • JOnAS: $AS_WEB_APP_HOME=$JONAS_AS_DIR/webapps/autoload $PORTAL_ ROOT_HOME=$JONAS_AS_DIR/webapps/autoload /liferay- portal. war • Resin: $AS_WEB_APP_HOME=$RESIN_AS_DIR/webapps

Ngày đăng: 12/08/2014, 21:20

TỪ KHÓA LIÊN QUAN

w