How can I get the current user an  resource context  in a portal JSPDynPag

How can I get the current user (com.sapportals.portal.security.usermanagement.IUser?)an the resource context  in a portal component (JSPDynPage)?
Thanks.

Hi Jon,
Here is the code to get the current user and resource context in your JSPDynPage:
IPortalComponentRequest  currentRequest  = (IPortalComponentRequest)pageContext.getAttribute(javax.servlet.jsp.PageContext.REQUEST);
com.sapportals.portal.security.usermanagement.IUser contextUser = (com.sapportals.portal.security.usermanagement.IUser) currentRequest.getUser().getUser();
ResourceContext resourceContext = new ResourceContext(contextUser);
Greetings,
Praveen Gudapati
p.s. points are always welcome for helpful answers

Similar Messages

  • How can I get the current user and the current page?

    Hi everyone
    Question..
    It is possible to get the current user (from the user's database on apex) and the current page? (I mean, if I'm in page 4 be able to query a variable / function or something which could give me the current displayed page)
    Thank you very much... I'd been researching without success :-S so I'll appreciate your help
    Regards,
    Fury

    Fury,
    If the user has authenticated, :APP_USER is the name that was used. The current page id is in :APP_PAGE_ID.
    Although I showed bind variable notation for those, & substitution format and v() notation are also available for referencing developer-defined items or built-in names. See the User's Guide for more details.
    Scott

  • How can i get the current number of word in paragraph?

    I have cursor set on some word in Para. And i'd like to make italic all words before it. How can i get the number of current word in collection Words in mInd.Selection.Item(1)?

    Hi Dmitry1776,
    Try something like this:
    Set myInsertionPoint = myInDesign.Selection.Item(1)
    Set myStory = myInsertionPoint.ParentStory
    Set myStartCharacter = myStory.Characters.Item(myInsertionPoint.Paragraphs.Item(1).Index)
    Set myCharacter = myStory.Characters.Item(myInsertionPoint.Index)
    Set myEndCharacter = myStory.Characters.Item(myCharacter.Words.Item(1).Index - 1)
    Set myText = myInsertionPoint.ParentStory.Texts.ItemByRange(myStartCharacter, myEndCharacter).Item(1)
    ...at this point, myText is a range of text from the start of the paragraph to just before the text containing the insertion point.
    Thanks,
    Ole

  • How can I get the jvm or kvm resource?

    I am interested in the jvm,kvm.But I don't know very clearly the archicheture of the kvm or jvm. Where can I get the resource of kvm or jvm? Can I get a source code sample of kvm?

    Do you mean source code?
    The source code for the Sun jdk 1.3.1 is here...
    http://java.sun.com/j2ee/download.html

  • How can I get the current time in Xcelsius?

    I'm reading in an XML feed containing dates/times, and I'd like to do a calculation to see how old it is -- but I can't seem to access the current time in Xcelsius (=now() doesn't work -- it only calculates once, when the model is loaded).
    I can get around that (a bit awkwardly) with a timer, but I'd also like to know what the user's current time zone is... Any ideas?

    Hi,
    Maybe you could use a web service to return the required information - you can feed the timezone to the web service.
    Have a look at this:
    http://www.earthtools.org/webservices.htm#timezone
    http://markitup.com/WebServices/TimeZones.asmx?op=CurrentDateTime
    Best regards,
    Jacob

  • How can I get the Windows User using ABAP ?

    I need to get thru ABAP the Windows user.

    Hi Carlos,
    You can use the following FM to read the currently logged in windows user id:
    DATA: w_userid TYPE char20.
    CALL FUNCTION 'GUI_GET_DESKTOP_INFO'
         EXPORTING
              type   = '5'
         CHANGING
              return = w_userid.
    WRITE: 'Windows User ID:', w_userid.
    Hope this is what you need.
    Sumant.

  • How can I get the DPI of the current workstation?

    Hi can anyone help me?
    I want to know the dpi witch is set on a Windows system.
    How can i get it? Because i will reformat and fit the dpi of displaying images to the dpi of a current window system, e.g image= 200x200dpi and monitor=84dpi so the dpi of the images should be set to 84.
    But How can i get the current dpi of the Workstation?
    please help,
    florian

    yes but it sucks because windows-workstations
    manipulates the dpi to a standard value of 96 dpi...
    its equal if there is a 15" or a 17" monitor ...
    thanks floI agree, getScreenResolution() just doesn't work. Try changing your screen resolution setting (say from 1024x768 to 800x600) and this method will continue to return the same value!
    Can one adjust the scale so that you can draw a 1 inch square, for instance? The default affine transform property of the graphics object passed to paint methods is supposed to have 72 units = 1 inch, but that's not true. Again, adjust your screen settings and the same 72x72 square will come out in very different sizes.
    Is there any way to correct this, short of going to native code to get the screen resolution? I know that the screen display may be a bit miscallibrated, but anything would be better that the way it is now!

  • How can i get the data from the weblink

    Hi All,
    Good Afternoon,
    i create a page with picklist,
    that picklist contains so many currencies like(USD,AED,BSD----------)
    when ever i am selecting the currency from that picklist,
    that time i want to get the current exchage rate from this link
    http://www.oanda.com/convert/classic
    how can i get the current exchage rate from that link.
    pls give me the gudaincee.
    i hope u will help me.

    Hi Gaurav,
    Below given link gives a nice demo of integrating web service with OAF. (For using captcha user verification service).
    [http://oracle.anilpassi.com/integrate-oa-framework-with-web-service-2.html]
    However, using web services will cost little extra effort of learning SOAP and wsdl.
    Please let me know if you find any difficulties related to web services.
    Abdul Wahid

  • How Can I Get The Cpu State With Java?

    are there any method to use??
    what's more,I also wanna to know how can I get
    the current ram that the System is using
    and the threads the System are running?
    Will you please share your knowledge here or
    write to tell me at [email protected]?
    Thanks!!

    if you know how to do this in c++, you can write native methods and use them in java.
    native methods forum:
    http://forum.java.sun.com/forum.jsp?forum=52
    tobias

  • How to get the current user name of the host who is occupying a specific VM?

    I'm developing a winform app with c# code to manage Hyper-V. I need to remind someone if he/she would take a VM which has already been occupied by others.
    Is there any powershell cmd or WMI interface to get the current user of a specific VM?
    Thanks!

    Hiya,
    from cmd there are quser(Query user) and qwinsta(Query Session)
    which should give you that. Don't know how you can incoorperate that in C#, but that should give you something to work with :)
    https://technet.microsoft.com/en-us/library/cc785434.aspx
    https://technet.microsoft.com/en-us/library/cc788125.aspx

  • How to get the current user logon to portal?

    Hi Gurus,
    How to get the current user who logged into portal.
    I have a webdynpro requirement where in which I have to get the current user id who loggedinto portal which will be the input parameter of the BAPI(adaptive RFC model) which will return me employee number of the particular user.
    Can anyone send me the code to retrive the user id through webdynpro application..........
    Pts will be rewarded for useful inputs......
    Thanks in Advance,
    Dharani

    Hi Dharani,
    Using UMEfactory u can do that...
    1. create one input field,
    2. create one attribute called Uid
    3. assign Uid attribute to the input field
    4. type the following code in Doinit() method
                String uid = wdContext.currentContextElement().getUid();
         try {
         IUser user = UMFactory.getUserFactory().
         getUserByLogonID(uid);
         String userName = user.getDisplayName();
         } catch (UMException ex) {
          e.toString(); 
    5. after that go to Portal create one iview assign to particular user. then u get into the user details...
    thats it
    Regards,
    P.Manivannan

  • How can i get the list of all users present in the UME ?

    Hi Experts,
    How can i get the list of all users present in the UME ?
    Is there any API or function Code to get all user list??
    Please help me out!!!
    Help will be rewarded
    -pankaj chouhan

    Hi Pankaj,
    find the official NetWeaver security javadocs (including access to UME) <a href="http://help.sap.com/javadocs/NW04S/current/se/index.html">here</a>. Look for classs UMFactory and proceed from there.
    Best regards,
    Martin

  • How can I get the attributes details like user name, mail , from sAMAccount csv or notepad file through powershell or any other command in AD?

    How can I get the attributes details like user name, mail , from sAMAccount csv or notepad file through powershell or any other command in AD?

    Ok what about If i need to get all important attributes by comparing Email addresses from excel file and get all required answers
    currently I am trying to verify how many users Lines are missing , Emp numbers , Phones  from AD with HR list available to me.
    I am trying to Scan all the AD matching HR Excel sheet and want to search quickly how many accounts are active , Line Managers names , Phone numbers , locations , title , AD ID .
    these are fields I am interested to get in output file after scanning Excel file and geting reply from AD in another Excel or CSV file
    Name’tAccountName’tDescri ption’tEma I IAddress’tLastLogonoate’tManager’tTitle’tDepartmenttComp
    any’twhenCreatedtAcctEnabled’tGroups
    Name,SamAccountName,Description,EmailAddress,LastLogonDate,Manager,Title,Department,Company,whenCreated,Enabled,MemberOf | Sort-Object -Property Name
    Can you modify this script to help me out :)
    Hi,
    Depending on what attributes you want.
    Import-Module ActiveDirectory
    #From a txt file
    $USERS = Get-Content C:\Temp\USER-LIST.txt
    $USERS|Foreach{Get-ADUser $_ -Properties * |Select SAMAccountName, mail, XXXXX}|Export-CSV -Path C:\Temp\USERS-ATTRIBUTES.csv
    #or from a csv file
    $USERS = Import-CSV C:\Temp\USER-LIST.csv
    $USERS|Foreach{Get-ADUser $_.SAMAccountName -Properties * |Select SAMAccountName, mail, XXXXX}|Export-CSV -Path C:\Temp\USERS-ATTRIBUTES.csv
    Regards,
    Dear
    Gautam Ji<abbr class="affil"></abbr>
    Thanks for replying I tried both but it did not work for me instead this command which i extended generated nice results
    Get-ADUser -Filter * -Property * | Select-Object Name,Created,createTimeStamp,DistinguishedName,DisplayName,
    EmployeeID,EmployeeNumber,Enabled,HomeDirectory,LastBadPasswordAttempt,LastLogonDate,LogonWorkstations,City,Manager,MemberOf,MobilePhone,PasswordLastSet,BadLogonCount,pwdLastSet,SamAccountName,UserPrincipalName,whenCreated,whenChanged
    | Export-CSV Allusers.csv -NoTypeInformation -Encoding UTF8
    only one problem is that Manager column is generating this outcome rather showing exact name of the line Manager .
    CN=Mr XYZ ,OU=Users,OU=IT,OU=Departments,OU=Company ,DC=organization,DC=com,DC=tk

  • How can I get the language of the user logged on using only DI API?

    Hello,
    how can I get the language of the user logged on using only DI API,
    without invoking the UI?
    Can I read the value from some table using sql?
    I could write to file the first user's connection to the language code in SAP and then use it from external program, but I do not like this solution ...
    I know only this possibility:
            '_SboCy ==> SAPbobsCOM.Company
            '_SboCys ==> SAPbobsCOM.CompanyService
            '_SboApp ==> SAPbouiCOM.Application
            CodLng Dim As String = ""
            Dim lng As SAPbobsCOM.UserLanguages _SboCy.GetBusinessObject = (BoObjectTypes.oUserLanguages)
            If lng.GetByKey (_SboApp.Language) Then
                codLng = lng.LanguageShortName
                'Etc. ..
            End If
            lng = Nothing
    Thanks

    Hi Enrico,
    The language settings are held on the user's Windows profile and not in the database. In SBO 2007A onwards there is an XML file that is created by the SBO client (previous versions stored the information in the registry). The file is called b1-current-user.xml and you'll find it in the temporary application data under the user's profile (by default this will be C:\Documents and Settings\<profile>\Local Settings\Application Data\SAP\SAP Business One for Windows XP). This XML file contains a node that looks like the following:
    <leaf kind="single" name="Language" type="String">
         <value>8</value>
    </leaf>
    where the value is the language id that should correspond to the same setting in the DI API. If your application will always run on a workstation where the SBO client is installed then you could read this XML file. Of course, this file may not exist for a particular Windows user if they have never opened the SBO client so you'd need to have a default setting.
    If you application will be installed on a workstation which doesn't have an SBO client installed on it then there is no way to tell what default language to use and you'll need to build this logic in to your own application (eg have a screen where the user can choose their preferred langauge and then store this as a config file in a similar way to how the SBO client works).
    Kind Regards,
    Owen

  • How can I get the position assigned to the user in CRM .

    Hi all ,
    How can we get the positions to which a  user is assigned as a holder in CRM .
    Thanks ,
    Naval bhatt .

    Hi,
         Use the PPM toolkit class CL_CRM_PPM_UM_TOOLKIT. You can use the method You can use the method GET_ASSIGNMENTS_OF_USER which returns positions held by an user(user name).  You may also find the method GET_POSITION_OF_USER useful. It accepts username and the organization ID and will return the positions held by the user under that organization.
      This class always uses the current plan (01). If you want otherwise, you can use the FM RH_STRUC_GET. As to how this FM should be used, look inside the above said methods.
    Regards,
    Arun Prakash
    Edited by: Arun Prakash Karuppanan on May 11, 2010 11:40 AM

Maybe you are looking for

  • Downloading from iTunes with Windows Vista

    I just purchased my iPod video and i am tring to download a free episode of something and it is saying that it is going to take 132 hours for it to download. I am using windows vista and i was wondering if this was a normal thing or if there was anyt

  • Itunes not working, get "missing file, reinstall itunes" message.

    1.  Itunes not working, get "missing file, reinstall itunes", message. 2.  When try to reinstall itunes, gets as far as "starting services", then stops with message, "Apple mobile device failed to start. Verify that you have sufficient privileges to

  • Media Encoder 720x480 exporting as 656x480 when using FLV|F4V

    Version: 4.2.0.006 When I use the FLV | F4V format and select F4V (same as source) and I'm NOT resizing the video, it shows the resolution as 656x480 instead of the 720x480 resolution of the original AVI. If I use FLV instead of F4V it comes out 655x

  • Creating Logical formulas in Numbers '09

    I need to apply a cost per square inch on art work. The cost/sq in decreases in increments as the total area increases. Is it possible to have a formula recognize the category of a particular area and apply the appropriate cost per square inch? Thank

  • Fax and phone interference

    The fax test says "not using cord supplied with printer,"  but I am using that cord as directed.   Problem--incoming phone calls are triggering the fax signal, and we can't hear the voice when we pick up after two rings.   How to separate the voice c