cancel
Showing results for 
Search instead for 
Did you mean: 

Web Forms Relators

egcoder
Champ in-the-making
Champ in-the-making
Hello All,
I'm facing a problem of creating a web form relators (or you may call it web forms nesting), what I seek is have a web form of certain type inside my parent web form, so that I would be able to fill both data from inside the parent web form only, for example:

I have a "Vendor" web form that have the following elements:
-Vendor Name -> of type text field
-Product -> of type "web form product"

the "Product" web form should have the following elements for example:
-Product Name -> text field
-Specifications -> a relator of {key and value}

and the "Product" web form should have only a name text field for example, so that when I try to create an item of the "Vendor" I would find it something like below:

-Vendor Name=XYZ
–Product Name=Glasses
–Specifications= key->size & value->3      ||       key->weight & value=30gm


I would appreciate if any one could give me a clue about how to implement such relation in alfresco, I used to do that using data relators and content type relators in vignette, but I hope to find a similar implementation here at alfresco.

Thanks A lot,

I.Issa
1 REPLY 1

pmonks
Star Contributor
Star Contributor
In Alfresco this kind of thing is accomplished via standard XML Schema constructs.  For nesting data structures, XML Schema provides the ability to define nested complex types.  For example (note: it's not clear to me if this is exactly what you're after, but hopefully it should give you some ideas of what's possible):


<xs:element name="Vendor">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="VendorName" type="xs:string"/>
      <xs:element name="Product" minOccurs="0" maxOccurs="unbounded">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="ProductName" type="xs:string"/>
            <xs:element name="Specification" minOccurs="0" maxOccurs="unbounded">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="Key" type="xs:string"/>
                  <xs:element name="Value" type="xs:string"/>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:element>
Note: for clarity I've used the "Russian Doll" XML Schema design approach, but when designing XML Schemas "for real" I encourage the use of the "Venetian Blind" approach (see http://www.xfront.com/GlobalVersusLocal.html for more details).

Cheers,
Peter