Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column
width0px
 Now you need to create your form that integrates with your database queries.

There are two ways of creating frevvo Live Forms forms:

  • dragging and dropping controls from the designer palette
  • creating a form from an XML schema. In this case, the controls will be automatically created for you based on the XML schema definitions.

When working with the database connector, you will always used the latter and create the controls from the schema. In the future we intend to relax this requirement.

Column
width0px

On This Page:

Table of Contents
maxLevel1

...

You can use the database connector to generate the schemas you will need to use in the frevvo Live Forms form. 
 
To fetch the schema, type a URI in the browser that looks like the example below.  This is almost identical to the query we used to test the connector, but it tells the connector to GET the schema instead.

...

Code Block
 <?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.frevvo.com/database/customers" xmlns:xsd=http://www.w3.org/2001/XMLSchema targetNamespace="http://www.frevvo.com/database/customers">
  <xsd:element name="customers">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element maxOccurs="unbounded" name="row">
          <xsd:complexType>
            <xsd:sequence>               <xsd:element name="customerId">                 <xsd:simpleType>
                  <xsd:simpleType> <xsd:restriction base="xsd:string">
                    <xsd:maxLength value="11"/>                   </xsd:restriction> </xsd:simpleType> </xsd:element> <xsd:element minOccurs="0" name="firstname"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:maxLength value="50"/> </xsd:restriction> </xsd:simpleType> </xsd:element> <xsd:element minOccurs="0" name="lastname"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:maxLength       value="50"/> </xsd:restriction> </xsd:simpleType>               </xsd:element>               <xsd:element minOccurs="0" name="firstname">
                <xsd:simpleType>
                  <xsd:restriction base="xsd:string">
                    <xsd:maxLength value="50"/>
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:element>
              <xsd:element minOccurs="0" name="lastname">
                <xsd:simpleType>
                  <xsd:restriction base="xsd:string">
                    <xsd:maxLength value="50"/>
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:element>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

...

</xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>

Save the schema as an .xsd file in your file system.  You can then [[V4_Data_Sources_and_Schemas#Uploading_a_Schema | upload the schema]] to frevvo Live Forms and generate controls from the schema elements that map to your database tables.  If you have multiple queries in your configuration file, you’ll need to generate a schema for each query.

...

  1. Click the Next button to advance from the default document to the next schema document
  2. You should see the Document name change your schema's document name
  3. Enter the database connector Url to your query in the wizard's URL input. If the database connector is running in the same host and port as the frevvo Live Forms form server, then you can omit http://<host>:<port>/ from the URL. See this example below.

...

If you have already uploaded the schema to frevvoLive Forms, you can still make the changes and update the schema. The process of updating the schema is described [[V4_Data_Sources_and_Schemas#Updating_a_Schema | here]];

...

Limiting potentially repeating Data

Often the schema from your database will allow any number of elements even though you know your form will never use more than one at a time. Every schema includes the “rows” element as shown in the partial schema below—note that based on the maxOccurs value of “unbounded” in the schema, there can be an unlimited number of customer elements. 

...

the schema from your database will allow any number of elements even though you know your form will never use more than one at a time. Every schema includes the “rows” element as shown in the partial schema below—note that based on the maxOccurs value of “unbounded” in the schema, there can be an unlimited number of customer elements. 

Code Block
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns=http://www.frevvo.com/database/Customer targetNamespace="http://www.frevvo.com/database/Customer"> <xsd:element name="Customers"> <xsd:complexType> <xsd:sequence> <xsd:element maxOccurs="unbounded" name="row"> <xsd:complexType> <xsd:sequence

Since the schema says the element is unbounded, the control you generate initially will be a repeat control.  You’ll see the Repeat Row heading in the Forms Designer and if you don’t make any changes, users will see the + sign that comes with repeat controls.

...

Code Block
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns=http://www.frevvo.com/database/Customer  targetNamespace="http://www.frevvo.com/database/Customer">      <xsd:element name="Customer"> 
       <xsd:complexType> 
          name="Customer"> <xsd:complexType> <xsd:sequence> 
             <xsd:element maxOccurs="1" name="row"> 
                <xsd:complexType> 
                   <xsd:sequence>

Note that now maxOccurs="1" and that will force the + sign to disappear.

...

Code Block
<xsd:element minOccurs="0" name="Home Phone" type="phoneType"/>

Now the frevvo Live Forms form will only accept valid phone numbers. If you enter an invalid phone the form will flag the field as invalid.

...