use of org.activityinfo.client.report.editor.pivotTable.DimensionModel in project activityinfo by bedatadriven.
the class DimensionProxy method load.
@Override
protected void load(Object loadConfig, final AsyncCallback<ListLoadResult<DimensionModel>> callback) {
final List<DimensionModel> list = Lists.newArrayList();
list.add(new DimensionModel(DimensionType.Indicator, I18N.CONSTANTS.indicator()));
list.add(new DimensionModel(DimensionType.Partner, I18N.CONSTANTS.partner()));
list.add(new DimensionModel(DimensionType.Project, I18N.CONSTANTS.project()));
list.add(new DimensionModel(DimensionType.Target, I18N.CONSTANTS.realizedOrTargeted()));
list.add(new DimensionModel(DateUnit.YEAR));
list.add(new DimensionModel(DateUnit.QUARTER));
list.add(new DimensionModel(DateUnit.MONTH));
list.add(new DimensionModel(DateUnit.WEEK_MON));
if (model.getIndicators().isEmpty()) {
callback.onSuccess(new BaseListLoadResult<DimensionModel>(list));
} else {
dispatcher.execute(new GetSchema(), new AsyncCallback<SchemaDTO>() {
@Override
public void onFailure(Throwable caught) {
callback.onFailure(caught);
}
@Override
public void onSuccess(SchemaDTO schema) {
addGeographicDimensions(list, schema);
list.addAll(DimensionModel.attributeGroupModels(schema, model.getIndicators()));
callback.onSuccess(new BaseListLoadResult<DimensionModel>(list));
}
});
}
}
Aggregations