Search in sources :

Example 1 with ItemCriteriaDTO

use of org.broadleafcommerce.common.structure.dto.ItemCriteriaDTO in project BroadleafCommerce by BroadleafCommerce.

the class PageServiceUtility method buildItemCriteriaDTOList.

protected List<ItemCriteriaDTO> buildItemCriteriaDTOList(Page page) {
    List<ItemCriteriaDTO> itemCriteriaDTOList = new ArrayList<ItemCriteriaDTO>();
    for (PageItemCriteria criteria : page.getQualifyingItemCriteria()) {
        ItemCriteriaDTO criteriaDTO = new ItemCriteriaDTO();
        criteriaDTO.setMatchRule(criteria.getMatchRule());
        criteriaDTO.setQty(criteria.getQuantity());
        itemCriteriaDTOList.add(criteriaDTO);
    }
    return itemCriteriaDTOList;
}
Also used : PageItemCriteria(org.broadleafcommerce.cms.page.domain.PageItemCriteria) ArrayList(java.util.ArrayList) ItemCriteriaDTO(org.broadleafcommerce.common.structure.dto.ItemCriteriaDTO)

Example 2 with ItemCriteriaDTO

use of org.broadleafcommerce.common.structure.dto.ItemCriteriaDTO in project BroadleafCommerce by BroadleafCommerce.

the class StructuredContentServiceImpl method buildItemCriteriaDTOList.

protected List<ItemCriteriaDTO> buildItemCriteriaDTOList(StructuredContent sc) {
    List<ItemCriteriaDTO> itemCriteriaDTOList = new ArrayList<>();
    Set<StructuredContentItemCriteria> qualifyingItemCriteria = SetUtils.emptyIfNull(sc.getQualifyingItemCriteria());
    for (StructuredContentItemCriteria criteria : qualifyingItemCriteria) {
        ItemCriteriaDTO criteriaDTO = entityConfiguration.createEntityInstance(ItemCriteriaDTO.class.getName(), ItemCriteriaDTO.class);
        criteriaDTO.setMatchRule(criteria.getMatchRule());
        criteriaDTO.setQty(criteria.getQuantity());
        itemCriteriaDTOList.add(criteriaDTO);
    }
    return itemCriteriaDTOList;
}
Also used : StructuredContentItemCriteria(org.broadleafcommerce.cms.structure.domain.StructuredContentItemCriteria) ArrayList(java.util.ArrayList) ItemCriteriaDTO(org.broadleafcommerce.common.structure.dto.ItemCriteriaDTO)

Aggregations

ArrayList (java.util.ArrayList)2 ItemCriteriaDTO (org.broadleafcommerce.common.structure.dto.ItemCriteriaDTO)2 PageItemCriteria (org.broadleafcommerce.cms.page.domain.PageItemCriteria)1 StructuredContentItemCriteria (org.broadleafcommerce.cms.structure.domain.StructuredContentItemCriteria)1