use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class UMUserPasswordResetOptionsViewBean method populateTableModel.
private void populateTableModel(List questionAnswers) {
tblModel.clearAll();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
szCache.setValue(questionAnswers);
if ((questionAnswers != null) && !questionAnswers.isEmpty()) {
boolean firstEntry = true;
for (Iterator iter = questionAnswers.iterator(); iter.hasNext(); ) {
if (firstEntry) {
firstEntry = false;
} else {
tblModel.appendRow();
}
UMUserPasswordResetOptionsData data = (UMUserPasswordResetOptionsData) iter.next();
String question = data.getQuestionLocalizedName();
if (data.isPersonalQuestion()) {
tblModel.setValue(TBL_DATA_QUESTION, null);
tblModel.setValue(TBL_DATA_PERSONAL_QUESTION, question);
} else {
tblModel.setValue(TBL_DATA_QUESTION, question);
tblModel.setValue(TBL_DATA_PERSONAL_QUESTION, null);
}
tblModel.setRowSelected(data.isSelected());
tblModel.setValue(TBL_DATA_ANSWER, data.getAnswer());
}
}
}
use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class UMUserPasswordResetOptionsViewBean method beginQuestionsDisplay.
public boolean beginQuestionsDisplay(ChildDisplayEvent event) {
boolean display = false;
UMUserPasswordResetOptionsModel model = (UMUserPasswordResetOptionsModel) getModel();
String userId = (String) getPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID);
if (model.isLoggedInUser(userId)) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
List data = (List) szCache.getSerializedObj();
display = (data != null) && !data.isEmpty();
}
return display;
}
use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class UMUserPasswordResetOptionsViewBean method restoreOptionsData.
private List restoreOptionsData() throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(TBL_SEARCH);
table.restoreStateData();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
List optionData = (List) szCache.getSerializedObj();
int sz = optionData.size();
for (int i = 0; i < sz; i++) {
UMUserPasswordResetOptionsData data = (UMUserPasswordResetOptionsData) optionData.get(i);
tblModel.setRowIndex(i);
data.setSelected(tblModel.isRowSelected());
data.setAnswer((String) tblModel.getValue(TBL_DATA_ANSWER));
if (data.isPersonalQuestion()) {
data.setQuestion((String) tblModel.getValue(TBL_DATA_PERSONAL_QUESTION));
}
}
return optionData;
}
use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class AgentConfigInheritViewBean method populatePropertyNameTableModel.
private void populatePropertyNameTableModel(Collection propertyNames) {
if (!submitCycle && (propertyNames != null)) {
tblPropertyNamesModel.clearAll();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
String universalId = (String) getPageSessionAttribute(AgentProfileViewBean.UNIVERSAL_ID);
String agentType = getAgentType();
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
AgentsModel model = (AgentsModel) getModel();
Set inheritedPropertyNames = model.getInheritedPropertyNames(curRealm, universalId);
Map nameToSchemas = model.getAttributeSchemas(agentType, propertyNames);
removeNonInheritable(nameToSchemas, propertyNames);
try {
ResourceBundle rb = AgentConfiguration.getServiceResourceBundle(model.getUserLocale());
String groupName = model.getAgentGroup(curRealm, universalId);
Map groupValues = model.getGroupAttributeValues(curRealm, groupName);
ArrayList cache = new ArrayList();
int counter = 0;
for (Iterator i = propertyNames.iterator(); i.hasNext(); counter++) {
if (counter > 0) {
tblPropertyNamesModel.appendRow();
}
String name = (String) i.next();
AttributeSchema as = (AttributeSchema) nameToSchemas.get(name);
if (as != null) {
String displayName = rb.getString(as.getI18NKey());
tblPropertyNamesModel.setValue(TBL_DATA_PROPERTY_NAME, displayName);
try {
String help = rb.getString(as.getI18NKey() + ".help");
tblPropertyNamesModel.setValue(TBL_DATA_PROPERTY_HELP, help);
} catch (MissingResourceException e) {
// need to clear the help value
tblPropertyNamesModel.setValue(TBL_DATA_PROPERTY_HELP, "");
}
Object oValue = groupValues.get(name);
String value = "";
if (oValue != null) {
value = oValue.toString();
if (value.length() >= 2) {
value = value.substring(1, value.length() - 1);
}
}
tblPropertyNamesModel.setValue(TBL_DATA_VALUE, value);
tblPropertyNamesModel.setSelectionVisible(counter, true);
tblPropertyNamesModel.setRowSelected(inheritedPropertyNames.contains(name));
cache.add(name);
}
}
szCache.setValue(cache);
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
} catch (SMSException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
} catch (SSOException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
}
use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class EntitiesViewBean method resetView.
public void resetView() {
super.resetView();
tblModelPopulated = false;
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
szCache.setValue(null);
tblModel.clearAll();
setDisplayFieldValue(TF_FILTER, "*");
}
Aggregations