Package org.broadleafcommerce.openadmin.dto

Examples of org.broadleafcommerce.openadmin.dto.Entity.findProperty()


                LOG.debug("No key property passed in for map, failing validation");
            }

            populate: {
                if (persistentClass != null) {
                    Serializable valueInstance = (Serializable) map.get(entity.findProperty("priorKey").getValue());

                    if (valueInstance == null) {
                        valueInstance = procureSandBoxMapValue(mapStructure, entity);
                        if (valueInstance == null) {
                            break populate;
View Full Code Here


                    if (map.get(mapKey) != null && !map.get(mapKey).equals(valueInstance)) {
                        entity.addValidationError(mapStructure.getKeyPropertyName(), "keyExistsValidationError");
                    }

                    if (StringUtils.isNotBlank(mapStructure.getMapKeyValueProperty())) {
                        Property p = entity.findProperty("key");
                        Property newP = new Property();
                        newP.setName(mapStructure.getMapKeyValueProperty());
                        newP.setValue(p.getValue());
                        newP.setIsDirty(p.getIsDirty());
                        entity.addProperty(newP);
View Full Code Here

                    //allow validation on other properties in order to show key validation errors along with all the other properties
                    //validation errors
                    valueInstance = createPopulatedInstance(valueInstance, entity, valueMergedProperties, false);

                    if (StringUtils.isNotEmpty(mapKey) && !entity.isValidationFailure()) {
                        if (!entity.findProperty("priorKey").getValue().equals(mapKey)) {
                            map.remove(entity.findProperty("priorKey").getValue());
                        }
                        /*
                         * TODO this map manipulation code currently assumes the key value is a String. This should be widened to accept
                         * additional types of primitive objects.
View Full Code Here

                    //validation errors
                    valueInstance = createPopulatedInstance(valueInstance, entity, valueMergedProperties, false);

                    if (StringUtils.isNotEmpty(mapKey) && !entity.isValidationFailure()) {
                        if (!entity.findProperty("priorKey").getValue().equals(mapKey)) {
                            map.remove(entity.findProperty("priorKey").getValue());
                        }
                        /*
                         * TODO this map manipulation code currently assumes the key value is a String. This should be widened to accept
                         * additional types of primitive objects.
                         */
 
View Full Code Here

                        }
                        /*
                         * TODO this map manipulation code currently assumes the key value is a String. This should be widened to accept
                         * additional types of primitive objects.
                         */
                        map.put(entity.findProperty(mapStructure.getKeyPropertyName()).getValue(), valueInstance);
                    }
                } else {
                    if (StringUtils.isNotEmpty(mapKey) && !entity.isValidationFailure()) {
                        map.put(entity.findProperty(mapStructure.getKeyPropertyName()).getValue(), entity.findProperty(((SimpleValueMapStructure) mapStructure).getValuePropertyName()).getValue());
                    }
View Full Code Here

                         */
                        map.put(entity.findProperty(mapStructure.getKeyPropertyName()).getValue(), valueInstance);
                    }
                } else {
                    if (StringUtils.isNotEmpty(mapKey) && !entity.isValidationFailure()) {
                        map.put(entity.findProperty(mapStructure.getKeyPropertyName()).getValue(), entity.findProperty(((SimpleValueMapStructure) mapStructure).getValuePropertyName()).getValue());
                    }
                }
            }

            instance = persistenceManager.getDynamicEntityDao().merge(instance);
View Full Code Here

                         */
                        map.put(entity.findProperty(mapStructure.getKeyPropertyName()).getValue(), valueInstance);
                    }
                } else {
                    if (StringUtils.isNotEmpty(mapKey) && !entity.isValidationFailure()) {
                        map.put(entity.findProperty(mapStructure.getKeyPropertyName()).getValue(), entity.findProperty(((SimpleValueMapStructure) mapStructure).getValuePropertyName()).getValue());
                    }
                }
            }

            instance = persistenceManager.getDynamicEntityDao().merge(instance);
View Full Code Here

                }
            }

            instance = persistenceManager.getDynamicEntityDao().merge(instance);
           
            Entity[] responses = getMapRecords(instance, mapStructure, ceilingMergedProperties, valueMergedProperties, entity.findProperty("symbolicId"));
            for (Entity response : responses) {
                if (response.findProperty(mapStructure.getKeyPropertyName()).getValue().equals(persistencePackage.getEntity().findProperty(mapStructure.getKeyPropertyName()).getValue())) {
                    return response;
                }
            }
View Full Code Here

            throw new SecurityServiceException("Field not mutable");
        }
        try {
            Map<String, FieldMetadata> ceilingMergedProperties = getSimpleMergedProperties(entity.getType()[0],
                    persistencePerspective);
            String mapKey = entity.findProperty(mapStructure.getKeyPropertyName()).getValue();
            if (ceilingMergedProperties.containsKey(mapStructure.getMapProperty() + FieldManager.MAPFIELDSEPARATOR + mapKey)) {
                throw new ServiceException("\"" + mapKey + "\" is a reserved property name.");
            }

            Serializable instance = persistenceManager.getDynamicEntityDao().retrieve(Class.forName(entity.getType()[0]), Long.valueOf(entity.findProperty("symbolicId").getValue()));
View Full Code Here

            String mapKey = entity.findProperty(mapStructure.getKeyPropertyName()).getValue();
            if (ceilingMergedProperties.containsKey(mapStructure.getMapProperty() + FieldManager.MAPFIELDSEPARATOR + mapKey)) {
                throw new ServiceException("\"" + mapKey + "\" is a reserved property name.");
            }

            Serializable instance = persistenceManager.getDynamicEntityDao().retrieve(Class.forName(entity.getType()[0]), Long.valueOf(entity.findProperty("symbolicId").getValue()));

            Assert.isTrue(instance != null, "Entity not found");

            FieldManager fieldManager = getFieldManager();
            Map map = (Map) fieldManager.getFieldValue(instance, mapStructure.getMapProperty());
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.