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