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 SCServiceProfileViewBean method handleTblSubConfigButtonDeleteRequest.
/**
* Deletes sub configuration.
*
* @param event Request Invocation Event.
* @throws ModelControlException if table model cannot be restored.
*/
public void handleTblSubConfigButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
CCActionTable tbl = (CCActionTable) getChild(AMPropertySheetModel.TBL_SUB_CONFIG);
tbl.restoreStateData();
CCActionTableModel tblModel = (CCActionTableModel) tbl.getModel();
Integer[] selected = tblModel.getSelectedRows();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
List list = (List) szCache.getSerializedObj();
Set names = new HashSet(selected.length * 2);
for (int i = 0; i < selected.length; i++) {
SMSubConfig sc = (SMSubConfig) list.get(selected[i].intValue());
names.add(sc.getName());
}
try {
SubSchemaModel model = (SubSchemaModel) getModel();
model.deleteSubConfigurations(names);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "subconfig.message.deleted");
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "subconfig.message.deleted.pural");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
submitCycle = false;
forwardTo();
}
use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class SCServiceProfileViewBean method createChild.
protected View createChild(String name) {
if (!populatedSubConfigTable && name.equals(AMPropertySheetModel.TBL_SUB_CONFIG)) {
populatedSubConfigTable = true;
SubSchemaModel model = (SubSchemaModel) getModel();
if (model.hasGlobalSubSchema()) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
populateTableModel(szCache.<List<SMSubConfig>>getSerializedObj());
}
}
return super.createChild(name);
}
Aggregations