use of com.evolveum.midpoint.web.component.wizard.resource.dto.ObjectClassDto in project midpoint by Evolveum.
the class SchemaListPanel method initLayout.
protected void initLayout() {
final ObjectClassDataProvider dataProvider = new ObjectClassDataProvider(allClasses);
TextField objectClass = new TextField<>(ID_OBJECT_CLASS, new Model<>());
objectClass.setOutputMarkupId(true);
objectClass.add(new AjaxFormComponentUpdatingBehavior("keyup") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
updateSearchPerformed(target, dataProvider);
}
});
add(objectClass);
AjaxButton clearSearch = new AjaxButton(ID_CLEAR_SEARCH) {
@Override
public void onClick(AjaxRequestTarget target) {
clearSearchPerformed(target, dataProvider);
}
};
add(clearSearch);
WebMarkupContainer tableBody = new WebMarkupContainer(ID_TABLE_BODY);
tableBody.setOutputMarkupId(true);
add(tableBody);
DataView<ObjectClassDto> objectClassDataView = new DataView<ObjectClassDto>(ID_OBJECT_CLASS_LIST, dataProvider, UserProfileStorage.DEFAULT_PAGING_SIZE) {
@Override
protected void populateItem(final Item<ObjectClassDto> item) {
AjaxLink<Void> link = new AjaxLink<Void>(ID_CLASS_LINK) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
objectClassClickPerformed(target, item.getModelObject());
}
};
item.add(link);
Label label = new Label(ID_LABEL, new PropertyModel<>(item.getModel(), ObjectClassDto.F_DISPLAY_NAME));
link.add(label);
item.add(AttributeModifier.replace("class", new IModel<Object>() {
@Override
public Object getObject() {
return item.getModelObject().isSelected() ? "success" : null;
}
}));
}
};
tableBody.add(objectClassDataView);
NavigatorPanel objectClassNavigator = new NavigatorPanel(ID_NAVIGATOR, objectClassDataView, true);
objectClassNavigator.setOutputMarkupId(true);
objectClassNavigator.setOutputMarkupPlaceholderTag(true);
add(objectClassNavigator);
WebMarkupContainer objectClassInfoContainer = new WebMarkupContainer(ID_OBJECT_CLASS_INFO_CONTAINER);
objectClassInfoContainer.setOutputMarkupId(true);
add(objectClassInfoContainer);
WebMarkupContainer objectClassInfoColumn = new WebMarkupContainer(ID_OBJECT_CLASS_INFO_COLUMN);
objectClassInfoColumn.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return getSelectedObjectClass() != null;
}
});
objectClassInfoContainer.add(objectClassInfoColumn);
initDetailsPanel(objectClassInfoColumn);
ListDataProvider<AttributeDto> attributeProvider = new ListDataProvider<>(this, attributeModel, true);
attributeProvider.setSort(AttributeDto.F_DISPLAY_ORDER, SortOrder.ASCENDING);
BoxedTablePanel<AttributeDto> attributeTable = new BoxedTablePanel<>(ID_ATTRIBUTE_TABLE, attributeProvider, initColumns());
attributeTable.setOutputMarkupId(true);
attributeTable.setItemsPerPage(UserProfileStorage.DEFAULT_PAGING_SIZE);
attributeTable.setShowPaging(true);
objectClassInfoColumn.add(attributeTable);
}
use of com.evolveum.midpoint.web.component.wizard.resource.dto.ObjectClassDto in project midpoint by Evolveum.
the class SchemaListPanel method objectClassClickPerformed.
private void objectClassClickPerformed(AjaxRequestTarget target, ObjectClassDto dto) {
for (ObjectClassDto o : allClasses.getObject()) {
o.setSelected(false);
}
dto.setSelected(true);
attributeModel.reset();
detailsModel.reset();
target.add(get(ID_TABLE_BODY), get(ID_OBJECT_CLASS_INFO_CONTAINER));
}
use of com.evolveum.midpoint.web.component.wizard.resource.dto.ObjectClassDto in project midpoint by Evolveum.
the class SchemaListPanel method loadAttributes.
private List<AttributeDto> loadAttributes() {
List<AttributeDto> list = new ArrayList<>();
ObjectClassDto selected = getSelectedObjectClass();
if (selected == null) {
return list;
}
for (ResourceAttributeDefinition def : selected.getDefinition().getAttributeDefinitions()) {
list.add(new AttributeDto(def));
}
return list;
}
use of com.evolveum.midpoint.web.component.wizard.resource.dto.ObjectClassDto in project midpoint by Evolveum.
the class SchemaListPanel method loadAllClasses.
private List<ObjectClassDto> loadAllClasses() {
List<ObjectClassDto> list = new ArrayList<>();
ResourceSchema schema = loadResourceSchema();
if (schema == null) {
return list;
}
for (ResourceObjectTypeDefinition definition : schema.getObjectTypeDefinitions()) {
list.add(new ObjectClassDto(definition));
}
Collections.sort(list);
return list;
}
Aggregations