Administrators can create a postprocessing plug-in to add
postprocessing capabilities at the deployment level for all of the
users in your organization, instead of coded into each individual
document specification. For example, you could add postprocessing
capabilities such as copying, archiving or renaming output files,
emailing the results or uploading generated documents to a server.
About this task
- The postprocessors cannot modify the results list and will throw
an exception if a modification attempt is made. While the processors
cannot add or remove results from the list, they can change the path
for any of the results.
- Rational® Publishing Engine creates
the post processors only once for the first document generation and
will use those instances for the entire document generation.
- If the post processors are used outside an Eclipse context (in
the RPE Web Service or a custom Java™ application),
they cannot have embedded .jar files and all their dependencies must
already be in their parent class path.
Procedure
To create a new plug-in for postprocessing and deploy
it into the client:
- Create a new plug-in project.
- Add a new extension where the extension point should be:
RRDGPostProcessor.
- Provide a ID and name for the new extension. For
example, if the new extension is called PostProcessor1,
an entry similar to this should appear in your plugin.xml file:
<extension id="PostProcessor1" name="PostProcessor1" point="com.ibm.rational.rrdg.RRDGPostProcessor">
<RRDGPostProcessor class="com.ibm.rational.rpe.postprocessor.PostProcessor1">
</RRDGPostProcessor>
</extension>
- Create a PostProcessor1 class with the following code:
public class PostProcessor1 implements IPostProcessor
{
@Override
public void processResults(List <RPEResult> results)
{
//All the code for processing results should go here.
}
}
- The code for processing results should be added to the
PostProcessor1.processResults method.
- Compile the plug-in and package as a .jar file.
- For local document generation, place the packaged .jar
file into the <RPE_installdir>/launcher/plugins folder
and it should be loaded when Launcher starts. For Document Studio,
add the .jar file to the <RPE_installdir>/studio/plugins folder.
- For Remote services, add the packaged .jar file to the <RPE_installdir>/webapps/WEB-INF/lib/plugins folder.
If the plugins folder does not exist, then create the folder manually.