Search in sources :

Example 1 with AdminGroupingModel

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;
}
Also used : AdminGroupingModel(org.activityinfo.client.page.entry.grouping.AdminGroupingModel) Filter(org.activityinfo.shared.command.Filter)

Example 2 with AdminGroupingModel

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();
}
Also used : AdminGroupingModel(org.activityinfo.client.page.entry.grouping.AdminGroupingModel) TreeStore(com.extjs.gxt.ui.client.store.TreeStore) DispatcherStub(org.activityinfo.client.dispatch.DispatcherStub) GetAdminEntities(org.activityinfo.shared.command.GetAdminEntities) GetSchema(org.activityinfo.shared.command.GetSchema) Test(org.junit.Test)

Example 3 with AdminGroupingModel

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));
}
Also used : AdminGroupingModel(org.activityinfo.client.page.entry.grouping.AdminGroupingModel) Filter(org.activityinfo.shared.command.Filter) Test(org.junit.Test)

Aggregations

AdminGroupingModel (org.activityinfo.client.page.entry.grouping.AdminGroupingModel)3 Filter (org.activityinfo.shared.command.Filter)2 Test (org.junit.Test)2 TreeStore (com.extjs.gxt.ui.client.store.TreeStore)1 DispatcherStub (org.activityinfo.client.dispatch.DispatcherStub)1 GetAdminEntities (org.activityinfo.shared.command.GetAdminEntities)1 GetSchema (org.activityinfo.shared.command.GetSchema)1