如何使用新版本保存anciant表单。 我使用了CRUD API,然后使用两种方法执行了步骤:
通过强制使用最新版本号来检索表单的XML:
docId=fd4f49aad1ac3eb5a8ac29b0fa15a8cc1ec6ee6e
和version=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
使用最新版本创建一个空的测试表单并填写 使用旧版本
创建的表单运行此命令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内部服务器错误。发生错误时这是一个堆栈跟踪:
> |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|
答案 0 :(得分:0)
以下说明了您提到的2个案例中的错误:
GET
时,API会将该版本号返回给您。要回答标题中的问题,如果您有一个使用表单版本1创建的文档,并且希望在升级后将该文档的版本存储为与表单的版本2相对应,那么您需要使用不同的文档ID存储它。