use of com.sun.web.ui.model.CCAddRemoveModel in project OpenAM by OpenRock.
the class SAMLv2AffiliateViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTIES);
ps.init();
SAMLv2Model model = (SAMLv2Model) getModel();
try {
Map values = getStandardAffiliationValues();
Set allSPEntities = model.getallSPEntities(realm);
Set affiliateMembers = (Set) values.get(model.AFFILIATE_MEMBER);
allSPEntities.removeAll(affiliateMembers);
if (samladdRemoveModel == null) {
samladdRemoveModel = new CCAddRemoveModel();
}
if ((allSPEntities != null) && !allSPEntities.isEmpty()) {
samladdRemoveModel.setAvailableOptionList(createOptionList(allSPEntities));
}
if ((affiliateMembers != null) && !affiliateMembers.isEmpty()) {
samladdRemoveModel.setSelectedOptionList(createOptionList(affiliateMembers));
}
ps.setAttributeValues(values, model);
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
ps.setAttributeValues(getExtendedAffiliationValues(), model);
}
use of com.sun.web.ui.model.CCAddRemoveModel in project OpenAM by OpenRock.
the class SMDiscoveryDescriptionViewBeanBase method getValues.
private SMDescriptionData getValues() throws AMConsoleException {
SMDescriptionData smData = new SMDescriptionData();
smData.descriptionID = (String) getDisplayFieldValue(TF_DESCRIPTION_ID);
if (smData.descriptionID.length() == 0) {
smData.descriptionID = SAMLUtils.generateID();
}
CCAddRemove mechIdChild = (CCAddRemove) getChild(ATTR_NAME_SECURITY_MECH_ID);
mechIdChild.restoreStateData();
CCAddRemoveModel mechIdModel = (CCAddRemoveModel) propertySheetModel.getModel(ATTR_NAME_SECURITY_MECH_ID);
smData.securityMechId = getList(mechIdModel.getSelectedOptionList());
smData.endPointUrl = ((String) propertySheetModel.getValue(ATTR_NAME_SOAP_HTTP_END_POINT)).trim();
smData.soapAction = ((String) propertySheetModel.getValue(ATTR_NAME_SOAP_HTTP_ACTION)).trim();
if (smData.securityMechId.isEmpty()) {
throw new AMConsoleException("discovery.service.description.missing.securityMechId.message");
}
if (smData.endPointUrl.length() == 0) {
throw new AMConsoleException("discovery.service.description.missing.endPointUrl.message");
}
return smData;
}
use of com.sun.web.ui.model.CCAddRemoveModel in project OpenAM by OpenRock.
the class IDFFAffiliateViewBean method populateValue.
private void populateValue(String name) {
IDFFModel model = (IDFFModel) getModelInternal();
try {
Map values = model.getAffiliateProfileAttributeValues(realm, name);
Set availableEntities = model.getAllEntityDescriptorNames(realm);
Set affliliatEntities = model.getAllAffiliateEntityDescriptorNames(realm);
Set affiliateMembers = model.getAllAffiliateMembers(realm, name);
availableEntities.removeAll(affiliateMembers);
availableEntities.removeAll(affliliatEntities);
if (affiliateMembersModel == null) {
affiliateMembersModel = new CCAddRemoveModel();
}
if ((availableEntities != null) && !availableEntities.isEmpty()) {
affiliateMembersModel.setAvailableOptionList(createOptionList(availableEntities));
}
if ((affiliateMembers != null) && !affiliateMembers.isEmpty()) {
affiliateMembersModel.setSelectedOptionList(createOptionList(affiliateMembers));
}
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
ps.setAttributeValues(values, model);
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
use of com.sun.web.ui.model.CCAddRemoveModel in project OpenAM by OpenRock.
the class AMPropertySheetModel method clear.
public void clear() {
super.clear();
for (Iterator iter = children.iterator(); iter.hasNext(); ) {
View view = (View) iter.next();
if (CCAddRemove.class.isInstance(view)) {
CCAddRemoveModel m = (CCAddRemoveModel) getModel(view.getName());
m.clear();
m.setAvailableOptionList(new OptionList());
m.setSelectedOptionList(new OptionList());
} else if (CCEditableList.class.isInstance(view)) {
CCEditableListModel m = (CCEditableListModel) getModel(view.getName());
m.setOptionList(new OptionList());
((CCEditableList) view).resetStateData();
} else if (CCOrderedList.class.isInstance(view)) {
CCOrderedListModel m = (CCOrderedListModel) getModel(view.getName());
m.setSelectedOptionList(new OptionList());
((CCOrderedList) view).resetStateData();
} else if (CCUnOrderedList.class.isInstance(view)) {
CCUnOrderedListModel m = (CCUnOrderedListModel) getModel(view.getName());
m.setOptionList(new OptionList());
((CCUnOrderedList) view).resetStateData();
} else if (CCMapList.class.isInstance(view)) {
CCMapListModel m = (CCMapListModel) getModel(view.getName());
m.setOptionList(new OptionList());
((CCMapList) view).resetStateData();
} else {
if (DisplayFieldImpl.class.isInstance(view)) {
((DisplayFieldImpl) view).setValues(null);
}
}
}
}
use of com.sun.web.ui.model.CCAddRemoveModel in project OpenAM by OpenRock.
the class SubjectOpViewBeanBase method createPropertyModel.
protected void createPropertyModel(String realmName) {
DelegationConfig dConfig = DelegationConfig.getInstance();
canModify = dConfig.hasPermission(realmName, null, AMAdminConstants.PERMISSION_MODIFY, getModel(), getClass().getName());
propertySheetModel = new AMPropertySheetModel(getClass().getClassLoader().getResourceAsStream(getPropertyXMLFileName(!canModify)));
propertySheetModel.clear();
if (canModify) {
addRemoveModel = new CCAddRemoveModel();
addRemoveModel.setShowMoveUpDownButtons("false");
addRemoveModel.clear();
propertySheetModel.setModel(VALUES_MULTIPLE_CHOICE_VALUE, addRemoveModel);
}
}
Aggregations