Search in sources :

Example 6 with ServerSiteModel

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();
}
Also used : CCEditableList(com.sun.web.ui.view.editablelist.CCEditableList) Set(java.util.Set) TreeSet(java.util.TreeSet) ServerSiteModel(com.sun.identity.console.service.model.ServerSiteModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 7 with ServerSiteModel

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());
    }
}
Also used : ServerSiteModel(com.sun.identity.console.service.model.ServerSiteModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 8 with ServerSiteModel

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);
    }
}
Also used : Iterator(java.util.Iterator) ServerSiteModel(com.sun.identity.console.service.model.ServerSiteModel) HashSet(java.util.HashSet)

Example 9 with ServerSiteModel

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();
}
Also used : UnknownPropertyNameException(com.sun.identity.common.configuration.UnknownPropertyNameException) ServerSiteModel(com.sun.identity.console.service.model.ServerSiteModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 10 with ServerSiteModel

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));
}
Also used : ServerSiteModel(com.sun.identity.console.service.model.ServerSiteModel)

Aggregations

ServerSiteModel (com.sun.identity.console.service.model.ServerSiteModel)28 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)23 Iterator (java.util.Iterator)11 HashSet (java.util.HashSet)8 HashMap (java.util.HashMap)7 Set (java.util.Set)7 SerializedField (com.sun.identity.console.components.view.html.SerializedField)6 ArrayList (java.util.ArrayList)6 Map (java.util.Map)6 TreeSet (java.util.TreeSet)6 CCActionTable (com.sun.web.ui.view.table.CCActionTable)5 ServerConfigXML (com.sun.identity.common.configuration.ServerConfigXML)4 List (java.util.List)4 UnknownPropertyNameException (com.sun.identity.common.configuration.UnknownPropertyNameException)3 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)3 ConfigurationException (com.sun.identity.common.configuration.ConfigurationException)1 DirUserObject (com.sun.identity.common.configuration.ServerConfigXML.DirUserObject)1 AMPropertySheetModel (com.sun.identity.console.base.model.AMPropertySheetModel)1 FQDNUrl (com.sun.identity.shared.FQDNUrl)1 CCEditableList (com.sun.web.ui.view.editablelist.CCEditableList)1