Liferay's User Interface
Liferay is a portal server. This means that it is designed to be a single environment where all of the applications a user needs can run, and these are integrated together in a consistent and systematic way. If an application lives outside of the portal, the portal should be able to consume some resource of the application (such as an RSS feed or a subset of functionality in a "dashboard" application) so that the end user can see everything he or she interacts with at a glance.
To achieve this, all of the application functionality within Liferay Portal is in fragments of the page called portlets. Portlets are web applications that run in a portion of a web page. Liferay's core is a portlet container, and the container's job is to aggregate the set of portlets that are to appear on any particular page and display them properly to the user. In this way, one or many applications can reside on a page, and the user can (at the administrator's discretion) arrange them in the way that works best for the user.
Portlet applications, like servlet applications, have become a Java standard which various portal server vendors have implemented. The Java standard defines the portlet specification. A JSR-168 or JSR-286 standard portlet should be deployable on any portlet container which supports those standards. Portlets are placed on the page in a certain order by the end user and are served up dynamically by the portal server.
Portal applications come generally in two flavors: 1) multiple portlets can be written to provide small amounts of functionality and then are aggregated by the portal server into a larger application, or 2) whole applications can be written to reside in only one or a few portlet windows. The choice is up to those designing the application. Developers only have to worry about what happens inside of the portlet itself; the portal server handles building out the page as it is presented to the user.
Portlets are not difficult to build, and Java standard portlets can be written by any Java developer with experience in writing web applications. Liferay provides a Plugins Software Development Kit that makes creating portlet projects easy. For further information about the Plugins SDK, please see Liferay in Action, published by Manning Publications, which is the official guide to Liferay development.
Additionally, Liferay supports portlets written in other programming languages, such as PHP, Ruby, Groovy, or Python. Sample portlets written in these languages can be checked out from our Subversion repository (http://svn.liferay.com/repos/public/plugins/trunk/portlets).
Assuming that you've followed the instructions in Chapter 2 for removing the demo web site (7 Cogs), Liferay initially presents a very simple interface. Unauthenticated users can navigate the public pages of the portal and will see a Sign In link in the top right corner of the screen.
To sign into Liferay for the first time, you can click the Sign In link. You will then be presented with the Sign In Portlet. This portlet allows a user (or a prospective user) to do several things: sign in to Liferay, create a new account on the portal, or have a password reminder emailed if the user has forgotten his or her password. To sign in for the first time, don't create an account for yourself. We will do that later. If you were to create a new account on the portal for yourself now, it would be created using Liferay's defaults, which means the account would not have access to the administrative portlets you need in order to set up Liferay for your organization. For this reason, you will need to sign in as the default administrative user. This user's credentials are:
User Name: firstname.lastname@example.org
Illustration 12: Logging into Liferay Portal
Go ahead and sign into your new portal using these credentials. As you can see, Liferay by default uses one's email address as the user name. This can be changed later if you don't like this functionality, but it is generally a good practice to keep it this way. Users' email addresses are not normally things they will forget, and they are unique to each user, so they make good candidates for user IDs.
Once you log in as the administrative user, you will see that the Dockbar has now appeared across the top of the page. The Dockbar is the primary tool logged in users have for navigating the portal and accessing administrative functions from anywhere on the web site. Depending on the logged-in user's roles and what section of the website the user is viewing, you may see all or only some of the options available in the Dockbar.
As an administrator, the first option you will see on the Dockbar is Add . Mousing over Add will reveal a list of things that you can add. You can use this to add a new page at the current navigation level, or add portlets to the current page. When you first pull down the menu, you will see a list of common portlets that you can click on to add to the page. You will also see a More option, which will show you all of the currently available portlets. From the expanded More menu, you can add portlets to the current page. If you want to add a portlet to the current page, you can click the Add button next to a portlet to add it to the first column in the page, or drag the portlet from the menu to where you want it on the page.
Illustration 13: Add Menu from the Dockbar
The next option you'll see is the Manage menu. From this menu, you can access various settings for the current page and any of its subpages. The items available are Page, Page Layout Sitemap, and Settings. Clicking on Page Layout brings up a dialog box which enables you to choose the layout template to use for the current page. The other settings are the same as their counterparts in the Control Panel, and are covered in detail later in this chapter. The last item in the menu is Control Panel; clicking on it brings you to the Control Panel.
The next thing you'll see is a check box labeled Toggle Edit Controls. This lets you turn on and off the edit controls in the top of the portlet windows. This is helpful for administrators who want to look at a page they're working on and see it the way a regular user would.
If you roll your mouse over Go to, the Dockbar will expand, showing all of the places in the portal to which you have access. Initially, the place you are on is highlighted. You will see that you are in the liferay.com community, on the public pages. Liferay allows for various configurations of pages for end users: you can configure it so that some or all users have their own pages, public and private (or both), upon which they can place the portlets they need to use. The administrator account by default has its own pages. Because you are logged in with an account that has Administrator privileges, you can see everything in the portal.
One of the most important tools Liferay offers for managing your portal is the aforementioned Control Panel. The Control Panel is composed of administrative portlets that you can use to mange various aspects of the portal.
Navigating the Control Panel
The control panel is very easy to navigate. On the left side is a list of headings with functions underneath them. The headings are in alphabetical order, but the functions are in a logical order.
User Name: The first section is always the logged in user's personal space. Here, you can change your account information and manage your own personal pages.
Illustration 14: Liferay's Control Panel Content: The Content section contains links to all of Liferay's content management functions. You can maintain web content, documents, images, bookmarks, a calendar, administer a message board, configure a wiki, and more. The title of this section appears as the name of the community or organization whose content you are currently managing, and you can switch to another one at any time.
Portal: The Portal section allows portal administrators to set up and maintain the portal. This is where you can add and edit users, organizations, communities, roles, and configure the settings of the portal.
Server: The Server section contains administrative functions for configuring portal instances, plugins, and more.
All of the functions that you will need to maintain the portal or its content can be found in the control panel. Additionally, developers can write portlets which can also be added to the control panel. For further information about this, you can take Liferay's Portal Developer course or see the official guide to Liferay development, Liferay in Action .