A web application for developing and conducting PolicyModels interviews. This system allows model developers to make models available online (either publicly or privately), to receive feedback about them.
This server supports interview localizations. If a model contains multiple localizations, users can switch between languages as they go.
After each PolicyModels interview, the system displays the interview results in a user-friendly manner. Users can also print interview transcripts.
See demo server here.
Customizations are supported at three levels: Model version, Model, and Global.
Server admins can customize model value display, enable commenting, and make a version public, available through a link, or private.
Server admins can specify whether interviewees need to affirm their answers, whether they can add notes, and whether interview statistics are saved.
Server admins can:
- Edit the home (index), models, and about pages.
- Edit additional textual values, such as the server's name, limited liability statement, etc.
- Edit the server's branding, including logo upload, main color selection, and custom CSS
- Add analytics code.
This server can conduct interviews on behalf of other systems, via a REST API, or though an embeddable web component. The embeddable web component project is available here.
When using the API integration feature, the client system receives the interview results, and can specify where to send the user to after the interview is done. From a user's point of view, the process is seamless, as the transition between systems can be done without requiring user any action.
System interaction is as follows:
- Client system requests an interview from PoMo Server (this app). This request includes a URL to
POST
the results back to, when the interview is done. - PoMo Server responds with a URL for starting the interview.
- The client system redirects the user to said URL.
- PoMo server conducts the interview
- PoMo server posts the results to the URL sent by the client system at stage 1.
- Client system responds with a new URL to send the user to.
- PoMo server redirects the user to said URL.
GET /api/1/models/
Lists all models that have public runnable versions.
GET /api/1/models/:modelId/
Lists all public runnable versions of model :modelId
.
GET /api/1/models/:modelId/:ver
Returns model version metadata for model :modelId
.
POST /api/1/models/:modelId/requests
Requests an interview with the latest public version of model :modelId
. See payload below.
POST /api/1/models/:modelId/:ver/requests
Requests an interview with the version :ver
of model :modelId
. See payload below.
Interview request payload:
{
"callbackURL" :String,
["localization" :String,]
["message" :String,]
"returnButtonTitle" :String,
"returnButtonText" :String
}
Where:
callbackURL
: The URL to POST the results to.localization
: Optional. Name of the localization to use.message
: Optional. Message to display before the interview begins.returnButtonTitle
: Text to appear above the button that sends the results to the client system.returnButtonText
: Text to appear on the button that sends the results to the client system.
Sample Client
An example client application is available in this repository.
This server library uses the core PolicyModels language library.
For more information, visit datatags.org.
- Configuration: see conf/application.conf
- Add a user via API from localhost (useful for adding first user):
-
using cURL:
curl -X POST -d '{"username": "admin", "password":"pass"}' http://localhost:9000/admin/api/users/
-
using httpie:
echo '{"username": "admin", "password":"pass"}' | http POST localhost:9000/admin/api/users/
-