Search in sources :

Example 1 with ViewBean

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();
}
Also used : CompleteRequestException(com.iplanet.jato.CompleteRequestException) ViewBeanManager(com.iplanet.jato.ViewBeanManager) ViewBean(com.iplanet.jato.view.ViewBean)

Example 2 with ViewBean

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());
}
Also used : ViewBean(com.iplanet.jato.view.ViewBean)

Example 3 with ViewBean

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);
                    }
                }
            }
        }
    }
}
Also used : AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) Iterator(java.util.Iterator) ViewBean(com.iplanet.jato.view.ViewBean) View(com.iplanet.jato.view.View) ContainerView(com.iplanet.jato.view.ContainerView)

Example 4 with ViewBean

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));
            }
        }
    }
}
Also used : CCRadioButton(com.sun.web.ui.view.html.CCRadioButton) AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) Iterator(java.util.Iterator) ViewBean(com.iplanet.jato.view.ViewBean) HashMap(java.util.HashMap) Map(java.util.Map)

Example 5 with ViewBean

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();
}
Also used : CompleteRequestException(com.iplanet.jato.CompleteRequestException) ViewBeanManager(com.iplanet.jato.ViewBeanManager) ViewBean(com.iplanet.jato.view.ViewBean)

Aggregations

ViewBean (com.iplanet.jato.view.ViewBean)21 CompleteRequestException (com.iplanet.jato.CompleteRequestException)7 ViewBeanManager (com.iplanet.jato.ViewBeanManager)6 AuthViewBeanBase (com.sun.identity.authentication.UI.AuthViewBeanBase)3 NonSyncStringBuffer (com.iplanet.jato.util.NonSyncStringBuffer)2 ContainerView (com.iplanet.jato.view.ContainerView)2 View (com.iplanet.jato.view.View)2 AMPropertySheetModel (com.sun.identity.console.base.model.AMPropertySheetModel)2 Iterator (java.util.Iterator)2 AMPostViewBean (com.sun.identity.console.base.AMPostViewBean)1 AMPrimaryMastHeadViewBean (com.sun.identity.console.base.AMPrimaryMastHeadViewBean)1 ServicesViewBean (com.sun.identity.console.realm.ServicesViewBean)1 CCMapList (com.sun.identity.console.ui.view.CCMapList)1 CCOrderedList (com.sun.identity.console.ui.view.CCOrderedList)1 CCUnOrderedList (com.sun.identity.console.ui.view.CCUnOrderedList)1 CCAddRemove (com.sun.web.ui.view.addremove.CCAddRemove)1 CCEditableList (com.sun.web.ui.view.editablelist.CCEditableList)1 CCRadioButton (com.sun.web.ui.view.html.CCRadioButton)1 CCActionTable (com.sun.web.ui.view.table.CCActionTable)1 HashMap (java.util.HashMap)1