use of com.sun.identity.console.federation.model.WSFedPropertiesModel in project OpenAM by OpenRock.
the class WSFedGeneralViewBean method setDisplayName.
private void setDisplayName(String entityName, String realm) {
WSFedPropertiesModel model = (WSFedPropertiesModel) getModel();
Map spmap = new HashMap();
Map idpmap = new HashMap();
try {
// retrieve role of entity
List roleList = getWSFedRoles(entityName, realm);
Iterator rIt = roleList.listIterator();
// to display idp and sp display names in case of a dual entity
if (roleList.size() > 1) {
spmap = model.getServiceProviderAttributes(realm, entityName);
idpmap = model.getIdentityProviderAttributes(realm, entityName);
setDisplayFieldValue(WSFedPropertiesModel.TF_DISPNAME, getDisplayName(spmap));
setDisplayFieldValue(WSFedPropertiesModel.TFIDPDISP_NAME, getDisplayName(idpmap));
} else {
// to show display name for an entity with single role
while (rIt.hasNext()) {
String role = (String) rIt.next();
if (role.equals(EntityModel.SERVICE_PROVIDER)) {
spmap = model.getServiceProviderAttributes(realm, entityName);
setDisplayFieldValue(WSFedPropertiesModel.TF_DISPNAME, getDisplayName(spmap));
} else if (role.equals(EntityModel.IDENTITY_PROVIDER)) {
idpmap = model.getIdentityProviderAttributes(realm, entityName);
setDisplayFieldValue(WSFedPropertiesModel.TF_DISPNAME, getDisplayName(idpmap));
}
}
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "error in setting Display Name ");
}
}
use of com.sun.identity.console.federation.model.WSFedPropertiesModel in project OpenAM by OpenRock.
the class WSFedIDPViewBean method handleButton1Request.
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
retrieveCommonProperties();
try {
WSFedPropertiesModel model = (WSFedPropertiesModel) getModel();
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
//retrieve all the extended metadata values from the property sheet
Map idpExtValues = ps.getAttributeValues(model.getIDPEXDataMap(), false, model);
// should retain the value of the displayname and cotlist from General page
Set entries = getExtendedValues().entrySet();
Iterator iterator = entries.iterator();
while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry) iterator.next();
if (entry.getKey().equals(WSFedPropertiesModel.TF_DISPNAME)) {
idpExtValues.put((String) entry.getKey(), returnEmptySetIfValueIsNull((Set) entry.getValue()));
} else if (entry.getKey().equals(WSFedPropertiesModel.COT_LIST)) {
idpExtValues.put((String) entry.getKey(), returnEmptySetIfValueIsNull((Set) entry.getValue()));
}
}
//retrieve all the standard metadata values from the property sheet
Map idpStdValues = ps.getAttributeValues(model.getIDPSTDDataMap(), false, model);
//save the standard metadata values for the Idp
model.setIDPSTDAttributeValues(entityName, idpStdValues, realm, idpExtValues, location);
//save the extended metadata values for the Idp
model.setIDPExtAttributeValues(realm, entityName, idpExtValues, location);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "wsfed.idp.property.updated");
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
use of com.sun.identity.console.federation.model.WSFedPropertiesModel in project OpenAM by OpenRock.
the class WSFedIDPViewBean method getStandardValues.
private String getStandardValues() {
String claimName = null;
WSFedPropertiesModel model = (WSFedPropertiesModel) getModel();
try {
FederationElement fedElem = model.getEntityDesc(realm, entityName);
claimName = model.getClaimType(fedElem);
if (claimName.equals(strUPN)) {
claimName = WSFederationConstants.NAMED_CLAIM_DISPLAY_NAMES[WSFederationConstants.NAMED_CLAIM_UPN];
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
return claimName;
}
use of com.sun.identity.console.federation.model.WSFedPropertiesModel in project OpenAM by OpenRock.
the class WSFedIDPViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
WSFedPropertiesModel model = (WSFedPropertiesModel) getModel();
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
//sets the extended meta data values for the Idp
ps.setAttributeValues(getExtendedValues(), model);
//sets the claimtype display name
setDisplayFieldValue(WSFedPropertiesModel.TFCLAIM_TYPES, getStandardValues());
}
use of com.sun.identity.console.federation.model.WSFedPropertiesModel in project OpenAM by OpenRock.
the class WSFedIDPViewBean method getExtendedValues.
private Map getExtendedValues() {
Map map = new HashMap();
Map tmpMap = new HashMap();
WSFedPropertiesModel model = (WSFedPropertiesModel) getModel();
try {
//gets extended metadata values
map = model.getIdentityProviderAttributes(realm, entityName);
Set entries = map.entrySet();
Iterator iterator = entries.iterator();
//the list of values is converted to a set
while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry) iterator.next();
tmpMap.put((String) entry.getKey(), returnEmptySetIfValueIsNull(convertListToSet((List) entry.getValue())));
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
return tmpMap;
}
Aggregations