Skip to Content
author's profile photo Former Member
Former Member

User language info - KM navigation IView

Hi All,

I'm trying to write a custom navigation iview that shows an URL depending of the userlanguage.

I wrote my custom WdfProxy, but I don't succeed in retrieving the userlanguage. With a normal iview you can retrieve the user info from the componentrequest, but the WdfProxy has not got such an attribute.

In the wdfproxy I try to ask userinfo via the iresource -

IResource startResource = ResourceFactory.getInstance().getResource(this.startUri,super.resourceContext);

- but startResource is null. I execute this code inside the getInternalParameters() method.

Can some tell me how I can retrieve the userlanguage?

We are running EP6 SP2.

Thanks

Message was edited by: Geert Wouters

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 09, 2005 at 07:08 AM

    Hi Detlev,

    Thanks for the advise.

    I was able to create a MyCustomWdfProxy object that does what it should do. There is however something wrong with the MyCustomNavigation.xml file.

    When I load the navigationscreen, i see the correct link structure (the line at the top of the panel with the directory path/URL),but I don't see the directory content (detailed content panel).

    If I replace the original WdfProxy code by my code, everything works fine.

    Is there somewhere a parameter in the MyCustomNavigation.xml file that I should change in order to retrieve also the detailednavigation panel on my screen?

    Thanks in advance

    Message was edited by: Geert Wouters

    Add a comment
    10|10000 characters needed characters exceeded

    • Dag Geert,

      maybe I was not clear enough, sorry. I didn't mean to rebuild the WDFProxy class but just to write a little wrapper calling the original com.sap.km.cm.Navigation iView with the standard parameter set. So you don't have to care about your own [...]Navigation.xml file.

      Just a short extract:

      protected void doOnNodeReady(IPortalComponentRequest req, IEvent event) {
        IUserContext user = req.getUser();
        String usersLang = null;
        Locale locale = user.getLocale();
        if (user.isMemberOfGroup("GRUP.SUPER_GROUPS_DATASOURCE.Anonymous Users", true) || locale == null) {
            usersLang = req.getServletRequest().getLocale().getLanguage();
        } else {
            usersLang = locale.getLanguage();
        }
        // build to be called URI like
        String uri = "/irj/servlet/prt/portal/prtroot/com.sap.km.cm.navigation";
        String path = "/documents/mylangs/lang_"  + usersLang;
        uri += path + "?path=" + path + "&StartUri=" + path +
          "&layoutSetMode=exclusive&XFProjectPath=" +
          &ConfigFileName=Navigation.xml&" +
          StartPage=NavigationPage&Validate=false&" +
          rndLayoutSet=NewsBrowser&rndRootLayoutSet=NewsBrowser";
        req.redirect(uri);
      }

      Of course you should do it generic and not hard code all the values given here but define them as properties, so that you can set them just as within the standard navigation iView and pass them through.

      Hope it helps, groetjes

      Detlev

  • Posted on Feb 07, 2005 at 11:08 AM

    Hi Geert,

    the better way to do so is to write your own proxy implementation as an AbstractPortalComponent; implement the user language request (and afterwards: the redirect to the standard KM component, with parameters set dynamically) within doOnNodeReady (doContent will be just an empty method).

    This way you have killed two birds with one stone: Retrieving the user language works as usual and you are not modifying standard components, but just using them, making them dynamically.

    Hope it helps

    Detlev

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.