use of org.activityinfo.client.page.entry.grouping.AdminGroupingModel in project activityinfo by bedatadriven.
the class DataEntryPlaceParser method parse.
@Override
public DataEntryPlace parse(String token) {
DataEntryPlace place = new DataEntryPlace();
if (!token.isEmpty()) {
String[] parts = token.split("/");
new Filter();
if (parts.length > 0) {
String[] qualifiers = parts[0].split("\\-");
for (String qualifier : qualifiers) {
String[] qualifierParts = qualifier.split("\\+");
if (qualifierParts[0].equals("groupByAdmin")) {
AdminGroupingModel grouping = new AdminGroupingModel(Integer.parseInt(qualifierParts[1]));
place.setGrouping(grouping);
} else {
updateFilter(place, qualifierParts);
}
}
}
}
return place;
}
use of org.activityinfo.client.page.entry.grouping.AdminGroupingModel in project activityinfo by bedatadriven.
the class SiteAdminTreeLoaderTest method load.
@Test
public void load() {
DispatcherStub dispatcher = new DispatcherStub();
dispatcher.setResult(new GetSchema(), DTOs.PEAR.SCHEMA);
dispatcher.setResult(new GetAdminEntities(1), DTOs.PROVINCES);
SiteAdminTreeLoader loader = new SiteAdminTreeLoader(dispatcher, new AdminGroupingModel(1));
new TreeStore<ModelData>(loader);
loader.load();
}
use of org.activityinfo.client.page.entry.grouping.AdminGroupingModel in project activityinfo by bedatadriven.
the class DataEntryPlaceParserTest method activityFilteredAndGrouped.
@Test
public void activityFilteredAndGrouped() {
Filter filter = new Filter();
filter.addRestriction(DimensionType.Activity, 33);
AdminGroupingModel grouping = new AdminGroupingModel(1);
verifyCorrectSerde(new DataEntryPlace(grouping, filter));
}
Aggregations