Examples of CustomerAttribute


Examples of org.broadleafcommerce.profile.core.domain.CustomerAttribute

        wrapDetails(model, request);
    }

    @Override
    public CustomerAttribute unwrap(HttpServletRequest request, ApplicationContext context) {
        CustomerAttribute attribute = new CustomerAttributeImpl();
        attribute.setId(id);
        attribute.setName(name);
        attribute.setValue(value);
        return attribute;
    }
View Full Code Here

Examples of org.broadleafcommerce.profile.core.domain.CustomerAttribute

        customer.setFirstName(this.firstName);
        customer.setLastName(this.lastName);
        customer.setEmailAddress(this.emailAddress);
        if (customerAttributes != null) {
            for (CustomerAttributeWrapper customerAttributeWrapper : customerAttributes) {
            CustomerAttribute attribute = customerAttributeWrapper.unwrap(request, context);
                attribute.setCustomer(customer);
            customer.getCustomerAttributes().put(attribute.getName(), attribute);
        }
        }
        return customer;
    }
View Full Code Here

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

    if(customer.getPermalink() == null){
      customer.setPermalink(UUID.randomUUID().toString());
    }
   
    for (Iterator<CustomerAttribute> iterator = customer.getAttributes().iterator(); iterator.hasNext();) {
      CustomerAttribute customerAttribute = (CustomerAttribute) iterator.next();
      // ATTRIBUTE DEFINITION CAN'T BE NULL
          if(customerAttribute.getAttributeDefinition() == null){
            throw new CustomerAttributeException("Attribute Definition can't be null!");
          }
      // MARKET AREA CAN'T BE NULL IF ATTRIBUTE IS NOT GLOBAL
          if(!customerAttribute.getAttributeDefinition().isGlobal()
              && customerAttribute.getMarketAreaId() == null){
            throw new CustomerAttributeException("Market Area can't be null if Attribute is not global!");
          }
        }
        if (customer.getId() != null) {
            if(em.contains(customer)){
View Full Code Here

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

        customer.setFirstname(firstName);
        customer.setLastname(lastName);
       
        customer.setNetworkOrigin(CustomerNetworkOrigin.TWITTER);

        CustomerAttribute attribute = new CustomerAttribute();
        AttributeDefinition attributeDefinition = attributeService.getAttributeDefinitionByCode(CustomerAttribute.CUSTOMER_ATTRIBUTE_SCREENAME);
        attribute.setAttributeDefinition(attributeDefinition);
        String screenName = "";
        if(StringUtils.isNotEmpty(lastName)){
          if(StringUtils.isNotEmpty(lastName)){
            screenName = lastName;
            if(screenName.length() > 1){
              screenName = screenName.substring(0, 1);
            }
            if(!screenName.endsWith(".")){
              screenName = screenName + ". ";
            }
          }
        }
        screenName = screenName + firstName;
        attribute.setShortStringValue(screenName);
        customer.getAttributes().add(attribute);
       
        if(StringUtils.isNotEmpty(locale)){
          customer.setDefaultLocale(locale);
        }
View Full Code Here

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

                    customer.setGender(gender);
                }

                customer.setNetworkOrigin(CustomerNetworkOrigin.GOOGLE_ACCOUNT);

                CustomerAttribute attribute = new CustomerAttribute();
                AttributeDefinition attributeDefinition = attributeService.getAttributeDefinitionByCode(CustomerAttribute.CUSTOMER_ATTRIBUTE_SCREENAME);
                attribute.setAttributeDefinition(attributeDefinition);
                String screenName = username;
                if (StringUtils.isEmpty(screenName)) {
                    if (StringUtils.isNotEmpty(lastName)) {
                        if (StringUtils.isNotEmpty(lastName)) {
                            screenName = lastName;
                            if (screenName.length() > 1) {
                                screenName = screenName.substring(0, 1);
                            }
                            if (!screenName.endsWith(".")) {
                                screenName = screenName + ". ";
                            }
                        }
                    }
                    screenName = screenName + firstName;
                }
                attribute.setShortStringValue(screenName);
                customer.getAttributes().add(attribute);

                customerService.saveOrUpdateCustomer(customer);
            }
View Full Code Here

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

          customer.setGender(gender);
        }
       
        customer.setNetworkOrigin(CustomerNetworkOrigin.FACEBOOK);
       
        CustomerAttribute attribute = new CustomerAttribute();
        AttributeDefinition attributeDefinition = attributeService.getAttributeDefinitionByCode(CustomerAttribute.CUSTOMER_ATTRIBUTE_SCREENAME);
        attribute.setAttributeDefinition(attributeDefinition);
        String screenName = username;
        if(StringUtils.isEmpty(screenName)){
          if(StringUtils.isNotEmpty(lastName)){
            if(StringUtils.isNotEmpty(lastName)){
              screenName = lastName;
              if(screenName.length() > 1){
                screenName = screenName.substring(0, 1);
              }
              if(!screenName.endsWith(".")){
                screenName = screenName + ". ";
              }
            }
          }
          screenName = screenName + firstName;
        }
        attribute.setShortStringValue(screenName);
        customer.getAttributes().add(attribute);
       
        if(StringUtils.isNotEmpty(locale)){
          customer.setDefaultLocale(locale);
        }
View Full Code Here

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

          customer.setGender(gender);
        }
       
        customer.setNetworkOrigin(CustomerNetworkOrigin.WINDOWS_LIVE);
       
        CustomerAttribute attribute = new CustomerAttribute();
        AttributeDefinition attributeDefinition = attributeService.getAttributeDefinitionByCode(CustomerAttribute.CUSTOMER_ATTRIBUTE_SCREENAME);
        attribute.setAttributeDefinition(attributeDefinition);
        String screenName = "";
        if(StringUtils.isNotEmpty(lastName)){
          if(StringUtils.isNotEmpty(lastName)){
            screenName = lastName;
            if(screenName.length() > 1){
              screenName = screenName.substring(0, 1);
            }
            if(!screenName.endsWith(".")){
              screenName = screenName + ". ";
            }
          }
        }
        screenName = screenName + firstName;
        attribute.setShortStringValue(screenName);
        customer.getAttributes().add(attribute);
       
        if(StringUtils.isNotEmpty(locale)){
          customer.setDefaultLocale(locale);
        }
View Full Code Here

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

      customer.setLastname(auth.getLastname());
      if(StringUtils.isNotEmpty(auth.getGender())){
        customer.setGender(auth.getGender());
      }
     
      CustomerAttribute attribute = new CustomerAttribute();
      AttributeDefinition attributeDefinition = attributeService.getAttributeDefinitionByCode(CustomerAttribute.CUSTOMER_ATTRIBUTE_SCREENAME);
      attribute.setAttributeDefinition(attributeDefinition);
      String screenName = "";
      if(StringUtils.isNotEmpty(auth.getLastname())){
        if(StringUtils.isNotEmpty(auth.getLastname())){
          screenName = auth.getLastname();
          if(screenName.length() > 1){
            screenName = screenName.substring(0, 1);
          }
          if(!screenName.endsWith(".")){
            screenName = screenName + ". ";
          }
        }
      }
      screenName = screenName + auth.getFirstname();
      attribute.setShortStringValue(screenName);
      customer.getAttributes().add(attribute);
     
      if(StringUtils.isNotEmpty(auth.getLanguage())){
        customer.setDefaultLocale(auth.getLanguage());
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.