Search in sources :

Example 66 with AMPropertySheet

use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.

the class MAPCreateDeviceTwoViewBean method handleButton2Request.

/**
     * Handles create device request.
     *
     * @param event Request Invocation Event.
     */
public void handleButton2Request(RequestInvocationEvent event) throws ModelControlException {
    submitCycle = true;
    MAPCreateDeviceModel model = (MAPCreateDeviceModel) getModel();
    AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
    try {
        Map values = ps.getAttributeValues(model.getCreateDeviceAttributeNames());
        Set setParentId = new HashSet(2);
        setParentId.add(attrParentId);
        values.put("parentId", setParentId);
        model.createDevice(values);
        MAPDeviceProfileViewBean vb = (MAPDeviceProfileViewBean) getViewBean(MAPDeviceProfileViewBean.class);
        vb.deviceName = (String) AMAdminUtils.getValue((Set) values.get(MAPCreateDeviceModel.ATTRIBUTE_NAME_CLIENT_TYPE));
        passPgSessionMap(vb);
        vb.forwardTo(getRequestContext());
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        forwardTo();
    }
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) MAPCreateDeviceModel(com.sun.identity.console.service.model.MAPCreateDeviceModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map) HashSet(java.util.HashSet)

Example 67 with AMPropertySheet

use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.

the class SCPropertiesBase method getValues.

protected Map getValues() throws ModelControlException, AMConsoleException {
    SCModel model = (SCModel) getModel();
    Map values = null;
    Map orig = model.getValues();
    AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
    // pass true to get only the values that have been modified
    return ps.getAttributeValues(orig, true, model);
}
Also used : SCModel(com.sun.identity.console.service.model.SCModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) Map(java.util.Map)

Example 68 with AMPropertySheet

use of com.sun.identity.console.base.AMPropertySheet 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();
    }
}
Also used : MalformedURLException(java.net.MalformedURLException) FQDNUrl(com.sun.identity.shared.FQDNUrl) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) ServerSiteModel(com.sun.identity.console.service.model.ServerSiteModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 69 with AMPropertySheet

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

Example 70 with AMPropertySheet

use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.

the class STSAddViewBeanBase method getAttributeSettings.

/*
    Returns a map of all settings, including those not changed from the default values in the model.
    AMConsoleException will be thrown if passwords are mis-matched.
     */
private Map getAttributeSettings() throws ModelControlException, AMConsoleException {
    Map values = null;
    AMServiceProfileModel model = (AMServiceProfileModel) getModel();
    if (model != null) {
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
        values = ps.getAttributeValues(model.getAttributeValues(), false, model);
    }
    return values;
}
Also used : AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) Map(java.util.Map) AMServiceProfileModel(com.sun.identity.console.base.model.AMServiceProfileModel)

Aggregations

AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)122 Map (java.util.Map)79 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)76 HashMap (java.util.HashMap)37 SAMLv2Model (com.sun.identity.console.federation.model.SAMLv2Model)28 Set (java.util.Set)21 HashSet (java.util.HashSet)15 List (java.util.List)10 View (com.iplanet.jato.view.View)9 IDFFModel (com.sun.identity.console.federation.model.IDFFModel)8 SubConfigModel (com.sun.identity.console.service.model.SubConfigModel)8 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)8 ArrayList (java.util.ArrayList)7 Iterator (java.util.Iterator)7 CCPageTitle (com.sun.web.ui.view.pagetitle.CCPageTitle)6 ModelControlException (com.iplanet.jato.model.ModelControlException)5 WSFedPropertiesModel (com.sun.identity.console.federation.model.WSFedPropertiesModel)5 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)5 AbstractAuditModel (com.sun.identity.console.audit.model.AbstractAuditModel)4 FSAuthDomainsModel (com.sun.identity.console.federation.model.FSAuthDomainsModel)4