use of eu.bcvsolutions.idm.ic.impl.IcObjectClassInfoImpl in project CzechIdMng by bcvsolutions.
the class ConnIdIcConvertUtil method convertConnIdObjectClassInfo.
public static IcObjectClassInfo convertConnIdObjectClassInfo(ObjectClassInfo objectClass) {
if (objectClass == null) {
return null;
}
IcObjectClassInfoImpl icObjectClass = new IcObjectClassInfoImpl();
Set<AttributeInfo> attributeInfos = objectClass.getAttributeInfo();
if (attributeInfos != null) {
for (AttributeInfo attributeInfo : attributeInfos) {
icObjectClass.getAttributeInfos().add(ConnIdIcConvertUtil.convertConnIdAttributeInfo(attributeInfo));
}
}
icObjectClass.setType(objectClass.getType());
icObjectClass.setContainer(objectClass.isContainer());
return icObjectClass;
}
use of eu.bcvsolutions.idm.ic.impl.IcObjectClassInfoImpl in project CzechIdMng by bcvsolutions.
the class BasicVirtualConnector method generateSchema.
/**
* Generate schema from connector configuration and form definition
*
* @return
*/
private IcSchemaImpl generateSchema() {
IcSchemaImpl schema = new IcSchemaImpl();
List<IcObjectClassInfo> objectClasses = schema.getDeclaredObjectClasses();
IcObjectClassInfoImpl objectClass = new IcObjectClassInfoImpl();
objectClass.setType(IcObjectClassInfo.ACCOUNT);
List<IcAttributeInfo> attributes = objectClass.getAttributeInfos();
// Create UID schema attribute
IcAttributeInfoImpl attributeUid = new IcAttributeInfoImpl();
attributeUid.setClassType(String.class.getName());
attributeUid.setCreateable(true);
attributeUid.setMultivalued(false);
attributeUid.setName(IcAttributeInfo.NAME);
attributeUid.setNativeName(VsAccount_.uid.getName());
attributeUid.setReadable(true);
attributeUid.setRequired(true);
attributeUid.setReturnedByDefault(true);
attributeUid.setUpdateable(true);
attributes.add(attributeUid);
// Create ENABLE schema attribute
if (this.virtualConfiguration.isDisableSupported()) {
IcAttributeInfoImpl attributeDisabled = new IcAttributeInfoImpl();
attributeDisabled.setClassType(Boolean.class.getName());
attributeDisabled.setCreateable(true);
attributeDisabled.setMultivalued(false);
attributeDisabled.setName(IcAttributeInfo.ENABLE);
attributeDisabled.setNativeName(VsAccount_.enable.getName());
attributeDisabled.setReadable(true);
attributeDisabled.setRequired(false);
attributeDisabled.setReturnedByDefault(true);
attributeDisabled.setUpdateable(true);
attributes.add(attributeDisabled);
}
// Attributes from definition and configuration
Arrays.asList(virtualConfiguration.getAttributes()).forEach(virtualAttirbute -> {
IdmFormAttributeDto formAttribute = formAttributeService.findAttribute(VsAccount.class.getName(), formDefinition.getCode(), virtualAttirbute);
if (formAttribute == null) {
return;
}
IcAttributeInfoImpl attribute = new IcAttributeInfoImpl();
String classType = this.convertToSchemaClassType(formAttribute.getPersistentType());
attribute.setClassType(classType);
attribute.setCreateable(!formAttribute.isReadonly());
attribute.setMultivalued(formAttribute.isMultiple());
attribute.setName(virtualAttirbute);
attribute.setNativeName(virtualAttirbute);
attribute.setReadable(true);
attribute.setRequired(formAttribute.isRequired());
attribute.setReturnedByDefault(true);
attribute.setUpdateable(!formAttribute.isReadonly());
attributes.add(attribute);
});
objectClasses.add(objectClass);
return schema;
}
Aggregations