Search in sources :

Example 81 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.

the class EntityOpViewBeanBase method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    if (!submitCycle) {
        String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        EntitiesModel model = (EntitiesModel) getModel();
        try {
            String entityType = (String) getPageSessionAttribute(ENTITY_TYPE);
            setDefaultValues(entityType);
        } catch (AMConsoleException e) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        }
    }
}
Also used : AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) EntitiesModel(com.sun.identity.console.idm.model.EntitiesModel)

Example 82 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.

the class EntityOpViewBeanBase method createPropertySheetModel.

protected AMPropertySheetModel createPropertySheetModel(String type) {
    AMPropertySheetModel psModel = null;
    EntitiesModel model = (EntitiesModel) getModel();
    String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    String agentType = (String) getPageSessionAttribute(ENTITY_AGENT_TYPE);
    try {
        psModel = new AMPropertySheetModel(model.getPropertyXMLString(realmName, type, agentType, isCreateViewBean(), getClass().getName()));
    } catch (AMConsoleException e) {
        psModel = handleNoAttributeToDisplay(e);
    }
    return psModel;
}
Also used : AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) EntitiesModel(com.sun.identity.console.idm.model.EntitiesModel)

Example 83 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.

the class EntityMembersFilteredIdentityViewBean method getMemberNames.

private void getMemberNames() {
    EntitiesModel model = (EntitiesModel) getModel();
    try {
        String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        String type = (String) getPageSessionAttribute(PG_SESSION_MEMBER_TYPE);
        String universalId = (String) getPageSessionAttribute(UNIVERSAL_ID);
        Set entities = model.getMembers(curRealm, universalId, type);
        CCSelectableList list = (CCSelectableList) getChild(MEMBERS);
        list.setOptions(getOptionListForEntities(entities));
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
Also used : Set(java.util.Set) CCSelectableList(com.sun.web.ui.view.html.CCSelectableList) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) EntitiesModel(com.sun.identity.console.idm.model.EntitiesModel)

Example 84 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.

the class EntityMembershipViewBean method getMemberships.

private void getMemberships() {
    if (!submitCycle) {
        try {
            String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
            String type = (String) getPageSessionAttribute(PG_SESSION_MEMBER_TYPE);
            String universalId = (String) getPageSessionAttribute(UNIVERSAL_ID);
            if (cacheAssigned != null) {
                assignedMembers = AMAdminUtils.toList(cacheAssigned);
            } else {
                EntitiesModel model = (EntitiesModel) getModel();
                assignedMembers = new ArrayList();
                assignedMembers.addAll(model.getMembership(curRealm, universalId, type));
            }
            if (canModify) {
                CCAddRemoveModel addRemoveModel = (CCAddRemoveModel) propertySheetModel.getModel(ADD_REMOVE_MEMBERS);
                addRemoveModel.clear();
                if (cacheAssigned != null) {
                    addRemoveModel.setSelectedOptionList(cacheAssigned);
                } else {
                    addRemoveModel.setSelectedOptionList(getOptionListForEntities(assignedMembers));
                }
                addRemoveModel.setAvailableOptionList(getAssignableMembership());
            } else {
                propertySheetModel.setValue(ADD_REMOVE_MEMBERS, AMAdminUtils.getString(getEntityDisplayNames(assignedMembers), ",", false));
            }
        } catch (AMConsoleException e) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        }
        if (canModify) {
            CCAddRemove addRemove = (CCAddRemove) getChild(ADD_REMOVE_MEMBERS);
            addRemove.resetStateData();
        }
    }
}
Also used : CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) ArrayList(java.util.ArrayList) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove) EntitiesModel(com.sun.identity.console.idm.model.EntitiesModel)

Example 85 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.

the class EntityResourceOfferingViewBeanBase method handleTblSecurityMechIDButtonAddRequest.

public void handleTblSecurityMechIDButtonAddRequest(RequestInvocationEvent event) throws ModelControlException {
    try {
        SMDiscoEntryData smData = getValues(false);
        setPageSessionAttribute(EntityDiscoveryDescriptionViewBeanBase.PG_SESSION_DISCO_ENTRY_DATA, smData);
        setPageSessionAttribute(EntityDiscoveryDescriptionViewBeanBase.PG_SESSION_RETURN_VIEW_BEAN_CLASSNAME, getClass().getName());
        EntityDiscoveryDescriptionAddViewBean vb = (EntityDiscoveryDescriptionAddViewBean) getViewBean(EntityDiscoveryDescriptionAddViewBean.class);
        passPgSessionMap(vb);
        vb.forwardTo(getRequestContext());
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        forwardTo();
    }
}
Also used : SMDiscoEntryData(com.sun.identity.console.service.model.SMDiscoEntryData) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Aggregations

AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)701 Map (java.util.Map)255 Set (java.util.Set)206 HashMap (java.util.HashMap)193 HashSet (java.util.HashSet)148 SSOException (com.iplanet.sso.SSOException)126 Iterator (java.util.Iterator)122 List (java.util.List)97 SMSException (com.sun.identity.sm.SMSException)83 ArrayList (java.util.ArrayList)78 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)76 IdRepoException (com.sun.identity.idm.IdRepoException)58 SAML2MetaException (com.sun.identity.saml2.meta.SAML2MetaException)47 SAML2MetaManager (com.sun.identity.saml2.meta.SAML2MetaManager)46 AMIdentity (com.sun.identity.idm.AMIdentity)44 SAMLv2Model (com.sun.identity.console.federation.model.SAMLv2Model)41 NameNotFoundException (com.sun.identity.policy.NameNotFoundException)41 CCActionTable (com.sun.web.ui.view.table.CCActionTable)40 TreeSet (java.util.TreeSet)39 CachedPolicy (com.sun.identity.console.policy.model.CachedPolicy)38