This chapter describes BEA Aqualogic Data Services Platform Source View. It includes the following topics:
The underlying XQuery source of a data service typically:
In addition, data services created from physical data sources contain metadata related to the physical sources. For example, data services based on relational data describe the XML field type (such as xs:string), the xpath, native size, native type, null-ability setting and so forth.
In developing data services there are many occasions when it is more convenient or necessary to modifying source.
There are times when it may be preferable to develop or troubleshoot data services by working directly in source. The Source View tab allows you to directly edit data service source code, as well as schemas. Changes to source are immediately reflected in other data service modes such as the XQuery Editor; similarly, source is immediately updated when changes are made through the XQuery Editor View or Design View.
AquaLogic Data Services Platform supports the XQuery language as specified in XQuery 1.0: An XML Query Language, W3C Working Draft of July, 23, 2004. You can use any feature of the language described by the specification.
AquaLogic Data Services Platform supplements the base XQuery syntax with a set of elements and directives that appear in Source View as pragmas. Pragmas are a standard XQuery feature that give implementors and vendors a way to include custom elements and directives within XQuery code.
The BEA implementation of XQuery also contains some extensions to the language and additional functions. BEA extensions to XQuery and links to W3C documentation are described in the AquaLogic Data Services Platform XQuery Developer's Guide.
You can view a file in Source View by clicking the Source View tab. To open Source View to a particular query function, first select the function from Design View or XQuery Editor View, then click the Source View tab.
You can search for specific text strings in Source View using is open you can access file search using WebLogic Workshop's Edit Find command option or <Ctrl-f>. Complete search and replace facilities are available including specifying case, whole words only, wildcard search patterns, and limited search. You also have the option to mark all occurrences of found strings.
Found items are highlighted in yellow. This makes it easy to trace the use of variables, for example.
As a convenience you can quickly navigate to the data service represented by a particular function by clicking Ctrl while holding your mouse over a particular function call such as:
for $fk in f3:ADDRESS()
If you click the pop-up which repeats the function name, the data service that contains that function will open to that function.
WebLogic Workshop contains a rich code editing environment.
XQuery documents in Source View are color-coded to highlight the various elements of the source code. By default keywords are blue and bold, comments (including pragmas) are colored grey, and variables are colored magenta.
You can customize color coding through the Preferences dialog (Tools Preferences).
If you know the namespace prefix, you can activate the function-completion mechanism.
Function completion is invoked when you type a namespace prefix followed by a colon. The namespace prefix should be bound to a URI corresponding to a data service or XFL file. Alternatively, you can type the prefix followed by a colon followed by Ctrl-Space.
The function-completion facility can also be used to complete Xpath expressions:
Syntax errors that occur in source either as a result of editing or as a result of changes made in the XQuery Editor are flagged on Source View scroll bar (Figure 8-6). Clicking on the error mark takes the cursor to that line of code.
The actual code in question is underlined in red. Mouse-over the text to see the complete error message.
For additional information on editing the WebLogic Workshop properties configuration file see:
If you would like Source View to provide code completion and error highlighting for additional classes, you can edit the
Workshop.properties file to add class files or JAR files to the paths.classPath property, then restart WebLogic Workshop.