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. The heart of any portal implementation is its portlets, because portlets are where all of the functionality is implemented. 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 the Liferay Developer's Guide.
Additionally, Liferay supports portlets written in other programming languages, such as PHP, Ruby, Groovy, or Python. Sample portlets written in these languages are available to download from our Sourceforge site (http://sourceforge.net/projects/lportal) or can be checked out from our Subversion repository (https://lportal.svn.sourceforge.net/svnroot/lportal).
Illustration 50: The default Liferay Dock. When you see Liferay's default interface for the first time, you will see what we call the Dock in the upper right hand corner of the screen. The Dock is the key to navigating within the supplied Liferay themes: it provides links to all the global functions a user needs, such as logging in and out and switching between various community and organization pages. By default, it contains only two links: Home and Sign In. To show these links, all you need to do is roll your mouse cursor over the Dock, and it will expand.
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: email@example.com
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 little has changed. The Sign In portlet now displays the name of the user (whose rather unimaginative name is Test Test) who is logged in, and the Dock now displays the text "Welcome, Test Test!" If you hover your mouse over the dock now, however, you will see that there are many more links in it:
Home: takes you to the home page.
Illustration 51: Administrator's DockSign Out: logs you out of the portal.
Add Application: opens the Add Application window which allows you to add portlets to the page.
Layout Template: displays the Layout Template window which allows you to choose different layouts for the page.
Manage Pages: takes you to the page administration screen, where you can add and delete pages, change the order of the pages, and configure several other things about pages.
Toggle Edit Controls: This will let 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.
My Places: shows you the community and organization pages in the portal to which you can navigate.
If you roll your mouse over My Places, the Dock will expand, showing all of the places in the portal to which you have access. Initially, the place you are on will be highlighted. You will see that you are in the Guest 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. To administer Liferay, you will need to add the administrative portlets to a page somewhere. Since the Guest community is by default where the public pages for your web site will go, you do not want to put the administrative portlets there. Instead, it is better to put them on the administrator's private pages.
To navigate to these pages, you would go to the Dock, then My Places, then My Community, and then click on Private Pages. You will then be taken to the administrator's private pages.
Adding the Administrative Portlets
Liferay's administration interface is itself implemented as portlets. This means that there is no special area to go to in Liferay in order to begin administering your new portal. All you need to do is add the administrative portlets to a page and get to work! For our purposes, we will create a page in the administrative user's private page area called Admin. At the top right of the page you are viewing (under the Dock), you should see an Add Page link. Click it, and a field will appear, allowing you to type a name for the page. Type Admin and press the Enter key. The page has now been created. Go to the page by clicking on it.
You will see that the page is blank. We will be adding some of Liferay's administrative portlets to it so that we can begin configuring Liferay. First, though, we want to change the layout so that it is optimal for the portlets that we want to add. So go up to the Dock and click Layout Template. Select the 2 Column 70/30 layout and click Save. It won't look like anything has changed, but that's because you don't have any portlets on the page yet. We will now add the administrative portlets that we will need to begin configuring Liferay.
Go back up to the Dock and click Add Application. You will see a new window with application categories pop up on the left of your browser window. There are several ways you can use this window to find portlets to add to your page.
Illustration 52: Your Administrative Page. If you know what you are looking for, you can begin typing the name of the portlet in the search bar at the top. The window will readjust itself as you type to display portlet titles that match your search. If you're not sure of the name of the portlet you want, you can click on the categories and they will expand and display the portlets that are inside those categories.
Click the Admin category. One of the portlets listed there is called Enterprise Admin. Drag the portlet title off the Add Application window and onto your Liferay workspace. You will see the columns for the layout you chose previously appear as you drag. Drop the portlet in the left most column, and it will appear there. Next, drag the portlet called Admin to the right most (smaller) column.
After this, open the Community category. One of the portlets in this category is called simply, Communities. Drag this portlet to the left most column underneath the Enterprise Admin portlet. After you have done all of this, you can close the Add Application window by clicking the red X that's in the top right corner of the window.
When you are finished, you should have a page that looks similar to what is pictured.