gpt4 book ai didi

java - Magnolia 日志中的 AbstractFieldFactory 警告

转载 作者:行者123 更新时间:2023-11-30 05:18:48 24 4
gpt4 key购买 nike

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

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 是什么。指。该类打开一个对话框并列出内部 git 存储库的所有版本(提交)。

类代码:

    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;
}
}

}

最佳答案

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

希望有帮助,

干杯

关于java - Magnolia 日志中的 AbstractFieldFactory 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59882958/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com