Skip to content

feat: refactor TextAPI (cf. #50)

Michelle Weidling requested to merge feature/#50-refactor-api into develop

Feature

Summary

This MR moves most of the functionality out of tapi.xqm into separate designated modules. As a result, tapi.xqm mainly contains the RESTXQ endpoints.

In detail, the following modules have been created:

  • tapi-collection.xqm: creating all information necessary for the TextAPI collection endpoint (/collection.json)
  • tapi-manifest.xqm: creating all information necessary for the TextAPI collection endpoint (/manifest.json)
  • tapi-item.xqm: creating all information necessary for the TextAPI collection endpoint (/latest/item.json)
  • tapi-html.xqm: handling the creation of the HTML presentation of a given page (/content/xxxx.html)
  • tapi-txt.xqm: handling the creation of the TXT presentation of a given page (/content/xxxx.txt) which is needed for the collation

All modules have been provided with extensive tests. The module functions and expected parameters aim to be descriptive to such a degree that additional documentation can be kept to a minimum (following Robert Martin's and Martin Fowler's advice).


Furthermore, several testsuites are considered and inspected during the unit_test stage of the CI/CD since every module of the ones mentioned above has its own unit testing module.

Compliance to “Definition of Done”

  • Unit tests passed
  • Code reviewed
  • Acceptance criteria met
  • Functional tests passed
  • Non-Functional requirements met
  • Product Owner accepts the User Story

Use Cases

As a developer, having clean and separate modules speeds up my work, and more tests assure my that everything is working fine.

Documentation

  • I updated the README (if applicable)
  • I provided my functions with appropriate documentation
  • I updated existing documentation

Tests

Are we able to test this new feature?

  • Yes, everything can be done via unit tests

Changelog

  • I added a statement to the CHANGELOG.

Version number

  • I bumped the version number in build.properties.

Related Tickets

#50 (closed), #57 (closed)

/cc Mathias Göbel, Frank Schneider, Michelle Weidling

Edited by Michelle Weidling

Merge request reports