Setting language for URL mapping

The URL mapping can also be used to set language for portal page. Ex. Lets say i have a requirement that whenever set of users go to portal page they should always get German page or other set gets Spanish set.
In order to implement this i created a URL mapping like this

<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" build="wp6101_115_01" type="update" version="6.1.0.1" xsi:noNamespaceSchemaLocation="PortalConfig_6.1.0.xsd">
<portal action="locate">
<content-node action="locate" objectid="homePage" uniquename="ibm.portal.Home" />
<url-mapping-context action="update" domain="rel" label="germanhome" >
<access-control externalized="false" owner="uid=wasadmin,o=defaultwimfilebasedrealm" private="false"/>
<portal-url resourceref="homePage" update="set" locale="de" />
</url-mapping-context>
<url-mapping-context action="update" domain="rel" label="spanishhome" >
<access-control externalized="false" owner="uid=wasadmin,o=defaultwimfilebasedrealm" private="false" />
<portal-url resourceref="homePage" update="set" locale="es" />
</url-mapping-context>
</portal>
</request>

Here i created two URL mappings two home page the first <url-mapping> element has lable germanhome that means create a URL with context equal to german home. The <portal-url> element defines the actual page that you want to map this URL to, in my case i am creating mapping to home page. Setting of locale='de' for <portal-url>, makes sure that user gets this page in german. Once you go to this page, Locale for the user would be set to German and would remain German even when he goes to other page until it is explicitly change.

Import the sample xmlaccess script in your portal and then try accessing http://localhost:10040/wps/portal/germanhome url and you should get all the pages in german. Now if you want set user locale to spanish try accessing http://localhost:10040/wps/portal/spanishhome.

Using the XML configuration interface is the only method for changing the locale of a URL Mapping.

3 comments:

srjwebsolutions said...


We are leading responsive website designing and development company in Noida.
We are offering mobile friendly responsive website designing, website development, e-commerce website, seo service and sem services in Noida.

Responsive Website Designing Company in Noida
Website Designing Company in Noida
SEO Services in Noida
SMO Services in Noida

Vikas Chaudhary said...

Battery Mantra is Authorized exide car battery dealer in Noida and Greater Noida. We are providing our service in Indirapuram, Delhi, Ashok Nagar.

Exide Battery Dealer in Noida
Battery Dealer in Noida
Authorized Battery Dealer in Noida
Car Battery Dealer in Noida
Car Battery Dealer
Exide Battery Dealer

EG MEDI said...

Egmedi.com is online medical store pharmacy in laxmi nagar Delhi. You can Order prescription/OTC medicines online.
Cash on Delivery available. Free Home Delivery


Online Pharmacy in Delhi
Buy Online medicine in Delhi
Online Pharmacy in laxmi nagar
Buy Online medicine in laxmi nagar
Onine Medical Store in Delhi
Online Medical store in laxmi nagar
Online medicine store in delhi
online medicine store in laxmi nagar
Purchase Medicine Online
Online Pharmacy India
Online Medical Store