-
Notifications
You must be signed in to change notification settings - Fork 6
Content Importer Concept
java -jar shell-1.0-SNAPSHOT.jar --shell.argument.for.doImport.path={{pathToDirectory}} --shell.argument.for.doImport.importerId={{importerIdName}} --shell.argument.for.doImport.delete.playerState=true
- Folder structure is generated with generate-template-files command
- Import concept works for single Topic only
- Each import mode imports the files from the given directory structure
- For each entity there is one file in json format
- Files are located in nested folders with order like a relation in the database
- Resources are in the folder resources and in the entity-file there is the filename of the file
- delete.playerState=true will delete all game state of all players for this topic! So do not do that on production system!
- update attached import-config.json file for the specific Topic
- run command in shell:
generate-template-files /path/to/import-config.json
Folder structure will be created in the same directory as import-config.json in folder named "generated", like in the image below
In the shell write commands like in the example below.
Important: run commands in the same order like in the example
Adding missing relations to the files:
- topic: update "startPage" in topic.json with the relative path to topic.json file
- page transitions: update "to" with the relative path to the next page
- page transitions criteria: update "affectedExercise" or "affectedPage" with the relative path to the affectedExercise or affectedPage
- run:
do-import {/path/to/folder}/generated name_of_the_hidden_folder
- hidden folder will be created with the provided name
- entities will be inserted in DB and IDs of them will be written in the related json files in the hidden folder.
- IMPORTANT: running same command again will trigger update.
At this point all entities should be inserted in the database! After this point:
- running the same command will trigger UPDATE
- for OVERRIDE run:
do-import {/path/to/folder}/generated name_of_the_hidden_folder true
- Title
- Icon
- StartPageID
- ....
- Title
- Icon
- ...
- Title
- Icon
- ...
A page file contains everything related to the page, except the page transitions
The file contains:
- information about the page
- Components (including Exercise)
- Chapter ID
- ...
A pageTransition file contains everything related to the pageTransition
The file contains:
- fromPage
- toPage
- Criteria with PageID or ExerciseID
- ...