use of com.sun.web.ui.view.html.CCButton in project OpenAM by OpenRock.
the class AgentsViewBean method beginDisplay.
/**
* Sets the agent title and populates the agent and agent group
* action table.
*
* @param event Display Event.
* @throws ModelControlException if cannot access to framework model.
*/
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event, false);
resetButtonState(TBL_BUTTON_DELETE);
AgentsModel model = (AgentsModel) getModel();
String agentType = getDisplayIDType();
Object[] param = { agentType };
ptModel.setPageTitleText(model.getLocalizedString("agenttype." + agentType));
ptModel.setPageTitleHelpMessage(model.getLocalizedString("agenttype." + agentType + ".help"));
tblModel.setTitle(MessageFormat.format(model.getLocalizedString("table.agents.title.name"), param));
tblModel.setTitleLabel(MessageFormat.format(model.getLocalizedString("table.agents.summary"), param));
tblModel.setSummary(MessageFormat.format(model.getLocalizedString("table.agents.summary"), param));
tblGroupModel.setTitle(MessageFormat.format(model.getLocalizedString("table.agent.groups.title.name"), param));
tblGroupModel.setTitleLabel(MessageFormat.format(model.getLocalizedString("table.agent.groups.summary"), param));
tblGroupModel.setSummary(MessageFormat.format(model.getLocalizedString("table.agent.groups.summary"), param));
getAgentNames();
CCButton b = (CCButton) getChild(TBL_BUTTON_DELETE);
b.setDisabled(true);
b = (CCButton) getChild(TBL_BUTTON_DELETE_GROUP);
b.setDisabled(true);
}
use of com.sun.web.ui.view.html.CCButton in project OpenAM by OpenRock.
the class PolicyNormalViewBeanBase method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
try {
populateAttributes();
} catch (AMConsoleException e) {
//NO-OP
/* attribute values will not be populated if cached policy
* cannot be located.
*/
}
CCButton btn = (CCButton) getChild("tblSubjectsButtonDelete");
btn.setDisabled(true);
btn = (CCButton) getChild("tblResponseProvidersButtonDelete");
btn.setDisabled(true);
btn = (CCButton) getChild("tblConditionsButtonDelete");
btn.setDisabled(true);
PolicyModel model = (PolicyModel) getModel();
String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
QueryResults subjectsQuery = model.getActiveSubjectTypes(realm);
Map subjects = (Map) subjectsQuery.getResults();
if ((subjects == null) || subjects.isEmpty()) {
((CCButton) getChild("tblSubjectsButtonAdd")).setDisabled(true);
setDisplayFieldValue("tblSubjectsNote", model.getLocalizedString("policy.no.subject.types"));
} else {
setDisplayFieldValue("tblSubjectsNote", "");
}
Map conditions = model.getActiveConditionTypes(realm);
if ((conditions == null) || conditions.isEmpty()) {
((CCButton) getChild("tblConditionsButtonAdd")).setDisabled(true);
setDisplayFieldValue("tblConditionsNote", model.getLocalizedString("policy.no.condition.types"));
} else {
setDisplayFieldValue("tblConditionsNote", "");
}
Map responseProviders = model.getActiveResponseProviderTypes(realm);
if ((responseProviders == null) || responseProviders.isEmpty()) {
((CCButton) getChild("tblResponseProvidersButtonAdd")).setDisabled(true);
setDisplayFieldValue("tblResponseProvidersNote", model.getLocalizedString("policy.no.response.providers.types"));
} else {
setDisplayFieldValue("tblResponseProvidersNote", "");
}
}
use of com.sun.web.ui.view.html.CCButton in project OpenAM by OpenRock.
the class PolicyOpViewBeanBase method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
try {
populateRulesTable();
CachedPolicy cachedPolicy = getCachedPolicy();
Policy policy = cachedPolicy.getPolicy();
String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
PolicyModel model = (PolicyModel) getModel();
CCButton btn = (CCButton) getChild("tblRulesButtonAdd");
if (!model.canCreateRule(policy, realmName)) {
btn.setDisabled(true);
}
btn = (CCButton) getChild("tblRulesButtonDelete");
btn.setDisabled(true);
Map serviceTypes = model.getServiceTypeNames();
if ((serviceTypes == null) || serviceTypes.isEmpty()) {
((CCButton) getChild("tblRulesButtonDelete")).setDisabled(true);
setDisplayFieldValue("tblRulesNote", model.getLocalizedString("policy.no.service.types"));
} else {
setDisplayFieldValue("tblRulesNote", "");
}
if (!isInlineAlertMessageSet() && cachedPolicy.isPolicyModified() && isProfilePage()) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "policy.unsaved.message");
}
} catch (AMConsoleException e) {
CCButton btn = (CCButton) getChild("tblRulesButtonAdd");
btn.setDisabled(true);
btn = (CCButton) getChild("tblRulesButtonDelete");
btn.setDisabled(true);
}
}
use of com.sun.web.ui.view.html.CCButton in project OpenAM by OpenRock.
the class ServicesViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
resetButtonState(TBL_BUTTON_DELETE);
getServiceNames();
setPageTitle(getModel(), "page.title.realms.services");
ServicesModel model = (ServicesModel) getModel();
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
try {
if (model.getAssignableServiceNames(curRealm).isEmpty()) {
CCButton btnAdd = (CCButton) getChild(TBL_BUTTON_ADD);
btnAdd.setDisabled(true);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "services.noservices.for.assignment.message");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
CCButton btnAdd = (CCButton) getChild(TBL_BUTTON_ADD);
btnAdd.setDisabled(true);
}
}
use of com.sun.web.ui.view.html.CCButton in project OpenAM by OpenRock.
the class AuthConfigViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
resetButtonState(REMOVE_ENTRY_BUTTON);
acModel = (AuthConfigurationModel) getModel();
// set the page title to include the auth config name
String title = acModel.getLocalizedString("page.title.auth.config.edit");
String[] param = { getConfigName() };
ptModel.setPageTitleText(MessageFormat.format(title, (Object[]) param));
AuthConfigurationModel model = (AuthConfigurationModel) getModel();
if (model != null) {
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
ps.setAttributeValues(getValues(model), model);
}
if (!tablePopulated) {
populateEntryTable();
}
CCButton btnReorder = (CCButton) getChild(REORDER_ENTRY_BUTTON);
btnReorder.setDisabled(model.getNumberEntries() < 2);
if (getInstanceNames().isEmpty()) {
CCButton btnAdd = (CCButton) getChild(ADD_ENTRY_BUTTON);
btnAdd.setDisabled(true);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "authentication.instance.list.empty");
}
showInvalidSet();
}
Aggregations