How to get user language in property renderer without web dynpro (java)

Hi all,
how can I get the language of the current user?
Normally I got it with:
IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();
IUser ep5User = WPUMFactory.getUserFactory().getEP5User(sapUser);
IResourceContext resourceContext = new ResourceContext(ep5User);
String strUserLanguage = resourceContext.getLocale().getLanguage();
But this only works in web dynpro applications. Now I need to get the language in my own property renderer. The code throws:
com.sap.tc.webdynpro.services.sal.um.api.WDUMException: No client user defined for the current request (no regular Web Dynpro request as ITask is null.
Thanks a lot
Steffi

Hi,
If you are in a property renderer you always have a IResource which inturn has a ResourceContext and ResourceContext has the Users object.
So the code should be:
IResourceContext resourceContext = IResource.getContext();
IUser user = resourceContext.getUser();
user.getLocale().getLanguage();
Regards,
Praveen Gudapati
Edited by: Praveen Gudapati on May 16, 2008 2:54 PM

Similar Messages

  • How to set a variable in portal session using web dynpro java.

    Hi,
    I have created a web dynpro application, which is running inside portal. I have created a role called "R1". Inside role R1, i have created 3 workset W1, W2 and W3. and inside each workset i have some pages and iviews.
    My requirement is when user logins to the portal , and when he clicks on role R1 for the first time, a login page should come (so that we can do revalidation), and when he enters his password again in that login page , then only workset W1, W2 and W3 should be visible/accessible to him and after successful revalidation, if he clicks again on role R1, in that particular portal session, than that login page should not come.
    for this, i thought i will set a variable in portal session, whenever user successfully revalidated himself, and if after successful revalidation he clicks again on role R1, i will check in doinit method of webdynpro whether variable is set or not (which i already set on successful revalidation), and if it is set then i will do Donavigation else i will present login page to the user.
    Can anyone tells me how to set a variable in portal session using web dynpro java.
    thanks
    Arush

    Hi,
    Try this:
    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE, key, value)
    WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE, key)
    Ex:
    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE,"Key1","Value1");
    String value1=WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE,"Key1").toString();
    /people/william.cui/blog/2007/02/12/sharing-session-context-between-parent-and-external-windows-running-on-same-host
    Regards,
    Charan

  • How to get users picture field displayed via _api/Web/Lists - SharePoint Online

    I have created a field of type Person or Group with "show field  picture only".
    When I look at the result I get back from the _api/web URL what I see is this as the field name:
        <d:OData__x0061_wo9Id m:type="Edm.Int32">25</d:OData__x0061_wo9Id>  
    I need to get the right properties like username,accontname etc..out and I think need to build this url below: 
        /_layouts/15/userphoto.aspx?size=M&accountname=name%40domain.com.au&url=https%3A%2F%2Fdomain-my.sharepoint.com%3A443%2FUser%2520Photos%2FProfile%2520Pictures%2Fusername_domain_com_au_MThumb.jpg
    to be able to get each users picture.
    Thanks in advance

    Hi,
    To get the UserName or AccountName of a Person or Group column, you can take the URL below for a try:
    siteUrl + "/_api/web/lists/getbytitle('" + listName + "')/items(" + itemId + ")?$select=Title,OData__x0050_G1/Name,OData__x0050_G1/UserName,OData__x0050_G1/Title&$expand=OData__x0050_G1/Name,OData__x0050_G1/UserName,OData__x0050_G1/Title"
    If you want to get the Picture URL of an user, you can send another request to User Information list:
    siteUrl + "/_api/web/siteUserInfoList/Items"
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • How to authenticate users from SharePoint 2007 to the Web Dynpro platform

    Hi, I am working on integrating Share to Webdypro application. I want to implelement Single sign on from Sharepoint to SAP.
    So I can make use of Windows credentials for accesing my SAP application.
    So what all configurations need to be maintained at SAP side to achieve this thing.
    Can anyone please help me on this.
    Thanks,
    Betcy

    Hi Betcy,
    I am not familiar with sharepoint solutions, but as you mentioned about windows credentials I believe it refers to kerberos tokens. On this case you can take advantage of SPNego authentication.
    You can find more details on following SAP note:
    #[1488409|https://service.sap.com/sap/support/notes/1488409] - New SPNego Implementation
    I hope it helps.
    Kind regards,
    Lisandro Magnus

  • How to get User input in JTextField?

    How to get User input in JTextField? Can u anyone give me some code samples? thanks

    read the API!!!

  • How to get user logged in to ironport web

    How to get user logged in to ironport web by  their username, time connected and the IP address?

    The onbox reporting can only show what web traffic is currently being surfed.  We can provide a near-real time view of this web traffic with a "Web Tracking Report".
    However, there is not a report available that depicts what you're describing.  (This information is best contained on the domain server).  The closes we could get with the WSA is displaying which credentials we are currently caching.  (Which users we've seen since within the surrogate timeout).  This is possible with the authcache command on the cli.
    ~Tim

  • How to Get user profile properties in provider -cloud hosted app in sharepoint online - office 365 using REST API?

    How to Get user profile properties in provider -cloud hosted app in sharepoint online - office 365 using REST API?
    any idea?

    Hi,
    From your description, my understanding is that you want to get user profile properties in provider-hosted app in SharePoint online using REST API.
    Here is sample code for getting user profile properties:
    http://www.vrdmn.com/2013/07/sharepoint-2013-get-userprofile.html
    Here is a blog below about accessing data from the provider-host apps:
    http://dannyjessee.com/blog/index.php/2014/07/accessing-sharepoint-data-from-provider-hosted-apps-use-the-right-context/
    Best Regards,
    Vincent Han
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to get user input to keep in array in the form of int[]?

    I really want to know how to get user input to keep in an array. Or if it's impossible, can i use the value in "int" and transfer it to an array?

    What I understand is that you want to set an input from the user in an array of int.
    Here is how it work:
    1. Create a stream and a buffer to get and store the informations entered by the user:
    BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
    2. Set this input in a String:
    String input = stdin.readLine();
    3. Set this string in an int:
    int userInput = Integer.parseInt(input);
    4. Then you can put this int in the array.
    Warning this code throws IOExceptions and NumberFormatException ( when you try to set letters as int ). But you can catch them easily.

  • How to create a user in UME Database using web dynpro java custom application

    Hi,
    Can you please suggest me how to create a user in UME Database using web dynpro java custom application.
    My Requirement is user can register his/her user id in SAP Portal 7.3 UME database.
    Please suggest me.
    Thanks and Regards,
    Amit

    Hi Amit,
    Generated Documentation (Untitled)
    This is what you're looking for, there's no real cook-book -- though Amey mentioned there might be some material on SDN, perhaps some tutorials.
    You should be looking into com.sap.security.api.IUserFactory, methods newUser(String) which gives you and IUserMaint and commitUser(IUserMaint, IUserAccount) -- IUserAccount can be obtained using com.sap.security.api.IUserAccountFactory, method newUserAccount(String)
    Hope it helps,
    D.

  • HT204034 How to get an Apple App store account without a credit card?

    Does anyone know how to get an Apple App store account without a credit card?
    When I sign in with my Apple ID it says I did not have an account with the App store, but in order to create one it requires a credit card.
    There is NO None option as some articles show when selecting a credit card.

    Hello SandraLAVixen,
    I understand you would like information on how to use an Apple ID without a credit card. The following article may help:
    Create an iTunes Store, App Store, or iBooks Store account without a credit card or other payment method - Apple Support
    If you already have an Apple ID
    If you've already created your Apple ID, you'll need to add a payment method when you first use it to sign in to the iTunes Store, App Store, or iBooks Store. But you can optionally remove the payment method after you sign in to the store. You won't be asked for a payment method again until you make your first purchase.
    Thank you for contributing to Apple Support Communities.
    Cheers,
    Bobby_D

  • Does anyone know how to get an application you had once without using App Store?

    Does anyone know how to get an application you had once without using App Store?
    Because I'm underage and I couldn't get it back.
    I just want it back, I'm not going to use any money in App Store...

    When you say you "had it once", how did you get it then?  The App Store has only been around for a few years, so there are lots of apps out there that you would once get from the developer, but now they're only available on the App store.  Which app(s) are you referring to? 

  • How I get rid of the Firefox 'Be a web hero etc' & other like windows appearing? It's irritating!

    How I get rid of the Firefox 'Be a web hero etc' & other like windows on starting Firefox. It's very very irritating.

    You can add this code to userContent.css to hide the snippets container on the about:home page.
    * http://kb.mozillazine.org/userContent.css
    * http://kb.mozillazine.org/Editing_configuration
    You can use the ChromEdit Plus extension to have easier access to the customization files.
    * ChromEdit Plus: http://webdesigns.ms11.net/chromeditp.html
    <pre><nowiki>@-moz-document url(about:home){
    /* hide snippet container on the about:home page */
    #snippetContainer { display: none !important; }
    </nowiki></pre>

  • How to get animate edge to interact with my web content

    Hello and good day,
    I will like to know how to get animate edge to interact with my web content or DOM.
    Am creating my own cms and also i created an image  slider.
    i know how to integrate it to dreamweaver but now i will like to the animate slider to change images when a new image is added to my cms..

    There is  no direct way out of edge animate.
    You could export a OAM from Animate and import that into DreamWeaver CC which has a direct way of Hosting sites

  • Problem: Changing Language for Web Dynpro Java within NW Portal (i18n)

    Hi Experts out there,
    I hope all you had a nice Christmas and a big New Years Eve :)!!!
    i got a challenge for you about WD Java and internationalization (i18n)
    Here is the scenario:
    We are using a SAP NetWeaver Portal 7.0 and my task is to implement some smaller Web Dynpro  Applications.
    These Applications must be i18n conform, so i just created (according to the corresponding WD Java tutorial) some ".xlf" files.
    Okay...Everything is working fine. The user can log at the portal and the application is displayed in his language, which is "english" or "german". (the application is just a simple form)
    So far so good...Now here comes the point where it's getting tricky...
    When the user wants to change his assigned language (of the portal user) he can use the "personalize" button in the Masthead (-> change portal language). All the portal content should now be displayed in his new chosen language.
    For example the user is logged into the portal with "german" as portal language and now changes his languages settings into "english". After this everything in the portal (navigation, portal iViews ) is displayed in the changed language (from english into german) ...
    BUT: my Web Dynpro  Java Application stays as the original languages setting was. That means the whole portal is now english, but my WD Java Appl. stays german .
    Only if the user logs of and logs in again, the WD Java Appl. is displayed in the corresponding portal language...
    VERY Strange?!?!
    Can anybody give me a hint how to solve this problem?
    I guess i have to re-initiate the Web Dynpro  Application some how ...(like killing the application and restarting it ...) but is just a "weak guess"...
    Any Help / Hint is more than welcome !!!
    Cheers
    Stefan

    Hi Stefan,
    This correct see SAP Note [947081|https://service.sap.com/sap/support/notes/947081]
    If the locale for the Web Dynpro iView is changed in the portal (through portal personalization), this is not reflected in the running login session. The user needs to logoff and login again, in order to see the locale change in the Web Dynpro iView.
    Regards,
    Leo

  • Storing Current Logged on User Details in Web Dynpro Java

    Hi Experts,
    My GP Process containd 2 steps:
       - Create Activity
       - Evaluate and Approve
    The user creates the Activity and the manager approves it.
    I have to make sure the User Details are avaialble for the Manager to see.
    How do i store the user details logged on.
    I need the "Name", "Date" and "Time" of the user when he creates the Activity.
    Can somebody guide me how to do it using Web Dynpro java.????
    Thanks a lot.
    Cheers
    Gaurav Raghav

    Hi Gaurav,
    Make use of background callable object which retrieves the logged in user details. If you are using WD and you need the logged in user infomation use the IWDClient . Code for getting this is there in sap help.
    Thanks,Uma.A

Maybe you are looking for

  • How to delete a view in a viewset

    Hi, I had gone through the PDF given for Creating a Web Dynpro Application Accessing ABAP Functions. In that there is a viewset by name FlightListViewSet and 2 views And  the layout of viewset is T Layout .It should have Top,Left,Right. He named cell

  • IPad 3 with iOS 8.1 worthless

    SInce I "upgraded" from 7.1.2 to 8.1 it is like someone switched my iPad for a first generation model! This means I'm no longer be able to watch HD 1080p movies without stutering and even locking. Also, I used my iPad for music production and spend m

  • Report Builder - Printing in dos mode

    I am using developer 2000 - report builder I want to printing all my near around 15000 -in dos mode because in windows printing it is very slow . so just want to print it in dos mode .

  • How to force a container redraw to fit-to-content?

    Hi, This has been driving me crazy for a long time now. Example: <panel id="outer"> <panel id="inner"> <textarea text="blah blah blah"/> </panel> </panel> The above works fine, the outer panel's size perfectly fits its content. But if the mxml starts

  • Method cellForRowAtIndexPath if (cell == nil) {} condition strange behavior

    This tableView's are making me crazy. I just tested this behavior on new test project (iPad) with one tableView. I added 30 sections with one row per section and put this line inside if( cell == nil ) {} condition in cellForRowAtIndexPath method: NSL