Using XForms in JiapAdmin
- Repository
- Static vs Dynamic
The purpose of this tutorial is to show user how xforms are used in a
real scenario.
Repository
To store xform and language documents, we use simple files stored in a
server directory. Each project has its folder, and each activity has
its folder inside its project's folder. We also have a file that
contains projects and activities xform files relation (repository.xml).
<?xml version="1.0"
encoding="ISO-8859-1"?>
<repository>
<project>
<projectname>Example</projectname>
<activities>
<activity>
<activityname>Activity1</activityname>
<activityxformfile>xform.xhtml</activityxformfile>
</activity>
</activities>
<projectxformfile/>
</project>
</repository>
In this example we have an activity (Actvity1) that has an xform file
associated, whereas its project has not any xform file.
Static vs Dynamic
When we start any project or activity in JiapAdmin, repository file
allow us to know if exist any xform document. If there is not xform
document for a project, formgenerator application builds a new xform.
If xform file is found, then formgenerator will apply data to existent
xform file, choosing corresponding language file.
Using static xforms we can:
- Move form elements, customize properties order.
- Change input element to textarea element, and vice versa.
- Set form labels in different languages.
- Specify property's data type.
- Set xform element attributes: readonly, required and relevant.