Changeset 2074


Ignore:
Timestamp:
04/07/10 11:59:38 (8 years ago)
Author:
elemoine
Message:

AttributeStore - add field "restriction" in the default record type, r=bartvde (#252)

Location:
core/trunk/geoext
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • core/trunk/geoext/examples/attribute-form.html

    r2026 r2074  
    1919        useful when doing feature editing with WFS-T.</p>
    2020
     21        <p>Note that validation is activated based on the restriction
     22        information read from the DescribeFeatureType document. For example the
     23        "STATE_NAME", "STATE_FIPS", "SUB_REGION", and "STATE_ABBR" text fields
     24        indicate errors if more than 5 characters are entered.</p>
     25
    2126        <p>Note that the js is not minified so it is readable.
    2227        See <a href="attribute-form.js">attribute-form.js</a>.</p>
  • core/trunk/geoext/examples/data/describe_feature_type.xml

    r2008 r2074  
    1 <?xml version="1.0" encoding="UTF-8"?><xs:schema  targetNamespace="http://www.openplans.org/topp"  xmlns:topp="http://www.openplans.org/topp" xmlns:gml="http://www.opengis.net/gml" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0"><xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://localhost:8080/geoserver/schemas/gml/2.1.2.1/feature.xsd"/><xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema" name="states_Type"><xs:complexContent><xs:extension base="gml:AbstractFeatureType"><xs:sequence><xs:element name="the_geom" minOccurs="0" nillable="true" type="gml:MultiPolygonPropertyType"/><xs:element name="STATE_NAME" minOccurs="0" nillable="true"><xs:simpleType><xs:restriction base="xs:string"><xs:maxLength value="2147483647"/></xs:restriction></xs:simpleType></xs:element><xs:element name="STATE_FIPS" minOccurs="0" nillable="true"><xs:simpleType><xs:restriction base="xs:string"><xs:maxLength value="2147483647"/></xs:restriction></xs:simpleType></xs:element><xs:element name="SUB_REGION" minOccurs="0" nillable="true"><xs:simpleType><xs:restriction base="xs:string"><xs:maxLength value="2147483647"/></xs:restriction></xs:simpleType></xs:element><xs:element name="STATE_ABBR" minOccurs="0" nillable="true"><xs:simpleType><xs:restriction base="xs:string"><xs:maxLength value="2147483647"/></xs:restriction></xs:simpleType></xs:element><xs:element name="LAND_KM" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="WATER_KM" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="PERSONS" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="FAMILIES" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="HOUSHOLD" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="MALE" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="FEMALE" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="WORKERS" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="DRVALONE" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="CARPOOL" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="PUBTRANS" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="EMPLOYED" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="UNEMPLOY" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="SERVICE" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="MANUAL" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="P_MALE" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="P_FEMALE" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="SAMP_POP" minOccurs="0" nillable="true" type="xs:double"/></xs:sequence></xs:extension></xs:complexContent></xs:complexType><xs:element name="states" type="topp:states_Type" substitutionGroup="gml:_Feature"/></xs:schema>
     1<?xml version="1.0" encoding="UTF-8"?><xs:schema  targetNamespace="http://www.openplans.org/topp"  xmlns:topp="http://www.openplans.org/topp" xmlns:gml="http://www.opengis.net/gml" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0"><xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://localhost:8080/geoserver/schemas/gml/2.1.2.1/feature.xsd"/><xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema" name="states_Type"><xs:complexContent><xs:extension base="gml:AbstractFeatureType"><xs:sequence><xs:element name="the_geom" minOccurs="0" nillable="true" type="gml:MultiPolygonPropertyType"/><xs:element name="STATE_NAME" minOccurs="0" nillable="true"><xs:simpleType><xs:restriction base="xs:string"><xs:maxLength value="5"/></xs:restriction></xs:simpleType></xs:element><xs:element name="STATE_FIPS" minOccurs="0" nillable="true"><xs:simpleType><xs:restriction base="xs:string"><xs:maxLength value="5"/></xs:restriction></xs:simpleType></xs:element><xs:element name="SUB_REGION" minOccurs="0" nillable="true"><xs:simpleType><xs:restriction base="xs:string"><xs:maxLength value="5"/></xs:restriction></xs:simpleType></xs:element><xs:element name="STATE_ABBR" minOccurs="0" nillable="true"><xs:simpleType><xs:restriction base="xs:string"><xs:maxLength value="5"/></xs:restriction></xs:simpleType></xs:element><xs:element name="LAND_KM" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="WATER_KM" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="PERSONS" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="FAMILIES" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="HOUSHOLD" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="MALE" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="FEMALE" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="WORKERS" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="DRVALONE" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="CARPOOL" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="PUBTRANS" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="EMPLOYED" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="UNEMPLOY" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="SERVICE" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="MANUAL" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="P_MALE" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="P_FEMALE" minOccurs="0" nillable="true" type="xs:double"/><xs:element name="SAMP_POP" minOccurs="0" nillable="true" type="xs:double"/></xs:sequence></xs:extension></xs:complexContent></xs:complexType><xs:element name="states" type="topp:states_Type" substitutionGroup="gml:_Feature"/></xs:schema>
  • core/trunk/geoext/lib/GeoExt/data/AttributeStore.js

    r1956 r2074  
    4141 *  Either an array of field definition objects as passed to
    4242 *  ``Ext.data.Record.create``, or a record constructor created using
    43  *  ``Ext.data.Record.create``.  Defaults to ``["name", "type"]``.
     43 *  ``Ext.data.Record.create``.  Defaults to ``["name", "type", "restriction"]``.
    4444 */
    4545GeoExt.data.AttributeStore = function(c) {
     
    5353            ),
    5454            reader: new GeoExt.data.AttributeReader(
    55                 c, c.fields || ["name", "type"]
     55                c, c.fields || ["name", "type", "restriction"]
    5656            )
    5757        })
  • core/trunk/geoext/tests/lib/GeoExt/data/AttributeReader.html

    r1302 r2074  
    1212
    1313    function test_read(t) {
    14         t.plan(3);
     14        t.plan(4);
    1515
    1616        var reader = new GeoExt.data.AttributeReader({}, [
    1717            "name",
    18             "type"
     18            "type",
     19            "restriction"
    1920        ]);
    2021
     
    2728
    2829        //2 tests -- testing the fields of a record
    29         t.eq(record.get("name"), "STATE_FIPS", "[2] correct attribute name");
     30        t.eq(record.get("name"), "STATE_FIPS", "[1] correct attribute name");
    3031        t.eq(record.get("type"), "xsd:string", "[2] correct attribute type name");
    31 
     32        t.eq(record.get("restriction").maxLength, "2", "[3] correct attribute restriction");
    3233    }
    3334
  • core/trunk/geoext/tests/lib/GeoExt/data/AttributeReader.js

    r1302 r2074  
    99          '<xsd:element maxOccurs="1" minOccurs="0" name="the_geom" nillable="true" type="gml:MultiSurfacePropertyType"/>' +
    1010          '<xsd:element maxOccurs="1" minOccurs="0" name="STATE_NAME" nillable="true" type="xsd:string"/>' +
    11           '<xsd:element maxOccurs="1" minOccurs="0" name="STATE_FIPS" nillable="true" type="xsd:string"/>' +
     11          '<xsd:element maxOccurs="1" minOccurs="0" name="STATE_FIPS" nillable="true">' +
     12            '<xsd:simpleType>' +
     13              '<xsd:restriction base="xsd:string">' +
     14                '<xsd:maxLength value="2"/>' +
     15              '</xsd:restriction>' +
     16            '</xsd:simpleType>' +
     17          '</xsd:element>' +
    1218          '<xsd:element maxOccurs="1" minOccurs="0" name="SUB_REGION" nillable="true" type="xsd:string"/>' +
    1319          '<xsd:element maxOccurs="1" minOccurs="0" name="STATE_ABBR" nillable="true" type="xsd:string"/>' +
  • core/trunk/geoext/tests/list-tests.html

    r2008 r2074  
    22  <li>lib/overrides/override-ext-ajax.html</li>
    33  <li>lib/GeoExt/data/AttributeReader.html</li>
     4  <li>lib/GeoExt/data/AttributeStore.html</li>
    45  <li>lib/GeoExt/data/FeatureRecord.html</li>
    56  <li>lib/GeoExt/data/FeatureReader.html</li>
Note: See TracChangeset for help on using the changeset viewer.