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;
}
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);
}
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");
}
}
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;
}
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();
}
Aggregations