Package org.hoteia.qalingo.core.domain

Examples of org.hoteia.qalingo.core.domain.CatalogCategoryMasterAttribute


      Map<String, String> attributes = catalogCategoryForm.getGlobalAttributes();
      boolean doesntExist = true;
      for (Iterator<String> iterator = attributes.keySet().iterator(); iterator.hasNext();) {
        String attributeKey = (String) iterator.next();
        for (Iterator<CatalogCategoryMasterAttribute> iteratorCategoryGlobalAttributes = catalogCategory.getGlobalAttributes().iterator(); iteratorCategoryGlobalAttributes.hasNext();) {
          CatalogCategoryMasterAttribute catalogCategoryMasterAttribute = (CatalogCategoryMasterAttribute) iteratorCategoryGlobalAttributes.next();
          if(catalogCategoryMasterAttribute.getAttributeDefinition().getCode().equals(attributeKey)) {
              catalogCategoryMasterAttribute.setValue(catalogCategoryForm.getGlobalAttributes().get(attributeKey));
            doesntExist = false;
          }
        }
        if(doesntExist) {
          String value = attributes.get(attributeKey);
          if(StringUtils.isNotEmpty(value)) {
            catalogCategory.getMarketAreaAttributes(marketArea.getId()).add(buildCatalogCategoryMasterAttribute(marketArea, localization, attributeKey, value, true));
          }
        }
      }
    }
   
    if(catalogCategoryForm != null
        && catalogCategoryForm.getMarketAreaAttributes() != null) {
      Map<String, String> attributes = catalogCategoryForm.getMarketAreaAttributes();
      boolean doesntExist = true;
      for (Iterator<String> iterator = attributes.keySet().iterator(); iterator.hasNext();) {
        String attributeKey = (String) iterator.next();
        for (Iterator<CatalogCategoryMasterAttribute> iteratorCategoryMarketAttributes = catalogCategory.getMarketAreaAttributes(marketArea.getId()).iterator(); iteratorCategoryMarketAttributes.hasNext();) {
          CatalogCategoryMasterAttribute catalogCategoryMasterAttribute = (CatalogCategoryMasterAttribute) iteratorCategoryMarketAttributes.next();
          if(catalogCategoryMasterAttribute.getAttributeDefinition().getCode().equals(attributeKey)) {
              catalogCategoryMasterAttribute.setValue(catalogCategoryForm.getMarketAreaAttributes().get(attributeKey));
            doesntExist = false;
          }
        }
        if(doesntExist) {
          String value = attributes.get(attributeKey);
View Full Code Here


  private CatalogCategoryMasterAttribute buildCatalogCategoryMasterAttribute(final MarketArea marketArea, final Localization localization, final String attributeKey, final String attributeValue, boolean isGlobal) {
   
    //TODO : denis : 20130125 : add cache
    AttributeDefinition attributeDefinition = attributeService.getAttributeDefinitionByCode(attributeKey);

    CatalogCategoryMasterAttribute catalogCategoryMasterAttribute = new CatalogCategoryMasterAttribute();
    catalogCategoryMasterAttribute.setAttributeDefinition(attributeDefinition);
    catalogCategoryMasterAttribute.setLocalizationCode(localization.getCode());
    catalogCategoryMasterAttribute.setMarketAreaId(marketArea.getId());
    catalogCategoryMasterAttribute.setStartDate(new Date());
    catalogCategoryMasterAttribute.setValue(attributeValue);
    return catalogCategoryMasterAttribute;
  }
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.domain.CatalogCategoryMasterAttribute

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.