Skip to main content

BIN SQ5eB Documentation

  • Author:

  • Version: 6

  • Description: READONLY version of BgcUD - A very old example... a computer shop with choice controls.. at that time those pc configuration were something you could only dream about... This example is also in bindexamples app

  • Created: 2014-10-17

  • Modified: 2019-12-27

  • Source:

     Edit Bin W3C Schema Json-Schema Java Bean Code Default Value as XML

    Printers Embed Responsive

    <osk
        xmlns:extra="http://eleusoft.org/schema/extra" >
        <datatypeLibrary prefix="xs" uri='http://www.w3.org/2001/XMLSchema-datatypes'/>
        <schema name='simpletypes'>
            <simpleType name="ApplyQuantityControl" type="xs:int" extra:nc.applybutton='true'
    			extra:form.control='NumberControl'>
                <facet name="minInclusive" value="1"/>
            </simpleType>
            <simpleType name="Currency"  type="xs:double" 
    			extra:form.control='NumberControl' extra:nc.format="currency" 
    			extra:form.css='currency'/>
            <simpleType name="HiddenDefault"	type="xs:string" extra:form.control="HiddenDefaultValueControl" extra:form.hidden='true' description="Form control that returns the default value of the field without displaying it."/>
            <simpleType name="HiddenDefaultPrice"	type="Currency" extra:form.control="HiddenDefaultValueControl" extra:form.hidden='true' description="Form control that returns the default (currency) value of the field without displaying it."/>
        </schema>
        
        <schema 
    	elementFormDefault="qualified"
    	 uri="http://www.mycomputerathome.com/prices/2003/2"
    	name="com.mycomputerathome" >
            <ns prefix='mc' uri='http://www.mycomputerathome.com/prices/2003/2'/>
            <ns prefix='spy' uri='http://org.eleusoft.com/spy'/>
            <complexType extra:form='true' extra:form.ccontrol='print' name='Order2003_2' description="READONLY version of bin:BgcUD - A very old example... a  computer shop  with choice controls..  at that time those pc configuration were something you could only dream about... This example is also in bindexamples app">
                <field name="ClientInfo" reftype="spy:ClientInfo" extra:form.caption=""/>
                <field name="Model" type="mc:Model" extra:form.caption=""/>
                <field name="Color" type="mc:ModelColor" extra:form.caption=""/>
                <field name="CD" type="mc:CD" extra:form.caption=""/>
                <field name='KeyboardLanguage' type='xs:string' caption='Please, choose keyboard language'>
                    <facet name='enumeration' value='English'/>
                    <facet name='enumeration' value='Italian'/>
                </field>
                <field name="Quantity" 
    				type="ApplyQuantityControl" 
    				caption="Quantity" 
    				default='1'
    				extra:nc.applybutton='true' 
    				extra:nc.applybuttonlabel='Recalculate' 
    				extra:form.error="Quantity value must be betweeen 1 and 50.">
                    <facet name='maxInclusive' value='50'/>
                </field>
            </complexType>
            <complexType name="Model"   >
                <choice name="ModelChoice" caption='Please, choose a model' 
    			extra:choice.change='Confirm change'
    			extra:choice.autosubmit='true'>
                    <field name="S4000" type='mc:S4000' />
                    <field name="S5000" type='mc:S5000' />
                    <field name="S6000" type='mc:S6000' />
                    <field name="S7000DL" type='mc:S7000DL' />
                </choice>
            </complexType>
            <complexType name="S4000"   
    			extra:choice.caption='S4000 CPU 3600 Mhz (1350 EUR)' 
    			extra:cc.title="The S4000 is an entry model, ideal for home and multimedia use.">
                <implements type="mc:MultimediaModel"/>
                <field caption='' extra:form.title="" type='HiddenDefaultPrice' name='price' default='1350'/>
            </complexType>
            <complexType name="S5000"   
    			extra:choice.caption='S5000 CPU 5000 Mhz (1700 EUR)' 
    			extra:cc.title="The S5000 is a powerful multimedia model, ideal for your games .">
                <implements type="mc:MultimediaModel"/>
                <field caption='' extra:form.title="" type='HiddenDefaultPrice' name='price' default='1700'/>
            </complexType>
            <complexType name="S6000"   
    			extra:choice.caption='S6000 CPU 6000 Mhz (2090 EUR)' 
    			extra:cc.title="The S6000 is a professional model, ideal for the small-medium size business.">
                <implements type="mc:ProfessionalModel"/>
                <field caption='' extra:form.title="" type='HiddenDefaultPrice' name='price' default='2090'/>
            </complexType>
            <complexType name="S7000DL"   
    			extra:choice.caption='S7000 CPU 7000 Mhz (2590 EUR)' 
    			extra:cc.title="The S7000 is a professional server model, ideal for managing the small-medium size business network.">
                <implements type="mc:ServerModel"/>
                <field caption=''  extra:form.title="" type='HiddenDefaultPrice' name='price' default='2590'/>
            </complexType>
            <complexType name="MultimediaModel" extra:cc.title="This is an entry model, ideal for home and multimedia use.">
                <implements type="mc:TwoCoolersModel"/>
                <implements type="mc:HD100or200"/>
                <implements type="mc:SuperGraphicCardEnabled"/>
            </complexType>
            <complexType name="ProfessionalModel" extra:cc.title="This ">
                <implements type="mc:ThreeCoolersModel"/>
                <implements type="mc:HD100or200"/>
                <implements type="mc:NormalGraphicCardEnabled"/>
            </complexType>
            <complexType name="ServerModel" extra:cc.title="This is a server model.">
                <implements type="mc:ThreeCoolersModel"/>
                <implements type="mc:HD200or500or800"/>
                <implements type="mc:NormalGraphicCardEnabled"/>
            </complexType>
            <complexType name="ModelColor" extra:form.xtitle="">
                <choice name="ColorChoice" caption="Please, choose one of the following colors for your computer:" 
    				extra:choice.inline='true'
    				extra:choice.autosubmit='true' >
                    <field name="BLACK" default='0' type='HiddenDefaultPrice' caption='Black'/>
                    <field name="RED" default='0' type='HiddenDefaultPrice' caption='Red'/>
                    <field name="YELLOW" default='-15' type='HiddenDefaultPrice' caption='Yellow (-15 EUR)'/>
                </choice>
            </complexType>
            <complexType name="CD" >
                <choice name="CDChoice" caption="Select your CD or CD/DVD unit"
    				extra:choice.inline='true'
    				extra:choice.autosubmit='true' >
                    <field name="CDRW256" default='0' type='HiddenDefaultPrice' caption='CDRW 256x 128x 64x (0 EUR)'/>
                    <field name="DVDRW" default='20' type='HiddenDefaultPrice' caption='DVD Writer (+20 EUR)'/>
                </choice>
            </complexType>
            <complexType name="HD100or200">
                <choice name='HDChoice' caption="You might select between a 100 or 200 GB hard disk" 
    				extra:choice.inline='true'
    				extra:choice.autosubmit='true'>
                    <field name="HardDisk100GB" default='0' type='HiddenDefaultPrice' caption='100 GB (0 EUR)'/>
                    <field name="HardDisk200GB" default='70' type='HiddenDefaultPrice' caption='200 GB (+70 EUR)'/>
                </choice>
            </complexType>
            <complexType name="HD200or500or800">
                <choice name='HDChoice' caption="You might select between 200, 500 or 800 GB hard disk" 
    				extra:choice.inline='true'
    				extra:choice.autosubmit='true'>
                    <field name="HardDisk200GB" default='0' type='HiddenDefaultPrice' caption='200 GB (0 EUR)'/>
                    <field name="HardDisk500GB" default='170' type='HiddenDefaultPrice' caption='500 GB (+170 EUR)'/>
                    <field name="HardDisk800GB" default='270' type='HiddenDefaultPrice' caption='800 GB (+270 EUR)'/>
                </choice>
            </complexType>
            <complexType name="NormalGraphicCardEnabled">
                <!-- 
    			calling the choice of the card for different models with the same name 
    			(GraphicCardChoice), brings the adv that then we can retrieve the "GraphicCardChoice"
    			of any model indipendently from the complex type names (NormalGraphicCardEnabled, SuperGraphicCardEnabled)
    			associated with that particular model.
    			
    			note: should use fixed, not default, isnt' it ? 
    			otherwise changing input values from page (hacking) change final output
    			-->
                <choice name="GraphicCardChoice" caption="A Graphic card of 128 MB is a good start for a professional model but the administrator might want to play something..." 
    				extra:choice.inline='true'
    				extra:choice.autosubmit='true'>
                    <field name="Standard128MB" default='0' type='HiddenDefaultPrice' caption='Standard 128 MB'/>
                    <field name="Administrator256MB" default='100' type='HiddenDefaultPrice' caption='AdminGraphicCard 256 MB (+100 EUR)'/>
                </choice>
            </complexType>
            <complexType name="SuperGraphicCardEnabled" >
                <choice name="GraphicCardChoice" 
    				caption="A wide choice of graphic cards for your multimedia computer." 
    				extra:choice.inline='true'
    				extra:choice.autosubmit='true'>
                    <field name="Standard256MB" default='0' type='HiddenDefaultPrice' caption='Standard 256 MB DDT (0 EUR)'/>
                    <field name="HydroForceTeHodio512MB" default='30' type='HiddenDefaultPrice' caption='HydroForce TeHodio 512MB DDT Extra Benz (+30 EUR)'/>
                    <field name="Sere1024MB" default='100' type='HiddenDefaultPrice' caption='Serenella 1024MB GHD Unleaded (+100 EUR)'/>
                    <field name="Supr1024MB" default='150' type='HiddenDefaultPrice' caption='Supreme 2048MB GHR Hydrogen (+150 EUR)'/>
                </choice>
            </complexType>
            <complexType name='TwoCoolersModel'>
                <choice name='CoolerChoice' caption="For this model you can select between two coolers" 
    				extra:choice.inline='true'
    				extra:choice.autosubmit='true'>
                    <field name="NormalCooler" default='0' type='HiddenDefaultPrice' caption='Normal cooler (0 EUR)'/>
                    <field name="FreezeCooler" default='20' type='HiddenDefaultPrice' caption='Freeze cooler (+20 EUR)'/>
                </choice>
            </complexType>
            <complexType name='ThreeCoolersModel'>
                <choice name='CoolerChoice' caption="For this model you can select between three coolers" 
    				extra:choice.inline='true'
    				extra:choice.autosubmit='true'>
                    <field name="NormalCooler" default='0' type='HiddenDefaultPrice' caption='Normal cooler (0 EUR)'/>
                    <field name="FreezeCooler" default='20' type='HiddenDefaultPrice' caption='Freeze cooler (+20 EUR)'/>
                    <field name="ExtraPolarCooler" default='50' type='HiddenDefaultPrice' caption='Extra Polar cooler (+50 EUR)'/>
                </choice>
            </complexType>
        </schema>
    
    <schema 
    		name="spy"
    		elementFormDefault="qualified"
    		uri="http://org.eleusoft.com/spy">
            <ns prefix='spy' uri='http://org.eleusoft.com/spy'/>
            <complexType name="ClientInfo"  description='A basic controls-filled structure for getting user info. For validation is generally enough not setting a default value. ' >
                <field name="IP" extra:form.control='com.eleusoft.form.controls.servlet.RemoteAddressControl' extra:form.caption="" />
                <!--
    			<field name="Browser" extra:form.control='com.eleusoft.form.controls.sniffer.BrowserSnifferControl' extra:form.caption="" />
    			-->
                <field name="Lang" extra:form.control='com.eleusoft.form.controls.servlet.UserLanguagesControl' extra:form.caption="" />
                <field name="SecureProtocol" extra:form.control='com.eleusoft.form.controls.servlet.SecureProtocolControl' extra:form.caption="" />
            </complexType>
        </schema>
    </osk>