Custom Column in Request Track page in OIM using Backing Bean


In this post lets understand how to create custom column in Request track page
End result looks like below:


  1. Create backing bean using ADF Project and deploy to oim server via starter pack( create a jar of your ADF project and copy the jar to starter pack and deploy to server. reference link Deployment of starter pack)
    #{backingBeanScope.RequesterUserNameInRequestTrackPage.requesterUserName}
Backing bean code is as below : the below code returns you the requester user login



/**
* Class   : RequesterUserNameInRequestTrackPage
*  Description: This class loads the requester user loginin Requester track page 
* @author Ravi Kumar
* Created on @date 25th July , 2018
* All rights reserved.
*/

/**
 * Revision History-- Rev.No--- modified by--- Date--- Modified Description --- Comments if any
 * ----------------------------------------------------------------------------------------------
 * 
 * -----------------------------------------------------------------------------------------------
 */

package oracle.ui.custom;

import oracle.iam.request.api.RequestService;
import oracle.iam.request.vo.Request;
import oracle.iam.ui.platform.model.common.OIMClientFactory;
import oracle.iam.ui.platform.utils.FacesUtils;
import idm.common.utils.MyLogger;
import oracle.iam.platform.entitymgr.vo.SearchCriteria;
import oracle.iam.platform.entitymgr.vo.SearchCriteria.Operator;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import oracle.iam.identity.usermgmt.api.UserManager;

public class RequesterUserNameInRequestTrackPage {
    private String requesterUserName;
    Logger logger = new MyLogger("ADF");
    String className = "RequesterUserNameInRequestTrackPage";
    
    public RequesterUserNameInRequestTrackPage() {
        super();
    }
    public void setRequesterUserName(String requesterUserName) {
        this.requesterUserName = requesterUserName;
    }
    public String getRequesterUserName() {
        String methodName = "getRequesterUserName";
        logger.setMethodStartLog(className, methodName);
        requesterUserName = "";
        try {
            Object requestKeyObj = FacesUtils.getValueFromELExpression("#{row.reqID}");
            logger.debug(className, methodName, "requestKeyObj: "+requestKeyObj);
            if(requestKeyObj != null && !requestKeyObj.toString().trim().isEmpty()) {
                String requestKey = requestKeyObj.toString().trim();
                logger.debug(className, methodName, "requestKey: "+requestKey);
                RequestService requestService=OIMClientFactory.getRequestService();
                Request request = requestService.getBasicRequestData(requestKey);
                String requesterUserKey = request.getRequesterKey();
                logger.debug(className, methodName, "requesterUserKey: "+requesterUserKey);
                requesterUserName = this.getUserName(requesterUserKey);
                System.out.println("requestKey: "+requestKey);
                System.out.println("requesterUserKey: "+requesterUserKey);
             }
            else{
                logger.debug(className, methodName, "Invalid Request");
            }
        }
        catch(Exception e){
            e.printStackTrace();
        }
        logger.debug(className, methodName, "requesterUserName: "+requesterUserName);
        logger.setMethodFinishLog(className, methodName);
        return requesterUserName;
    }

    @SuppressWarnings({ "unchecked", "rawtypes" })
    public String getUserName(String userKey) {
          String methodName = "getUserName";
          logger.setMethodStartLog(className, methodName);
          logger.debug(className, methodName, "userKey: "+userKey);
          String userName = null;     
          SearchCriteria sc = new SearchCriteria("usr_key", userKey,Operator.EQUAL);  
          try {
              Set retAttrs = new HashSet();
              retAttrs.add("User Login");
              UserManager usrMgr = OIMClientFactory.getUserManager();
              List<oracle.iam.identity.usermgmt.vo.User> userList;
              userList = usrMgr.search(sc, retAttrs, null);
              for(oracle.iam.identity.usermgmt.vo.User user: userList){
                  userName =  user.getLogin();
                  logger.debug(className, methodName, "userName: "+userName);
              }
            
           } catch (Exception e) {
              e.printStackTrace();
          } 
          logger.debug(className, methodName, "userName: "+userName);
          logger.setMethodFinishLog(className, methodName);
          return userName;
      }
    

}

2. Create sandbox in identity console and add new column

Create new sandbox in identity console activate it and navigate to request track page
Select the table and choose + button 



Select Web Components



Choose table column





Cut and paste the new column into correct place




select new column and click on edit






Label the new column





Add output text field into the column



Choose output text from web components output text








Re arrange the column place in the table

select the table and click on edit













Select Output text value and click on edit and update value EL Expression

#{backingBeanScope.RequesterUserNameInRequestTrackPage.requesterUserName}




Export and publish the sandbox

We are done with the implementation check the new field in Request track page :)


Comments

  1. Thanks for such a nice explanation, Requester Username field will be visible in Request table of oim without using ADF?

    I want to know if we have added any column using UI CUSTOMIZATION LIKE YOU DID, it will reflect column name in request table also?

    ReplyDelete

Post a Comment

Popular posts from this blog

Rules in Sailpoint

Sailpoint Installation Steps (IdentityIQ 7.3 Installation in Windows Machine)

How to create provisioning plan in Sailpoint