The initial setup is more complicated than duplicating the template project since it needs to link together multiple services offered by different vendors. For more details about service choices one can consult the web page of the XMLPaper project: https://github.com/oxygenxml/markupuk-2019-paper.
To make the setup more intuitive XMLPaper uses a setup tool that takes care of connecting various services. This setup tool is part of the same suite as the build service and web hosting service. To make other services cooperate, the steps below are performed:
The setup tool uses OAuth to ask the authors for permission to create and manage a Git repository in their account starting from the project template.
The setup tool registers a Git hook to trigger the build service whenever a commit is pushed. It also registers an SSH key so that it can fetch the repository contents to perform the build. Each build job will have the URL of the Git repository as an environment variable.
The build service runs a script found in the project that uses the URL of the Git repository to create back links to open the source of the paper either directly or in the web editor.
When the web editor is opened for the first time, it uses OAuth to request the user's permission to read and commit files in the Git repository when the author opens or saves the paper in the editor.
Note | |
---|---|
Some of the services require the author to create an user account. In our case, the user has to create an account with a Git repository hosting service and another account for the build service, setup tool, and web hosting service. The user account creation usually happens as an interstitial step and only if the user does not already have an account. |
In our case, the services are either part of the same bundle like the build service and web hosting service or are connected using OAuth. Other services use personal access tokens to allow applications access their API. In this case, the user should be guided to generate one and give it to the setup tool.