You can use getData tags and process-related service requests
after creating a get-data-config.xml file. The get-data-config.xml
file contains expression builders, each representing a different SQL
query defined in the project's query template file. getData tags
in the storefront JSP files can retrieve specific data from the database
by referencing the appropriate expression builder.
About this task
Complete this task when creating a new service module, where
the configuration file has not been provided for you. If you are changing
the behavior of a service module that is ready for you to use as is,
you must, however, extend
the provided configuration file instead.
Procedure
- Create the get-data-config.xml file for the project.
- Insert your project related expression builders into the
get-data-config.xml file.
Each expression builder has
the following properties:
- The name node uniquely identifies the expression
builder, and is used by getData
tags in the project JSP files when referring to an expression
builder.
- The data-type-name node contains the noun
type returned by this expression builder.
- The expression template node refers to an
XPath query defined in the project query
template file, used to retrieve specific information from the
database. Parameters such as $projectID$ can be
passed to the expression builder by a getData tag.
- Each param node contains a pair of name and value child
nodes that define a parameter passed to the query template file. Each
expression builder is associated with a specific Access Profile. This
Access Profile, together with the defined XPath query, uniquely identifies
a query in the query template file.
Each expression builder should resemble the following
sample structure, replacing the empty nodes with your own project-related
expression builders:
<!-- Project related expression builder 1. -->
<expression-builder>
<name> </name>
<data-type-name> </data-type-name>
<expression-template> </expression-template>
<param>
<name> </name>
<value> </value>
</param>
</expression-builder>
<!-- Project related expression builder 2. -->
<expression-builder>
<name> </name>
<data-type-name> </data-type-name>
<expression-template> </expression-template>
<param>
<name> </name>
<value> </value>
</param>
</expression-builder>
<!-- Project related expression builder 3. -->
<expression-builder>
<name> </name>
<data-type-name> </data-type-name>
<expression-template> </expression-template>
<param>
<name> </name>
<value> </value>
</param>
</expression-builder>
</wcf:get-data-config>
Note: Although there are three expression builders
in the sample expression builder structure, your own project-related
expression builders can contain as many expression builders as needed.
- Deploy your changes using the WebSphere Administrative
Console or the wsadmin tool:
Results
After completing these steps, you have successfully created
a new service module when the configuration file has not been provided
for you.