use of com.evolveum.midpoint.web.page.admin.certification.dto.CertCaseOrWorkItemDto in project midpoint by Evolveum.
the class CertDecisionHelper method createTypeColumn.
public <T extends CertCaseOrWorkItemDto> IColumn<T, String> createTypeColumn(final WhichObject which, final PageBase page) {
IColumn column;
column = new IconColumn<CertCaseOrWorkItemDto>(page.createStringResource("")) {
@Override
protected DisplayType getIconDisplayType(IModel<CertCaseOrWorkItemDto> rowModel) {
ObjectTypeGuiDescriptor guiDescriptor = getObjectTypeDescriptor(which, rowModel);
String icon = guiDescriptor != null ? guiDescriptor.getBlackIcon() : ObjectTypeGuiDescriptor.ERROR_ICON;
return GuiDisplayTypeUtil.createDisplayType(icon);
}
private ObjectTypeGuiDescriptor getObjectTypeDescriptor(WhichObject which, IModel<CertCaseOrWorkItemDto> rowModel) {
QName targetType = rowModel.getObject().getObjectType(which);
return ObjectTypeGuiDescriptor.getDescriptor(ObjectTypes.getObjectTypeFromTypeQName(targetType));
}
@Override
public void populateItem(Item<ICellPopulator<CertCaseOrWorkItemDto>> item, String componentId, IModel<CertCaseOrWorkItemDto> rowModel) {
super.populateItem(item, componentId, rowModel);
ObjectTypeGuiDescriptor guiDescriptor = getObjectTypeDescriptor(which, rowModel);
if (guiDescriptor != null) {
item.add(AttributeModifier.replace("title", page.createStringResource(guiDescriptor.getLocalizationKey())));
item.add(new TooltipBehavior());
}
}
};
return column;
}
use of com.evolveum.midpoint.web.page.admin.certification.dto.CertCaseOrWorkItemDto in project midpoint by Evolveum.
the class CertDecisionHelper method createDetailedInfoColumn.
public <T extends CertCaseOrWorkItemDto> IColumn<T, String> createDetailedInfoColumn(final PageBase page) {
IColumn column;
column = new IconColumn<CertCaseOrWorkItemDto>(page.createStringResource("")) {
@Override
protected DisplayType getIconDisplayType(final IModel<CertCaseOrWorkItemDto> rowModel) {
return GuiDisplayTypeUtil.createDisplayType("fa fa-fw fa-info-circle text-info");
}
@Override
public void populateItem(Item<ICellPopulator<CertCaseOrWorkItemDto>> item, String componentId, IModel<CertCaseOrWorkItemDto> rowModel) {
super.populateItem(item, componentId, rowModel);
CertCaseOrWorkItemDto aCase = rowModel.getObject();
String handlerUri;
if (aCase instanceof CertWorkItemDto) {
handlerUri = aCase.getHandlerUri();
} else {
handlerUri = ((PageCertCampaign) page).getCampaignHandlerUri();
}
CertGuiHandler handler = CertGuiHandlerRegistry.instance().getHandler(handlerUri);
if (handler != null) {
String title = handler.getCaseInfoButtonTitle(rowModel, page);
item.add(AttributeModifier.replace("title", title));
item.add(new TooltipBehavior());
}
}
};
return column;
}
use of com.evolveum.midpoint.web.page.admin.certification.dto.CertCaseOrWorkItemDto in project midpoint by Evolveum.
the class CertDecisionHelper method createReviewerNameColumn.
public <T extends CertCaseOrWorkItemDto> IColumn<T, String> createReviewerNameColumn(final PageBase page, final String headerKey) {
IColumn column;
column = new AbstractColumn<T, String>(page.createStringResource(headerKey)) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<T>> cellItem, String componentId, final IModel<T> rowModel) {
CertCaseOrWorkItemDto dto = rowModel.getObject();
RepeatingView reviewersPanel = new RepeatingView(componentId);
if (dto instanceof CertWorkItemDto) {
List<ObjectReferenceType> reviewersList = ((CertWorkItemDto) dto).getReviewerRefList();
if (CollectionUtils.isNotEmpty(reviewersList)) {
for (ObjectReferenceType reviewer : reviewersList) {
reviewersPanel.add(new AjaxLinkPanel(reviewersPanel.newChildId(), Model.of(WebComponentUtil.getDisplayNameOrName(reviewer))) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
dispatchToObjectDetailsPage(reviewer, page, false);
}
});
}
}
}
cellItem.add(reviewersPanel);
}
};
return column;
}
use of com.evolveum.midpoint.web.page.admin.certification.dto.CertCaseOrWorkItemDto in project midpoint by Evolveum.
the class CertDecisionHelper method createTargetNameColumn.
public <T extends CertCaseOrWorkItemDto> IColumn<T, String> createTargetNameColumn(final PageBase page, final String headerKey) {
IColumn column;
column = new AjaxLinkColumn<CertCaseOrWorkItemDto>(page.createStringResource(headerKey), SearchingUtils.TARGET_NAME, CertCaseOrWorkItemDto.F_TARGET_NAME) {
@Override
public void onClick(AjaxRequestTarget target, IModel<CertCaseOrWorkItemDto> rowModel) {
CertCaseOrWorkItemDto dto = rowModel.getObject();
dispatchToObjectDetailsPage(dto.getCertCase().getTargetRef(), page, false);
}
};
return column;
}
use of com.evolveum.midpoint.web.page.admin.certification.dto.CertCaseOrWorkItemDto in project midpoint by Evolveum.
the class CertDecisionHelper method createObjectNameColumn.
public <T extends CertCaseOrWorkItemDto> IColumn<T, String> createObjectNameColumn(final PageBase page, final String headerKey) {
IColumn column;
column = new AjaxLinkColumn<CertCaseOrWorkItemDto>(page.createStringResource(headerKey), SearchingUtils.OBJECT_NAME, CertCaseOrWorkItemDto.F_OBJECT_NAME) {
@Override
public void onClick(AjaxRequestTarget target, IModel<CertCaseOrWorkItemDto> rowModel) {
CertCaseOrWorkItemDto dto = rowModel.getObject();
dispatchToObjectDetailsPage(dto.getCertCase().getObjectRef(), page, false);
}
};
return column;
}
Aggregations