← Back to plugin index

Word Template Password Renderer

Description
Simple password renderer using Aspose.Words to produce a file from a normal Microsoft Word file. Supported document types for the template are: DOC, DOCX, RTF and ODF. The format of the generated file is configurable.

Report Parameters (${...})

The word document may contain parameters as normal text elements that are replaced. Those parameters have the form ${ParamName}.

This renderer also supports arbitrary MessageFormat patterns for all input parameters; for example ${Now,date,short} will effectively be interpreted as MessageFormat {0,date,short} with the single parameter Now from the parameter map. For more information about MessageFormat, please consult the MessageFormat javadoc.

There are two predefined properties that are always added to the parameter map:

  1. ${PlainPassword} contains the plain text password to display
  2. ${Now} contains the current timestamp and can be used for both date and time display. Since this represents a Date object, it can be formatted directly using MessageFormat, for example:
    ${Now,date,short} displays a short date using the user's locale; for example: 09.01.12.
    Alternatively, a date format can be specified in a SimpleDateFormat compatible form, for example:
    ${Now,date,dd.MM.yyyy} resulting in 09.01.2012.

This password renderer allows to pass arbitrary parameters to the conversion engine: the parameter map passed to the renderPassword() method is forwarded to the report engine. Thus, when placing the parameter Salutation with value "Dear Mr. Smith" into the parameter map when calling this renderer, you can display this value in the document using ${Salutation}.

Adding images is also supported by adding an instance of BufferedImage to the parameter map. This image replaces the entire text node where the parameter was found and is inserted as an inline image. Make sure there's enough place for that image in the template document.

Handling Multiple Languages

You can have this renderer use different documents for rendering depending on a language.
There must always be a default template configured which is used if there's no specific template defined for the passed-in language. Additionally you can define a specific template for every language expected.
Templates are read in when the renderer is initialized and are kept in memory by the renderer. Thus, reusing the renderer instance improves efficiency as the document needn't be re-parsed on every call.
Type name
WordTemplatePasswordRenderer
Class
com.airlock.iam.core.misc.util.password.generator.WordTemplatePasswordRenderer
May be used by
Properties
Default Template (defaultTemplate)
Description
Specifies the name of the default Word template file.

Supported formats are: DOC, DOCX, RTF and ODF.

The file name is either absolute or relative to the JVMs current directory.

Multiple templates for different languages can be specified with the property template. There must always be a default template.

Attributes
File/Path
Mandatory
Template (template)
Description
Language dependent templates taking precedence over the default template.
Selectors must be chosen according to the ISO-2-letter language codes, i.e. "fr" for french.
See also description of default-template.
Attributes
Plugin-List
Optional
Assignable plugins
Save Options (saveOptions)
Description
Configures the output format and related settings for saving the document in the desired format, e.g. fonts.
Attributes
Plugin-Link
Mandatory
Assignable plugins
YAML Template (with default values)

type: WordTemplatePasswordRenderer
id: WordTemplatePasswordRenderer-xxxxxx
displayName: 
comment: 
properties:
  defaultTemplate:
  saveOptions:
  template: