App dissection
Contents
This chapter covers the anatomy of the application.
Collector basics
A collector typically consists of the following items
- Document type(s)
-
For pre-defined indexing of different types of data
- Task
-
Which is the code that actually performs the job (and can be scheduled)
- Form
-
To enable configuration of a collector (on a per collection basis)
Let’s dive into the details.
App structure
In your project folder, you should find a file structure looking like this:
Application file structure:
src/
main/
resources/
assets/ (1)
tasks/ (2)
collectors.json (3)
documentTypes.json (4)
build.gradle (5)
gradle.properties (6)
webpack.config.babel.js (7)
1 | JavaScript assets for the collector form goes here |
2 | The code which will perform the actual work goes here |
3 | Declaration of collectors in the app |
4 | Location of document types bundled with the collector |
5 | Enonic app dependencies |
6 | App settings and name |
7 | JS build file |
build.gradle
The main purpose of this file is to ensure you have the proper dependency setup. The essential part is using the right version of lib-explorer
Ensure you are using a version of lib-explorer that is supported by your version of Explorer. |
build.gradle
...
include 'com.enonic.lib:lib-explorer:4.0.0'
...
Next up we dive into Managed document types.