Creating Processor .properties Files
The processors executed by the default
EscenicStandardFilterChain
are defined in a
system file called StandardFilter.properties
,
which looks something like this:
$class com.escenic.presentation.servlet.LooseFilterChain ## config.1xx -- reserved for third parties ## config.2xx -- reserved for escenic core resolver filters config.210 = ./PublicationResolverConfig config.220 = ./SectionResolverConfig config.230 = ./ArticleResolverConfig ## config.3xx -- reserved for third parties ## config.4xx -- reserved for escenic core presentation filters config.400 = ./PresentationConfig ## config.5xx -- reserved for third parties ## config.6xx -- reserved for escenic core authentication and authorization filters config.600 = ./PreviewConfig config.601 = ./AgreementConfig # config.7xx -- reserved for third parties # config.8xx -- reserved for escenic core dispatcher filters config.800 = ./TemplateDispatchConfig # config.9xx -- reserved for third parties after # dispatching in case we didn't dispatch!
This file specifies the names of a series of configuration files,
which in turn identify and configure the classes implementing the
processors in the chain. The file
PublicationResolverConfig.properties
, for
example, looks like this:
$class = com.escenic.presentation.servlet.LooseFilterChain$FilterChainConfigBuilder filterName = PublicationResolver filter = ./PublicationResolverFilter # must be an absolute path initParameter.processorName = /com/escenic/servlet/PublicationResolverProcessor
The other files that are involved in configuring the
PublicationResolverProcessor
are:
PublicationResolverFilter.properties
-
which contains the following:
$class = com.escenic.presentation.servlet.ProcessorFilter
PublicationResolverProcessor.properties
-
which contains the following:
$class = com.escenic.presentation.servlet.PublicationResolverProcessor publicationName = ${/defaults.publication-name}
As you can see, the last of these files contains a reference to the
class which actually implements the processor,
com.escenic.presentation.servlet.PublicationResolverProcessor
.
In order to insert your own processor into the default chain, you
need to create a corresponding set of files of your own. If, for
example, you have created a processor class called
com.mycompany.mysterious.MysteriousProcessor
, and
you want to insert it into the processor chain immediately after the
standard ArticleResolver
processor, then you
would need to create the following files:
StandardFilter.properties
-
which should contain something like:
config.310 = /com/mycompany/mysterious/MysteriousProcessorConfig
This file is merged with the system
StandardFilter.properties
file by the Content Store. The parameter nameconfig.310
ensures that the processor is executed after theArticleResolver
processor (at slot 230) and before thePresentationProcessor
(at slot 400). It is also within the 300-399, which is reserved for use by third-party developers. You should only use slots in these third-party ranges, because then you are sure that your processor will not come into conflict with any standard processor added in later versions of the Content Store. MysteriousProcessorConfig.properties
-
which should contain something like:
$class = com.escenic.presentation.servlet.LooseFilterChain$FilterChainConfigBuilder filterName = Mysterious filter = ./MysteriousFilter # must be an absolute path initParameter.processorName = /com/mycompany/mysterious/MysteriousProcessor
This file has a standard structure and contents. The parts that change from processor to processor are highlighted in bold.
MysteriousFilter.properties
-
which must contain the following line:
$class = com.escenic.presentation.servlet.ProcessorFilter
This file always has exactly the same contents. Its name must match the name specified with the filter parameter in the
MysteriousProcessorConfig.properties
file. MysteriousProcessor.properties
-
which must at least contain the following line:
$class = com.mycompany.mysterious.MysteriousProcessor
If your processor has configuration parameters, then the file can also contain settings for these parameters, for example:
$class = com.mycompany.mysterious.MysteriousProcessor theAnswer = 42