use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class DelegationViewBean method populateTableModelEx.
private void populateTableModelEx() {
if (!tblModelPopulated) {
tblModelPopulated = true;
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
List cache = (List) szCache.getSerializedObj();
if ((cache != null) && !cache.isEmpty()) {
populateTableModel(cache);
}
}
}
use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class DelegationViewBean method populateTableModel.
private void populateTableModel(Collection DelegationNames) {
tblModel.clearAll();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
if ((DelegationNames != null) && !DelegationNames.isEmpty()) {
List cache = new ArrayList(DelegationNames.size());
DelegationModel model = (DelegationModel) getModel();
SSOToken ssoToken = model.getUserSSOToken();
boolean firstEntry = true;
for (Iterator iter = DelegationNames.iterator(); iter.hasNext(); ) {
String id = (String) iter.next();
try {
AMIdentity entity = IdUtils.getIdentity(ssoToken, id);
if (firstEntry) {
firstEntry = false;
} else {
tblModel.appendRow();
}
String name = AMFormatUtils.getIdentityDisplayName(model, entity);
tblModel.setValue(TBL_DATA_NAME, name);
tblModel.setValue(TBL_DATA_UNIVERSALNAME, id);
tblModel.setValue(TBL_DATA_ACTION_HREF, stringToHex(id));
cache.add(id);
} catch (IdRepoException e) {
//ignore since ID is not found.
}
}
szCache.setValue((Serializable) cache);
} else {
szCache.setValue(null);
}
}
use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class ServerConfigXMLViewBean method createChild.
protected View createChild(String name) {
View view = null;
if (name.equals(TBL_SERVERS)) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE_SERVER);
populateServerTableModel((List) szCache.getSerializedObj());
view = new CCActionTable(this, tblServerModel, name);
} else if (name.equals(TBL_USERS)) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE_USER);
populateUserTableModel((List) szCache.getSerializedObj());
view = new CCActionTable(this, tblUserModel, name);
} else if (name.equals(PGTITLE_THREE_BTNS)) {
view = new CCPageTitle(this, ptModel, name);
} else if (name.equals(PROPERTY_ATTRIBUTE)) {
view = new AMPropertySheet(this, propertySheetModel, name);
} else if (propertySheetModel.isChildSupported(name)) {
view = propertySheetModel.createChild(this, name, getModel());
} else if (ptModel.isChildSupported(name)) {
view = ptModel.createChild(this, name);
} else if (tblServerModel.isChildSupported(name)) {
view = tblServerModel.createChild(this, name);
} else if (tblUserModel.isChildSupported(name)) {
view = tblUserModel.createChild(this, name);
} else {
view = super.createChild(name);
}
return view;
}
use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class ServerConfigXMLViewBean method populateServerTableModel.
private void populateServerTableModel(List entries) {
tblServerModel.clearAll();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE_SERVER);
int counter = 0;
if ((entries != null) && !entries.isEmpty()) {
for (Iterator i = entries.iterator(); i.hasNext(); counter++) {
if (counter > 0) {
tblServerModel.appendRow();
}
ServerConfigXML.ServerObject entry = (ServerConfigXML.ServerObject) i.next();
tblServerModel.setValue(TBL_SERVERS_NAME_DATA, entry.name);
tblServerModel.setValue(TBL_SERVERS_HOST_DATA, entry.host);
tblServerModel.setValue(TBL_SERVERS_PORT_DATA, entry.port);
tblServerModel.setValue(TBL_SERVERS_TYPE_DATA, entry.type);
tblServerModel.setSelectionVisible(counter, true);
}
}
szCache.setValue(entries);
}
use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.
the class ServerConfigXMLViewBean method populateUserTableModel.
private void populateUserTableModel(List entries) {
if (bAMSDKEnabled) {
tblUserModel.clearAll();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE_USER);
int counter = 0;
if ((entries != null) && !entries.isEmpty()) {
for (Iterator i = entries.iterator(); i.hasNext(); counter++) {
if (counter > 0) {
tblUserModel.appendRow();
}
ServerConfigXML.ServerObject entry = (ServerConfigXML.ServerObject) i.next();
tblUserModel.setValue(TBL_USERS_NAME_DATA, entry.name);
tblUserModel.setValue(TBL_USERS_HOST_DATA, entry.host);
tblUserModel.setValue(TBL_USERS_PORT_DATA, entry.port);
tblUserModel.setValue(TBL_USERS_TYPE_DATA, entry.type);
tblUserModel.setSelectionVisible(counter, true);
}
}
szCache.setValue(entries);
}
}
Aggregations