Search in sources :

Example 21 with DelegationConfig

use of com.sun.identity.console.delegation.model.DelegationConfig in project OpenAM by OpenRock.

the class IDRepoModelImpl method getPropertyXMLString.

/**
     * Returns property sheet XML for ID Repo Profile.
     *
     * @param realmName Name of Realm.
     * @param viewbeanClassName Class Name of View Bean.
     * @param type Type of ID Repo.
     * @param bCreate <code>true</code> for creation operation.
     * @return property sheet XML for ID Repo Profile.
     */
public String getPropertyXMLString(String realmName, String viewbeanClassName, String type, boolean bCreate) throws AMConsoleException {
    try {
        ServiceSchemaManager schemaMgr = new ServiceSchemaManager(IdConstants.REPO_SERVICE, getUserSSOToken());
        ServiceSchema orgSchema = schemaMgr.getOrganizationSchema();
        ServiceSchema ss = orgSchema.getSubSchema(type);
        DelegationConfig dConfig = DelegationConfig.getInstance();
        boolean canModify = dConfig.hasPermission(realmName, null, AMAdminConstants.PERMISSION_MODIFY, this, viewbeanClassName);
        Set attributeSchemas = ss.getAttributeSchemas();
        PropertyXMLBuilder.removeAttributeSchemaWithoutI18nKey(attributeSchemas);
        PropertyXMLBuilder builder = new PropertyXMLBuilder(IdConstants.REPO_SERVICE, this, attributeSchemas, SchemaType.ORGANIZATION);
        if (!bCreate && !canModify) {
            builder.setAllAttributeReadOnly(true);
        }
        String xml = builder.getXML();
        String xmlFile = (bCreate) ? "com/sun/identity/console/propertyRMIDRepoAdd.xml" : "com/sun/identity/console/propertyRMIDRepoEdit.xml";
        String header = AMAdminUtils.getStringFromInputStream(getClass().getClassLoader().getResourceAsStream(xmlFile));
        xml = PropertyXMLBuilder.prependXMLProperty(xml, header);
        return xml;
    } catch (SMSException e) {
        throw new AMConsoleException(getErrorString(e));
    } catch (SSOException e) {
        throw new AMConsoleException(getErrorString(e));
    }
}
Also used : ServiceSchema(com.sun.identity.sm.ServiceSchema) Set(java.util.Set) SMSException(com.sun.identity.sm.SMSException) DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig) SSOException(com.iplanet.sso.SSOException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) PropertyXMLBuilder(com.sun.identity.console.property.PropertyXMLBuilder) ServiceSchemaManager(com.sun.identity.sm.ServiceSchemaManager)

Example 22 with DelegationConfig

use of com.sun.identity.console.delegation.model.DelegationConfig in project OpenAM by OpenRock.

the class G11NSupportedCharsetsEditViewBean 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/propertyG11NSupportedCharsets.xml" : "com/sun/identity/console/propertyG11NSupportedCharsets_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 23 with DelegationConfig

use of com.sun.identity.console.delegation.model.DelegationConfig in project OpenAM by OpenRock.

the class G11NCharsetAliasEditViewBean 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/propertyG11NCharsetAlias.xml" : "com/sun/identity/console/propertyG11NCharsetAlias_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 24 with DelegationConfig

use of com.sun.identity.console.delegation.model.DelegationConfig in project OpenAM by OpenRock.

the class SubjectOpViewBeanBase method createPropertyModel.

protected void createPropertyModel(String realmName) {
    DelegationConfig dConfig = DelegationConfig.getInstance();
    canModify = dConfig.hasPermission(realmName, null, AMAdminConstants.PERMISSION_MODIFY, getModel(), getClass().getName());
    propertySheetModel = new AMPropertySheetModel(getClass().getClassLoader().getResourceAsStream(getPropertyXMLFileName(!canModify)));
    propertySheetModel.clear();
    if (canModify) {
        addRemoveModel = new CCAddRemoveModel();
        addRemoveModel.setShowMoveUpDownButtons("false");
        addRemoveModel.clear();
        propertySheetModel.setModel(VALUES_MULTIPLE_CHOICE_VALUE, addRemoveModel);
    }
}
Also used : CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig)

Example 25 with DelegationConfig

use of com.sun.identity.console.delegation.model.DelegationConfig in project OpenAM by OpenRock.

the class RealmResourceOfferingEditViewBean method createPropertyModel.

protected void createPropertyModel() {
    DelegationConfig dConfig = DelegationConfig.getInstance();
    canModify = dConfig.hasPermission("/", null, AMAdminConstants.PERMISSION_MODIFY, getRequestContext().getRequest(), getClass().getName());
    String xmlFile = (canModify) ? "com/sun/identity/console/propertyRealmResOffering.xml" : "com/sun/identity/console/propertyRealmResOffering_Readonly.xml";
    InputStream is = getClass().getClassLoader().getResourceAsStream(xmlFile);
    String xml = AMAdminUtils.getStringFromInputStream(is);
    propertySheetModel = new AMPropertySheetModel(processPropertiesXML(xml));
    propertySheetModel.clear();
    createSecurityMechIDTable();
}
Also used : InputStream(java.io.InputStream) AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig)

Aggregations

DelegationConfig (com.sun.identity.console.delegation.model.DelegationConfig)43 AMPropertySheetModel (com.sun.identity.console.base.model.AMPropertySheetModel)32 SSOException (com.iplanet.sso.SSOException)8 SMSException (com.sun.identity.sm.SMSException)8 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)7 PropertyXMLBuilder (com.sun.identity.console.property.PropertyXMLBuilder)4 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)4 InputStream (java.io.InputStream)4 ServiceSchema (com.sun.identity.sm.ServiceSchema)3 Set (java.util.Set)3 HashSet (java.util.HashSet)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 SAMLPropertyXMLBuilder (com.sun.identity.console.federation.SAMLPropertyXMLBuilder)1 EndUserViewBean (com.sun.identity.console.idm.EndUserViewBean)1 SubConfigPropertyXMLBuilder (com.sun.identity.console.property.SubConfigPropertyXMLBuilder)1 IdRepoException (com.sun.identity.idm.IdRepoException)1 ServiceSchemaManager (com.sun.identity.sm.ServiceSchemaManager)1 List (java.util.List)1