Ausgaben über die Java-API konfigurieren

Die Ausgaben, die in der Dokumentspezifikation definiert sind, sind in der Sammlung RPEDocumentSpecification.getRuntime().getOutputs() verfügbar.
Das Beispiel zeigt, wie Sie mit Ausnahme der Microsoft-Word-Ausgabe alle Ausgaben entfernen, den Pfad für diese Ausgabe ändern und eine Formatvorlage für die Microsoft-Word-Ausgabe definieren können.
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\\Ausgabe.doc"));
		stylesheet.setValue( new Value( null, "c:\\Test\\Beispielformatvorlage.dot"));
	}
	else
	{
		toRemove.add( output);
	}
}
		
docspec.getRuntime().getOutputs().removeAll( toRemove);
Anmerkung: Sie können die Variablen auch über eine Vorlage konfigurieren, wenn Sie die Vorlage der Dokumentspezifikation hinzufügen.

Feedback