Search in sources :

Example 11 with CCButton

use of com.sun.web.ui.view.html.CCButton in project OpenAM by OpenRock.

the class EntitiesViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event, false);
    resetButtonState(TBL_BUTTON_DELETE);
    EntitiesModel model = (EntitiesModel) getModel();
    CCButton b = (CCButton) getChild(TBL_BUTTON_ADD);
    String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    if (model.repoExists(curRealm)) {
        b.setDisabled(false);
    } else {
        b.setDisabled(true);
    }
    String[] param = { getDisplayIDType() };
    ptModel.setPageTitleText(MessageFormat.format(model.getLocalizedString("page.title.entities"), (Object[]) param));
    tblModel.setTitle(MessageFormat.format(model.getLocalizedString("table.entities.title.name"), (Object[]) param));
    tblModel.setTitleLabel(MessageFormat.format(model.getLocalizedString("table.entities.title.name"), (Object[]) param));
    tblModel.setSummary(MessageFormat.format(model.getLocalizedString("table.entities.summary"), (Object[]) param));
    getEntityNames();
    addEntitiesTab();
    tabModel.setSelectedNode(7);
}
Also used : CCButton(com.sun.web.ui.view.html.CCButton) EntitiesModel(com.sun.identity.console.idm.model.EntitiesModel)

Example 12 with CCButton

use of com.sun.web.ui.view.html.CCButton in project OpenAM by OpenRock.

the class EntitiesViewBean method getEntityNames.

private void getEntityNames() {
    EntitiesModel model = (EntitiesModel) 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);
        IdSearchResults results = model.getEntityNames(curRealm, getDisplayIDType(), filter);
        int errorCode = results.getErrorCode();
        switch(errorCode) {
            case IdSearchResults.SIZE_LIMIT_EXCEEDED:
                setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", "message.sizelimit.exceeded");
                break;
            case IdSearchResults.TIME_LIMIT_EXCEEDED:
                setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", "message.timelimit.exceeded");
                break;
        }
        populateTableModel(results.getSearchResults());
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        // disable the add button if there was an error 
        CCButton b = (CCButton) getChild(TBL_BUTTON_ADD);
        b.setDisabled(true);
    }
}
Also used : IdSearchResults(com.sun.identity.idm.IdSearchResults) CCButton(com.sun.web.ui.view.html.CCButton) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) EntitiesModel(com.sun.identity.console.idm.model.EntitiesModel)

Example 13 with CCButton

use of com.sun.web.ui.view.html.CCButton in project OpenAM by OpenRock.

the class PolicyReferralViewBeanBase method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    try {
        populateAttributes();
        PolicyModel model = (PolicyModel) getModel();
        String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        if (model.getActiveReferralTypes(realmName).isEmpty()) {
            CCButton btn = (CCButton) getChild("tblReferralsButtonAdd");
            btn.setDisabled(true);
        }
        CCButton btn = (CCButton) getChild("tblReferralsButtonDelete");
        btn.setDisabled(true);
    } catch (AMConsoleException e) {
        CCButton btn = (CCButton) getChild("tblReferralsButtonAdd");
        btn.setDisabled(true);
        btn = (CCButton) getChild("tblReferralsButtonDelete");
        btn.setDisabled(true);
    }
}
Also used : CCButton(com.sun.web.ui.view.html.CCButton) PolicyModel(com.sun.identity.console.policy.model.PolicyModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 14 with CCButton

use of com.sun.web.ui.view.html.CCButton in project OpenAM by OpenRock.

the class FSSAMLSetTrustedPartnerTypeViewBean method enableButton.

protected void enableButton() {
    CCButton btnBack = (CCButton) getChild("button1");
    btnBack.setDisabled(false);
}
Also used : CCButton(com.sun.web.ui.view.html.CCButton)

Aggregations

CCButton (com.sun.web.ui.view.html.CCButton)14 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)7 PolicyModel (com.sun.identity.console.policy.model.PolicyModel)3 Map (java.util.Map)3 AgentsModel (com.sun.identity.console.agentconfig.model.AgentsModel)2 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)2 HashMap (java.util.HashMap)2 AuthConfigurationModel (com.sun.identity.console.authentication.model.AuthConfigurationModel)1 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)1 AMViewConfig (com.sun.identity.console.base.AMViewConfig)1 QueryResults (com.sun.identity.console.base.model.QueryResults)1 CachedPolicy (com.sun.identity.console.policy.model.CachedPolicy)1 IDRepoModel (com.sun.identity.console.realm.model.IDRepoModel)1 ServicesModel (com.sun.identity.console.realm.model.ServicesModel)1 IdSearchResults (com.sun.identity.idm.IdSearchResults)1 Policy (com.sun.identity.policy.Policy)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1 TreeSet (java.util.TreeSet)1