use of com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType in project midpoint by Evolveum.
the class PerfTestPrismObjectSize method replaceDelta.
@Test(dataProvider = "combinations")
public void replaceDelta(ContainerTestParams config) throws SchemaException {
for (int maxOps : DELTA_OP_COUNT) {
int opCount = Math.min(config.count, maxOps);
measureDelta(config, monitorName("replace", config.monitorId(), Integer.toString(opCount)), assignments -> {
DeltaBuilder<UserType> delta = new DeltaBuilder<>(UserType.class, getPrismContext());
for (int i = assignments.size() - opCount; i < assignments.size(); i++) {
AssignmentType assignment = assignments.get(i).clone();
assignment.description("Modified");
delta = (DeltaBuilder<UserType>) delta.item(UserType.F_ASSIGNMENT).replace(assignment.asPrismContainerValue());
}
return delta.asObjectDelta("");
});
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType in project midpoint by Evolveum.
the class TestDeltaPerfComparison method randomAssigment.
private AssignmentType randomAssigment() {
AssignmentType assigment = new AssignmentType();
ObjectReferenceType target = new ObjectReferenceType();
target.setOid(newUuid());
target.setRelation(new QName("default"));
assigment.setTargetRef(target);
return assigment;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType in project midpoint by Evolveum.
the class AssignmentListProvider method postProcessWrapper.
@Override
protected void postProcessWrapper(PrismContainerValueWrapper<AssignmentType> valueWrapper) {
AssignmentType assignmentType = valueWrapper.getRealValue();
if (assignmentType == null) {
return;
}
ObjectReferenceType targetRef = assignmentType.getTargetRef();
if (targetRef == null || targetRef.getOid() == null || targetRef.getObject() != null) {
return;
}
PrismObject<? extends ObjectType> object = WebModelServiceUtils.loadObject(targetRef, getPageBase());
targetRef.asReferenceValue().setObject(object);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType in project midpoint by Evolveum.
the class PageAdminAbstractRole method loadInducements.
// TODO unify with loadAssignments
private List<AssignmentEditorDto> loadInducements() {
List<AssignmentEditorDto> list = new ArrayList<AssignmentEditorDto>();
ObjectWrapper focusWrapper = getObjectWrapper();
PrismObject<T> focus = focusWrapper.getObject();
List<AssignmentType> inducements = focus.asObjectable().getInducement();
for (AssignmentType inducement : inducements) {
list.add(new AssignmentEditorDto(UserDtoStatus.MODIFY, inducement, this));
}
Collections.sort(list);
return list;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType in project midpoint by Evolveum.
the class AbstractRoleMemberPanel method initObjectForAdd.
// TODO: merge this with TreeTablePanel.initObjectForAdd, also see MID-3233
private void initObjectForAdd(ObjectReferenceType parentOrgRef, QName type, QName relation, AjaxRequestTarget target) throws SchemaException {
getPageBase().hideMainPopup(target);
PrismContext prismContext = getPageBase().getPrismContext();
PrismObjectDefinition def = prismContext.getSchemaRegistry().findObjectDefinitionByType(type);
PrismObject obj = def.instantiate();
if (parentOrgRef == null) {
parentOrgRef = createReference(relation);
}
ObjectType objType = (ObjectType) obj.asObjectable();
if (FocusType.class.isAssignableFrom(obj.getCompileTimeClass())) {
AssignmentType assignment = new AssignmentType();
assignment.setTargetRef(parentOrgRef);
((FocusType) objType).getAssignment().add(assignment);
}
// TODO: fix MID-3234
if (parentOrgRef.getType() != null && OrgType.COMPLEX_TYPE.equals(parentOrgRef.getType())) {
objType.getParentOrgRef().add(parentOrgRef.clone());
}
WebComponentUtil.dispatchToObjectDetailsPage(obj, this);
}
Aggregations