Package com.alibaba.citrus.service.form.configuration

Examples of com.alibaba.citrus.service.form.configuration.GroupConfig


        assertEquals(null, field2.getValue()); // default is null
    }

    @Test
    public void getGroupConfig() throws Exception {
        GroupConfig gc = group.getGroupConfig();
        assertNotNull(gc);
        assertSame(form.getFormConfig(), gc.getFormConfig());
    }
View Full Code Here


            return assertNotNull(formService.getFormConfig().getGroupConfig(groupName),
                                 "group \"%s\" does not defined", groupName);
        }

        protected final FieldConfig getFieldConfig(String groupName, String fieldName) {
            GroupConfig groupConfig = getGroupConfig(groupName);
            fieldName = assertNotNull(trimToNull(fieldName), "field name is empty");
            return assertNotNull(groupConfig.getFieldConfig(fieldName), "field \"%s.%s\" does not defined",
                                 groupConfig.getName(), fieldName);
        }
View Full Code Here

        if (requiresMessage()) {
            boolean hasMessage = false;

            // 1. 从messageSource中查找
            if (id != null && messageSource != null) {
                GroupConfig groupConfig = fieldConfig.getGroupConfig();
                FormConfig formConfig = groupConfig.getFormConfig();

                // form.groupName.fieldName.validatorId
                messageCode = formConfig.getMessageCodePrefix() + groupConfig.getName() + "." + fieldConfig.getName()
                              + "." + id;

                hasMessage = getMessageFromMessageSource() != null;
            }
View Full Code Here

                    String groupInstanceKey = getGroupInstanceKey(groupKey, instanceKey);

                    // 下面从request中初始化所有group instance,
                    // 并确保不会重复初始化同一个group instance。
                    if (!groups.containsKey(groupInstanceKey) && !ignoredGroups.contains(groupInstanceKey)) {
                        GroupConfig groupConfig = getFormConfig().getGroupConfigByKey(groupKey);

                        if (groupConfig == null) {
                            log.debug("No group associated with parameter: {}", key);
                            continue;
                        } else if ((forcePostOnly || groupConfig.isPostOnly())
                                   && !"post".equalsIgnoreCase(request.getMethod())) {
                            log.warn("Group {} can only read from POST request: {}", groupConfig.getName(), key);
                            ignoredGroups.add(groupInstanceKey);
                            setValid(false);
                            continue;
                        } else {
                            groups.put(groupInstanceKey, new GroupImpl(groupConfig, this, instanceKey));
View Full Code Here

        // 取得规格化的group/field key,即:
        // 如果fieldKeyFormat=compressed,则为压缩格式;
        // 如果fieldKeyFormat=uncompressed,则为非压缩格式;
        // 如果group或field不存在,则暂且保持key原值,后面会报警告。
        GroupConfig groupConfig = getFormConfig().getGroupConfigByKey(groupKey);

        if (groupConfig != null) {
            groupKey = groupConfig.getKey();

            FieldConfig fieldConfig = groupConfig.getFieldConfigByKey(fieldKey);

            if (fieldConfig != null) {
                fieldKey = fieldConfig.getKey();
            }
        }
View Full Code Here

    /**
     * 取得group instance。如果该group instance不存在,并且<code>create == true</code>
     * ,则创建之。Group名称大小写不敏感。
     */
    public Group getGroup(String groupName, String instanceKey, boolean create) {
        GroupConfig groupConfig = getFormConfig().getGroupConfig(groupName);

        if (groupConfig == null) {
            return null;
        }

        instanceKey = defaultIfNull(trimToNull(instanceKey), DEFAULT_GROUP_INSTANCE_KEY);

        String groupInstanceKey = getGroupInstanceKey(groupConfig.getKey(), instanceKey);
        Group group = groups.get(groupInstanceKey);

        if (group == null && create) {
            group = new GroupImpl(groupConfig, this, instanceKey);
            groups.put(groupInstanceKey, group);
View Full Code Here

            return assertNotNull(formService.getFormConfig().getGroupConfig(groupName),
                    "group \"%s\" does not defined", groupName);
        }

        protected final FieldConfig getFieldConfig(String groupName, String fieldName) {
            GroupConfig groupConfig = getGroupConfig(groupName);
            fieldName = assertNotNull(trimToNull(fieldName), "field name is empty");
            return assertNotNull(groupConfig.getFieldConfig(fieldName), "field \"%s.%s\" does not defined",
                    groupConfig.getName(), fieldName);
        }
View Full Code Here

        if (requiresMessage()) {
            boolean hasMessage = false;

            // 1. ��messageSource�в���
            if (id != null && messageSource != null) {
                GroupConfig groupConfig = fieldConfig.getGroupConfig();
                FormConfig formConfig = groupConfig.getFormConfig();

                // form.groupName.fieldName.validatorId
                messageCode = formConfig.getMessageCodePrefix() + groupConfig.getName() + "." + fieldConfig.getName()
                        + "." + id;

                hasMessage = getMessageFromMessageSource() != null;
            }
View Full Code Here

                    String groupInstanceKey = getGroupInstanceKey(groupKey, instanceKey);

                    // �����request�г�ʼ������group instance��
                    // ��ȷ�������ظ���ʼ��ͬһ��group instance��
                    if (!groups.containsKey(groupInstanceKey) && !ignoredGroups.contains(groupInstanceKey)) {
                        GroupConfig groupConfig = getFormConfig().getGroupConfigByKey(groupKey);

                        if (groupConfig == null) {
                            log.debug("No group associated with parameter: {}", key);
                            continue;
                        } else if ((forcePostOnly || groupConfig.isPostOnly())
                                && !"post".equalsIgnoreCase(request.getMethod())) {
                            log.warn("Group {} can only read from POST request: {}", groupConfig.getName(), key);
                            ignoredGroups.add(groupInstanceKey);
                            setValid(false);
                            continue;
                        } else {
                            if (log.isDebugEnabled()) {
                                if (DEFAULT_GROUP_INSTANCE_KEY.equals(instanceKey)) {
                                    log.debug("Initializing form group: {}", groupConfig.getName());
                                } else {
                                    log.debug("Initializing form group: {}[{}]", groupConfig.getName(), instanceKey);
                                }
                            }

                            Group group = new GroupImpl(groupConfig, this, instanceKey);
View Full Code Here

    /**
     * ȡ��group instance�������group instance�����ڣ�����<code>create == true</code>
     * ���򴴽�֮��Group���ƴ�Сд�����С�
     */
    public Group getGroup(String groupName, String instanceKey, boolean create) {
        GroupConfig groupConfig = getFormConfig().getGroupConfig(groupName);

        if (groupConfig == null) {
            return null;
        }

        instanceKey = defaultIfNull(trimToNull(instanceKey), DEFAULT_GROUP_INSTANCE_KEY);

        String groupInstanceKey = getGroupInstanceKey(groupConfig.getKey(), instanceKey);
        Group group = groups.get(groupInstanceKey);

        if (group == null && create) {
            group = new GroupImpl(groupConfig, this, instanceKey);
            groups.put(groupInstanceKey, group);
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.service.form.configuration.GroupConfig

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.