Package smilehouse.openinterface

Examples of smilehouse.openinterface.CustomerCriteria


        // This component does not support iteration, so we output all our data
        // once (and only once)
        if( this.allDataOutput == true ) return null;
        else this.allDataOutput = true;
       
        CustomerCriteria criteria = new CustomerCriteria();
       
        // Customer id in
        String customerIdStr = this.data.getAttribute(CUSTOMER_ID_ATTR);
        if(customerIdStr != null && customerIdStr.length() > 0)
            criteria.setCustomerId(customerIdStr);
       
        // id greater than
        String idGTStr = this.data.getAttribute(ID_GREATER_THAN_ATTR);
        if(idGTStr != null && idGTStr.length() > 0)
                criteria.setIdGreaterThan(new String(idGTStr));

        // id less than
        String idLTStr = this.data.getAttribute(ID_LESS_THAN_ATTR);
        if(idLTStr != null && idLTStr.length() > 0)
                criteria.setIdLessThan(new String(idLTStr));

        // id in
        String idInStr = this.data.getAttribute(ID_IN_ATTR);
        if(idInStr != null && idInStr.length() > 0) {
            String[] idInStrArray = Utils.split(idInStr, ",");
            Long[] idInLongArray = new Long[idInStrArray.length];
                criteria.setIdIn(idInStrArray);
        }
       
        // Primary customer group
        String primaryCustomerGroupStr = this.data.getAttribute(PRIMARY_CUSTOMER_GROUP_ATTR);
        if(primaryCustomerGroupStr != null && primaryCustomerGroupStr.length() > 0)
            criteria.setPrimaryCustomerGroup(primaryCustomerGroupStr);
       
        // Customer group
        String customerGroupStr = this.data.getAttribute(CUSTOMER_GROUP_ATTR);
        if(customerGroupStr != null && customerGroupStr.length() > 0)
            criteria.setCustomerGroup(customerGroupStr);
       
        // Date created before
        Date dateCreatedBefore = getDateCreatedBefore();
        if(dateCreatedBefore != null) {
            Calendar dateCreatedBeforeCal = new GregorianCalendar();
            dateCreatedBeforeCal.setTime(dateCreatedBefore);
            criteria.setFirstVisitDateBefore(dateCreatedBeforeCal);
        }
       
        // Date created after
        Date dateCreatedAfter = getDateCreatedAfter();
        if(dateCreatedAfter != null) {
            Calendar dateCreatedAfterCal = new GregorianCalendar();
            dateCreatedAfterCal.setTime(dateCreatedAfter);
            criteria.setFirstVisitDateAfter(dateCreatedAfterCal);
        }
      
        // Date before last visited
        Date dateLastVisitBefore = getDateLastVisitBefore();
        if(dateLastVisitBefore != null) {
            Calendar dateLastVisitBeforeCal = new GregorianCalendar();
            dateLastVisitBeforeCal.setTime(dateLastVisitBefore);
            criteria.setLastVisitDateBefore(dateLastVisitBeforeCal);
        }

        // Date after last visited
        Date dateLastVisitAfter = getDateLastVisitAfter();
        if(dateLastVisitAfter != null) {
            Calendar dateLastVisitAfterCal = new GregorianCalendar();
            dateLastVisitAfterCal.setTime(dateLastVisitAfter);
            criteria.setLastVisitDateAfter(dateLastVisitAfterCal);
        }
       
        //Date before customer modified
        Date dateCustomerModifiedBefore = getDateCustModifiedBefore();
        if(dateCustomerModifiedBefore != null) {
            Calendar dateCustomerModifiedBeforeCal = new GregorianCalendar();
            dateCustomerModifiedBeforeCal.setTime(dateCustomerModifiedBefore);
            criteria.setCustomerModifiedBefore(dateCustomerModifiedBeforeCal);
        }
       
        //Date after customer modified
        Date dateCustomerModifiedAfter = getDateCustModifiedAfter();
        if(dateCustomerModifiedAfter != null) {
            Calendar dateCustomerModifiedAfterCal = new GregorianCalendar();
            dateCustomerModifiedAfterCal.setTime(dateCustomerModifiedAfter);
            criteria.setCustomerModifiedAfter(dateCustomerModifiedAfterCal);
        }
       
        //Date before admin modified
        Date dateAdminModifiedBefore = getDateAdminModifiedBefore();
        if(dateAdminModifiedBefore != null) {
            Calendar dateAdminModifiedBeforeCal = new GregorianCalendar();
            dateAdminModifiedBeforeCal.setTime(dateAdminModifiedBefore);
            criteria.setAdminModifiedBefore(dateAdminModifiedBeforeCal);
        }
       
        //Date after admin modified
        Date dateAdminModifiedAfter = getDateAdminModifiedAfter();
        if(dateAdminModifiedAfter != null) {
            Calendar dateAdminModifiedAfterCal = new GregorianCalendar();
            dateAdminModifiedAfterCal.setTime(dateAdminModifiedAfter);
            criteria.setAdminModifiedAfter(dateAdminModifiedAfterCal);
        }
       
        //Define the operation type.
        String customerModifyOperationType = getModifyOperation();
        if(customerModifyOperationType != null){
          criteria.setModifyOperation(customerModifyOperationType);
        }
       
        logger.logMessage("Calling Open Interface", this, MessageLogger.DEBUG);
        try {
            ExportResult result;
View Full Code Here

TOP

Related Classes of smilehouse.openinterface.CustomerCriteria

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.