use of com.evolveum.midpoint.web.page.admin.orgs.OrgTreeAssignablePanel in project midpoint by Evolveum.
the class TreeTablePanel method moveRootPerformed.
private void moveRootPerformed(SelectableBean<OrgType> root, AjaxRequestTarget target) {
if (root == null) {
root = getTreePanel().getRootFromProvider();
}
final SelectableBean<OrgType> orgToMove = root;
OrgTreeAssignablePanel orgAssignablePanel = new OrgTreeAssignablePanel(parentPage.getMainPopupBodyId(), false, parentPage) {
private static final long serialVersionUID = 1L;
@Override
protected void onItemSelect(SelectableBean<OrgType> selected, AjaxRequestTarget target) {
moveConfirmPerformed(orgToMove, selected, target);
}
};
parentPage.showMainPopup(orgAssignablePanel, target);
}
use of com.evolveum.midpoint.web.page.admin.orgs.OrgTreeAssignablePanel in project midpoint by Evolveum.
the class OrgTreeMemberPopupTabPanel method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
OrgTreeAssignablePanel orgTreePanel = new OrgTreeAssignablePanel(ID_ORG_TREE_VIEW_PANEL, true) {
private static final long serialVersionUID = 1L;
@Override
protected void onOrgTreeCheckBoxSelectionPerformed(AjaxRequestTarget target, IModel<TreeSelectableBean<OrgType>> rowModel) {
onSelectionPerformed(target, (IModel) rowModel);
}
@Override
protected List<OrgType> getPreselectedOrgsList() {
return getPreselectedObjects();
}
@Override
protected boolean isAssignButtonVisible() {
return false;
}
@Override
protected boolean isInducement() {
return OrgTreeMemberPopupTabPanel.this.isInducement();
}
};
orgTreePanel.setOutputMarkupId(true);
add(orgTreePanel);
}
use of com.evolveum.midpoint.web.page.admin.orgs.OrgTreeAssignablePanel in project midpoint by Evolveum.
the class AssignmentTablePanel method createAssignmentMenu.
protected List<InlineMenuItem> createAssignmentMenu() {
List<InlineMenuItem> items = new ArrayList<>();
InlineMenuItem item;
if (WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_ADMIN_ASSIGN_ACTION_URI)) {
item = new InlineMenuItem(createStringResource("AssignmentTablePanel.menu.assign")) {
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) {
TypedAssignablePanel panel = new TypedAssignablePanel(getPageBase().getMainPopupBodyId(), RoleType.class) {
private static final long serialVersionUID = 1L;
@Override
protected void addPerformed(AjaxRequestTarget target, List selected, QName relation, ShadowKindType kind, String intent) {
super.addPerformed(target, selected, relation, kind, intent);
addSelectedAssignablePerformed(target, selected, relation, getPageBase().getMainPopup().getId());
reloadMainFormButtons(target);
}
};
panel.setOutputMarkupId(true);
getPageBase().showMainPopup(panel, target);
}
};
}
};
items.add(item);
item = new InlineMenuItem(createStringResource("AssignmentTablePanel.menu.assignOrg")) {
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) {
int count = WebModelServiceUtils.countObjects(OrgType.class, null, getPageBase());
if (count > 0) {
OrgTreeAssignablePanel orgTreePanel = new OrgTreeAssignablePanel(getPageBase().getMainPopupBodyId(), true) {
private static final long serialVersionUID = 1L;
@Override
protected void assignSelectedOrgPerformed(List<OrgType> selectedOrgs, AjaxRequestTarget target) {
// TODO Auto-generated method stub
addSelectedAssignablePerformed(target, (List) selectedOrgs, WebComponentUtil.getDefaultRelationOrFail(), getPageBase().getMainPopup().getId());
reloadMainFormButtons(target);
}
};
orgTreePanel.setOutputMarkupId(true);
getPageBase().showMainPopup(orgTreePanel, target);
} else {
warn(createStringResource("AssignmentTablePanel.menu.assignOrg.noorgs").getString());
target.add(getPageBase().getFeedbackPanel());
}
}
};
}
};
items.add(item);
}
if (WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_ADMIN_UNASSIGN_ACTION_URI)) {
item = new InlineMenuItem(createStringResource("AssignmentTablePanel.menu.unassign")) {
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) {
AssignmentTablePanel.this.deleteAssignmentPerformed(target, null);
}
};
}
};
items.add(item);
}
if (isShowAllAssignmentsVisible()) {
item = new InlineMenuItem(createStringResource("AssignmentTablePanel.menu.showAllAssignments")) {
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) {
showAllAssignments(target);
}
};
}
};
items.add(item);
}
return items;
}
use of com.evolveum.midpoint.web.page.admin.orgs.OrgTreeAssignablePanel in project midpoint by Evolveum.
the class OrgTreeAssignmentPopupTabPanel method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
OrgTreeAssignablePanel orgTreePanel = new OrgTreeAssignablePanel(ID_ORG_TREE_VIEW_PANEL, true) {
private static final long serialVersionUID = 1L;
@Override
protected void onOrgTreeCheckBoxSelectionPerformed(AjaxRequestTarget target, IModel<TreeSelectableBean<OrgType>> rowModel) {
onSelectionPerformed(target, (IModel) rowModel);
}
@Override
protected boolean isAssignButtonVisible() {
return false;
}
@Override
protected List<OrgType> getPreselectedOrgsList() {
return getPreselectedObjects();
}
@Override
protected boolean isInducement() {
return OrgTreeAssignmentPopupTabPanel.this.isInducement();
}
@Override
protected ObjectFilter getSubtypeFilter() {
return OrgTreeAssignmentPopupTabPanel.this.getSubtypeFilter();
}
};
orgTreePanel.setOutputMarkupId(true);
add(orgTreePanel);
}
use of com.evolveum.midpoint.web.page.admin.orgs.OrgTreeAssignablePanel in project midpoint by Evolveum.
the class TypedAssignablePanel method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
initAssignmentParametersPanel();
WebMarkupContainer tablesContainer = new WebMarkupContainer(ID_TABLES_CONTAINER);
tablesContainer.setOutputMarkupId(true);
add(tablesContainer);
PopupObjectListPanel<T> listRolePanel = createObjectListPanel(ID_ROLE_TABLE, ID_SELECTED_ROLES, ObjectTypes.ROLE);
tablesContainer.add(listRolePanel);
PopupObjectListPanel<T> listResourcePanel = createObjectListPanel(ID_RESOURCE_TABLE, ID_SELECTED_RESOURCES, ObjectTypes.RESOURCE);
tablesContainer.add(listResourcePanel);
PopupObjectListPanel<T> listOrgPanel = createObjectListPanel(ID_ORG_TABLE, ID_SELECTED_ORGS, ObjectTypes.ORG);
tablesContainer.add(listOrgPanel);
PopupObjectListPanel<T> listServicePanel = createObjectListPanel(ID_SERVICE_TABLE, ID_SELECTED_SERVICES, ObjectTypes.SERVICE);
tablesContainer.add(listServicePanel);
OrgTreeAssignablePanel orgTreePanel = new OrgTreeAssignablePanel(ID_ORG_TREE_VIEW_PANEL, true) {
private static final long serialVersionUID = 1L;
@Override
protected void assignSelectedOrgPerformed(List<OrgType> selectedOrgs, AjaxRequestTarget target) {
// noinspection unchecked
TypedAssignablePanel.this.assignButtonClicked(target, (List<T>) selectedOrgs);
}
};
orgTreePanel.setOutputMarkupId(true);
orgTreePanel.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return OrgType.COMPLEX_TYPE.equals(typeModel.getObject().getTypeQName()) && isOrgTreeViewSelected();
}
});
tablesContainer.add(orgTreePanel);
// todo now it's usually hiden by object list panel - bad layout; need to discuss: if count panel should be visible
// after org tree panel is added
// WebMarkupContainer countContainer = createCountContainer();
// add(countContainer);
AjaxButton addButton = new AjaxButton(ID_BUTTON_ASSIGN, createStringResource("userBrowserDialog.button.addButton")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
TypedAssignablePanel.this.assignButtonClicked(target, new ArrayList<>());
}
};
addButton.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return !isOrgTreeViewSelected();
}
});
add(addButton);
}
Aggregations