Search in sources :

Example 91 with AMPropertySheet

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

the class PolicyOpViewBeanBase method createChild.

protected View createChild(String name) {
    View view = null;
    if (!bPopulateTables) {
        populateTables();
        bPopulateTables = true;
    }
    if (ptModel.isChildSupported(name)) {
        view = ptModel.createChild(this, name);
    } else if (name.equals(PROPERTY_ATTRIBUTE)) {
        view = new AMPropertySheet(this, propertySheetModel, name);
    } else if (propertySheetModel.isChildSupported(name)) {
        view = propertySheetModel.createChild(this, name, getModel());
    } else {
        view = super.createChild(name);
    }
    return view;
}
Also used : AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) View(com.iplanet.jato.view.View)

Example 92 with AMPropertySheet

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

the class RuleOpViewBeanBase method createChild.

protected View createChild(String name) {
    View view = null;
    if (name.equals(ACTIONS_TILED_VIEW)) {
        view = new ActionTiledView(this, tblActionsModel, name);
    } else if (ptModel.isChildSupported(name)) {
        view = ptModel.createChild(this, name);
    } else if (name.equals(TBL_ACTIONS)) {
        CCActionTable table = new CCActionTable(this, tblActionsModel, name);
        table.setTiledView((ActionTiledView) getChild(ACTIONS_TILED_VIEW));
        view = table;
    } else if (name.equals(PROPERTY_ATTRIBUTE)) {
        view = new AMPropertySheet(this, propertySheetModel, name);
    } else if (propertySheetModel.isChildSupported(name)) {
        view = propertySheetModel.createChild(this, name, getModel());
    } else {
        view = super.createChild(name);
    }
    return view;
}
Also used : AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) CCActionTable(com.sun.web.ui.view.table.CCActionTable) View(com.iplanet.jato.view.View)

Example 93 with AMPropertySheet

use of com.sun.identity.console.base.AMPropertySheet 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 94 with AMPropertySheet

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

the class IDRepoEditViewBean method setDefaultValues.

/**
     * Sets the default values for the attributes of a particular 
     * data store entry. The name of the data store is retrieved from 
     * the page session. The type passed in the request is not used here.
     */
protected void setDefaultValues(String type) {
    String idRepoName = (String) getPageSessionAttribute(IDREPO_NAME);
    if (idRepoName != null) {
        IDRepoModel model = (IDRepoModel) getModel();
        String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        try {
            Map attrValues = model.getAttributeValues(realmName, idRepoName);
            propertySheetModel.clear();
            AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
            ps.setAttributeValues(attrValues, model);
        } catch (AMConsoleException e) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
            forwardTo();
        }
    }
}
Also used : AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) IDRepoModel(com.sun.identity.console.realm.model.IDRepoModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map)

Example 95 with AMPropertySheet

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

the class SCServiceProfileViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    SubSchemaModel model = (SubSchemaModel) getModel();
    if (model.hasGlobalSubSchema()) {
        if (!submitCycle) {
            populateTableModel(model.getSubConfigurations());
        }
        resetButtonState(AMPropertySheetModel.TBL_SUB_CONFIG_BUTTON_DELETE);
        Map createable = model.getCreateableSubSchemaNames();
        if (createable.isEmpty()) {
            resetButtonState(AMPropertySheetModel.TBL_SUB_CONFIG_BUTTON_ADD);
        } else {
            SubConfigModel scModel = getSubConfigModel();
            boolean canCreate = false;
            for (Iterator i = createable.keySet().iterator(); i.hasNext() && !canCreate; ) {
                String name = (String) i.next();
                String plugin = scModel.getSelectableSubConfigNamesPlugin(name);
                if (plugin == null) {
                    canCreate = true;
                } else {
                    Set subconfigNames = scModel.getSelectableConfigNames(name);
                    canCreate = (subconfigNames != null) && !subconfigNames.isEmpty();
                }
            }
            disableButton(AMPropertySheetModel.TBL_SUB_CONFIG_BUTTON_ADD, !canCreate);
        }
    }
    if (serviceName.equals("iPlanetAMAuthHTTPBasicService")) {
        CCRadioButton radio = (CCRadioButton) getChild("iplanet-am-auth-http-basic-module-configured");
        if ((radio.getValue() == null) || (radio.getValue().equals(""))) {
            String defaultModule = new String();
            String realmName = SMSEntry.getRootSuffix();
            if (realmName != null) {
                List moduleList = AMAuthUtils.getModuleInstancesForHttpBasic(realmName);
                if (!moduleList.isEmpty()) {
                    defaultModule = (String) moduleList.get(0);
                    radio.setValue(defaultModule);
                }
            }
        }
    }
    // If this is a dynamic request the UI is set with unsaved attribute values
    AMPropertySheet propertySheet = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
    if (dynamicRequest) {
        propertySheet.setAttributeValues(unsavedAttributeValues, model);
    }
}
Also used : SubSchemaModel(com.sun.identity.console.service.model.SubSchemaModel) CCRadioButton(com.sun.web.ui.view.html.CCRadioButton) HashSet(java.util.HashSet) Set(java.util.Set) SubConfigModel(com.sun.identity.console.service.model.SubConfigModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) List(java.util.List) Map(java.util.Map)

Aggregations

AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)122 Map (java.util.Map)79 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)76 HashMap (java.util.HashMap)37 SAMLv2Model (com.sun.identity.console.federation.model.SAMLv2Model)28 Set (java.util.Set)21 HashSet (java.util.HashSet)15 List (java.util.List)10 View (com.iplanet.jato.view.View)9 IDFFModel (com.sun.identity.console.federation.model.IDFFModel)8 SubConfigModel (com.sun.identity.console.service.model.SubConfigModel)8 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)8 ArrayList (java.util.ArrayList)7 Iterator (java.util.Iterator)7 CCPageTitle (com.sun.web.ui.view.pagetitle.CCPageTitle)6 ModelControlException (com.iplanet.jato.model.ModelControlException)5 WSFedPropertiesModel (com.sun.identity.console.federation.model.WSFedPropertiesModel)5 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)5 AbstractAuditModel (com.sun.identity.console.audit.model.AbstractAuditModel)4 FSAuthDomainsModel (com.sun.identity.console.federation.model.FSAuthDomainsModel)4