Storing Complex JDBC Themes in the Database

2-22 Oracle Fusion Middleware Users Guide for Oracle MapViewer jdbc_query theme themes map_request

2.3.2.2 Storing Complex JDBC Themes in the Database

Sometimes the SQL query for a JDBC theme is so complex that you may want to save the query. In such cases, you can define a predefined theme whose definition is stored in the databases USER_SDO_THEMES view, and then include the full SQL query as the content of the features element in the styling rules for that theme. The feature style specified in the features element is then used to render the geometries retrieved using the full query. The base table as defined for such a theme is ignored because the full SQL query already includes a FROM clause. The geometry column defined in the USER_SDO_THEMES view is still needed, and it must be the same as the geometry column selected in the user-supplied SQL query. If you have a label element for a styling rule, the label style specified is used to label the geometries, as long as the query selects a column that contains label text. Example 2–11 is a sample styling_rules element of a predefined theme with a complex SQL query. Example 2–11 Complex Query in a Predefined Theme ?xml version=1.0 standalone=yes? styling_rules rule features style=L.POOR_ROADS asis=true select sdo_lrs.clip_geom_segmentgeometry,start_measure,end_measure geometry from select + no_merge use_hasha b a.street_id, name, start_measure, end_measure, geometry from select + no_merge a.street_id, name, geometry from philly_roads a where sdo_filtergeometry,sdo_geometry2002,41124,null, sdo_elem_info_array1,2,1, sdo_ordinate_array?,?,?,?, querytype=window=TRUE a, philly_road_conditions b where condition=POOR and a.street_id = b.street_id features rule styling_rules Even though Example 2–11 is defined as a predefined theme, MapViewer still treats it as a JDBC theme at run time when a user requests a map that includes this theme. As with a normal JDBC theme, MapViewer by default imposes a window filtering process if a query window was included in the map request on top of the SQL query. To override this default behavior and have the supplied query string executed without any modification, specify asis=true in the features element, as shown in Example 2–11 . For information about the asis attribute, see Section 3.2.9 .

2.3.3 Image Themes