0

我正在使用 Orbeon Forms 3.8.0.201005141856 CE。

当页面上的模型太多时,Orbeon 会引发 stackoverflow 错误。在初始化期间,在主模型上完成 xforms-rebuild,然后在每个模型上启动重建/重新验证/重新计算。

如果模型太多,由于堆栈溢出,它永远不会完成。

我可以理解存在一些递归性,也许第一个模型没有完成验证,除非其他所有模型都完成了,但堆栈是这样的:

前几行是随机的,这些是在溢出时实际调用的方法,其余的是一个无限循环:

org.orbeon.oxf.xforms.xbl.XBLContainer synchronizeAndRefresh XBLContainer.java 696 org.orbeon.oxf.xforms.xbl.XBLContainer endOutermostActionHandler XBLContainer.java 669 org.orbeon.oxf.xforms.XFormsModel rebuildRecalculateRevalidateIfNeeded XFormsModel.java 1120 org.orbeon. oxf.xforms.xbl.XBLContainer rebuildRecalculateRevalidateIfNeeded XBLContainer.java 723 org.orbeon.oxf.xforms.xbl.XBLContainer rebuildRecalculateRevalidateIfNeeded XBLContainer.java 733 org.orbeon.oxf.xforms.xbl.XBLContainer rebuildRecalculateRevalidateIfNeeded XBLContainer.java 733 org.orbeon.oxf。 xforms.xbl.XBLContainer rebuildRecalculateRevalidateIfNeeded XBLContainer.java 733

也许在这里可以避免某些级别的递归?

无论如何,我怀疑我能解决这个问题。但也许我可以在我的表格上修复一些东西。我想确认这是一个太多的模型问题。

我的情况有点特殊,因为我的表格是动态构建的,没有关于将要使用的数据的信息。稍微简化一下,它看起来像这样(这只是给出一个想法的伪代码)。

我有定义可能数据的模板,可以有多个模板,每个模板可以包含多个属性。

<!-- This defines data templates, known at form creation -->
<xf:instance>
  <templates>
    <template id="template_1">
      <attribute id="attribute_1_1" type="string" />
      <attribute id="attribute_1_2" type="date" />
    </template>
    <template id="template_2">
      <attribute id="attribute_2_1" type="int" />
      <attribute id="attribute_2_2" type="dateTime" />
    </template>
  </templates>
</xf:instance>

然后是数据。可以有多个对象,每个对象都使用上面的模板之一。它可以包含模板中的属性,但可能不是全部。它还可以包含不是来自将被忽略的模板的属性。可以有多个对象使用同一个模板。可以有任何对象未使用的模板。

<!-- This is the data, unknown at form creation -->
<xf:instance id="objects">
  <data>
    <object template="template_1">
      <attribute name="attribute_1_1">value</attribute>
      <attribute name="unknownAttribute">value</attribute>
    </object>
    ...
  </data>
</xf:instance>

现在用于显示:

<!-- Repeat on objects -->
<xf:repeat nodeset="instance('objects')/object">

  <!-- A XBL that can display a template from its template definition node
  <fr:templateDisplay template="instance('templates')/template[@id = ./@template]" />
</xf:repeat>

XBL 本身在模板级别做同样的事情:

<xbl:binding id="templateDisplay" />
  <xbl:implementation>
    <xf:model>
      ...
    </xf:model>
  </xbl:implementation>

  <xbl:template>
    <!-- A repeat on the attribute definition of the attributes -->
    <xf:repeat>
      <!-- A XBL that changes its control depending on datatype -->
      <fr:genericInput type="" data=""/>
    </xf:repeat>
  <xbl:template>
</xbl:binding>

genericInput XBL 根据数据类型包含不同类型的输入,它可以在绑定上使用不同的@type,它可以是简单的 xbl,它可以是一个日期选择器等。它可以是读写/只读,它可以是单值/多值。

问题是,如果我有一个包含 5 个属性的模板,它会按对象生成(至少)6 个 XBL,因此需要重建 6 个模型。

一开始我可以在崩溃之前管理 20 个对象。我还有一个被所有其他 xbl 使用的本地化 xbl(因此按对象至少有 12 个 xbl/模型),我删除了它和其他一些东西,在崩溃之前我最多有 60 个对象,但目标是 200 个。

我想也许在我的 xbl 中使用 xsl 来尝试删除 genericInput。但我不熟悉 XSL,我想确定它会带来改进。

或者是否可以过滤这些重建并具有仍然有效的形式?一种使它们减少递归的方法?

或者也许我错了,这不是模型数量的问题?

任何提示将不胜感激。

4

0 回答 0