Package com.logicaldoc.core.document

# Class DocumentInitializer

java.lang.Object
com.logicaldoc.core.metadata.initialization.Initializer
com.logicaldoc.core.document.DocumentInitializer

All Implemented Interfaces:
  `DocumentListener`

public class DocumentInitializer extends Initializer implements DocumentListener
This listener takes care of initializing the metadata of a document.

Since:
  8.8.2
Author:
  Marco Meschieri - LogicalDOC

## Constructor Summary

Constructors
Constructor
Description
`DocumentInitializer()`

## Method Summary

Modifier and Type
Method
Description
`void`
`afterCheckin(Document document, DocumentHistory transaction, Map<String,Object> dictionary)`
Called after a document is checked in
`void`
`afterFileStore(Document document, DocumentHistory transaction, Map<String,Object> dictionary)`
Called after a document's file gets stored after a creation or checkin.
`void`
`afterSaveHistory(Document document, DocumentHistory event, Map<String,Object> dictionary)`
Called after an event has been stored
`void`
`afterStore(Document document, DocumentHistory transaction, Map<String,Object> dictionary)`
Called after a document is stored in the database
`void`
`beforeCheckin(Document document, DocumentHistory transaction, Map<String,Object> dictionary)`
Called before a document is checked in
`void`
`beforeStore(Document document, DocumentHistory transaction, Map<String,Object> dictionary)`
Called before a document is stored in the database

### Methods inherited from class com.logicaldoc.core.metadata.initialization.Initializer

`initialize`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DocumentInitializer

public DocumentInitializer()

## Method Details

### beforeStore

public void beforeStore(Document document, DocumentHistory transaction, Map<String,Object> dictionary) throws PersistenceException
Description copied from interface: `DocumentListener`
Called before a document is stored in the database

Specified by:
  `beforeStore` in interface `DocumentListener`
Parameters:
  `document` - The document to be stored
  `transaction` - Transaction informations
  `dictionary` - Dictionary of the execution pipeline
Throws:
  `PersistenceException` - raised if something went wrong

### beforeCheckin

public void beforeCheckin(Document document, DocumentHistory transaction, Map<String,Object> dictionary) throws PersistenceException
Description copied from interface: `DocumentListener`
Called before a document is checked in

Specified by:
  `beforeCheckin` in interface `DocumentListener`
Parameters:
  `document` - The document to be checked in
  `transaction` - Transaction informations
  `dictionary` - Dictionary of the execution pipeline
Throws:
  `PersistenceException` - raised if something went wrong

### afterStore

public void afterStore(Document document, DocumentHistory transaction, Map<String,Object> dictionary) throws PersistenceException
Description copied from interface: `DocumentListener`
Called after a document is stored in the database

Specified by:
  `afterStore` in interface `DocumentListener`
Parameters:
  `document` - The document to be stored
  `transaction` - Transaction informations
  `dictionary` - Dictionary of the execution pipeline
Throws:
  `PersistenceException` - raised if something went wrong

### afterCheckin

public void afterCheckin(Document document, DocumentHistory transaction, Map<String,Object> dictionary) throws PersistenceException
Description copied from interface: `DocumentListener`
Called after a document is checked in

Specified by:
  `afterCheckin` in interface `DocumentListener`
Parameters:
  `document` - The document to be checked in
  `transaction` - Transaction informations
  `dictionary` - Dictionary of the execution pipeline
Throws:
  `PersistenceException` - raised if something went wrong

### afterSaveHistory

public void afterSaveHistory(Document document, DocumentHistory event, Map<String,Object> dictionary) throws PersistenceException
Description copied from interface: `DocumentListener`
Called after an event has been stored

Specified by:
  `afterSaveHistory` in interface `DocumentListener`
Parameters:
  `document` - The document the event is relative to
  `event` - The saved event
  `dictionary` - Dictionary of the execution pipeline
Throws:
  `PersistenceException` - raised if something went wrong

### afterFileStore

public void afterFileStore(Document document, DocumentHistory transaction, Map<String,Object> dictionary) throws PersistenceException
Description copied from interface: `DocumentListener`
Called after a document's file gets stored after a creation or checkin.

Specified by:
  `afterFileStore` in interface `DocumentListener`
Parameters:
  `document` - The document to be stored
  `transaction` - Transaction informations
  `dictionary` - Dictionary of the execution pipeline
Throws:
  `PersistenceException` - raised if something went wrong