@Override public boolean isActive() { if (LOG.isDebugEnabled()) { if (!DateUtil.isActive(activeStartDate, activeEndDate, true)) { LOG.debug("category, " + id + ", inactive due to date"); } if ('Y'==getArchived()) { LOG.debug("category, " + id + ", inactive due to archived status"); } } return DateUtil.isActive(activeStartDate, activeEndDate, true) && 'Y'!=getArchived(); }
@Override public List<Product> readFilteredActiveProductsByQuery(String query, SearchCriteria searchCriteria) { Date currentDate = DateUtil.getCurrentDateAfterFactoringInDateResolution(cachedDate, currentDateResolution); return readFilteredActiveProductsByQueryInternal(query, currentDate, searchCriteria); }
@Override public boolean isActive() { return DateUtil.isActive(startDate, endDate, true) && 'Y'!=getArchived(); }
@Override public List<Sku> readAllActiveSkus(int page, int pageSize) { Date currentDate = DateUtil.getCurrentDateAfterFactoringInDateResolution(cachedDate, currentDateResolution); return readAllActiveSkusInternal(page, pageSize, currentDate); }
@Override public boolean isActive() { return DateUtil.isActive(activeStartDate, activeEndDate, true) && 'Y' != getArchived(); }
@Override public List<Product> readFilteredActiveProductsByCategory(Long categoryId, SearchCriteria searchCriteria) { Date currentDate = DateUtil.getCurrentDateAfterFactoringInDateResolution(cachedDate, currentDateResolution); return readFilteredActiveProductsByCategoryInternal(categoryId, currentDate, searchCriteria); }
@Override public boolean isActive() { return DateUtil.isActive(startDate, endDate, true) && 'Y'!=getArchived(); }
@Override public List<Product> readAllActiveProducts() { Date currentDate = DateUtil.getCurrentDateAfterFactoringInDateResolution(cachedDate, currentDateResolution); return readAllActiveProductsInternal(currentDate); }
@Override public boolean isActive() { if (LOG.isDebugEnabled()) { if (!DateUtil.isActive(getActiveStartDate(), getActiveEndDate(), true)) { LOG.debug("product, " + id + ", inactive due to date"); } if ('Y' == getArchived()) { LOG.debug("product, " + id + ", inactive due to archived status"); } } return DateUtil.isActive(getActiveStartDate(), getActiveEndDate(), true) && 'Y' != getArchived(); }
@Override public List<Sku> readAllActiveSkus(Integer pageSize, Long lastId) { Date currentDate = DateUtil.getCurrentDateAfterFactoringInDateResolution(cachedDate, currentDateResolution); return readAllActiveSkusInternal(pageSize, currentDate, lastId); }
@Override public boolean isActive() { boolean datesActive; // If the start date for this offer code has not been set, just delegate to the offer to determine if the code is // active rather than requiring the user to set offer code dates as well if (offerCodeStartDate == null) { datesActive = DateUtil.isActive(getOffer().getStartDate(), getOffer().getEndDate(), true); } else { datesActive = DateUtil.isActive(offerCodeStartDate, offerCodeEndDate, true); } return datesActive && 'Y' != getArchived(); }
@Override public List<Product> readActiveProductsByCategory(Long categoryId) { Date currentDate = DateUtil.getCurrentDateAfterFactoringInDateResolution(cachedDate, currentDateResolution); return readActiveProductsByCategoryInternal(categoryId, currentDate); }
@Override public boolean isActive(Product product, Category category) { if (LOG.isDebugEnabled()) { if (!DateUtil.isActive(getActiveStartDate(), getActiveEndDate(), true)) { LOG.debug("sku, " + id + ", inactive due to date"); } else if (!product.isActive()) { LOG.debug("sku, " + id + ", inactive due to product being inactive"); } else if (!category.isActive()) { LOG.debug("sku, " + id + ", inactive due to category being inactive"); } } return this.isActive() && (product == null || product.isActive()) && (category == null || category.isActive()); }
@Override public List<Product> readActiveProductsByCategory(Long categoryId, int limit, int offset) { Date currentDate = DateUtil.getCurrentDateAfterFactoringInDateResolution(cachedDate, currentDateResolution); return readActiveProductsByCategoryInternal(categoryId, currentDate, limit, offset); }
@Override public boolean isActive() { if (activeStartDate == null && activeEndDate == null && hasDefaultSku()) { return lookupDefaultSku().isActive(); } if (LOG.isDebugEnabled()) { if (!DateUtil.isActive(getActiveStartDate(), getActiveEndDate(), true)) { LOG.debug("sku, " + id + ", inactive due to date"); } } if (!(getProduct() == null) && !getProduct().isActive()) { return false; } return DateUtil.isActive(getActiveStartDate(), getActiveEndDate(), true); }
@Override public Long readCountAllActiveSkus() { Date currentDate = DateUtil.getCurrentDateAfterFactoringInDateResolution(cachedDate, currentDateResolution); return readCountAllActiveSkusInternal(currentDate); }
protected void addIsActiveStatus(RecordHelper helper, Entity entity) { if (isActiveFilter) { try { boolean isActive = false; Property startDate = entity.findProperty("startDate"); if (startDate != null && StringUtils.isNotBlank(startDate.getValue())) { Property endDate = entity.findProperty("endDate"); Date end = null; if (endDate != null && StringUtils.isNotBlank(endDate.getValue())) { end = helper.getSimpleDateFormatter().parse(endDate.getValue()); } Date date = helper.getSimpleDateFormatter().parse(startDate.getValue()); isActive = DateUtil.isActive(date, end, true); } entity.addProperty(buildIsActiveProperty(isActive)); } catch (ParseException e) { throw ExceptionHelper.refineException(e); } } }
@Override public List<Product> readAllActiveProducts(int page, int pageSize) { Date currentDate = DateUtil.getCurrentDateAfterFactoringInDateResolution(cachedDate, currentDateResolution); return readAllActiveProductsInternal(page, pageSize, currentDate); }
@Override public List<Product> readAllActiveProducts(Integer pageSize, Long lastId) { Date currentDate = DateUtil.getCurrentDateAfterFactoringInDateResolution(cachedDate, currentDateResolution); return readAllActiveProductsInternal(pageSize, currentDate, lastId); }
@Override public Long readCountAllActiveProducts() { Date currentDate = DateUtil.getCurrentDateAfterFactoringInDateResolution(cachedDate, currentDateResolution); return readCountAllActiveProductsInternal(currentDate); }