use of com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView in project midpoint by Evolveum.
the class ContainerableListPanel method getAutoRefreshInterval.
protected int getAutoRefreshInterval() {
if (isCollectionViewPanel()) {
CompiledObjectCollectionView view = getObjectCollectionView();
if (view == null) {
return 0;
}
Integer autoRefreshInterval = view.getRefreshInterval();
return Objects.requireNonNullElse(autoRefreshInterval, 0);
}
return 0;
}
use of com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView in project midpoint by Evolveum.
the class ContainerableListPanel method getCompiledCollectionViewFromPanelConfiguration.
private CompiledObjectCollectionView getCompiledCollectionViewFromPanelConfiguration() {
if (compiledCollectionViewFromPanelConfiguration != null) {
return compiledCollectionViewFromPanelConfiguration;
}
if (config == null) {
return null;
}
GuiObjectListViewType listViewType = config.getListView();
if (listViewType == null) {
return null;
}
Task task = getPageBase().createSimpleTask("Compile collection");
OperationResult result = task.getResult();
try {
compiledCollectionViewFromPanelConfiguration = new CompiledObjectCollectionView();
getPageBase().getModelInteractionService().compileView(compiledCollectionViewFromPanelConfiguration, listViewType, task, result);
} catch (Throwable e) {
LOGGER.error("Cannot compile object collection view for panel configuration {}. Reason: {}", config, e.getMessage(), e);
result.recordFatalError("Cannot compile object collection view for panel configuration " + config + ". Reason: " + e.getMessage(), e);
getPageBase().showResult(result);
}
return compiledCollectionViewFromPanelConfiguration;
}
use of com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView in project midpoint by Evolveum.
the class Search method getArchetypeQuery.
private ObjectQuery getArchetypeQuery(PageBase pageBase) {
if (getCollectionSearchItem() == null || getCollectionSearchItem().getObjectCollectionView() == null) {
return null;
}
CompiledObjectCollectionView view = getCollectionSearchItem().getObjectCollectionView();
if (view.getFilter() == null) {
return null;
}
ObjectQuery query = pageBase.getPrismContext().queryFor(getTypeClass()).build();
OperationResult result = new OperationResult("evaluate filter");
query.addFilter(WebComponentUtil.evaluateExpressionsInFilter(view.getFilter(), result, pageBase));
return query;
}
use of com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView in project midpoint by Evolveum.
the class AssignmentPopup method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
Form form = new Form(ID_FORM);
form.setOutputMarkupId(true);
add(form);
MultiCompositedButtonPanel newObjectIcon = new MultiCompositedButtonPanel(ID_COMPOSITED_BUTTONS, createNewButtonDescriptionModel()) {
@Override
protected void buttonClickPerformed(AjaxRequestTarget target, AssignmentObjectRelation relationSpec, CompiledObjectCollectionView collectionViews, Class<? extends WebPage> page) {
Form form = (Form) AssignmentPopup.this.get(ID_FORM);
AssignmentPopup.this.getModelObject().setSelectionVisible(false);
addOrReplaceTabPanels(form, relationSpec);
target.add(form);
}
};
form.add(newObjectIcon);
newObjectIcon.add(new VisibleBehaviour(() -> getModelObject() != null && getModelObject().isSelectionVisible()));
addOrReplaceTabPanels(form, null);
MessagePanel warningMessage = new MessagePanel(ID_WARNING_MESSAGE, MessagePanel.MessagePanelType.WARN, getWarningMessageModel());
warningMessage.setOutputMarkupId(true);
warningMessage.add(new VisibleBehaviour(() -> getWarningMessageModel() != null));
add(warningMessage);
form.add(createCancelButton());
form.add(createAddButton());
form.add(createBackButton());
}
use of com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView in project midpoint by Evolveum.
the class NewObjectCreationPopup method initLayout.
private void initLayout() {
MultiCompositedButtonPanel buttonPanel = new MultiCompositedButtonPanel(ID_NEW_OBJECT_SELECTION_BUTTON_PANEL, getModel()) {
private static final long serialVersionUID = 1L;
@Override
protected void buttonClickPerformed(AjaxRequestTarget target, AssignmentObjectRelation relationSpec, CompiledObjectCollectionView collectionViews, Class<? extends WebPage> page) {
NewObjectCreationPopup.this.buttonClickPerformed(target, relationSpec, collectionViews, page);
}
};
buttonPanel.setOutputMarkupId(true);
add(buttonPanel);
AjaxButton cancel = new AjaxButton(ID_BUTTON_CANCEL, createStringResource("PageBase.button.cancel")) {
@Override
public void onClick(AjaxRequestTarget target) {
cancelPerformed(target);
}
};
add(cancel);
}
Aggregations