Package org.jahia.ajax.gwt.client.data

Examples of org.jahia.ajax.gwt.client.data.GWTJahiaFieldInitializer


        context.put("contextNode", contextNode);
        context.put("contextParent", contextParent);


        for (Map.Entry<String, ExtendedPropertyDefinition> item : getChoiceListItems(items).entrySet()) {
            GWTJahiaFieldInitializer initializer = getInitializerValues(item.getValue(), context, uiLocale);
            if (initializer != null) {
                results.put(item.getKey(), initializer);
            }
        }
        return results;
View Full Code Here


        return getInitializerValues(epd, context, uiLocale);
    }
   
    private GWTJahiaFieldInitializer getInitializerValues(ExtendedPropertyDefinition epd, Map<String, Object> context, Locale uiLocale) {
        GWTJahiaFieldInitializer initializer = null;
        Map<String, String> map = epd.getSelectorOptions();
        if (map.size() > 0) {
            final List<GWTJahiaValueDisplayBean> displayBeans = new ArrayList<GWTJahiaValueDisplayBean>(32);
            final Map<String, ChoiceListInitializer> initializers = choiceListInitializerService.getInitializers();
            List<String> dependentProperties = null;
            if (map.containsKey("dependentProperties")) {
                dependentProperties = Lists.newArrayList(StringUtils.split(map.get("dependentProperties"), ','));
                context.put("dependentProperties", dependentProperties);
            }
            List<ChoiceListValue> listValues = null;
            for (Map.Entry<String, String> entry : map.entrySet()) {
                if (initializers.containsKey(entry.getKey())) {
                    listValues = initializers.get(entry.getKey())
                            .getChoiceListValues(epd, entry.getValue(), listValues, uiLocale, context);
                }
            }
            if (listValues != null) {
                for (ChoiceListValue choiceListValue : listValues) {
                    try {
                        final GWTJahiaValueDisplayBean displayBean =
                                new GWTJahiaValueDisplayBean(choiceListValue.getValue().getString(),
                                        choiceListValue.getDisplayName());
                        final Map<String, Object> props = choiceListValue.getProperties();
                        if (props != null) {
                            for (Map.Entry<String, Object> objectEntry : props.entrySet()) {
                                if (objectEntry.getKey() == null || objectEntry.getValue() == null) {
                                    logger.error("Null value : " + objectEntry.getKey() + " / " +
                                            objectEntry.getValue());
                                } else {
                                    displayBean.set(objectEntry.getKey(), objectEntry.getValue());
                                }
                            }
                        }
                        displayBeans.add(displayBean);
                    } catch (RepositoryException e) {
                        logger.error(e.getMessage(), e);
                    }
                }
            }
            initializer = new GWTJahiaFieldInitializer(displayBeans, dependentProperties);
        }
        return initializer;
    }
View Full Code Here

                currentProperties.put(definition.getName(), property);
            }


            final GWTJahiaNodeProperty gwtJahiaNodeProperty = currentProperties.get(definition.getName());
            GWTJahiaFieldInitializer fieldInitializer = initializersValues != null ?
                    initializersValues.get(definition.getOverrideDeclaringNodeType() + "." + definition.getName()) : null;
            Field<?> field = FormFieldCreator.createField(definition, gwtJahiaNodeProperty, fieldInitializer, displayHiddenProperties, permissions);
            propertyDefinitions.put(gwtJahiaNodeProperty.getName(), definition);
            if (field != null) {
                if (fieldSet == null || fieldSetGrouping &&
View Full Code Here

TOP

Related Classes of org.jahia.ajax.gwt.client.data.GWTJahiaFieldInitializer

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.