Skip to Content
0
Former Member
Feb 11, 2008 at 03:37 PM

Masthead Link with changing Language

27 Views

Hi

I'm new in developing in portal and try to get step by step into this.

I'm trying changing the masthead that I will have a link which changes the language. E.g. having [EN], [GE] - and the user can change the language.

Ok, there is personalization etc. which allows the user to do it - but we want to have it on the main masthead.

I've read a lot about this (e.g.https://Let a user change their portal language graphically) but my problem is in coding the stuff.

I try to insert in masthead.par - in the headeriView.jsp the following code:

-


private String ChangeLanguage(IPortalComponentRequest request)

{

IUser user = request.getUser();

String uID = user.getUniqueID();

IUserMaint modUser = UMFactory.getUserFactory().getMutableUser(uID);

String uniqueID = request.getUser().getUniqueID();

return uniqueID;

}

-


As soon as I insert the line

IUserMaint modUser= UMFActory.getUserFactory().getMutableUser(uID);

then my MASTHEAD fails in portal. Removing this line - everything works fine.

And without this line I cannot go further to make the following:

modUser.setLocale(Locale.ENGLISH);

modUser.commit)(;

modUser.save();

If you have any hints / help please let me know - thank you

Roger