use of com.sun.identity.console.service.model.SMDiscoEntryData in project OpenAM by OpenRock.
the class SMDiscoveryBootstrapRefOffViewBeanBase method getValues.
protected SMDiscoEntryData getValues(boolean validated) throws AMConsoleException {
SMDiscoEntryData smDisco = new SMDiscoEntryData();
smDisco.abstractValue = ((String) propertySheetModel.getValue(ATTR_ABSTRACT)).trim();
smDisco.serviceType = ((String) propertySheetModel.getValue(ATTR_SERVICE_TYPE)).trim();
smDisco.providerId = ((String) propertySheetModel.getValue(ATTR_PROVIDER_ID)).trim();
String optionFlag = (String) propertySheetModel.getValue(ATTR_RESOURCE_OFFERING_OPTIONS_OPTIONS);
smDisco.noOption = optionFlag.equalsIgnoreCase("true");
CCEditableList eList = (CCEditableList) getChild(ATTR_RESOURCE_OFFERING_OPTIONS_LIST);
eList.restoreStateData();
CCEditableListModel eModel = (CCEditableListModel) eList.getModel();
OptionList options = eModel.getOptionList();
if (options != null) {
smDisco.options = AMAdminUtils.toList(options);
}
List descData = (List) removePageSessionAttribute(ATTR_SECURITY_MECH_ID);
if (descData != null) {
smDisco.descData = descData;
}
smDisco.directives = getDirectiveMechIDMapping();
if (validated) {
if ((descData == null) || descData.isEmpty()) {
throw new AMConsoleException("discovery.service.bootstrapResOff.missing.service.desc.message");
} else if (smDisco.serviceType.length() == 0) {
throw new AMConsoleException("discovery.service.bootstrapResOff.missing.serviceType.message");
} else if (smDisco.providerId.length() == 0) {
throw new AMConsoleException("discovery.service.bootstrapResOff.missing.providerId.message");
}
}
return smDisco;
}
use of com.sun.identity.console.service.model.SMDiscoEntryData in project OpenAM by OpenRock.
the class SMDiscoveryDescriptionViewBeanBase method setMechID.
private void setMechID(CCAddRemoveModel model) {
SMDiscoEntryData data = (SMDiscoEntryData) getPageSessionAttribute(PG_SESSION_DISCO_ENTRY_DATA);
Set availableMechIds = getSecurityMechanisms();
Set assignedMechIds = data.getAllAssignedMechIDs();
availableMechIds.removeAll(assignedMechIds);
model.setAvailableOptionList(createOptionList(availableMechIds));
SMDescriptionData descData = getCurrentData();
if (descData != null) {
model.setSelectedOptionList(createOptionList(descData.securityMechId));
}
}
use of com.sun.identity.console.service.model.SMDiscoEntryData in project OpenAM by OpenRock.
the class SMDiscoveryBootstrapRefOffViewBeanBase method handleTblSecurityMechIDButtonAddRequest.
public void handleTblSecurityMechIDButtonAddRequest(RequestInvocationEvent event) throws ModelControlException {
try {
SMDiscoEntryData smData = getValues(false);
setPageSessionAttribute(SMDiscoveryDescriptionViewBeanBase.PG_SESSION_DISCO_ENTRY_DATA, smData);
setPageSessionAttribute(SMDiscoveryDescriptionViewBeanBase.PG_SESSION_RETURN_VIEW_BEAN_CLASSNAME, getClass().getName());
SMDiscoveryDescriptionAddViewBean vb = (SMDiscoveryDescriptionAddViewBean) getViewBean(SMDiscoveryDescriptionAddViewBean.class);
unlockPageTrail();
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 EntityDiscoveryDescriptionEditViewBean method getCurrentData.
protected SMDescriptionData getCurrentData() {
int currentIdx = Integer.parseInt((String) getPageSessionAttribute(PGATTR_INDEX));
SMDiscoEntryData data = (SMDiscoEntryData) getPageSessionAttribute(PG_SESSION_DISCO_ENTRY_DATA);
return (SMDescriptionData) data.descData.get(currentIdx);
}
use of com.sun.identity.console.service.model.SMDiscoEntryData in project OpenAM by OpenRock.
the class EntityDiscoveryDescriptionAddViewBean method handleButton1Request.
protected void handleButton1Request(SMDescriptionData smData) {
EntityResourceOfferingViewBeanBase vb = (EntityResourceOfferingViewBeanBase) getReturnToViewBean();
SMDiscoEntryData data = (SMDiscoEntryData) removePageSessionAttribute(PG_SESSION_DISCO_ENTRY_DATA);
data.descData.add(smData);
setPageSessionAttribute(EntityResourceOfferingViewBeanBase.PROPERTY_ATTRIBUTE, data);
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
}
Aggregations