110 likes | 226 Views
Welcome. STAR TRAINING _______ Next 7 __________________ Advanced requests. Search – Advanced requests. Advanced Requests in practice: Based on Next language and TCL services. SEARCH TAB. Search – Advanced requests. This exercise consists in a location query (= request) on parcels.
E N D
Welcome STAR TRAINING _______ Next 7 __________________ Advanced requests
Search – Advanced requests Advanced Requests in practice: • Based on Next language and TCL services. SEARCH TAB
Search – Advanced requests This exercise consists in a location query (= request) on parcels. To do so, we will use the «PARCELLE» table containing information on cadastral parcels and graphically linked to surfaces. We will build a query that will enable the user to view a parcel, on the basis of its reference. First, let’s have a look at the table: CCOCOM NOT NULL VARCHAR2(5) CCOSEC NOT NULL VARCHAR2(3) DNUPLA NOT NULL VARCHAR2(4) The bold fields are «primary keys» and are used by STAR to construct the links with the graphic data. Note that there is only one sole value for «CCOCOM»: 330
Search – Advanced requests Add a new request • To add a new request, click on «Advanced requests» and «New»
Search – Advanced requests Add a new request • You can create a new request (type in the lines of code in the configurator) or reload an existing enext6 request • Encode the «General Configuration Name» • If you want to reload an enext 6 request, click on «Browse» and select your file from your PC
Search – Advanced requests Add a new request • Click on «Load file» to load your enext 6 request into the configurator
Search – Advanced requests Add a new request • Click on «Confirm» and give the description to save your advanced request
Search – Advanced requests First request (Query with two interdependent lists) PARAM 1 Section string ENUM($WEBDEMO.ListCCOSEC) CHAMP CCOSEC LIKE The value of PARAM 1 (CCOSEC) will be selected in a list. The list will be generated via a TCL script under [JBOSS]/bin/winnext/tcl/WEBDEMO PARAM 2 Parcel_number string ENUM($WEBDEMO.ListDNUPLA&$PARAM1) CHAMP DNUPLA LIKE The value of PARAM 2 (DNUPLA) depends on the value of PARAM 1 and will be selected in a list. The list will be generated via a TCL script under [JBOSS]/bin/winnext/tcl/WEBDEMO MAP GRATENTOUR This means that the query will try to find linked elements in the «GRATENTOUR» map LAYER FO_Parcelle This means that the query will try to find linked elements in the «FO_Parcelle» layer TABLE PARCELLE This means that the table linked to the graphic is named «PARCELLE» MIN_WIDTH 1000 This means that, when the application views the quarter, the minimum width for the graphic window will be 1000 meters SQLINFO YES This means that the selection tab has to be activated just after the location (with attributes information on the Parcel) DISPLAY_ROW OFF PROG APP_find Is the name of the program to run (key expression)
Search – Advanced requests So, your request should look like this: PARAM 1 Section string ENUM($WEBDEMO.ListCCOSEC) CHAMP CCOSEC LIKE PARAM 2 Parcel_number string ENUM($WEBDEMO.ListDNUPLA&$PARAM1) CHAMP DNUPLA LIKE MAP GRATENTOUR LAYER FO_Parcelle TABLE PARCELLE EVIDENCE FIRST MIN_WIDTH 1000 SQLINFO YES DISPLAY_ROW OFF PROG APP_find Connect to the application and try to execute the query (for example, try to locate on B / 0010)
Search – Advanced requests TCL scripts ListCCOSEC.TCL : lists the different « CCOSEC » field values proc WEBDEMO.ListCCOSEC {} { global SERVER_STD set sqlcmd "select distinct CCOSEC from PARCELLE" ServA_SimpleQuery $sqlcmd $SERVER_STD res return [join [split [join $res ,] "{}"] ""] } ListDNUPLA.tcl : lists the different «DNUPLA» values for a specific «CCOSEC» value proc WEBDEMO.ListDNUPLA {ccosec} { global SERVER_STD set sqlcmd "select distinct DNUPLA from PARCELLE where CCOSEC='$ccosec'" ServA_SimpleQuery $sqlcmd $SERVER_STD res return [join [split [join $res ,] "{}"] ""] }
That’s all, folks ! STAR TRAINING _______ Developer __________________ Keep up the good work !