Search in sources :

Example 6 with RMRealmModel

use of com.sun.identity.console.realm.model.RMRealmModel in project OpenAM by OpenRock.

the class RealmPropertiesViewBean method createPropertyModel.

private void createPropertyModel(String realmName) {
    RMRealmModel model = (RMRealmModel) getModel();
    try {
        psModel = new AMPropertySheetModel(model.getRealmProfilePropertyXML(realmName, getClass().getName()));
        psModel.clear();
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
Also used : AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) RMRealmModel(com.sun.identity.console.realm.model.RMRealmModel)

Example 7 with RMRealmModel

use of com.sun.identity.console.realm.model.RMRealmModel in project OpenAM by OpenRock.

the class RealmPropertiesViewBean method handleButton1Request.

/**
     * Handles save button request.
     *
     * @param event Request invocation event
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    submitCycle = true;
    RMRealmModel model = (RMRealmModel) getModel();
    String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    AMPropertySheet ps = (AMPropertySheet) getChild(REALM_PROPERTIES);
    try {
        Map orig = model.getAttributeValues(realm);
        Map values = ps.getAttributeValues(orig, true, true, model);
        model.setAttributeValues(realm, values);
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "message.updated");
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map) RMRealmModel(com.sun.identity.console.realm.model.RMRealmModel)

Example 8 with RMRealmModel

use of com.sun.identity.console.realm.model.RMRealmModel in project OpenAM by OpenRock.

the class RealmPropertiesViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    if (!isJatoSessionRequestFromXUI(getRequestContext().getRequest()) && isXuiAdminConsoleEnabled()) {
        String redirectRealm = getRedirectRealm(this);
        redirectToXui(getRequestContext().getRequest(), redirectRealm, MessageFormat.format("realms/{0}/dashboard", Uris.urlEncodePathElement(redirectRealm)));
        return;
    }
    super.beginDisplay(event);
    RMRealmModel model = (RMRealmModel) getModel();
    if (model != null) {
        if (!submitCycle) {
            String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
            AMPropertySheet ps = (AMPropertySheet) getChild(REALM_PROPERTIES);
            psModel.clear();
            try {
                ps.setAttributeValues(model.getAttributeValues(realm), model);
            } catch (AMConsoleException a) {
                setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "no.properties");
            }
        }
        setPageTitle(getModel(), "page.title.realms.properties");
    }
}
Also used : AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) RMRealmModel(com.sun.identity.console.realm.model.RMRealmModel)

Example 9 with RMRealmModel

use of com.sun.identity.console.realm.model.RMRealmModel in project OpenAM by OpenRock.

the class RMRealmViewBean method getRealmNames.

private void getRealmNames() {
    RMRealmModel model = (RMRealmModel) getModel();
    String filter = ((String) getDisplayFieldValue(TF_FILTER));
    if ((filter == null) || (filter.length() == 0)) {
        filter = "*";
        setDisplayFieldValue(TF_FILTER, "*");
    } else {
        filter = filter.trim();
    }
    try {
        String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        populateTableModel(model.getRealmNames(curRealm, filter));
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
Also used : AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) RMRealmModel(com.sun.identity.console.realm.model.RMRealmModel)

Example 10 with RMRealmModel

use of com.sun.identity.console.realm.model.RMRealmModel in project OpenAM by OpenRock.

the class RMRealmAddViewBean method populateRealmParentList.

private void populateRealmParentList() {
    RMRealmModel model = (RMRealmModel) getModel();
    Set realms = new HashSet();
    try {
        realms = model.getRealmNames(model.getStartDN(), "*");
    } catch (AMConsoleException a) {
    // do something here
    }
    Map display = new HashMap(realms.size() * 2);
    for (Iterator i = realms.iterator(); i.hasNext(); ) {
        String tmp = (String) i.next();
        String path = getPath(tmp);
        display.put(tmp, path);
    }
    OptionList optionList = createOptionList(display);
    CCSelectableList parentList = (CCSelectableList) getChild(RMRealmModel.TF_PARENT);
    parentList.setOptions(optionList);
    String value = (String) parentList.getValue();
    if ((value == null) || (value.length() == 0)) {
        Option opt = optionList.get(0);
        parentList.setValue(opt.getValue());
    }
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) HashMap(java.util.HashMap) Iterator(java.util.Iterator) CCSelectableList(com.sun.web.ui.view.html.CCSelectableList) Option(com.iplanet.jato.view.html.Option) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashMap(java.util.HashMap) Map(java.util.Map) RMRealmModel(com.sun.identity.console.realm.model.RMRealmModel) OptionList(com.iplanet.jato.view.html.OptionList) HashSet(java.util.HashSet)

Aggregations

RMRealmModel (com.sun.identity.console.realm.model.RMRealmModel)11 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)9 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)4 Map (java.util.Map)4 HashMap (java.util.HashMap)3 AMPropertySheetModel (com.sun.identity.console.base.model.AMPropertySheetModel)2 SerializedField (com.sun.identity.console.components.view.html.SerializedField)2 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 Iterator (java.util.Iterator)2 List (java.util.List)2 Set (java.util.Set)2 Option (com.iplanet.jato.view.html.Option)1 OptionList (com.iplanet.jato.view.html.OptionList)1 AMViewBeanBase (com.sun.identity.console.base.AMViewBeanBase)1 AMViewConfig (com.sun.identity.console.base.AMViewConfig)1 CCSelectableList (com.sun.web.ui.view.html.CCSelectableList)1 CCActionTable (com.sun.web.ui.view.table.CCActionTable)1