use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class PageOrgs method initLayout.
protected void initLayout() {
Form mainForm = new MidpointForm(ID_MAIN_FORM);
add(mainForm);
MainObjectListPanel<OrgType> table = new MainObjectListPanel<OrgType>(ID_TABLE, OrgType.class, getQueryOptions()) {
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.TABLE_ORGS;
}
@Override
protected List<InlineMenuItem> createInlineMenu() {
FocusListInlineMenuHelper<OrgType> listInlineMenuHelper = new FocusListInlineMenuHelper<OrgType>(OrgType.class, PageOrgs.this, this) {
private static final long serialVersionUID = 1L;
protected boolean isShowConfirmationDialog(ColumnMenuAction action) {
return PageOrgs.this.isShowConfirmationDialog(action);
}
protected IModel<String> getConfirmationMessageModel(ColumnMenuAction action, String actionName) {
return PageOrgs.this.getConfirmationMessageModel(action, actionName);
}
};
return listInlineMenuHelper.createRowActions(getType());
}
@Override
protected List<IColumn<SelectableBean<OrgType>, String>> createDefaultColumns() {
return ColumnUtils.getDefaultOrgColumns(getPageBase());
}
@Override
protected List<ItemPath> getFixedSearchItems() {
List<ItemPath> fixedSearchItems = new ArrayList<>();
fixedSearchItems.add(ObjectType.F_NAME);
fixedSearchItems.add(AbstractRoleType.F_DISPLAY_NAME);
fixedSearchItems.add(OrgType.F_PARENT_ORG_REF);
return fixedSearchItems;
}
};
table.setOutputMarkupId(true);
mainForm.add(table);
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class PageObjectTemplates method initLayout.
private void initLayout() {
Form mainForm = new MidpointForm(ID_MAIN_FORM);
add(mainForm);
MainObjectListPanel<ObjectTemplateType> table = new MainObjectListPanel<ObjectTemplateType>(ID_TABLE, ObjectTemplateType.class) {
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.TABLE_OBJECT_TEMPLATES;
}
@Override
protected List<InlineMenuItem> createInlineMenu() {
List<InlineMenuItem> menu = new ArrayList<>();
menu.add(createDeleteInlineMenu());
return menu;
}
@Override
protected List<IColumn<SelectableBean<ObjectTemplateType>, String>> createDefaultColumns() {
return ColumnUtils.getDefaultObjectColumns();
}
@Override
protected String getNothingSelectedMessage() {
return getString("pageObjectTemplates.message.nothingSelected");
}
@Override
protected String getConfirmMessageKeyForSingleObject() {
return "pageObjectTemplates.message.confirmationMessageForMultipleObject";
}
@Override
protected String getConfirmMessageKeyForMultiObject() {
return "pageObjectTemplates.message.confirmationMessageForSingleObject";
}
};
table.setOutputMarkupId(true);
mainForm.add(table);
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class PageValuePolicies method initLayout.
protected void initLayout() {
Form mainForm = new MidpointForm(ID_MAIN_FORM);
add(mainForm);
MainObjectListPanel<ValuePolicyType> table = new MainObjectListPanel<ValuePolicyType>(ID_TABLE, ValuePolicyType.class) {
@Override
protected void objectDetailsPerformed(AjaxRequestTarget target, ValuePolicyType valuePolicy) {
PageValuePolicies.this.valuePolicyDetailsPerformed(target, valuePolicy);
}
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.TABLE_VALUE_POLICIES;
}
@Override
protected List<IColumn<SelectableBean<ValuePolicyType>, String>> createDefaultColumns() {
return PageValuePolicies.this.initValuePoliciesColumns();
}
@Override
protected List<InlineMenuItem> createInlineMenu() {
return PageValuePolicies.this.createInlineMenu();
}
};
table.setOutputMarkupId(true);
mainForm.add(table);
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class ResourceSchemaHandlingPanel method initLayout.
protected void initLayout() {
MidpointForm<?> form = new MidpointForm<>(ID_FORM);
add(form);
MultivalueContainerListPanelWithDetailsPanel<ResourceObjectTypeDefinitionType> objectTypesPanel = new MultivalueContainerListPanelWithDetailsPanel<>(ID_TABLE, ResourceObjectTypeDefinitionType.class) {
@Override
protected MultivalueContainerDetailsPanel<ResourceObjectTypeDefinitionType> getMultivalueContainerDetailsPanel(ListItem<PrismContainerValueWrapper<ResourceObjectTypeDefinitionType>> item) {
return createMultivalueContainerDetailsPanel(ID_ITEM_DETAILS, item.getModel());
}
@Override
protected boolean isCreateNewObjectVisible() {
return false;
}
@Override
protected IModel<PrismContainerWrapper<ResourceObjectTypeDefinitionType>> getContainerModel() {
return PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.create(ResourceType.F_SCHEMA_HANDLING, SchemaHandlingType.F_OBJECT_TYPE));
}
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.TABLE_SCHEMA_HANDLING;
}
@Override
protected List<IColumn<PrismContainerValueWrapper<ResourceObjectTypeDefinitionType>, String>> createDefaultColumns() {
List<IColumn<PrismContainerValueWrapper<ResourceObjectTypeDefinitionType>, String>> columns = new ArrayList<>();
// columns.add(new PrismPropertyWrapperColumn<>(getContainerModel(), ResourceObjectTypeDefinitionType.F_DISPLAY_NAME, AbstractItemWrapperColumn.ColumnType.STRING, getPageBase()));
columns.add(new PrismPropertyWrapperColumn<>(getContainerModel(), ResourceObjectTypeDefinitionType.F_KIND, AbstractItemWrapperColumn.ColumnType.STRING, getPageBase()));
columns.add(new PrismPropertyWrapperColumn<>(getContainerModel(), ResourceObjectTypeDefinitionType.F_INTENT, AbstractItemWrapperColumn.ColumnType.STRING, getPageBase()));
columns.add(new PrismPropertyWrapperColumn<>(getContainerModel(), ResourceObjectTypeDefinitionType.F_DEFAULT, AbstractItemWrapperColumn.ColumnType.STRING, getPageBase()));
columns.add(new PrismPropertyWrapperColumn<>(getContainerModel(), ResourceObjectTypeDefinitionType.F_DESCRIPTION, AbstractItemWrapperColumn.ColumnType.STRING, getPageBase()));
List<InlineMenuItem> menuActionsList = getMultivalueContainerListPanel().getDefaultMenuActions();
columns.add(new InlineMenuButtonColumn(menuActionsList, getPageBase()) {
private static final long serialVersionUID = 1L;
@Override
public String getCssClass() {
return " col-md-1 ";
}
});
return columns;
}
@Override
protected IColumn<PrismContainerValueWrapper<ResourceObjectTypeDefinitionType>, String> createNameColumn(IModel<String> displayModel, GuiObjectColumnType customColumn, ItemPath itemPath, ExpressionType expression) {
return new PrismPropertyWrapperColumn<>(getContainerModel(), ResourceObjectTypeDefinitionType.F_DISPLAY_NAME, AbstractItemWrapperColumn.ColumnType.LINK, getPageBase()) {
@Override
protected void onClick(AjaxRequestTarget target, IModel<PrismContainerValueWrapper<ResourceObjectTypeDefinitionType>> model) {
itemDetailsPerformed(target, model);
}
};
}
@Override
public void editItemPerformed(AjaxRequestTarget target, IModel<PrismContainerValueWrapper<ResourceObjectTypeDefinitionType>> rowModel, List<PrismContainerValueWrapper<ResourceObjectTypeDefinitionType>> listItems) {
AbstractPageObjectDetails parent = findParent(AbstractPageObjectDetails.class);
if (parent == null) {
super.editItemPerformed(target, rowModel, listItems);
return;
}
ContainerPanelConfigurationType detailsPanel = new ContainerPanelConfigurationType(getPrismContext());
detailsPanel.setPanelType("schemaHandlingDetails");
PrismContainerValueWrapper<ResourceObjectTypeDefinitionType> objectTypeDef;
if (rowModel != null) {
objectTypeDef = rowModel.getObject();
} else {
objectTypeDef = listItems.iterator().next();
}
// VirtualContainersSpecificationType virtualContainer = new VirtualContainersSpecificationType(getPrismContext());
detailsPanel.setPath(new ItemPathType(objectTypeDef.getPath()));
// detailsPanel.getContainer().add(virtualContainer);
detailsPanel.setIdentifier("schemaHandlingDetails");
DisplayType displayType = new DisplayType();
displayType.setLabel(getObjectTypeDisplayName(objectTypeDef.getNewValue().asContainerable()));
detailsPanel.setDisplay(displayType);
getPageBase().getSessionStorage().setObjectDetailsStorage("details" + parent.getType().getSimpleName(), detailsPanel);
ResourceSchemaHandlingPanel.this.getPanelConfiguration().getPanel().add(detailsPanel);
target.add(parent);
parent.replacePanel(detailsPanel, target);
// super.editItemPerformed(target, rowModel, listItems);
}
};
form.add(objectTypesPanel);
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class ResourceTasksPanel method initLayout.
protected void initLayout() {
final MainObjectListPanel<TaskType> tasksPanel = new MainObjectListPanel<>(ID_TASKS_TABLE, TaskType.class, null) {
private static final long serialVersionUID = 1L;
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.PAGE_RESOURCE_TASKS_PANEL;
}
@Override
protected ISelectableDataProvider<TaskType, SelectableBean<TaskType>> createProvider() {
return createSelectableBeanObjectDataProvider(() -> createResourceTasksQuery(), null);
}
@Override
protected List<InlineMenuItem> createInlineMenu() {
return null;
}
@Override
protected void newObjectPerformed(AjaxRequestTarget target, AssignmentObjectRelation relation, CompiledObjectCollectionView collectionView) {
if (collectionView == null) {
collectionView = getObjectCollectionView();
}
List<ObjectReferenceType> archetypeRef = ObjectCollectionViewUtil.getArchetypeReferencesList(collectionView);
try {
PrismContext prismContext = getPrismContext();
PrismObjectDefinition<TaskType> def = prismContext.getSchemaRegistry().findObjectDefinitionByType(TaskType.COMPLEX_TYPE);
PrismObject<TaskType> obj = def.instantiate();
TaskType newTask = obj.asObjectable();
ObjectReferenceType resourceRef = new ObjectReferenceType();
resourceRef.setOid(ResourceTasksPanel.this.getObjectWrapper().getOid());
resourceRef.setType(ResourceType.COMPLEX_TYPE);
newTask.setObjectRef(resourceRef);
WebComponentUtil.initNewObjectWithReference(getPageBase(), newTask, archetypeRef);
} catch (SchemaException ex) {
getPageBase().getFeedbackMessages().error(ResourceTasksPanel.this, ex.getUserFriendlyMessage());
target.add(getPageBase().getFeedbackPanel());
}
}
@Override
protected List<IColumn<SelectableBean<TaskType>, String>> createDefaultColumns() {
return ColumnUtils.getDefaultTaskColumns();
}
@Override
protected List<CompiledObjectCollectionView> getNewObjectInfluencesList() {
List<CompiledObjectCollectionView> newObjectInfluencesList = super.getNewObjectInfluencesList();
List<CompiledObjectCollectionView> filteredInfluencesList = new ArrayList<>();
if (newObjectInfluencesList != null) {
newObjectInfluencesList.forEach(influence -> {
if (influence.getCollection() != null && influence.getCollection().getCollectionRef() != null && ArrayUtils.contains(resourceTaskArchetypeOids, influence.getCollection().getCollectionRef().getOid())) {
filteredInfluencesList.add(influence);
}
});
}
return filteredInfluencesList;
}
};
tasksPanel.setAdditionalBoxCssClasses(GuiStyleConstants.CLASS_OBJECT_TASK_BOX_CSS_CLASSES);
add(tasksPanel);
AjaxButton runNow = new AjaxButton(ID_RUN_NOW, getPageBase().createStringResource("pageTaskEdit.button.runNow")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
List<String> oids = createOidList(getTaskListPanel().getSelectedRealObjects());
if (!oids.isEmpty()) {
OperationResult result = TaskOperationUtils.runNowPerformed(oids, getPageBase());
getPageBase().showResult(result);
} else {
noTasksSelected();
}
target.add(getPageBase().getFeedbackPanel());
}
};
add(runNow);
AjaxButton resume = new AjaxButton(ID_RESUME, getPageBase().createStringResource("pageTaskEdit.button.resume")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
List<TaskType> tasks = getTaskListPanel().getSelectedRealObjects();
if (!tasks.isEmpty()) {
OperationResult result = TaskOperationUtils.resumeTasks(tasks, getPageBase());
getPageBase().showResult(result);
} else {
noTasksSelected();
}
target.add(getPageBase().getFeedbackPanel());
}
};
add(resume);
AjaxButton suspend = new AjaxButton(ID_SUSPEND, getPageBase().createStringResource("pageTaskEdit.button.suspend")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
List<TaskType> tasks = getTaskListPanel().getSelectedRealObjects();
if (!tasks.isEmpty()) {
OperationResult result = TaskOperationUtils.suspendTasks(tasks, getPageBase());
getPageBase().showResult(result);
} else {
noTasksSelected();
}
target.add(getPageBase().getFeedbackPanel());
}
};
add(suspend);
}
Aggregations