木兰日志中的 AbstractFieldFactory 警告

AbstractFieldFactory warning in magnolia log

我调用此 ImportCommandAction 定义为 public class ImportCommandAction <D extends ActionDefinition> extends AbstractVersionAction<D> 作为页面上的操作。自定义导入操作有自己的 VersionName class 并覆盖 getBeanItemClass()。每次我调用这个 class 我都会在日志中得到一个条目

WARN magnolia.ui.form.field.factory.AbstractFieldFactory: BeanItem doesn't have any property for id versionName, returning default property.

我不明白这个警告以及 ui.form.field.factory.AbstractFieldFactory 指的是什么 id。 class 打开一个对话框并列出来自内部 git 存储库的所有版本(提交)。

Class代码:

    public ImportCommandAction(
            D definition, AppContext appContext, LocationController locationController,
            UiContext uiContext, FormDialogPresenter formDialogPresenter, 
            AbstractJcrNodeAdapter nodeAdapter, SimpleTranslator i18n, 
            ContentConnector contentConnector)
    {
            super(definition, locationController, uiContext, formDialogPresenter, i18n);
            this.nodeAdapter = nodeAdapter;
            this.appContext = appContext;
            this.dialogID = "ui-contentapp:code:ImportCommandAction.selectVersion";
            this.contentConnector = contentConnector;
        }

        @Override
        protected Class getBeanItemClass() {
            return VersionName.class;
        }

        @Override
        protected FormDialogDefinition buildNewComponentDialog() 
        throws ActionExecutionException, RepositoryException {
        ConfiguredFormDefinition form = new ConfiguredFormDefinition();

        ConfiguredTabDefinition tab = new ConfiguredTabDefinition();
        tab.setName("versions");

        SelectFieldDefinition select = new SelectFieldDefinition();
        select.setName(VersionName.PROPERTY_NAME_VERSION_NAME);
        select.setSortOptions(false);
        tab.addField(select); //more code follows
        }

        @Override
        protected Node getNode() throws RepositoryException {
             return nodeAdapter.getJcrItem();
        }

        protected String getVersionName() {
            return (String) getItem()
            .getItemProperty(VersionName.PROPERTY_NAME_VERSION_NAME)
            .getValue();
        }

        /**
         * Simple POJO used to access user selection from dialog, 
         * see {@link com.vaadin.data.util.BeanItem}.
         */
        protected class VersionName {

            protected final static String PROPERTY_NAME_VERSION_NAME = "versionName";

            private String versionName;

            public String getVersionName() {
                return versionName;
            }

            public void setVersionName(String versionName) {
                this.versionName = versionName;
            }
        }

    }

这意味着注入到 fieldFactory 的项目找不到具有 defition#name 的 属性。在您的情况下, defition#name 是 versionName 并且为了不使 fieldFactory 一起失败而回退到默认值。我会调试哪个字段是导致此行为的原因,然后从那里继续调查。

希望对您有所帮助,

干杯