use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.
the class PageAssignmentConflicts method initLayout.
private void initLayout() {
MidpointForm mainForm = new MidpointForm(ID_MAIN_FORM);
mainForm.setOutputMarkupId(true);
add(mainForm);
RepeatingView conflictsPanel = new RepeatingView(ID_CONFLICTS_PANEL);
conflictsPanel.setOutputMarkupId(true);
List<ConflictDto> conflicts = getSessionStorage().getRoleCatalog().getConflictsList();
for (ConflictDto dto : conflicts) {
AssignmentConflictPanel panel = new AssignmentConflictPanel(conflictsPanel.newChildId(), Model.of(dto));
conflictsPanel.add(panel);
}
mainForm.add(conflictsPanel);
AjaxSubmitButton back = new AjaxSubmitButton(ID_BACK, createStringResource("PageAssignmentConflicts.back")) {
@Override
public void onSubmit(AjaxRequestTarget target) {
redirectBack();
}
};
mainForm.add(back);
AjaxSubmitButton submit = new AjaxSubmitButton(ID_SUBMIT, createStringResource("PageAssignmentConflicts.submit")) {
@Override
public void onSubmit(AjaxRequestTarget target) {
processConflictDecisions();
redirectBack();
}
};
mainForm.add(submit);
}
use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.
the class PageAssignmentDetails method initLayout.
public void initLayout(final IModel<AssignmentEditorDto> assignmentModel) {
setOutputMarkupId(true);
MidpointForm mainForm = new MidpointForm(ID_FORM);
mainForm.setOutputMarkupId(true);
add(mainForm);
AssignmentDetailsPanel detailsPanel = new AssignmentDetailsPanel(ID_DETAILS_PANEL, assignmentModel);
detailsPanel.setOutputMarkupId(true);
mainForm.add(detailsPanel);
AjaxButton back = new AjaxButton(ID_BACK, createStringResource("PageAssignmentDetails.backButton")) {
@Override
public void onClick(AjaxRequestTarget target) {
redirectBack();
}
};
mainForm.add(back);
AjaxButton addToCart = new AjaxButton(ID_ADD_TO_CART, createStringResource("PageAssignmentDetails.addToCartButton")) {
@Override
public void onClick(AjaxRequestTarget target) {
RoleCatalogStorage storage = getSessionStorage().getRoleCatalog();
if (storage.getAssignmentShoppingCart() == null) {
storage.setAssignmentShoppingCart(new ArrayList<>());
}
AssignmentEditorDto dto = assignmentModel.getObject();
dto.setMinimized(true);
dto.setSimpleView(true);
storage.getAssignmentShoppingCart().add(dto);
redirectBack();
}
};
mainForm.add(addToCart);
}
use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.
the class PageAssignmentsList method initLayout.
public void initLayout() {
setOutputMarkupId(true);
MidpointForm mainForm = new MidpointForm(ID_FORM);
mainForm.setOutputMarkupId(true);
add(mainForm);
AssignmentTablePanel panel = new AssignmentTablePanel<UserType>(ID_ASSIGNMENT_TABLE_PANEL, assignmentsModel) {
private static final long serialVersionUID = 1L;
@Override
protected List<InlineMenuItem> createAssignmentMenu() {
List<InlineMenuItem> items = new ArrayList<>();
InlineMenuItem item = new InlineMenuItem(createStringResource("PageAssignmentsList.deleteAllItemsFromShoppingCart")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new InlineMenuItemAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
getModelObject().forEach(assignmentEditorDto -> assignmentEditorDto.setSelected(true));
deleteAssignmentPerformed(target, null);
}
};
}
};
items.add(item);
return items;
}
@Override
public IModel<String> getLabel() {
return createStringResource("PageAssignmentsList.assignmentsToRequest");
}
@Override
protected boolean isRelationEditable() {
return false;
}
@Override
protected void reloadMainFormButtons(AjaxRequestTarget target) {
Component requestButton = PageAssignmentsList.this.get(createComponentPath(ID_FORM, ID_REQUEST_BUTTON));
if (requestButton != null) {
refreshRequestButton(requestButton);
}
target.add(getFeedbackPanel());
target.add(requestButton);
}
};
mainForm.add(panel);
UserSelectionButton targetUserPanel = new UserSelectionButton(ID_TARGET_USER_PANEL, new IModel<List<UserType>>() {
@Override
public List<UserType> getObject() {
return WebComponentUtil.loadTargetUsersListForShoppingCart(OPERATION_LOAD_ASSIGNMENT_TARGET_USER_OBJECT, PageAssignmentsList.this);
}
}, true, createStringResource("AssignmentCatalogPanel.selectTargetUser")) {
private static final long serialVersionUID = 1L;
@Override
protected String getUserButtonLabel() {
return getTargetUserSelectionButtonLabel(getModelObject());
}
@Override
protected void onDeleteSelectedUsersPerformed(AjaxRequestTarget target) {
super.onDeleteSelectedUsersPerformed(target);
getSessionStorage().getRoleCatalog().setTargetUserOidsList(new ArrayList<>());
targetUserChangePerformed(target);
}
@Override
protected void multipleUsersSelectionPerformed(AjaxRequestTarget target, List<UserType> usersList) {
if (CollectionUtils.isNotEmpty(usersList)) {
List<String> usersOidsList = new ArrayList<>();
usersList.forEach(user -> usersOidsList.add(user.getOid()));
getSessionStorage().getRoleCatalog().setTargetUserOidsList(usersOidsList);
}
targetUserChangePerformed(target);
}
};
targetUserPanel.setOutputMarkupId(true);
mainForm.add(targetUserPanel);
TextArea<String> descriptionInput = new TextArea<>(ID_DESCRIPTION, descriptionModel);
descriptionInput.add(new AjaxFormComponentUpdatingBehavior("blur") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
getSessionStorage().getRoleCatalog().setRequestDescription(getDescriptionComponent().getValue());
}
});
mainForm.add(descriptionInput);
AjaxButton back = new AjaxButton(ID_BACK, createStringResource("PageAssignmentDetails.backButton")) {
@Override
public void onClick(AjaxRequestTarget target) {
redirectBack();
}
};
mainForm.add(back);
AjaxButton requestAssignments = new AjaxButton(ID_REQUEST_BUTTON, createStringResource("PageAssignmentsList.requestButton")) {
@Override
public void onClick(AjaxRequestTarget target) {
if (getSessionStorage().getRoleCatalog().getTargetUserOidsList() == null || getSessionStorage().getRoleCatalog().getTargetUserOidsList().size() <= 1) {
onSingleUserRequestPerformed(target);
} else {
onMultiUserRequestPerformed(target);
}
}
};
requestAssignments.add(new VisibleEnableBehaviour() {
@Override
public boolean isEnabled() {
return isRequestButtonEnabled();
}
});
mainForm.add(requestAssignments);
refreshRequestButton(requestAssignments);
AjaxSubmitButton resolveAssignments = new AjaxSubmitButton(ID_RESOLVE_CONFLICTS_BUTTON, createStringResource("PageAssignmentsList.resolveConflicts")) {
@Override
protected void onError(AjaxRequestTarget target) {
target.add(getFeedbackPanel());
}
@Override
protected void onSubmit(AjaxRequestTarget target) {
PageAssignmentsList.this.navigateToNext(PageAssignmentConflicts.class);
}
};
resolveAssignments.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return !getSessionStorage().getRoleCatalog().isMultiUserRequest() && !areConflictsResolved();
}
});
mainForm.add(resolveAssignments);
}
use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.
the class PageMessageTemplates method initLayout.
private void initLayout() {
Form mainForm = new MidpointForm(ID_MAIN_FORM);
add(mainForm);
MainObjectListPanel<MessageTemplateType> table = new MainObjectListPanel<>(ID_TABLE, MessageTemplateType.class) {
@Override
protected TableId getTableId() {
return TableId.TABLE_MESSAGE_TEMPLATES;
}
@Override
protected IColumn<SelectableBean<MessageTemplateType>, String> createCheckboxColumn() {
return null;
}
};
table.setOutputMarkupId(true);
mainForm.add(table);
}
use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.
the class PageArchetypes method initLayout.
private void initLayout() {
Form mainForm = new MidpointForm(ID_MAIN_FORM);
add(mainForm);
MainObjectListPanel<ArchetypeType> table = new MainObjectListPanel<ArchetypeType>(ID_TABLE, ArchetypeType.class) {
@Override
protected TableId getTableId() {
return UserProfileStorage.TableId.TABLE_ARCHETYPES;
}
@Override
protected IColumn<SelectableBean<ArchetypeType>, String> createCheckboxColumn() {
return null;
}
};
table.setOutputMarkupId(true);
mainForm.add(table);
}
Aggregations