use of com.iplanet.jato.view.ViewBean in project OpenAM by OpenRock.
the class PWResetServlet method onRequestHandlerNotSpecified.
/**
* Forwards to invalid URL view bean, in case of no handler specified
*
* @param requestContext request context
* @throws ServletException
*/
protected void onRequestHandlerNotSpecified(RequestContext requestContext) throws ServletException {
ViewBeanManager viewBeanManager = requestContext.getViewBeanManager();
ViewBean targetView = viewBeanManager.getViewBean(PWResetInvalidURLViewBean.class);
targetView.forwardTo(requestContext);
throw new CompleteRequestException();
}
use of com.iplanet.jato.view.ViewBean in project OpenAM by OpenRock.
the class AuthExceptionViewBean method handleHrefExceptionRequest.
/**
* Handles href exception request
* @param event request invocation event.
* @throws ServletException if it fails to foward request
* @throws IOException if it fails to foward request
*/
public void handleHrefExceptionRequest(RequestInvocationEvent event) throws ServletException, IOException {
ViewBean targetView = getViewBean(LoginViewBean.class);
targetView.forwardTo(getRequestContext());
}
use of com.iplanet.jato.view.ViewBean in project OpenAM by OpenRock.
the class AMPropertySheet method setAttributeValues.
/**
* Set values to model of a <code>CCPropertySheet</code> component.
*
* @param attributeValues Map of attribute name to values.
*/
public void setAttributeValues(Map attributeValues, AMModel amModel) {
AMPropertySheetModel model = (AMPropertySheetModel) getModel();
ViewBean parent = getParentViewBean();
for (Iterator iter = attributeValues.keySet().iterator(); iter.hasNext(); ) {
String name = (String) iter.next();
// different attribute types set different types of data
// get Object from the values and convert as needed.
Object values = attributeValues.get(name);
View view = null;
try {
view = parent.getChild(name);
} catch (IllegalArgumentException e) {
// skip this attribute. its not defined in the property sheet
continue;
}
if (view != null) {
if (setValuesToMultipleChoices(parent, name, values, amModel, model) || setValuesToAddRemove(view, name, values, amModel, model) || setValuesToEditableList(view, name, values, amModel, model) || setValuesToOrderedList(view, name, values, amModel, model) || setValuesToUnOrderedList(view, name, values, amModel, model) || setValuesToMapList(view, name, values, amModel, model) || setValuesToDateTime(view, name, values, amModel, model) || setValuesToSelect(view, name, values, amModel, model)) {
// do nothing.
} else {
// all other element types should be passing a set
if (Set.class.isInstance(values)) {
if (model.isChildSupported(name + PropertyTemplate.PWD_CONFIRM_SUFFIX)) {
model.setValues(name + PropertyTemplate.PWD_CONFIRM_SUFFIX, ((Set) values).toArray(), amModel);
}
if ((values != null) && !((Set) values).isEmpty() && model.isChildSupported(name + PropertyTemplate.PASSWORD_VALUE_TAG)) {
model.setValue(name, PASSWORD_MASK);
} else {
model.setValues(name, ((Set) values).toArray(), amModel);
}
}
}
}
}
}
use of com.iplanet.jato.view.ViewBean in project OpenAM by OpenRock.
the class AMPropertySheet method init.
public void init() {
ViewBean parent = getParentViewBean();
AMPropertySheetModel model = (AMPropertySheetModel) getModel();
Map radioComponents = model.getRadioDefaultValues();
if ((radioComponents != null) && !radioComponents.isEmpty()) {
for (Iterator i = radioComponents.keySet().iterator(); i.hasNext(); ) {
String name = (String) i.next();
CCRadioButton rb = (CCRadioButton) parent.getChild(name);
Object value = rb.getValue();
if (value == null) {
rb.setValue(radioComponents.get(name));
}
}
}
}
use of com.iplanet.jato.view.ViewBean in project OpenAM by OpenRock.
the class ConsoleServletBase method onRequestHandlerNotFound.
/**
* Forwards to invalid URL view bean, in case of an invalid target
* request handler (page).
*
* @param requestContext - request context
* @param handlerName - name of handler
* @throws ServletException
*/
protected void onRequestHandlerNotFound(RequestContext requestContext, String handlerName) throws ServletException {
ViewBeanManager viewBeanManager = requestContext.getViewBeanManager();
ViewBean targetView = viewBeanManager.getViewBean(AMInvalidURLViewBean.class);
targetView.forwardTo(requestContext);
throw new CompleteRequestException();
}
Aggregations