Search in sources :

Example 1 with EntitiesModel

use of com.sun.identity.console.idm.model.EntitiesModel in project OpenAM by OpenRock.

the class ServicesEditViewBean method forwardTo.

public void forwardTo(RequestContext reqContext) throws NavigationException {
    String serviceName = (String) getPageSessionAttribute(SERVICE_NAME);
    EntitiesModel model = (EntitiesModel) getModel();
    // Check if the selected service has attributes to display.
    if (model.hasDisplayableAttributes(serviceName)) {
        initialize(serviceName);
        super.forwardTo(reqContext);
    } else {
        ServicesNoAttributeViewBean vb = (ServicesNoAttributeViewBean) getViewBean(ServicesNoAttributeViewBean.class);
        passPgSessionMap(vb);
        vb.forwardTo(reqContext);
    }
}
Also used : EntitiesModel(com.sun.identity.console.idm.model.EntitiesModel)

Example 2 with EntitiesModel

use of com.sun.identity.console.idm.model.EntitiesModel in project OpenAM by OpenRock.

the class ServicesNoAttributeViewBean method getBreadCrumbDisplayName.

protected String getBreadCrumbDisplayName() {
    EntitiesModel model = (EntitiesModel) getModel();
    String lserviceName = model.getLocalizedServiceName((String) getPageSessionAttribute(SERVICE_NAME));
    String[] param = { lserviceName };
    return MessageFormat.format(model.getLocalizedString("breadcrumbs.editentities.editservice"), (Object[]) param);
}
Also used : EntitiesModel(com.sun.identity.console.idm.model.EntitiesModel)

Example 3 with EntitiesModel

use of com.sun.identity.console.idm.model.EntitiesModel in project OpenAM by OpenRock.

the class ServicesSelectViewBean method handleButton2Request.

/**
     * Handles assigned button request.
     *
     * @param event Request invocation event.
     */
public void handleButton2Request(RequestInvocationEvent event) throws ModelControlException {
    submitCycle = true;
    String serviceName = (String) getDisplayFieldValue(ATTR_SERVICE_LIST);
    String universalId = (String) getPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID);
    EntitiesModel model = (EntitiesModel) getModel();
    if (model.hasUserAttributeSchema(serviceName)) {
        unlockPageTrailForSwapping();
        fowardToAddServiceViewBean(model, universalId, serviceName);
    } else {
        try {
            model.assignService(universalId, serviceName, Collections.EMPTY_MAP);
            forwardToEntityServiceViewBean();
        } catch (AMConsoleException e) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
            forwardTo();
        }
    }
}
Also used : AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) EntitiesModel(com.sun.identity.console.idm.model.EntitiesModel)

Example 4 with EntitiesModel

use of com.sun.identity.console.idm.model.EntitiesModel in project OpenAM by OpenRock.

the class ServicesAddViewBean method handleButton2Request.

/**
     * Handles add service request.
     *
     * @param event Request invocation event.
     */
public void handleButton2Request(RequestInvocationEvent event) throws ModelControlException {
    submitCycle = true;
    EntitiesModel model = (EntitiesModel) getModel();
    try {
        Map values = getValues();
        String universalId = (String) getPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID);
        String serviceName = (String) getPageSessionAttribute(SERVICE_NAME);
        model.assignService(universalId, serviceName, values);
        forwardToServicesViewBean();
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        forwardTo();
    }
}
Also used : AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map) EntitiesModel(com.sun.identity.console.idm.model.EntitiesModel)

Example 5 with EntitiesModel

use of com.sun.identity.console.idm.model.EntitiesModel in project OpenAM by OpenRock.

the class ServicesEditViewBean method handleButton1Request.

/**
     * Handles add service request.
     *
     * @param event Request invocation event.
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    submitCycle = true;
    EntitiesModel model = (EntitiesModel) getModel();
    try {
        Map values = getValues();
        String universalId = (String) getPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID);
        String serviceName = (String) getPageSessionAttribute(SERVICE_NAME);
        model.setServiceAttributeValues(universalId, serviceName, values);
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "message.updated");
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map) EntitiesModel(com.sun.identity.console.idm.model.EntitiesModel)

Aggregations

EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)55 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)23 Map (java.util.Map)15 Set (java.util.Set)13 HashSet (java.util.HashSet)10 Iterator (java.util.Iterator)10 List (java.util.List)9 OptionList (com.iplanet.jato.view.html.OptionList)7 AMIdentity (com.sun.identity.idm.AMIdentity)7 IdRepoException (com.sun.identity.idm.IdRepoException)7 ArrayList (java.util.ArrayList)7 HashMap (java.util.HashMap)7 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)5 SerializedField (com.sun.identity.console.components.view.html.SerializedField)5 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)4 CCAddRemove (com.sun.web.ui.view.addremove.CCAddRemove)4 AMViewConfig (com.sun.identity.console.base.AMViewConfig)3 IdSearchResults (com.sun.identity.idm.IdSearchResults)3 IdType (com.sun.identity.idm.IdType)3 AMPropertySheetModel (com.sun.identity.console.base.model.AMPropertySheetModel)2