use of com.sun.identity.console.service.model.ServerSiteModel in project OpenAM by OpenRock.
the class ServerEditViewBeanBase method beginDisplay.
/**
* Displays the profile of a site.
*/
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
String serverName = (String) getPageSessionAttribute(PG_ATTR_SERVER_NAME);
ServerSiteModel model = (ServerSiteModel) getModel();
ptModel.setPageTitleText(model.getEditServerPageTitle(serverName));
try {
setConfigProperties(serverName, model);
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
use of com.sun.identity.console.service.model.ServerSiteModel in project OpenAM by OpenRock.
the class ServerSiteViewBean method populateSiteTableModel.
private void populateSiteTableModel(Map siteToURL) {
tblSiteModel.clearAll();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE_1);
SerializedField szCacheSite = (SerializedField) getChild(SZ_CACHE_SITE);
ServerSiteModel model = (ServerSiteModel) getModel();
tblServerModel.setMaxRows(model.getPageSize());
HashMap cacheSite = new HashMap();
ArrayList cache = new ArrayList();
if ((siteToURL != null) && !siteToURL.isEmpty()) {
int counter = 0;
for (Iterator iter = siteToURL.keySet().iterator(); iter.hasNext(); counter++) {
if (counter > 0) {
tblSiteModel.appendRow();
}
String name = (String) iter.next();
String[] params = (String[]) siteToURL.get(name);
String url = params[0];
String assigned = params[1];
tblSiteModel.setValue(TBL_DATA_SITE_ACTION_HREF, stringToHex(name));
tblSiteModel.setValue(TBL_DATA_SITE_NAME, name);
tblSiteModel.setValue(TBL_DATA_SITE_URL, url);
tblSiteModel.setValue(TBL_DATA_SITE_SERVERS, assigned);
tblSiteModel.setSelectionVisible(counter, true);
cacheSite.put(name, params);
cache.add(name);
}
szCacheSite.setValue(cacheSite);
szCache.setValue(cache);
} else {
szCache.setValue(null);
szCacheSite.setValue(null);
}
}
use of com.sun.identity.console.service.model.ServerSiteModel in project OpenAM by OpenRock.
the class ServerAddViewBean method handleButton1Request.
/**
* Handles create server request.
*
* @param event Request invocation event
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
ServerSiteModel model = (ServerSiteModel) getModel();
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
String name = (String) getDisplayFieldValue(TF_NAME);
name = name.trim();
if (name.length() > 0) {
try {
FQDNUrl test = new FQDNUrl(name);
if ((!test.isFullyQualified()) || (test.getPort().length() == 0) || (test.getURI().length() == 0)) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "serverconfig.create.site.invalid.url");
forwardTo();
} else {
model.createServer(name);
backTrail();
ServerSiteViewBean vb = (ServerSiteViewBean) getViewBean(ServerSiteViewBean.class);
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
forwardTo();
} catch (MalformedURLException mue) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", mue.getMessage());
forwardTo();
}
} else {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "serverconfig.create.site.missing.attributes");
forwardTo();
}
}
use of com.sun.identity.console.service.model.ServerSiteModel in project OpenAM by OpenRock.
the class ServerCloneViewBean method handleButton1Request.
/**
* Handles clone server request.
*
* @param event Request invocation event
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
ServerSiteModel model = (ServerSiteModel) getModel();
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
String serverName = (String) getPageSessionAttribute(PG_ATTR_SERVER_NAME);
String name = (String) getDisplayFieldValue(TF_NAME);
name = name.trim();
if (name.length() > 0) {
try {
model.cloneServer(serverName, name);
backTrail();
ServerSiteViewBean vb = (ServerSiteViewBean) getViewBean(ServerSiteViewBean.class);
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
forwardTo();
}
} else {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "serverconfig.clone.server.missing.atributes");
forwardTo();
}
}
use of com.sun.identity.console.service.model.ServerSiteModel in project OpenAM by OpenRock.
the class ServerEditGeneralViewBean method beginDisplay.
/**
* Displays the profile of a site.
*/
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
String serverName = (String) getPageSessionAttribute(PG_ATTR_SERVER_NAME);
ServerSiteModel model = (ServerSiteModel) getModel();
try {
getParentSites(serverName, model);
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
Aggregations