Time for action – creating a new page and adding a portlet
You have gone through the Add option of the Dockbar. Let's now use this knowledge to create a new page and load the page with a couple of portlets:
- Click on the Add option in the Dockbar. Select the Page option from the drop-down.
- It will display a textbox with the yellow background in the page navigation.
- Add the name of the page here, Collaboration, and click on the tick mark next to the textbox. You should now see the page added to the page navigation.
- Click on the Add option from the Dockbar and select More from the drop-down.
- Search for the Blogs portlet and Polls Display portlet. Add these portlets to the page.
- Try adding the same portlets a second time and see what happens.
You would be able to add another polls display portlet to the page but not another blogs portlet. Can you tell why this happened? If you cannot, revisit the last section. It is related to the portlet instance.
What just happened?
You got familiar with the Add option of the Dockbar.
You have created a new page and added one instanceable and one non-instanceable portlet to the page.
You are now familiar with the difference between an instanceable and a non-instanceable portlet.
You should now have a Collaboration page added to your portal. You should also have Blogs and Polls Display portlets added to the Collaboration page.
Have a go hero – installing a new portlet
We have seen how to add a new portlet to the page. Now, get ready to install a new portlet to your portal. We will use the Install More Applications link available in the More application's pop-up. You must be connected to the Internet to perform this exercise.
- Click on the More option under Add in the Dockbar.
- You will see a pop-up to add a new portlet on the page.
- Now, click on the Install More Applications link.
- You will see an interface displayed in the previous screenshot.
- You can see the Configuration tab on the top. Click on this tab.
- This tab contains different configurations, for the server including Deploy Directory, Destination Directory, Interval, Blacklist Threshold, and so on.
Note
Blacklist threshold : The Portal Server extracts the
.war
file of the plugins (portlet, theme, and so on) from thedeploy
directory and installs it on the portal. The blacklist threshold is the number of times the portal server tries to extract the.war
file. If the.war
file cannot be extracted by the number mentioned in the blacklist threshold, then the server will blacklist the.war
file and will not try to extract it again. To remove the application from the blacklist, you need to remove the.war
file and restart your application server. - You will find two textboxes, named Trusted Plugin Repositories and Untrusted Plugin Repositories.
- Trusted Plugin Repository contains the URL of Liferay's official plugins repository. Untrusted Plugin Repository contains the URL of Liferay's community plugin repository. You can configure more than one repository here and your Liferay server will pull plugins from the repositories and display them to install on your local installation. To configure multiple repositories, you have to give each repository URL in new line.
- You should see the Untrusted Plugin Repository box with the following URL. If it is not present, add the URL http://plugins.liferay.com/community and click on Save.
- Once you have saved it, click on the Browse Repository link at the top. The Portlet Plugins tab will be selected by default and you will see a list of portlets under it. If the repository was not configured earlier, you will see more portlets in the list than earlier.
- Click on any of the portlet names. This will take you to the interface to install the portlet. Click on Install.
- The portlet will be installed to your local environment. You can watch the Tomcat console. Once you get a message One Portlet for xxx-portlet is available for use, the portlet is deployed on your application server and ready to be added to the page.
- Go to your home page and add the newly added portlet to your page.
This way you can add more portlets, themes, hooks, or web modules using this feature. Hooks or web modules are again other types of plugins.
Pop quiz – true or false
Please state whether the following statements are true or false:
- Every user will get the same view of the Dockbar.
- It is possible to add the portlet more than once to the page if it is an instanceable portlet.
- All the portals must have the Terms of use page.
- Non-instanceable portlets can display different data if added on different pages of the same organization or community.
Using the Manage option
We have discussed how to add a new application to your portal in the previous section. Now, let's go back and discuss other options available in the Dockbar. Click on the Back to Liferay link from the Control Panel to go back to the page.
The third option you see in the Dockbar is Manage. This option is useful to manage the current page and various other settings. When you roll your mouse over the Manage option, you can see different options—Page, Page Layout, Sitemap, Settings, and Control Panel. This is displayed in the following screenshot:
When you click on the Page option, it will allow you to do various settings for the current page. You can change the name of the page, provide the HTML title of the page, change the friendly URL (partially), and also provide Meta tags to the page to make it SEO-friendly. If you want to add a sub-page or child page, you can click on Children and add a child page under the current page. You can also change the look and feel of the page by clicking the look & feel tab. We will discuss these options in detail later in this book.
The next option under Manage is Page Layout. Layout is a grid-like structure which works as a portlet place holder. It is used to arrange the portlets in a certain fashion on the page. The default layout is 2 columns (30/70). When you click on the Page Layout option, it will open a pop-up with all the default layouts available as displayed in the following screenshot:
You can change the layout of the page by selecting the layout and clicking on the Save button.
Another option under Manage is Sitemap. This option will allow you to see the sitemap of the pages you are accessing. You can see the names of pages, add a new page under the same site, change the look and feel, and change the display order of the pages. We will discuss this option in detail, when we discuss Manage Pages.
You will also see an option called Settings under Manage. The Settings option will allow you to do different community or organization page-level settings. The options available are Virtual Host, Logo, Sitemap, Robots, Monitoring, and Staging. A brief introduction of each section is as follows:
- Virtual Host—This option will allow you to provide a domain name for your community or organization, for example,
www.mydomainname.com
. This feature is also helpful when you want to host multiple websites as separate communities in Liferay. You can provide a virtual host to each community and each of them will behave as a separate website. - Logo—This option will be used to upload a logo for your organization or community pages. This logo will be displayed instead of the default Liferay logo. If you have more than one community hosted as a separate website and you want to have different logos for each website, you can use this feature.
- Sitemap—This option publishes your site to Google and Yahoo search engines using the sitemap protocol. Once it is published, the Google and Yahoo search indexes will use the site map to index your site. It also allows you to view your sitemap before publishing.
- Robots—This option will allow you to set the
robots.txt
file for your public and private pages of the portal. You have to set the virtual host for the public and private pages before setting therobot.txt
file. This file will be used for SEO (Search Engine Optimization) purposes and notifies the indexes whether to index any page or follow the links on the page. This option will appear if you are using an enterprise edition of Liferay. - Monitoring—This option will allow you to integrate your portal pages with Google Analytics to do the traffic analysis using the Google Analytics tool. You need to have a Google Analytics ID and provide it in the text field given on this option.
- Staging—This tab will allow you to set up staging for your site. This will be helpful to view/check your work before publishing to a live site. This will be explained in detail in Chapter 10, Liferay Server Administration.
The preceding options will be used in the next few chapters of this book.
When you click on the next option called Control Panel under Manage, it will take you to the Admin Interface of Liferay known as Control Panel. This is a centralized admin space. It consists of all the admin portlets which you can use to manage different aspects of your portal. We will discuss Control Panel in detail in another section of this chapter.
The next thing you will see in the Dockbar is an option called Toggle Edit Control. This option will allow you to turn on or off the edit controls that you can see on top of every portlet window. The portlet window has Configuration, Minimize, Maximize, and Remove options. If you turn off the control by disabling the Toggle Edit Control option, those options will disappear. This feature will be helpful to the admin to see how the page will be displayed to a normal user who does not have all these edit permissions.
Now, the next option you can see in the Dockbar is Go To. If you bring your mouse pointer to this option, it will expand. This section will display all the places of the portal which you have access to. The place which you are currently on will be highlighted. As you can see, currently you are in liferay.com community. This is a default community of Liferay which has a public page. Everyone is able to access the public page of the guest community. It is displayed in the following screenshot:
Another thing you will notice in the same drop-down is My Public Pages and My Private Pages. By default in Liferay, each user has his/her set of private and public pages. A user can manage the public and private pages and will behave as an admin of these pages even if the user does not have an Admin role at portal level. Anyone can access a user's public pages by the URL, whereas private pages can be accessible to the user only. This feature is very helpful in an intranet-fashioned portal where users need their own space to play on the portal. For the internet fashioned portals, this feature can be turned off by an admin.
You can also see the user's first name and the last name in the Dockbar and a sign out link. On clicking the username, it will take you to the user's profile. A user can edit his/her profile by clicking this option.
The Sign out link will log you off from the portal.