Search in sources :

Example 1 with SubConfigPropertyXMLBuilder

use of com.sun.identity.console.property.SubConfigPropertyXMLBuilder in project OpenAM by OpenRock.

the class SubConfigModelImpl method getEditConfigPropertyXML.

/** 
     * Returns property sheet XML for editing sub configuration.
     *
     * @param viewbeanClassName Class name of view bean.
     * @return property sheet XML for editing sub configuration.
     */
public String getEditConfigPropertyXML(String viewbeanClassName) throws AMConsoleException {
    DelegationConfig dConfig = DelegationConfig.getInstance();
    boolean canModify = dConfig.hasPermission("/", null, AMAdminConstants.PERMISSION_MODIFY, getUserSSOToken(), viewbeanClassName);
    try {
        xmlBuilder = new SubConfigPropertyXMLBuilder(serviceName, subConfigMeta.getServiceSchema(), this);
        xmlBuilder.setSupportSubConfig(subConfigMeta.hasGlobalSubSchema());
        xmlBuilder.setViewBeanName("SubConfigEdit");
        if (!canModify) {
            xmlBuilder.setAllAttributeReadOnly(true);
        }
        return xmlBuilder.getXML();
    } catch (SMSException e) {
        throw new AMConsoleException(getErrorString(e));
    } catch (SSOException e) {
        throw new AMConsoleException(getErrorString(e));
    }
}
Also used : SMSException(com.sun.identity.sm.SMSException) SubConfigPropertyXMLBuilder(com.sun.identity.console.property.SubConfigPropertyXMLBuilder) DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig) SSOException(com.iplanet.sso.SSOException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 2 with SubConfigPropertyXMLBuilder

use of com.sun.identity.console.property.SubConfigPropertyXMLBuilder in project OpenAM by OpenRock.

the class SubConfigModelImpl method getAddConfigPropertyXML.

/** 
     * Returns property sheet XML for adding new sub configuration.
     *
     * @param name Name of Schema.
     * @return property sheet XML for adding new sub configuration.
     */
public String getAddConfigPropertyXML(String name) throws AMConsoleException {
    try {
        xmlBuilder = new SubConfigPropertyXMLBuilder(serviceName, subConfigMeta.getServiceSchema(name), this);
        String xml = xmlBuilder.getXML();
        String attributeNameXML = (getSelectableSubConfigNamesPlugin(name) != null) ? AMAdminUtils.getStringFromInputStream(getClass().getClassLoader().getResourceAsStream("com/sun/identity/console/propertySubConfigSelectableName.xml")) : AMAdminUtils.getStringFromInputStream(getClass().getClassLoader().getResourceAsStream("com/sun/identity/console/propertySubConfigName.xml"));
        xml = SubConfigPropertyXMLBuilder.prependXMLProperty(xml, attributeNameXML);
        return xml;
    } catch (SMSException e) {
        throw new AMConsoleException(getErrorString(e));
    } catch (SSOException e) {
        throw new AMConsoleException(getErrorString(e));
    }
}
Also used : SMSException(com.sun.identity.sm.SMSException) SubConfigPropertyXMLBuilder(com.sun.identity.console.property.SubConfigPropertyXMLBuilder) SSOException(com.iplanet.sso.SSOException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Aggregations

SSOException (com.iplanet.sso.SSOException)2 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)2 SubConfigPropertyXMLBuilder (com.sun.identity.console.property.SubConfigPropertyXMLBuilder)2 SMSException (com.sun.identity.sm.SMSException)2 DelegationConfig (com.sun.identity.console.delegation.model.DelegationConfig)1