Choosing (or conforming to) a Schema
The first step to getting information into the MDS4 is to decide which
information you would like to have published. Since the data is in
XML format, you should choose (or pick) the schema that you'd like the
data to conform to. This generally means coming up with element names
and types and creating some mapping of the data you're about to
retrieve from your non web-service based application before putting it
in to the MDS4. For this example, I'm going to choose this very
simple format for the data:
<fortuneInformation>
<fortuneData>
... here is the fortune ...
</fortuneData>
<fortuneDateAndTime>
... date and time of retrieval ...
</fortuneDateAndTime>
<fortuneSourceURL>
... the URL of where the fortune was retrieved ...
</fortuneSourceURL>
</fortuneInformation>
As you can see, that format is very simple. An example output will
look like this:
<fortuneInformation>
<fortuneData>
186,282 miles per second: It isn't just a good idea, it's the law!
</fortuneData>
<fortuneDateAndTime>
Thu Jul 14 18:16:01 CDT 2005
</fortuneDateAndTime>
<fortuneSourceURL>
http://anduin.eldar.org/cgi-bin/fortune.pl?text_format=yes
</fortuneSourceURL>
</fortuneInformation>
Once you've chosen how to represent your data in XML format, you can
start thinking about how you're going to retrieve and prepare that
data for publication.
Enabling The Provider
Now that we have the information provider written, the next step is to
enable it so that we can test it. To do this you will need to do
three things. First, come up with a short name (i.e. a mapping) that
can be used to reference your provider, second, copy your provider to
the location where it is expected to be found, and finally, register
it to the Index Service with the parameters you'd like.
Enabling The Provider: Step 1
To establish the mapping of your provider, you need to edit the
$GLOBUS_LOCATION/etc/globus_wsrf_mds_index/jndi-config.xml file.
You should see an executableMappings section that looks
something like this:
<parameter>
<name>executableMappings</name>
<value>
aggr-test=aggregator-exec-test.sh,
pingexec=example-ping-exec
</value>
</parameter>
To add our fortune_script.sh file, let's decide that we're call
it the
fortuneProvider as the mapped name. Our entry would then look
like this:
fortuneProvider=fortune_script.sh
With that line added, the entire entry should look like this (note
that an extra comma had to be added before our new entry):
<parameter>
<name>executableMappings</name>
<value>
aggr-test=aggregator-exec-test.sh,
pingexec=example-ping-exec,
fortuneProvider=fortune_script.sh
</value>
</parameter>
NOTE: The reason we are required to establish this mapping in
the first place is for security reasons. The execution aggregator
source references this mapping when it's registered, rather than a
full path name to a script to avoid allowing arbitrary registrations
to be made that can execute arbitrary code. Requiring this mapping be
configured before starting the globus container guarantees that the
system administrator of the deployment has approved of the use of the
new provider.
Enabling The Provider: Step 2
To make sure your provider is in the expected place, it MUST be
copied to the $GLOBUS_LOCATION/libexec/aggrexec directory.
Notice how the full path of the script was not specified in the above
example when making the mapping. That's because the path of
$GLOBUS_LOCATION/libexec/aggrexec is simply assumed and it will be
pre-pended at run-time for you. Make sure your file resides in this
directory with proper executable permissions.
Check the listing to make sure:
neillm@glob ~ $ ls -al $GLOBUS_LOCATION/libexec/aggrexec/
total 12
drwxr-xr-x 2 neillm wheel 4096 Jul 16 14:01 .
drwxr-xr-x 6 neillm wheel 4096 Jul 8 14:52 ..
-rwxr-xr-x 1 neillm wheel 345 Jul 8 14:52 aggregator-exec-test.sh
-rwxr-xr-x 1 neillm wheel 1947 Jul 16 13:52 fortune_script.sh
Enabling The Provider: Step 3
So now that we've completed the first two steps of enabling the
provider, we only have left to decide on the final details of how to
make the registration to the Index Service.
To do this, you'll need a registration file. There are many types of
registrations that can possibly occur, due to the flexibility of the
Aggregator Framework. You can view several examples in the
$GLOBUS_LOCATION/etc/globus_wsrf_mds_aggregator/example-aggregator-registration.xml
file.
For this example, we'll simply use the custom fortune registration