OIM ADF UI - Code Snippet to get Selected Application Instances 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> getSelectedAppInstFromCart() throws Exception{
        final String logp = CN + " :: getSelectedAppInstFromCart - ";
        LOGGER.debug(logp + "START");

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

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


            if(ApprovalConstants.APP_INSTANCE_ENTITY.equalsIgnoreCase(entityType)){
                String appInstKey = (String)cartRow.getAttribute(ENTITY_KEY);
                String appInstName = (String)cartRow.getAttribute(ENTITY_NAME);
                appInstDetails.put(appInstKey,appInstName);
            }
        }
       
        LOGGER.debug(logp + "END");
        return appInstDetails;
    }

No comments:

Post a Comment