use of com.sun.identity.console.base.AMViewConfig in project OpenAM by OpenRock.
the class ServerEditAdvancedViewBean method createTabModel.
protected void createTabModel(String serverName) {
AMViewConfig amconfig = AMViewConfig.getInstance();
tabModel = amconfig.getTabsModel(ServerEditViewBeanBase.TAB_NAME, "/", getRequestContext().getRequest());
if (serverName.equals(ServerConfiguration.DEFAULT_SERVER_CONFIG)) {
CCNavNode node = (CCNavNode) tabModel.getNodeById(425);
tabModel.removeNode(node);
}
registerChild(TAB_COMMON, CCTabs.class);
}
use of com.sun.identity.console.base.AMViewConfig in project OpenAM by OpenRock.
the class ServerConfigXMLViewBean method createTabModel.
protected void createTabModel() {
if (tabModel == null) {
AMViewConfig amconfig = AMViewConfig.getInstance();
tabModel = amconfig.getTabsModel(ServerEditViewBeanBase.TAB_NAME, "/", getRequestContext().getRequest());
registerChild(TAB_COMMON, CCTabs.class);
}
}
use of com.sun.identity.console.base.AMViewConfig in project OpenAM by OpenRock.
the class ServerEditViewBeanBase method nodeClicked.
/**
* Handles tab selected event.
*
* @param event Request Invocation Event.
* @param nodeID Selected Node ID.
*/
public void nodeClicked(RequestInvocationEvent event, int nodeID) {
AMViewConfig amconfig = AMViewConfig.getInstance();
try {
AMViewBeanBase vb = getTabNodeAssociatedViewBean("cscGeneral", nodeID);
unlockPageTrailForSwapping();
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
} catch (AMConsoleException e) {
debug.error("ServerEditGeneralViewBean.nodeClicked", e);
forwardTo();
}
}
use of com.sun.identity.console.base.AMViewConfig in project OpenAM by OpenRock.
the class AgentsViewBean method nodeClicked.
/**
* Handles tab selected event.
*
* @param event Request Invocation Event.
* @param nodeID Selected Node ID.
*/
public void nodeClicked(RequestInvocationEvent event, int nodeID) {
boolean forwardTo = false;
String strNodeId = Integer.toString(nodeID);
if (strNodeId.length() > 2) {
String prefix = strNodeId.substring(0, 2);
if (prefix.equals(AMAdminConstants.TAB_AGENT_PREFIX)) {
setPageSessionAttribute(getTrackingTabIDName(), Integer.toString(nodeID));
AMViewConfig amconfig = AMViewConfig.getInstance();
List list = amconfig.getSupportedAgentTypes(getModel());
strNodeId = strNodeId.substring(2);
int idx = Integer.parseInt(strNodeId);
if (idx < list.size()) {
setPageSessionAttribute(PG_SESSION_AGENT_TYPE, (String) list.get(idx));
AMPostViewBean vb = (AMPostViewBean) getViewBean(AMPostViewBean.class);
passPgSessionMap(vb);
vb.setTargetViewBeanURL("../agentconfig/Agents");
vb.forwardTo(getRequestContext());
forwardTo = true;
}
}
}
if (!forwardTo) {
try {
AMViewBeanBase vb = getTabNodeAssociatedViewBean("realms", nodeID);
String tmp = (String) getPageSessionAttribute(AMAdminConstants.PREVIOUS_REALM);
vb.setPageSessionAttribute(AMAdminConstants.PREVIOUS_REALM, tmp);
tmp = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
vb.setPageSessionAttribute(AMAdminConstants.CURRENT_REALM, tmp);
tmp = (String) getPageSessionAttribute(AMAdminConstants.PREVIOUS_TAB_ID);
vb.setPageSessionAttribute(AMAdminConstants.PREVIOUS_TAB_ID, tmp);
unlockPageTrailForSwapping();
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
} catch (AMConsoleException e) {
debug.error("AgentViewBean.nodeClicked", e);
forwardTo();
}
}
}
use of com.sun.identity.console.base.AMViewConfig in project OpenAM by OpenRock.
the class AgentsViewBean method getAgentNames.
private void getAgentNames() {
AgentsModel model = (AgentsModel) getModel();
String filter = ((String) getDisplayFieldValue(TF_FILTER));
String gfilter = ((String) getDisplayFieldValue(TF_GROUP_FILTER));
if ((filter == null) || (filter.length() == 0)) {
filter = "*";
setDisplayFieldValue(TF_FILTER, "*");
} else {
filter = filter.trim();
}
if ((gfilter == null) || (gfilter.length() == 0)) {
gfilter = "*";
setDisplayFieldValue(TF_GROUP_FILTER, "*");
} else {
gfilter = gfilter.trim();
}
// this is to faciliate combined types.
String agentType = getDisplayIDType();
AMViewConfig cfg = AMViewConfig.getInstance();
Set agentTypes = cfg.getCombineAgentTypes(agentType);
if (agentTypes == null) {
agentTypes = new HashSet(2);
agentTypes.add(agentType);
} else {
supportedTypes.addAll(agentTypes);
}
try {
Set agents = new HashSet();
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
int errorCode = model.getAgentNames(curRealm, agentTypes, filter, agents);
switch(errorCode) {
case IdSearchResults.SIZE_LIMIT_EXCEEDED:
setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", "message.sizelimit.exceeded");
break;
case IdSearchResults.TIME_LIMIT_EXCEEDED:
setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", "message.timelimit.exceeded");
break;
}
Set agentGroups = new HashSet();
errorCode = model.getAgentGroupNames(curRealm, agentTypes, gfilter, agentGroups);
switch(errorCode) {
case IdSearchResults.SIZE_LIMIT_EXCEEDED:
setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", "message.sizelimit.exceeded");
break;
case IdSearchResults.TIME_LIMIT_EXCEEDED:
setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", "message.timelimit.exceeded");
break;
}
Map results = new HashMap(4);
results.put(CACHE_AGENTS, agents);
results.put(CACHE_AGENT_GROUPS, agentGroups);
populateTableModel(results);
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
CCButton b = (CCButton) getChild(TBL_BUTTON_ADD);
b.setDisabled(true);
b = (CCButton) getChild(TBL_BUTTON_ADD_GROUP);
b.setDisabled(true);
}
}
Aggregations