use of com.sun.web.ui.model.CCTabsModel in project OpenAM by OpenRock.
the class MAPClientManagerViewBean method createTab.
private View createTab(String name) {
CCTabsModel tabModel = new CCTabsModel();
MAPServiceModel model = (MAPServiceModel) getModel();
Set profileNames = model.getProfileNames();
if ((profileNames != null) && !profileNames.isEmpty()) {
for (Iterator iter = profileNames.iterator(); iter.hasNext(); ) {
String val = (String) iter.next();
tabModel.addNode(new CCNavNode(val.hashCode(), val, val, val));
}
tabModel.setSelectedNode(getProfileName().hashCode());
}
return new CCTabs(this, tabModel, name);
}
use of com.sun.web.ui.model.CCTabsModel in project OpenAM by OpenRock.
the class AMViewConfig method getTabsModel.
public CCTabsModel getTabsModel(String type, String realmName, HttpServletRequest req) {
CCTabsModel tabModel = new CCTabsModel();
AccessControlModel model = new AccessControlModelImpl(req);
List tabs = getTabList(type);
if ((tabs == null) || tabs.isEmpty()) {
return null;
}
for (Iterator iter = tabs.iterator(); iter.hasNext(); ) {
AMTabEntry entry = (AMTabEntry) iter.next();
CCNavNode navNode = entry.getNavNode(model, realmName);
if (navNode != null) {
tabModel.addNode(navNode);
}
}
return tabModel;
}
use of com.sun.web.ui.model.CCTabsModel in project OpenAM by OpenRock.
the class AMViewConfig method getSAMLv2TabsModel.
// all tabs for SAMLv2 property page are predefined in fmConsoleConfiguration.xml.
//here unwanted tabs are hidden based on the role of the respective entity.
public CCTabsModel getSAMLv2TabsModel(String type, String realmName, HttpServletRequest req, List tabsToDisplay) {
CCTabsModel tabModel = new CCTabsModel();
AccessControlModel model = new AccessControlModelImpl(req);
List tabs = getTabList(type);
if ((tabs == null) || tabs.isEmpty()) {
return null;
}
for (Iterator iter = tabs.iterator(); iter.hasNext(); ) {
AMTabEntry entry = (AMTabEntry) iter.next();
for (Iterator tab_iter = tabsToDisplay.iterator(); tab_iter.hasNext(); ) {
String roletoDisplay = (String) tab_iter.next();
if (entry.getViewBean().contains(roletoDisplay)) {
CCNavNode navNode = entry.getNavNode(model, realmName);
if (navNode != null) {
tabModel.addNode(navNode);
}
}
}
}
return tabModel;
}
use of com.sun.web.ui.model.CCTabsModel in project OpenAM by OpenRock.
the class AMViewConfig method addSessionTabs.
public CCTabsModel addSessionTabs(CCTabsModel tabModel, AMModel model) {
if (tabModel == null) {
tabModel = new CCTabsModel();
}
CCNavNode sessionNode = (CCNavNode) tabModel.getNodeById(AMAdminConstants.SESSIONS_NODE_ID);
if (sessionNode != null) {
if ((tabs == null) || (tabs.isEmpty()) || (sessionNode.getChildren() == null) || (sessionNode.getChildren().size() >= 2)) {
return tabModel;
}
AMTabEntry[] entries = new AMTabEntry[2];
entries[0] = (AMTabEntry) sessionNode.getChildren().get(0);
entries[1] = (AMTabEntry) sessionNode.getChildren().get(1);
for (AMTabEntry entry : entries) {
sessionNode.addChild(new CCNavNode(entry.getID(), entry.getLabel(), entry.getTooltip(), entry.getStatus()));
}
}
return tabModel;
}
use of com.sun.web.ui.model.CCTabsModel in project OpenAM by OpenRock.
the class EntityEditViewBean method createPropertyModel.
protected boolean createPropertyModel() {
boolean created = super.createPropertyModel();
if (created) {
String type = (String) getPageSessionAttribute(ENTITY_TYPE);
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
EntitiesModel model = (EntitiesModel) getModel();
tabModel = new CCTabsModel();
tabModel.addNode(new CCNavNode(TAB_PROFILE, "profile.tab", "", ""));
if (model.canAssignService(curRealm, type)) {
tabModel.addNode(new CCNavNode(TAB_SERVICES, "services.tab", "", ""));
}
try {
Set memberOfs = model.getIdTypeMemberOf(curRealm, type);
for (Iterator iter = memberOfs.iterator(); iter.hasNext(); ) {
IdType t = (IdType) iter.next();
tabModel.addNode(new CCNavNode(t.hashCode(), t.getName(), "", ""));
}
Set beMemberOfs = model.getIdTypeBeMemberOf(curRealm, type);
if ((beMemberOfs != null) && !beMemberOfs.isEmpty()) {
for (Iterator i = beMemberOfs.iterator(); i.hasNext(); ) {
IdType t = (IdType) i.next();
tabModel.addNode(new CCNavNode(t.hashCode(), t.getName(), "", ""));
}
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
tabModel.setSelectedNode(TAB_PROFILE);
}
return created;
}
Aggregations