The Export / Import tab allows you to export the pages you create into a single file, called a LAR (Liferay Archive). You can then import this file into any server running Liferay, and all of your pages will be copied. This is a great way to take your content from one environment (say, a development or QA environment) and move it all in one shot to your production server.
This is also a good way to back up your site's content. You can export it to a specific location on your server which is backed up, and if you ever have to restore your site, all you need to do is import the latest LAR file. One limit- ation on LAR files, however, is that they are version dependent, so you can't use an export from an old version of Liferay and import it into a newer ver- sion.
Let's be good admins and export a LAR file for backup purposes. Select the Export / Import tab and then name the file spartansoftwareV1.lar. We're
asked what we would like to export. Let's select everything for this initial ex- port. Note that if you select the More Options link, the list expands to include data from many of Liferay's applications, including the Document Library and the Wiki. You can also export the theme you're using.
Once you click the Export button, your browser will prompt you to save the file. Once you have the file, you can copy it to a backup location for safe keeping or import it into another installation of Liferay Portal. If you must rebuild or wish to revert back to this version of your site, you can import this file be selecting Export / Import and then selecting Import and then browsing
to the file.
Settings
The Settings tab gives us several powerful tools. In this tab you'll find op- tions to customize the logo, stage the content, connect a domain to a com- munity or organization, take advantage of the Liferay's integration with Google Analytics, and more. Let's take a look at them in order.
Virtual Host
You can make web navigation much easier for your users by connecting a domain name to a community or organization. This tab allows you to define a domain name (i.e., www.mycompany.com) for your community. This can be a full domain or a subdomain. This enables you to host a number of web sites as separate communities on one Liferay server.
For instance, if we set this up for Spartan Software's marketing com- munity, users in that community could use marketing.spartansoftware.com
to get to their community, provided that Spartan's network administrators created the domain name and pointed it to the Liferay server.
To set this up, you would simply configure the DNS for marketing.s- partansoftware.com at the web address for your portal, and enter
http://marketing.spartansoftware.com in the Virtual Host tab for the mar-
keting community.
This can help users quickly access their community without recalling an extended URL.
Logo
If you want to use your own logo for a specific community or organiza- tion, you can configure an alternate logo here. To add a custom logo, select the Logo tab, then browse to the location of your file and select the Use Logo box. Be careful to make sure that your logo fits the space in the top left corner of the theme you are using for your web site.
Sitemap
The next tab lets you generate a sitemap to help you optimize your site for search engines. The Sitemap tab publishes your site using the sitemap protocol, a protocol that helps search engines crawl your web site to index all relevant information. You can publish your site to Yahoo or Google, and their search indexes will use the sitemap to index your site.
Liferay Portal makes this very simple for administrators by generating the sitemap XML automatically for all public web sites.
By selecting one of the search engine links, the sitemap will be sent to them. It's only necessary to do this once per community or organization. The search engine crawler will periodically crawl the sitemap once you've made the initial request.
If you're interested in seeing what is being sent to the search engines, se- lecting the Preview link allows you to see the generated XML.
Monitoring
The Monitoring tab allows you to integrate your pages with Google Ana- lytics. Liferay provides seamless integration with Google Analytics, allowing you to place your ID in one place, and then it will get inserted automatically on every page. This enables you to focus your efforts on building the page, rather than remembering to put the code everywhere. Google Analytics is a fantastic, free service which lets you do all kinds of traffic analysis on your site, so you can see who visits, where they visit from, and what pages they most often visit. This helps you to tweak your site so that you can provide the most relevant content to your users.
Staging
Staging is a major feature of Liferay CMS. The concept of staging is a simple one: you don't want your users seeing your web site change before their eyes as you are modifying it, do you? Liferay's staging environment al-
lows you to make changes to your site in a specialized staging area, and then when you are finished, publish the whole site to your users.
You can use staging in multiple ways. Larger organizations may consider having a staging server—a separate instance of Liferay Portal which is used just for staging. Content creators can then use this server to make their changes while the live server handles the incoming user traffic. When changes to the site are ready to be published, they can be pushed remotely to the live server.
Alternatively, you may want to host both your staging environment and your live environment on the same server—particularly if you are part of a smaller organization with less resources to purchase servers. Either way, once set up, the interface is the same; the only difference comes when it's ac- tually time to publish your content.
Enabling the Staging Environment
The Staging tab allows us to make changes in a staging environment and preview our work before publishing it to the live site. Let's create a staging environment for the Spartan Software's Corporate Headquarters community.
First, we'll need to create the community. Go the Control Panel, select the
Communities tab, and then select Add. In the Name field, type in Corporate Headquarters. Add a description and leave the type set to Open. After you've
Now we're going to add a page to our new community. Since you're already in the Communities interface, you can simply select Actions Manage→
Pages for the Corporate Headquarters community.
Add a new public page named News and Events. Next, click the View Pages button and add the Alerts and Announcements portlets to it.
Now we're ready to activate the staging feature for this community. You should now have two tabs or windows open in your browser to Liferay: one is on the Control Panel, and one contains the page you have just created. Re- turn to the Control Panel tab where you're editing the page structure and se- lect Settings → Staging.
We'll assume we don't have a separate staging server, and so we'll select a staging type of Local Live. If you were to select Remote Live, you would also have needed to supply the name or IP of the remote server where staged con- tent should be published, the port (80 if Liferay is sitting behind a web server, or the port your application server is listening on if not), and the remote community or organization ID. You can find this ID by selecting Actions →
Edit on any community or organization in the Control Panel. Either way, once
we make a selection (Local Live or Remote Live), many more options will be- come available to us.
We'll cover many of the collaboration portlets listed here when we come to chapter 5. For now you just need to be aware that the option is available to enable or disable staging for any of them, and you need to decide if you would like to stage content for these portlets. In the case of the collaborative portlets, the answer would of course be “no.” Why? Because portlets such as the Message Boards are designed for user interaction. If their content were
staged, you'd have to manually publish your site whenever somebody posted a message on the message boards in order to make that message appear on the live site.
Generally, you'll want Web Content to be staged, because end users aren't creating that kind of content—that's the stuff you publish to your site. But portlets like the message boards or the wiki would likely benefit from not being staged.
Under Advanced Options, you can select a number of Editorial Stages your content needs to go through. This means you can have your pages reviewed through up to six levels of approval before they get published. If you select a number of stages here, you'll next be asked to define roles for each stage. Users in these roles will need to approve the changes through however many stages you have selected in order for the changes to be published live. Let's see how all of this works.
Using the Staging Environment
If we navigate back to the News and Events page of the Corporate Headquarters community we'll now notice an orange border around the page, and the Staging link will be in the Dockbar. Select the Staging button and then View Staged Area. The page now has a red border.
Add the wiki portlet and then from the Dockbar select Staging View→
Live Page. Notice that the wiki portlet isn't there. As you can see, only the
page changes are staged; web content itself can go through a whole different workflow process (which we'll get to later). If you select Staging → View Staged Page, you'll also see that since we didn't configure the Wiki portlet to
stage its content (because that content is user-submitted), the Wiki portlet in our staged area displays a warning message telling us that its content is not staged.
Now, let's say that our page is exactly the way we want it, and we want to publish it to the live site. If we have enabled more than one Editorial Stage, we can submit a proposal to have the content reviewed. If not, we can simply publish it to the live site.
To submit a proposal, you must be viewing the staged page. From there, you can go up to the Dockbar and select Staging Propose Publication→ . Once you do this, a small dialog box will pop up asking you for the proposal de- scription as well as allowing you to select the reviewer who should be able to review this proposal. The list of reviewers is populated from the roles you se- lected when you enabled Editorial Stages.
Once you've submitted your proposal, it will no longer be possible to sub- mit more proposals. Your proposal will have to be dealt with by someone with the role who reviews the content at this editorial stage. To view the pro- posals, go back up to the Dockbar and select Staging View Proposals→ . You'll then see the proposal you've submitted.
Click on the proposal to view it. Here, you'll be able to change the ap- prover, set a due date, select the next reviewer (from the role which is con- figured for that editorial stage), and, of course, the other options you'd ex- pect: preview the proposed changes, approve, and reject.
Once rejected, the proposal needs to either be approved later or deleted. If the proposal is approved, it goes on to the next stage, if there's another ap- prover. Otherwise, a Publish to Live button is enabled. In order to get the mod- ified pages onto the live site, somebody has to push this button; there isn't a way to cause the pages to be published automatically upon the last approval.
To publish the modified page we simply need to return to the proposal and click Publish to Live. Once this is done, Liferay will ask you what you wish to publish. In our example, we have only one page to publish, and it's already selected. All we have to do is click Publish. The changes are now live!
When it comes time to modify your site again, you simply repeat the pro- cess. You can enable staging on an individual community or organization basis, depending on your needs. This makes it really easy to put strict con- trols in place for your public web site, but to open things up for individual communities that don't need such strict controls. Liferay's staging environ- ment is extremely easy to use and makes maintaining a content-rich web site a snap.