Skip to Content

If you are going to implement Multilingual External Facing Portal with identical contents in each language;
luckily you have Portal Content Translation. However, if you have different contents you cannot use
Portal Content Translation or swap language with direct links like “/irj/portal/anonymous?guest_user=english”.

Lets assume we are going to publish in two languages English and Turkish.

Here is step by step solution :

Step 1 – Grant Anonymous Access to KM


Use following documentation to configure an anonymous access to KM.

How To configure an anonymous access to KM

Step 2 – Create Anonymous Users


    • Create two users in portal “english” and “turkish”.
    • In Config Tool, Enter the user ID of the users in the UME property ume.login.guest_user.uniqueids separated by comma.
    • Restart servlet engine.

Now we have two anonymous users named turkish and english. We want to use user turkish to publish content in Turkish Language and user english to publish content in English Language. Users can access the portal in anonymous mode via following URLs:

    1. http::/irj/portal/anonymous?guest_user=turkish
    2. http::/irj/portal/anonymous?guest_user=english


Step 3 – Create Content for Anonymous Users


    1. Create two roles “Anonymous English Content” and “Anonymous Turkish Content”.
    2. Assign user “english” to role “Anonymous English Content” and user “turkish” to role “Anonymous Turkish Content”.
    3. Prepare your content and assign them to relevant roles.


Do not forget to set “Authentication Scheme” property of your IViews to anonymous.

Step 4 – Change Portal Desktop to “Light Desktop”


Go to System Administraton – Portal Display – Desktop & Display Rules and configure “Master Rule Collection” to use Light Desktop for group “Anonymous Users”.

Now, we have two different anonymous pages with different URLs. However, when you want to go to English Page from Turkish Page you will see that it is not possible just by changing URL or via direct link from any content. Even you change URL, you will see that Portal do not logoff first anonymous user and log on to other anonymous user. Let’s see how we can overcome this trouble.


Step 5 – Develop a Portal Component to swap Anonymous Users


    1. Create a new Portal Application Project “Change User”
    2. Create a servlet by extending “AbstractPortalComponent” class
    3. In doContent method write following code :


      String guest_user = request.getParameter("guest_user");
      String href="/irj/portal/anonymous?guest_user="+guest_user;
      response.write("

“);
response.write(“window.top.location.href=\””href“\””);
response.write(“</script>”);
</font>
</pre>
</li>
<li>In portalapp.xml create a component “ChangeUser” and add property “Authscheme” with value “Anonymous”</li>
<li>Deploy your par file to Portal</li>
</ul>
<p>Now, we have a component called ChangeUser and we can use this component to swap anonymous users in Portal. In Turkish Page use following link to swap to English Page :<br>
“/irj/servlet/prt/portal/prtroot/ChangeUser.ChangeUser?logout_submit=true&guest_user=english” <br>
and in English page use following link to swap to Turkish Page : <br>
“/irj/servlet/prt/portal/prtroot/ChangeUser.ChangeUser?logout_submit=true&guest_user=turkish”
</p>
<p>
Notice that there is a “logout_submit=true” in querystring which actually handle logoff job. I changed Masthead and add following lines to swap languages :
</p>
<pre>
<font size=2>
<% if (isAnonymous) { %>
<% if (componentRequest.getUser().getUniqueName().equals(“english”)) { %>
<TD nowrap >

Turkish </TD>
<% } else { %>
<TD nowrap >[English | /irj/servlet/prt/portal/prtroot/ChangeUser.ChangeUser?logout_submit=true&guest_user=english]</TD>
<% } %>
<% } %>

</font>
</pre>

To report this post you need to login first.

6 Comments

You must be Logged on to comment or reply to a post.

  1. Michael Nicholls
    Are there any version/support pack limitations on this?

    Cheers

    (feel free to add it as a wiki page to the portal space. If you make a child page under here it will certainly be a welcome addition.)

    (0) 
  2. christian schoenwaelder
    i try to solve this topic since about a month. the weird thing in my project is, that i i just want to view the page in a different language. i don’t want to switch users….

    thx for the blog!

    (0) 

Leave a Reply