« Zurück zu Using Liferay

Remote Publishing

Introduction #

Liferay portal provides remote staging and publishing capability that users can select subsets of pages and data, and transfer them to the live site, that is, remote portal instance. By this, we can export the selected data to the community of a remote portal instance or to another community in the same portal instance.

How to publish? #

First, we consider the scenario: export the selected pages and data to another community in the same portal instance. In the web site www.book.com, we already have default community Guest with a group ID 10148. In the public pages of the Guest community, create a page Remote Publishing and moreover, add portlets Hello World and Asset Publisher in the page Remote Publishing. Then we create a community Book Workshop with a group ID 11307. We’re going to publish the page Remote Publishing from the public pages of the community Guest to the public pages of the community Book Workshop.

How to publish this page? We can use the publishing feature as follows: log in as an admin; go to Control Panel and click on the Communities under the Portal category; locate the community Guest and click on the action Manage Pages. Click on the button Publish to Remote. Then you will see the screenshot like following figure.

Now let’s set up publishing feature. Under the tab Pages, choose the Scope as Selected Pages, and moreover, select the page Remote Publishing. Under the tab Remote Option, input values for remote options as shown in above figure, e.g. Remote Host/IP as www.book.com (for example, external IP: 64.71.191.145), Remote Port as 8080, for instance, Remote Group ID as 11307, and Remote Pages Set as Public Pages.

When you are ready, click on the tab Pages, and furthermore, click on the button Publish. The page Remote Publishing will be published from the public pages of the community Guest to the public pages of the community Book Workshop.

Then, we’re going to consider another scenario: export the selected data to the community of a remote portal instance. We’re going to publish the page Remote Publishing from the public pages of the community Guest to the public pages of the community Guest of a remote portal instance. Suppose that the remote portal has external IP 69.198.171.104 (and domain name liferay.cignex.com), port number 8080, and group ID of the community Guest 1.

How to publish this page to remote portal instance? Under the tab Pages, choose the Scope as Selected Pages, and moreover, select the page Remote Publishing. Under the tab Remote Option, input values for remote options, e.g. Remote Host/IP as liferay.cignex.com (or external IP 69.198.171.104, for example,

Of course, you can have different remote portal instances), Remote Port as 8080, Remote Group ID as 1, and Remote Pages Set as Public Pages. When you are ready, click on the tab Pages, and furthermore, click on the button Publish. The page Remote Publishing will be published from the public pages of the community Guest of current portal instance, e.g., www.book.com to the public pages of the community Guest of the remote portal instance, e.g., liferay.cignex.com.

What’s remote staging and publishing? #

We have introduced local staging and publishing in the previous section. Local staging and publishing means that we have only one box and only one Liferay portal instance. For a given group, e.g., Book Street, we created a staging group, e.g., Book Street (Staging) – a working copy of the group Book Street. Then users can work on the staging group only. When they are ready, they can publish the pages of the staging group, Book Street (Staging) to the pages of the group Book Street. Since the staging and publishing are happening in one box, and the staging group Book Street (Staging) and live group Book Street are belonging same Liferay portal instance, it is called local staging and publishing. This would be useful when the website is small – less traffic, small group of end users.

Abstracted from the book: Liferay-Portal-5-2-Systems-Development

But when the website is huge – high traffic, big groups of end users - we have to consider the feature: remote staging and publishing. As shown in above figure, there are one staging box and two production box, for example. All boxes have live groups only. For instance, the live group Book Street in the staging box will be mapped into the live group Book Street in the production boxes. Thus, the live group Book Street in the staging box could be called as a staging group of the live group Book Street in the production boxes.

All internal content management users are working in the staging box only. They could use CMS (content management system) tools and WCM (web content management) tools to manage content and web content, e.g., building live website. They can also apply workflow to make content and web content approved or rejected. That is, the staging box is used only for internal content management team. Once the pages are getting approved, content management team could publish these pages into the production boxes.

The production boxes are used only for end users (either public users or private customers). These boxes are set up with same content and web content from the staging box at the beginning. Afterwards, they will accept updates via remote staging and publishing. And they also save specific data in the production boxes, such as users’ ratings, comments, preferences, etc.

In addition, you can have a set of production boxes, more than two boxes as stated in above figure. These production boxes could be organized as a clustering environment. Furthermore, these production boxes could be distributed geographically. For instance, it is possible that you could put one box in California, USA, and another box in Zurich, Switzerland. In order to show remote staging and publishing, we use external IP 64.71.191.145 for the staging box I; and external IPs 69.198.171.104 and 69.198.171.105 for the production boxes II and III, respectively.

Setup #

In order to communicate to the remote server and moreover, to protect HTTP connection, we need to set up tunnel web in the portal-ext.properties. That is, we need to add the following lines at the end of portal-ext.properties.

tunnel.servlet.hosts.allowed=127.0.0.1,SERVER_IP,69.198.171.104,69.198.171.105,64.71.191.145
tunnel.servlet.https.required=false

The above code shows a property tunnel.servlet.hosts.allowed with a list of allowed hosts, e.g., 69.198.171.104, 69.198.171.105, 64.71.191.145. As stated above, we used these hosts as examples only. You can have your own real hosts. Meanwhile, it specifies property tunnel.servlet.https.required. By default, it is set as a value false. You can set it as a value true if you want to use HTTPS.

How does it work? #

(under construction)

Custom Code and Remote Publishing #

(under construction)

Troubleshooting #

Note: Before remote publishing please ensure the local publish computer's clock is synchronized with remote computer and ensure local computer and remote computer's java startup parameter -Duser.timezone correspond your locale.

You may meet issue like:

UI -

Communities portlet is temporally unavailable

logs -

01:21:04,882 WARN JournalContentPortletDataHandlerImpl:120 - No article id found in preferences of portlet 56_INSTANCE_J2Vs

01:21:07,748 ERROR LayoutServiceHttp:816 - com.liferay.portal.SystemException

How to fix it? #

1) by database update:

update Layout set typeSettings = replace ( typeSettings, '56_INSTANCE_J2Vs,', "");

2) by UI:

Locate the page (says "Home") which contains "56_INSTANCE_J2Vs";

Repopulate the content for the portlet Web Content Display in the page (says "Home").

That's it.

Notices of remote publishing

0 Anhänge
65990 Angesehen
Durchschnitt (0 Stimmen)
Die durchschnittliche Bewertung ist 0.0 von max. 5 Sternen.
Kommentare
Antworten im Thread Autor Datum
Hi Is there a way to publish a website running... Paul Sudhakar 3. Mai 2009 23:05
Thank You! PAWAN KUMAR SINGH 13. Mai 2009 02:35
Is it possible to publish once to all clustered... Marcelo Ruiz Camauër 13. Oktober 2009 06:45
Is multi sever remote publishing possible ? I... Tejas Kanani 24. November 2010 01:33

Hi
Is there a way to publish a website running under IIS having only html pages in to liferay ?
Gepostet am 03.05.09 23:05.
Is it possible to publish once to all clustered production instances, or do you need to repeat the same action in each server instance?
Gepostet am 13.10.09 06:45.
Is multi sever remote publishing possible ?
I want to publish the content to 3 different remote instances at a time. Is there any configuration by which i can achieve this. I am using Liferay 6.
Gepostet am 24.11.10 01:33 als Antwort auf Marcelo Ruiz Camauër.