Search in sources :

Example 1 with PartnerDimBinding

use of org.activityinfo.server.command.handler.binding.dim.PartnerDimBinding in project activityinfo by bedatadriven.

the class GetSitesHandler method buildLinkedQuery.

private QueryModel buildLinkedQuery(FormTree formTree, FormClass form, ActivityLink activityLink) {
    QueryModel query = new QueryModel(form.getId());
    fieldBindingMap.put(form.getId(), Lists.<FieldBinding>newLinkedList());
    addBinding(new SiteDimBinding(), query, formTree);
    addBinding(new ConstantActivityIdFieldBinding(activityLink.getActivityId()), query, formTree);
    addBinding(new ProjectDimBinding(), query, formTree);
    if (command.isFetchDates()) {
        addBinding(new StartEndDateFieldBinding(), query, formTree);
    }
    if (command.isFetchPartner()) {
        addBinding(new PartnerDimBinding(), query, formTree);
    }
    if (command.isFetchLocation()) {
        query = buildLocationQuery(query, formTree, form);
    }
    if (command.fetchAnyIndicators()) {
        query = buildLinkedIndicatorQuery(activityLink.getLinkedIndicators(), query, formTree, form);
    }
    if (command.isFetchAttributes()) {
        // query = buildLinkedAttributeQuery(activityLink.getLinkedAttributes(), query, formTree, form);
        query = buildAttributeQuery(query, formTree, form);
    }
    if (command.isFetchComments()) {
        addBinding(new CommentFieldBinding(), query, formTree);
    }
    return query;
}
Also used : ProjectDimBinding(org.activityinfo.server.command.handler.binding.dim.ProjectDimBinding) PartnerDimBinding(org.activityinfo.server.command.handler.binding.dim.PartnerDimBinding) SiteDimBinding(org.activityinfo.server.command.handler.binding.dim.SiteDimBinding) QueryModel(org.activityinfo.model.query.QueryModel)

Example 2 with PartnerDimBinding

use of org.activityinfo.server.command.handler.binding.dim.PartnerDimBinding in project activityinfo by bedatadriven.

the class GetSitesHandler method buildQuery.

private QueryModel buildQuery(Activity activity, FormTree formTree, FormClass form) {
    QueryModel query = new QueryModel(form.getId());
    fieldBindingMap.put(form.getId(), Lists.<FieldBinding>newLinkedList());
    addBinding(new SiteDimBinding(), query, formTree);
    addBinding(new ActivityIdFieldBinding(), query, formTree);
    addBinding(new ProjectDimBinding(), query, formTree);
    if (command.isFetchDates() && activity != null && !activity.isMonthly()) {
        addBinding(new StartEndDateFieldBinding(), query, formTree);
    }
    if (command.isFetchPartner()) {
        addBinding(new PartnerDimBinding(), query, formTree);
    }
    if (command.isFetchLocation()) {
        query = buildLocationQuery(query, formTree, form);
    }
    if (command.isFetchAttributes()) {
        query = buildAttributeQuery(query, formTree, form);
    }
    if (command.fetchAnyIndicators()) {
        query = buildIndicatorQuery(query, formTree, form);
    }
    if (command.isFetchComments()) {
        addBinding(new CommentFieldBinding(), query, formTree);
    }
    return query;
}
Also used : ProjectDimBinding(org.activityinfo.server.command.handler.binding.dim.ProjectDimBinding) PartnerDimBinding(org.activityinfo.server.command.handler.binding.dim.PartnerDimBinding) SiteDimBinding(org.activityinfo.server.command.handler.binding.dim.SiteDimBinding) QueryModel(org.activityinfo.model.query.QueryModel)

Aggregations

QueryModel (org.activityinfo.model.query.QueryModel)2 PartnerDimBinding (org.activityinfo.server.command.handler.binding.dim.PartnerDimBinding)2 ProjectDimBinding (org.activityinfo.server.command.handler.binding.dim.ProjectDimBinding)2 SiteDimBinding (org.activityinfo.server.command.handler.binding.dim.SiteDimBinding)2