JAVA API Personalization iview / User Mapping

I am using the following code snippet to get the
User Mapping from the "Personalization" iview
IUserMappingData iumd = iums.getMappingData (systemalias, iuser);
Is there a similiar SET method?
TIA -hs

hI
When you use umdata.enrich(map), soon after that, use SET property in the Hash Map and finally call umdata.storeLogonData(Map). This map should contain updated credentials.
Hope this works.
Pls reward points if useful
Murali.

Similar Messages

  • Java API Personalization

    I need to write an iview that creates entries for the Personalization
    i.e the ALIAS, userid password entries needs to be created froma java program, not by user entries.
    TIA -hs

    Hi,
    To create semantic objects -- iViews, pages and so forth -- via code see the documentation at http://help.sap.com/saphelp_nw04/helpdata/en/fd/ea5c42da4de92ce10000000a1550b0/frameset.htm.
    To change the personalized values for attributes for an object, see the documentation at http://help.sap.com/saphelp_nw04/helpdata/en/e6/e8a04267deb211e10000000a155106/frameset.htm. In the environment variables for the PCD lookup, set the IPcdContext.PCD_PERSONALIZATION_PRINCIPAL variable to the user for which to personalize.
    If this is not exactly what you need, please specify more precisely.
    Hope this helps.
    Daniel

  • Java code to get user mapping info

    I am writing a Java Servlet that needs to read the username and password to a user mapping system.  Can anyone post a code example that will accomplish this?  I have already been looking through the forums, so please don't post links to other forum entries.

    hello Pfister,
       I'll send you one article link , just go thru it ,
    you can many examples from basics. if you get any errors just take that error no. which displayed , you can find the solution for that error in the link.
    This link you can see one good example:
    http://www.onjava.com/pub/a/onjava/excerpt/java_cookbook_ch18/index.html?page=5
    Regards,
    Varun

  • Java api: User mapping information

    Hi all,
    is it possible using Java Api to read User mapping information.
    I need user name my portal user mapped to.

    found an answer: Re: Getting User ID and Password Mapped to the Users

  • Portal - User mapping - umlaut - personalize - error

    Hello all,
    did anyone hear of the following in the portal user mapping to a backend SAP system ?
    A user has an account in a 4.7 SAP system and his password contains a german umlaut.
    In the portal "User mapping" instead of SSO is active. The user clicks the "Personalize" iview to map his SAP User, he enters his SAP UID and his (umlaut-containing) password.
    When he then calls an iview that is connected to the backend system (e.g. bwsp via ITS), he gets the message "No user mapping defined for system ...". He then can enter his UID/password for this single request, and when he does so, it works. Same procedure comes up, when he again tries to call the iview.
    It seems, as if the password is written to the database in the wrong way ?
    Any experiences on this ?
    Thank you + regards
    Andreas

    Hi Andreas,
    Go to User Admin - User Mapping. Search for the user and click on "Edit".
    Now select the "System" defined for connecting to the SAP 4. 7 system. Give the user id and password for the system and click on "save".
    Now try accessing the iview. You would be taken to the sap system directly without any request for login.
    You can do the same, if the user has "Personalize" link available in the top right corner of the portal which comes by adding the "EU Role" to the user.
    Hope this solves your problem.. If not pls get back.
    Regards,
    venkat.
    [Reward points for useful answers]

  • Update User Mapping ID api

    Hi,
    Does anyone know if there is an api to update user mapping ids for users in EP6.0 Portal Database.
    I know it can be done in the standard User Import with the inclusion of $usermapping$ but wanted to know of there is a way to do it in a bespoke program to help automate the addition of portal users who will require access to the connected R/3 system (of which there will be many).
    Thanks for any help you can offer,
    Steve.

    Hi Steve
    Try the following code.
    IPortalComponentRequest req = (IPortalComponentRequest) this.getRequest();
    IUserMappingService iumser = (IUserMappingService) PortalRuntime.getRuntimeResources().getService(IUserMappingService.KEY);
    IUserMappingData iumdata = iumser.getMappingData("System Alias", req.getUser());
    Map map = new HashMap();
    try {
        iumdata.enrich(map);
    } catch (Exception e) {}
    String userid = (String)map.get ("user");
    String password = (String)map.get ("mappedpassword");
    The following code stores usermapping info.
    IPortalComponentRequest req = (IPortalComponentRequest) this.getRequest();
    IUserMappingService umapser = (IUserMappingService)
    PortalRuntime.getRuntimeResources().getService(IUserMappingService.KEY);
    IUser userid = req.getUser();
    IUserMappingData iumdata = umapser.getMappingData ("System Alias", userid);
    Map map = new HashMap ();
    try {
         map.put("user","userid");
             map.put("mappedpassword","password");
            iumdata.storeLogonData(map);
    } catch (Exception e) {response.write(e.getMessage());}
    Hope this helps.
    Regards,
    Yoga

  • Difference between interfaces in Java API and user defined interfaces

    Is there any differences between the interfaces (such as KeyListener, ActionListener and EventListener etc.,) in Java API and the user defined interfaces.
    The user defined interfaces seems to be empty without any functionality (except its constant and method declarations). But the interfaces in Java API seems to have some functionality behind them, since they route the device events to the programs.
    Actually what is happening behind the Java API's interfaces?
    Please clarify.

    Ummm, no they are not (or at least some of them are not). Also, some things we support now we may not have supported in a previous release.
    If you look at the section 2 (Working with TimesTen Data Stores0 in the TimesTen Java Developer's Guide and look at the sections:
    TimesTen JDBC Extensions
    Additional TimesTen classes and interfaces
    then you will see the extra functionality documented there. Of course, if you do not need any of this functionality then you can simply treat them as the base classes from java.sql and they will work fine so it is easy to make most of your code generic.
    Chris

  • How to Change TimeZones from Personalize iView

    Hi All,
    In my Masthead, i need to Display the Country name and the Time, user is going to chnage the time zone and Country from Personalize iview User Profile, according to that the respective time is going to display it on Masthead part.
    Now my Question, If user is Change the Timezone & Country in the User profile, how it is going to reflect on  Masthead area.
    Thanks In Advance
    Krishna Ganesh

    Hi Michael,
    In the Masthead JSP it self, we are adding jsp scriptlets and html Div Elements to display the time on the Masthead. Currently i am able to display the server time with normal Java API.
    Now i am going to display 5 timezones in a Iview, that iview is going to add to user's HomePage(User Choice).
    Thanks
    Ganesh

  • User Mapping not fully available

    Hi, each time i want to do a user mapping i have the following error:
      Portal Runtime Error
    An exception occurred while processing a request for :
    iView : pcd:portal_content/administrator/super_admin/super_admin_role/com.sap.portal.user_administration/com.sap.portal.user_mapping/com.sap.portal.userMappingAdmin/com.sap.portal.userMappingAdmin
    Component Name : com.sap.portal.usermanagement.admin.UserMappingAdmin
    User Mapping not fully available..
    Exception id: 09:43_09/11/04_0002_1358150
    See the details for the exception ID in the log file
    This is the message i have found at the server log:
    #1.5#0008541F9918004D0000006E00000CF80003E872B1EAA51E#1100004239000#/System/Server#sap.com/irj#com.sap.portal.portal#Administrator#281####f126dea0324c11d98bd10008541f9918#PRT-Async 0##0#0#Error#1#com.sap.portal.portal#Java###Exception ID:09:43_09/11/04_0002_1358150
    [EXCEPTION]
    #1#com.sapportals.portal.prt.component.PortalComponentException: Error in service call of Portal Component
    Component : pcd:portal_content/administrator/super_admin/super_admin_role/com.sap.portal.user_administration/com.sap.portal.user_mapping/com.sap.portal.userMappingAdmin/com.sap.portal.userMappingAdmin
    Component class : com.sapportals.portal.prt.component.usermanagement.UserMappingAdminComponent
    User : Administrator
         at com.sapportals.portal.prt.core.PortalRequestManager.handlePortalComponentException(PortalRequestManager.java:969)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:343)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
         at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable$1$DoDispatchRequest.run(AsyncIncludeRunnable.java:376)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable.run(AsyncIncludeRunnable.java:389)
         at com.sapportals.portal.prt.core.async.ThreadContextRunnable.run(ThreadContextRunnable.java:164)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:729)
         at java.lang.Thread.run(Thread.java:534)
    Caused by: com.sapportals.portal.prt.component.PortalComponentException: PortalComponentException
         at com.sapportals.portal.prt.component.usermanagement.UserMappingAdminComponent.doHandleHTMLBEvent(UserMappingAdminComponent.java:408)
         at com.sapportals.portal.prt.component.usermanagement.UserMappingAdminComponent.doContent(UserMappingAdminComponent.java:137)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
         ... 7 more
    Caused by: com.sap.security.api.umap.UserMappingNotAvailableException: User Mapping not fully available.
         at com.sap.security.core.umap.imp.UserMappingDataImp.storeLogonData(UserMappingDataImp.java:545)
         at com.sapportals.portal.prt.component.usermanagement.UserMappingDataModel.saveLogonData(UserMappingDataModel.java:508)
         at com.sapportals.portal.prt.component.usermanagement.UserMappingAdminDataModel.saveLogonData(UserMappingAdminDataModel.java:179)
         at com.sapportals.portal.prt.component.usermanagement.UserMappingComponent.doHandleHTMLBEventSave(UserMappingComponent.java:157)
         at com.sapportals.portal.prt.component.usermanagement.UserMappingAdminComponent.doHandleHTMLBEvent(UserMappingAdminComponent.java:231)
         ... 11 more
    I have redeployed com.sap.security.usermapping.par.sda but nothing happens.
    Someone knows how to solve this problem?
    Thanks

    Hello Pablo,
    Do you know where I can download the "SAP JAVA Cryptographic Toolkit"?
    I've tried to download it from service.sap.com/download under-> "Download  SAP Cryptographic Software"  but it seems that it's not in there.
    Thanks in advanced,
    Kobi.

  • Are there any APIs to access user personalization data from java

    Hi gurus,
    We want to access personalization data for a user from java using API. This includes user mapping also.
    If you are aware of any api please let me know.
    Thanks in advance.
    Regards,
      Pratik Thakkar

    Hi Pratik,
    You can also retrieve a system object and get the user mapping for the system:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
    env.put(Context.SECURITY_PRINCIPAL, request.getUser());
    env.put(Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_SEMANTICS);
    iCtx = new InitialContext(env);
    ISystem pcdSys =(ISystem)iCtx.lookup(sysId);
    ISystemUserMappingData um = pcdSys.getUserMappingData(request.getUser());
    From this object you can get the user, password and other properties.
    As for personalized values of iView attributes, you can an environmental value before create the initial context to indicate to return personalized value, as follows:
    env.put(IPcdContext.PCD_PERSONALIZATION_PRINCIPAL, request.getUser());
    Hope this helps.
    Daniel

  • EP7 "Personalize - User Mapping" iView not working

    We are in the process of migrating to EP7 and have hit a snag with the Personalize - User Mapping" iview (com.sap.portal.persoUserMapping) short dumping with the following when called:
    Exception ID:04:37_19/04/07_0203_91834451
    [EXCEPTION]
    com.sapportals.portal.prt.component.PortalComponentException: Error in service call of Portal Component
    Component : pcd:portal_content/com.shell.siti.gph.shell_content/cust_content/com.shell.shellpeople/100_admin/300_user_admin/100_roles/com.shell.shellpeople.admin.roles.portal_personalization/com.sap.portal.persoUserMapping/com.sap.portal.persoUserMapping
    Component class : com.sapportals.portal.prt.component.usermanagement.UserMappingComponent
    User : Steve.Caffrey
         at com.sapportals.portal.prt.core.PortalRequestManager.handlePortalComponentException(PortalRequestManager.java:969)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:343)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
         at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable$1$DoDispatchRequest.run(AsyncIncludeRunnable.java:375)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable.run(AsyncIncludeRunnable.java:388)
         at com.sapportals.portal.prt.core.async.ThreadContextRunnable.run(ThreadContextRunnable.java:164)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:729)
         at java.lang.Thread.run(Thread.java:534)
    Caused by: java.lang.NullPointerException
         at java.util.Hashtable.put(Hashtable.java:393)
         at java.util.Properties.setProperty(Properties.java:102)
         at com.sapportals.portal.prt.component.usermanagement.MappingFieldParser.addElementToCreds(MappingFieldParser.java:177)
         at com.sapportals.portal.prt.component.usermanagement.MappingFieldParser.parseFieldItem(MappingFieldParser.java:155)
         at com.sapportals.portal.prt.component.usermanagement.MappingFieldParser.parse(MappingFieldParser.java:62)
         at com.sapportals.portal.prt.component.usermanagement.UserMappingDataModel.interpreteUserMappingFields(UserMappingDataModel.java:950)
         at com.sapportals.portal.prt.component.usermanagement.UserMappingDataModel.getCredentials(UserMappingDataModel.java:643)
         at com.sapportals.portal.prt.component.usermanagement.UserMappingDataModel.getCredentials(UserMappingDataModel.java:241)
         at com.sapportals.portal.prt.component.usermanagement.UserMappingView.addLogonScreenFields(UserMappingView.java:238)
         at com.sapportals.portal.prt.component.usermanagement.UserMappingView.createUserMappingGrid(UserMappingView.java:498)
         at com.sapportals.portal.prt.component.usermanagement.UserMappingView.doContent(UserMappingView.java:71)
         at com.sapportals.portal.prt.component.usermanagement.UserMappingComponent.doContent(UserMappingComponent.java:99)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
         ... 7 more
    Has anyone else had problems with this in EP7.  It worked perfectly well in EP6 but I am aware there have been some user management API changes for EP7 and wonder if they may be the cause?
    Any help or advice you can offer will be gratefully received and of course rewarded with points.
    Thanks,
    Steve.

    Hi Sunil,
    Thanks for the reply.
    Unfortunately the Direct Editing tab is not available in EP7 (probably because it was so buggy in the first place).
    Also, looking at our EP6 setup where the iView works just fine this parameter is set as:
    ume.usermapping.unsecure=FALSE
    Any other ideas?
    Regards,
    Steve.

  • Exception in User Mapping (Remote iViews) in Federated Portal Network (FPN)

    Hi all,
    I am trying to implement Federated Portal Network. Content Usage mode as 'Remote Delta link' but getting runtime exception at Consumer Portal side while navigating through following path:
    Ideally it should display login page asking for user credentials to connect to remote producer portal
    Path at Consumer Portal side: Personalize -> User Mapping (Remote iViews) -> select remote producer portal alias from Remote Content Provider dropdown
    Consumer portal : EP1 SPS 12
    Producer portal: EP4 SPS 11
    Exception as below:
    The initial exception that caused the request to fail, was:
      com.sapportals.portal.pcd.gl.PermissionControlException: Access denied (Object(s): portal_content/every_user/general/eu_role/com.sap.portal.portal_personalization/com.sap.portal.umeEnduserRemoteUserMappingWD/com.sap.portal.umeEnduserRemoteUserMappingWD)
    at com.sapportals.portal.pcd.gl.PcdFilterContext.filterLookup(PcdFilterContext.java:422)
        at com.sapportals.portal.pcd.gl.PcdProxyContext.basicContextLookup(PcdProxyContext.java:1248)
        at com.sapportals.portal.pcd.gl.PcdProxyContext.basicContextLookup(PcdProxyContext.java:1254)
        at com.sapportals.portal.pcd.gl.PcdProxyContext.basicContextLookup(PcdProxyContext.java:1254)
        at com.sapportals.portal.pcd.gl.PcdProxyContext.basicContextLookup(PcdProxyContext.java:1254)
    Request you to kindly share your inputs.
    Thanks and Regards

    Hi all,
    I am trying to implement Federated Portal Network. Content Usage mode as 'Remote Delta link' but getting runtime exception at Consumer Portal side while navigating through following path:
    Ideally it should display login page asking for user credentials to connect to remote producer portal
    Path at Consumer Portal side: Personalize -> User Mapping (Remote iViews) -> select remote producer portal alias from Remote Content Provider dropdown
    Consumer portal : EP1 SPS 12
    Producer portal: EP4 SPS 11
    Exception as below:
    The initial exception that caused the request to fail, was:
      com.sapportals.portal.pcd.gl.PermissionControlException: Access denied (Object(s): portal_content/every_user/general/eu_role/com.sap.portal.portal_personalization/com.sap.portal.umeEnduserRemoteUserMappingWD/com.sap.portal.umeEnduserRemoteUserMappingWD)
    at com.sapportals.portal.pcd.gl.PcdFilterContext.filterLookup(PcdFilterContext.java:422)
        at com.sapportals.portal.pcd.gl.PcdProxyContext.basicContextLookup(PcdProxyContext.java:1248)
        at com.sapportals.portal.pcd.gl.PcdProxyContext.basicContextLookup(PcdProxyContext.java:1254)
        at com.sapportals.portal.pcd.gl.PcdProxyContext.basicContextLookup(PcdProxyContext.java:1254)
        at com.sapportals.portal.pcd.gl.PcdProxyContext.basicContextLookup(PcdProxyContext.java:1254)
    Request you to kindly share your inputs.
    Thanks and Regards

  • KM - Java iView - User Authentication

    Hello all,
    I'm writing a simple KM iView in Java for EP6.0.
    I want to experiment with resources; accessing, creating etc.
    I use the following code to create my IUser and access the resource context
    IUser user = userFactory.getUser(request.getUser().getUniqueName());
    IResourceContext resourceContext = new ResourceContext(user);
    If I access the resource "/", everything is fine, it gets found and I can display it's children, one of them being "/documents". When I try to access this resource I cannot because "User is not authenticated". I cannot access any other collections for the same reason. I can access a file I've created underneath "/documents", my iView displays that the file was 'found' but I cannot work with the file (e.g. display its content type) because "User is not authenticated".
    So how does a user become authenticated? Is this a user mapping issue, something that can be resolved by the portals user administrator, something I can do in Java, or something completely different?
    As always, any help is greatly appreciated.
    Thanks for your time,
    Patrick.

    Hey Armin,
    Thanks for that, it worked a treat.
    I had taken example code from the PDK where creating the IUser was written as
    IUser user = .....
    I guess they thought that it was so simple they didn't need to write it. I knew that I could access the portal user from the request and then I looked at the API there to see if any methods returned an IUser, that's why I was using getUniqueName(). It seemed to make sense.
    One question though, I see that the method for creating the user that you gave me has been deprecated. Has the new method been released or is it on its way, do you know?
    Thanks again for the solution. I awarded you the points.
    Patrick.

  • Question about Logon ticket with user mapping at BI-JAVA environment

    We're implementing BI 7.0 including BI Java and SAP EP for end user
    access.
    I have two question about SSO method when we're using BI Java.
    I know we can simply configure SSO logon ticket with BI-Java(EP
    included) and BI-ABAP through BI template installer and we already
    succeeded in that case.
    But the problem is we want to change it to user mapping SSO method for
    some our internal reason.
    After we configure user mapping SSO, we've got SSO failed error when we
    call BI-Java stuff like BEx Web Application iView.
    After many testing implemented, we found SSO Logon ticket with user
    mapping (using SAP reference system). It seems working now.
    But our question is "Is it no problem when we use SSO logon ticket with
    user mapping?" Is there any restriction or issue?
    One more question is we can ONLY use user base mapping when reference
    system used. How can we assign BI-ABAP users to EP Group?

    Using an SAP Reference system is allright. But if the reason u r going for this is because of different usernames in EP and BI, why dont you go for user mapping.
    Anyways, on restriction of reference syetms is that you can have ONLY ONE reference system defined in portal. In you case you can only have the BI system defined.
    Hope this helps!!

  • Java API for adding new User in OID

    I am search documentation for sample code to add a new User to the OID via Java API, I could not find any. Is it not possible to do so? if it is, can someone point me to the right location.
    Thanks

       * This method adds employee details into directory
       * @param emp Employee details to be added
       * @param password Password for the employee
       * @exception GroceryAppException if  directory operation fails
      public void addEmployee(Employee emp, String password)
        throws GroceryAppException {
        Map attrs = new HashMap();
        List  objclass = new ArrayList();
        // Object classes that the employee must use
        objclass.add("top");
        objclass.add("inetOrgPerson");
        objclass.add("orcluserv2");
        // create other attributes and their values
        // Add all attributes that you need to set
        attrs.put("uid",emp.getEmpId());
        attrs.put("cn",emp.getFirstName());
        attrs.put("sn",emp.getLastName());
        attrs.put("postaladdress",emp.getAddress());
        attrs.put("mail",emp.getEmail());
        try {
          // create the Directory Entry with the specified attributes
          dirManager.addDirectoryEntry("cn="+emp.getFirstName()+"cn=Users,dc=oracle,dc=com"
                                             , objclass, attrs);
        } catch (NamingException namingEx) { // for Directory errors
          throw new GroceryAppException("Error while adding employee entry to directory :" +
                                      namingEx.getMessage());
      }And the Directory Manager
       * Creates an entry in Directory with the specified attributes and objectclass,
       * with the specified Distingushed Name.
       * @param dn Distinguished name of the entry to be created
       * @param objCls Object classes that the entry must use
       * @param map Attribute,value mappings of the entry
       * @exception NamingException if adding entry fails
       public void addDirectoryEntry(String dn, List objCls, Map map)
         throws NamingException {
          // Create attribute list, ignore case of attribute names
          Attributes attrs = new BasicAttributes(true);
          if( !objCls.isEmpty()) {
            Attribute objclass = new BasicAttribute("objectclass");
            // Iterate thriough the collection and add the object classes to the attribute
            Iterator objclsIter = objCls.iterator();
            while(objclsIter.hasNext()) {
              // Add the object classes
              objclass.add(objclsIter.next());
            // Add the object class attribute to list
            attrs.put(objclass);
          // Iterate through other attributes and add to attributes list
          Iterator attrsIter = map.entrySet().iterator();
          while( attrsIter.hasNext() ) {
            Map.Entry attr = (Map.Entry)attrsIter.next();
            attrs.put(new BasicAttribute((String)attr.getKey(),attr.getValue()));
          // add the directory entry to the directory with the attributes
          dirctx.createSubcontext(dn, attrs);
       }

Maybe you are looking for