use of com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView in project midpoint by Evolveum.
the class ExportDashboardActivitySupport method setupCompiledViewsForWidgets.
private void setupCompiledViewsForWidgets(OperationResult result) throws CommonException {
mapOfCompiledViews = new LinkedHashMap<>();
List<DashboardWidgetType> widgets = dashboard.getWidget();
for (DashboardWidgetType widget : widgets) {
if (isWidgetTableVisible()) {
CompiledObjectCollectionView compiledView = reportService.createCompiledView(report.getDashboard(), widget, runningTask, result);
DisplayType newDisplay = widget.getDisplay();
if (compiledView.getDisplay() == null) {
compiledView.setDisplay(newDisplay);
} else if (newDisplay != null) {
MiscSchemaUtil.mergeDisplay(compiledView.getDisplay(), newDisplay);
}
compiledView.setViewIdentifier(widget.getIdentifier());
mapOfCompiledViews.put(widget.getIdentifier(), compiledView);
}
}
}
use of com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView in project midpoint by Evolveum.
the class MultifunctionalButton method initLayout.
private void initLayout() {
AjaxCompositedIconButton mainButton = new AjaxCompositedIconButton(ID_MAIN_BUTTON, new PropertyModel<>(getModel(), MultiFunctinalButtonDto.F_MAIN_BUTTON)) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
if (!additionalButtonsExist()) {
buttonClickPerformed(target, null, null);
}
}
};
mainButton.add(AttributeAppender.append(" data-toggle", additionalButtonsExist() ? "dropdown" : ""));
// if (!additionalButtonsExist()) {
mainButton.add(new VisibleBehaviour(this::isMainButtonVisible));
// }
add(mainButton);
MultiCompositedButtonPanel buttonsPanel = new MultiCompositedButtonPanel(ID_BUTTON, new PropertyModel<>(getModel(), MultiFunctinalButtonDto.F_ADDITIONAL_BUTTONS)) {
private static final long serialVersionUID = 1L;
@Override
protected void buttonClickPerformed(AjaxRequestTarget target, AssignmentObjectRelation relationSpec, CompiledObjectCollectionView collectionViews, Class<? extends WebPage> page) {
MultifunctionalButton.this.buttonClickPerformed(target, relationSpec, collectionViews);
}
};
buttonsPanel.setOutputMarkupId(true);
buttonsPanel.add(new VisibleBehaviour(this::additionalButtonsExist));
add(buttonsPanel);
}
use of com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView in project midpoint by Evolveum.
the class TaskTablePanel method getNewTaskInfluencesList.
private List<CompiledObjectCollectionView> getNewTaskInfluencesList(List<String> oids) {
List<CompiledObjectCollectionView> compiledObjectCollectionViews = getPageBase().getCompiledGuiProfile().findAllApplicableArchetypeViews(TaskType.COMPLEX_TYPE, OperationTypeType.ADD);
List<CompiledObjectCollectionView> filteredObjectCollectionViews = new ArrayList<>();
for (CompiledObjectCollectionView compiledObjectCollectionView : compiledObjectCollectionViews) {
for (String oid : oids) {
if (isViewForObjectCollectionType(compiledObjectCollectionView, oid, ArchetypeType.COMPLEX_TYPE)) {
filteredObjectCollectionViews.add(compiledObjectCollectionView);
}
}
}
return filteredObjectCollectionViews;
}
use of com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView in project midpoint by Evolveum.
the class ReportServiceImpl method createCompiledView.
public CompiledObjectCollectionView createCompiledView(DashboardReportEngineConfigurationType dashboardConfig, DashboardWidgetType widget, Task task, OperationResult result) throws CommonException {
MiscUtil.stateCheck(dashboardConfig != null, "Dashboard engine in report couldn't be null.");
DashboardWidgetPresentationType presentation = widget.getPresentation();
MiscUtil.stateCheck(!DashboardUtils.isDataFieldsOfPresentationNullOrEmpty(presentation), "DataField of presentation couldn't be null.");
DashboardWidgetSourceTypeType sourceType = DashboardUtils.getSourceType(widget);
MiscUtil.stateCheck(sourceType != null, "No source type specified in " + widget);
CompiledObjectCollectionView compiledCollection = new CompiledObjectCollectionView();
if (widget.getPresentation() != null && widget.getPresentation().getView() != null) {
getModelInteractionService().applyView(compiledCollection, widget.getPresentation().getView());
}
CollectionRefSpecificationType collectionRefSpecification = getDashboardService().getCollectionRefSpecificationType(widget, task, result);
if (collectionRefSpecification != null) {
@NotNull CompiledObjectCollectionView compiledCollectionRefSpec = getModelInteractionService().compileObjectCollectionView(collectionRefSpecification, compiledCollection.getTargetClass(prismContext), task, result);
getModelInteractionService().applyView(compiledCollectionRefSpec, compiledCollection.toGuiObjectListViewType());
compiledCollection = compiledCollectionRefSpec;
}
GuiObjectListViewType reportView = getReportViewByType(dashboardConfig, ObjectUtils.defaultIfNull(compiledCollection.getContainerType(), ObjectType.COMPLEX_TYPE));
if (reportView != null) {
getModelInteractionService().applyView(compiledCollection, reportView);
}
if (compiledCollection.getColumns().isEmpty()) {
Class<Containerable> type = resolveTypeForReport(compiledCollection);
getModelInteractionService().applyView(compiledCollection, DefaultColumnUtils.getDefaultView(ObjectUtils.defaultIfNull(type, ObjectType.class)));
}
return compiledCollection;
}
use of com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView in project midpoint by Evolveum.
the class DefaultGuiConfigurationCompiler method compileDefaultCollectionViews.
private List<CompiledObjectCollectionView> compileDefaultCollectionViews(Collection<Class<?>> classes) {
List<CompiledObjectCollectionView> compiledObjectCollectionViews = new ArrayList<>();
for (Class<?> clazz : classes) {
CollectionInstance collectionInstance = clazz.getAnnotation(CollectionInstance.class);
if (collectionInstance == null) {
continue;
}
ObjectTypes objectType = ObjectTypes.getObjectType(collectionInstance.applicableForType());
CompiledObjectCollectionView defaultCollectionView = new CompiledObjectCollectionView(objectType.getTypeQName(), collectionInstance.identifier());
defaultCollectionView.setDisplay(createDisplayType(collectionInstance.display()));
compiledObjectCollectionViews.add(defaultCollectionView);
defaultCollectionView.setDefaultView(true);
if (collectionInstance.applicableForOperation().length == 1) {
defaultCollectionView.setApplicableForOperation(collectionInstance.applicableForOperation()[0]);
}
}
return compiledObjectCollectionViews;
}
Aggregations