Configuring outputs through the Java API

The outputs defined in the document specification are available in the RPEDocumentSpecification.getRuntime().getOutputs() collection.
The example shows how to remove all of the outputs except Microsoft Word, how to change the path for that output, and how to set a style sheet for the Microsoft Word output.
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);
Note: You can also configure the variables from a template as you add the template to the document specification.

Feedback