Data Services Developer's Guide
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
This chapter describes BEA Aqualogic Data Services Platform (DSP) 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.
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.
DSP supplements the base XQuery syntax with a set of elements and directives that appear in the 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 Data Services Platform XQuery Developer's Guide.
Figure 8-1 Source View Showing Pragmas, Namespace Declarations, and a Function
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
Found items are highlighted in yellow. This makes it easy to trace the use of variables, for example.
Figure 8-2 Source View Search Dialog Box
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.
Figure 8-3 Color Coding in Source View
You can customize color coding through the Preferences dialog (Tools
When working with Source View you can use WebLogic Workshop function completion feature.
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.
Figure 8-4 Function Completion Using Namespace Prefixes
The function-completion facility can also be used to complete Xpath expressions:
Figure 8-5 XPath Code Completion in Source View
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:
http://download.oracle.com/docs/cd/E13226_01/workshop/docs70/help/reference/configfiles/conWorkshop_propertiesConfigurationFile.html
Figure 8-6 Syntax Errors Are Flagged and Mouse-over Text Provides Details
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.
![]() ![]() |
![]() |
![]() |