Search in sources :

Example 11 with AdminEntityDTO

use of org.activityinfo.legacy.shared.model.AdminEntityDTO in project activityinfo by bedatadriven.

the class AdminFilterPanel method removeFilter.

private void removeFilter() {
    for (AdminEntityDTO entity : tree.getCheckedSelection()) {
        tree.setChecked(entity, false);
    }
    value = new Filter();
    ValueChangeEvent.fire(this, value);
    filterToolBar.setRemoveFilterEnabled(false);
}
Also used : Filter(org.activityinfo.legacy.shared.command.Filter) AdminEntityDTO(org.activityinfo.legacy.shared.model.AdminEntityDTO)

Example 12 with AdminEntityDTO

use of org.activityinfo.legacy.shared.model.AdminEntityDTO in project activityinfo by bedatadriven.

the class AdminFilterPanel method initializeComponent.

private void initializeComponent() {
    this.setLayout(new FitLayout());
    this.setScrollMode(Style.Scroll.AUTO);
    this.setHeadingText(I18N.CONSTANTS.filterByGeography());
    this.setIcon(IconImageBundle.ICONS.filter());
    loader = new AdminTreeLoader(dispatcher);
    store = new TreeStore<AdminEntityDTO>(loader);
}
Also used : AdminEntityDTO(org.activityinfo.legacy.shared.model.AdminEntityDTO) FitLayout(com.extjs.gxt.ui.client.widget.layout.FitLayout)

Example 13 with AdminEntityDTO

use of org.activityinfo.legacy.shared.model.AdminEntityDTO in project activityinfo by bedatadriven.

the class AdminTreeProxy method load.

/**
 * Load nodes in the tree
 *
 * @param parent
 * @param callback
 */
@Override
protected void load(final Object parent, final AsyncCallback<List<AdminEntityDTO>> callback) {
    if (filter == null) {
        callback.onSuccess(new ArrayList<AdminEntityDTO>());
        return;
    }
    if (!hasRestrictions()) {
        callback.onSuccess(new ArrayList<AdminEntityDTO>());
    } else {
        GetAdminEntities request = new GetAdminEntities();
        request.setFilter(filter);
        if (parent == null) {
            request.setParentId(GetAdminEntities.ROOT);
        } else {
            assert parent instanceof AdminEntityDTO : "expecting AdminEntityDTO";
            request.setParentId(((AdminEntityDTO) parent).getId());
        }
        service.execute(request, new AsyncCallback<AdminEntityResult>() {

            @Override
            public void onFailure(Throwable caught) {
                callback.onFailure(caught);
            }

            @Override
            public void onSuccess(AdminEntityResult result) {
                callback.onSuccess(result.getData());
            }
        });
    }
}
Also used : AdminEntityDTO(org.activityinfo.legacy.shared.model.AdminEntityDTO) AdminEntityResult(org.activityinfo.legacy.shared.command.result.AdminEntityResult) GetAdminEntities(org.activityinfo.legacy.shared.command.GetAdminEntities)

Example 14 with AdminEntityDTO

use of org.activityinfo.legacy.shared.model.AdminEntityDTO in project activityinfo by bedatadriven.

the class PolygonLayerGenerator method queryBounds.

private void queryBounds(DispatcherSync dispatcher, Filter layerFilter) {
    GetAdminEntities query = new GetAdminEntities();
    query.setLevelId(layer.getAdminLevelId());
    AdminEntityResult entities = dispatcher.execute(query);
    for (AdminEntityDTO entity : entities.getData()) {
        if (entity.hasBounds()) {
            AdminMarker marker = new AdminMarker(entity);
            overlay.addPolygon(marker);
        }
    }
}
Also used : AdminEntityDTO(org.activityinfo.legacy.shared.model.AdminEntityDTO) AdminMarker(org.activityinfo.legacy.shared.reports.content.AdminMarker) AdminEntityResult(org.activityinfo.legacy.shared.command.result.AdminEntityResult) GetAdminEntities(org.activityinfo.legacy.shared.command.GetAdminEntities)

Aggregations

AdminEntityDTO (org.activityinfo.legacy.shared.model.AdminEntityDTO)14 AdminEntityResult (org.activityinfo.legacy.shared.command.result.AdminEntityResult)4 ArrayList (java.util.ArrayList)3 Filter (org.activityinfo.legacy.shared.command.Filter)3 GetAdminEntities (org.activityinfo.legacy.shared.command.GetAdminEntities)3 SqlResultCallback (com.bedatadriven.rebar.sql.client.SqlResultCallback)2 SqlResultSet (com.bedatadriven.rebar.sql.client.SqlResultSet)2 SqlResultSetRow (com.bedatadriven.rebar.sql.client.SqlResultSetRow)2 SqlTransaction (com.bedatadriven.rebar.sql.client.SqlTransaction)2 SqlQuery (com.bedatadriven.rebar.sql.client.query.SqlQuery)2 HashMap (java.util.HashMap)2 LocationResult (org.activityinfo.legacy.shared.command.result.LocationResult)2 LocationDTO (org.activityinfo.legacy.shared.model.LocationDTO)2 FitLayout (com.extjs.gxt.ui.client.widget.layout.FitLayout)1 StringWriter (java.io.StringWriter)1 List (java.util.List)1 Set (java.util.Set)1 GetLocations (org.activityinfo.legacy.shared.command.GetLocations)1 AdminMarker (org.activityinfo.legacy.shared.reports.content.AdminMarker)1 PointValue (org.activityinfo.legacy.shared.reports.model.PointValue)1