Search in sources :

Example 26 with AMModel

use of com.sun.identity.console.base.model.AMModel in project OpenAM by OpenRock.

the class SMDiscoveryProviderResourceIdMapperViewBeanBase method getModelInternal.

protected AMModel getModelInternal() {
    AMModel model = null;
    HttpServletRequest req = RequestManager.getRequestContext().getRequest();
    try {
        model = new SMDiscoveryServiceModelImpl(req, getPageSessionAttributes());
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    return model;
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) AMModel(com.sun.identity.console.base.model.AMModel) SMDiscoveryServiceModelImpl(com.sun.identity.console.service.model.SMDiscoveryServiceModelImpl) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 27 with AMModel

use of com.sun.identity.console.base.model.AMModel in project OpenAM by OpenRock.

the class AgentsViewBean method getBreadCrumbDisplayName.

protected String getBreadCrumbDisplayName() {
    String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    AMModel model = (AMModel) getModel();
    String path = null;
    if ((realm != null) && (realm.trim().length() > 0)) {
        int idx = realm.lastIndexOf('/');
        if ((idx != -1) && (idx < (realm.length() - 1))) {
            path = realm.substring(idx + 1);
        }
    }
    if (path == null) {
        model.getStartDSDN();
        path = AMFormatUtils.DNToName(model, model.getStartDSDN());
    }
    // unescape the value to display '/' character
    String[] arg = { SMSSchema.unescapeName(path) };
    return MessageFormat.format(model.getLocalizedString("breadcrumbs.editRealm"), (Object[]) arg);
}
Also used : AMModel(com.sun.identity.console.base.model.AMModel)

Example 28 with AMModel

use of com.sun.identity.console.base.model.AMModel in project OpenAM by OpenRock.

the class AMAdminFrameViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    AMViewConfig config = AMViewConfig.getInstance();
    RequestContext rc = getRequestContext();
    String startDN = AMModelBase.getStartDN(rc.getRequest());
    String url = config.getDefaultViewBeanURL(startDN, rc.getRequest());
    if ((url != null) && (url.length() > 0)) {
        setDisplayFieldValue(VIEWBEAN_URL, url);
    } else {
        /* 
             * We couldn't retrieve the default view to display.
             * This may be due to permission problems, or a configuration
             * issue. If the users profile is set to ignore, display
             * the "Authenticated View". 
             */
        AMModel model = getModel();
        if (model.ignoreUserProfile()) {
            AuthenticatedViewBean vb = (AuthenticatedViewBean) getViewBean(AuthenticatedViewBean.class);
            passPgSessionMap(vb);
            vb.forwardTo(rc);
        }
        //set the non admin end user view
        setDisplayFieldValue(VIEWBEAN_URL, "../idm/EndUser");
    }
}
Also used : AMModel(com.sun.identity.console.base.model.AMModel) RequestContext(com.iplanet.jato.RequestContext)

Example 29 with AMModel

use of com.sun.identity.console.base.model.AMModel in project OpenAM by OpenRock.

the class AMPrimaryMastHeadViewBean method createMastheadModel.

private CCMastheadModel createMastheadModel() {
    CCMastheadModel mm = new CCMastheadModel();
    AMModel model = getModel();
    String consoleDirectory = model.getConsoleDirectory();
    /*
         * set the logo; can be different for each realm based on 
         * the console jsp directory attribute.
         */
    String logo = "../" + consoleDirectory + "/images/PrimaryProductName.png";
    mm.setSrc(logo);
    mm.setWidth("");
    mm.setHeight("");
    mm.setVersionProductNameSrc(logo);
    /*
         * enable some of the masthead display features...
         * turn off the date, does not provide anything valid and is
         * issue for localization
         */
    mm.setShowDate(false);
    mm.setShowServer(true);
    mm.setShowUserRole(true);
    mm.setVersionFileName("help/version.html");
    return mm;
}
Also used : AMModel(com.sun.identity.console.base.model.AMModel) CCMastheadModel(com.sun.web.ui.model.CCMastheadModel)

Example 30 with AMModel

use of com.sun.identity.console.base.model.AMModel in project OpenAM by OpenRock.

the class AMViewBeanBase method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    AMModel model = getModel();
    setPageEncoding(model);
    setDisplayFieldValue(TXT_RANDOM_STR, model.getRandomString());
    setDisplayFieldValue(PG_SESSION, getPageSessionAttributeString());
    setDisplayFieldValue(TXT_LOCATION, getModel().getLocalizedString("label.location"));
    performDelegationTasks();
}
Also used : AMModel(com.sun.identity.console.base.model.AMModel)

Aggregations

AMModel (com.sun.identity.console.base.model.AMModel)33 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)14 HttpServletRequest (javax.servlet.http.HttpServletRequest)13 Iterator (java.util.Iterator)4 SMDiscoveryServiceModelImpl (com.sun.identity.console.service.model.SMDiscoveryServiceModelImpl)3 SubConfigModelImpl (com.sun.identity.console.service.model.SubConfigModelImpl)3 List (java.util.List)3 Set (java.util.Set)3 SMG11NModelImpl (com.sun.identity.console.service.model.SMG11NModelImpl)2 WSPersonalProfileServiceModelImpl (com.sun.identity.console.webservices.model.WSPersonalProfileServiceModelImpl)2 CCBreadCrumbsModel (com.sun.web.ui.model.CCBreadCrumbsModel)2 CCBreadCrumbs (com.sun.web.ui.view.breadcrumb.CCBreadCrumbs)2 CCSelect (com.sun.web.ui.view.html.CCSelect)2 ArrayList (java.util.ArrayList)2 Locale (java.util.Locale)2 RequestContext (com.iplanet.jato.RequestContext)1 OptionList (com.iplanet.jato.view.html.OptionList)1 AMCommonNameGenerator (com.sun.identity.console.base.model.AMCommonNameGenerator)1 SCSAML2SOAPBindingModelImpl (com.sun.identity.console.service.model.SCSAML2SOAPBindingModelImpl)1 SCSOAPBindingModelImpl (com.sun.identity.console.service.model.SCSOAPBindingModelImpl)1