Search in sources :

Example 1 with Status

use of org.apache.syncope.common.lib.to.BulkActionResult.Status in project syncope by apache.

the class BulkActionResultColumn method populateItem.

@Override
public void populateItem(final Item<ICellPopulator<T>> item, final String componentId, final IModel<T> rowModel) {
    try {
        final Object id = BeanUtils.getPropertyDescriptor(rowModel.getObject().getClass(), keyFieldName).getReadMethod().invoke(rowModel.getObject(), new Object[0]);
        final Status status = results.getResults().containsKey(id.toString()) ? results.getResults().get(id.toString()) : Status.NOT_ATTEMPTED;
        item.add(new Label(componentId, new StringResourceModel(status.name(), item, new Model<>(status.name()))));
    } catch (BeansException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
        LOG.error("Errore retrieving target id value", e);
    }
}
Also used : Status(org.apache.syncope.common.lib.to.BulkActionResult.Status) Label(org.apache.wicket.markup.html.basic.Label) StringResourceModel(org.apache.wicket.model.StringResourceModel) InvocationTargetException(java.lang.reflect.InvocationTargetException) BeansException(org.springframework.beans.BeansException)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Status (org.apache.syncope.common.lib.to.BulkActionResult.Status)1 Label (org.apache.wicket.markup.html.basic.Label)1 StringResourceModel (org.apache.wicket.model.StringResourceModel)1 BeansException (org.springframework.beans.BeansException)1