blob: 19fc0704a9c0c6d5e6ddfacb3002bbad208beaa9 [file] [log] [blame]
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
Binding for example CForms form model GUI.
@version $Id$
-->
<fb:context
xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"
xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
path="/fd:form"
lenient="true">
<fb:new id="widgets-class"/>
<fb:class id="widgets-class">
<fb:temp-repeater id="widgets"
parent-path="fd:widgets"
row-path="*" row-path-insert="."
virtual-rows="true">
<fb:on-bind><fb:new id="widget-row-class"/></fb:on-bind>
</fb:temp-repeater>
</fb:class>
<fb:class id="widget-row-class">
<fb:new id="view-selector-class"/>
<fb:javascript id="type-selector" path="." direction="load">
<fb:load-form>
widget.setValue(jxpathPointer.getNode().getFirstChild().getLocalName());
if("view".equals(widget.lookupWidget("../view-selector").getValue())) {
widget.setProcessRequests(false);
widget.lookupWidget("../union").setProcessRequests(false);
}
</fb:load-form>
</fb:javascript>
<fb:union id="union" path=".">
<fb:new id="action-class"/>
<fb:new id="aggregatefield-class"/>
<fb:new id="booleanfield-class"/>
<fb:new id="class-class"/>
<fb:new id="field-class"/>
<fb:new id="new-class"/>
<fb:new id="output-class"/>
<fb:new id="repeater-class"/>
<fb:new id="row-action-class"/>
<fb:new id="struct-class"/>
<fb:new id="submit-class"/>
<fb:new id="union-class"/>
</fb:union>
</fb:class>
<fb:class id="view-selector-class">
<fb:javascript id="view-selector" path="." direction="load">
<fb:load-form>
widget.setValue("view");
</fb:load-form>
</fb:javascript>
</fb:class>
<fb:class id="label-class">
<fb:value id="label" path="fd:label"/>
</fb:class>
<fb:class id="action-class">
<fb:case id="action" path=".">
<fb:insert-node><fd:action/>
</fb:insert-node>
<fb:struct id="action" path="fd:action">
<fb:value id="id" path="@id"/>
<fb:new id="label-class"/>
</fb:struct>
</fb:case>
</fb:class>
<fb:class id="aggregatefield-class">
<fb:case id="aggregatefield" path=".">
<fb:insert-node><fd:aggregatefield/>
</fb:insert-node>
<fb:struct id="aggregatefield" path="fd:aggregatefield">
<fb:value id="id" path="@id"/>
<fb:new id="label-class"/>
<fb:insert-node>
<fd:widgets/>
</fb:insert-node>
<fb:new id="widgets-class"/>
</fb:struct>
</fb:case>
</fb:class>
<fb:class id="booleanfield-class">
<fb:case id="booleanfield" path=".">
<fb:insert-node><fd:booleanfield/>
</fb:insert-node>
<fb:struct id="booleanfield" path="fd:booleanfield">
<fb:value id="id" path="@id"/>
<fb:new id="label-class"/>
</fb:struct>
</fb:case>
</fb:class>
<fb:class id="class-class">
<fb:case id="class" path=".">
<fb:insert-node><fd:class/>
</fb:insert-node>
<fb:struct id="class" path="fd:class" direction="load">
<fb:value id="id" path="@id"/>
<fb:insert-node>
<fd:widgets/>
</fb:insert-node>
<fb:new id="widgets-class"/>
</fb:struct>
</fb:case>
</fb:class>
<fb:class id="field-class">
<fb:case id="field" path=".">
<fb:insert-node><fd:field/>
</fb:insert-node>
<fb:struct id="field" path="fd:field">
<fb:value id="id" path="@id"/>
<fb:new id="label-class"/>
<fb:value id="required" path="@required">
<fd:convertor datatype="boolean"/>
</fb:value>
</fb:struct>
</fb:case>
</fb:class>
<fb:class id="new-class">
<fb:case id="new" path=".">
<fb:insert-node><fd:new/>
</fb:insert-node>
<fb:struct id="new" path="fd:new">
<fb:value id="id" path="@id"/>
</fb:struct>
</fb:case>
</fb:class>
<fb:class id="output-class">
<fb:case id="output" path=".">
<fb:insert-node><fd:output/>
</fb:insert-node>
<fb:struct id="output" path="fd:output">
<fb:value id="id" path="@id"/>
<fb:new id="label-class"/>
</fb:struct>
</fb:case>
</fb:class>
<fb:class id="repeater-class">
<fb:case id="repeater" path=".">
<fb:insert-node><fd:repeater/>
</fb:insert-node>
<fb:struct id="repeater" path="fd:repeater">
<fb:value id="id" path="@id"/>
<fb:new id="label-class"/>
<fb:value id="initial-size" path="@initial-size">
<fd:convertor datatype="long"/>
</fb:value>
<fb:insert-node>
<fd:widgets/>
</fb:insert-node>
<fb:new id="widgets-class"/>
</fb:struct>
</fb:case>
</fb:class>
<fb:class id="row-action-class">
<fb:case id="row-action" path=".">
<fb:insert-node><fd:row-action/>
</fb:insert-node>
<fb:struct id="row-action" path="fd:row-action">
<fb:value id="id" path="@id"/>
<fb:new id="label-class"/>
</fb:struct>
</fb:case>
</fb:class>
<fb:class id="struct-class">
<fb:case id="struct" path=".">
<fb:insert-node><fd:struct/>
</fb:insert-node>
<fb:struct id="struct" path="fd:struct">
<fb:value id="id" path="@id"/>
<fb:new id="label-class"/>
<fb:insert-node>
<fd:widgets/>
</fb:insert-node>
<fb:new id="widgets-class"/>
</fb:struct>
</fb:case>
</fb:class>
<fb:class id="submit-class">
<fb:case id="submit" path=".">
<fb:insert-node><fd:submit/>
</fb:insert-node>
<fb:struct id="submit" path="fd:submit">
<fb:value id="id" path="@id"/>
<fb:new id="label-class"/>
</fb:struct>
</fb:case>
</fb:class>
<fb:class id="union-class">
<fb:case id="union" path=".">
<fb:insert-node><fd:union/>
</fb:insert-node>
<fb:struct id="union" path="fd:union">
<fb:value id="id" path="@id"/>
<fb:new id="label-class"/>
<fb:insert-node>
<fd:widgets/>
</fb:insert-node>
<fb:new id="widgets-class"/>
</fb:struct>
</fb:case>
</fb:class>
</fb:context>