Download Pelican User Guide

Transcript
4.8 Configuration Files
51
<pipeline>
<modules>
<Module1>
<parameter value="1"/>
<import nodeset="set1"/>
</Module1>
<Module2>
<import nodeset="set1"/>
<parameter value="2"/>
</Module2>
</modules>
</pipeline>
<nodesets>
<nodeset name="set1">
<common1 value="first common parameter"/>
<common2 value="second common parameter"/>
</nodeset>
</nodesets>
The preprocessor will transform this into the following XML:
<pipeline>
<modules>
<Module1>
<parameter value="1"/>
<!--% Imported nodeset set1-->
<common1 value="first common parameter"/>
<common2 value="second common parameter"/>
</Module1>
<Module2>
<parameter value="2"/>
<!--% Imported nodeset set1-->
<common1 value="first common parameter"/>
<common2 value="second common parameter"/>
</Module2>
</modules>
</pipeline>
<nodesets>
<nodeset name="set1">
<common1 value="first common parameter"/>
<common2 value="second common parameter"/>
</nodeset>
</nodesets>
4.8.3.2
Importing Files
It is possible to import all the child nodes under the root node of a document in another file.
To do this, use the import file="[file name]" tag. If not an absolute path, the file name must be relative
to the current working directory.
4.8.3.3
Importing Remote Files
The import url="[address]" tag is not currently implemented, but is reserved for future use.
4.8.4
Obtaining Configuration Data
Objects that are configurable (which are currently pipeline modules, adapters, chunkers and data clients) can obtain
their settings using convenience methods on the ConfigNode object passed to them in their constructors.
To get the text for a single option, call ConfigNode::getOption() with the tag name and attribute name. The method
returns a QString containing the required data.
For example, a module might have this configuration XML in the modules section:
Generated on Tue Jan 22 2013 11:07:31 for Pelican User Guide by Doxygen