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));
}
}
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));
}
}
Aggregations