use of com.sun.identity.console.property.PropertyXMLBuilder in project OpenAM by OpenRock.
the class MAPDeviceProfileModelImpl method getProfilePropertyXML.
/**
* Returns the property XML for profile view.
*
* @param clientType Client Type.
* @param classification Device attribute classification.
* @throws AMConsoleException if there are no attribute to display.
* @return the property XML for profile view.
*/
public String getProfilePropertyXML(String clientType, String classification) throws AMConsoleException {
String xml = "";
Set attributeNames = getAttributeNames(clientType, classification);
Set attributeSchemas = getAttributeSchemas(attributeNames);
try {
PropertyXMLBuilder builder = new PropertyXMLBuilder(mapServiceName, this, attributeSchemas);
xml = builder.getXML(getReadOnlyAttributeNames(clientType, attributeNames));
} catch (SMSException e) {
throw new AMConsoleException(getErrorString(e));
} catch (SSOException e) {
throw new AMConsoleException(getErrorString(e));
}
return xml;
}
use of com.sun.identity.console.property.PropertyXMLBuilder in project OpenAM by OpenRock.
the class EntitiesModelImpl method getServicePropertySheetXML.
/**
* Returns the XML for property sheet view component.
*
* @param realmName Name of Realm.
* @param serviceName Name of service.
* @param idType type of Identity.
* @param bCreate true if the property sheet is for identity creation.
* @param viewbeanClassName Class Name of View Bean.
* @return the XML for property sheet view component.
* @throws AMConsoleException if XML cannot be created.
*/
public String getServicePropertySheetXML(String realmName, String serviceName, IdType idType, boolean bCreate, String viewbeanClassName) throws AMConsoleException {
setLocationDN(realmName);
DelegationConfig dConfig = DelegationConfig.getInstance();
try {
ServiceSchema serviceSchema = AMAdminUtils.getSchemaSchema(serviceName, idType);
Set set = new HashSet(2);
set.add(serviceSchema.getServiceType());
PropertyXMLBuilder xmlBuilder = new PropertyXMLBuilder(serviceName, set, this);
if (!bCreate) {
boolean canModify = dConfig.hasPermission(realmName, serviceName, AMAdminConstants.PERMISSION_MODIFY, this, viewbeanClassName);
if (!canModify) {
xmlBuilder.setAllAttributeReadOnly(true);
}
}
String xml = xmlBuilder.getXML();
if (idType.equals(IdType.ROLE)) {
String cosPriority = AMAdminUtils.getStringFromInputStream(getClass().getClassLoader().getResourceAsStream("com/sun/identity/console/propertyEntitiesCOSPriority.xml"));
if (xml != null) {
xml = PropertyXMLBuilder.appendXMLProperty(xml, cosPriority);
} else {
xml = PropertyXMLBuilder.formPropertySheetXML(cosPriority, true);
}
}
return xml;
} catch (SMSException e) {
throw new AMConsoleException(getErrorString(e));
} catch (SSOException e) {
throw new AMConsoleException(getErrorString(e));
}
}
Aggregations