Search in sources :

Example 36 with AMPropertySheetModel

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

the class ConditionOpViewBeanBase method createPropertyModel.

private boolean createPropertyModel() {
    boolean init = false;
    HttpServletRequest req = RequestManager.getRequestContext().getRequest();
    String condType = (String) getPageSessionAttribute(PG_SESSION_CONDITION_TYPE);
    if ((condType == null) || (condType.trim().length() == 0)) {
        condType = req.getParameter(getName() + "." + CONDITION_TYPE);
        if ((condType != null) && (condType.trim().length() > 0)) {
            setPageSessionAttribute(PG_SESSION_CONDITION_TYPE, condType);
        }
    }
    String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    if ((curRealm == null) || (curRealm.trim().length() == 0)) {
        curRealm = req.getParameter(getName() + "." + REALM_NAME);
        if ((curRealm == null) || (curRealm.trim().length() == 0)) {
            setPageSessionAttribute(AMAdminConstants.CURRENT_REALM, curRealm);
        } else {
            realmName = curRealm;
        }
    } else {
        realmName = curRealm;
    }
    init = (curRealm != null) && (curRealm.trim().length() > 0) && (condType != null) && (condType.trim().length() > 0);
    if (init) {
        DelegationConfig dConfig = DelegationConfig.getInstance();
        canModify = dConfig.hasPermission(realmName, null, AMAdminConstants.PERMISSION_MODIFY, getModel(), getClass().getName());
        propertySheetModel = new AMPropertySheetModel(getConditionXML(curRealm, condType, !canModify));
        propertySheetModel.clear();
        if (canModify) {
            addRemoveModel = new CCAddRemoveModel();
            addRemoveModel.setShowMoveUpDownButtons("false");
            addRemoveModel.clear();
            propertySheetModel.setModel(VALUES_MULTIPLE_CHOICE_VALUE, addRemoveModel);
        }
    }
    return init;
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig)

Example 37 with AMPropertySheetModel

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

the class RealmDiscoveryDescriptionEditViewBean method createPropertyModel.

protected void createPropertyModel() {
    DelegationConfig dConfig = DelegationConfig.getInstance();
    boolean canModify = dConfig.hasPermission("/", null, AMAdminConstants.PERMISSION_MODIFY, getRequestContext().getRequest(), getClass().getName());
    String xmlFile = (canModify) ? "com/sun/identity/console/propertySMDiscoveryDescription.xml" : "com/sun/identity/console/propertySMDiscoveryDescription_Readonly.xml";
    propertySheetModel = new AMPropertySheetModel(getClass().getClassLoader().getResourceAsStream(xmlFile));
    propertySheetModel.clear();
}
Also used : AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig)

Example 38 with AMPropertySheetModel

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

the class RealmPropertiesViewBean method createPropertyModel.

private void createPropertyModel(String realmName) {
    RMRealmModel model = (RMRealmModel) getModel();
    try {
        psModel = new AMPropertySheetModel(model.getRealmProfilePropertyXML(realmName, getClass().getName()));
        psModel.clear();
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
Also used : AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) RMRealmModel(com.sun.identity.console.realm.model.RMRealmModel)

Example 39 with AMPropertySheetModel

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

the class SoapSTSAddViewBean method createPropertyModel.

/*
     This method is called from the AMServiceProfileViewBeanBase ctor, so the xml file location cannot be passed to the
     super ctor, as this field is not initialized until after the super ctor is called. So this method must be over-ridden
     here.
     */
@Override
protected void createPropertyModel() {
    String xml = AMAdminUtils.getStringFromInputStream(getClass().getClassLoader().getResourceAsStream(PROPERTY_MODEL_XML_FILE_LOCATION));
    propertySheetModel = new AMPropertySheetModel(xml);
    propertySheetModel.clear();
}
Also used : AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel)

Example 40 with AMPropertySheetModel

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

the class RestSTSAddViewBean method createPropertyModel.

/*
    This method is called from the AMServiceProfileViewBeanBase ctor, so the xml file location cannot be passed to the
    super ctor, as this field is not initialized until after the super ctor is called. So this method must be over-ridden
    here.
    */
@Override
protected void createPropertyModel() {
    String xml = AMAdminUtils.getStringFromInputStream(getClass().getClassLoader().getResourceAsStream(PROPERTY_MODEL_XML_FILE_LOCATION));
    propertySheetModel = new AMPropertySheetModel(xml);
    propertySheetModel.clear();
}
Also used : AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel)

Aggregations

AMPropertySheetModel (com.sun.identity.console.base.model.AMPropertySheetModel)146 DelegationConfig (com.sun.identity.console.delegation.model.DelegationConfig)32 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)16 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)9 InputStream (java.io.InputStream)8 HashSet (java.util.HashSet)7 Set (java.util.Set)7 Iterator (java.util.Iterator)5 HashMap (java.util.HashMap)4 Map (java.util.Map)4 HttpServletRequest (javax.servlet.http.HttpServletRequest)4 CCEditableListModel (com.sun.web.ui.model.CCEditableListModel)3 List (java.util.List)3 ViewBean (com.iplanet.jato.view.ViewBean)2 AgentsModel (com.sun.identity.console.agentconfig.model.AgentsModel)2 AbstractAuditModel (com.sun.identity.console.audit.model.AbstractAuditModel)2 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)2 RMRealmModel (com.sun.identity.console.realm.model.RMRealmModel)2 SubConfigModel (com.sun.identity.console.service.model.SubConfigModel)2 CCOrderedListModel (com.sun.identity.console.ui.model.CCOrderedListModel)2