2. Configurable processors

Some processors can be configured to fit the needs of the user. In case of a login processor the configuration could contain the information that the processor needs to connect to a remote LDAP server. This information could also be passed as an input parameter, but the configuration has some significant advantages:

Let’s have a look at a configurable processor that is one of the core processors of Projector: The template processor. The template processor is used to fill dynamic content into static documents like web pages, page fragments or XML documents.

Figure 3.2. Template Processor

Template Processor

The template processor gets configured with the template that is stored in the Slide server. When projector first starts up this template is parsed and precompiled so that the dynamic content can be filled in very fast. After parsing the template the processor knows which parameter it requires.

The only output that this processor delivers is the generated document. The only provided state is OK as the template evaluation will never fail. This is because the parameter description will assure that the processor will only be invoked if the necessary dynamic content is provided.