use of com.qcadoo.model.api.search.CustomRestriction in project mes by qcadoo.
the class NegotiationDetailsHooks method filterStateChangeHistory.
public void filterStateChangeHistory(final ViewDefinitionState view) {
final GridComponent historyGrid = (GridComponent) view.getComponentByReference("loggingsGrid");
final CustomRestriction onlySuccessfulRestriction = stateChangeHistoryService.buildStatusRestriction(NegotiationStateChangeFields.STATUS, Lists.newArrayList(SUCCESSFUL.getStringValue()));
historyGrid.setCustomRestriction(onlySuccessfulRestriction);
}
use of com.qcadoo.model.api.search.CustomRestriction in project mes by qcadoo.
the class OfferDetailsHooks method filterStateChangeHistory.
public void filterStateChangeHistory(final ViewDefinitionState view) {
final GridComponent historyGrid = (GridComponent) view.getComponentByReference("loggingsGrid");
final CustomRestriction onlySuccessfulRestriction = stateChangeHistoryService.buildStatusRestriction(OfferStateChangeFields.STATUS, Lists.newArrayList(SUCCESSFUL.getStringValue()));
historyGrid.setCustomRestriction(onlySuccessfulRestriction);
}
use of com.qcadoo.model.api.search.CustomRestriction in project mes by qcadoo.
the class TechnologyDetailsHooks method filterStateChangeHistory.
public void filterStateChangeHistory(final ViewDefinitionState view) {
final GridComponent historyGrid = (GridComponent) view.getComponentByReference(QcadooViewConstants.L_GRID);
final CustomRestriction onlySuccessfulRestriction = stateChangeHistoryService.buildStatusRestriction(STATUS, Lists.newArrayList(StateChangeStatus.SUCCESSFUL.getStringValue()));
historyGrid.setCustomRestriction(onlySuccessfulRestriction);
}
use of com.qcadoo.model.api.search.CustomRestriction in project qcadoo by qcadoo.
the class MenuAdministrationService method addRestrictionToCategoriesGrid.
public void addRestrictionToCategoriesGrid(final ViewDefinitionState viewDefinitionState) {
GridComponent categoriesGrid = (GridComponent) viewDefinitionState.getComponentByReference(QcadooViewConstants.L_GRID);
categoriesGrid.setCustomRestriction(new CustomRestriction() {
@Override
public void addRestriction(final SearchCriteriaBuilder searchCriteriaBuilder) {
SearchDisjunction disjunction = SearchRestrictions.disjunction();
for (String[] category : HIDDEN_CATEGORIES) {
disjunction.add(SearchRestrictions.and(SearchRestrictions.eq(MenuCategoryFields.PLUGIN_IDENTIFIER, category[0]), SearchRestrictions.eq(MenuCategoryFields.NAME, category[1])));
}
searchCriteriaBuilder.add(SearchRestrictions.not(disjunction));
}
});
}
use of com.qcadoo.model.api.search.CustomRestriction in project qcadoo by qcadoo.
the class CustomTranslationsListViewHooks method addDiscriminatorRestrictionToGrid.
public void addDiscriminatorRestrictionToGrid(final ViewDefinitionState view) {
GridComponent customTranslationsGrid = (GridComponent) view.getComponentByReference(QcadooViewConstants.L_GRID);
FieldComponent localeField = (FieldComponent) view.getComponentByReference(LOCALE);
final String locale = (String) localeField.getFieldValue();
if (StringUtils.isEmpty(locale)) {
customTranslationsGrid.setCustomRestriction(null);
} else {
customTranslationsGrid.setCustomRestriction(new CustomRestriction() {
@Override
public void addRestriction(final SearchCriteriaBuilder searchCriteriaBuilder) {
searchCriteriaBuilder.add(SearchRestrictions.eq(LOCALE, locale));
}
});
}
}
Aggregations