问题
How do I add a MongoDB data source to Orbeon CE? I have been browsing through all the xml config files without any luck and the Orbeon documentation doesn't help very much. Any help would be appreciated.
It is supposed to be achievable through the persistence api.
Edit: And when having added the data source \ service under, for example, /fr/service/mongodb/* how do you make procedure calls to it from a form application, i.e. how do you use the /crud and /search to add and retreive information from the database?
回答1:
First note that support for MongoDB is at this point very much experimental. It is implemented as a servlet in MongoDBPersistence.scala, so you'll want to:
- Edit Orbeon's
web.xml
declare that servlet in a<servlet>
, and map/fr/service/mongo/*
to that servlet with a<servlet-mapping>
. - Add a property telling Form Runner to use the MongoDB persistence layer: e.g.
<property as="xs:string" name="oxf.fr.persistence.provider.*.*.*" value="mongo"/>
. - Add a property telling Form Runner what the URI of the MongoDB persistence layer is, e.g.
<property as="xs:anyURI" name="oxf.fr.persistence.mongo.uri" value="/fr/service/mongo"/>
.
来源:https://stackoverflow.com/questions/14441279/how-to-add-mongodb-data-source-in-orbeon