Skip to content

Commit 998dd85

Browse files
committed
Add basic flow and overview of some classes
1 parent de00e39 commit 998dd85

File tree

1 file changed

+58
-3
lines changed

1 file changed

+58
-3
lines changed

CONTRIBUTING.md

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ GitHub, clone, and develop on a branch. Steps:
6363
5. Follow [these instructions](https://help.github.com/articles/creating-a-pull-request-from-a-fork)
6464
to create a pull request from your fork.
6565

66+
### Running the Application and Tests
67+
See [README.md](README.md) for details on running the application with dependencies.
68+
The tests can be run using the standard `mvn test` command.
69+
6670
### Code Structure and Dependencies
6771
This project uses the [Maven standard directory layout](https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html)
6872
and is a [Model-view-controller](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller)
@@ -81,6 +85,57 @@ The application also uses a triple store to keep the RDF representing
8185
workflows (gathered from [cwltool](https://github.com/common-workflow-language/cwltool)'s
8286
`--print-rdf` functionality).
8387

84-
See [README.md](README.md) for details on running the application with dependencies.
85-
The tests can be run using the standard `mvn test` command.
86-
88+
In general, the controller classes call services which have the main logic for
89+
the application. These controllers are:
90+
* `PageController` - handles basic static pages such as the index and documentation
91+
* `workflow.WorkflowController` - the main controller class for the application
92+
* `workflow.WorkflowJSONController` - handles API functionality
93+
* `workflow.PermalinkController` - handles permalinks with content negotiation for
94+
retrieving different formats
95+
96+
Notable services include
97+
* `workflow.WorkflowService` - Handles workflow related functionality
98+
* `researchobject.ROBundleService` - Creates research object bundles
99+
* `graphviz.GraphVizService` - A wrapper for `com.github.jabbalaci.graphviz.GraphViz`
100+
to generate images from DOT source code
101+
* `git.GitService` - Builds on JGit to provide Git functionality
102+
* `cwl.CWLService` - Implements parsing of cwl files
103+
104+
Note: For the async operations, Spring does not support the calling of a method within
105+
the same class (as a proxy needs to kick in to spawn a new thread). For this reason
106+
some extra classes such as `researchobject.ROBundleFactory` and `cwl.CWLToolRunner`
107+
are used when they would otherwise not be required.
108+
109+
### Basic Application Flow
110+
111+
1. User fills in the form on the front page. This is represented by
112+
`workflow.WorkflowForm` and consists of just a URL to Github/Gitlab,
113+
or a URL to a git repository as well as the branch and path of a
114+
workflow within the repository.
115+
116+
2. This is submitted and picked up by a method in `workflow.WorkflowController`.
117+
The form is validated and parsed by `workflow.WorkflowFormValidator` to
118+
produce a `git.GitDetails` object with a repository URL, branch and path.
119+
The MongoDB database is checked for already pending `workflow.QueuedWorkflow` or
120+
created `workflow.Workflow` objects based on this (but this flow assumes they do
121+
not already exist).
122+
123+
3. A new `workflow.QueuedWorkflow` object is created by cloning the repository
124+
locally (if it does not already exist), checking out the new branch and parsing
125+
the file using built-in YAML parsing code. Intermediate visualisations and
126+
models are produced which may not yet be complete.
127+
128+
4. [cwltool](https://github.com/common-workflow-language/cwltool) is run on the
129+
workflow using the `--print-rdf` option to produce the RDF representation. The RDF
130+
will be stored in the SPARQL store and queries will extract the information
131+
required. Afterwards this is used to construct a Research Object Bundle for the workflow.
132+
This is an asynchronous operation so meanwhile...
133+
134+
5. The user is redirected to the main workflow page, which will use the `loading`
135+
template for now until cwltool has finished running. The background is the intermediate
136+
visualisation. An AJAX call repeatedly checks the status of cwltool saved in the
137+
`workflow.QueuedWorkflow` object in MongoDB.
138+
139+
6. The page either displays an error on the loading page or reloads to view the
140+
parsed workflow on the `workflow` template. An AJAX call checks if the Research Object
141+
Bundle has been created and adds it to the page when it has.

0 commit comments

Comments
 (0)