Search in sources :

Example 6 with CustomRestriction

use of com.qcadoo.model.api.search.CustomRestriction in project mes by qcadoo.

the class MaterialRequirementCoveragesListHooks method addDiscriminatorRestrictionToGrid.

public final void addDiscriminatorRestrictionToGrid(final ViewDefinitionState view) {
    GridComponent grid = (GridComponent) view.getComponentByReference(QcadooViewConstants.L_GRID);
    grid.setCustomRestriction(new CustomRestriction() {

        @Override
        public void addRestriction(final SearchCriteriaBuilder searchBuilder) {
            searchBuilder.add(SearchRestrictions.eq(MaterialRequirementCoverageFields.SAVED, true));
        }
    });
}
Also used : SearchCriteriaBuilder(com.qcadoo.model.api.search.SearchCriteriaBuilder) GridComponent(com.qcadoo.view.api.components.GridComponent) CustomRestriction(com.qcadoo.model.api.search.CustomRestriction)

Example 7 with CustomRestriction

use of com.qcadoo.model.api.search.CustomRestriction in project mes by qcadoo.

the class BatchViewHooks method filterStateChangeHistory.

private void filterStateChangeHistory(final ViewDefinitionState view) {
    GridComponent loggingsGrid = (GridComponent) view.getComponentByReference(L_LOGGINGS_GRID);
    CustomRestriction onlySuccessfulRestriction = stateChangeHistoryService.buildStatusRestriction(BatchStateChangeFields.STATUS, Lists.newArrayList(SUCCESSFUL.getStringValue()));
    loggingsGrid.setCustomRestriction(onlySuccessfulRestriction);
}
Also used : GridComponent(com.qcadoo.view.api.components.GridComponent) CustomRestriction(com.qcadoo.model.api.search.CustomRestriction)

Example 8 with CustomRestriction

use of com.qcadoo.model.api.search.CustomRestriction in project mes by qcadoo.

the class TrackingRecordSimpleViewHooks method filterStateChangeHistory.

public void filterStateChangeHistory(final ViewDefinitionState view) {
    final GridComponent historyGrid = (GridComponent) view.getComponentByReference(L_LOGGINGS_GRID);
    final CustomRestriction onlySuccessfulRestriction = stateChangeHistoryService.buildStatusRestriction(TrackingRecordStateChangeFields.STATUS, Lists.newArrayList(SUCCESSFUL.getStringValue()));
    historyGrid.setCustomRestriction(onlySuccessfulRestriction);
}
Also used : GridComponent(com.qcadoo.view.api.components.GridComponent) CustomRestriction(com.qcadoo.model.api.search.CustomRestriction)

Example 9 with CustomRestriction

use of com.qcadoo.model.api.search.CustomRestriction in project mes by qcadoo.

the class OrderDetailsHooks method filterStateChangeHistory.

// FIXME replace this beforeRender hook with <criteriaModifier /> parameter in view XML.
public void filterStateChangeHistory(final ViewDefinitionState view) {
    final GridComponent historyGrid = (GridComponent) view.getComponentByReference(QcadooViewConstants.L_GRID);
    final CustomRestriction onlySuccessfulRestriction = stateChangeHistoryService.buildStatusRestriction(OrderStateChangeFields.STATUS, Lists.newArrayList(StateChangeStatus.SUCCESSFUL.getStringValue()));
    historyGrid.setCustomRestriction(onlySuccessfulRestriction);
}
Also used : GridComponent(com.qcadoo.view.api.components.GridComponent) CustomRestriction(com.qcadoo.model.api.search.CustomRestriction)

Example 10 with CustomRestriction

use of com.qcadoo.model.api.search.CustomRestriction in project mes by qcadoo.

the class RequestForQuotationDetailsHooks method filterStateChangeHistory.

public void filterStateChangeHistory(final ViewDefinitionState view) {
    final GridComponent historyGrid = (GridComponent) view.getComponentByReference("loggingsGrid");
    final CustomRestriction onlySuccessfulRestriction = stateChangeHistoryService.buildStatusRestriction(RequestForQuotationStateChangeFields.STATUS, Lists.newArrayList(SUCCESSFUL.getStringValue()));
    historyGrid.setCustomRestriction(onlySuccessfulRestriction);
}
Also used : CustomRestriction(com.qcadoo.model.api.search.CustomRestriction)

Aggregations

CustomRestriction (com.qcadoo.model.api.search.CustomRestriction)16 GridComponent (com.qcadoo.view.api.components.GridComponent)12 SearchCriteriaBuilder (com.qcadoo.model.api.search.SearchCriteriaBuilder)8 Entity (com.qcadoo.model.api.Entity)1 SearchDisjunction (com.qcadoo.model.api.search.SearchDisjunction)1 PossibleUnitConversions (com.qcadoo.model.api.units.PossibleUnitConversions)1 FieldComponent (com.qcadoo.view.api.components.FieldComponent)1 Transactional (org.springframework.transaction.annotation.Transactional)1