How to get user information in a standalone java class

Is there a way to retrieve it in a stand alone java class (with no access to request object)? If so how do I get it?
Thanks,
Deepak

Hi
use this
IWDClientUser currentUsers[]=WDClientUser.getClientUsers();
          //Displaying the count of logged on users
          wdComponentAPI.getMessageManager().reportSuccess("Number of logged on Users in the portal - "+(currentUsers.length-1));
          for(int i=0;i<currentUsers.length;i++){
             if(currentUsers<i>!=null){
                 // Displaying the logged on users;
                 if(!currentUsers<i>.getLastName().equals("Guest")){
                      String first= currentUsers<i>.getFirstName();
                      wdComponentAPI.getMessageManager().reportSuccess("User - "currentUsers<i>.getFirstName()" "+currentUsers<i>.getLastName());
    //@@end

Similar Messages

  • How to  get the profile object in simple java class  (Property accessor)

    Hi All,
    Please guide me how to get the profile object in simple java class (Property accessor) which is extending the RepositoryPropertyDescriptor.
    I have one requirement where i need the profile object i.e i have store id which is tied to profile .so i need the profile object in the property accessor of the SKU item descriptor property, which is extending RepositoryPropertyDescriptor.
    a.I dont have request object also to do request.resolvename.
    b.It is not a component to create setter and getter.It is simple java class which is extending the RepositoryPropertyDescriptor.
    Advance Thanks.

    Iam afraid you might run into synchronization issues with it. You are trying to get/set value of property of a sku repository item that is shared across various profiles.
    Say one profile A called setPropertyValue("propertyName", value).Now another profile B accesses
    getPropertyValue() {
    super.getPropertyValue() // Chance of getting value set by Profile A.
    // Perform logic
    There is a chance that profile B getting the value set by Profile A and hence inconsistency.
    How about doing this way??
    Create PropertyDescriptor in Profile (i.e user item descriptor), pass the attribute CustomCatalogTools in userProfile.xml to that property.
    <attribute name="catalogTools" value="atg.commerce.catalog.CustomCatalogTools"/>
    getPropertyValue()
    //You have Profile item descriptor and also storeId property value.
    // Use CustomCatalogTools.findSku();
    // Use storeId, profile repository item, sku repository item to perform the logic
    Here user itemdescriptor getPropertyValue/setPropertyValue is always called by same profile and there is consistency.
    -karthik

  • How i get user info from ldap using java after authenticating user with SSO

    Hi
    I have one jsp/bean application as a partner application with SSO.
    It works fine.
    Now i need to get other attributes of user from LDAP who has logged into the application through SSO.
    using SSO java APIs i only get username, userDN, subscriber info.
    To get user's other attribute i have to user LDAP APIs for that i have to create on Directory Context, for the same i need userpassword.
    so here i my question, how do i get user password after he has logged in thro SSO.
    regards..
    and thanking u in advance
    samir

    Valentina,
    there's no way to get the password value from the directory (it's one way). Of course you can get the hashed (MD4,MD5,SHA-1) base64 encoded value (i.e. the value you see in OiD) but not the 'password'.
    --Olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to get access to PageContext in a java class (.java file)?

    Hi all,
    I am trying to get access to PageContext from inside a java class, and it doesn't seem to work.
    I could get the PageContext from a jsp page, at the object instantiation, through the constructor, but my class is not called by a jsp page.
    Any ideas?
    Thanks,
    Paul

    Basically I do not need to change any attributes from pageContext. However I need the pageContext object because I am using a third party component that is initialized with the pageContext .
    I cannot change the implementation of that component: it is a black box to me, I simply need the pageContext in my java class that uses the component.
    Any thoughts based on this clarification?
    Thanks,
    Paul

  • How to pass an argument to a standalone java class in JDeveloper

    To the experienced:
    In JDeveloper when you write a java class with a main() method that takes no argument, you just right click the java file and select Run to run the program. But suppose the main() method takes arguments, how do you pass your arguments to the program? This is especially a problem as I use the studio version of JDeveloper (Versions 10.1.3.4 and 11.1.1.3) that each uses the version of JDK bundled with it, rather than the JDK (which is yet another different version) installed at the OS level of the PC.
    Many thanks for your help!
    Newman

    Hi, Puthanampatti,
    Suppose a java class has a main() method:
    <pre>
    public class FormatTerm {
    public static void main(String[] args) {
    String year = args[0];
    String semester = args[1];
    </pre>
    What I want to know is how to pass the arguments when invoking FormatTerm within JDeveloper (i.e., without going out of JDeveloper to invoke FormatTerm on a command line in DOS). I would appreciate it very much if you know how to do that in JDeveloper 11g (I use Version 11.1.1.3) and could help me out.
    Thank you very much for your help!
    Newman

  • How to get user information from ldap - bpm11g

    hi all,
    i need know how to do get information from ldap, but using adf bean for show user data in adf form.
    anyone knows about this ?
    tks.

    Neal wrote:
    >
    Hi,
    I am using WLS default authentication to protect my JSP pages. Can someone tell
    me if it is possible to add more fields to the default login box (in addition
    to login and password boxes, I want to ask user the department name). In additional,
    can WLS propogate this information (department name) along with other security
    credentails to other J2EE components such as EJBs? In my EJBs I want to be able
    to get the department name that user provided during login and then use that for
    conditional business logic.
    Any insights on this subject will be greatly appreciated.
    TIA,
    -NealYou can't do this with the default simple authentication. That can only handle a
    username / password combination.
    You should be able to do this with JAAS. You could write a LoginModule that
    populates the department as a Principal or public Credential on the Subject in
    addition to the normal authentication. You would have to do a callback handler
    that passed through the department info to it.
    This link has more on WLS's stab at JAAS:
    http://e-docs.bea.com/wls/docs61/security/prog.html#1039659
    Once you have associated the Subject with the access control context by invoking
    a doAs() you should be able to get it back at any point with
    Subject.getSubject(AccessController.getContext()) to get access to the
    department info.
    It will all be a bit of a chore, mind.

  • MapViewer: how to manage user selections in business components Java class

    Hi list,
    I'm a GIS developer with experience on Mapserver and Mapguide. Buit I'm totally new on Oracle Mapviewer and I'm doing a feasibility study on a project where I basically have a very simple GIS use case, but I don't know if it is possible to manage by use Oracle ADF Java API and Oracle Mapviewer.
    I would like to use JDeveloper / ADF Business Components / ADF Faces.
    This is the use case:
    - Mapviewer should display a polygon layer from Oracle Spatial
    - Mapviewer should display a polygon layer from WFS
    - User should be able to select a polygon on Oracle Spatial layer and another polygon in WFS layer
    - ADF Face map control should:
    a) hilglight these two polygon
    b) execute my buiseness component Java function passing the user selection (id?... coordinates?... or anything useful to get these two polygons in the business Java function) as parameter.
    Is it possible?...
    Any suggestions (or samples) for point b)?...
    Thanks in advance for any help

    Hi Arnd,
    Thanks for answer.
    Can you adreess me to some ADF project that include ADF Geographic Map control?
    I've carefully studied what explained in manuls contained in JDeveloper Help. I've made something, but I have some issue I can't solve.
    Here you are in details what I've made:
    1) I've installed Mapviewer Quick Starter Kit
    2) I've configured themes and base map by use on MapBuilder
    3) I've built an ADF application with separated business and model-view-controller projects
    4) I've created entities and views in ADF business project
    5) I've created a JSF page in model-view-controller project
    6) I've put inside page an ADF Geographic Map assigning my base map and his related toolbar.
    Up to now it worked fine. My problems started at this point, on the attempt to add themes to be exposed to user interaction.
    PROBLEM 1
    I've seen that there are basically two options to add theme for user interaction:
    a) add a predefined themes
    b) add a color/point/graph bindable themes
    Option b) seems not fit for my needs.
    Color theme is only for regions and forces me to set a range of colors (I want to set exatctly two different color for two different table attribute value).
    Lines seem not covered from any of them.
    So the solution should be option a), predefined themes. But predefined theme seems not selectable and I don't know how to attach a selection listener.
    Please note (about selection listener) that in JDeveloper Help, book "Web User Intercace Developer Guide", "Using ADF Geographic Component" there is a code sample, but the explaination on how to enter the backing bean method is truncated (it says "For example," and stop, nothing else).
    My questions are: predefined theme can be selectable? And how can I attach the selection listener?.
    PROBLEM 2
    Up to now I've made no test on WFS themes, but of course, also these themes should be exposed to user interaction in the same way of predefined layers.
    Is it possible?...
    PROBLEM 3
    Legends activated by ADF Map Toolbar seem not working for predefied themes, they display nothing.
    Is it possible to fix or workaround in some way?...
    PROBLEM 4
    Are there any way to print maps?...
    Best regards
    Francesco

  • 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

  • Unable to get User Information in infopath form hosted on sharepoint online(2013)

    Im trying to retrieve user information (department, Manager, Work E- Mail, Etc..) into an infopath form hosted in sharepoint online using "/_vti_bin/UserProfileService.asmx"
    web service. But it returns me an error when im opening the form as :
    An error occurred while
    trying to connect
    to a
    web service. Error ID 5566
    Any idea about how to get those  information into a form which hosted in Office365 environment?
    Thanks.

    I believe this is a known issue:http://support.microsoft.com/kb/2674193/en-us

  • How to get the information of the log related to t.code generated by basis.

    In the log generated by the basis personnel we found the details of user and corresponding t.code used details.  How to get the information reg. which document he went into using this t.code? For example me29 t.code used by 'x' user.  The log is showing time date t.code and user.  By using me29n which document he attended is the requirement. How to get this information. Let me know it pl.
    TS

    Thanks all for the help.
    Here is my solution. A mix from Julian and Thomas.
    In future I will encapsulate the code in a function module.
    DATA: BEGIN OF usr_tabl OCCURS 10.
            INCLUDE STRUCTURE uinfo.
    DATA: END OF usr_tabl.
    DATA: th_opcode(1) TYPE x.
    DATA: LV_TID LIKE  SY-INDEX.
    CONSTANTS: opcode_list LIKE th_opcode VALUE 2.
    CALL 'ThUsrInfo' ID 'OPCODE' FIELD opcode_list
      ID 'TAB' FIELD usr_tabl-sys.
    CALL FUNCTION 'TH_USER_INFO'
      EXPORTING
        CLIENT = sy-mandt
        USER   = sy-uname
      IMPORTING
        TID    = LV_TID.
    read table usr_tabl with key tid = lv_tid.
    IF sy-subrc = 0.
      CASE usr_tabl-type.
        WHEN 2.
          write :/ usr_tabl-type, 'SYSTEM'." (system)
        WHEN 4.
          write :/ usr_tabl-type, 'GUI'." (Gui)
        WHEN 32.
          write :/ usr_tabl-type, 'RFC'."(RFC)
        WHEN 202.
          write :/ usr_tabl-type, 'PLUG-IN'." (Plug-in &).
      endcase.
    ENDIF.

  • 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.

  • I am new to Mac Pro but am purchasing one online.  can anyone tell me how to get the information from my Toshiba onto the Mac.  there are no stores in the state I live in.  Do I need to find a location and will they do a transfer from my I Tunes etc?

    I am new to Mac Pro and am purchasing one online  tonight.  Can anyone tell me how to get my information - Itunes, photos, and videos transferred onto the Mac from my Toshiba.  the state I live in doesn't have an Apple store but I could take it to Minneapolis when I go.  Any ideas where to begin?

    You might profit from a visit to a Minneapolis Apple store. With a brand new Mac, I think they will be most helpful - not just with transferring files, but with other advice as well. And I strongly recommend you invest in a back up drive. The Apple folk can help with that as well.

  • 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 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 I get a Information about how many Scheduling agree

    Dear friend,
       Can any one tell me a process ,How I get a information about how many scheduling agreement or Schedule lines created with in given time.Any standard tcode available  ?
    Regards
    Abrar AHmed

    Dear Abrar
    - To see how many scheduling agreement is created for a given period, use VA05, click on [Further sel criteria] and tick the box against [Sales Document type]  Now input the scheduling agreement type and execute.  You will get list of all scheduling agreements created within the specified period.
    - You can see how many line items are created in a sale order for a given period via VA05.
    thanks
    G. Lakshmipathi

Maybe you are looking for