use of de.metas.ui.web.view.ViewResult in project metasfresh-webui-api by metasfresh.
the class BoardRestController method getNewCardsView.
@GetMapping("/{boardId}/newCardsView/{viewId}")
public JSONViewResult getNewCardsView(@PathVariable("boardId") final int boardId, @PathVariable("viewId") final String viewIdStr, @RequestParam("firstRow") final int firstRow, @RequestParam("pageLength") final int pageLength, @RequestParam(name = "orderBy", required = false) final String orderBysListStr) {
userSession.assertLoggedIn();
final ViewResult viewResult = viewsRepo.getView(viewIdStr).getPageWithRowIdsOnly(firstRow, pageLength, DocumentQueryOrderBy.parseOrderBysList(orderBysListStr));
final List<Integer> boardCardIds = boardsRepo.retrieveCardIds(boardId);
return toJSONCardsViewResult(boardId, viewResult, // language
userSession.getAD_Language(), // filter out cards which already exist in our board
cardId -> !boardCardIds.contains(cardId));
}
use of de.metas.ui.web.view.ViewResult in project metasfresh-webui-api by metasfresh.
the class BoardRestController method toJSONCardsViewResult.
private final JSONViewResult toJSONCardsViewResult(final int boardId, final IView view, final String adLanguage) {
final ViewResult viewResult = ViewResult.ofView(view);
final IViewRowOverrides rowOverrides = ViewRowOverridesHelper.getViewRowOverrides(view);
return JSONViewResult.of(viewResult, rowOverrides, adLanguage);
}
Aggregations