use of com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType in project midpoint by Evolveum.
the class DistributedReportExportActivitySupport method fetchGlobalReportDataRef.
@NotNull
private ObjectReferenceType fetchGlobalReportDataRef(OperationResult result) throws SchemaException, ObjectNotFoundException, ActivityRunException {
ActivityState activityState = ActivityState.getActivityStateUpwards(activity.getPath().allExceptLast(), runningTask, ReportExportWorkStateType.COMPLEX_TYPE, beans, result);
ObjectReferenceType globalReportDataRef = activityState.getWorkStateReferenceRealValue(F_REPORT_DATA_REF);
if (globalReportDataRef == null) {
throw new ActivityRunException("No global report data reference in " + activityState, FATAL_ERROR, PERMANENT_ERROR);
}
return globalReportDataRef;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType in project midpoint by Evolveum.
the class AbstractPopupTabPanel method initObjectListPanel.
protected Component initObjectListPanel() {
PopupObjectListPanel<O> listPanel = new PopupObjectListPanel<>(ID_OBJECT_LIST_PANEL, getObjectType().getClassDefinition(), true) {
private static final long serialVersionUID = 1L;
@Override
protected List<IColumn<SelectableBean<O>, String>> createDefaultColumns() {
if (AbstractRoleType.class.isAssignableFrom(getType())) {
return new ArrayList<>((Collection) ColumnUtils.getDefaultAbstractRoleColumns(false));
} else {
return super.createDefaultColumns();
}
}
@Override
protected void onUpdateCheckbox(AjaxRequestTarget target, IModel<SelectableBean<O>> rowModel) {
onSelectionPerformed(target, rowModel);
}
@Override
protected List<O> getPreselectedObjectList() {
return getPreselectedObjects();
}
@Override
protected IModel<Boolean> getCheckBoxEnableModel(IModel<SelectableBean<O>> rowModel) {
return getObjectSelectCheckBoxEnableModel(rowModel);
}
@Override
protected ObjectQuery getCustomizeContentQuery() {
ObjectQuery customQuery = AbstractPopupTabPanel.this.addFilterToContentQuery();
if (customQuery == null) {
customQuery = AbstractPopupTabPanel.this.getPageBase().getPrismContext().queryFactory().createQuery();
}
List<ObjectReferenceType> archetypeRefList = getArchetypeRefList();
if (!CollectionUtils.isEmpty(archetypeRefList)) {
List<ObjectFilter> archetypeRefFilterList = new ArrayList<>();
for (ObjectReferenceType archetypeRef : archetypeRefList) {
ObjectFilter filter = AbstractPopupTabPanel.this.getPageBase().getPrismContext().queryFor(AssignmentHolderType.class).item(AssignmentHolderType.F_ARCHETYPE_REF).ref(archetypeRef.getOid()).buildFilter();
((RefFilter) filter).setTargetTypeNullAsAny(true);
archetypeRefFilterList.add(filter);
}
if (!CollectionUtils.isEmpty(archetypeRefFilterList)) {
OrFilter archetypeRefOrFilter = AbstractPopupTabPanel.this.getPageBase().getPrismContext().queryFactory().createOr(archetypeRefFilterList);
customQuery.addFilter(archetypeRefOrFilter);
}
}
ObjectFilter subTypeFilter = getSubtypeFilter();
if (subTypeFilter != null) {
customQuery.addFilter(subTypeFilter);
}
return customQuery;
}
};
listPanel.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
public boolean isVisible() {
return isObjectListPanelVisible();
}
});
listPanel.setOutputMarkupId(true);
return listPanel;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType in project midpoint by Evolveum.
the class ReferenceConverter method convertToObject.
@Override
public ObjectReferenceType convertToObject(String value, Locale locale) throws ConversionException {
Class<ObjectType> type = getReferenceTargetObjectType();
ObjectQuery query = pageBase.getPrismContext().queryFor(type).item(ObjectType.F_NAME).eq(value).matchingNorm().build();
List<PrismObject<ObjectType>> objectsList = WebModelServiceUtils.searchObjects(type, query, new OperationResult("searchObjects"), pageBase);
if (CollectionUtils.isNotEmpty(objectsList)) {
if (objectsList.size() == 1) {
return ObjectTypeUtil.createObjectRefWithFullObject(objectsList.get(0), pageBase.getPrismContext());
}
pageBase.error("Couldn't specify one object by name '" + value + "' and type " + type.getSimpleName() + ". Please will try specific type of object.");
}
ObjectReferenceType ref = null;
if (isAllowedNotFoundObjectRef()) {
ref = new ObjectReferenceType();
ref.setTargetName(new PolyStringType(value));
if (baseComponent != null && baseComponent.getModelObject() instanceof ObjectReferenceType) {
if (((ObjectReferenceType) baseComponent.getModelObject()).getRelation() == null) {
ref.setRelation(pageBase.getPrismContext().getDefaultRelation());
} else {
ref.setRelation(((ObjectReferenceType) baseComponent.getModelObject()).getRelation());
}
ref.setType(WebComponentUtil.classToQName(PrismContext.get(), type));
}
}
return ref;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType in project midpoint by Evolveum.
the class MultiTypesMemberPopupTabPanel method prepareDelta.
@Override
protected ObjectDelta prepareDelta() {
Class classType = WebComponentUtil.qnameToClass(getPageBase().getPrismContext(), getObjectType().getTypeQName());
ObjectReferenceType ref = ObjectTypeUtil.createObjectRef(getAbstractRoleTypeObject(), getRelationValue());
return getPageBase().getPrismContext().deltaFactory().object().createModificationAddReference(classType, "fakeOid", ObjectType.F_PARENT_ORG_REF, ref.asReferenceValue());
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType in project midpoint by Evolveum.
the class FocusPersonasTabPanel method getPersonasOidsList.
private List<String> getPersonasOidsList() {
List<ObjectReferenceType> personasRefList = getObjectWrapper().getObject().asObjectable().getPersonaRef();
List<String> oidsList = new ArrayList<>();
if (personasRefList != null) {
for (ObjectReferenceType ref : personasRefList) {
oidsList.add(ref.getOid());
}
}
return oidsList;
}
Aggregations