#80 Parse entries into a flexible data format

Closed
fynngodau wants to merge 0 commits from fynngodau/entries into fynngodau/master

So far, entries were parsed into the four categories affectedClass, lesson, teacher and info. This was because when I designed the first parser (which was Untis4, by the way), I only knew one substitution plan system, which was my own, which only contains these four columns.

As I learned about other Untis systems, I re-developed the Untis parser to flexibly merge the different columns into these four (this system was later abstracted to Untis' superclass FlexibleReader). This system worked, but it dropped data that couldn't be exposed to the user anymore as it was already omitted at the parsing step.

That's why I have changed the way the Entry class stores its data. It uses an enum called TableColumns (UNDEFINED, CLASS, SUBJECT, LESSON, TYPE, TEACHER, ROOM, OLD_SUBJECT, OLD_TEACHER, OLD_CLASS, OLD_TIME, INFO) to store all possible columns (new columns can easily be added to this file) and an EnumMap to assign Strings to a TableColumns object.

I plan to write documentation about how one can write their own Reader. #64

Additionally, I added a subclass of Entry called InfoEntry which is used to store entries that contain general information as well as a subclass of InfoEntry called ErrorEntry to display parsing errors.

The CompatEntry class provides access to the same data format as previously (affectedClass, lesson, teacher, info). It is marked as @Deprecated, but it is currently in use in every place where entries are actually displayed.

The UI remains unchanged so far, however, with these changes it would be possible to develop a popup displaying every column that a row contains instead of just the information that CompatEntry exposes. It is also imaginable to let users configure the information that the main screen shows.

If you have time, could you please:

  • Test whether plans are parsed as previously.
  • Test whether filters work as previously¹.
  • Look for other bugs.
  • Review the code.

Feedback is very welcome. Thank you!


¹ Filter "class appears" now matches CLASS as well as OLD_CLASS instaed of just affectedClass; filter "teacher appears" now matches TEACHER, OLD_TEACHER and INFO instead of just teacher and info; filter "course appears" now matches CLASS, OLD_CLASS and INFO instead of affectedClass and info, and as I'm typing this, I'm noticing it should match SUBJECT as well. #65 The difference is that OLD_* was previously only displayed if the non-old version was not filled.

So far, entries were parsed into the four categories `affectedClass`, `lesson`, `teacher` and `info`. This was because when I designed the first parser (which was `Untis4`, by the way), I only knew one substitution plan system, which was my own, which only contains these four columns. As I learned about other Untis systems, I re-developed the `Untis` parser to flexibly merge the different columns into these four (this system was later abstracted to `Untis`' superclass `FlexibleReader`). This system worked, but it dropped data that couldn't be exposed to the user anymore as it was already omitted at the parsing step. That's why I have changed the way the `Entry` class stores its data. It uses an `enum` called [`TableColumns`](https://notabug.org/fynngodau/DSBDirect/src/1fbd90368ce3c8ba128bd3c9551c8e8746e705bf/app/src/main/java/godau/fynn/dsbdirect/table/TableColumn.java) (`UNDEFINED, CLASS, SUBJECT, LESSON, TYPE, TEACHER, ROOM, OLD_SUBJECT, OLD_TEACHER, OLD_CLASS, OLD_TIME, INFO`) to store all possible columns (new columns can easily be added to this file) and an `EnumMap` to assign `String`s to a `TableColumns` object. I plan to write documentation about how one can write their own `Reader`. #64 Additionally, I added a subclass of `Entry` called `InfoEntry` which is used to store entries that contain general information as well as a subclass of `InfoEntry` called `ErrorEntry` to display parsing errors. The `CompatEntry` class provides access to the same data format as previously (`affectedClass`, `lesson`, `teacher`, `info`). It is marked as `@Deprecated`, but it is currently in use in every place where entries are actually displayed. The UI remains unchanged so far, however, with these changes it would be possible to develop a popup displaying every column that a row contains instead of just the information that `CompatEntry` exposes. It is also imaginable to let users configure the information that the main screen shows. If you have time, could you please: * Test whether plans are parsed as previously. * Test whether filters work as previously¹. * Look for other bugs. * Review the code. Feedback is very welcome. Thank you! --- ¹ Filter "class appears" now matches `CLASS` as well as `OLD_CLASS` instaed of just `affectedClass`; filter "teacher appears" now matches `TEACHER`, `OLD_TEACHER` and `INFO` instead of just `teacher` and `info`; filter "course appears" now matches `CLASS`, `OLD_CLASS` and `INFO` instead of `affectedClass` and `info`, and as I'm typing this, I'm noticing it should match `SUBJECT` as well. #65 The difference is that `OLD_*` was previously only displayed if the non-old version was not filled.
fynngodau commented 4 years ago
Owner

As nobody seems to have an opinion on this, I am going to

  • merge the entries branch,
  • publish documentation and
  • merge the recyclerview branch.
As nobody seems to have an opinion on this, I am going to * merge the `entries` branch, * publish documentation and * merge the `recyclerview` branch.
fynngodau referenced this issue from a commit 4 years ago
fynngodau referenced this issue from a commit 4 years ago
Please reopen this pull request to perform merge operation.
Sign in to join this conversation.
No Milestone
No assignee
1 Participants
Loading...
Cancel
Save
There is no content yet.