fore issueshttps://gitlab.existsolutions.com/eXistdbElements/fore/-/issues2019-08-22T09:47:58Zhttps://gitlab.existsolutions.com/eXistdbElements/fore/-/issues/12adding div to repeat template for todoWithLabels.html breaks processing2019-08-22T09:47:58ZJoern Turneradding div to repeat template for todoWithLabels.html breaks processingwhen adding a wrapping <div> to the outermost repeat template it will break repeat processing.when adding a wrapping <div> to the outermost repeat template it will break repeat processing.https://gitlab.existsolutions.com/eXistdbElements/fore/-/issues/11handling of key value lists2019-06-20T16:15:12ZJoern Turnerhandling of key value listskey value lists are typically used in conjunction with select controls to provide dynamic options to choose from.
In XForms these are represented in XML which either creates additional effort to write and bind them as well as runtime ov...key value lists are typically used in conjunction with select controls to provide dynamic options to choose from.
In XForms these are represented in XML which either creates additional effort to write and bind them as well as runtime overhead:
* they need to be kept in form-session
* they need to be converted to JSON
* they bloat the model markup with essentially readonly data
* key/values can be encoded in XML in a myriad of ways which makes it necessary to map them for consumption of a control. This is certainly possible but creates additional runtime and implementation overhead.
As key/value list are static by nature (set aside filtering, sorting or subselections).
Long story short - in the eXist-db context pure JSON key/value list might be a much more elegant solution.
The demo '07_select_autocomplete.html' uses this approach. In a server-side context it would be very easy to provide a URL that returns those key/value list in a fixed format like:
```
[ {"label":"LightGreen","value":"lightgreen"} ]
```https://gitlab.existsolutions.com/eXistdbElements/fore/-/issues/10[use case] mixed content2019-06-19T11:06:39ZMagdalena Turska[use case] mixed contentnot sure if it is within scope but for TEI handling, sometimes despite the imposed structure there would still be mixed content, eg. description as a text sibling to structured `<lat>` and `<lon>` elements for locations
```xml
<location...not sure if it is within scope but for TEI handling, sometimes despite the imposed structure there would still be mixed content, eg. description as a text sibling to structured `<lat>` and `<lon>` elements for locations
```xml
<location cert="high">
Gabal Halaqa, 2km west of Dana
<lat>40.885129</lat><lon>30.0731517,18</lon>
</location>
```https://gitlab.existsolutions.com/eXistdbElements/fore/-/issues/9[use case] repeats2019-06-19T11:08:32ZMagdalena Turska[use case] repeatsrepeated section
## Model
```xml
<place ref="LGPN_Syria" type="deme" xml:id="LGPN_Kisala">
<placeName type="modern">Kišʻāla</placeName>
<placeName type="ancient">Κισαλα</placeName>
<location cert="high">
Gabal Hala...repeated section
## Model
```xml
<place ref="LGPN_Syria" type="deme" xml:id="LGPN_Kisala">
<placeName type="modern">Kišʻāla</placeName>
<placeName type="ancient">Κισαλα</placeName>
<location cert="high">
Gabal Halaqa, 2km west of Dana
<lat>40.885129</lat><lon>30.0731517,18</lon>
</location>
</place>
```
## Form binding
Add button inserts another placeName into place entry
Delete removes it
...
### Form sample
...https://gitlab.existsolutions.com/eXistdbElements/fore/-/issues/8Selections based on dynamically changing parts of the model2019-06-19T10:59:09ZMagdalena TurskaSelections based on dynamically changing parts of the modelaffects select controls but also checkboxes, radio buttons etc
## Model
```xml
...
<!-- section representing available sources-->
<listSource>
<bibl type="primary" n="P1">
<ref target="SEG" type="inscr_stone">VII 1...affects select controls but also checkboxes, radio buttons etc
## Model
```xml
...
<!-- section representing available sources-->
<listSource>
<bibl type="primary" n="P1">
<ref target="SEG" type="inscr_stone">VII 1053, 5</ref>
</bibl>
<bibl type="primary" n="P2">
<ref target="IGLS" type="inscr_stone">XXI p. 123</ref>
</bibl>
<bibl type="secondary" n="S1">
<ref target="IGLS" type="inscr_stone">XXI p. 123</ref>
</bibl>
</listSource>
...
<!-- section storing attested forms -->
<name lang="greek" cert="high" n="1" canonical="Ἀντίοχος" type="main"/>
<persName case="Nom" source="P2">Ἀντίοχος</persName>
<persName case="Nom" source="P1">Αντίοχοσ</persName>
</name>
```
## Form binding
Checkboxes represent available source identifiers from source/@n
Binding is that persName/@source should point to corresponding source/@n
...
### Form sample
https://gitlab.existsolutions.com/eXistdbElements/fore/-/issues/7[use case] select/autocomplete2019-06-19T11:08:11ZMagdalena Turska[use case] select/autocompleteAutocomplete control where the id of the chosen entry is stored, not the text label. On loading, the label corresponding to stored id should be retrieved and displayed
Parameters
* [ ] static option set
* [ ] dynamic option set
* [ ] ma...Autocomplete control where the id of the chosen entry is stored, not the text label. On loading, the label corresponding to stored id should be retrieved and displayed
Parameters
* [ ] static option set
* [ ] dynamic option set
* [ ] match options starting with / match anywhere in the option
* [ ] minimal number of characters to trigger autocompletion query
* [ ] sorting order for the option set
* [ ] maximum number of the options returned
## Model
```xml
<relation cert="high" name="child" target="Pdb258dfaae04-Anathos"/>
```
## Form binding
Id of the autocomplete option is bound to relation/@target
...
### Form sample
...Joern TurnerJoern Turnerhttps://gitlab.existsolutions.com/eXistdbElements/fore/-/issues/6[use case] dependent selects2019-06-19T10:59:09ZMagdalena Turska[use case] dependent selectsOptions of the dependant select control are restricted to a subset relevant for the chosen option in the master control (usually also select but could be radio/checkbox or even free text input)
Parameters
* [ ] dynamic option set
* [ ] ...Options of the dependant select control are restricted to a subset relevant for the chosen option in the master control (usually also select but could be radio/checkbox or even free text input)
Parameters
* [ ] dynamic option set
* [ ] sorting order for the option set
* [ ] maximum number of the options returned
## Model
```xml
<trait ana="religion" type="Jew" subtype="rabbi"/>
```
## Form binding
Master select is is bound to trait/@type and dependent select to trait/@subtype
...
### Form sample
...https://gitlab.existsolutions.com/eXistdbElements/fore/-/issues/5[use case] free text autocomplete2019-06-20T16:15:44ZMagdalena Turska[use case] free text autocompleteAutocomplete field that finds matches across a set of hits (allow for both static and dynamic option sets). Text of the option label is stored.
Parameters
* [ ] static option set
* [x] dynamic option set
* [ ] match options starting wit...Autocomplete field that finds matches across a set of hits (allow for both static and dynamic option sets). Text of the option label is stored.
Parameters
* [ ] static option set
* [x] dynamic option set
* [ ] match options starting with / match anywhere in the option
* [x] allow/don't allow for option not in the option set
* [ ] minimal number of characters to trigger autocompletion query
* [ ] sorting order for the option set
* [ ] maximum number of the options returned
## Model
```xml
<name lang="greek" cert="high" n="1" canonical="Ἀντίοχος" type="main"/>
```
## Form binding
Autocomplete input is bound to name/@canonical
...
### Form sample
...https://gitlab.existsolutions.com/eXistdbElements/fore/-/issues/4state keeping2019-02-01T11:34:06ZJoern Turnerstate keeping# how to keep state...
Thinking about an XQuery implementation which can shortcut a much more costly Java development the only real problem is how to keep the state of a form between requests.
Essentially all that needs to be kept is t...# how to keep state...
Thinking about an XQuery implementation which can shortcut a much more costly Java development the only real problem is how to keep the state of a form between requests.
Essentially all that needs to be kept is the current state of all instances of a model. All other information can be obtained by calculation.https://gitlab.existsolutions.com/eXistdbElements/fore/-/issues/1implement XPath/XQuery facade class2019-06-19T10:04:28ZJoern Turnerimplement XPath/XQuery facade classKey functionality for a new form framework is the availability of an XPath/XQuery facade class in Java that provides the following interface. The proposed methods do not need to be exactly as layed out below but provide the implied funct...Key functionality for a new form framework is the availability of an XPath/XQuery facade class in Java that provides the following interface. The proposed methods do not need to be exactly as layed out below but provide the implied functionality.
```
public static List evaluate(Element element, String xpath)
public static NodeList evaluate(Element element, String xpath)
public static String evaluateAsString(Element element,String xpath)
public static String getAsString(List nodeset, int position)
public static boolean getAsBoolean(List nodeset, int position)
public static double getAsDouble(List nodeset, int position)
public static boolean existsNode(List contextNodeset, int positionInNodeset)
public static Node getAsNode(List nodeset, int position)
/**
* Returns the set of all references to other nodes contained in the given
* XPath expression.
* <p/>
* The returned references are expected to be strings and not some
* XPath processor specific classes.
*
* @param xpath the XPath expression.
* @return the set of all references to other nodes.
* @throws XFormsException if a reference detection error occurred.
*/
public static Set<String> getReferences(String xpath)
```
The signatures might be incomplete and may require more arguments such as prefixMappings or other contextual information. These have been left away here for clarity.
## getReferences
This needs a bit more context. I attached a file that is of central importance in betterFORM to build the dependency graph. Essentially this class analyses XPath expressions to find references to other nodes. E.g. a
function may take a node as argument or a predicate refers to another node.
I attached the orgininal implementation to give an impression of what needs to be done. However it must be investigated how the use of full XQuery influences this analysis. Essentially the algorithm must be able to detect references to the node itself as well as to other nodes. This will be sufficient to setup the dependency graph for calculation and validation.
[SaxonReferenceFinderImpl.java](/uploads/c01a31881d61ed5e6b741cacd90d1f93/SaxonReferenceFinderImpl.java)
It should also be noted that is considered an error if validations contains circular dependencies.