use of com.sun.identity.console.service.model.SMDiscoEntryData 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.SMDiscoEntryData in project OpenAM by OpenRock.
the class RealmResourceOfferingViewBeanBase method handleTblSecurityMechIDHrefActionRequest.
/**
* Handles edit security mechanism ID request.
*
* @param event Request Invocation Event.
*/
public void handleTblSecurityMechIDHrefActionRequest(RequestInvocationEvent event) throws ModelControlException {
SMDiscoEntryData smData = (SMDiscoEntryData) getPageSessionAttribute(PROPERTY_ATTRIBUTE);
setPageSessionAttribute(RealmDiscoveryDescriptionViewBeanBase.PG_SESSION_DISCO_ENTRY_DATA, smData);
setPageSessionAttribute(RealmDiscoveryDescriptionViewBeanBase.PG_SESSION_RETURN_VIEW_BEAN_CLASSNAME, getClass().getName());
RealmDiscoveryDescriptionEditViewBean vb = (RealmDiscoveryDescriptionEditViewBean) getViewBean(RealmDiscoveryDescriptionEditViewBean.class);
passPgSessionMap(vb);
vb.populateValues((String) getDisplayFieldValue(TBL_SECURITY_MECH_ID_HREF_ACTION));
vb.forwardTo(getRequestContext());
}
use of com.sun.identity.console.service.model.SMDiscoEntryData in project OpenAM by OpenRock.
the class RealmResourceOfferingViewBeanBase method handleTblSecurityMechIDButtonAddRequest.
public void handleTblSecurityMechIDButtonAddRequest(RequestInvocationEvent event) throws ModelControlException {
try {
SMDiscoEntryData smData = getValues(false);
setPageSessionAttribute(RealmDiscoveryDescriptionViewBeanBase.PG_SESSION_DISCO_ENTRY_DATA, smData);
setPageSessionAttribute(RealmDiscoveryDescriptionViewBeanBase.PG_SESSION_RETURN_VIEW_BEAN_CLASSNAME, getClass().getName());
RealmDiscoveryDescriptionAddViewBean vb = (RealmDiscoveryDescriptionAddViewBean) getViewBean(RealmDiscoveryDescriptionAddViewBean.class);
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
forwardTo();
}
}
use of com.sun.identity.console.service.model.SMDiscoEntryData in project OpenAM by OpenRock.
the class RealmResourceOfferingEditViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
if (populateValues) {
SMDiscoEntryData data = getCurrentServiceData();
setValues(data, getModel());
} else {
SMDiscoEntryData data = (SMDiscoEntryData) getPageSessionAttribute(PROPERTY_ATTRIBUTE);
if (data != null) {
populateDirectiveMechIDRefs(data);
}
}
}
use of com.sun.identity.console.service.model.SMDiscoEntryData in project OpenAM by OpenRock.
the class SMDiscoveryServiceViewBean method populateBootstrapResOffTable.
private void populateBootstrapResOffTable(Set resoff) {
tablePopulated = true;
if (resoff != null) {
CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(AMAdminConstants.DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF);
tblModel.clearAll();
boolean firstEntry = true;
int counter = 0;
try {
SMDiscoveryServiceData smEntry = SMDiscoveryServiceData.getEntries(resoff);
List resourceList = smEntry.getResourceData();
if ((resourceList != null) && !resourceList.isEmpty()) {
for (Iterator i = resourceList.iterator(); i.hasNext(); ) {
SMDiscoEntryData smDisco = (SMDiscoEntryData) i.next();
if (!firstEntry) {
tblModel.appendRow();
} else {
firstEntry = false;
}
tblModel.setValue(TBL_BOOTSTRAP_RES_OFF_DATA_SERVICE_TYPE, smDisco.serviceType);
tblModel.setValue(TBL_BOOTSTRAP_RES_OFF_DATA_ABSTRACT, smDisco.abstractValue);
tblModel.setValue(TBL_BOOTSTRAP_RES_OFF_HREF_ACTION, Integer.toString(counter));
counter++;
}
disableButton(TBL_BOOTSTRAP_RES_OFF_ADD_BTN, true);
} else {
disableButton(TBL_BOOTSTRAP_RES_OFF_ADD_BTN, false);
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
setPageSessionAttribute(AMAdminConstants.DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF, (OrderedSet) resoff);
}
Aggregations