如何在ORBEON中迁移使用新版本保存的anciant表单?

时间:2017-12-06 11:06:11

标签: xhtml field orbeon savechanges

如何使用新版本保存anciant表单。 我使用了CRUD API,然后使用两种方法执行了步骤:

  1. 通过强制使用最新版本号来检索表单的XML:

    • 使用早期版本创建表单:使用docId=fd4f49aad1ac3eb5a8ac29b0fa15a8cc1ec6ee6eversion=1
    • 进行测试
    • 运行此命令:curl -v -k -H "Orbeon-Form-Definition-Version: 2" http://127.0.0.1:8080/orbeon/fr/service/persistence/crud/newProject/test/data/fd4f49aad1ac3eb5a8ac29b0fa15a8cc1ec6ee6e/data.xml
    • 这会导致“400错误请求”。如果我把旧版本1而不是2版本,则没有错误。
  2. 使用最新版本创建一个空的测试表单并填写 使用旧版本

    创建的表单
    • 运行此命令curl -v -k -H "Orbeon-Form-Definition-Version: 1" http://127.0.0.1:8080/orbeon/fr/service/persistence/crud/newProject/test/data/fd4f49aad1ac3eb5a8ac29b0fa15a8cc1ec6ee6e/data.xml >>myData。 ⇒将XML文件保存到目录。

    • 使用新版本(documentId = 40239f94e49538db4e94e4f60ad7b4f312c23f3e

    • 保存一个空的测试表单
    • 运行此命令curl -v -k -d @mydata.xml -H "Content-Type: application/xml" -H "Orbeon-Form-Definition-Version: 2" -X PUT http://127.0.0.1:8080/orbeon/fr/service/persistence/crud/newProject/test/data/40239f94e49538db4e94e4f60ad7b4f312c23f3e/data.xml⇒结果500内部服务器错误。
  3. 发生错误时这是一个堆栈跟踪:

    > |An Error has Occurred                                                                                                 |
    |----------------------------------------------------------------------------------------------------------------------|
    |Fatal error: The markup in the document following the root element must be well-formed.                               |
    |----------------------------------------------------------------------------------------------------------------------|
    |Application Call Stack                                                                                                |
    |----------------------------------------------------------------------------------------------------------------------|
    |oxf:/ops/pfc/xforms-xml-submission.xpl                                            |reading processor output      | 111|
    |······················································································································|
    |element=<p:output name="data" ref="instance"/>                                                                        |
    |name   =data                                                                                                          |
    |ref    =instance                                                                                                      |
    |----------------------------------------------------------------------------------------------------------------------|
    |oxf:/ops/pfc/xforms-xml-submission.xpl                                            |reading processor output      | 102|
    |······················································································································|
    |element=<p:output name="data" id="raw-instance"/>                                                                     |
    |name   =data                                                                                                          |
    |id     =raw-instance                                                                                                  |
    |----------------------------------------------------------------------------------------------------------------------|
    |:/Users/fkammoun/AppData/Local/Temp/upload__5a2c8fe_15fbb88e967__8000_00000000.tmp|                              |   1|
    |----------------------------------------------------------------------------------------------------------------------|
    |Exception: org.orbeon.oxf.common.ValidationException                                                                  |
    |----------------------------------------------------------------------------------------------------------------------|
    |org.orbeon.oxf.xml.XMLParsing$ErrorHandler         |fatalError                    |XMLParsing.java               | 221|
    |orbeon.apache.xerces.util.ErrorHandlerWrapper      |fatalError                    |                              |    |
    |orbeon.apache.xerces.impl.XMLErrorReporter         |reportError                   |                              |    |
    |orbeon.apache.xerces.impl.XMLErrorReporter         |reportError                   |                              |    |
    |orbeon.apache.xerces.impl.XMLErrorReporter         |reportError                   |                              |    |
    |orbeon.apache.xerces.impl.XMLScanner               |reportFatalError              |                              |    |
    |.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher|dispatch                      |                              |    |
    |n.apache.xerces.impl.XMLDocumentFragmentScannerImpl|scanDocument                  |                              |    |
    |orbeon.apache.xerces.parsers.XML11Configuration    |parse                         |                              |    |
    |orbeon.apache.xerces.parsers.XML11Configuration    |parse                         |                              |    |
    |orbeon.apache.xerces.parsers.XMLParser             |parse                         |                              |    |
    |orbeon.apache.xerces.parsers.AbstractSAXParser     |parse                         |                              |    |
    |processor.generator.URLGenerator$URLResourceHandler|readXML                       |URLGenerator.java             |1042|
    |org.orbeon.oxf.processor.generator.URLGenerator$1  |readImpl                      |URLGenerator.java             | 545|
    |essor.impl.ProcessorOutputImpl$TopLevelOutputFilter|read                          |ProcessorOutputImpl.java      | 257|
    |org.orbeon.oxf.processor.impl.ProcessorOutputImpl  |read                          |ProcessorOutputImpl.java      | 394|
    |org.orbeon.oxf.processor.ProcessorImpl             |readInputAsSAX                |ProcessorImpl.java            | 262|
    |ssor.pipeline.PipelineProcessor$InternalTopOutput$1|run                           |PipelineProcessor.java        | 535|
    |org.orbeon.oxf.processor.pipeline.PipelineProcessor|executeParents                |PipelineProcessor.java        | 696|
    |org.orbeon.oxf.processor.pipeline.PipelineProcessor|access$400                    |PipelineProcessor.java        |  60|
    |cessor.pipeline.PipelineProcessor$InternalTopOutput|readImpl                      |PipelineProcessor.java        | 531|
    |essor.impl.ProcessorOutputImpl$TopLevelOutputFilter|read                          |ProcessorOutputImpl.java      | 257|
    |org.orbeon.oxf.processor.impl.ProcessorOutputImpl  |read                          |ProcessorOutputImpl.java      | 394|
    |org.orbeon.oxf.processor.ProcessorImpl             |readInputAsSAX                |ProcessorImpl.java            | 262|
    |org.orbeon.oxf.processor.ProcessorImpl             |readInputAsSAX                |ProcessorImpl.java            | 266|
    |org.orbeon.oxf.processor.IdentityProcessor$1       |readImpl                      |IdentityProcessor.java        |  33|
    |essor.impl.ProcessorOutputImpl$TopLevelOutputFilter|read                          |ProcessorOutputImpl.java      | 257|
    |org.orbeon.oxf.processor.impl.ProcessorOutputImpl  |read                          |ProcessorOutputImpl.java      | 394|
    |org.orbeon.oxf.processor.ProcessorImpl             |readInputAsSAX                |ProcessorImpl.java            | 262|
    |orbeon.oxf.processor.pipeline.PipelineProcessor$1$1|run                           |PipelineProcessor.java        |  93|
    |org.orbeon.oxf.processor.pipeline.PipelineProcessor|executeChildren               |PipelineProcessor.java        | 679|
    |org.orbeon.oxf.processor.pipeline.PipelineProcessor|access$000                    |PipelineProcessor.java        |  60|
    |g.orbeon.oxf.processor.pipeline.PipelineProcessor$1|readImpl                      |PipelineProcessor.java        |  91|
    |essor.impl.ProcessorOutputImpl$TopLevelOutputFilter|read                          |ProcessorOutputImpl.java      | 257|
    |org.orbeon.oxf.processor.impl.ProcessorOutputImpl  |read                          |ProcessorOutputImpl.java      | 394|
    |processor.pipeline.choose.ConcreteChooseProcessor$1|readImpl                      |ConcreteChooseProcessor.java  | 126|
    |essor.impl.ProcessorOutputImpl$TopLevelOutputFilter|read                          |ProcessorOutputImpl.java      | 257|
    |org.orbeon.oxf.processor.impl.ProcessorOutputImpl  |read                          |ProcessorOutputImpl.java      | 394|
    |org.orbeon.oxf.processor.ProcessorImpl             |readInputAsSAX                |ProcessorImpl.java            | 262|
    |orbeon.oxf.processor.pipeline.PipelineProcessor$1$1|run                           |PipelineProcessor.java        |  93|
    

1 个答案:

答案 0 :(得分:0)

以下说明了您提到的2个案例中的错误:

  1. 检索文档时,无法指定表单版本。该信息附在文档上,由文档ID标识,当您执行GET时,API会将该版本号返回给您。
  2. 预计给定文档ID的表单定义版本不会更改。这解释了您在第二种情况下遇到的错误,因为您正在尝试更新文档,并提供新的表单定义版本,这是不允许的。实际上,当您更新文档时,您不应该提供任何表单定义版本,因为该信息无法更改并且已存储在数据库中。
  3. 要回答标题中的问题,如果您有一个使用表单版本1创建的文档,并且希望在升级后将该文档的版本存储为与表单的版本2相对应,那么您需要使用不同的文档ID存储它。