use of org.activityinfo.server.command.handler.binding.dim.SiteDimBinding in project activityinfo by bedatadriven.
the class GetSitesHandler method buildMonthlyQuery.
private QueryModel buildMonthlyQuery(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 StartEndDateFieldBinding(), query, formTree);
if (command.fetchAnyIndicators()) {
query = buildIndicatorQuery(query, formTree, form);
}
if (command.isFetchAttributes()) {
query = buildAttributeQuery(query, formTree, form);
}
return query;
}
use of org.activityinfo.server.command.handler.binding.dim.SiteDimBinding 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;
}
use of org.activityinfo.server.command.handler.binding.dim.SiteDimBinding 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;
}
Aggregations