文書仕様に定義された出力は、
RPEDocumentSpecification.getRuntime().getOutputs() コレクション内で使用可能です。
次の例は、Microsoft Word を除いて、出力のすべてを削除する方法、
出力へのパスの変更方法、および Microsoft Word 出力のスタイル・シートを設定する方法を示します。
List<RPEOutput> toRemove = new ArrayList<RPEOutput>()
for ( RPEOutput output: docspec.getRuntime().getOutputs())
{
String type = PropertyUtils.getPropertyRawValue( output.getProperty( RPEConfigConstants.PROPERTY_TYPE), "");
if ( type.equals( "Word"))
{
Property path = output.getProperty( RPEConfigConstants.PROPERTY_PATH);
Property stylesheet = output.getProperty( RPEConfigConstants.PROPERTY_STYLESHEET);
assert( path != null);
assert( stylesheet != null);
path.setValue( new Value( null, "c:\\test\\output.doc"));
stylesheet.setValue( new Value( null, "c:\\test\\sample_stylesheet.dot"));
}
else
{
toRemove.add( output);
}
}
docspec.getRuntime().getOutputs().removeAll( toRemove);
注: また、
テンプレートを文書仕様に追加することによって、テンプレートから
変数を構成することもできます。