use of com.sun.identity.console.federation.model.WSFedPropertiesModel in project OpenAM by OpenRock.
the class WSFedSPViewBean 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 spExtValues = ps.getAttributeValues(model.getSPEXDataMap(), 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)) {
spExtValues.put((String) entry.getKey(), returnEmptySetIfValueIsNull((Set) entry.getValue()));
} else if (entry.getKey().equals(WSFedPropertiesModel.COT_LIST)) {
spExtValues.put((String) entry.getKey(), returnEmptySetIfValueIsNull((Set) entry.getValue()));
}
}
//save the extended metadata values for the SP
model.setSPExtAttributeValues(realm, entityName, spExtValues, location);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "wsfed.sp.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 WSFedSPViewBean method getExtendedValues.
private Map getExtendedValues() {
Map map = new HashMap();
Map tmpMap = new HashMap();
WSFedPropertiesModel model = (WSFedPropertiesModel) getModel();
try {
//gets extended metadata values
map = model.getServiceProviderAttributes(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;
}
use of com.sun.identity.console.federation.model.WSFedPropertiesModel in project OpenAM by OpenRock.
the class WSFedSPViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
WSFedPropertiesModel model = (WSFedPropertiesModel) getModel();
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
// set extended meta data values for the SP
ps.setAttributeValues(getExtendedValues(), model);
setDisplayFieldValue(WSFedPropertiesModel.TFUSR_AGENT_NAME, "Key");
setDisplayFieldValue(WSFedPropertiesModel.TFCOKKI_NAME, "Name");
}
use of com.sun.identity.console.federation.model.WSFedPropertiesModel in project OpenAM by OpenRock.
the class WSFedGeneralViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
//setting the Name fields
setDisplayFieldValue(WSFedPropertiesModel.TF_REALM, realm);
setDisplayFieldValue(WSFedPropertiesModel.TF_NAME, entityName);
try {
WSFedPropertiesModel model = (WSFedPropertiesModel) getModel();
FederationElement fedElement = model.getEntityDesc(realm, entityName);
//setting the Token Issuer Name
setDisplayFieldValue(WSFedPropertiesModel.TFTOKENISSUER_NAME, model.getTokenName(fedElement));
//setting the Token Issuer End Point
setDisplayFieldValue(WSFedPropertiesModel.TFTOKENISSUER_ENDPT, model.getTokenEndpoint(fedElement));
//setting the value of displayName
setDisplayName(entityName, realm);
} catch (AMConsoleException e) {
debug.error("WSFedGeneralViewBean.beginDisplay", e);
}
}
use of com.sun.identity.console.federation.model.WSFedPropertiesModel in project OpenAM by OpenRock.
the class WSFedGeneralViewBean method handleButton1Request.
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
// get the entity name, realm, and location.
retrieveCommonProperties();
try {
WSFedPropertiesModel model = (WSFedPropertiesModel) getModel();
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
String role = "dual";
Map attributes = null;
List roleList = getWSFedRoles(entityName, realm);
if (roleList.size() == 1) {
role = (String) roleList.listIterator().next();
attributes = model.getGenAttributes();
} else {
attributes = model.getDualRoleAttributes();
}
Map values = ps.getAttributeValues(attributes, false, model);
model.setGenAttributeValues(realm, entityName, values, role, location);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "wsfed.general.property.updated");
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
Aggregations