use of com.sun.identity.console.service.model.ServerSiteModel in project OpenAM by OpenRock.
the class SiteEditViewBean method handleButton1Request.
/**
* Handles create site request.
*
* @param event Request invocation event
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
String siteName = (String) getPageSessionAttribute(PG_ATTR_SITE_NAME);
String primaryURL = (String) getDisplayFieldValue(TF_URL);
CCEditableList elist = (CCEditableList) getChild(EDITABLE_FAILOVER_URLS);
elist.restoreStateData();
Set failoverURLs = getValues(elist.getModel().getOptionList());
ServerSiteModel model = (ServerSiteModel) getModel();
try {
model.modifySite(siteName, primaryURL, failoverURLs);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "siteconfig.updated");
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
use of com.sun.identity.console.service.model.ServerSiteModel in project OpenAM by OpenRock.
the class SiteEditViewBean method beginDisplay.
/**
* Displays the profile of a site.
*/
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
String siteName = (String) getPageSessionAttribute(PG_ATTR_SITE_NAME);
ServerSiteModel model = (ServerSiteModel) getModel();
ptModel.setPageTitleText(model.getEditSitePageTitle(siteName));
try {
setDisplayFieldValue(TF_URL, model.getSitePrimaryURL(siteName));
getFailoverURLs(siteName, model);
getServers(siteName, 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 ServerEditAdvancedViewBean method populateTableModel.
private void populateTableModel(Set properties) {
tblModel.clearAll();
ServerSiteModel model = (ServerSiteModel) getModel();
if ((properties == null) || properties.isEmpty()) {
properties = new HashSet(2);
properties.add("=");
}
int counter = 0;
for (Iterator iter = properties.iterator(); iter.hasNext(); counter++) {
if (counter > 0) {
tblModel.appendRow();
}
String t = (String) iter.next();
int idx = t.indexOf('=');
String name = t.substring(0, idx).trim();
String value = t.substring(idx + 1).trim();
tblModel.setValue(TBL_DATA_NAME, name);
tblModel.setValue(TBL_DATA_VALUE, value);
tblModel.setSelectionVisible(counter, true);
}
}
use of com.sun.identity.console.service.model.ServerSiteModel in project OpenAM by OpenRock.
the class ServerEditGeneralViewBean method handleButton1Request.
/**
* Handles create site request.
*
* @param event Request invocation event
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
String serverName = (String) getPageSessionAttribute(PG_ATTR_SERVER_NAME);
String parentSite = (serverName.equals(ServerConfiguration.DEFAULT_SERVER_CONFIG)) ? null : (String) getDisplayFieldValue(PARENT_SITE);
ServerSiteModel model = (ServerSiteModel) getModel();
try {
model.modifyServer(serverName, parentSite, getAttributeValues());
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "serverconfig.updated");
} catch (UnknownPropertyNameException e) {
// ignore. this cannot happen because property in this page
// is customized.
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
use of com.sun.identity.console.service.model.ServerSiteModel in project OpenAM by OpenRock.
the class ServerCloneViewBean method beginDisplay.
/**
* Sets the title of the page.
*
* @param event Display event.
* @throws ModelControlException if JATO model fails to initiate.
*/
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
ServerSiteModel model = (ServerSiteModel) getModel();
String serverName = (String) getPageSessionAttribute(PG_ATTR_SERVER_NAME);
Object[] param = { serverName };
ptModel.setPageTitleText(MessageFormat.format(model.getLocalizedString("page.title.server.clone"), param));
setDisplayFieldValue("helpName", MessageFormat.format(model.getLocalizedString("serverconfig.server.clone.help.name"), param));
}
Aggregations