Thursday, 22 March 2018

OIM ADF UI - Code Snippet to get Selected Roles form Cart.

    public static final String CART_ITMS_ITR = "CartItemsVOIterator";
    public static final String ENTITY_TYPE = "entityType";
    public static final String ENTITY_KEY = "entityKey";
    public static final String ENTITY_NAME = "entityName";


    public HashMap<String,String> getSelectedRolesFromCart() throws Exception{
        final String logp = CN + " :: getSelectedRolesFromCart - ";
        LOGGER.debug(logp + "START");

        List<Row> cartRows = null;
        HashMap<String,String> roleDetails = new HashMap<String,String>();
       
        cartRows = this.getAllRowsOfIterator(CART_ITMS_ITR);

        for (Row cartRow : cartRows) {
            String entityType = (String)cartRow.getAttribute(ENTITY_TYPE);


            if(ApprovalConstants.ROLE_ENTITY.equalsIgnoreCase(entityType)){
                String roleKey = (String)cartRow.getAttribute(ENTITY_KEY);
                String roleName = (String)cartRow.getAttribute(ENTITY_NAME);
                roleDetails.put(roleKey,roleName);
            }
        }
       
        LOGGER.debug(logp + "END");
        return roleDetails;
    }


Happy Learning!!!

No comments:

Post a Comment