Package org.ofbiz.entity

Examples of org.ofbiz.entity.GenericEntity$NULL


                // product feature and add it to the id code and product feature applications
                // of the next variant.  just a matter of whether we're starting with an
                // existing list of features and id code or from scratch.
                if (combinations.size()==0) {
                    for (Iterator cFi = currentFeatures.iterator(); cFi.hasNext(); ) {
                        GenericEntity currentFeature = (GenericEntity) cFi.next();
                        if (currentFeature.getString("productFeatureApplTypeId").equals("SELECTABLE_FEATURE")) {
                            Map newCombination = new HashMap();
                            List newFeatures = new LinkedList();
                            List newFeatureIds = new LinkedList();
                            if (currentFeature.getString("idCode") != null) {
                                newCombination.put("defaultVariantProductId", productId + currentFeature.getString("idCode"));
                            } else {
                                newCombination.put("defaultVariantProductId", productId);
                            }
                            newFeatures.add(currentFeature);
                            newFeatureIds.add(currentFeature.getString("productFeatureId"));
                            newCombination.put("curProductFeatureAndAppls", newFeatures);
                            newCombination.put("curProductFeatureIds", newFeatureIds);
                            newCombinations.add(newCombination);
                        }
                    }
                } else {
                    for (Iterator comboIt = combinations.iterator(); comboIt.hasNext(); ) {
                        Map combination = (Map) comboIt.next();
                        for (Iterator cFi = currentFeatures.iterator(); cFi.hasNext(); ) {
                            GenericEntity currentFeature = (GenericEntity) cFi.next();
                            if (currentFeature.getString("productFeatureApplTypeId").equals("SELECTABLE_FEATURE")) {
                                Map newCombination = new HashMap();
                                // .clone() is important, or you'll keep adding to the same List for all the variants
                                // have to cast twice: once from get() and once from clone()
                                List newFeatures = ((List) ((LinkedList) combination.get("curProductFeatureAndAppls")).clone());
                                List newFeatureIds = ((List) ((LinkedList) combination.get("curProductFeatureIds")).clone());
                                if (currentFeature.getString("idCode") != null) {
                                    newCombination.put("defaultVariantProductId", combination.get("defaultVariantProductId") + currentFeature.getString("idCode"));
                                } else {
                                    newCombination.put("defaultVariantProductId", combination.get("defaultVariantProductId"));
                                }
                                newFeatures.add(currentFeature);
                                newFeatureIds.add(currentFeature.getString("productFeatureId"));
                                newCombination.put("curProductFeatureAndAppls", newFeatures);
                                newCombination.put("curProductFeatureIds", newFeatureIds);
                                newCombinations.add(newCombination);
                            }
                        }
View Full Code Here


            GenericValue value = (GenericValue) context.get("value");
            if (Debug.infoOn()) Debug.logInfo("Got a clear cache line by value service call; entityName: " + value.getEntityName(), module);
            if (Debug.verboseOn()) Debug.logVerbose("Got a clear cache line by value service call; value: " + value, module);
            delegator.clearCacheLine(value, distribute);
        } else if (context.containsKey("dummyPK")) {
            GenericEntity dummyPK = (GenericEntity) context.get("dummyPK");
            if (Debug.infoOn()) Debug.logInfo("Got a clear cache line by dummyPK service call; entityName: " + dummyPK.getEntityName(), module);
            if (Debug.verboseOn()) Debug.logVerbose("Got a clear cache line by dummyPK service call; dummyPK: " + dummyPK, module);
            delegator.clearCacheLineFlexible(dummyPK, distribute);
        } else if (context.containsKey("primaryKey")) {
            GenericPK primaryKey = (GenericPK) context.get("primaryKey");
            if (Debug.infoOn()) Debug.logInfo("Got a clear cache line by primaryKey service call; entityName: " + primaryKey.getEntityName(), module);
View Full Code Here

            }
            Object retVal = null;
            if (this.entryAcsr != null && !this.entryAcsr.isEmpty()) {
                //Debug.logInfo("Getting entry, using entryAcsr for field " + this.getName() + " of form " + this.modelForm.getName(), module);
                if (dataMap instanceof GenericEntity) {
                    GenericEntity genEnt = (GenericEntity) dataMap;
                    if (genEnt.getModelEntity().isField(this.entryAcsr.getOriginalName())) {
                        retVal = genEnt.get(this.entryAcsr.getOriginalName());
                    } else {
                      //TODO: this may never come up, but if necessary use the FlexibleStringExander to eval the name first: String evaled = this.entryAcsr
                    }
                } else {
                    retVal = this.entryAcsr.get(dataMap);
View Full Code Here

            delegator = GenericDelegator.getGenericDelegator(delegatorName);
        }

        Map inMap = (Map) mapAcsr.get(methodContext);
        if (UtilValidate.isEmpty(entityName) && inMap instanceof GenericEntity) {
            GenericEntity inEntity = (GenericEntity) inMap;
            entityName = inEntity.getEntityName();
        }
       
        List fieldsToSelectList = null;
        if (!fieldsToSelectListAcsr.isEmpty()) {
            fieldsToSelectList = (List) fieldsToSelectListAcsr.get(methodContext);
View Full Code Here

         finAccountCode = finAccountCode.toUpperCase().replaceAll(filterRegex.pattern(), "");
        
         // now we need to get the encrypted version of the fin account code the user passed in to look up against FinAccount
         // we do this by making a temporary generic entity with same finAccountCode and then doing a match
         ModelEntity finAccountEntity = delegator.getModelEntity("FinAccount");
         GenericEntity encryptedFinAccount = GenericEntity.createGenericEntity(finAccountEntity, UtilMisc.toMap("finAccountCode", finAccountCode));
         delegator.encryptFields(encryptedFinAccount);
         String encryptedFinAccountCode = encryptedFinAccount.getString("finAccountCode");
        
         // now look for the account
         List accounts = delegator.findByAnd("FinAccount", UtilMisc.toMap("finAccountCode", encryptedFinAccountCode));
         accounts = EntityUtil.filterByDate(accounts);
        
View Full Code Here

        return partyObject;
    }

    public String getDistributorId() {
        try {
            GenericEntity distributorRole = EntityUtil.getFirst(orderHeader.getRelatedByAnd("OrderRole", UtilMisc.toMap("roleTypeId", "DISTRIBUTOR")));

            return distributorRole == null ? null : distributorRole.getString("partyId");
        } catch (GenericEntityException e) {
            Debug.logWarning(e, module);
        }
        return null;
    }
View Full Code Here

        return null;
    }

    public String getAffiliateId() {
        try {
            GenericEntity distributorRole = EntityUtil.getFirst(orderHeader.getRelatedByAnd("OrderRole", UtilMisc.toMap("roleTypeId", "AFFILIATE")));

            return distributorRole == null ? null : distributorRole.getString("partyId");
        } catch (GenericEntityException e) {
            Debug.logWarning(e, module);
        }
        return null;
    }
View Full Code Here

             */
            List productAssocs = EntityUtil.filterByDate(delegator.findByAnd("ProductAssoc", UtilMisc.toMap("productId", productId, "productAssocTypeId", "PRODUCT_VARIANT")), true);
            if (productAssocs != null && productAssocs.size() > 0) {
                Iterator productAssocIter = productAssocs.iterator();
                while (productAssocIter.hasNext()) {
                    GenericEntity productAssoc = (GenericEntity) productAssocIter.next();
                   
                    //for each associated product, if it has all standard features, display it's productId
                    boolean hasAllFeatures = true;
                    Iterator curProductFeatureAndApplIter = curProductFeatureAndAppls.iterator();
                    while (curProductFeatureAndApplIter.hasNext()) {
                        String productFeatureAndAppl = (String) curProductFeatureAndApplIter.next();
                        Map findByMap = UtilMisc.toMap("productId", productAssoc.getString("productIdTo"),
                                "productFeatureId", productFeatureAndAppl,
                                "productFeatureApplTypeId", "STANDARD_FEATURE");

                        //Debug.log("Using findByMap: " + findByMap);

                        List standardProductFeatureAndAppls = EntityUtil.filterByDate(delegator.findByAnd("ProductFeatureAppl", findByMap), true);
                        if (standardProductFeatureAndAppls == null || standardProductFeatureAndAppls.size() == 0) {
                            // Debug.log("Does NOT have this standard feature");
                            hasAllFeatures = false;
                            break;
                        } else {
                            // Debug.log("DOES have this standard feature");
                        }
                    }

                    if (hasAllFeatures) {
                        // add to list of existing variants: productId=productAssoc.productIdTo
                        existingVariantProductIds.add(productAssoc.get("productIdTo"));
                    }
                }
            }
            results = ServiceUtil.returnSuccess();
            results.put("variantProductIds", existingVariantProductIds);
View Full Code Here

                // product feature and add it to the id code and product feature applications
                // of the next variant.  just a matter of whether we're starting with an
                // existing list of features and id code or from scratch.
                if (combinations.size()==0) {
                    for (Iterator cFi = currentFeatures.iterator(); cFi.hasNext(); ) {
                        GenericEntity currentFeature = (GenericEntity) cFi.next();
                        if (currentFeature.getString("productFeatureApplTypeId").equals("SELECTABLE_FEATURE")) {
                            Map newCombination = new HashMap();
                            List newFeatures = new LinkedList();
                            List newFeatureIds = new LinkedList();
                            if (currentFeature.getString("idCode") != null) {
                                newCombination.put("defaultVariantProductId", productId + currentFeature.getString("idCode"));
                            } else {
                                newCombination.put("defaultVariantProductId", productId);
                            }
                            newFeatures.add(currentFeature);
                            newFeatureIds.add(currentFeature.getString("productFeatureId"));
                            newCombination.put("curProductFeatureAndAppls", newFeatures);
                            newCombination.put("curProductFeatureIds", newFeatureIds);
                            newCombinations.add(newCombination);
                        }
                    }
                } else {
                    for (Iterator comboIt = combinations.iterator(); comboIt.hasNext(); ) {
                        Map combination = (Map) comboIt.next();
                        for (Iterator cFi = currentFeatures.iterator(); cFi.hasNext(); ) {
                            GenericEntity currentFeature = (GenericEntity) cFi.next();
                            if (currentFeature.getString("productFeatureApplTypeId").equals("SELECTABLE_FEATURE")) {
                                Map newCombination = new HashMap();
                                // .clone() is important, or you'll keep adding to the same List for all the variants
                                // have to cast twice: once from get() and once from clone()
                                List newFeatures = ((List) ((LinkedList) combination.get("curProductFeatureAndAppls")).clone());
                                List newFeatureIds = ((List) ((LinkedList) combination.get("curProductFeatureIds")).clone());
                                if (currentFeature.getString("idCode") != null) {
                                    newCombination.put("defaultVariantProductId", combination.get("defaultVariantProductId") + currentFeature.getString("idCode"));
                                } else {
                                    newCombination.put("defaultVariantProductId", combination.get("defaultVariantProductId"));
                                }
                                newFeatures.add(currentFeature);
                                newFeatureIds.add(currentFeature.getString("productFeatureId"));
                                newCombination.put("curProductFeatureAndAppls", newFeatures);
                                newCombination.put("curProductFeatureIds", newFeatureIds);
                                newCombinations.add(newCombination);
                            }
                        }
View Full Code Here

            servicePathMap = null;
           
            if(servicePathObject instanceof HashMap){
                servicePathMap = (HashMap)servicePathObject;
            }else if(servicePathObject instanceof GenericEntity){
                GenericEntity servicePathEntity = (GenericEntity)servicePathObject;
                Set servicePathEntitySet = servicePathEntity.keySet();
                Iterator spesItr = servicePathEntitySet.iterator();
                servicePathMap = FastMap.newInstance();
                while(spesItr.hasNext()){
                    String spesKey = (String)spesItr.next();
                    servicePathMap.put(spesKey, servicePathEntity.get(spesKey));
                }
            }else if(servicePathObject instanceof Collection){
                Collection servicePathColl = (Collection)servicePathObject;
                Iterator splItr = servicePathColl.iterator();
                int count=0;
View Full Code Here

TOP

Related Classes of org.ofbiz.entity.GenericEntity$NULL

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.