use of com.evolveum.midpoint.web.page.admin.dto.ObjectViewDto in project midpoint by Evolveum.
the class PageDebugList method loadResources.
private List<ObjectViewDto> loadResources() {
List<ObjectViewDto> objects = new ArrayList<>();
try {
OperationResult result = new OperationResult(OPERATION_LOAD_RESOURCES);
List<PrismObject<ResourceType>> list = WebModelServiceUtils.searchObjects(ResourceType.class, null, SelectorOptions.createCollection(GetOperationOptions.createRaw()), result, this, null);
for (PrismObject obj : list) {
ObjectViewDto dto = new ObjectViewDto(obj.getOid(), WebComponentUtil.getName(obj));
objects.add(dto);
}
} catch (Exception ex) {
// todo implement error handling
}
Collections.sort(objects, (o1, o2) -> String.CASE_INSENSITIVE_ORDER.compare(o1.getName(), o2.getName()));
return objects;
}
use of com.evolveum.midpoint.web.page.admin.dto.ObjectViewDto in project midpoint by Evolveum.
the class SystemConfigPanel method initLayout.
protected void initLayout() {
ChooseTypePanel<ValuePolicyType> passPolicyChoosePanel = new ChooseTypePanel<ValuePolicyType>(ID_GLOBAL_PASSWORD_POLICY_CHOOSER, new PropertyModel<ObjectViewDto<ValuePolicyType>>(getModel(), SystemConfigurationDto.F_PASSWORD_POLICY));
ChooseTypePanel<SecurityPolicyType> securityPolicyChoosePanel = new ChooseTypePanel<SecurityPolicyType>(ID_GLOBAL_SECURITY_POLICY_CHOOSER, new PropertyModel<ObjectViewDto<SecurityPolicyType>>(getModel(), SystemConfigurationDto.F_SECURITY_POLICY));
add(passPolicyChoosePanel);
add(securityPolicyChoosePanel);
ObjectPolicyConfigurationEditor objectPolicyEditor = new ObjectPolicyConfigurationEditor(ID_OBJECT_POLICY_EDITOR, new PropertyModel<List<ObjectPolicyConfigurationTypeDto>>(getModel(), SystemConfigurationDto.F_OBJECT_POLICY_LIST));
add(objectPolicyEditor);
DropDownChoice<AEPlevel> aepLevel = new DropDownChoice<>(ID_GLOBAL_AEP, new PropertyModel<AEPlevel>(getModel(), SystemConfigurationDto.F_AEP_LEVEL), WebComponentUtil.createReadonlyModelFromEnum(AEPlevel.class), new EnumChoiceRenderer<AEPlevel>(SystemConfigPanel.this));
aepLevel.setOutputMarkupId(true);
if (aepLevel.getModel().getObject() == null) {
aepLevel.getModel().setObject(null);
}
aepLevel.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
add(aepLevel);
TextField<String> auditRecordsField = WebComponentUtil.createAjaxTextField(ID_CLEANUP_AUDIT_RECORDS, new PropertyModel<String>(getModel(), SystemConfigurationDto.F_AUDIT_CLEANUP));
TextField<String> closedTasksField = WebComponentUtil.createAjaxTextField(ID_CLEANUP_CLOSED_TASKS, new PropertyModel<String>(getModel(), SystemConfigurationDto.F_TASK_CLEANUP));
add(auditRecordsField);
add(closedTasksField);
createTooltip(ID_CLEANUP_AUDIT_RECORDS_TOOLTIP);
createTooltip(ID_CLEANUP_CLOSED_TASKS_TOOLTIP);
CheckBox experimentalCodeCheck = WebComponentUtil.createAjaxCheckBox(ID_EXPERIMENTAL_CODE_CHECKBOX, new PropertyModel<Boolean>(getModel(), SystemConfigurationDto.F_ENABLE_EXPERIMENTAL_CODE));
add(experimentalCodeCheck);
}
use of com.evolveum.midpoint.web.page.admin.dto.ObjectViewDto in project midpoint by Evolveum.
the class AssignmentEditorDto method loadTenantOrgReference.
private ObjectViewDto loadTenantOrgReference(AssignmentType assignment, ObjectReferenceType ref) {
ObjectViewDto dto = null;
if (isRole(assignment)) {
if (ref != null) {
Task task = pageBase.createSimpleTask("Load tenant for assignment");
OperationResult result = task.getResult();
PrismObject<OrgType> tenant = WebModelServiceUtils.loadObject(OrgType.class, ref.getOid(), pageBase, task, result);
if (tenant != null) {
dto = new ObjectViewDto(ref.getOid(), WebComponentUtil.getEffectiveName(tenant, OrgType.F_DISPLAY_NAME));
dto.setType(OrgType.class);
} else if (ref.getTargetName() == null) {
dto = new ObjectViewDto(ObjectViewDto.BAD_OID);
dto.setType(OrgType.class);
}
return dto;
}
}
dto = new ObjectViewDto();
dto.setType(OrgType.class);
return dto;
}
use of com.evolveum.midpoint.web.page.admin.dto.ObjectViewDto in project midpoint by Evolveum.
the class AssignmentEditorPanel method createOrgContainer.
private WebMarkupContainer createOrgContainer() {
WebMarkupContainer tenantRefContainer = new WebMarkupContainer(ID_CONTAINER_ORG_REF);
ChooseTypePanel tenantRef = new ChooseTypePanel(ID_ORG_CHOOSER, new PropertyModel<ObjectViewDto>(getModel(), AssignmentEditorDto.F_ORG_REF)) {
@Override
protected ObjectQuery getChooseQuery() {
return QueryBuilder.queryFor(OrgType.class, getPageBase().getPrismContext()).item(OrgType.F_TENANT).eq(false).or().item(OrgType.F_TENANT).isNull().build();
}
@Override
protected boolean isSearchEnabled() {
return true;
}
@Override
protected QName getSearchProperty() {
return OrgType.F_NAME;
}
};
tenantRefContainer.add(tenantRef);
tenantRef.setEnabled(getModel().getObject().isEditable());
tenantRefContainer.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
AssignmentEditorDto dto = getModel().getObject();
if (dto != null) {
if (AssignmentEditorDtoType.ROLE.equals(dto.getType())) {
return true;
}
}
return false;
}
});
return tenantRefContainer;
}
use of com.evolveum.midpoint.web.page.admin.dto.ObjectViewDto in project midpoint by Evolveum.
the class AssignmentEditorPanel method createTenantContainer.
private WebMarkupContainer createTenantContainer() {
WebMarkupContainer tenantRefContainer = new WebMarkupContainer(ID_CONTAINER_TENANT_REF);
ChooseTypePanel tenantRef = new ChooseTypePanel(ID_TENANT_CHOOSER, new PropertyModel<ObjectViewDto>(getModel(), AssignmentEditorDto.F_TENANT_REF)) {
@Override
protected ObjectQuery getChooseQuery() {
return QueryBuilder.queryFor(OrgType.class, getPageBase().getPrismContext()).item(OrgType.F_TENANT).eq(true).build();
}
@Override
protected boolean isSearchEnabled() {
return true;
}
@Override
protected QName getSearchProperty() {
return OrgType.F_NAME;
}
};
tenantRef.setPanelEnabled(getModel().getObject().isEditable());
tenantRefContainer.add(tenantRef);
tenantRefContainer.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
AssignmentEditorDto dto = getModel().getObject();
if (dto != null) {
if (AssignmentEditorDtoType.ROLE.equals(dto.getType())) {
return true;
}
}
return false;
}
});
return tenantRefContainer;
}
Aggregations