Search in sources :

Example 16 with ViewBean

use of com.iplanet.jato.view.ViewBean in project OpenAM by OpenRock.

the class PWResetServlet 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(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 17 with ViewBean

use of com.iplanet.jato.view.ViewBean in project OpenAM by OpenRock.

the class AMPropertySheet method restoreStateData.

/**
     * Automates the restoring of store data in some children. This is required
     * for some special children such as <code>CCAddRemvoe</code>.
     *
     * @throws ModelControlException if cannot get model of property sheet.
     */
public void restoreStateData(Collection participatingChildren) throws ModelControlException {
    ViewBean parent = getParentViewBean();
    String[] names = parent == null ? null : parent.getChildNames();
    if ((names != null) && (names.length > 0)) {
        for (int i = 0; i < names.length; i++) {
            String name = names[i];
            if (participatingChildren.contains(name)) {
                View child = parent.getChild(name);
                if (CCAddRemove.class.isInstance(child)) {
                    ((CCAddRemove) child).restoreStateData();
                } else if (CCUnOrderedList.class.isInstance(child)) {
                    ((CCUnOrderedList) child).restoreStateData();
                } else if (CCMapList.class.isInstance(child)) {
                    ((CCMapList) child).restoreStateData();
                } else if (CCEditableList.class.isInstance(child)) {
                    ((CCEditableList) child).restoreStateData();
                } else if (CCOrderedList.class.isInstance(child)) {
                    ((CCOrderedList) child).restoreStateData();
                } else if (CCActionTable.class.isInstance(child)) {
                    ((CCActionTable) child).restoreStateData();
                }
            }
        }
    }
}
Also used : CCEditableList(com.sun.web.ui.view.editablelist.CCEditableList) CCMapList(com.sun.identity.console.ui.view.CCMapList) ViewBean(com.iplanet.jato.view.ViewBean) CCOrderedList(com.sun.identity.console.ui.view.CCOrderedList) CCActionTable(com.sun.web.ui.view.table.CCActionTable) View(com.iplanet.jato.view.View) ContainerView(com.iplanet.jato.view.ContainerView) CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove) CCUnOrderedList(com.sun.identity.console.ui.view.CCUnOrderedList)

Example 18 with ViewBean

use of com.iplanet.jato.view.ViewBean in project OpenAM by OpenRock.

the class DSAMEResBundleTag method doStartTag.

/**
     * performs start tag
     *
     * @return EVAL_BODY_INCLUDE always
     * @throws JspException if request context is null
     */
public int doStartTag() throws JspException {
    reset();
    ViewBean vb = getParentViewBean();
    java.util.Locale locale;
    if (vb instanceof AuthViewBeanBase) {
        AuthViewBeanBase ab = (AuthViewBeanBase) vb;
        locale = ab.getRequestLocale();
    } else {
        locale = java.util.Locale.getDefault();
    }
    String rbName = (String) getValue("BundleName");
    String resKey = (String) getValue("ResourceKey");
    String resValue;
    ResourceBundle rb = AMResourceBundleCache.getInstance().getResBundle(rbName, locale);
    try {
        resValue = rb.getString(resKey);
    } catch (MissingResourceException ex) {
        resValue = resKey;
    }
    writeOutput(resValue);
    return SKIP_BODY;
}
Also used : MissingResourceException(java.util.MissingResourceException) ResourceBundle(java.util.ResourceBundle) AuthViewBeanBase(com.sun.identity.authentication.UI.AuthViewBeanBase) ViewBean(com.iplanet.jato.view.ViewBean)

Example 19 with ViewBean

use of com.iplanet.jato.view.ViewBean in project OpenAM by OpenRock.

the class DSAMEFormTag method doEndTag.

public int doEndTag() throws JspException {
    ViewBean vb = getParentViewBean();
    NonSyncStringBuffer buffer = new NonSyncStringBuffer();
    buffer.append("<input type=\"hidden\" name=\"");
    buffer.append(AuthViewBeanBase.PAGE_ENCODING).append("\" value=\"").append(vb.getDisplayFieldValue("gx_charset")).append("\"/>").append("</form>");
    writeOutput(buffer);
    return EVAL_PAGE;
}
Also used : NonSyncStringBuffer(com.iplanet.jato.util.NonSyncStringBuffer) ViewBean(com.iplanet.jato.view.ViewBean)

Example 20 with ViewBean

use of com.iplanet.jato.view.ViewBean in project OpenAM by OpenRock.

the class DSAMEFormTag method setTilePrefix.

public void setTilePrefix(String name) throws JspException {
    ViewBean vb = getParentViewBean();
    if (vb instanceof AuthViewBeanBase) {
        AuthViewBeanBase ab = (AuthViewBeanBase) vb;
        setValue("name", name + ab.getTileIndex());
    } else {
        setValue("name", name);
    }
}
Also used : AuthViewBeanBase(com.sun.identity.authentication.UI.AuthViewBeanBase) 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