use of com.sun.identity.console.service.model.DiscoveryDataCache in project OpenAM by OpenRock.
the class EntityResourceOfferingViewBean method populateTableModel.
private void populateTableModel(SMDiscoveryServiceData data) {
tblModel.clearAll();
if (data != null) {
int counter = 0;
EntityResourceOfferingModel model = (EntityResourceOfferingModel) getModel();
for (Iterator i = data.getResourceData().iterator(); i.hasNext(); counter++) {
if (counter > 0) {
tblModel.appendRow();
}
SMDiscoEntryData entry = (SMDiscoEntryData) i.next();
tblModel.setValue(TBL_DATA_SERVICE_TYPE, entry.serviceType);
tblModel.setValue(TBL_DATA_ABSTRACT, entry.abstractValue);
tblModel.setValue(TBL_DATA_ACTION_HREF, Integer.toString(counter));
}
DiscoveryDataCache cache = DiscoveryDataCache.getInstance();
String id = cache.cacheData(model.getUserSSOToken(), data);
setPageSessionAttribute(DATA_ID, id);
}
}
use of com.sun.identity.console.service.model.DiscoveryDataCache in project OpenAM by OpenRock.
the class RealmResourceOfferingViewBean method populateTableModel.
private void populateTableModel(SMDiscoveryServiceData data) {
tblModel.clearAll();
if (data != null) {
int counter = 0;
RealmResourceOfferingModel model = (RealmResourceOfferingModel) getModel();
for (Iterator i = data.getResourceData().iterator(); i.hasNext(); counter++) {
if (counter > 0) {
tblModel.appendRow();
}
SMDiscoEntryData entry = (SMDiscoEntryData) i.next();
tblModel.setValue(TBL_DATA_SERVICE_TYPE, entry.serviceType);
tblModel.setValue(TBL_DATA_ABSTRACT, entry.abstractValue);
tblModel.setValue(TBL_DATA_ACTION_HREF, Integer.toString(counter));
}
DiscoveryDataCache cache = DiscoveryDataCache.getInstance();
String id = cache.cacheData(model.getUserSSOToken(), data);
setPageSessionAttribute(DATA_ID, id);
}
}
use of com.sun.identity.console.service.model.DiscoveryDataCache in project OpenAM by OpenRock.
the class RealmResourceOfferingViewBean method handleTblButtonDeleteRequest.
public void handleTblButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(TBL_ENTRIES);
table.restoreStateData();
RealmResourceOfferingModel model = (RealmResourceOfferingModel) getModel();
String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
DiscoveryDataCache cache = DiscoveryDataCache.getInstance();
String cacheID = (String) getPageSessionAttribute(RealmResourceOfferingViewBean.DATA_ID);
SMDiscoveryServiceData smEntry = cache.getData(model.getUserSSOToken(), cacheID);
Integer[] selected = tblModel.getSelectedRows();
smEntry.deleteDiscoEntries(selected);
try {
model.setRealmDiscoEntry(realm, smEntry);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "discovery.service.table.entry.deleted");
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "discovery.service.table.entry.deleted.pural");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
use of com.sun.identity.console.service.model.DiscoveryDataCache in project OpenAM by OpenRock.
the class UMUserResourceOfferingEditViewBean method getCurrentServiceData.
protected SMDiscoEntryData getCurrentServiceData() {
int currentIdx = Integer.parseInt((String) getPageSessionAttribute(PGATTR_INDEX));
DiscoveryDataCache cache = DiscoveryDataCache.getInstance();
String cacheID = (String) getPageSessionAttribute(UMUserResourceOfferingViewBean.DATA_ID);
SMDiscoveryServiceData smEntry = cache.getData(getModel().getUserSSOToken(), cacheID);
List resourceData = smEntry.getResourceData();
SMDiscoEntryData smDisco = (SMDiscoEntryData) resourceData.get(currentIdx);
if (getPageSessionAttribute(PGATTR_ORIG_MECH_ID) == null) {
ArrayList list = new ArrayList();
for (Iterator i = smDisco.descData.iterator(); i.hasNext(); ) {
list.add(new SMDescriptionData((SMDescriptionData) i.next()));
}
setPageSessionAttribute(PGATTR_ORIG_MECH_ID, list);
}
return smDisco;
}
use of com.sun.identity.console.service.model.DiscoveryDataCache in project OpenAM by OpenRock.
the class UMUserResourceOfferingViewBean method populateTableModel.
private void populateTableModel(SMDiscoveryServiceData data) {
tblModel.clearAll();
if (data != null) {
int counter = 0;
UMUserResourceOfferingModel model = (UMUserResourceOfferingModel) getModel();
for (Iterator i = data.getResourceData().iterator(); i.hasNext(); counter++) {
if (counter > 0) {
tblModel.appendRow();
}
SMDiscoEntryData entry = (SMDiscoEntryData) i.next();
tblModel.setValue(TBL_DATA_SERVICE_TYPE, entry.serviceType);
tblModel.setValue(TBL_DATA_ABSTRACT, entry.abstractValue);
tblModel.setValue(TBL_DATA_ACTION_HREF, Integer.toString(counter));
}
DiscoveryDataCache cache = DiscoveryDataCache.getInstance();
String id = cache.cacheData(model.getUserSSOToken(), data);
setPageSessionAttribute(DATA_ID, id);
}
}
Aggregations