use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class ServerSiteViewBean method populateServerTableModel.
private void populateServerTableModel(Map serverToSite) {
tblServerModel.clearAll();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
SerializedField szCacheServer = (SerializedField) getChild(SZ_CACHE_SERVER);
ServerSiteModel model = (ServerSiteModel) getModel();
tblServerModel.setMaxRows(model.getPageSize());
int counter = 0;
HashMap cacheServer = new HashMap();
ArrayList cache = new ArrayList();
if ((serverToSite != null) && !serverToSite.isEmpty()) {
for (Iterator iter = serverToSite.keySet().iterator(); iter.hasNext(); counter++) {
if (counter > 0) {
tblServerModel.appendRow();
}
String name = (String) iter.next();
String siteName = (String) serverToSite.get(name);
tblServerModel.setValue(TBL_DATA_SERVER_ACTION_HREF, name);
tblServerModel.setValue(TBL_DATA_SERVER_NAME, name);
tblServerModel.setValue(TBL_DATA_SITE, siteName);
tblServerModel.setSelectionVisible(counter, true);
cacheServer.put(name, siteName);
cache.add(name);
}
szCache.setValue(cache);
szCacheServer.setValue(cacheServer);
} else {
szCache.setValue(null);
}
}
use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class FSAuthDomainsEditViewBean method handleButton1Request.
/**
* Handles create authentication domains view bean.
*
* @param event Request invocation event
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
FSAuthDomainsModel model = (FSAuthDomainsModel) getModel();
String name = (String) getDisplayFieldValue(model.TF_NAME);
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
try {
String realm = model.getRealm(name);
Map values = ps.getAttributeValues(model.getDataMap(), false, model);
model.setAttributeValues(realm, name, values);
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
FederationViewBean vb = (FederationViewBean) getViewBean(FederationViewBean.class);
CCAddRemove addRemoveList = (CCAddRemove) getChild(ADD_REMOVE_PROVIDERS);
addRemoveList.restoreStateData();
CCAddRemoveModel addRemoveModel = (CCAddRemoveModel) addRemoveList.getModel();
List list = new ArrayList(getSelectedValues(addRemoveModel));
model.addProviders(realm, name, list);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "authentication.domain.updated");
forwardTo();
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
forwardTo();
}
}
use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class RMRealmViewBean method handleTblButtonDeleteRequest.
/**
* Deletes realms.
*
* @param event Request Invocation Event.
* @throws ModelControlException if table model cannot be restored.
*/
public void handleTblButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(TBL_SEARCH);
table.restoreStateData();
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
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++) {
String name = (String) list.get(selected[i].intValue());
/*
* make sure the realm name starts with / to give it a
* fully qualified look. This value will be set in the log file
*/
if (!name.startsWith("/")) {
name = "/" + name;
}
names.add(name);
}
try {
RMRealmModel model = (RMRealmModel) getModel();
model.deleteSubRealms(curRealm, names);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "realm.message.deleted");
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "realm.message.deleted.pural");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class RMRealmViewBean method populateTableModel.
private void populateTableModel(Collection realmNames) {
tblModel.clearAll();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
RMRealmModel model = (RMRealmModel) getModel();
tblModel.setMaxRows(model.getPageSize());
if ((realmNames != null) && !realmNames.isEmpty()) {
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
List cache = new ArrayList(realmNames.size());
boolean firstEntry = true;
String startDN = model.getStartDN();
int counter = 0;
for (Iterator iter = realmNames.iterator(); iter.hasNext(); counter++) {
if (firstEntry) {
firstEntry = false;
} else {
tblModel.appendRow();
}
String name = (String) iter.next();
String fqName = null;
String displayName = null;
if (name.equals(startDN)) {
tblModel.setSelectionVisible(counter, false);
fqName = name;
displayName = AMFormatUtils.DNToName(model, model.getStartDSDN());
} else {
int idx = name.lastIndexOf('/');
displayName = (idx == -1) ? name : name.substring(idx + 1);
tblModel.setSelectionVisible(counter, true);
fqName = name;
}
/*
* Set name column info. Need to unescape the value as it
* may contain a '/' character.
*/
tblModel.setValue(TBL_DATA_ACTION_HREF, stringToHex(fqName));
tblModel.setValue(TBL_DATA_NAME, SMSSchema.unescapeName(displayName));
// set location column info
tblModel.setValue(TBL_DATA_PATH, getPath(name));
cache.add(name);
}
szCache.setValue((ArrayList) cache);
} else {
szCache.setValue(null);
}
}
use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class STSHomeViewBean method populateSoapSTSTableModel.
private void populateSoapSTSTableModel(Set<String> publishedInstances) {
tblModelSoapSTSInstances.clearAll();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
Map<String, Set<String>> cacheMap = (Map<String, Set<String>>) szCache.getSerializedObj();
if (cacheMap == null) {
cacheMap = new HashMap<>();
}
if ((publishedInstances != null) && !publishedInstances.isEmpty()) {
boolean firstEntry = true;
for (String instanceName : publishedInstances) {
if (firstEntry) {
firstEntry = false;
} else {
tblModelSoapSTSInstances.appendRow();
}
tblModelSoapSTSInstances.setValue(TBL_SOAP_STS_INSTANCES_DATA_NAME, instanceName);
tblModelSoapSTSInstances.setValue(TBL_SOAP_STS_INSTANCES_DATA_ACTION_HREF, instanceName);
}
cacheMap.put(SOAP_STS_PUBLISHED_INSTANCES_CACHE_KEY, publishedInstances);
szCache.setValue(cacheMap);
} else {
szCache.setValue(null);
}
}
Aggregations