Examples of FilterAndSortCriteria


Examples of com.anasoft.os.daofusion.cto.client.FilterAndSortCriteria

    public CriteriaTransferObject wrap() {
        CriteriaTransferObject transferObjectForCount = new CriteriaTransferObject() {
           
            @Override
            public FilterAndSortCriteria get(String propertyId) {
                final FilterAndSortCriteria transferObjectCriteria = transferObject.get(propertyId);
               
                FilterAndSortCriteria criteriaForCount = new FilterAndSortCriteria(propertyId) {
                   
                    @Override
                    public String getPropertyId() {
                        return transferObjectCriteria.getPropertyId();
                    }
View Full Code Here

Examples of com.anasoft.os.daofusion.cto.client.FilterAndSortCriteria

    Set<String> propertyIdSet = transferObject.getPropertyIdSet();
    Map<String, List<NestedPropertyMapping>> propertyMappings = getPropertyMappings(mappingGroupName);
   
    if (propertyMappings != null) {
        for (String propertyId : propertyIdSet) {
            FilterAndSortCriteria clientSideCriteria = transferObject.get(propertyId);
            List<NestedPropertyMapping> mappingList = propertyMappings.get(propertyId);
               
            if (mappingList != null) {
                for (NestedPropertyMapping mapping : mappingList) {
                    LOG.info("Applying property mapping for propertyId '{}' within the mapping group '{}'", propertyId, mappingGroupName);
View Full Code Here

Examples of org.broadleafcommerce.openadmin.dto.FilterAndSortCriteria

            targetType = field.getType();
        }
        BasicFieldMetadata metadata = (BasicFieldMetadata) addSearchMappingRequest.getMergedProperties().get
                (addSearchMappingRequest.getPropertyName());
       
        FilterAndSortCriteria fasc = addSearchMappingRequest.getRequestedCto().get(addSearchMappingRequest.getPropertyName());

        FilterMapping filterMapping = new FilterMapping()
                .withInheritedFromClass(clazz)
                .withFullPropertyName(addSearchMappingRequest.getPropertyName())
                .withFilterValues(fasc.getFilterValues())
                .withSortDirection(fasc.getSortDirection());
        filterMappings.add(filterMapping);
       
        if (fasc.hasSpecialFilterValue()) {
            filterMapping.setDirectFilterValues(new EmptyFilterValues());
           
            // Handle special values on a case by case basis
            List<String> specialValues = fasc.getSpecialFilterValues();
            if (specialValues.contains(FilterAndSortCriteria.IS_NULL_FILTER_VALUE)) {
                filterMapping.setRestriction(new Restriction().withPredicateProvider(new IsNullPredicateProvider()));
            }
            if (specialValues.contains(FilterAndSortCriteria.IS_NOT_NULL_FILTER_VALUE)) {
                filterMapping.setRestriction(new Restriction().withPredicateProvider(new IsNotNullPredicateProvider()));
View Full Code Here

Examples of org.broadleafcommerce.openadmin.dto.FilterAndSortCriteria

       
        // This list of datums will populate the typeahead suggestions.
        List<Map<String, String>> responses = new ArrayList<Map<String, String>>();
        if (md instanceof BasicFieldMetadata) {
            String searchField = searchFieldResolver.resolveField(((BasicFieldMetadata) md).getForeignKeyClass());
            ppr.addFilterAndSortCriteria(new FilterAndSortCriteria(searchField, query));

            DynamicResultSet drs = service.getRecords(ppr).getDynamicResultSet();
            ClassMetadata lookupMetadata = service.getClassMetadata(ppr).getDynamicResultSet().getClassMetaData();
            for (Entity e : drs.getRecords()) {
                Map<String, String> responseMap = new HashMap<String, String>();
View Full Code Here

Examples of org.broadleafcommerce.openadmin.dto.FilterAndSortCriteria

       
        return results;
    }
   
    protected void addFriendlyRestriction(CriteriaTransferObject cto) {
        cto.add(new FilterAndSortCriteria("isFriendly", "true"));
    }
View Full Code Here

Examples of org.broadleafcommerce.openadmin.dto.FilterAndSortCriteria

                userSort = true;
                break;
            }
        }
        if (!userSort) {
            FilterAndSortCriteria sortFasc = new FilterAndSortCriteria("description");
            sortFasc.setSortAscending(true);
            cto.add(sortFasc);
        }
    }
View Full Code Here

Examples of org.broadleafcommerce.openadmin.dto.FilterAndSortCriteria

    /* ************** */
   
    public PersistencePackageRequest removeFilterAndSortCriteria(String name) {
        Iterator<FilterAndSortCriteria> it = filterAndSortCriteria.listIterator();
        while (it.hasNext()) {
            FilterAndSortCriteria fasc = it.next();
            if (fasc.getPropertyId().equals(name)) {
                it.remove();
            }
        }
        return this;
    }
View Full Code Here

Examples of org.broadleafcommerce.openadmin.dto.FilterAndSortCriteria

        if (md instanceof BasicFieldMetadata) {
            String idProp = ((BasicFieldMetadata) md).getForeignKeyProperty();
            String displayProp = ((BasicFieldMetadata) md).getForeignKeyDisplayValueProperty();

            List<String> filterValues = BLCArrayUtils.asList(ids.split(FILTER_VALUE_SEPARATOR_REGEX));
            ppr.addFilterAndSortCriteria(new FilterAndSortCriteria(idProp, filterValues));
           
            DynamicResultSet drs = service.getRecords(ppr).getDynamicResultSet();
            Map<String, String> returnMap = new HashMap<String, String>();
           
            for (Entity e : drs.getRecords()) {
View Full Code Here

Examples of org.broadleafcommerce.openadmin.dto.FilterAndSortCriteria

    @Override
    public PersistenceResponse getRecord(PersistencePackageRequest request, String id, ClassMetadata cmd, boolean isCollectionRequest)
            throws ServiceException {
        String idProperty = getIdProperty(cmd);
       
        FilterAndSortCriteria fasc = new FilterAndSortCriteria(idProperty);
        fasc.setFilterValue(id);
        request.addFilterAndSortCriteria(fasc);

        PersistenceResponse response = fetch(request);
        Entity[] entities = response.getDynamicResultSet().getRecords();
        Assert.isTrue(entities != null && entities.length == 1, "Entity not found");
View Full Code Here

Examples of org.broadleafcommerce.openadmin.dto.FilterAndSortCriteria

        ppr.setSectionEntityField(collectionProperty.getName());

        PersistenceResponse response;

        if (md instanceof AdornedTargetCollectionMetadata) {
            FilterAndSortCriteria fasc = new FilterAndSortCriteria(ppr.getAdornedList().getCollectionFieldName());
            fasc.setFilterValue(containingEntityId);
            ppr.addFilterAndSortCriteria(fasc);

            fasc = new FilterAndSortCriteria(ppr.getAdornedList().getCollectionFieldName() + "Target");
            fasc.setFilterValue(collectionItemId);
            ppr.addFilterAndSortCriteria(fasc);

            response = fetch(ppr);
            Entity[] entities = response.getDynamicResultSet().getRecords();
            Assert.isTrue(entities != null && entities.length == 1, "Entity not found");
        } else if (md instanceof MapMetadata) {
            MapMetadata mmd = (MapMetadata) md;
            FilterAndSortCriteria fasc = new FilterAndSortCriteria(ppr.getForeignKey().getManyToField());
            fasc.setFilterValue(containingEntityId);
            ppr.addFilterAndSortCriteria(fasc);

            response = fetch(ppr);
            Entity[] entities = response.getDynamicResultSet().getRecords();
            for (Entity e : entities) {
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.