use of com.evolveum.midpoint.gui.impl.page.admin.AbstractPageObjectDetails in project midpoint by Evolveum.
the class ResourceAttributePanel method customEditItemPerformed.
// private void manageMappings(boolean outbound) {
// if (outbound) {
// collectionOutbounds();
// }
// PrismContainerWrapper<ResourceAttributeDefinitionType> resourceAttributeDefinition = getModelObject();
//
// }
//
// private void collectionOutbounds() {
// PrismContainerWrapper<ResourceAttributeDefinitionType> resourceAttributeDef = getModelObject();
//
// for (PrismContainerValueWrapper<ResourceAttributeDefinitionType> resourceAttributeDefVal : resourceAttributeDef.getValues()) {
// ResourceAttributeDefinitionType resourceAttrRealValue = resourceAttributeDefVal.getRealValue();
// if (resourceAttributeDef == null) {
// continue;
// }
// MappingType mappingType = resourceAttrRealValue.getOutbound();
// if (mappingType == null) {
// continue;
// }
//
// }
// }
@Override
protected boolean customEditItemPerformed(AjaxRequestTarget target, IModel<PrismContainerValueWrapper<ResourceAttributeDefinitionType>> rowModel, List<PrismContainerValueWrapper<ResourceAttributeDefinitionType>> listItems) {
if (getConfig() == null) {
return false;
}
AbstractPageObjectDetails parent = findParent(AbstractPageObjectDetails.class);
if (parent == null) {
return false;
}
ContainerPanelConfigurationType detailsPanel = new ContainerPanelConfigurationType(getPrismContext());
detailsPanel.setPanelType("attributeDefinitionDetails");
PrismContainerValueWrapper<ResourceAttributeDefinitionType> attrDef;
if (rowModel != null) {
attrDef = rowModel.getObject();
} else {
attrDef = listItems.iterator().next();
}
// VirtualContainersSpecificationType virtualContainer = new VirtualContainersSpecificationType(getPrismContext());
detailsPanel.setPath(new ItemPathType(attrDef.getPath()));
// detailsPanel.getContainer().add(virtualContainer);
detailsPanel.setIdentifier("attributeDefinitionDetails");
DisplayType displayType = new DisplayType();
displayType.setLabel(new PolyStringType(attrDef.getDisplayName()));
IconType icon = new IconType();
icon.setCssClass("fa fa-navicon");
displayType.setIcon(icon);
detailsPanel.setDisplay(displayType);
getPageBase().getSessionStorage().setObjectDetailsStorage("details" + parent.getType().getSimpleName(), detailsPanel);
ResourceAttributePanel.this.getConfig().getPanel().add(detailsPanel);
target.add(parent);
parent.replacePanel(detailsPanel, target);
return true;
}
use of com.evolveum.midpoint.gui.impl.page.admin.AbstractPageObjectDetails 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);
}
Aggregations