Below you will find some fragments regarding the system architecture of Kitodo.production.
This data type is used for communication with database. There are defined two abstract classes: BaseBean and BaseIndexedBean BaseBean is extended by entities which are stored only in database and by abstract BaseIndexedBean. All beans classes which are stored both in database and index extend BaseIndexedBean class.
This data type is used for communication with ElasticSearch index. All type classes extend BaseType class. Type classes produce JSON objects which are converted to HTTP entities and in that form send to the ES server.
Data Transfer Object
This data type is used for communication with frontend. All DTO classes extend BaseDTO class. Only indexed objects have DTO classes (indexed - beans which extend BaseIndexedBean). Data used for them is extracted from JSON objects returned as search results from ES index. All attributes are set up in data service classes (e.g. ProcessService).
Modification of data
Scenario: New column to database was inserted.
- Add new attribute to Entity class (XxxxBean) with get/set methods.
- Write flyway migration.
- Add new JSON key in createDocument method of XxxxType class.
- Adjust test for this method.
- Update mapping for ElasticSearch index.
- Add new attribute to DTO class (XxxxDTO) with get/set methods.
- Add usage of the setter in method convertJSONObjectToDTO of XxxxService class. 8 Update frontend page with usage of the new attribute.
- Run application and recreate index (drop mapping, create new mapping, reindex data).
FileManagementInterface is used for file management. It contains two methods: retrieve it takes a file path and returns the file to which this path has pointed. save it takes a file and saves it to the given path and it returns a boolean if saving was successful or not.